From 799f7809897a7d079ffe8bc2ffe6ff29ac4a1475 Mon Sep 17 00:00:00 2001 From: Kota Sudhakar Reddy <60102891+Kotasudhakarreddy@users.noreply.github.com> Date: Mon, 12 Apr 2021 22:17:39 +0530 Subject: [PATCH 1/7] Generated based on new api-version 2020-12-01 --- .../mgmtmetadata/web_resource-manager.txt | 7 +- .../AzSdk.RP.props | 2 +- .../AppServiceEnvironmentsOperations.cs | 2922 +- ...ServiceEnvironmentsOperationsExtensions.cs | 494 + .../CertificateOrdersDiagnosticsOperations.cs | 687 + ...teOrdersDiagnosticsOperationsExtensions.cs | 189 + .../src/Generated/CertificatesOperations.cs | 11 +- .../CertificatesOperationsExtensions.cs | 16 +- .../src/Generated/DomainsOperations.cs | 8 +- .../Generated/DomainsOperationsExtensions.cs | 16 +- .../src/Generated/GlobalModelOperations.cs | 597 + .../GlobalModelOperationsExtensions.cs | 150 + .../IAppServiceEnvironmentsOperations.cs | 300 + ...ICertificateOrdersDiagnosticsOperations.cs | 126 + .../src/Generated/ICertificatesOperations.cs | 6 +- .../src/Generated/IDomainsOperations.cs | 8 +- .../src/Generated/IGlobalModelOperations.cs | 103 + .../src/Generated/IProviderOperations.cs | 218 +- .../src/Generated/IStaticSitesOperations.cs | 1450 +- .../src/Generated/IWebAppsOperations.cs | 1176 +- .../src/Generated/IWebSiteManagementClient.cs | 34 +- .../Models/AccessControlEntryAction.cs | 60 - .../src/Generated/Models/ApiKVReference.cs | 117 + .../Models/AppInsightsWebAppStackSettings.cs | 69 + .../Models/AppServiceCertificateOrder.cs | 24 +- ...AppServiceCertificateOrderPatchResource.cs | 24 +- .../Generated/Models/AppServiceEnvironment.cs | 278 +- .../AppServiceEnvironmentPatchResource.cs | 279 +- .../Models/AppServiceEnvironmentResource.cs | 279 +- .../src/Generated/Models/AppServicePlan.cs | 20 +- .../Models/AppServicePlanPatchResource.cs | 35 +- .../src/Generated/Models/Apple.cs | 66 + .../src/Generated/Models/AppleRegistration.cs | 60 + .../src/Generated/Models/ApplicationStack.cs | 14 +- .../Models/ApplicationStackResource.cs | 14 +- .../Generated/Models/AppserviceGithubToken.cs | 87 + .../Models/AppserviceGithubTokenRequest.cs | 80 + .../Models/AseV3NetworkingConfiguration.cs | 77 + .../src/Generated/Models/AutoHealTriggers.cs | 20 +- .../Generated/Models/AzureStaticWebApps.cs | 60 + .../Models/AzureStaticWebAppsRegistration.cs | 56 + .../Generated/Models/AzureStorageInfoValue.cs | 5 +- .../src/Generated/Models/AzureStorageState.cs | 8 +- .../src/Generated/Models/BillingMeter.cs | 10 +- .../src/Generated/Models/Certificate.cs | 17 +- .../Models/CertificateOrderContact.cs | 64 + .../Models/CertificatePatchResource.cs | 22 +- .../src/Generated/Models/ClientCertMode.cs | 8 +- .../Generated/Models/ConfigReferenceSource.cs | 54 + .../src/Generated/Models/CsmCopySlotEntity.cs | 93 - .../Generated/Models/CustomDomainStatus.cs | 26 + .../Generated/Models/DataProviderMetadata.cs | 59 + .../src/Generated/Models/DetectorInfo.cs | 80 +- .../src/Generated/Models/DetectorResponse.cs | 31 +- .../src/Generated/Models/DetectorType.cs | 66 + .../Models/FunctionAppMajorVersion.cs | 71 + .../Models/FunctionAppMinorVersion.cs | 69 + .../Models/FunctionAppRuntimeSettings.cs | 193 + .../Generated/Models/FunctionAppRuntimes.cs | 61 + .../src/Generated/Models/FunctionAppStack.cs | 97 + .../Models/GitHubActionCodeConfiguration.cs | 65 + .../Models/GitHubActionConfiguration.cs | 82 + .../GitHubActionContainerConfiguration.cs | 83 + .../Models/GitHubActionWebAppStackSettings.cs | 66 + .../src/Generated/Models/IdentityProviders.cs | 20 +- .../src/Generated/Models/InsightStatus.cs | 78 + .../Models/KeyValuePairStringObject.cs | 52 + .../Models/KubeEnvironmentProfile.cs | 68 + .../Models/LegacyMicrosoftAccount.cs | 72 + .../Models/LinuxJavaContainerSettings.cs | 127 + .../src/Generated/Models/LoadBalancingMode.cs | 2 +- .../Models/NetworkAccessControlEntry.cs | 78 - .../Generated/Models/QueryUtterancesResult.cs | 59 + .../Models/QueryUtterancesResults.cs | 62 + ...tePrivateEndpointConnectionARMResource.cs} | 28 +- .../src/Generated/Models/Rendering.cs | 14 +- .../src/Generated/Models/RenderingType.cs | 128 +- .../src/Generated/Models/ResolveStatus.cs | 114 + .../src/Generated/Models/SampleUtterance.cs | 71 + .../src/Generated/Models/Site.cs | 26 +- .../src/Generated/Models/SiteAuthSettings.cs | 16 +- .../src/Generated/Models/SiteConfig.cs | 139 +- .../Models/SiteConfigPropertiesDictionary.cs | 84 + .../Generated/Models/SiteConfigResource.cs | 139 +- .../src/Generated/Models/SiteLoadBalancing.cs | 8 +- .../src/Generated/Models/SitePatchResource.cs | 26 +- .../src/Generated/Models/SiteSourceControl.cs | 12 +- .../src/Generated/Models/SkuCapacity.cs | 12 +- .../src/Generated/Models/SkuName.cs | 3 + .../Models/SlowRequestsBasedTrigger.cs | 10 +- .../src/Generated/Models/StackMajorVersion.cs | 38 +- .../src/Generated/Models/StackPreferredOs.cs | 60 + .../src/Generated/Models/StampCapacity.cs | 9 +- .../Generated/Models/StaticSiteARMResource.cs | 54 +- .../Models/StaticSiteBuildARMResource.cs | 14 +- .../Models/StaticSiteBuildProperties.cs | 57 +- ...aticSiteCustomDomainOverviewARMResource.cs | 29 +- ...ustomDomainRequestPropertiesARMResource.cs | 62 + .../Models/StaticSitePatchResource.cs | 48 +- .../Models/StaticSiteTemplateOptions.cs | 91 + .../StaticSiteUserProvidedFunctionApp.cs | 83 + ...cSiteUserProvidedFunctionAppARMResource.cs | 83 + .../StaticSiteZipDeploymentARMResource.cs | 96 + .../Models/StaticSitesWorkflowPreview.cs | 69 + .../StaticSitesWorkflowPreviewRequest.cs | 79 + .../src/Generated/Models/Status.cs | 64 + .../Models/StatusCodesBasedTrigger.cs | 10 +- .../Models/StatusCodesRangeBasedTrigger.cs | 75 + .../src/Generated/Models/StringList.cs | 58 + .../src/Generated/Models/SupportTopic.cs | 59 + .../src/Generated/Models/ValidateRequest.cs | 20 +- .../Generated/Models/ValidateResourceTypes.cs | 1 + .../Generated/Models/VirtualNetworkProfile.cs | 16 +- .../src/Generated/Models/VnetParameters.cs | 11 +- .../Models/VnetValidationFailureDetails.cs | 20 +- .../Generated/Models/WebAppMajorVersion.cs | 71 + .../Generated/Models/WebAppMinorVersion.cs | 69 + .../Generated/Models/WebAppRuntimeSettings.cs | 152 + .../src/Generated/Models/WebAppRuntimes.cs | 81 + .../src/Generated/Models/WebAppStack.cs | 96 + .../Models/WindowsJavaContainerSettings.cs | 130 + .../src/Generated/Models/WorkerPool.cs | 91 - .../src/Generated/Models/WorkerSizeOptions.cs | 24 + .../src/Generated/ProviderOperations.cs | 1520 +- .../Generated/ProviderOperationsExtensions.cs | 348 +- .../SdkInfo_WebSiteManagementClient.cs | 76 +- .../src/Generated/StaticSitesOperations.cs | 7199 ++++- .../StaticSitesOperationsExtensions.cs | 2425 +- .../src/Generated/WebAppsOperations.cs | 24739 +++++++++------- .../Generated/WebAppsOperationsExtensions.cs | 2422 +- .../src/Generated/WebSiteManagementClient.cs | 215 +- .../WebSiteManagementClientExtensions.cs | 52 +- ...Microsoft.Azure.Management.Websites.csproj | 4 +- .../src/Properties/AssemblyInfo.cs | 4 +- 134 files changed, 39490 insertions(+), 14451 deletions(-) create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperations.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperationsExtensions.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperations.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperationsExtensions.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificateOrdersDiagnosticsOperations.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IGlobalModelOperations.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AccessControlEntryAction.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConfigReferenceSource.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmCopySlotEntity.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkAccessControlEntry.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs rename sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/{PrivateEndpointConnectionResource.cs => RemotePrivateEndpointConnectionARMResource.cs} (62%) create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPool.cs diff --git a/eng/mgmt/mgmtmetadata/web_resource-manager.txt b/eng/mgmt/mgmtmetadata/web_resource-manager.txt index f3ded863f84d..1cf3b1b74b7c 100644 --- a/eng/mgmt/mgmtmetadata/web_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/web_resource-manager.txt @@ -3,12 +3,11 @@ AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-06 --csharp-sdks-folder=K:\DotNet-SDK\Sep-2020\azure-sdk-for-net\sdk -2020-09-18 04:29:17 UTC +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-12 --csharp-sdks-folder=K:\DotNet-SDK\Apr-2021\azure-sdk-for-net\sdk +2021-04-12 16:08:50 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: 1b04f5fce19cd330dcc0eec11a98e499c0cda50d +Commit: 73d51f188ceba91939355c8e1d4d74dd38173c13 AutoRest information Requested version: v2 -Bootstrapper version: autorest@2.0.4413 diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/AzSdk.RP.props b/sdk/websites/Microsoft.Azure.Management.WebSites/AzSdk.RP.props index a6ad5fd5e9ac..5e8eb9669936 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/AzSdk.RP.props +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/AzSdk.RP.props @@ -1,7 +1,7 @@ - CertificateRegistration_2020-06-01;DomainRegistration_2020-06-01;Web_2020-06-01;Web_2020-06-01;WebSiteManagementClient_2020-06-01; + CertificateRegistration_2020-12-01;DomainRegistration_2020-12-01;Web_2020-12-01;Web_2020-12-01;WebSiteManagementClient_2020-12-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperations.cs index dd3bef96890c..25f1619436c4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperations.cs @@ -1401,10 +1401,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get diagnostic information for an App Service Environment. + /// Get networking configuration of an App Service Environment /// /// - /// Description for Get diagnostic information for an App Service Environment. + /// Description for Get networking configuration of an App Service Environment /// /// /// Name of the resource group to which the resource belongs. @@ -1433,7 +1433,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDiagnosticsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAseV3NetworkingConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1476,11 +1476,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDiagnostics", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAseV3NetworkingConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -1577,7 +1577,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1590,7 +1590,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1610,10 +1610,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get a diagnostics item for an App Service Environment. + /// Update networking configuration of an App Service Environment /// /// - /// Description for Get a diagnostics item for an App Service Environment. + /// Description for Update networking configuration of an App Service + /// Environment /// /// /// Name of the resource group to which the resource belongs. @@ -1621,8 +1622,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the diagnostics item. + /// /// /// /// Headers that will be added to request. @@ -1645,7 +1645,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDiagnosticsItemWithHttpMessagesAsync(string resourceGroupName, string name, string diagnosticsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAseNetworkingConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1670,9 +1670,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (diagnosticsName == null) + if (aseNetworkingConfiguration == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diagnosticsName"); + throw new ValidationException(ValidationRules.CannotBeNull, "aseNetworkingConfiguration"); } if (Client.SubscriptionId == null) { @@ -1691,16 +1691,15 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("diagnosticsName", diagnosticsName); + tracingParameters.Add("aseNetworkingConfiguration", aseNetworkingConfiguration); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticsItem", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAseNetworkingConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{diagnosticsName}", System.Uri.EscapeDataString(diagnosticsName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1714,7 +1713,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1745,6 +1744,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(aseNetworkingConfiguration != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(aseNetworkingConfiguration, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -1795,7 +1800,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1808,7 +1813,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1828,12 +1833,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get the network endpoints of all inbound dependencies of an App Service - /// Environment. + /// Get diagnostic information for an App Service Environment. /// /// - /// Description for Get the network endpoints of all inbound dependencies of an - /// App Service Environment. + /// Description for Get diagnostic information for an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -1862,7 +1865,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetInboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDiagnosticsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1905,11 +1908,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInboundNetworkDependenciesEndpoints", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDiagnostics", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -2006,7 +2009,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2019,7 +2022,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2039,10 +2042,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get all multi-role pools. + /// Get a diagnostics item for an App Service Environment. /// /// - /// Description for Get all multi-role pools. + /// Description for Get a diagnostics item for an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -2050,6 +2053,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Name of the diagnostics item. + /// /// /// Headers that will be added to request. /// @@ -2071,7 +2077,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRolePoolsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDiagnosticsItemWithHttpMessagesAsync(string resourceGroupName, string name, string diagnosticsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2096,6 +2102,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (diagnosticsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "diagnosticsName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2113,14 +2123,16 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("diagnosticsName", diagnosticsName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePools", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticsItem", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{diagnosticsName}", System.Uri.EscapeDataString(diagnosticsName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2215,7 +2227,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2228,7 +2240,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2248,10 +2260,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get properties of a multi-role pool. + /// Get the network endpoints of all inbound dependencies of an App Service + /// Environment. /// /// - /// Description for Get properties of a multi-role pool. + /// Description for Get the network endpoints of all inbound dependencies of an + /// App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -2280,7 +2294,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetInboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2323,11 +2337,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMultiRolePool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInboundNetworkDependenciesEndpoints", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -2424,7 +2438,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2437,7 +2451,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2457,38 +2471,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Create or update a multi-role pool. - /// - /// - /// Description for Create or update a multi-role pool. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Properties of the multi-role pool. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(resourceGroupName, name, multiRolePoolEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Create or update a multi-role pool. + /// Get all multi-role pools. /// /// - /// Description for Create or update a multi-role pool. + /// Description for Get all multi-role pools. /// /// /// Name of the resource group to which the resource belongs. @@ -2496,9 +2482,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Properties of the multi-role pool. - /// /// /// Headers that will be added to request. /// @@ -2520,7 +2503,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRolePoolsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2545,10 +2528,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (multiRolePoolEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "multiRolePoolEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2566,13 +2545,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("multiRolePoolEnvelope", multiRolePoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateMultiRolePool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePools", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -2588,7 +2566,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2619,12 +2597,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(multiRolePoolEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(multiRolePoolEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -2645,7 +2617,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2675,7 +2647,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2688,25 +2660,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2726,12 +2680,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get metric definitions for a specific instance of a multi-role pool of an - /// App Service Environment. + /// Get properties of a multi-role pool. /// /// - /// Description for Get metric definitions for a specific instance of a - /// multi-role pool of an App Service Environment. + /// Description for Get properties of a multi-role pool. /// /// /// Name of the resource group to which the resource belongs. @@ -2739,9 +2691,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the instance in the multi-role pool. - /// /// /// Headers that will be added to request. /// @@ -2763,7 +2712,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRolePoolInstanceMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string instance, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2788,10 +2737,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instance == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instance"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2809,16 +2754,14 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instance", instance); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePoolInstanceMetricDefinitions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMultiRolePool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instance}", System.Uri.EscapeDataString(instance)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2913,7 +2856,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2926,7 +2869,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2946,11 +2889,38 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get metric definitions for a multi-role pool of an App Service Environment. + /// Create or update a multi-role pool. /// /// - /// Description for Get metric definitions for a multi-role pool of an App - /// Service Environment. + /// Description for Create or update a multi-role pool. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Properties of the multi-role pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(resourceGroupName, name, multiRolePoolEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a multi-role pool. + /// + /// + /// Description for Create or update a multi-role pool. /// /// /// Name of the resource group to which the resource belongs. @@ -2958,6 +2928,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Properties of the multi-role pool. + /// /// /// Headers that will be added to request. /// @@ -2979,7 +2952,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRoleMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3004,6 +2977,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (multiRolePoolEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "multiRolePoolEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -3021,12 +2998,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("multiRolePoolEnvelope", multiRolePoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRoleMetricDefinitions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateMultiRolePool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -3042,7 +3020,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3073,6 +3051,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(multiRolePoolEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(multiRolePoolEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -3093,7 +3077,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3123,7 +3107,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3136,7 +3120,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3148,18 +3132,38 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - if (_shouldTrace) + // Deserialize Response + if ((int)_statusCode == 202) { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get available SKUs for scaling a multi-role pool. - /// + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get metric definitions for a specific instance of a multi-role pool of an + /// App Service Environment. + /// /// - /// Description for Get available SKUs for scaling a multi-role pool. + /// Description for Get metric definitions for a specific instance of a + /// multi-role pool of an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -3167,6 +3171,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Name of the instance in the multi-role pool. + /// /// /// Headers that will be added to request. /// @@ -3188,7 +3195,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRolePoolSkusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRolePoolInstanceMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string instance, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3213,6 +3220,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (instance == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instance"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -3230,14 +3241,16 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("instance", instance); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePoolSkus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePoolInstanceMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{instance}", System.Uri.EscapeDataString(instance)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3332,7 +3345,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3345,7 +3358,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3365,11 +3378,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get usage metrics for a multi-role pool of an App Service Environment. + /// Get metric definitions for a multi-role pool of an App Service Environment. /// /// - /// Description for Get usage metrics for a multi-role pool of an App Service - /// Environment. + /// Description for Get metric definitions for a multi-role pool of an App + /// Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -3398,7 +3411,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRoleUsagesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRoleMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3441,11 +3454,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRoleUsages", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRoleMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -3542,7 +3555,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3555,7 +3568,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3575,11 +3588,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// List all currently running operations on the App Service Environment. + /// Get available SKUs for scaling a multi-role pool. /// /// - /// Description for List all currently running operations on the App Service - /// Environment. + /// Description for Get available SKUs for scaling a multi-role pool. /// /// /// Name of the resource group to which the resource belongs. @@ -3608,7 +3620,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListOperationsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRolePoolSkusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3651,11 +3663,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePoolSkus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -3752,7 +3764,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3765,7 +3777,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3785,12 +3797,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get the network endpoints of all outbound dependencies of an App Service - /// Environment. + /// Get usage metrics for a multi-role pool of an App Service Environment. /// /// - /// Description for Get the network endpoints of all outbound dependencies of - /// an App Service Environment. + /// Description for Get usage metrics for a multi-role pool of an App Service + /// Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -3819,7 +3830,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRoleUsagesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3862,11 +3873,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetOutboundNetworkDependenciesEndpoints", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRoleUsages", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -3963,7 +3974,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3976,7 +3987,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3996,10 +4007,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Reboot all machines in an App Service Environment. + /// List all currently running operations on the App Service Environment. /// /// - /// Description for Reboot all machines in an App Service Environment. + /// Description for List all currently running operations on the App Service + /// Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -4016,6 +4028,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -4025,7 +4040,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RebootWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListOperationsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4068,11 +4083,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Reboot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -4088,7 +4103,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -4139,7 +4154,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4169,13 +4184,31 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4184,35 +4217,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Resume an App Service Environment. - /// - /// - /// Description for Resume an App Service Environment. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> ResumeWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginResumeWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get all App Service plans in an App Service Environment. + /// Get the network endpoints of all outbound dependencies of an App Service + /// Environment. /// /// - /// Description for Get all App Service plans in an App Service Environment. + /// Description for Get the network endpoints of all outbound dependencies of + /// an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -4241,7 +4251,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAppServicePlansWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4284,11 +4294,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAppServicePlans", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetOutboundNetworkDependenciesEndpoints", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -4385,7 +4395,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4398,7 +4408,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4418,10 +4428,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get all apps in an App Service Environment. + /// Gets the list of private endpoints associated with a hosting environment /// /// - /// Description for Get all apps in an App Service Environment. + /// Description for Gets the list of private endpoints associated with a + /// hosting environment /// /// /// Name of the resource group to which the resource belongs. @@ -4429,9 +4440,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Comma separated list of app properties to include. - /// /// /// Headers that will be added to request. /// @@ -4453,7 +4461,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebAppsWithHttpMessagesAsync(string resourceGroupName, string name, string propertiesToInclude = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4495,21 +4503,16 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("propertiesToInclude", propertiesToInclude); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebApps", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionList", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (propertiesToInclude != null) - { - _queryParameters.Add(string.Format("propertiesToInclude={0}", System.Uri.EscapeDataString(propertiesToInclude))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -4602,7 +4605,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4615,7 +4618,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4635,35 +4638,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Suspend an App Service Environment. - /// - /// - /// Description for Suspend an App Service Environment. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> SuspendWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginSuspendWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get global usage metrics of an App Service Environment. + /// Gets a private endpoint connection /// /// - /// Description for Get global usage metrics of an App Service Environment. + /// Description for Gets a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. @@ -4671,11 +4649,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Return only usages/metrics specified in the filter. Filter conforms to - /// odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq - /// 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - /// 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// + /// Name of the private endpoint connection. /// /// /// Headers that will be added to request. @@ -4698,7 +4673,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4723,6 +4698,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -4740,21 +4719,18 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("filter", filter); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -4847,7 +4823,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4860,7 +4836,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4880,10 +4856,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get all worker pools of an App Service Environment. + /// Approves or rejects a private endpoint connection /// /// - /// Description for Get all worker pools of an App Service Environment. + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. @@ -4891,28 +4867,1641 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// + /// + /// /// - /// Headers that will be added to request. + /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListWorkerPoolsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// 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> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateLinkResources").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Reboot all machines in an App Service Environment. + /// + /// + /// Description for Reboot all machines in an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// 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 RebootWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Reboot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Resume an App Service Environment. + /// + /// + /// Description for Resume an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> ResumeWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginResumeWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get all App Service plans in an App Service Environment. + /// + /// + /// Description for Get all App Service plans in an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// 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>> ListAppServicePlansWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAppServicePlans", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all apps in an App Service Environment. + /// + /// + /// Description for Get all apps in an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Comma separated list of app properties to include. + /// + /// + /// 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>> ListWebAppsWithHttpMessagesAsync(string resourceGroupName, string name, string propertiesToInclude = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("propertiesToInclude", propertiesToInclude); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListWebApps", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (propertiesToInclude != null) + { + _queryParameters.Add(string.Format("propertiesToInclude={0}", System.Uri.EscapeDataString(propertiesToInclude))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Suspend an App Service Environment. + /// + /// + /// Description for Suspend an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> SuspendWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginSuspendWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get global usage metrics of an App Service Environment. + /// + /// + /// Description for Get global usage metrics of an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Return only usages/metrics specified in the filter. Filter conforms to + /// odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq + /// 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq + /// 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// + /// + /// 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>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all worker pools of an App Service Environment. + /// + /// + /// Description for Get all worker pools of an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// 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>> ListWorkerPoolsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPools", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get properties of a worker pool. + /// + /// + /// Description for Get properties of a worker pool. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Name of the worker pool. + /// + /// + /// 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> GetWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (workerPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("workerPoolName", workerPoolName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetWorkerPool", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update a worker pool. + /// + /// + /// Description for Create or update a worker pool. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Name of the worker pool. + /// + /// + /// Properties of the worker pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWorkerPoolWithHttpMessagesAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a worker pool. + /// + /// + /// Description for Create or update a worker pool. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Name of the worker pool. + /// + /// + /// Properties of the worker pool. + /// + /// + /// 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> UpdateWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4937,6 +6526,14 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (workerPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); + } + if (workerPoolEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -4954,14 +6551,17 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("workerPoolName", workerPoolName); + tracingParameters.Add("workerPoolEnvelope", workerPoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPools", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateWorkerPool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4975,7 +6575,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5006,6 +6606,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(workerPoolEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workerPoolEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -5026,7 +6632,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -5056,7 +6662,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5069,7 +6675,25 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5089,10 +6713,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get properties of a worker pool. + /// Get metric definitions for a specific instance of a worker pool of an App + /// Service Environment. /// /// - /// Description for Get properties of a worker pool. + /// Description for Get metric definitions for a specific instance of a worker + /// pool of an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -5103,6 +6729,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the worker pool. /// + /// + /// Name of the instance in the worker pool. + /// /// /// Headers that will be added to request. /// @@ -5124,7 +6753,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWorkerPoolInstanceMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, string instance, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5153,6 +6782,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); } + if (instance == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instance"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5171,15 +6804,17 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("workerPoolName", workerPoolName); + tracingParameters.Add("instance", instance); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWorkerPool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPoolInstanceMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); + _url = _url.Replace("{instance}", System.Uri.EscapeDataString(instance)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -5274,7 +6909,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5287,7 +6922,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5307,41 +6942,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Create or update a worker pool. - /// - /// - /// Description for Create or update a worker pool. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Name of the worker pool. - /// - /// - /// Properties of the worker pool. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWorkerPoolWithHttpMessagesAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Create or update a worker pool. + /// Get metric definitions for a worker pool of an App Service Environment. /// /// - /// Description for Create or update a worker pool. + /// Description for Get metric definitions for a worker pool of an App Service + /// Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -5352,9 +6957,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the worker pool. /// - /// - /// Properties of the worker pool. - /// /// /// Headers that will be added to request. /// @@ -5376,7 +6978,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebWorkerMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5405,10 +7007,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); } - if (workerPoolEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5427,13 +7025,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("workerPoolName", workerPoolName); - tracingParameters.Add("workerPoolEnvelope", workerPoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateWorkerPool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebWorkerMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); @@ -5450,7 +7047,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5481,12 +7078,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(workerPoolEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workerPoolEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -5507,7 +7098,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -5537,7 +7128,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5550,25 +7141,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5588,12 +7161,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get metric definitions for a specific instance of a worker pool of an App - /// Service Environment. + /// Get available SKUs for scaling a worker pool. /// /// - /// Description for Get metric definitions for a specific instance of a worker - /// pool of an App Service Environment. + /// Description for Get available SKUs for scaling a worker pool. /// /// /// Name of the resource group to which the resource belongs. @@ -5604,9 +7175,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the worker pool. /// - /// - /// Name of the instance in the worker pool. - /// /// /// Headers that will be added to request. /// @@ -5628,7 +7196,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWorkerPoolInstanceMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, string instance, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWorkerPoolSkusWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5657,10 +7225,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); } - if (instance == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instance"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5679,17 +7243,15 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("workerPoolName", workerPoolName); - tracingParameters.Add("instance", instance); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPoolInstanceMetricDefinitions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPoolSkus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); - _url = _url.Replace("{instance}", System.Uri.EscapeDataString(instance)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -5784,7 +7346,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5797,7 +7359,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5817,10 +7379,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get metric definitions for a worker pool of an App Service Environment. + /// Get usage metrics for a worker pool of an App Service Environment. /// /// - /// Description for Get metric definitions for a worker pool of an App Service + /// Description for Get usage metrics for a worker pool of an App Service /// Environment. /// /// @@ -5853,7 +7415,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebWorkerMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebWorkerUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5901,11 +7463,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("workerPoolName", workerPoolName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebWorkerMetricDefinitions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebWorkerUsages", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); @@ -6003,7 +7565,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6016,7 +7578,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6036,10 +7598,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get available SKUs for scaling a worker pool. + /// Create or update an App Service Environment. /// /// - /// Description for Get available SKUs for scaling a worker pool. + /// Description for Create or update an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -6047,8 +7609,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the worker pool. + /// + /// Configuration details of the App Service Environment. /// /// /// Headers that will be added to request. @@ -6071,7 +7633,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWorkerPoolSkusWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, AppServiceEnvironmentResource hostingEnvironmentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6096,9 +7658,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (workerPoolName == null) + if (hostingEnvironmentEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostingEnvironmentEnvelope"); + } + if (hostingEnvironmentEnvelope != null) + { + hostingEnvironmentEnvelope.Validate(); } if (Client.SubscriptionId == null) { @@ -6117,16 +7683,15 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("workerPoolName", workerPoolName); + tracingParameters.Add("hostingEnvironmentEnvelope", hostingEnvironmentEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPoolSkus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -6140,7 +7705,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6171,6 +7736,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(hostingEnvironmentEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostingEnvironmentEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -6191,7 +7762,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6221,7 +7792,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6234,7 +7805,43 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6254,11 +7861,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get usage metrics for a worker pool of an App Service Environment. + /// Delete an App Service Environment. /// /// - /// Description for Get usage metrics for a worker pool of an App Service - /// Environment. + /// Description for Delete an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -6266,8 +7872,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the worker pool. + /// + /// Specify <code>true</code> to force the deletion even if the App + /// Service Environment contains resources. The default is + /// <code>false</code>. /// /// /// Headers that will be added to request. @@ -6278,9 +7886,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -6290,7 +7895,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebWorkerUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string name, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6315,10 +7920,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (workerPoolName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -6336,18 +7937,21 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("workerPoolName", workerPoolName); + tracingParameters.Add("forceDelete", forceDelete); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebWorkerUsages", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (forceDelete != null) + { + _queryParameters.Add(string.Format("forceDelete={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDelete, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -6359,7 +7963,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6410,7 +8014,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6440,31 +8044,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -6473,10 +8059,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Create or update an App Service Environment. + /// Move an App Service Environment to a different VNET. /// /// - /// Description for Create or update an App Service Environment. + /// Description for Move an App Service Environment to a different VNET. /// /// /// Name of the resource group to which the resource belongs. @@ -6484,8 +8070,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Configuration details of the App Service Environment. + /// + /// Details for the new virtual network. /// /// /// Headers that will be added to request. @@ -6508,7 +8094,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, AppServiceEnvironmentResource hostingEnvironmentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> BeginChangeVnetWithHttpMessagesAsync(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6533,13 +8119,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostingEnvironmentEnvelope == null) + if (vnetInfo == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostingEnvironmentEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetInfo"); } - if (hostingEnvironmentEnvelope != null) + if (vnetInfo != null) { - hostingEnvironmentEnvelope.Validate(); + vnetInfo.Validate(); } if (Client.SubscriptionId == null) { @@ -6558,13 +8144,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostingEnvironmentEnvelope", hostingEnvironmentEnvelope); + tracingParameters.Add("vnetInfo", vnetInfo); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginChangeVnet", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -6580,7 +8166,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6611,9 +8197,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(hostingEnvironmentEnvelope != null) + if(vnetInfo != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostingEnvironmentEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vnetInfo, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -6637,7 +8223,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6667,7 +8253,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6680,25 +8266,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6716,7 +8284,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6736,10 +8304,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Delete an App Service Environment. + /// Create or update a multi-role pool. /// /// - /// Description for Delete an App Service Environment. + /// Description for Create or update a multi-role pool. /// /// /// Name of the resource group to which the resource belongs. @@ -6747,10 +8315,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Specify <code>true</code> to force the deletion even if the App - /// Service Environment contains resources. The default is - /// <code>false</code>. + /// + /// Properties of the multi-role pool. /// /// /// Headers that will be added to request. @@ -6761,6 +8327,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -6770,7 +8339,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string name, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6795,6 +8364,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (multiRolePoolEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "multiRolePoolEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -6812,21 +8385,17 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("forceDelete", forceDelete); + tracingParameters.Add("multiRolePoolEnvelope", multiRolePoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateMultiRolePool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (forceDelete != null) - { - _queryParameters.Add(string.Format("forceDelete={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDelete, Client.SerializationSettings).Trim('"')))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -6838,7 +8407,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6869,6 +8438,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(multiRolePoolEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(multiRolePoolEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -6889,7 +8464,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6911,20 +8486,56 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { ServiceClientTracing.Error(_invocationId, ex); } - _httpRequest.Dispose(); - if (_httpResponse != null) + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) { - _httpResponse.Dispose(); + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } - throw ex; } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) + // Deserialize Response + if ((int)_statusCode == 202) { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -6934,10 +8545,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Move an App Service Environment to a different VNET. + /// Approves or rejects a private endpoint connection /// /// - /// Description for Move an App Service Environment to a different VNET. + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. @@ -6945,8 +8556,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Details for the new virtual network. + /// + /// + /// /// /// /// Headers that will be added to request. @@ -6969,7 +8581,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginChangeVnetWithHttpMessagesAsync(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6994,9 +8606,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetInfo == null) + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetInfo"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (privateEndpointWrapper == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); } if (Client.SubscriptionId == null) { @@ -7015,15 +8631,17 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetInfo", vnetInfo); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginChangeVnet", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -7037,7 +8655,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7068,9 +8686,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(vnetInfo != null) + if(privateEndpointWrapper != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vnetInfo, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -7124,7 +8742,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7137,7 +8755,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7155,7 +8773,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7175,10 +8793,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Create or update a multi-role pool. + /// Deletes a private endpoint connection /// /// - /// Description for Create or update a multi-role pool. + /// Description for Deletes a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. @@ -7186,8 +8804,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Properties of the multi-role pool. + /// /// /// /// Headers that will be added to request. @@ -7210,7 +8827,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7235,9 +8852,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (multiRolePoolEnvelope == null) + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "multiRolePoolEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } if (Client.SubscriptionId == null) { @@ -7256,15 +8873,16 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("multiRolePoolEnvelope", multiRolePoolEnvelope); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateMultiRolePool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -7278,7 +8896,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7309,12 +8927,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(multiRolePoolEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(multiRolePoolEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -7335,7 +8947,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -7365,7 +8977,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7378,7 +8990,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7396,7 +9008,25 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 204) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -9861,6 +11491,178 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) return _result; } + /// + /// Gets the list of private endpoints associated with a hosting environment + /// + /// + /// Description for Gets the list of private endpoints associated with a + /// hosting environment + /// + /// + /// 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>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(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, "GetPrivateEndpointConnectionListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Resume an App Service Environment. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperationsExtensions.cs index e4a6d169b17e..b77535a589eb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperationsExtensions.cs @@ -448,6 +448,104 @@ public static IPage ChangeVnet(this IAppServiceEnvironmentsOperations oper } } + /// + /// Get networking configuration of an App Service Environment + /// + /// + /// Description for Get networking configuration of an App Service Environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + public static AseV3NetworkingConfiguration GetAseV3NetworkingConfiguration(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name) + { + return operations.GetAseV3NetworkingConfigurationAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Get networking configuration of an App Service Environment + /// + /// + /// Description for Get networking configuration of an App Service Environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The cancellation token. + /// + public static async Task GetAseV3NetworkingConfigurationAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAseV3NetworkingConfigurationWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update networking configuration of an App Service Environment + /// + /// + /// Description for Update networking configuration of an App Service + /// Environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + public static AseV3NetworkingConfiguration UpdateAseNetworkingConfiguration(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration) + { + return operations.UpdateAseNetworkingConfigurationAsync(resourceGroupName, name, aseNetworkingConfiguration).GetAwaiter().GetResult(); + } + + /// + /// Update networking configuration of an App Service Environment + /// + /// + /// Description for Update networking configuration of an App Service + /// Environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAseNetworkingConfigurationAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateAseNetworkingConfigurationWithHttpMessagesAsync(resourceGroupName, name, aseNetworkingConfiguration, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get diagnostic information for an App Service Environment. /// @@ -1088,6 +1186,256 @@ public static IPage GetOutboundNetworkDependenciesE } } + /// + /// Gets the list of private endpoints associated with a hosting environment + /// + /// + /// Description for Gets the list of private endpoints associated with a + /// hosting environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + public static IPage GetPrivateEndpointConnectionList(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name) + { + return operations.GetPrivateEndpointConnectionListAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of private endpoints associated with a hosting environment + /// + /// + /// Description for Gets the list of private endpoints associated with a + /// hosting environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Name of the private endpoint connection. + /// + public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// + public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + return operations.ApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApproveOrRejectPrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + public static object DeletePrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task DeletePrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name) + { + return operations.GetPrivateLinkResourcesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateLinkResourcesAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Reboot all machines in an App Service Environment. /// @@ -2024,6 +2372,110 @@ public static WorkerPoolResource BeginCreateOrUpdateMultiRolePool(this IAppServi } } + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// + public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + return operations.BeginApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginApproveOrRejectPrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + public static object BeginDeletePrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeletePrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Resume an App Service Environment. /// @@ -2634,6 +3086,48 @@ public static IPage GetOutboundNetworkDependenciesE } } + /// + /// Gets the list of private endpoints associated with a hosting environment + /// + /// + /// Description for Gets the list of private endpoints associated with a + /// hosting environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetPrivateEndpointConnectionListNext(this IAppServiceEnvironmentsOperations operations, string nextPageLink) + { + return operations.GetPrivateEndpointConnectionListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of private endpoints associated with a hosting environment + /// + /// + /// Description for Gets the list of private endpoints associated with a + /// hosting environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListNextAsync(this IAppServiceEnvironmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Resume an App Service Environment. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperations.cs new file mode 100644 index 000000000000..de6c8f12dfda --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperations.cs @@ -0,0 +1,687 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CertificateOrdersDiagnosticsOperations operations. + /// + internal partial class CertificateOrdersDiagnosticsOperations : IServiceOperations, ICertificateOrdersDiagnosticsOperations + { + /// + /// Initializes a new instance of the CertificateOrdersDiagnosticsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal CertificateOrdersDiagnosticsOperations(WebSiteManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the WebSiteManagementClient + /// + public WebSiteManagementClient Client { get; private set; } + + /// + /// Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list of + /// detectors for this RP. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// 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>> ListAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(string resourceGroupName, string certificateOrderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (certificateOrderName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "certificateOrderName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("certificateOrderName", certificateOrderName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAppServiceCertificateOrderDetectorResponse", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{certificateOrderName}", System.Uri.EscapeDataString(certificateOrderName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Microsoft.CertificateRegistration call to get a detector response from App + /// Lens. + /// + /// + /// Description for Microsoft.CertificateRegistration call to get a detector + /// response from App Lens. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// The detector name which needs to be run. + /// + /// + /// The start time for detector response. + /// + /// + /// The end time for the detector response. + /// + /// + /// The time grain for the detector response. + /// + /// + /// 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> GetAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(string resourceGroupName, string certificateOrderName, string detectorName, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (certificateOrderName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "certificateOrderName"); + } + if (detectorName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "detectorName"); + } + if (timeGrain != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(timeGrain, "PT[1-9][0-9]+[SMH]")) + { + throw new ValidationException(ValidationRules.Pattern, "timeGrain", "PT[1-9][0-9]+[SMH]"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("certificateOrderName", certificateOrderName); + tracingParameters.Add("detectorName", detectorName); + tracingParameters.Add("startTime", startTime); + tracingParameters.Add("endTime", endTime); + tracingParameters.Add("timeGrain", timeGrain); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAppServiceCertificateOrderDetectorResponse", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors/{detectorName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{certificateOrderName}", System.Uri.EscapeDataString(certificateOrderName)); + _url = _url.Replace("{detectorName}", System.Uri.EscapeDataString(detectorName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (startTime != null) + { + _queryParameters.Add(string.Format("startTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(startTime, Client.SerializationSettings).Trim('"')))); + } + if (endTime != null) + { + _queryParameters.Add(string.Format("endTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(endTime, Client.SerializationSettings).Trim('"')))); + } + if (timeGrain != null) + { + _queryParameters.Add(string.Format("timeGrain={0}", System.Uri.EscapeDataString(timeGrain))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list of + /// detectors for this RP. + /// + /// + /// 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>> ListAppServiceCertificateOrderDetectorResponseNextWithHttpMessagesAsync(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, "ListAppServiceCertificateOrderDetectorResponseNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperationsExtensions.cs new file mode 100644 index 000000000000..c9696717ab5a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperationsExtensions.cs @@ -0,0 +1,189 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for CertificateOrdersDiagnosticsOperations. + /// + public static partial class CertificateOrdersDiagnosticsOperationsExtensions + { + /// + /// Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list of + /// detectors for this RP. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + public static IPage ListAppServiceCertificateOrderDetectorResponse(this ICertificateOrdersDiagnosticsOperations operations, string resourceGroupName, string certificateOrderName) + { + return operations.ListAppServiceCertificateOrderDetectorResponseAsync(resourceGroupName, certificateOrderName).GetAwaiter().GetResult(); + } + + /// + /// Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list of + /// detectors for this RP. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAppServiceCertificateOrderDetectorResponseAsync(this ICertificateOrdersDiagnosticsOperations operations, string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(resourceGroupName, certificateOrderName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Microsoft.CertificateRegistration call to get a detector response from App + /// Lens. + /// + /// + /// Description for Microsoft.CertificateRegistration call to get a detector + /// response from App Lens. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// The detector name which needs to be run. + /// + /// + /// The start time for detector response. + /// + /// + /// The end time for the detector response. + /// + /// + /// The time grain for the detector response. + /// + public static DetectorResponse GetAppServiceCertificateOrderDetectorResponse(this ICertificateOrdersDiagnosticsOperations operations, string resourceGroupName, string certificateOrderName, string detectorName, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string)) + { + return operations.GetAppServiceCertificateOrderDetectorResponseAsync(resourceGroupName, certificateOrderName, detectorName, startTime, endTime, timeGrain).GetAwaiter().GetResult(); + } + + /// + /// Microsoft.CertificateRegistration call to get a detector response from App + /// Lens. + /// + /// + /// Description for Microsoft.CertificateRegistration call to get a detector + /// response from App Lens. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// The detector name which needs to be run. + /// + /// + /// The start time for detector response. + /// + /// + /// The end time for the detector response. + /// + /// + /// The time grain for the detector response. + /// + /// + /// The cancellation token. + /// + public static async Task GetAppServiceCertificateOrderDetectorResponseAsync(this ICertificateOrdersDiagnosticsOperations operations, string resourceGroupName, string certificateOrderName, string detectorName, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(resourceGroupName, certificateOrderName, detectorName, startTime, endTime, timeGrain, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list of + /// detectors for this RP. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListAppServiceCertificateOrderDetectorResponseNext(this ICertificateOrdersDiagnosticsOperations operations, string nextPageLink) + { + return operations.ListAppServiceCertificateOrderDetectorResponseNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list of + /// detectors for this RP. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAppServiceCertificateOrderDetectorResponseNextAsync(this ICertificateOrdersDiagnosticsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAppServiceCertificateOrderDetectorResponseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs index 583856b5039f..2c7fe52ec5d0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs @@ -56,6 +56,10 @@ internal CertificatesOperations(WebSiteManagementClient client) /// /// Description for Get all certificates for a subscription. /// + /// + /// Return only information specified in the filter (using OData syntax). For + /// example: $filter=KeyVaultId eq 'KeyVaultId' + /// /// /// Headers that will be added to request. /// @@ -77,7 +81,7 @@ internal CertificatesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -94,6 +98,7 @@ internal CertificatesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -102,6 +107,10 @@ internal CertificatesOperations(WebSiteManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs index 2f310ccda8e3..0b12b9a8b490 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs @@ -30,9 +30,13 @@ public static partial class CertificatesOperationsExtensions /// /// The operations group for this extension method. /// - public static IPage List(this ICertificatesOperations operations) + /// + /// Return only information specified in the filter (using OData syntax). For + /// example: $filter=KeyVaultId eq 'KeyVaultId' + /// + public static IPage List(this ICertificatesOperations operations, string filter = default(string)) { - return operations.ListAsync().GetAwaiter().GetResult(); + return operations.ListAsync(filter).GetAwaiter().GetResult(); } /// @@ -44,12 +48,16 @@ public static IPage List(this ICertificatesOperations operations) /// /// The operations group for this extension method. /// + /// + /// Return only information specified in the filter (using OData syntax). For + /// example: $filter=KeyVaultId eq 'KeyVaultId' + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ICertificatesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ICertificatesOperations operations, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperations.cs index 32d276db9b8f..08d58ad3005c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperations.cs @@ -2095,11 +2095,11 @@ internal DomainsOperations(WebSiteManagementClient client) /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifer + /// for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifer + /// identifier details for an existing identifier /// /// /// Name of the resource group to which the resource belongs. @@ -2526,11 +2526,11 @@ internal DomainsOperations(WebSiteManagementClient client) /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifer + /// for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifer + /// identifier details for an existing identifier /// /// /// Name of the resource group to which the resource belongs. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperationsExtensions.cs index d6580c16cf14..ea9c034cf240 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperationsExtensions.cs @@ -514,11 +514,11 @@ public static DomainOwnershipIdentifier GetOwnershipIdentifier(this IDomainsOper /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifer + /// for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifer + /// identifier details for an existing identifier /// /// /// The operations group for this extension method. @@ -542,11 +542,11 @@ public static DomainOwnershipIdentifier CreateOrUpdateOwnershipIdentifier(this I /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifer + /// for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifer + /// identifier details for an existing identifier /// /// /// The operations group for this extension method. @@ -625,11 +625,11 @@ public static void DeleteOwnershipIdentifier(this IDomainsOperations operations, /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifer + /// for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifer + /// identifier details for an existing identifier /// /// /// The operations group for this extension method. @@ -653,11 +653,11 @@ public static DomainOwnershipIdentifier UpdateOwnershipIdentifier(this IDomainsO /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifer + /// for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifer + /// identifier details for an existing identifier /// /// /// The operations group for this extension method. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperations.cs new file mode 100644 index 000000000000..4e9e2829d289 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperations.cs @@ -0,0 +1,597 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// GlobalModelOperations operations. + /// + internal partial class GlobalModelOperations : IServiceOperations, IGlobalModelOperations + { + /// + /// Initializes a new instance of the GlobalModelOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal GlobalModelOperations(WebSiteManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the WebSiteManagementClient + /// + public WebSiteManagementClient Client { get; private set; } + + /// + /// Get deleted app for a subscription. + /// + /// + /// Description for Get deleted app for a subscription. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + /// + /// 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> GetDeletedWebAppWithHttpMessagesAsync(string deletedSiteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deletedSiteId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deletedSiteId"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deletedSiteId", deletedSiteId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDeletedWebApp", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}").ToString(); + _url = _url.Replace("{deletedSiteId}", System.Uri.EscapeDataString(deletedSiteId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all deleted apps for a subscription. + /// + /// + /// Description for Get all deleted apps for a subscription. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + /// + /// 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>> GetDeletedWebAppSnapshotsWithHttpMessagesAsync(string deletedSiteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deletedSiteId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deletedSiteId"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deletedSiteId", deletedSiteId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDeletedWebAppSnapshots", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}/snapshots").ToString(); + _url = _url.Replace("{deletedSiteId}", System.Uri.EscapeDataString(deletedSiteId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets an operation in a subscription and given region + /// + /// + /// Description for Gets an operation in a subscription and given region + /// + /// + /// Location name + /// + /// + /// Operation Id + /// + /// + /// 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 GetSubscriptionOperationWithAsyncResponseWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSubscriptionOperationWithAsyncResponse", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/operations/{operationId}").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperationsExtensions.cs new file mode 100644 index 000000000000..f9234d348ca7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperationsExtensions.cs @@ -0,0 +1,150 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for GlobalModelOperations. + /// + public static partial class GlobalModelOperationsExtensions + { + /// + /// Get deleted app for a subscription. + /// + /// + /// Description for Get deleted app for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + public static DeletedSite GetDeletedWebApp(this IGlobalModelOperations operations, string deletedSiteId) + { + return operations.GetDeletedWebAppAsync(deletedSiteId).GetAwaiter().GetResult(); + } + + /// + /// Get deleted app for a subscription. + /// + /// + /// Description for Get deleted app for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + /// + /// The cancellation token. + /// + public static async Task GetDeletedWebAppAsync(this IGlobalModelOperations operations, string deletedSiteId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDeletedWebAppWithHttpMessagesAsync(deletedSiteId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get all deleted apps for a subscription. + /// + /// + /// Description for Get all deleted apps for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + public static IList GetDeletedWebAppSnapshots(this IGlobalModelOperations operations, string deletedSiteId) + { + return operations.GetDeletedWebAppSnapshotsAsync(deletedSiteId).GetAwaiter().GetResult(); + } + + /// + /// Get all deleted apps for a subscription. + /// + /// + /// Description for Get all deleted apps for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + /// + /// The cancellation token. + /// + public static async Task> GetDeletedWebAppSnapshotsAsync(this IGlobalModelOperations operations, string deletedSiteId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDeletedWebAppSnapshotsWithHttpMessagesAsync(deletedSiteId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets an operation in a subscription and given region + /// + /// + /// Description for Gets an operation in a subscription and given region + /// + /// + /// The operations group for this extension method. + /// + /// + /// Location name + /// + /// + /// Operation Id + /// + public static void GetSubscriptionOperationWithAsyncResponse(this IGlobalModelOperations operations, string location, string operationId) + { + operations.GetSubscriptionOperationWithAsyncResponseAsync(location, operationId).GetAwaiter().GetResult(); + } + + /// + /// Gets an operation in a subscription and given region + /// + /// + /// Description for Gets an operation in a subscription and given region + /// + /// + /// The operations group for this extension method. + /// + /// + /// Location name + /// + /// + /// Operation Id + /// + /// + /// The cancellation token. + /// + public static async Task GetSubscriptionOperationWithAsyncResponseAsync(this IGlobalModelOperations operations, string location, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.GetSubscriptionOperationWithAsyncResponseWithHttpMessagesAsync(location, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IAppServiceEnvironmentsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IAppServiceEnvironmentsOperations.cs index a95032f627c6..4afcf71a451e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IAppServiceEnvironmentsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IAppServiceEnvironmentsOperations.cs @@ -284,6 +284,66 @@ public partial interface IAppServiceEnvironmentsOperations /// Task>> ChangeVnetWithHttpMessagesAsync(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get networking configuration of an App Service Environment + /// + /// + /// Description for Get networking configuration of an App Service + /// Environment + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAseV3NetworkingConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update networking configuration of an App Service Environment + /// + /// + /// Description for Update networking configuration of an App Service + /// Environment + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateAseNetworkingConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get diagnostic information for an App Service Environment. /// /// @@ -674,6 +734,157 @@ public partial interface IAppServiceEnvironmentsOperations /// Task>> GetOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the list of private endpoints associated with a hosting + /// environment + /// + /// + /// Description for Gets the list of private endpoints associated with + /// a hosting environment + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Reboot all machines in an App Service Environment. /// /// @@ -1234,6 +1445,68 @@ public partial interface IAppServiceEnvironmentsOperations /// Task> BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Resume an App Service Environment. /// /// @@ -1614,6 +1887,33 @@ public partial interface IAppServiceEnvironmentsOperations /// Task>> GetOutboundNetworkDependenciesEndpointsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the list of private endpoints associated with a hosting + /// environment + /// + /// + /// Description for Gets the list of private endpoints associated with + /// a hosting environment + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Resume an App Service Environment. /// /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificateOrdersDiagnosticsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificateOrdersDiagnosticsOperations.cs new file mode 100644 index 000000000000..27a71c5b91d6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificateOrdersDiagnosticsOperations.cs @@ -0,0 +1,126 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CertificateOrdersDiagnosticsOperations operations. + /// + public partial interface ICertificateOrdersDiagnosticsOperations + { + /// + /// Microsoft.CertificateRegistration to get the list of detectors for + /// this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list + /// of detectors for this RP. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(string resourceGroupName, string certificateOrderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Microsoft.CertificateRegistration call to get a detector response + /// from App Lens. + /// + /// + /// Description for Microsoft.CertificateRegistration call to get a + /// detector response from App Lens. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// The detector name which needs to be run. + /// + /// + /// The start time for detector response. + /// + /// + /// The end time for the detector response. + /// + /// + /// The time grain for the detector response. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(string resourceGroupName, string certificateOrderName, string detectorName, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Microsoft.CertificateRegistration to get the list of detectors for + /// this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list + /// of detectors for this RP. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListAppServiceCertificateOrderDetectorResponseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs index 949867d9a615..86f6dcfa701d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs @@ -29,6 +29,10 @@ public partial interface ICertificatesOperations /// /// Description for Get all certificates for a subscription. /// + /// + /// Return only information specified in the filter (using OData + /// syntax). For example: $filter=KeyVaultId eq 'KeyVaultId' + /// /// /// The headers that will be added to request. /// @@ -44,7 +48,7 @@ public partial interface ICertificatesOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all certificates in a resource group. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IDomainsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IDomainsOperations.cs index 26350ec4d859..e1aebe7efb72 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IDomainsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IDomainsOperations.cs @@ -324,11 +324,11 @@ public partial interface IDomainsOperations Task> GetOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string domainName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates an ownership identifier for a domain or updates identifier - /// details for an existing identifer + /// details for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or - /// updates identifier details for an existing identifer + /// updates identifier details for an existing identifier /// /// /// Name of the resource group to which the resource belongs. @@ -388,11 +388,11 @@ public partial interface IDomainsOperations Task DeleteOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string domainName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates an ownership identifier for a domain or updates identifier - /// details for an existing identifer + /// details for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or - /// updates identifier details for an existing identifer + /// updates identifier details for an existing identifier /// /// /// Name of the resource group to which the resource belongs. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IGlobalModelOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IGlobalModelOperations.cs new file mode 100644 index 000000000000..c71309c9de0f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IGlobalModelOperations.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.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// GlobalModelOperations operations. + /// + public partial interface IGlobalModelOperations + { + /// + /// Get deleted app for a subscription. + /// + /// + /// Description for Get deleted app for a subscription. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDeletedWebAppWithHttpMessagesAsync(string deletedSiteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all deleted apps for a subscription. + /// + /// + /// Description for Get all deleted apps for a subscription. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetDeletedWebAppSnapshotsWithHttpMessagesAsync(string deletedSiteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets an operation in a subscription and given region + /// + /// + /// Description for Gets an operation in a subscription and given + /// region + /// + /// + /// Location name + /// + /// + /// Operation Id + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task GetSubscriptionOperationWithAsyncResponseWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IProviderOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IProviderOperations.cs index 662c53798b81..ed6bf7f9bd67 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IProviderOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IProviderOperations.cs @@ -32,7 +32,7 @@ public partial interface IProviderOperations /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// /// /// The headers that will be added to request. @@ -51,6 +51,91 @@ public partial interface IProviderOperations /// Task>> GetAvailableStacksWithHttpMessagesAsync(string osTypeSelected = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their + /// versions + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetFunctionAppStacksWithHttpMessagesAsync(string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get available Function app frameworks and their versions for + /// location + /// + /// + /// Description for Get available Function app frameworks and their + /// versions for location + /// + /// + /// Function App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetFunctionAppStacksForLocationWithHttpMessagesAsync(string location, string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions + /// for location + /// + /// + /// Web App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetWebAppStacksForLocationWithHttpMessagesAsync(string location, string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets all available operations for the Microsoft.Web resource /// provider. Also exposes resource metric definitions /// @@ -75,6 +160,31 @@ public partial interface IProviderOperations /// Task>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetWebAppStacksWithHttpMessagesAsync(string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get available application frameworks and their versions /// /// @@ -83,7 +193,7 @@ public partial interface IProviderOperations /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// /// /// The headers that will be added to request. @@ -128,6 +238,85 @@ public partial interface IProviderOperations /// Task>> GetAvailableStacksNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their + /// versions + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetFunctionAppStacksNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get available Function app frameworks and their versions for + /// location + /// + /// + /// Description for Get available Function app frameworks and their + /// versions for location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetFunctionAppStacksForLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions + /// for location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetWebAppStacksForLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets all available operations for the Microsoft.Web resource /// provider. Also exposes resource metric definitions /// @@ -155,6 +344,31 @@ public partial interface IProviderOperations /// Task>> ListOperationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetWebAppStacksNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get available application frameworks and their versions /// /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IStaticSitesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IStaticSitesOperations.cs index d417e4d033a4..27111b69f27c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IStaticSitesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IStaticSitesOperations.cs @@ -23,6 +23,36 @@ namespace Microsoft.Azure.Management.WebSites /// public partial interface IStaticSitesOperations { + /// + /// Generates a preview workflow file for the static site + /// + /// + /// Description for Generates a preview workflow file for the static + /// site + /// + /// + /// Location where you plan to create the static site. + /// + /// + /// A JSON representation of the StaticSitesWorkflowPreviewRequest + /// properties. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PreviewWorkflowWithHttpMessagesAsync(string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all Static Sites for a subscription. /// @@ -331,7 +361,7 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -349,7 +379,7 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> GetStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a static site build. /// @@ -362,9 +392,41 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates the app settings of a static site build. + /// + /// + /// Description for Creates or updates the app settings of a static + /// site build. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// /// The stage site identifier. /// + /// + /// The dictionary containing the static site app settings to update. + /// /// /// The headers that will be added to request. /// @@ -374,10 +436,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteBuildAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates the function app settings of a static site /// build. @@ -392,10 +457,12 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// + /// The dictionary containing the static site function app settings to + /// update. /// /// /// The headers that will be added to request. @@ -412,7 +479,7 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the functions of a particular static site build. /// @@ -426,7 +493,7 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -444,12 +511,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteBuildFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListStaticSiteBuildFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the application settings of a static site. + /// Gets the application settings of a static site build. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Gets the application settings of a static site + /// build. /// /// /// Name of the resource group to which the resource belongs. @@ -457,7 +525,7 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -475,13 +543,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListStaticSiteBuildAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates the function app settings of a static site. + /// Gets the application settings of a static site build. /// /// - /// Description for Creates or updates the function app settings of a - /// static site. + /// Description for Gets the application settings of a static site + /// build. /// /// /// Name of the resource group to which the resource belongs. @@ -489,7 +557,8 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// /// /// The headers that will be added to request. @@ -506,12 +575,14 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates an invitation link for a user with the role + /// Gets the details of the user provided function apps registered with + /// a static site build /// /// - /// Description for Creates an invitation link for a user with the role + /// Description for Gets the details of the user provided function apps + /// registered with a static site build /// /// /// Name of the resource group to which the resource belongs. @@ -519,7 +590,8 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// /// /// The headers that will be added to request. @@ -536,19 +608,26 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> CreateUserRolesInvitationLinkWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetUserProvidedFunctionAppsForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all static site custom domains for a particular static site. + /// Gets the details of the user provided function app registered with + /// a static site build /// /// - /// Description for Gets all static site custom domains for a - /// particular static site. + /// Description for Gets the details of the user provided function app + /// registered with a static site build /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// /// /// The headers that will be added to request. @@ -565,14 +644,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteCustomDomainsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetUserProvidedFunctionAppForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a new static site custom domain in an existing resource - /// group and static site. + /// Register a user provided function app with a static site build /// /// - /// Description for Creates a new static site custom domain in an - /// existing resource group and static site. + /// Description for Register a user provided function app with a static + /// site build /// /// /// Name of the resource group to which the resource belongs. @@ -580,8 +658,21 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// The custom domain to create. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. + /// See example. + /// + /// + /// Specify <code>true</code> to force the update of the + /// auth configuration on the function app even if an + /// AzureStaticWebApps provider is already configured on the function + /// app. The default is <code>false</code>. /// /// /// The headers that will be added to request. @@ -598,12 +689,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a custom domain. + /// Detach the user provided function app from the static site build /// /// - /// Description for Deletes a custom domain. + /// Description for Detach the user provided function app from the + /// static site build /// /// /// Name of the resource group to which the resource belongs. @@ -611,8 +703,11 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// The custom domain to delete. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// /// /// The headers that will be added to request. @@ -626,13 +721,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task DeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DetachUserProvidedFunctionAppFromStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Validates a particular custom domain can be added to a static site. + /// Deploys zipped content to a specific environment of a static site. /// /// - /// Description for Validates a particular custom domain can be added - /// to a static site. + /// Description for Deploys zipped content to a specific environment of + /// a static site. /// /// /// Name of the resource group to which the resource belongs. @@ -640,8 +735,12 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// The custom domain to validate. + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. + /// See example. /// /// /// The headers that will be added to request. @@ -655,18 +754,22 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task CreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Detaches a static site. + /// Creates or updates the app settings of a static site. /// /// - /// Description for Detaches a static site. + /// Description for Creates or updates the app settings of a static + /// site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site to detach. + /// Name of the static site. + /// + /// + /// The dictionary containing the static site app settings to update. /// /// /// The headers that will be added to request. @@ -677,15 +780,19 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the functions of a static site. + /// Creates or updates the function app settings of a static site. /// /// - /// Description for Gets the functions of a static site. + /// Description for Creates or updates the function app settings of a + /// static site. /// /// /// Name of the resource group to which the resource belongs. @@ -693,6 +800,10 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// + /// + /// The dictionary containing the static site function app settings to + /// update. + /// /// /// The headers that will be added to request. /// @@ -708,12 +819,12 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the application settings of a static site. + /// Creates an invitation link for a user with the role /// /// - /// Description for Gets the application settings of a static site. + /// Description for Creates an invitation link for a user with the role /// /// /// Name of the resource group to which the resource belongs. @@ -721,6 +832,8 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// + /// + /// /// /// The headers that will be added to request. /// @@ -736,18 +849,19 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateUserRolesInvitationLinkWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the secrets for an existing static site. + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Lists the secrets for an existing static site. + /// Description for Gets all static site custom domains for a + /// particular static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. + /// Name of the static site resource to search in. /// /// /// The headers that will be added to request. @@ -764,20 +878,22 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> ListStaticSiteSecretsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListStaticSiteCustomDomainsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Resets the api key for an existing static site. + /// Gets an existing custom domain for a particular static site. /// /// - /// Description for Resets the api key for an existing static site. + /// Description for Gets an existing custom domain for a particular + /// static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. + /// Name of the static site resource to search in. /// - /// + /// + /// The custom domain name. /// /// /// The headers that will be added to request. @@ -788,18 +904,33 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task ResetStaticSiteApiKeyWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get all Static Sites for a subscription. + /// Creates a new static site custom domain in an existing resource + /// group and static site. /// /// - /// Description for Get all Static Sites for a subscription. + /// Description for Creates a new static site custom domain in an + /// existing resource group and static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request + /// properties. See example. /// /// /// The headers that will be added to request. @@ -816,16 +947,21 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all static sites in the specified resource group. + /// Deletes a custom domain. /// /// - /// Description for Gets all static sites in the specified resource - /// group. + /// Description for Deletes a custom domain. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. /// /// /// The headers that will be added to request. @@ -836,21 +972,29 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> GetStaticSitesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the list of users of a static site. + /// Validates a particular custom domain can be added to a static site. /// /// - /// Description for Gets the list of users of a static site. + /// Description for Validates a particular custom domain can be added + /// to a static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request + /// properties. See example. /// /// /// The headers that will be added to request. @@ -861,22 +1005,21 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteUsersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all static site builds for a particular static site. + /// Detaches a static site. /// /// - /// Description for Gets all static site builds for a particular static - /// site. + /// Description for Detaches a static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. /// /// /// The headers that will be added to request. @@ -887,22 +1030,21 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> GetStaticSiteBuildsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the functions of a particular static site build. + /// Gets the functions of a static site. /// /// - /// Description for Gets the functions of a particular static site - /// build. + /// Description for Gets the functions of a static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. /// /// /// The headers that will be added to request. @@ -919,16 +1061,18 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteBuildFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListStaticSiteFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all static site custom domains for a particular static site. + /// Gets the application settings of a static site. /// /// - /// Description for Gets all static site custom domains for a - /// particular static site. + /// Description for Gets the application settings of a static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. /// /// /// The headers that will be added to request. @@ -945,15 +1089,1047 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteCustomDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListStaticSiteAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the functions of a static site. + /// Lists the roles configured for the static site. /// /// - /// Description for Gets the functions of a static site. + /// Description for Lists the roles configured for the static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListStaticSiteConfiguredRolesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the secrets for an existing static site. + /// + /// + /// Description for Lists the secrets for an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListStaticSiteSecretsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of private endpoint connections associated with a + /// static site + /// + /// + /// Description for Gets the list of private endpoint connections + /// associated with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Resets the api key for an existing static site. + /// + /// + /// Description for Resets the api key for an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ResetStaticSiteApiKeyWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the details of the user provided function apps registered with + /// a static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetUserProvidedFunctionAppsForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the details of the user provided function app registered with + /// a static site + /// + /// + /// Description for Gets the details of the user provided function app + /// registered with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetUserProvidedFunctionAppForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static + /// site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. + /// See example. + /// + /// + /// Specify <code>true</code> to force the update of the + /// auth configuration on the function app even if an + /// AzureStaticWebApps provider is already configured on the function + /// app. The default is <code>false</code>. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> RegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Detach the user provided function app from the static site + /// + /// + /// Description for Detach the user provided function app from the + /// static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DetachUserProvidedFunctionAppFromStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. + /// See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task CreateZipDeploymentForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new static site in an existing resource group, or updates + /// an existing static site. + /// + /// + /// Description for Creates a new static site in an existing resource + /// group, or updates an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a static site. + /// + /// + /// Description for Deletes a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a static site build. + /// + /// + /// Description for Deletes a static site build. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Register a user provided function app with a static site build + /// + /// + /// Description for Register a user provided function app with a static + /// site build + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. + /// See example. + /// + /// + /// Specify <code>true</code> to force the update of the + /// auth configuration on the function app even if an + /// AzureStaticWebApps provider is already configured on the function + /// app. The default is <code>false</code>. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deploys zipped content to a specific environment of a static site. + /// + /// + /// Description for Deploys zipped content to a specific environment of + /// a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. + /// See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginCreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new static site custom domain in an existing resource + /// group and static site. + /// + /// + /// Description for Creates a new static site custom domain in an + /// existing resource group and static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request + /// properties. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added + /// to a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request + /// properties. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static + /// site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. + /// See example. + /// + /// + /// Specify <code>true</code> to force the update of the + /// auth configuration on the function app even if an + /// AzureStaticWebApps provider is already configured on the function + /// app. The default is <code>false</code>. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginRegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. + /// See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginCreateZipDeploymentForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all Static Sites for a subscription. + /// + /// + /// Description for Get all Static Sites for a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all static sites in the specified resource group. + /// + /// + /// Description for Gets all static sites in the specified resource + /// group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetStaticSitesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of users of a static site. + /// + /// + /// Description for Gets the list of users of a static site. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListStaticSiteUsersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all static site builds for a particular static site. + /// + /// + /// Description for Gets all static site builds for a particular static + /// site. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetStaticSiteBuildsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the functions of a particular static site build. + /// + /// + /// Description for Gets the functions of a particular static site + /// build. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListStaticSiteBuildFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the details of the user provided function apps registered with + /// a static site build + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site build + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetUserProvidedFunctionAppsForStaticSiteBuildNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all static site custom domains for a particular static site. + /// + /// + /// Description for Gets all static site custom domains for a + /// particular static site. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListStaticSiteCustomDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the functions of a static site. + /// + /// + /// Description for Gets the functions of a static site. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -971,5 +2147,59 @@ public partial interface IStaticSitesOperations /// Thrown when a required parameter is null /// Task>> ListStaticSiteFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of private endpoint connections associated with a + /// static site + /// + /// + /// Description for Gets the list of private endpoint connections + /// associated with a static site + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the details of the user provided function apps registered with + /// a static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetUserProvidedFunctionAppsForStaticSiteNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebAppsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebAppsOperations.cs index 4cd486e4521f..bb5fc95d1170 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebAppsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebAppsOperations.cs @@ -966,6 +966,125 @@ public partial interface IWebAppsOperations /// Task> GetBackupConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetAppSettingsKeyVaultReferencesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// App Setting key name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAppSettingKeyVaultReferenceWithHttpMessagesAsync(string resourceGroupName, string name, string appSettingKey, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetSiteConnectionStringKeyVaultReferencesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSiteConnectionStringKeyVaultReferenceWithHttpMessagesAsync(string resourceGroupName, string name, string connectionStringKey, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Replaces the connection strings of an app. /// /// @@ -3658,47 +3777,6 @@ public partial interface IWebAppsOperations /// Task> GetSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Integrates this Web App with a Virtual Network. This requires that - /// 1) "swiftSupported" is true when doing a GET against this resource, - /// and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. - /// This requires that 1) "swiftSupported" is true when doing a GET - /// against this resource, and 2) that the target Subnet has already - /// been delegated, and is not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Deletes a Swift Virtual Network connection from an app (or /// deployment slot). /// @@ -3726,47 +3804,6 @@ public partial interface IWebAppsOperations /// Task DeleteSwiftVirtualNetworkWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Integrates this Web App with a Virtual Network. This requires that - /// 1) "swiftSupported" is true when doing a GET against this resource, - /// and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. - /// This requires that 1) "swiftSupported" is true when doing a GET - /// against this resource, and 2) that the target Subnet has already - /// been delegated, and is not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all network features used by the app (or deployment slot, if /// specified). /// @@ -3781,7 +3818,7 @@ public partial interface IWebAppsOperations /// Name of the app. /// /// - /// The type of view. This can either be "summary" or "detailed". + /// The type of view. Only "summary" is supported at this time. /// /// /// The headers that will be added to request. @@ -4340,6 +4377,157 @@ public partial interface IWebAppsOperations /// Task> PutPrivateAccessVnetWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the list of private endpoint connections associated with a + /// site + /// + /// + /// Description for Gets the list of private endpoint connections + /// associated with a site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get list of processes for a web site, or a deployment slot, or for /// a specific scaled-out instance in a web site. /// @@ -4999,36 +5187,6 @@ public partial interface IWebAppsOperations /// Task DeleteSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot - /// of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config - /// properties to override the source slot config. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task CopyProductionSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets an app's deployment slots. /// /// @@ -5147,9 +5305,8 @@ public partial interface IWebAppsOperations /// If true, web app metrics are also deleted. /// /// - /// Specify true if the App Service plan will be empty after app - /// deletion and you want to delete the empty App Service plan. By - /// default, the empty App Service plan is not deleted. + /// Specify false if you want to keep empty App Service plan. By + /// default, empty App Service plan is deleted. /// /// /// The headers that will be added to request. @@ -5464,15 +5621,171 @@ public partial interface IWebAppsOperations /// /// Name of the app. /// - /// - /// ID of the backup. - /// - /// - /// Information on restore request . + /// + /// ID of the backup. + /// + /// + /// Information on restore request . + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API + /// will restore a backup of the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns whether Scm basic auth is allowed and whether Ftp is + /// allowed for a given site. + /// + /// + /// Description for Returns whether Scm basic auth is allowed and + /// whether Ftp is allowed for a given site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetBasicPublishingCredentialsPoliciesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns whether FTP is allowed on the site or not. + /// + /// + /// Description for Returns whether FTP is allowed on the site or not. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetFtpAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates whether FTP is allowed on the site or not. + /// + /// + /// Description for Updates whether FTP is allowed on the site or not. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateFtpAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns whether Scm basic auth is allowed on the site or not. + /// + /// + /// Description for Returns whether Scm basic auth is allowed on the + /// site or not. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetScmAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates whether user publishing credentials are allowed on the site + /// or not. + /// + /// + /// Description for Updates whether user publishing credentials are + /// allowed on the site or not. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// /// /// - /// Name of the deployment slot. If a slot is not specified, the API - /// will restore a backup of the production slot. /// /// /// The headers that will be added to request. @@ -5483,10 +5796,13 @@ public partial interface IWebAppsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task RestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateScmAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List the configurations of an app /// @@ -5895,6 +6211,133 @@ public partial interface IWebAppsOperations /// Task> GetBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetAppSettingsKeyVaultReferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// App Setting key name. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAppSettingKeyVaultReferenceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string appSettingKey, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetSiteConnectionStringKeyVaultReferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSiteConnectionStringKeyVaultReferenceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string connectionStringKey, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Replaces the connection strings of an app. /// /// @@ -8761,51 +9204,6 @@ public partial interface IWebAppsOperations /// Task> GetSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Integrates this Web App with a Virtual Network. This requires that - /// 1) "swiftSupported" is true when doing a GET against this resource, - /// and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. - /// This requires that 1) "swiftSupported" is true when doing a GET - /// against this resource, and 2) that the target Subnet has already - /// been delegated, and is not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API - /// will add or update connections for the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Deletes a Swift Virtual Network connection from an app (or /// deployment slot). /// @@ -8837,51 +9235,6 @@ public partial interface IWebAppsOperations /// Task DeleteSwiftVirtualNetworkSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Integrates this Web App with a Virtual Network. This requires that - /// 1) "swiftSupported" is true when doing a GET against this resource, - /// and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. - /// This requires that 1) "swiftSupported" is true when doing a GET - /// against this resource, and 2) that the target Subnet has already - /// been delegated, and is not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API - /// will add or update connections for the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all network features used by the app (or deployment slot, if /// specified). /// @@ -8896,7 +9249,7 @@ public partial interface IWebAppsOperations /// Name of the app. /// /// - /// The type of view. This can either be "summary" or "detailed". + /// The type of view. Only "summary" is supported at this time. /// /// /// Name of the deployment slot. If a slot is not specified, the API @@ -9522,6 +9875,39 @@ public partial interface IWebAppsOperations /// Task> PutPrivateAccessVnetSlotWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the list of private endpoint connections associated with a + /// site + /// + /// + /// Description for Gets the list of private endpoint connections + /// associated with a site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// Name of the site deployment slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a private endpoint connection /// /// @@ -9534,6 +9920,10 @@ public partial interface IWebAppsOperations /// Name of the site. /// /// + /// Name of the private endpoint connection. + /// + /// + /// Name of the site deployment slot. /// /// /// The headers that will be added to request. @@ -9550,7 +9940,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Approves or rejects a private endpoint connection /// @@ -9567,6 +9957,8 @@ public partial interface IWebAppsOperations /// /// /// + /// + /// /// /// The headers that will be added to request. /// @@ -9582,7 +9974,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a private endpoint connection /// @@ -9597,6 +9989,8 @@ public partial interface IWebAppsOperations /// /// /// + /// + /// /// /// The headers that will be added to request. /// @@ -9612,7 +10006,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the private link resources /// @@ -9625,6 +10019,8 @@ public partial interface IWebAppsOperations /// /// Name of the site. /// + /// + /// /// /// The headers that will be added to request. /// @@ -9640,7 +10036,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetPrivateLinkResourcesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get list of processes for a web site, or a deployment slot, or for /// a specific scaled-out instance in a web site. @@ -10367,43 +10763,9 @@ public partial interface IWebAppsOperations /// /// Site extension name. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API - /// deletes a deployment for the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot - /// of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config - /// properties to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production - /// slot is used as the source slot. + /// + /// Name of the deployment slot. If a slot is not specified, the API + /// deletes a deployment for the production slot. /// /// /// The headers that will be added to request. @@ -10417,7 +10779,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task CopySlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the difference in configuration settings between two web app /// slots. @@ -10635,6 +10997,8 @@ public partial interface IWebAppsOperations /// will delete the source control configuration for the production /// slot. /// + /// + /// /// /// The headers that will be added to request. /// @@ -10647,7 +11011,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task DeleteSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string additionalFlags = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the source control configuration of an app. /// @@ -11695,6 +12059,8 @@ public partial interface IWebAppsOperations /// /// Name of the app. /// + /// + /// /// /// The headers that will be added to request. /// @@ -11707,7 +12073,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task DeleteSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, string additionalFlags = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the source control configuration of an app. /// @@ -12769,6 +13135,68 @@ public partial interface IWebAppsOperations /// Task>> BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Restores an app from a backup blob in Azure Storage. /// /// @@ -12887,36 +13315,6 @@ public partial interface IWebAppsOperations /// Task> BeginInstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot - /// of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config - /// properties to override the source slot config. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginCopyProductionSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Creates a new web, mobile, or API app in an existing resource /// group, or updates an existing app. /// @@ -13189,6 +13587,8 @@ public partial interface IWebAppsOperations /// /// /// + /// + /// /// /// The headers that will be added to request. /// @@ -13204,7 +13604,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a private endpoint connection /// @@ -13219,6 +13619,8 @@ public partial interface IWebAppsOperations /// /// /// + /// + /// /// /// The headers that will be added to request. /// @@ -13234,7 +13636,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Restores an app from a backup blob in Azure Storage. /// @@ -13370,40 +13772,6 @@ public partial interface IWebAppsOperations /// Task> BeginInstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot - /// of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config - /// properties to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production - /// slot is used as the source slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginCopySlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Swaps two deployment slots of an app. /// /// @@ -13709,6 +14077,58 @@ public partial interface IWebAppsOperations /// Task>> ListConfigurationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetAppSettingsKeyVaultReferencesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetSiteConnectionStringKeyVaultReferencesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a list of web app configuration snapshots identifiers. Each /// element of the list contains a timestamp and the ID of the /// snapshot. @@ -14024,6 +14444,33 @@ public partial interface IWebAppsOperations /// Task>> ListPerfMonCountersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the list of private endpoint connections associated with a + /// site + /// + /// + /// Description for Gets the list of private endpoint connections + /// associated with a site + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get list of processes for a web site, or a deployment slot, or for /// a specific scaled-out instance in a web site. /// @@ -14233,6 +14680,58 @@ public partial interface IWebAppsOperations /// Task>> ListConfigurationsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetAppSettingsKeyVaultReferencesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetSiteConnectionStringKeyVaultReferencesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a list of web app configuration snapshots identifiers. Each /// element of the list contains a timestamp and the ID of the /// snapshot. @@ -14548,6 +15047,33 @@ public partial interface IWebAppsOperations /// Task>> ListPerfMonCountersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the list of private endpoint connections associated with a + /// site + /// + /// + /// Description for Gets the list of private endpoint connections + /// associated with a site + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get list of processes for a web site, or a deployment slot, or for /// a specific scaled-out instance in a web site. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs index 3481e85ddd9b..2c6b10eea2a4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs @@ -79,6 +79,11 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// IAppServiceCertificateOrdersOperations AppServiceCertificateOrders { get; } + /// + /// Gets the ICertificateOrdersDiagnosticsOperations. + /// + ICertificateOrdersDiagnosticsOperations CertificateOrdersDiagnostics { get; } + /// /// Gets the ICertificateRegistrationProviderOperations. /// @@ -114,6 +119,11 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// IDiagnosticsOperations Diagnostics { get; } + /// + /// Gets the IGlobalModelOperations. + /// + IGlobalModelOperations GlobalModel { get; } + /// /// Gets the IProviderOperations. /// @@ -149,6 +159,27 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// IResourceHealthMetadataOperations ResourceHealthMetadata { get; } + /// + /// Exchange code for GitHub access token for AppService CLI + /// + /// + /// Description for Exchange code for GitHub access token for + /// AppService CLI + /// + /// + /// Code string to exchange for Github Access token + /// + /// + /// State string used for verification. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GenerateGithubAccessTokenForAppserviceCLIAsyncWithHttpMessagesAsync(string code, string state, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets publishing user /// @@ -302,7 +333,8 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// /// Name of SKU used to filter the regions. Possible values include: /// 'Free', 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', - /// 'Isolated', 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' + /// 'Isolated', 'IsolatedV2', 'PremiumV2', 'PremiumV3', + /// 'PremiumContainer', 'ElasticPremium', 'ElasticIsolated' /// /// /// Specify <code>true</code> if you want to filter to only diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AccessControlEntryAction.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AccessControlEntryAction.cs deleted file mode 100644 index d9b41f1ca064..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AccessControlEntryAction.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for AccessControlEntryAction. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum AccessControlEntryAction - { - [EnumMember(Value = "Permit")] - Permit, - [EnumMember(Value = "Deny")] - Deny - } - internal static class AccessControlEntryActionEnumExtension - { - internal static string ToSerializedValue(this AccessControlEntryAction? value) - { - return value == null ? null : ((AccessControlEntryAction)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this AccessControlEntryAction value) - { - switch( value ) - { - case AccessControlEntryAction.Permit: - return "Permit"; - case AccessControlEntryAction.Deny: - return "Deny"; - } - return null; - } - - internal static AccessControlEntryAction? ParseAccessControlEntryAction(this string value) - { - switch( value ) - { - case "Permit": - return AccessControlEntryAction.Permit; - case "Deny": - return AccessControlEntryAction.Deny; - } - return null; - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs new file mode 100644 index 000000000000..bfd067ed6a02 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs @@ -0,0 +1,117 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Description of site key vault references. + /// + [Rest.Serialization.JsonTransformation] + public partial class ApiKVReference : ProxyOnlyResource + { + /// + /// Initializes a new instance of the ApiKVReference class. + /// + public ApiKVReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiKVReference class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Possible values include: 'Initialized', + /// 'Resolved', 'InvalidSyntax', 'MSINotEnabled', 'VaultNotFound', + /// 'SecretNotFound', 'SecretVersionNotFound', + /// 'AccessToKeyVaultDenied', 'OtherReasons', 'FetchTimedOut', + /// 'UnauthorizedClient' + /// Possible values include: 'KeyVault' + public ApiKVReference(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string reference = default(string), ResolveStatus? status = default(ResolveStatus?), string vaultName = default(string), string secretName = default(string), string secretVersion = default(string), ManagedServiceIdentity identityType = default(ManagedServiceIdentity), string details = default(string), ConfigReferenceSource? source = default(ConfigReferenceSource?), string activeVersion = default(string)) + : base(id, name, kind, type) + { + Reference = reference; + Status = status; + VaultName = vaultName; + SecretName = secretName; + SecretVersion = secretVersion; + IdentityType = identityType; + Details = details; + Source = source; + ActiveVersion = activeVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.reference")] + public string Reference { get; set; } + + /// + /// Gets or sets possible values include: 'Initialized', 'Resolved', + /// 'InvalidSyntax', 'MSINotEnabled', 'VaultNotFound', + /// 'SecretNotFound', 'SecretVersionNotFound', + /// 'AccessToKeyVaultDenied', 'OtherReasons', 'FetchTimedOut', + /// 'UnauthorizedClient' + /// + [JsonProperty(PropertyName = "properties.status")] + public ResolveStatus? Status { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.vaultName")] + public string VaultName { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.secretName")] + public string SecretName { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.secretVersion")] + public string SecretVersion { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.identityType")] + public ManagedServiceIdentity IdentityType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.details")] + public string Details { get; set; } + + /// + /// Gets or sets possible values include: 'KeyVault' + /// + [JsonProperty(PropertyName = "properties.source")] + public ConfigReferenceSource? Source { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.activeVersion")] + public string ActiveVersion { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs new file mode 100644 index 000000000000..ba4ae64ca04e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// App Insights Web App stack settings. + /// + public partial class AppInsightsWebAppStackSettings + { + /// + /// Initializes a new instance of the AppInsightsWebAppStackSettings + /// class. + /// + public AppInsightsWebAppStackSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AppInsightsWebAppStackSettings + /// class. + /// + /// <code>true</code> if remote + /// Application Insights is supported for the stack; otherwise, + /// <code>false</code>. + /// <code>true</code> if + /// Application Insights is disabled by default for the stack; + /// otherwise, <code>false</code>. + public AppInsightsWebAppStackSettings(bool? isSupported = default(bool?), bool? isDefaultOff = default(bool?)) + { + IsSupported = isSupported; + IsDefaultOff = isDefaultOff; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if remote + /// Application Insights is supported for the stack; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isSupported")] + public bool? IsSupported { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if Application + /// Insights is disabled by default for the stack; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDefaultOff")] + public bool? IsDefaultOff { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs index fba67b6ee17a..aee5531d6910 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs @@ -48,8 +48,8 @@ public AppServiceCertificateOrder() /// name. /// Domain verification /// token. - /// Duration in years (must be between 1 - /// and 3). + /// Duration in years (must be + /// 1). /// Certificate key size. /// <code>true</code> if the /// certificate should be automatically renewed when it expires; @@ -78,7 +78,8 @@ public AppServiceCertificateOrder() /// moment. /// Time stamp when the /// certificate would be auto renewed next - public AppServiceCertificateOrder(string location, CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?)) + /// Contact info + public AppServiceCertificateOrder(string location, CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?), CertificateOrderContact contact = default(CertificateOrderContact)) : base(location, id, name, kind, type, tags) { Certificates = certificates; @@ -100,6 +101,7 @@ public AppServiceCertificateOrder() IsPrivateKeyExternal = isPrivateKeyExternal; AppServiceCertificateNotRenewableReasons = appServiceCertificateNotRenewableReasons; NextAutoRenewalTimeStamp = nextAutoRenewalTimeStamp; + Contact = contact; CustomInit(); } @@ -127,7 +129,7 @@ public AppServiceCertificateOrder() public string DomainVerificationToken { get; private set; } /// - /// Gets or sets duration in years (must be between 1 and 3). + /// Gets or sets duration in years (must be 1). /// [JsonProperty(PropertyName = "properties.validityInYears")] public int? ValidityInYears { get; set; } @@ -232,6 +234,12 @@ public AppServiceCertificateOrder() [JsonProperty(PropertyName = "properties.nextAutoRenewalTimeStamp")] public System.DateTime? NextAutoRenewalTimeStamp { get; private set; } + /// + /// Gets contact info + /// + [JsonProperty(PropertyName = "properties.contact")] + public CertificateOrderContact Contact { get; private set; } + /// /// Validate the object. /// @@ -241,14 +249,6 @@ public AppServiceCertificateOrder() public override void Validate() { base.Validate(); - if (ValidityInYears > 3) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ValidityInYears", 3); - } - if (ValidityInYears < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ValidityInYears", 1); - } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs index a9284452f4d4..0badb4580486 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs @@ -48,8 +48,8 @@ public AppServiceCertificateOrderPatchResource() /// name. /// Domain verification /// token. - /// Duration in years (must be between 1 - /// and 3). + /// Duration in years (must be + /// 1). /// Certificate key size. /// <code>true</code> if the /// certificate should be automatically renewed when it expires; @@ -78,7 +78,8 @@ public AppServiceCertificateOrderPatchResource() /// moment. /// Time stamp when the /// certificate would be auto renewed next - public AppServiceCertificateOrderPatchResource(CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?)) + /// Contact info + public AppServiceCertificateOrderPatchResource(CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?), CertificateOrderContact contact = default(CertificateOrderContact)) : base(id, name, kind, type) { Certificates = certificates; @@ -100,6 +101,7 @@ public AppServiceCertificateOrderPatchResource() IsPrivateKeyExternal = isPrivateKeyExternal; AppServiceCertificateNotRenewableReasons = appServiceCertificateNotRenewableReasons; NextAutoRenewalTimeStamp = nextAutoRenewalTimeStamp; + Contact = contact; CustomInit(); } @@ -127,7 +129,7 @@ public AppServiceCertificateOrderPatchResource() public string DomainVerificationToken { get; private set; } /// - /// Gets or sets duration in years (must be between 1 and 3). + /// Gets or sets duration in years (must be 1). /// [JsonProperty(PropertyName = "properties.validityInYears")] public int? ValidityInYears { get; set; } @@ -232,6 +234,12 @@ public AppServiceCertificateOrderPatchResource() [JsonProperty(PropertyName = "properties.nextAutoRenewalTimeStamp")] public System.DateTime? NextAutoRenewalTimeStamp { get; private set; } + /// + /// Gets contact info + /// + [JsonProperty(PropertyName = "properties.contact")] + public CertificateOrderContact Contact { get; private set; } + /// /// Validate the object. /// @@ -240,14 +248,6 @@ public AppServiceCertificateOrderPatchResource() /// public virtual void Validate() { - if (ValidityInYears > 3) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ValidityInYears", 3); - } - if (ValidityInYears < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ValidityInYears", 1); - } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs index d7562b769f24..312d9255fffd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs @@ -32,132 +32,58 @@ public AppServiceEnvironment() /// /// Initializes a new instance of the AppServiceEnvironment class. /// - /// Name of the App Service Environment. - /// Location of the App Service Environment, - /// e.g. "West US". /// Description of the Virtual /// Network. - /// Description of worker pools with worker - /// size IDs, VM sizes, and number of workers in each pool. /// Provisioning state of the App /// Service Environment. Possible values include: 'Succeeded', /// 'Failed', 'Canceled', 'InProgress', 'Deleting' /// Current status of the App Service Environment. /// Possible values include: 'Preparing', 'Ready', 'Scaling', /// 'Deleting' - /// Name of the Virtual Network for the App - /// Service Environment. - /// Resource group of the Virtual - /// Network. - /// Subnet of the Virtual Network. /// Specifies which endpoints /// to serve internally in the Virtual Network for the App Service /// Environment. Possible values include: 'None', 'Web', 'Publishing', - /// 'Web,Publishing' + /// 'Web, Publishing' /// Front-end VM size, e.g. "Medium", /// "Large". /// Number of front-end instances. /// Number of IP SSL addresses reserved /// for the App Service Environment. - /// Edition of the metadata database for - /// the App Service Environment, e.g. "Standard". - /// Service objective of the - /// metadata database for the App Service Environment, e.g. - /// "S0". - /// Number of upgrade domains of the App - /// Service Environment. - /// Subscription of the App Service - /// Environment. /// DNS suffix of the App Service /// Environment. - /// Last deployment action on the App Service - /// Environment. - /// Result of the last deployment action - /// on the App Service Environment. - /// List of comma separated strings - /// describing which VM sizes are allowed for front-ends. - /// List of comma separated strings - /// describing which VM sizes are allowed for workers. /// Maximum number of VMs in the /// App Service Environment. - /// Description of IP SSL mapping for the App - /// Service Environment. - /// Current total, used, and - /// available worker capacities. - /// Access control list for - /// controlling traffic to the App Service Environment. - /// True/false indicating whether - /// the App Service Environment is healthy. - /// Detailed message about with results - /// of the last check of the App Service Environment. - /// Resource group of the App Service - /// Environment. /// Scale factor for /// front-ends. - /// Default Scale Factor for - /// FrontEnds. - /// API Management Account - /// associated with the App Service Environment. /// <code>true</code> if the App /// Service Environment is suspended; otherwise, /// <code>false</code>. The environment can be suspended, /// e.g. when the management endpoint is no longer available /// (most likely because NSG blocked the incoming traffic). - /// True/false indicating whether the - /// App Service Environment is suspended. The environment can be - /// suspended e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). /// Custom settings for changing the /// behavior of the App Service Environment. /// User added ip ranges to /// whitelist on ASE db /// Flag that displays whether an ASE has /// linux workers or not - /// Key Vault ID for ILB App Service - /// Environment default SSL certificate - /// Key Vault Secret Name for - /// ILB App Service Environment default SSL certificate - public AppServiceEnvironment(string name, string location, VirtualNetworkProfile virtualNetwork, IList workerPools, ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) + /// Dedicated Host Count + public AppServiceEnvironment(VirtualNetworkProfile virtualNetwork, ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string dnsSuffix = default(string), int? maximumNumberOfMachines = default(int?), int? frontEndScaleFactor = default(int?), bool? suspended = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), int? dedicatedHostCount = default(int?)) { - Name = name; - Location = location; ProvisioningState = provisioningState; Status = status; - VnetName = vnetName; - VnetResourceGroupName = vnetResourceGroupName; - VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; - WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; - DatabaseEdition = databaseEdition; - DatabaseServiceObjective = databaseServiceObjective; - UpgradeDomains = upgradeDomains; - SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; - LastAction = lastAction; - LastActionResult = lastActionResult; - AllowedMultiSizes = allowedMultiSizes; - AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; - VipMappings = vipMappings; - EnvironmentCapacities = environmentCapacities; - NetworkAccessControlList = networkAccessControlList; - EnvironmentIsHealthy = environmentIsHealthy; - EnvironmentStatus = environmentStatus; - ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; - DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; - ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; - DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - SslCertKeyVaultId = sslCertKeyVaultId; - SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; + DedicatedHostCount = dedicatedHostCount; CustomInit(); } @@ -166,19 +92,6 @@ public AppServiceEnvironment() /// partial void CustomInit(); - /// - /// Gets or sets name of the App Service Environment. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets location of the App Service Environment, e.g. "West - /// US". - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - /// /// Gets provisioning state of the App Service Environment. Possible /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', @@ -194,25 +107,6 @@ public AppServiceEnvironment() [JsonProperty(PropertyName = "status")] public HostingEnvironmentStatus? Status { get; private set; } - /// - /// Gets or sets name of the Virtual Network for the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "vnetName")] - public string VnetName { get; set; } - - /// - /// Gets or sets resource group of the Virtual Network. - /// - [JsonProperty(PropertyName = "vnetResourceGroupName")] - public string VnetResourceGroupName { get; set; } - - /// - /// Gets or sets subnet of the Virtual Network. - /// - [JsonProperty(PropertyName = "vnetSubnetName")] - public string VnetSubnetName { get; set; } - /// /// Gets or sets description of the Virtual Network. /// @@ -222,7 +116,7 @@ public AppServiceEnvironment() /// /// Gets or sets specifies which endpoints to serve internally in the /// Virtual Network for the App Service Environment. Possible values - /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' + /// include: 'None', 'Web', 'Publishing', 'Web, Publishing' /// [JsonProperty(PropertyName = "internalLoadBalancingMode")] public string InternalLoadBalancingMode { get; set; } @@ -234,17 +128,10 @@ public AppServiceEnvironment() public string MultiSize { get; set; } /// - /// Gets or sets number of front-end instances. + /// Gets number of front-end instances. /// [JsonProperty(PropertyName = "multiRoleCount")] - public int? MultiRoleCount { get; set; } - - /// - /// Gets or sets description of worker pools with worker size IDs, VM - /// sizes, and number of workers in each pool. - /// - [JsonProperty(PropertyName = "workerPools")] - public IList WorkerPools { get; set; } + public int? MultiRoleCount { get; private set; } /// /// Gets or sets number of IP SSL addresses reserved for the App @@ -253,110 +140,18 @@ public AppServiceEnvironment() [JsonProperty(PropertyName = "ipsslAddressCount")] public int? IpsslAddressCount { get; set; } - /// - /// Gets edition of the metadata database for the App Service - /// Environment, e.g. "Standard". - /// - [JsonProperty(PropertyName = "databaseEdition")] - public string DatabaseEdition { get; private set; } - - /// - /// Gets service objective of the metadata database for the App Service - /// Environment, e.g. "S0". - /// - [JsonProperty(PropertyName = "databaseServiceObjective")] - public string DatabaseServiceObjective { get; private set; } - - /// - /// Gets number of upgrade domains of the App Service Environment. - /// - [JsonProperty(PropertyName = "upgradeDomains")] - public int? UpgradeDomains { get; private set; } - - /// - /// Gets subscription of the App Service Environment. - /// - [JsonProperty(PropertyName = "subscriptionId")] - public string SubscriptionId { get; private set; } - /// /// Gets or sets DNS suffix of the App Service Environment. /// [JsonProperty(PropertyName = "dnsSuffix")] public string DnsSuffix { get; set; } - /// - /// Gets last deployment action on the App Service Environment. - /// - [JsonProperty(PropertyName = "lastAction")] - public string LastAction { get; private set; } - - /// - /// Gets result of the last deployment action on the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "lastActionResult")] - public string LastActionResult { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for front-ends. - /// - [JsonProperty(PropertyName = "allowedMultiSizes")] - public string AllowedMultiSizes { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for workers. - /// - [JsonProperty(PropertyName = "allowedWorkerSizes")] - public string AllowedWorkerSizes { get; private set; } - /// /// Gets maximum number of VMs in the App Service Environment. /// [JsonProperty(PropertyName = "maximumNumberOfMachines")] public int? MaximumNumberOfMachines { get; private set; } - /// - /// Gets description of IP SSL mapping for the App Service Environment. - /// - [JsonProperty(PropertyName = "vipMappings")] - public IList VipMappings { get; private set; } - - /// - /// Gets current total, used, and available worker capacities. - /// - [JsonProperty(PropertyName = "environmentCapacities")] - public IList EnvironmentCapacities { get; private set; } - - /// - /// Gets or sets access control list for controlling traffic to the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "networkAccessControlList")] - public IList NetworkAccessControlList { get; set; } - - /// - /// Gets true/false indicating whether the App Service Environment is - /// healthy. - /// - [JsonProperty(PropertyName = "environmentIsHealthy")] - public bool? EnvironmentIsHealthy { get; private set; } - - /// - /// Gets detailed message about with results of the last check of the - /// App Service Environment. - /// - [JsonProperty(PropertyName = "environmentStatus")] - public string EnvironmentStatus { get; private set; } - - /// - /// Gets resource group of the App Service Environment. - /// - [JsonProperty(PropertyName = "resourceGroup")] - public string ResourceGroup { get; private set; } - /// /// Gets or sets scale factor for front-ends. /// @@ -364,37 +159,15 @@ public AppServiceEnvironment() public int? FrontEndScaleFactor { get; set; } /// - /// Gets default Scale Factor for FrontEnds. - /// - [JsonProperty(PropertyName = "defaultFrontEndScaleFactor")] - public int? DefaultFrontEndScaleFactor { get; private set; } - - /// - /// Gets or sets API Management Account associated with the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "apiManagementAccountId")] - public string ApiManagementAccountId { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// App Service Environment is suspended; otherwise, + /// Gets &lt;code&gt;true&lt;/code&gt; if the App + /// Service Environment is suspended; otherwise, /// &lt;code&gt;false&lt;/code&gt;. The environment can /// be suspended, e.g. when the management endpoint is no longer /// available /// (most likely because NSG blocked the incoming traffic). /// [JsonProperty(PropertyName = "suspended")] - public bool? Suspended { get; set; } - - /// - /// Gets or sets true/false indicating whether the App Service - /// Environment is suspended. The environment can be suspended e.g. - /// when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - [JsonProperty(PropertyName = "dynamicCacheEnabled")] - public bool? DynamicCacheEnabled { get; set; } + public bool? Suspended { get; private set; } /// /// Gets or sets custom settings for changing the behavior of the App @@ -410,25 +183,16 @@ public AppServiceEnvironment() public IList UserWhitelistedIpRanges { get; set; } /// - /// Gets or sets flag that displays whether an ASE has linux workers or - /// not + /// Gets flag that displays whether an ASE has linux workers or not /// [JsonProperty(PropertyName = "hasLinuxWorkers")] - public bool? HasLinuxWorkers { get; set; } - - /// - /// Gets or sets key Vault ID for ILB App Service Environment default - /// SSL certificate - /// - [JsonProperty(PropertyName = "sslCertKeyVaultId")] - public string SslCertKeyVaultId { get; set; } + public bool? HasLinuxWorkers { get; private set; } /// - /// Gets or sets key Vault Secret Name for ILB App Service Environment - /// default SSL certificate + /// Gets dedicated Host Count /// - [JsonProperty(PropertyName = "sslCertKeyVaultSecretName")] - public string SslCertKeyVaultSecretName { get; set; } + [JsonProperty(PropertyName = "dedicatedHostCount")] + public int? DedicatedHostCount { get; private set; } /// /// Validate the object. @@ -438,21 +202,13 @@ public AppServiceEnvironment() /// public virtual void Validate() { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } if (VirtualNetwork == null) { throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); } - if (WorkerPools == null) + if (VirtualNetwork != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); + VirtualNetwork.Validate(); } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs index bf9e55680b03..724562c731b2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs @@ -36,14 +36,8 @@ public AppServiceEnvironmentPatchResource() /// Initializes a new instance of the /// AppServiceEnvironmentPatchResource class. /// - /// Name of the - /// App Service Environment. - /// Location of the App Service Environment, - /// e.g. "West US". /// Description of the Virtual /// Network. - /// Description of worker pools with worker - /// size IDs, VM sizes, and number of workers in each pool. /// Resource Id. /// Resource Name. /// Kind of resource. @@ -54,120 +48,51 @@ public AppServiceEnvironmentPatchResource() /// Current status of the App Service Environment. /// Possible values include: 'Preparing', 'Ready', 'Scaling', /// 'Deleting' - /// Name of the Virtual Network for the App - /// Service Environment. - /// Resource group of the Virtual - /// Network. - /// Subnet of the Virtual Network. /// Specifies which endpoints /// to serve internally in the Virtual Network for the App Service /// Environment. Possible values include: 'None', 'Web', 'Publishing', - /// 'Web,Publishing' + /// 'Web, Publishing' /// Front-end VM size, e.g. "Medium", /// "Large". /// Number of front-end instances. /// Number of IP SSL addresses reserved /// for the App Service Environment. - /// Edition of the metadata database for - /// the App Service Environment, e.g. "Standard". - /// Service objective of the - /// metadata database for the App Service Environment, e.g. - /// "S0". - /// Number of upgrade domains of the App - /// Service Environment. - /// Subscription of the App Service - /// Environment. /// DNS suffix of the App Service /// Environment. - /// Last deployment action on the App Service - /// Environment. - /// Result of the last deployment action - /// on the App Service Environment. - /// List of comma separated strings - /// describing which VM sizes are allowed for front-ends. - /// List of comma separated strings - /// describing which VM sizes are allowed for workers. /// Maximum number of VMs in the /// App Service Environment. - /// Description of IP SSL mapping for the App - /// Service Environment. - /// Current total, used, and - /// available worker capacities. - /// Access control list for - /// controlling traffic to the App Service Environment. - /// True/false indicating whether - /// the App Service Environment is healthy. - /// Detailed message about with results - /// of the last check of the App Service Environment. - /// Resource group of the App Service - /// Environment. /// Scale factor for /// front-ends. - /// Default Scale Factor for - /// FrontEnds. - /// API Management Account - /// associated with the App Service Environment. /// <code>true</code> if the App /// Service Environment is suspended; otherwise, /// <code>false</code>. The environment can be suspended, /// e.g. when the management endpoint is no longer available /// (most likely because NSG blocked the incoming traffic). - /// True/false indicating whether the - /// App Service Environment is suspended. The environment can be - /// suspended e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). /// Custom settings for changing the /// behavior of the App Service Environment. /// User added ip ranges to /// whitelist on ASE db /// Flag that displays whether an ASE has /// linux workers or not - /// Key Vault ID for ILB App Service - /// Environment default SSL certificate - /// Key Vault Secret Name for - /// ILB App Service Environment default SSL certificate - public AppServiceEnvironmentPatchResource(string appServiceEnvironmentPatchResourceName, string location, VirtualNetworkProfile virtualNetwork, IList workerPools, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) + /// Dedicated Host Count + public AppServiceEnvironmentPatchResource(VirtualNetworkProfile virtualNetwork, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string dnsSuffix = default(string), int? maximumNumberOfMachines = default(int?), int? frontEndScaleFactor = default(int?), bool? suspended = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), int? dedicatedHostCount = default(int?)) : base(id, name, kind, type) { - AppServiceEnvironmentPatchResourceName = appServiceEnvironmentPatchResourceName; - Location = location; ProvisioningState = provisioningState; Status = status; - VnetName = vnetName; - VnetResourceGroupName = vnetResourceGroupName; - VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; - WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; - DatabaseEdition = databaseEdition; - DatabaseServiceObjective = databaseServiceObjective; - UpgradeDomains = upgradeDomains; - SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; - LastAction = lastAction; - LastActionResult = lastActionResult; - AllowedMultiSizes = allowedMultiSizes; - AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; - VipMappings = vipMappings; - EnvironmentCapacities = environmentCapacities; - NetworkAccessControlList = networkAccessControlList; - EnvironmentIsHealthy = environmentIsHealthy; - EnvironmentStatus = environmentStatus; - ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; - DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; - ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; - DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - SslCertKeyVaultId = sslCertKeyVaultId; - SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; + DedicatedHostCount = dedicatedHostCount; CustomInit(); } @@ -176,19 +101,6 @@ public AppServiceEnvironmentPatchResource() /// partial void CustomInit(); - /// - /// Gets or sets name of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.name")] - public string AppServiceEnvironmentPatchResourceName { get; set; } - - /// - /// Gets or sets location of the App Service Environment, e.g. "West - /// US". - /// - [JsonProperty(PropertyName = "properties.location")] - public string Location { get; set; } - /// /// Gets provisioning state of the App Service Environment. Possible /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', @@ -204,25 +116,6 @@ public AppServiceEnvironmentPatchResource() [JsonProperty(PropertyName = "properties.status")] public HostingEnvironmentStatus? Status { get; private set; } - /// - /// Gets or sets name of the Virtual Network for the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.vnetName")] - public string VnetName { get; set; } - - /// - /// Gets or sets resource group of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.vnetResourceGroupName")] - public string VnetResourceGroupName { get; set; } - - /// - /// Gets or sets subnet of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.vnetSubnetName")] - public string VnetSubnetName { get; set; } - /// /// Gets or sets description of the Virtual Network. /// @@ -232,7 +125,7 @@ public AppServiceEnvironmentPatchResource() /// /// Gets or sets specifies which endpoints to serve internally in the /// Virtual Network for the App Service Environment. Possible values - /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' + /// include: 'None', 'Web', 'Publishing', 'Web, Publishing' /// [JsonProperty(PropertyName = "properties.internalLoadBalancingMode")] public string InternalLoadBalancingMode { get; set; } @@ -244,17 +137,10 @@ public AppServiceEnvironmentPatchResource() public string MultiSize { get; set; } /// - /// Gets or sets number of front-end instances. + /// Gets number of front-end instances. /// [JsonProperty(PropertyName = "properties.multiRoleCount")] - public int? MultiRoleCount { get; set; } - - /// - /// Gets or sets description of worker pools with worker size IDs, VM - /// sizes, and number of workers in each pool. - /// - [JsonProperty(PropertyName = "properties.workerPools")] - public IList WorkerPools { get; set; } + public int? MultiRoleCount { get; private set; } /// /// Gets or sets number of IP SSL addresses reserved for the App @@ -263,110 +149,18 @@ public AppServiceEnvironmentPatchResource() [JsonProperty(PropertyName = "properties.ipsslAddressCount")] public int? IpsslAddressCount { get; set; } - /// - /// Gets edition of the metadata database for the App Service - /// Environment, e.g. "Standard". - /// - [JsonProperty(PropertyName = "properties.databaseEdition")] - public string DatabaseEdition { get; private set; } - - /// - /// Gets service objective of the metadata database for the App Service - /// Environment, e.g. "S0". - /// - [JsonProperty(PropertyName = "properties.databaseServiceObjective")] - public string DatabaseServiceObjective { get; private set; } - - /// - /// Gets number of upgrade domains of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.upgradeDomains")] - public int? UpgradeDomains { get; private set; } - - /// - /// Gets subscription of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.subscriptionId")] - public string SubscriptionId { get; private set; } - /// /// Gets or sets DNS suffix of the App Service Environment. /// [JsonProperty(PropertyName = "properties.dnsSuffix")] public string DnsSuffix { get; set; } - /// - /// Gets last deployment action on the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.lastAction")] - public string LastAction { get; private set; } - - /// - /// Gets result of the last deployment action on the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.lastActionResult")] - public string LastActionResult { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for front-ends. - /// - [JsonProperty(PropertyName = "properties.allowedMultiSizes")] - public string AllowedMultiSizes { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for workers. - /// - [JsonProperty(PropertyName = "properties.allowedWorkerSizes")] - public string AllowedWorkerSizes { get; private set; } - /// /// Gets maximum number of VMs in the App Service Environment. /// [JsonProperty(PropertyName = "properties.maximumNumberOfMachines")] public int? MaximumNumberOfMachines { get; private set; } - /// - /// Gets description of IP SSL mapping for the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.vipMappings")] - public IList VipMappings { get; private set; } - - /// - /// Gets current total, used, and available worker capacities. - /// - [JsonProperty(PropertyName = "properties.environmentCapacities")] - public IList EnvironmentCapacities { get; private set; } - - /// - /// Gets or sets access control list for controlling traffic to the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "properties.networkAccessControlList")] - public IList NetworkAccessControlList { get; set; } - - /// - /// Gets true/false indicating whether the App Service Environment is - /// healthy. - /// - [JsonProperty(PropertyName = "properties.environmentIsHealthy")] - public bool? EnvironmentIsHealthy { get; private set; } - - /// - /// Gets detailed message about with results of the last check of the - /// App Service Environment. - /// - [JsonProperty(PropertyName = "properties.environmentStatus")] - public string EnvironmentStatus { get; private set; } - - /// - /// Gets resource group of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.resourceGroup")] - public string ResourceGroup { get; private set; } - /// /// Gets or sets scale factor for front-ends. /// @@ -374,37 +168,15 @@ public AppServiceEnvironmentPatchResource() public int? FrontEndScaleFactor { get; set; } /// - /// Gets default Scale Factor for FrontEnds. - /// - [JsonProperty(PropertyName = "properties.defaultFrontEndScaleFactor")] - public int? DefaultFrontEndScaleFactor { get; private set; } - - /// - /// Gets or sets API Management Account associated with the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.apiManagementAccountId")] - public string ApiManagementAccountId { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// App Service Environment is suspended; otherwise, + /// Gets &lt;code&gt;true&lt;/code&gt; if the App + /// Service Environment is suspended; otherwise, /// &lt;code&gt;false&lt;/code&gt;. The environment can /// be suspended, e.g. when the management endpoint is no longer /// available /// (most likely because NSG blocked the incoming traffic). /// [JsonProperty(PropertyName = "properties.suspended")] - public bool? Suspended { get; set; } - - /// - /// Gets or sets true/false indicating whether the App Service - /// Environment is suspended. The environment can be suspended e.g. - /// when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - [JsonProperty(PropertyName = "properties.dynamicCacheEnabled")] - public bool? DynamicCacheEnabled { get; set; } + public bool? Suspended { get; private set; } /// /// Gets or sets custom settings for changing the behavior of the App @@ -420,25 +192,16 @@ public AppServiceEnvironmentPatchResource() public IList UserWhitelistedIpRanges { get; set; } /// - /// Gets or sets flag that displays whether an ASE has linux workers or - /// not + /// Gets flag that displays whether an ASE has linux workers or not /// [JsonProperty(PropertyName = "properties.hasLinuxWorkers")] - public bool? HasLinuxWorkers { get; set; } - - /// - /// Gets or sets key Vault ID for ILB App Service Environment default - /// SSL certificate - /// - [JsonProperty(PropertyName = "properties.sslCertKeyVaultId")] - public string SslCertKeyVaultId { get; set; } + public bool? HasLinuxWorkers { get; private set; } /// - /// Gets or sets key Vault Secret Name for ILB App Service Environment - /// default SSL certificate + /// Gets dedicated Host Count /// - [JsonProperty(PropertyName = "properties.sslCertKeyVaultSecretName")] - public string SslCertKeyVaultSecretName { get; set; } + [JsonProperty(PropertyName = "properties.dedicatedHostCount")] + public int? DedicatedHostCount { get; private set; } /// /// Validate the object. @@ -448,21 +211,13 @@ public AppServiceEnvironmentPatchResource() /// public virtual void Validate() { - if (AppServiceEnvironmentPatchResourceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentPatchResourceName"); - } - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } if (VirtualNetwork == null) { throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); } - if (WorkerPools == null) + if (VirtualNetwork != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); + VirtualNetwork.Validate(); } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs index 910c484a40d3..25cb6fbebdb6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs @@ -37,14 +37,8 @@ public AppServiceEnvironmentResource() /// class. /// /// Resource Location. - /// Name of the App - /// Service Environment. - /// Location of the - /// App Service Environment, e.g. "West US". /// Description of the Virtual /// Network. - /// Description of worker pools with worker - /// size IDs, VM sizes, and number of workers in each pool. /// Resource Id. /// Resource Name. /// Kind of resource. @@ -56,120 +50,51 @@ public AppServiceEnvironmentResource() /// Current status of the App Service Environment. /// Possible values include: 'Preparing', 'Ready', 'Scaling', /// 'Deleting' - /// Name of the Virtual Network for the App - /// Service Environment. - /// Resource group of the Virtual - /// Network. - /// Subnet of the Virtual Network. /// Specifies which endpoints /// to serve internally in the Virtual Network for the App Service /// Environment. Possible values include: 'None', 'Web', 'Publishing', - /// 'Web,Publishing' + /// 'Web, Publishing' /// Front-end VM size, e.g. "Medium", /// "Large". /// Number of front-end instances. /// Number of IP SSL addresses reserved /// for the App Service Environment. - /// Edition of the metadata database for - /// the App Service Environment, e.g. "Standard". - /// Service objective of the - /// metadata database for the App Service Environment, e.g. - /// "S0". - /// Number of upgrade domains of the App - /// Service Environment. - /// Subscription of the App Service - /// Environment. /// DNS suffix of the App Service /// Environment. - /// Last deployment action on the App Service - /// Environment. - /// Result of the last deployment action - /// on the App Service Environment. - /// List of comma separated strings - /// describing which VM sizes are allowed for front-ends. - /// List of comma separated strings - /// describing which VM sizes are allowed for workers. /// Maximum number of VMs in the /// App Service Environment. - /// Description of IP SSL mapping for the App - /// Service Environment. - /// Current total, used, and - /// available worker capacities. - /// Access control list for - /// controlling traffic to the App Service Environment. - /// True/false indicating whether - /// the App Service Environment is healthy. - /// Detailed message about with results - /// of the last check of the App Service Environment. - /// Resource group of the App Service - /// Environment. /// Scale factor for /// front-ends. - /// Default Scale Factor for - /// FrontEnds. - /// API Management Account - /// associated with the App Service Environment. /// <code>true</code> if the App /// Service Environment is suspended; otherwise, /// <code>false</code>. The environment can be suspended, /// e.g. when the management endpoint is no longer available /// (most likely because NSG blocked the incoming traffic). - /// True/false indicating whether the - /// App Service Environment is suspended. The environment can be - /// suspended e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). /// Custom settings for changing the /// behavior of the App Service Environment. /// User added ip ranges to /// whitelist on ASE db /// Flag that displays whether an ASE has /// linux workers or not - /// Key Vault ID for ILB App Service - /// Environment default SSL certificate - /// Key Vault Secret Name for - /// ILB App Service Environment default SSL certificate - public AppServiceEnvironmentResource(string location, string appServiceEnvironmentResourceName, string appServiceEnvironmentResourceLocation, VirtualNetworkProfile virtualNetwork, IList workerPools, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) + /// Dedicated Host Count + public AppServiceEnvironmentResource(string location, VirtualNetworkProfile virtualNetwork, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string dnsSuffix = default(string), int? maximumNumberOfMachines = default(int?), int? frontEndScaleFactor = default(int?), bool? suspended = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), int? dedicatedHostCount = default(int?)) : base(location, id, name, kind, type, tags) { - AppServiceEnvironmentResourceName = appServiceEnvironmentResourceName; - AppServiceEnvironmentResourceLocation = appServiceEnvironmentResourceLocation; ProvisioningState = provisioningState; Status = status; - VnetName = vnetName; - VnetResourceGroupName = vnetResourceGroupName; - VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; - WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; - DatabaseEdition = databaseEdition; - DatabaseServiceObjective = databaseServiceObjective; - UpgradeDomains = upgradeDomains; - SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; - LastAction = lastAction; - LastActionResult = lastActionResult; - AllowedMultiSizes = allowedMultiSizes; - AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; - VipMappings = vipMappings; - EnvironmentCapacities = environmentCapacities; - NetworkAccessControlList = networkAccessControlList; - EnvironmentIsHealthy = environmentIsHealthy; - EnvironmentStatus = environmentStatus; - ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; - DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; - ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; - DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - SslCertKeyVaultId = sslCertKeyVaultId; - SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; + DedicatedHostCount = dedicatedHostCount; CustomInit(); } @@ -178,19 +103,6 @@ public AppServiceEnvironmentResource() /// partial void CustomInit(); - /// - /// Gets or sets name of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.name")] - public string AppServiceEnvironmentResourceName { get; set; } - - /// - /// Gets or sets location of the App Service Environment, e.g. "West - /// US". - /// - [JsonProperty(PropertyName = "properties.location")] - public string AppServiceEnvironmentResourceLocation { get; set; } - /// /// Gets provisioning state of the App Service Environment. Possible /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', @@ -206,25 +118,6 @@ public AppServiceEnvironmentResource() [JsonProperty(PropertyName = "properties.status")] public HostingEnvironmentStatus? Status { get; private set; } - /// - /// Gets or sets name of the Virtual Network for the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.vnetName")] - public string VnetName { get; set; } - - /// - /// Gets or sets resource group of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.vnetResourceGroupName")] - public string VnetResourceGroupName { get; set; } - - /// - /// Gets or sets subnet of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.vnetSubnetName")] - public string VnetSubnetName { get; set; } - /// /// Gets or sets description of the Virtual Network. /// @@ -234,7 +127,7 @@ public AppServiceEnvironmentResource() /// /// Gets or sets specifies which endpoints to serve internally in the /// Virtual Network for the App Service Environment. Possible values - /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' + /// include: 'None', 'Web', 'Publishing', 'Web, Publishing' /// [JsonProperty(PropertyName = "properties.internalLoadBalancingMode")] public string InternalLoadBalancingMode { get; set; } @@ -246,17 +139,10 @@ public AppServiceEnvironmentResource() public string MultiSize { get; set; } /// - /// Gets or sets number of front-end instances. + /// Gets number of front-end instances. /// [JsonProperty(PropertyName = "properties.multiRoleCount")] - public int? MultiRoleCount { get; set; } - - /// - /// Gets or sets description of worker pools with worker size IDs, VM - /// sizes, and number of workers in each pool. - /// - [JsonProperty(PropertyName = "properties.workerPools")] - public IList WorkerPools { get; set; } + public int? MultiRoleCount { get; private set; } /// /// Gets or sets number of IP SSL addresses reserved for the App @@ -265,110 +151,18 @@ public AppServiceEnvironmentResource() [JsonProperty(PropertyName = "properties.ipsslAddressCount")] public int? IpsslAddressCount { get; set; } - /// - /// Gets edition of the metadata database for the App Service - /// Environment, e.g. "Standard". - /// - [JsonProperty(PropertyName = "properties.databaseEdition")] - public string DatabaseEdition { get; private set; } - - /// - /// Gets service objective of the metadata database for the App Service - /// Environment, e.g. "S0". - /// - [JsonProperty(PropertyName = "properties.databaseServiceObjective")] - public string DatabaseServiceObjective { get; private set; } - - /// - /// Gets number of upgrade domains of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.upgradeDomains")] - public int? UpgradeDomains { get; private set; } - - /// - /// Gets subscription of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.subscriptionId")] - public string SubscriptionId { get; private set; } - /// /// Gets or sets DNS suffix of the App Service Environment. /// [JsonProperty(PropertyName = "properties.dnsSuffix")] public string DnsSuffix { get; set; } - /// - /// Gets last deployment action on the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.lastAction")] - public string LastAction { get; private set; } - - /// - /// Gets result of the last deployment action on the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.lastActionResult")] - public string LastActionResult { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for front-ends. - /// - [JsonProperty(PropertyName = "properties.allowedMultiSizes")] - public string AllowedMultiSizes { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for workers. - /// - [JsonProperty(PropertyName = "properties.allowedWorkerSizes")] - public string AllowedWorkerSizes { get; private set; } - /// /// Gets maximum number of VMs in the App Service Environment. /// [JsonProperty(PropertyName = "properties.maximumNumberOfMachines")] public int? MaximumNumberOfMachines { get; private set; } - /// - /// Gets description of IP SSL mapping for the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.vipMappings")] - public IList VipMappings { get; private set; } - - /// - /// Gets current total, used, and available worker capacities. - /// - [JsonProperty(PropertyName = "properties.environmentCapacities")] - public IList EnvironmentCapacities { get; private set; } - - /// - /// Gets or sets access control list for controlling traffic to the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "properties.networkAccessControlList")] - public IList NetworkAccessControlList { get; set; } - - /// - /// Gets true/false indicating whether the App Service Environment is - /// healthy. - /// - [JsonProperty(PropertyName = "properties.environmentIsHealthy")] - public bool? EnvironmentIsHealthy { get; private set; } - - /// - /// Gets detailed message about with results of the last check of the - /// App Service Environment. - /// - [JsonProperty(PropertyName = "properties.environmentStatus")] - public string EnvironmentStatus { get; private set; } - - /// - /// Gets resource group of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.resourceGroup")] - public string ResourceGroup { get; private set; } - /// /// Gets or sets scale factor for front-ends. /// @@ -376,37 +170,15 @@ public AppServiceEnvironmentResource() public int? FrontEndScaleFactor { get; set; } /// - /// Gets default Scale Factor for FrontEnds. - /// - [JsonProperty(PropertyName = "properties.defaultFrontEndScaleFactor")] - public int? DefaultFrontEndScaleFactor { get; private set; } - - /// - /// Gets or sets API Management Account associated with the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.apiManagementAccountId")] - public string ApiManagementAccountId { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// App Service Environment is suspended; otherwise, + /// Gets &lt;code&gt;true&lt;/code&gt; if the App + /// Service Environment is suspended; otherwise, /// &lt;code&gt;false&lt;/code&gt;. The environment can /// be suspended, e.g. when the management endpoint is no longer /// available /// (most likely because NSG blocked the incoming traffic). /// [JsonProperty(PropertyName = "properties.suspended")] - public bool? Suspended { get; set; } - - /// - /// Gets or sets true/false indicating whether the App Service - /// Environment is suspended. The environment can be suspended e.g. - /// when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - [JsonProperty(PropertyName = "properties.dynamicCacheEnabled")] - public bool? DynamicCacheEnabled { get; set; } + public bool? Suspended { get; private set; } /// /// Gets or sets custom settings for changing the behavior of the App @@ -422,25 +194,16 @@ public AppServiceEnvironmentResource() public IList UserWhitelistedIpRanges { get; set; } /// - /// Gets or sets flag that displays whether an ASE has linux workers or - /// not + /// Gets flag that displays whether an ASE has linux workers or not /// [JsonProperty(PropertyName = "properties.hasLinuxWorkers")] - public bool? HasLinuxWorkers { get; set; } - - /// - /// Gets or sets key Vault ID for ILB App Service Environment default - /// SSL certificate - /// - [JsonProperty(PropertyName = "properties.sslCertKeyVaultId")] - public string SslCertKeyVaultId { get; set; } + public bool? HasLinuxWorkers { get; private set; } /// - /// Gets or sets key Vault Secret Name for ILB App Service Environment - /// default SSL certificate + /// Gets dedicated Host Count /// - [JsonProperty(PropertyName = "properties.sslCertKeyVaultSecretName")] - public string SslCertKeyVaultSecretName { get; set; } + [JsonProperty(PropertyName = "properties.dedicatedHostCount")] + public int? DedicatedHostCount { get; private set; } /// /// Validate the object. @@ -451,21 +214,13 @@ public AppServiceEnvironmentResource() public override void Validate() { base.Validate(); - if (AppServiceEnvironmentResourceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentResourceName"); - } - if (AppServiceEnvironmentResourceLocation == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentResourceLocation"); - } if (VirtualNetwork == null) { throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); } - if (WorkerPools == null) + if (VirtualNetwork != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); + VirtualNetwork.Validate(); } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs index 6f5f763da3eb..b77592992597 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs @@ -80,9 +80,11 @@ public AppServicePlan() /// Scaling worker count. /// Scaling worker size ID. /// Provisioning state of the App - /// Service Environment. Possible values include: 'Succeeded', - /// 'Failed', 'Canceled', 'InProgress', 'Deleting' - public AppServicePlan(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), SkuDescription sku = default(SkuDescription)) + /// Service Plan. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled', 'InProgress', 'Deleting' + /// Specification for the + /// Kubernetes Environment to use for the App Service plan. + public AppServicePlan(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), KubeEnvironmentProfile kubeEnvironmentProfile = default(KubeEnvironmentProfile), SkuDescription sku = default(SkuDescription)) : base(location, id, name, kind, type, tags) { WorkerTierName = workerTierName; @@ -104,6 +106,7 @@ public AppServicePlan() TargetWorkerCount = targetWorkerCount; TargetWorkerSizeId = targetWorkerSizeId; ProvisioningState = provisioningState; + KubeEnvironmentProfile = kubeEnvironmentProfile; Sku = sku; CustomInit(); } @@ -237,13 +240,20 @@ public AppServicePlan() public int? TargetWorkerSizeId { get; set; } /// - /// Gets provisioning state of the App Service Environment. Possible - /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// Gets provisioning state of the App Service Plan. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', /// 'Deleting' /// [JsonProperty(PropertyName = "properties.provisioningState")] public ProvisioningState? ProvisioningState { get; private set; } + /// + /// Gets or sets specification for the Kubernetes Environment to use + /// for the App Service plan. + /// + [JsonProperty(PropertyName = "properties.kubeEnvironmentProfile")] + public KubeEnvironmentProfile KubeEnvironmentProfile { get; set; } + /// /// [JsonProperty(PropertyName = "sku")] diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs index 55716222a405..87b7050495c3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs @@ -66,11 +66,9 @@ public AppServicePlanPatchResource() /// free offer expires. /// Resource group of the App Service /// plan. - /// This needs to set to - /// <code>true</code> when creating a Linux App Service - /// Plan, along with <code>kind</code> set to - /// <code>Linux</code>. It should be - /// <code>false</code> otherwise. + /// If Linux app service plan + /// <code>true</code>, <code>false</code> + /// otherwise. /// Obsolete: If Hyper-V container app service /// plan <code>true</code>, <code>false</code> /// otherwise. @@ -80,9 +78,11 @@ public AppServicePlanPatchResource() /// Scaling worker count. /// Scaling worker size ID. /// Provisioning state of the App - /// Service Environment. Possible values include: 'Succeeded', - /// 'Failed', 'Canceled', 'InProgress', 'Deleting' - public AppServicePlanPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?)) + /// Service Plan. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled', 'InProgress', 'Deleting' + /// Specification for the + /// Kubernetes Environment to use for the App Service plan. + public AppServicePlanPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), KubeEnvironmentProfile kubeEnvironmentProfile = default(KubeEnvironmentProfile)) : base(id, name, kind, type) { WorkerTierName = workerTierName; @@ -104,6 +104,7 @@ public AppServicePlanPatchResource() TargetWorkerCount = targetWorkerCount; TargetWorkerSizeId = targetWorkerSizeId; ProvisioningState = provisioningState; + KubeEnvironmentProfile = kubeEnvironmentProfile; CustomInit(); } @@ -200,11 +201,8 @@ public AppServicePlanPatchResource() public string ResourceGroup { get; private set; } /// - /// Gets or sets this needs to set to - /// &lt;code&gt;true&lt;/code&gt; when creating a Linux - /// App Service Plan, along with - /// &lt;code&gt;kind&lt;/code&gt; set to - /// &lt;code&gt;Linux&lt;/code&gt;. It should be + /// Gets or sets if Linux app service plan + /// &lt;code&gt;true&lt;/code&gt;, /// &lt;code&gt;false&lt;/code&gt; otherwise. /// [JsonProperty(PropertyName = "properties.reserved")] @@ -239,12 +237,19 @@ public AppServicePlanPatchResource() public int? TargetWorkerSizeId { get; set; } /// - /// Gets provisioning state of the App Service Environment. Possible - /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// Gets provisioning state of the App Service Plan. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', /// 'Deleting' /// [JsonProperty(PropertyName = "properties.provisioningState")] public ProvisioningState? ProvisioningState { get; private set; } + /// + /// Gets or sets specification for the Kubernetes Environment to use + /// for the App Service plan. + /// + [JsonProperty(PropertyName = "properties.kubeEnvironmentProfile")] + public KubeEnvironmentProfile KubeEnvironmentProfile { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs new file mode 100644 index 000000000000..1659b09e76e0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] + public partial class Apple : ProxyOnlyResource + { + /// + /// Initializes a new instance of the Apple class. + /// + public Apple() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Apple class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public Apple(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), AppleRegistration registration = default(AppleRegistration), LoginScopes login = default(LoginScopes)) + : base(id, name, kind, type) + { + Enabled = enabled; + Registration = registration; + Login = login; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.registration")] + public AppleRegistration Registration { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.login")] + public LoginScopes Login { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs new file mode 100644 index 000000000000..09b837ad93e8 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] + public partial class AppleRegistration : ProxyOnlyResource + { + /// + /// Initializes a new instance of the AppleRegistration class. + /// + public AppleRegistration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AppleRegistration class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public AppleRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string clientId = default(string), string clientSecretSettingName = default(string)) + : base(id, name, kind, type) + { + ClientId = clientId; + ClientSecretSettingName = clientSecretSettingName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.clientId")] + public string ClientId { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.clientSecretSettingName")] + public string ClientSecretSettingName { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs index 1eb2589b59e0..581290a604fe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs @@ -38,13 +38,17 @@ public ApplicationStack() /// available. /// List of frameworks associated with /// application stack. - public ApplicationStack(string name = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList)) + /// <code>true</code> if this is + /// the stack is deprecated; otherwise, + /// <code>false</code>. + public ApplicationStack(string name = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList), IList isDeprecated = default(IList)) { Name = name; Display = display; Dependency = dependency; MajorVersions = majorVersions; Frameworks = frameworks; + IsDeprecated = isDeprecated; CustomInit(); } @@ -83,5 +87,13 @@ public ApplicationStack() [JsonProperty(PropertyName = "frameworks")] public IList Frameworks { get; set; } + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this + /// is the stack is deprecated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDeprecated")] + public IList IsDeprecated { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs index ac8153b7ec12..ace998a07c8a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs @@ -46,7 +46,10 @@ public ApplicationStackResource() /// available. /// List of frameworks associated with /// application stack. - public ApplicationStackResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string applicationStackResourceName = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList)) + /// <code>true</code> if this is + /// the stack is deprecated; otherwise, + /// <code>false</code>. + public ApplicationStackResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string applicationStackResourceName = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList), IList isDeprecated = default(IList)) : base(id, name, kind, type) { ApplicationStackResourceName = applicationStackResourceName; @@ -54,6 +57,7 @@ public ApplicationStackResource() Dependency = dependency; MajorVersions = majorVersions; Frameworks = frameworks; + IsDeprecated = isDeprecated; CustomInit(); } @@ -92,5 +96,13 @@ public ApplicationStackResource() [JsonProperty(PropertyName = "properties.frameworks")] public IList Frameworks { get; set; } + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this + /// is the stack is deprecated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.isDeprecated")] + public IList IsDeprecated { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs new file mode 100644 index 000000000000..a4a1226ce6af --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Github access token for Appservice CLI github integration. + /// + public partial class AppserviceGithubToken + { + /// + /// Initializes a new instance of the AppserviceGithubToken class. + /// + public AppserviceGithubToken() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AppserviceGithubToken class. + /// + /// Github access token for Appservice CLI + /// github integration + /// Scope of the github access token + /// token type + /// True if valid github token received, False + /// otherwise + /// Error message if unable to get + /// token + public AppserviceGithubToken(string accessToken = default(string), string scope = default(string), string tokenType = default(string), bool? gotToken = default(bool?), string errorMessage = default(string)) + { + AccessToken = accessToken; + Scope = scope; + TokenType = tokenType; + GotToken = gotToken; + ErrorMessage = errorMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets github access token for Appservice CLI github + /// integration + /// + [JsonProperty(PropertyName = "accessToken")] + public string AccessToken { get; set; } + + /// + /// Gets or sets scope of the github access token + /// + [JsonProperty(PropertyName = "scope")] + public string Scope { get; set; } + + /// + /// Gets or sets token type + /// + [JsonProperty(PropertyName = "tokenType")] + public string TokenType { get; set; } + + /// + /// Gets or sets true if valid github token received, False otherwise + /// + [JsonProperty(PropertyName = "gotToken")] + public bool? GotToken { get; set; } + + /// + /// Gets or sets error message if unable to get token + /// + [JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs new file mode 100644 index 000000000000..e99bcc39cb0f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Appservice Github token request content. + /// + public partial class AppserviceGithubTokenRequest + { + /// + /// Initializes a new instance of the AppserviceGithubTokenRequest + /// class. + /// + public AppserviceGithubTokenRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AppserviceGithubTokenRequest + /// class. + /// + /// Code string to exchange for Github Access + /// token + /// State string used for verification. + public AppserviceGithubTokenRequest(string code, string state) + { + Code = code; + State = state; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets code string to exchange for Github Access token + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets state string used for verification. + /// + [JsonProperty(PropertyName = "state")] + public string State { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Code == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Code"); + } + if (State == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "State"); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs new file mode 100644 index 000000000000..57dca6849502 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Full view of networking configuration for an ASE. + /// + [Rest.Serialization.JsonTransformation] + public partial class AseV3NetworkingConfiguration : ProxyOnlyResource + { + /// + /// Initializes a new instance of the AseV3NetworkingConfiguration + /// class. + /// + public AseV3NetworkingConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AseV3NetworkingConfiguration + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Property to enable + /// and disable new private endpoint connection creation on ASE + public AseV3NetworkingConfiguration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList windowsOutboundIpAddresses = default(IList), IList linuxOutboundIpAddresses = default(IList), bool? allowNewPrivateEndpointConnections = default(bool?)) + : base(id, name, kind, type) + { + WindowsOutboundIpAddresses = windowsOutboundIpAddresses; + LinuxOutboundIpAddresses = linuxOutboundIpAddresses; + AllowNewPrivateEndpointConnections = allowNewPrivateEndpointConnections; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.windowsOutboundIpAddresses")] + public IList WindowsOutboundIpAddresses { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "properties.linuxOutboundIpAddresses")] + public IList LinuxOutboundIpAddresses { get; private set; } + + /// + /// Gets or sets property to enable and disable new private endpoint + /// connection creation on ASE + /// + [JsonProperty(PropertyName = "properties.allowNewPrivateEndpointConnections")] + public bool? AllowNewPrivateEndpointConnections { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs index 1249271bac0a..0b7fe084b988 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs @@ -35,14 +35,20 @@ public AutoHealTriggers() /// A rule based on private /// bytes. /// A rule based on status codes. + /// A rule based on status codes + /// ranges. /// A rule based on request execution /// time. - public AutoHealTriggers(RequestsBasedTrigger requests = default(RequestsBasedTrigger), int? privateBytesInKB = default(int?), IList statusCodes = default(IList), SlowRequestsBasedTrigger slowRequests = default(SlowRequestsBasedTrigger)) + /// A rule based on multiple Slow + /// Requests Rule with path + public AutoHealTriggers(RequestsBasedTrigger requests = default(RequestsBasedTrigger), int? privateBytesInKB = default(int?), IList statusCodes = default(IList), IList statusCodesRange = default(IList), SlowRequestsBasedTrigger slowRequests = default(SlowRequestsBasedTrigger), IList slowRequestsWithPath = default(IList)) { Requests = requests; PrivateBytesInKB = privateBytesInKB; StatusCodes = statusCodes; + StatusCodesRange = statusCodesRange; SlowRequests = slowRequests; + SlowRequestsWithPath = slowRequestsWithPath; CustomInit(); } @@ -69,11 +75,23 @@ public AutoHealTriggers() [JsonProperty(PropertyName = "statusCodes")] public IList StatusCodes { get; set; } + /// + /// Gets or sets a rule based on status codes ranges. + /// + [JsonProperty(PropertyName = "statusCodesRange")] + public IList StatusCodesRange { get; set; } + /// /// Gets or sets a rule based on request execution time. /// [JsonProperty(PropertyName = "slowRequests")] public SlowRequestsBasedTrigger SlowRequests { get; set; } + /// + /// Gets or sets a rule based on multiple Slow Requests Rule with path + /// + [JsonProperty(PropertyName = "slowRequestsWithPath")] + public IList SlowRequestsWithPath { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs new file mode 100644 index 000000000000..b268f017941e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] + public partial class AzureStaticWebApps : ProxyOnlyResource + { + /// + /// Initializes a new instance of the AzureStaticWebApps class. + /// + public AzureStaticWebApps() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureStaticWebApps class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public AzureStaticWebApps(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), AzureStaticWebAppsRegistration registration = default(AzureStaticWebAppsRegistration)) + : base(id, name, kind, type) + { + Enabled = enabled; + Registration = registration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.registration")] + public AzureStaticWebAppsRegistration Registration { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs new file mode 100644 index 000000000000..07828db6047c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] + public partial class AzureStaticWebAppsRegistration : ProxyOnlyResource + { + /// + /// Initializes a new instance of the AzureStaticWebAppsRegistration + /// class. + /// + public AzureStaticWebAppsRegistration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureStaticWebAppsRegistration + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public AzureStaticWebAppsRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string clientId = default(string)) + : base(id, name, kind, type) + { + ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.clientId")] + public string ClientId { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs index a0dec36fc138..58973e11d2a7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs @@ -39,7 +39,8 @@ public AzureStorageInfoValue() /// Path to mount the storage within the site's /// runtime environment. /// State of the storage account. Possible values - /// include: 'Ok', 'InvalidCredentials', 'InvalidShare' + /// include: 'Ok', 'InvalidCredentials', 'InvalidShare', + /// 'NotValidated' public AzureStorageInfoValue(AzureStorageType? type = default(AzureStorageType?), string accountName = default(string), string shareName = default(string), string accessKey = default(string), string mountPath = default(string), AzureStorageState? state = default(AzureStorageState?)) { Type = type; @@ -91,7 +92,7 @@ public AzureStorageInfoValue() /// /// Gets state of the storage account. Possible values include: 'Ok', - /// 'InvalidCredentials', 'InvalidShare' + /// 'InvalidCredentials', 'InvalidShare', 'NotValidated' /// [JsonProperty(PropertyName = "state")] public AzureStorageState? State { get; private set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs index 49d68d686c25..dd8e18dc45a5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs @@ -26,7 +26,9 @@ public enum AzureStorageState [EnumMember(Value = "InvalidCredentials")] InvalidCredentials, [EnumMember(Value = "InvalidShare")] - InvalidShare + InvalidShare, + [EnumMember(Value = "NotValidated")] + NotValidated } internal static class AzureStorageStateEnumExtension { @@ -45,6 +47,8 @@ internal static string ToSerializedValue(this AzureStorageState value) return "InvalidCredentials"; case AzureStorageState.InvalidShare: return "InvalidShare"; + case AzureStorageState.NotValidated: + return "NotValidated"; } return null; } @@ -59,6 +63,8 @@ internal static string ToSerializedValue(this AzureStorageState value) return AzureStorageState.InvalidCredentials; case "InvalidShare": return AzureStorageState.InvalidShare; + case "NotValidated": + return AzureStorageState.NotValidated; } return null; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs index 2e6698cad5cd..592906a09b62 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs @@ -46,7 +46,8 @@ public BillingMeter() /// App Service ResourceType meter used /// for /// App Service OS type meter used for - public BillingMeter(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string meterId = default(string), string billingLocation = default(string), string shortName = default(string), string friendlyName = default(string), string resourceType = default(string), string osType = default(string)) + /// Meter Multiplier + public BillingMeter(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string meterId = default(string), string billingLocation = default(string), string shortName = default(string), string friendlyName = default(string), string resourceType = default(string), string osType = default(string), double? multiplier = default(double?)) : base(id, name, kind, type) { MeterId = meterId; @@ -55,6 +56,7 @@ public BillingMeter() FriendlyName = friendlyName; ResourceType = resourceType; OsType = osType; + Multiplier = multiplier; CustomInit(); } @@ -99,5 +101,11 @@ public BillingMeter() [JsonProperty(PropertyName = "properties.osType")] public string OsType { get; set; } + /// + /// Gets or sets meter Multiplier + /// + [JsonProperty(PropertyName = "properties.multiplier")] + public double? Multiplier { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs index d46eb9c0661c..0bc4b11e4ac3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs @@ -35,7 +35,6 @@ public Certificate() /// Initializes a new instance of the Certificate class. /// /// Resource Location. - /// Certificate password. /// Resource Id. /// Resource Name. /// Kind of resource. @@ -52,6 +51,7 @@ public Certificate() /// Certificate issuer. /// Certificate issue Date. /// Certificate expiration date. + /// Certificate password. /// Certificate thumbprint. /// Is the certificate valid?. /// Raw bytes of .cer file @@ -72,7 +72,9 @@ public Certificate() /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". /// CNAME of the certificate to be issued /// via free certificate - public Certificate(string location, string password, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string)) + /// Method of domain validation + /// for free cert + public Certificate(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string password = default(string), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string), string domainValidationMethod = default(string)) : base(location, id, name, kind, type, tags) { FriendlyName = friendlyName; @@ -95,6 +97,7 @@ public Certificate() KeyVaultSecretStatus = keyVaultSecretStatus; ServerFarmId = serverFarmId; CanonicalName = canonicalName; + DomainValidationMethod = domainValidationMethod; CustomInit(); } @@ -232,6 +235,12 @@ public Certificate() [JsonProperty(PropertyName = "properties.canonicalName")] public string CanonicalName { get; set; } + /// + /// Gets or sets method of domain validation for free cert + /// + [JsonProperty(PropertyName = "properties.domainValidationMethod")] + public string DomainValidationMethod { get; set; } + /// /// Validate the object. /// @@ -241,10 +250,6 @@ public Certificate() public override void Validate() { base.Validate(); - if (Password == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Password"); - } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs new file mode 100644 index 000000000000..e5e1e23fea6c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class CertificateOrderContact + { + /// + /// Initializes a new instance of the CertificateOrderContact class. + /// + public CertificateOrderContact() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CertificateOrderContact class. + /// + public CertificateOrderContact(string email = default(string), string nameFirst = default(string), string nameLast = default(string), string phone = default(string)) + { + Email = email; + NameFirst = nameFirst; + NameLast = nameLast; + Phone = phone; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "email")] + public string Email { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nameFirst")] + public string NameFirst { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nameLast")] + public string NameLast { get; set; } + + /// + /// + [JsonProperty(PropertyName = "phone")] + public string Phone { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs index f2579bd985bc..9f323bb4996d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs @@ -34,7 +34,6 @@ public CertificatePatchResource() /// /// Initializes a new instance of the CertificatePatchResource class. /// - /// Certificate password. /// Resource Id. /// Resource Name. /// Kind of resource. @@ -50,6 +49,7 @@ public CertificatePatchResource() /// Certificate issuer. /// Certificate issue Date. /// Certificate expiration date. + /// Certificate password. /// Certificate thumbprint. /// Is the certificate valid?. /// Raw bytes of .cer file @@ -70,7 +70,9 @@ public CertificatePatchResource() /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". /// CNAME of the certificate to be issued /// via free certificate - public CertificatePatchResource(string password, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string)) + /// Method of domain validation + /// for free cert + public CertificatePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string password = default(string), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string), string domainValidationMethod = default(string)) : base(id, name, kind, type) { FriendlyName = friendlyName; @@ -93,6 +95,7 @@ public CertificatePatchResource() KeyVaultSecretStatus = keyVaultSecretStatus; ServerFarmId = serverFarmId; CanonicalName = canonicalName; + DomainValidationMethod = domainValidationMethod; CustomInit(); } @@ -231,17 +234,10 @@ public CertificatePatchResource() public string CanonicalName { get; set; } /// - /// Validate the object. + /// Gets or sets method of domain validation for free cert /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Password == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Password"); - } - } + [JsonProperty(PropertyName = "properties.domainValidationMethod")] + public string DomainValidationMethod { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs index 422855315598..5c9bd29f7e2d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs @@ -24,7 +24,9 @@ public enum ClientCertMode [EnumMember(Value = "Required")] Required, [EnumMember(Value = "Optional")] - Optional + Optional, + [EnumMember(Value = "OptionalInteractiveUser")] + OptionalInteractiveUser } internal static class ClientCertModeEnumExtension { @@ -41,6 +43,8 @@ internal static string ToSerializedValue(this ClientCertMode value) return "Required"; case ClientCertMode.Optional: return "Optional"; + case ClientCertMode.OptionalInteractiveUser: + return "OptionalInteractiveUser"; } return null; } @@ -53,6 +57,8 @@ internal static string ToSerializedValue(this ClientCertMode value) return ClientCertMode.Required; case "Optional": return ClientCertMode.Optional; + case "OptionalInteractiveUser": + return ClientCertMode.OptionalInteractiveUser; } return null; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConfigReferenceSource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConfigReferenceSource.cs new file mode 100644 index 000000000000..621c4362c717 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConfigReferenceSource.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.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ConfigReferenceSource. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ConfigReferenceSource + { + [EnumMember(Value = "KeyVault")] + KeyVault + } + internal static class ConfigReferenceSourceEnumExtension + { + internal static string ToSerializedValue(this ConfigReferenceSource? value) + { + return value == null ? null : ((ConfigReferenceSource)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ConfigReferenceSource value) + { + switch( value ) + { + case ConfigReferenceSource.KeyVault: + return "KeyVault"; + } + return null; + } + + internal static ConfigReferenceSource? ParseConfigReferenceSource(this string value) + { + switch( value ) + { + case "KeyVault": + return ConfigReferenceSource.KeyVault; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmCopySlotEntity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmCopySlotEntity.cs deleted file mode 100644 index 0c117e09339b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmCopySlotEntity.cs +++ /dev/null @@ -1,93 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Copy deployment slot parameters. - /// - public partial class CsmCopySlotEntity - { - /// - /// Initializes a new instance of the CsmCopySlotEntity class. - /// - public CsmCopySlotEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CsmCopySlotEntity class. - /// - /// Destination deployment slot during copy - /// operation. - /// The site object which will be merged with - /// the source slot site - /// to produce new destination slot site object. - /// <code>null</code> to just copy source slot content. - /// Otherwise a <code>Site</code> - /// object with properties to override source slot site. - public CsmCopySlotEntity(string targetSlot, SiteConfig siteConfig) - { - TargetSlot = targetSlot; - SiteConfig = siteConfig; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets destination deployment slot during copy operation. - /// - [JsonProperty(PropertyName = "targetSlot")] - public string TargetSlot { get; set; } - - /// - /// Gets or sets the site object which will be merged with the source - /// slot site - /// to produce new destination slot site object. - /// &lt;code&gt;null&lt;/code&gt; to just copy source - /// slot content. Otherwise a - /// &lt;code&gt;Site&lt;/code&gt; - /// object with properties to override source slot site. - /// - [JsonProperty(PropertyName = "siteConfig")] - public SiteConfig SiteConfig { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TargetSlot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetSlot"); - } - if (SiteConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SiteConfig"); - } - if (SiteConfig != null) - { - SiteConfig.Validate(); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs new file mode 100644 index 000000000000..7a18aa9698bf --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + + /// + /// Defines values for CustomDomainStatus. + /// + public static class CustomDomainStatus + { + public const string RetrievingValidationToken = "RetrievingValidationToken"; + public const string Validating = "Validating"; + public const string Adding = "Adding"; + public const string Ready = "Ready"; + public const string Failed = "Failed"; + public const string Deleting = "Deleting"; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs new file mode 100644 index 000000000000..74f97c70231f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Additional configuration for a data providers + /// + public partial class DataProviderMetadata + { + /// + /// Initializes a new instance of the DataProviderMetadata class. + /// + public DataProviderMetadata() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataProviderMetadata class. + /// + /// Settings for the data provider + public DataProviderMetadata(string providerName = default(string), IList propertyBag = default(IList)) + { + ProviderName = providerName; + PropertyBag = propertyBag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "providerName")] + public string ProviderName { get; set; } + + /// + /// Gets settings for the data provider + /// + [JsonProperty(PropertyName = "propertyBag")] + public IList PropertyBag { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs index 78af46d0f5c1..6bef8197eb83 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.Management.WebSites.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -29,17 +31,33 @@ public DetectorInfo() /// /// Initializes a new instance of the DetectorInfo class. /// + /// Id of detector + /// Name of detector /// Short description of the detector and its - /// purpose - /// Support Category - /// Support Sub Category - /// Support Topic Id - public DetectorInfo(string description = default(string), string category = default(string), string subCategory = default(string), string supportTopicId = default(string)) + /// purpose. + /// Author of the detector. + /// Problem category. This serves for organizing + /// group for detectors. + /// List of Support Topics for which + /// this detector is enabled. + /// Analysis Types for which this detector + /// should apply to. + /// Whether this detector is an Analysis Detector or + /// not. Possible values include: 'Detector', 'Analysis', + /// 'CategoryOverview' + /// Defines score of a detector to power ML based + /// matching. + public DetectorInfo(string id = default(string), string name = default(string), string description = default(string), string author = default(string), string category = default(string), IList supportTopicList = default(IList), IList analysisType = default(IList), DetectorType? type = default(DetectorType?), double? score = default(double?)) { + Id = id; + Name = name; Description = description; + Author = author; Category = category; - SubCategory = subCategory; - SupportTopicId = supportTopicId; + SupportTopicList = supportTopicList; + AnalysisType = analysisType; + Type = type; + Score = score; CustomInit(); } @@ -49,28 +67,60 @@ public DetectorInfo() partial void CustomInit(); /// - /// Gets short description of the detector and its purpose + /// Gets id of detector + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets name of detector + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets short description of the detector and its purpose. /// [JsonProperty(PropertyName = "description")] public string Description { get; private set; } /// - /// Gets support Category + /// Gets author of the detector. + /// + [JsonProperty(PropertyName = "author")] + public string Author { get; private set; } + + /// + /// Gets problem category. This serves for organizing group for + /// detectors. /// [JsonProperty(PropertyName = "category")] public string Category { get; private set; } /// - /// Gets support Sub Category + /// Gets list of Support Topics for which this detector is enabled. + /// + [JsonProperty(PropertyName = "supportTopicList")] + public IList SupportTopicList { get; private set; } + + /// + /// Gets analysis Types for which this detector should apply to. + /// + [JsonProperty(PropertyName = "analysisType")] + public IList AnalysisType { get; private set; } + + /// + /// Gets whether this detector is an Analysis Detector or not. Possible + /// values include: 'Detector', 'Analysis', 'CategoryOverview' /// - [JsonProperty(PropertyName = "subCategory")] - public string SubCategory { get; private set; } + [JsonProperty(PropertyName = "type")] + public DetectorType? Type { get; private set; } /// - /// Gets support Topic Id + /// Gets defines score of a detector to power ML based matching. /// - [JsonProperty(PropertyName = "supportTopicId")] - public string SupportTopicId { get; private set; } + [JsonProperty(PropertyName = "score")] + public double? Score { get; private set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs index 853860a84c5c..79366fbad0af 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs @@ -40,11 +40,20 @@ public DetectorResponse() /// Resource type. /// metadata for the detector /// Data Set - public DetectorResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), DetectorInfo metadata = default(DetectorInfo), IList dataset = default(IList)) + /// Indicates status of the most severe + /// insight. + /// Additional configuration for + /// different data providers to be used by the UI + /// Suggested utterances where the + /// detector can be applicable. + public DetectorResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), DetectorInfo metadata = default(DetectorInfo), IList dataset = default(IList), Status status = default(Status), IList dataProvidersMetadata = default(IList), QueryUtterancesResults suggestedUtterances = default(QueryUtterancesResults)) : base(id, name, kind, type) { Metadata = metadata; Dataset = dataset; + Status = status; + DataProvidersMetadata = dataProvidersMetadata; + SuggestedUtterances = suggestedUtterances; CustomInit(); } @@ -65,5 +74,25 @@ public DetectorResponse() [JsonProperty(PropertyName = "properties.dataset")] public IList Dataset { get; set; } + /// + /// Gets or sets indicates status of the most severe insight. + /// + [JsonProperty(PropertyName = "properties.status")] + public Status Status { get; set; } + + /// + /// Gets or sets additional configuration for different data providers + /// to be used by the UI + /// + [JsonProperty(PropertyName = "properties.dataProvidersMetadata")] + public IList DataProvidersMetadata { get; set; } + + /// + /// Gets or sets suggested utterances where the detector can be + /// applicable. + /// + [JsonProperty(PropertyName = "properties.suggestedUtterances")] + public QueryUtterancesResults SuggestedUtterances { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs new file mode 100644 index 000000000000..23370a2c5fec --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DetectorType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DetectorType + { + [EnumMember(Value = "Detector")] + Detector, + [EnumMember(Value = "Analysis")] + Analysis, + [EnumMember(Value = "CategoryOverview")] + CategoryOverview + } + internal static class DetectorTypeEnumExtension + { + internal static string ToSerializedValue(this DetectorType? value) + { + return value == null ? null : ((DetectorType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DetectorType value) + { + switch( value ) + { + case DetectorType.Detector: + return "Detector"; + case DetectorType.Analysis: + return "Analysis"; + case DetectorType.CategoryOverview: + return "CategoryOverview"; + } + return null; + } + + internal static DetectorType? ParseDetectorType(this string value) + { + switch( value ) + { + case "Detector": + return DetectorType.Detector; + case "Analysis": + return DetectorType.Analysis; + case "CategoryOverview": + return DetectorType.CategoryOverview; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs new file mode 100644 index 000000000000..8dee701ca524 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Function App stack major version. + /// + public partial class FunctionAppMajorVersion + { + /// + /// Initializes a new instance of the FunctionAppMajorVersion class. + /// + public FunctionAppMajorVersion() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FunctionAppMajorVersion class. + /// + /// Function App stack major version (display + /// only). + /// Function App stack major version name. + /// Minor versions associated with the + /// major version. + public FunctionAppMajorVersion(string displayText = default(string), string value = default(string), IList minorVersions = default(IList)) + { + DisplayText = displayText; + Value = value; + MinorVersions = minorVersions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets function App stack major version (display only). + /// + [JsonProperty(PropertyName = "displayText")] + public string DisplayText { get; private set; } + + /// + /// Gets function App stack major version name. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Gets minor versions associated with the major version. + /// + [JsonProperty(PropertyName = "minorVersions")] + public IList MinorVersions { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs new file mode 100644 index 000000000000..bf288f1db6fc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Function App stack minor version. + /// + public partial class FunctionAppMinorVersion + { + /// + /// Initializes a new instance of the FunctionAppMinorVersion class. + /// + public FunctionAppMinorVersion() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FunctionAppMinorVersion class. + /// + /// Function App stack (display + /// only). + /// Function App stack name. + /// Settings associated with the minor + /// version. + public FunctionAppMinorVersion(string displayText = default(string), string value = default(string), FunctionAppRuntimes stackSettings = default(FunctionAppRuntimes)) + { + DisplayText = displayText; + Value = value; + StackSettings = stackSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets function App stack (display only). + /// + [JsonProperty(PropertyName = "displayText")] + public string DisplayText { get; private set; } + + /// + /// Gets function App stack name. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Gets settings associated with the minor version. + /// + [JsonProperty(PropertyName = "stackSettings")] + public FunctionAppRuntimes StackSettings { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs new file mode 100644 index 000000000000..9077c3cdc7bc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs @@ -0,0 +1,193 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Function App runtime settings. + /// + public partial class FunctionAppRuntimeSettings + { + /// + /// Initializes a new instance of the FunctionAppRuntimeSettings class. + /// + public FunctionAppRuntimeSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FunctionAppRuntimeSettings class. + /// + /// Function App stack minor version + /// (runtime only). + /// <code>true</code> if + /// remote debugging is supported for the stack; otherwise, + /// <code>false</code>. + /// Application Insights settings + /// associated with the minor version. + /// GitHub Actions settings + /// associated with the minor version. + /// Application settings associated + /// with the minor version. + /// Configuration settings + /// associated with the minor version. + /// List of supported + /// Functions extension versions. + /// <code>true</code> if the stack + /// is in preview; otherwise, <code>false</code>. + /// <code>true</code> if the + /// stack is deprecated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the stack + /// should be hidden; otherwise, + /// <code>false</code>. + /// End-of-life date for the minor + /// version. + /// <code>true</code> if the + /// stack version is auto-updated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the + /// minor version is early-access; otherwise, + /// <code>false</code>. + /// <code>true</code> if the minor + /// version the default; otherwise, + /// <code>false</code>. + public FunctionAppRuntimeSettings(string runtimeVersion = default(string), bool? remoteDebuggingSupported = default(bool?), AppInsightsWebAppStackSettings appInsightsSettings = default(AppInsightsWebAppStackSettings), GitHubActionWebAppStackSettings gitHubActionSettings = default(GitHubActionWebAppStackSettings), IDictionary appSettingsDictionary = default(IDictionary), SiteConfigPropertiesDictionary siteConfigPropertiesDictionary = default(SiteConfigPropertiesDictionary), IList supportedFunctionsExtensionVersions = default(IList), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?), bool? isDefault = default(bool?)) + { + RuntimeVersion = runtimeVersion; + RemoteDebuggingSupported = remoteDebuggingSupported; + AppInsightsSettings = appInsightsSettings; + GitHubActionSettings = gitHubActionSettings; + AppSettingsDictionary = appSettingsDictionary; + SiteConfigPropertiesDictionary = siteConfigPropertiesDictionary; + SupportedFunctionsExtensionVersions = supportedFunctionsExtensionVersions; + IsPreview = isPreview; + IsDeprecated = isDeprecated; + IsHidden = isHidden; + EndOfLifeDate = endOfLifeDate; + IsAutoUpdate = isAutoUpdate; + IsEarlyAccess = isEarlyAccess; + IsDefault = isDefault; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets function App stack minor version (runtime only). + /// + [JsonProperty(PropertyName = "runtimeVersion")] + public string RuntimeVersion { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if remote + /// debugging is supported for the stack; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "remoteDebuggingSupported")] + public bool? RemoteDebuggingSupported { get; private set; } + + /// + /// Gets application Insights settings associated with the minor + /// version. + /// + [JsonProperty(PropertyName = "appInsightsSettings")] + public AppInsightsWebAppStackSettings AppInsightsSettings { get; private set; } + + /// + /// Gets gitHub Actions settings associated with the minor version. + /// + [JsonProperty(PropertyName = "gitHubActionSettings")] + public GitHubActionWebAppStackSettings GitHubActionSettings { get; private set; } + + /// + /// Gets application settings associated with the minor version. + /// + [JsonProperty(PropertyName = "appSettingsDictionary")] + public IDictionary AppSettingsDictionary { get; private set; } + + /// + /// Gets configuration settings associated with the minor version. + /// + [JsonProperty(PropertyName = "siteConfigPropertiesDictionary")] + public SiteConfigPropertiesDictionary SiteConfigPropertiesDictionary { get; private set; } + + /// + /// Gets list of supported Functions extension versions. + /// + [JsonProperty(PropertyName = "supportedFunctionsExtensionVersions")] + public IList SupportedFunctionsExtensionVersions { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// in preview; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isPreview")] + public bool? IsPreview { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// deprecated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDeprecated")] + public bool? IsDeprecated { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// should be hidden; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden { get; private set; } + + /// + /// Gets end-of-life date for the minor version. + /// + [JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// version is auto-updated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isAutoUpdate")] + public bool? IsAutoUpdate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the minor + /// version is early-access; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isEarlyAccess")] + public bool? IsEarlyAccess { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the minor + /// version the default; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDefault")] + public bool? IsDefault { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs new file mode 100644 index 000000000000..eab82eef40de --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Function App stack runtimes. + /// + public partial class FunctionAppRuntimes + { + /// + /// Initializes a new instance of the FunctionAppRuntimes class. + /// + public FunctionAppRuntimes() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FunctionAppRuntimes class. + /// + /// Linux-specific settings + /// associated with the minor version. + /// Windows-specific settings + /// associated with the minor version. + public FunctionAppRuntimes(FunctionAppRuntimeSettings linuxRuntimeSettings = default(FunctionAppRuntimeSettings), FunctionAppRuntimeSettings windowsRuntimeSettings = default(FunctionAppRuntimeSettings)) + { + LinuxRuntimeSettings = linuxRuntimeSettings; + WindowsRuntimeSettings = windowsRuntimeSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets linux-specific settings associated with the minor version. + /// + [JsonProperty(PropertyName = "linuxRuntimeSettings")] + public FunctionAppRuntimeSettings LinuxRuntimeSettings { get; private set; } + + /// + /// Gets windows-specific settings associated with the minor version. + /// + [JsonProperty(PropertyName = "windowsRuntimeSettings")] + public FunctionAppRuntimeSettings WindowsRuntimeSettings { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs new file mode 100644 index 000000000000..542801585fbf --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Function App Stack. + /// + [Rest.Serialization.JsonTransformation] + public partial class FunctionAppStack : ProxyOnlyResource + { + /// + /// Initializes a new instance of the FunctionAppStack class. + /// + public FunctionAppStack() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FunctionAppStack class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Function App stack location. + /// Function App stack (display + /// only). + /// Function App stack name. + /// List of major versions + /// available. + /// Function App stack preferred OS. Possible + /// values include: 'Windows', 'Linux' + public FunctionAppStack(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string location = default(string), string displayText = default(string), string value = default(string), IList majorVersions = default(IList), StackPreferredOs? preferredOs = default(StackPreferredOs?)) + : base(id, name, kind, type) + { + Location = location; + DisplayText = displayText; + Value = value; + MajorVersions = majorVersions; + PreferredOs = preferredOs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets function App stack location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets function App stack (display only). + /// + [JsonProperty(PropertyName = "properties.displayText")] + public string DisplayText { get; private set; } + + /// + /// Gets function App stack name. + /// + [JsonProperty(PropertyName = "properties.value")] + public string Value { get; private set; } + + /// + /// Gets list of major versions available. + /// + [JsonProperty(PropertyName = "properties.majorVersions")] + public IList MajorVersions { get; private set; } + + /// + /// Gets function App stack preferred OS. Possible values include: + /// 'Windows', 'Linux' + /// + [JsonProperty(PropertyName = "properties.preferredOs")] + public StackPreferredOs? PreferredOs { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs new file mode 100644 index 000000000000..6db239e1d461 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The GitHub action code configuration. + /// + public partial class GitHubActionCodeConfiguration + { + /// + /// Initializes a new instance of the GitHubActionCodeConfiguration + /// class. + /// + public GitHubActionCodeConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GitHubActionCodeConfiguration + /// class. + /// + /// Runtime stack is used to determine the + /// workflow file content for code base apps. + /// Runtime version is used to determine + /// what build version to set in the workflow file. + public GitHubActionCodeConfiguration(string runtimeStack = default(string), string runtimeVersion = default(string)) + { + RuntimeStack = runtimeStack; + RuntimeVersion = runtimeVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets runtime stack is used to determine the workflow file + /// content for code base apps. + /// + [JsonProperty(PropertyName = "runtimeStack")] + public string RuntimeStack { get; set; } + + /// + /// Gets or sets runtime version is used to determine what build + /// version to set in the workflow file. + /// + [JsonProperty(PropertyName = "runtimeVersion")] + public string RuntimeVersion { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs new file mode 100644 index 000000000000..80fbadc40478 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The GitHub action configuration. + /// + public partial class GitHubActionConfiguration + { + /// + /// Initializes a new instance of the GitHubActionConfiguration class. + /// + public GitHubActionConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GitHubActionConfiguration class. + /// + /// GitHub Action code + /// configuration. + /// GitHub Action container + /// configuration. + /// This will help determine the workflow + /// configuration to select. + /// Workflow option to determine + /// whether the workflow file should be generated and written to the + /// repository. + public GitHubActionConfiguration(GitHubActionCodeConfiguration codeConfiguration = default(GitHubActionCodeConfiguration), GitHubActionContainerConfiguration containerConfiguration = default(GitHubActionContainerConfiguration), bool? isLinux = default(bool?), bool? generateWorkflowFile = default(bool?)) + { + CodeConfiguration = codeConfiguration; + ContainerConfiguration = containerConfiguration; + IsLinux = isLinux; + GenerateWorkflowFile = generateWorkflowFile; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets gitHub Action code configuration. + /// + [JsonProperty(PropertyName = "codeConfiguration")] + public GitHubActionCodeConfiguration CodeConfiguration { get; set; } + + /// + /// Gets or sets gitHub Action container configuration. + /// + [JsonProperty(PropertyName = "containerConfiguration")] + public GitHubActionContainerConfiguration ContainerConfiguration { get; set; } + + /// + /// Gets or sets this will help determine the workflow configuration to + /// select. + /// + [JsonProperty(PropertyName = "isLinux")] + public bool? IsLinux { get; set; } + + /// + /// Gets or sets workflow option to determine whether the workflow file + /// should be generated and written to the repository. + /// + [JsonProperty(PropertyName = "generateWorkflowFile")] + public bool? GenerateWorkflowFile { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs new file mode 100644 index 000000000000..07b4058844c6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The GitHub action container configuration. + /// + public partial class GitHubActionContainerConfiguration + { + /// + /// Initializes a new instance of the + /// GitHubActionContainerConfiguration class. + /// + public GitHubActionContainerConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GitHubActionContainerConfiguration class. + /// + /// The server URL for the container registry + /// where the build will be hosted. + /// The image name for the build. + /// The username used to upload the image to the + /// container registry. + /// The password used to upload the image to the + /// container registry. + public GitHubActionContainerConfiguration(string serverUrl = default(string), string imageName = default(string), string username = default(string), string password = default(string)) + { + ServerUrl = serverUrl; + ImageName = imageName; + Username = username; + Password = password; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the server URL for the container registry where the + /// build will be hosted. + /// + [JsonProperty(PropertyName = "serverUrl")] + public string ServerUrl { get; set; } + + /// + /// Gets or sets the image name for the build. + /// + [JsonProperty(PropertyName = "imageName")] + public string ImageName { get; set; } + + /// + /// Gets or sets the username used to upload the image to the container + /// registry. + /// + [JsonProperty(PropertyName = "username")] + public string Username { get; set; } + + /// + /// Gets or sets the password used to upload the image to the container + /// registry. + /// + [JsonProperty(PropertyName = "password")] + public string Password { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs new file mode 100644 index 000000000000..6a49283cffe7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// GitHub Actions Web App stack settings. + /// + public partial class GitHubActionWebAppStackSettings + { + /// + /// Initializes a new instance of the GitHubActionWebAppStackSettings + /// class. + /// + public GitHubActionWebAppStackSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GitHubActionWebAppStackSettings + /// class. + /// + /// <code>true</code> if GitHub + /// Actions is supported for the stack; otherwise, + /// <code>false</code>. + /// The minor version that is supported + /// for GitHub Actions. + public GitHubActionWebAppStackSettings(bool? isSupported = default(bool?), string supportedVersion = default(string)) + { + IsSupported = isSupported; + SupportedVersion = supportedVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if GitHub + /// Actions is supported for the stack; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isSupported")] + public bool? IsSupported { get; private set; } + + /// + /// Gets the minor version that is supported for GitHub Actions. + /// + [JsonProperty(PropertyName = "supportedVersion")] + public string SupportedVersion { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs index 25b7f98e559f..fd01b2c7989c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs @@ -35,14 +35,17 @@ public IdentityProviders() /// Resource Name. /// Kind of resource. /// Resource type. - public IdentityProviders(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), Facebook facebook = default(Facebook), GitHub gitHub = default(GitHub), Google google = default(Google), Twitter twitter = default(Twitter), IDictionary customOpenIdConnectProviders = default(IDictionary)) + public IdentityProviders(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), Facebook facebook = default(Facebook), GitHub gitHub = default(GitHub), Google google = default(Google), LegacyMicrosoftAccount legacyMicrosoftAccount = default(LegacyMicrosoftAccount), Twitter twitter = default(Twitter), Apple apple = default(Apple), AzureStaticWebApps azureStaticWebApps = default(AzureStaticWebApps), IDictionary customOpenIdConnectProviders = default(IDictionary)) : base(id, name, kind, type) { AzureActiveDirectory = azureActiveDirectory; Facebook = facebook; GitHub = gitHub; Google = google; + LegacyMicrosoftAccount = legacyMicrosoftAccount; Twitter = twitter; + Apple = apple; + AzureStaticWebApps = azureStaticWebApps; CustomOpenIdConnectProviders = customOpenIdConnectProviders; CustomInit(); } @@ -72,11 +75,26 @@ public IdentityProviders() [JsonProperty(PropertyName = "properties.google")] public Google Google { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.legacyMicrosoftAccount")] + public LegacyMicrosoftAccount LegacyMicrosoftAccount { get; set; } + /// /// [JsonProperty(PropertyName = "properties.twitter")] public Twitter Twitter { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.apple")] + public Apple Apple { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.azureStaticWebApps")] + public AzureStaticWebApps AzureStaticWebApps { get; set; } + /// /// [JsonProperty(PropertyName = "properties.customOpenIdConnectProviders")] diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs new file mode 100644 index 000000000000..e625bc5841cd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.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.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for InsightStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum InsightStatus + { + [EnumMember(Value = "Critical")] + Critical, + [EnumMember(Value = "Warning")] + Warning, + [EnumMember(Value = "Info")] + Info, + [EnumMember(Value = "Success")] + Success, + [EnumMember(Value = "None")] + None + } + internal static class InsightStatusEnumExtension + { + internal static string ToSerializedValue(this InsightStatus? value) + { + return value == null ? null : ((InsightStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this InsightStatus value) + { + switch( value ) + { + case InsightStatus.Critical: + return "Critical"; + case InsightStatus.Warning: + return "Warning"; + case InsightStatus.Info: + return "Info"; + case InsightStatus.Success: + return "Success"; + case InsightStatus.None: + return "None"; + } + return null; + } + + internal static InsightStatus? ParseInsightStatus(this string value) + { + switch( value ) + { + case "Critical": + return InsightStatus.Critical; + case "Warning": + return InsightStatus.Warning; + case "Info": + return InsightStatus.Info; + case "Success": + return InsightStatus.Success; + case "None": + return InsightStatus.None; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs new file mode 100644 index 000000000000..bcad1cb1452e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class KeyValuePairStringObject + { + /// + /// Initializes a new instance of the KeyValuePairStringObject class. + /// + public KeyValuePairStringObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KeyValuePairStringObject class. + /// + public KeyValuePairStringObject(string key = default(string), object value = default(object)) + { + Key = key; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "value")] + public object Value { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs new file mode 100644 index 000000000000..9153aca339a0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specification for a Kubernetes Environment to use for this resource. + /// + public partial class KubeEnvironmentProfile + { + /// + /// Initializes a new instance of the KubeEnvironmentProfile class. + /// + public KubeEnvironmentProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KubeEnvironmentProfile class. + /// + /// Resource ID of the Kubernetes Environment. + /// Name of the Kubernetes Environment. + /// Resource type of the Kubernetes + /// Environment. + public KubeEnvironmentProfile(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 or sets resource ID of the Kubernetes Environment. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets name of the Kubernetes Environment. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type of the Kubernetes Environment. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs new file mode 100644 index 000000000000..60c4a5747280 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] + public partial class LegacyMicrosoftAccount : ProxyOnlyResource + { + /// + /// Initializes a new instance of the LegacyMicrosoftAccount class. + /// + public LegacyMicrosoftAccount() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LegacyMicrosoftAccount class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public LegacyMicrosoftAccount(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), ClientRegistration registration = default(ClientRegistration), LoginScopes login = default(LoginScopes), AllowedAudiencesValidation validation = default(AllowedAudiencesValidation)) + : base(id, name, kind, type) + { + Enabled = enabled; + Registration = registration; + Login = login; + Validation = validation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.registration")] + public ClientRegistration Registration { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.login")] + public LoginScopes Login { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.validation")] + public AllowedAudiencesValidation Validation { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs new file mode 100644 index 000000000000..7abd94c002c7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs @@ -0,0 +1,127 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Linux Java Container settings. + /// + public partial class LinuxJavaContainerSettings + { + /// + /// Initializes a new instance of the LinuxJavaContainerSettings class. + /// + public LinuxJavaContainerSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinuxJavaContainerSettings class. + /// + /// Java 11 version (runtime only). + /// Java 8 version (runtime only). + /// <code>true</code> if the stack + /// is in preview; otherwise, <code>false</code>. + /// <code>true</code> if the + /// stack is deprecated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the stack + /// should be hidden; otherwise, + /// <code>false</code>. + /// End-of-life date for the minor + /// version. + /// <code>true</code> if the + /// stack version is auto-updated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the + /// minor version is early-access; otherwise, + /// <code>false</code>. + public LinuxJavaContainerSettings(string java11Runtime = default(string), string java8Runtime = default(string), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) + { + Java11Runtime = java11Runtime; + Java8Runtime = java8Runtime; + IsPreview = isPreview; + IsDeprecated = isDeprecated; + IsHidden = isHidden; + EndOfLifeDate = endOfLifeDate; + IsAutoUpdate = isAutoUpdate; + IsEarlyAccess = isEarlyAccess; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets java 11 version (runtime only). + /// + [JsonProperty(PropertyName = "java11Runtime")] + public string Java11Runtime { get; private set; } + + /// + /// Gets java 8 version (runtime only). + /// + [JsonProperty(PropertyName = "java8Runtime")] + public string Java8Runtime { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// in preview; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isPreview")] + public bool? IsPreview { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// deprecated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDeprecated")] + public bool? IsDeprecated { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// should be hidden; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden { get; private set; } + + /// + /// Gets end-of-life date for the minor version. + /// + [JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// version is auto-updated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isAutoUpdate")] + public bool? IsAutoUpdate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the minor + /// version is early-access; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isEarlyAccess")] + public bool? IsEarlyAccess { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs index a4a9f849e4f9..b635569ca214 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs @@ -19,6 +19,6 @@ public static class LoadBalancingMode public const string None = "None"; public const string Web = "Web"; public const string Publishing = "Publishing"; - public const string WebPublishing = "Web,Publishing"; + public const string WebPublishing = "Web, Publishing"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkAccessControlEntry.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkAccessControlEntry.cs deleted file mode 100644 index a09d92546938..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkAccessControlEntry.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Network access control entry. - /// - public partial class NetworkAccessControlEntry - { - /// - /// Initializes a new instance of the NetworkAccessControlEntry class. - /// - public NetworkAccessControlEntry() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NetworkAccessControlEntry class. - /// - /// Action object. Possible values include: - /// 'Permit', 'Deny' - /// Description of network access control - /// entry. - /// Order of precedence. - /// Remote subnet. - public NetworkAccessControlEntry(AccessControlEntryAction? action = default(AccessControlEntryAction?), string description = default(string), int? order = default(int?), string remoteSubnet = default(string)) - { - Action = action; - Description = description; - Order = order; - RemoteSubnet = remoteSubnet; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets action object. Possible values include: 'Permit', - /// 'Deny' - /// - [JsonProperty(PropertyName = "action")] - public AccessControlEntryAction? Action { get; set; } - - /// - /// Gets or sets description of network access control entry. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets or sets order of precedence. - /// - [JsonProperty(PropertyName = "order")] - public int? Order { get; set; } - - /// - /// Gets or sets remote subnet. - /// - [JsonProperty(PropertyName = "remoteSubnet")] - public string RemoteSubnet { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs new file mode 100644 index 000000000000..eeffe769f026 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Result for utterances query. + /// + public partial class QueryUtterancesResult + { + /// + /// Initializes a new instance of the QueryUtterancesResult class. + /// + public QueryUtterancesResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryUtterancesResult class. + /// + /// A sample utterance. + /// Score of a sample utterance. + public QueryUtterancesResult(SampleUtterance sampleUtterance = default(SampleUtterance), double? score = default(double?)) + { + SampleUtterance = sampleUtterance; + Score = score; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a sample utterance. + /// + [JsonProperty(PropertyName = "sampleUtterance")] + public SampleUtterance SampleUtterance { get; set; } + + /// + /// Gets or sets score of a sample utterance. + /// + [JsonProperty(PropertyName = "score")] + public double? Score { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs new file mode 100644 index 000000000000..9d352753d920 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Suggested utterances where the detector can be applicable + /// + public partial class QueryUtterancesResults + { + /// + /// Initializes a new instance of the QueryUtterancesResults class. + /// + public QueryUtterancesResults() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryUtterancesResults class. + /// + /// Search Query. + /// Array of utterance results for search + /// query. + public QueryUtterancesResults(string query = default(string), IList results = default(IList)) + { + Query = query; + Results = results; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets search Query. + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; set; } + + /// + /// Gets or sets array of utterance results for search query. + /// + [JsonProperty(PropertyName = "results")] + public IList Results { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs similarity index 62% rename from sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionResource.cs rename to sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs index 2785fb08e062..0d506eacfa07 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs @@ -13,26 +13,28 @@ namespace Microsoft.Azure.Management.WebSites.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Private Endpoint Connection ARM resource. + /// Remote Private Endpoint Connection ARM resource. /// [Rest.Serialization.JsonTransformation] - public partial class PrivateEndpointConnectionResource : ProxyOnlyResource + public partial class RemotePrivateEndpointConnectionARMResource : ProxyOnlyResource { /// - /// Initializes a new instance of the PrivateEndpointConnectionResource - /// class. + /// Initializes a new instance of the + /// RemotePrivateEndpointConnectionARMResource class. /// - public PrivateEndpointConnectionResource() + public RemotePrivateEndpointConnectionARMResource() { CustomInit(); } /// - /// Initializes a new instance of the PrivateEndpointConnectionResource - /// class. + /// Initializes a new instance of the + /// RemotePrivateEndpointConnectionARMResource class. /// /// Resource Id. /// Resource Name. @@ -40,12 +42,15 @@ public PrivateEndpointConnectionResource() /// Resource type. /// PrivateEndpoint of a remote private /// endpoint connection - public PrivateEndpointConnectionResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string provisioningState = default(string), ArmIdWrapper privateEndpoint = default(ArmIdWrapper), PrivateLinkConnectionState privateLinkServiceConnectionState = default(PrivateLinkConnectionState)) + /// Private IPAddresses mapped to the remote + /// private endpoint + public RemotePrivateEndpointConnectionARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string provisioningState = default(string), ArmIdWrapper privateEndpoint = default(ArmIdWrapper), PrivateLinkConnectionState privateLinkServiceConnectionState = default(PrivateLinkConnectionState), IList ipAddresses = default(IList)) : base(id, name, kind, type) { ProvisioningState = provisioningState; PrivateEndpoint = privateEndpoint; PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + IpAddresses = ipAddresses; CustomInit(); } @@ -71,5 +76,12 @@ public PrivateEndpointConnectionResource() [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] public PrivateLinkConnectionState PrivateLinkServiceConnectionState { get; set; } + /// + /// Gets or sets private IPAddresses mapped to the remote private + /// endpoint + /// + [JsonProperty(PropertyName = "properties.ipAddresses")] + public IList IpAddresses { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs index 8080fa872330..b9628aacb6f1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs @@ -30,7 +30,12 @@ public Rendering() /// Initializes a new instance of the Rendering class. /// /// Rendering Type. Possible values include: - /// 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + /// 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance', + /// 'PieChart', 'DataSummary', 'Email', 'Insights', 'DynamicInsight', + /// 'Markdown', 'Detector', 'DropDown', 'Card', 'Solution', 'Guage', + /// 'Form', 'ChangeSets', 'ChangeAnalysisOnboarding', 'ChangesView', + /// 'AppInsight', 'DependencyGraph', 'DownTime', 'SummaryCard', + /// 'SearchComponent', 'AppInsightEnablement' /// Title of data /// Description of the data that will help it /// be interpreted @@ -49,7 +54,12 @@ public Rendering() /// /// Gets or sets rendering Type. Possible values include: 'NoGraph', - /// 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + /// 'Table', 'TimeSeries', 'TimeSeriesPerInstance', 'PieChart', + /// 'DataSummary', 'Email', 'Insights', 'DynamicInsight', 'Markdown', + /// 'Detector', 'DropDown', 'Card', 'Solution', 'Guage', 'Form', + /// 'ChangeSets', 'ChangeAnalysisOnboarding', 'ChangesView', + /// 'AppInsight', 'DependencyGraph', 'DownTime', 'SummaryCard', + /// 'SearchComponent', 'AppInsightEnablement' /// [JsonProperty(PropertyName = "type")] public RenderingType? Type { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs index bf0ebdff16f5..727d7df75757 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs @@ -28,7 +28,49 @@ public enum RenderingType [EnumMember(Value = "TimeSeries")] TimeSeries, [EnumMember(Value = "TimeSeriesPerInstance")] - TimeSeriesPerInstance + TimeSeriesPerInstance, + [EnumMember(Value = "PieChart")] + PieChart, + [EnumMember(Value = "DataSummary")] + DataSummary, + [EnumMember(Value = "Email")] + Email, + [EnumMember(Value = "Insights")] + Insights, + [EnumMember(Value = "DynamicInsight")] + DynamicInsight, + [EnumMember(Value = "Markdown")] + Markdown, + [EnumMember(Value = "Detector")] + Detector, + [EnumMember(Value = "DropDown")] + DropDown, + [EnumMember(Value = "Card")] + Card, + [EnumMember(Value = "Solution")] + Solution, + [EnumMember(Value = "Guage")] + Guage, + [EnumMember(Value = "Form")] + Form, + [EnumMember(Value = "ChangeSets")] + ChangeSets, + [EnumMember(Value = "ChangeAnalysisOnboarding")] + ChangeAnalysisOnboarding, + [EnumMember(Value = "ChangesView")] + ChangesView, + [EnumMember(Value = "AppInsight")] + AppInsight, + [EnumMember(Value = "DependencyGraph")] + DependencyGraph, + [EnumMember(Value = "DownTime")] + DownTime, + [EnumMember(Value = "SummaryCard")] + SummaryCard, + [EnumMember(Value = "SearchComponent")] + SearchComponent, + [EnumMember(Value = "AppInsightEnablement")] + AppInsightEnablement } internal static class RenderingTypeEnumExtension { @@ -49,6 +91,48 @@ internal static string ToSerializedValue(this RenderingType value) return "TimeSeries"; case RenderingType.TimeSeriesPerInstance: return "TimeSeriesPerInstance"; + case RenderingType.PieChart: + return "PieChart"; + case RenderingType.DataSummary: + return "DataSummary"; + case RenderingType.Email: + return "Email"; + case RenderingType.Insights: + return "Insights"; + case RenderingType.DynamicInsight: + return "DynamicInsight"; + case RenderingType.Markdown: + return "Markdown"; + case RenderingType.Detector: + return "Detector"; + case RenderingType.DropDown: + return "DropDown"; + case RenderingType.Card: + return "Card"; + case RenderingType.Solution: + return "Solution"; + case RenderingType.Guage: + return "Guage"; + case RenderingType.Form: + return "Form"; + case RenderingType.ChangeSets: + return "ChangeSets"; + case RenderingType.ChangeAnalysisOnboarding: + return "ChangeAnalysisOnboarding"; + case RenderingType.ChangesView: + return "ChangesView"; + case RenderingType.AppInsight: + return "AppInsight"; + case RenderingType.DependencyGraph: + return "DependencyGraph"; + case RenderingType.DownTime: + return "DownTime"; + case RenderingType.SummaryCard: + return "SummaryCard"; + case RenderingType.SearchComponent: + return "SearchComponent"; + case RenderingType.AppInsightEnablement: + return "AppInsightEnablement"; } return null; } @@ -65,6 +149,48 @@ internal static string ToSerializedValue(this RenderingType value) return RenderingType.TimeSeries; case "TimeSeriesPerInstance": return RenderingType.TimeSeriesPerInstance; + case "PieChart": + return RenderingType.PieChart; + case "DataSummary": + return RenderingType.DataSummary; + case "Email": + return RenderingType.Email; + case "Insights": + return RenderingType.Insights; + case "DynamicInsight": + return RenderingType.DynamicInsight; + case "Markdown": + return RenderingType.Markdown; + case "Detector": + return RenderingType.Detector; + case "DropDown": + return RenderingType.DropDown; + case "Card": + return RenderingType.Card; + case "Solution": + return RenderingType.Solution; + case "Guage": + return RenderingType.Guage; + case "Form": + return RenderingType.Form; + case "ChangeSets": + return RenderingType.ChangeSets; + case "ChangeAnalysisOnboarding": + return RenderingType.ChangeAnalysisOnboarding; + case "ChangesView": + return RenderingType.ChangesView; + case "AppInsight": + return RenderingType.AppInsight; + case "DependencyGraph": + return RenderingType.DependencyGraph; + case "DownTime": + return RenderingType.DownTime; + case "SummaryCard": + return RenderingType.SummaryCard; + case "SearchComponent": + return RenderingType.SearchComponent; + case "AppInsightEnablement": + return RenderingType.AppInsightEnablement; } return null; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs new file mode 100644 index 000000000000..a83588884f36 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs @@ -0,0 +1,114 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ResolveStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ResolveStatus + { + [EnumMember(Value = "Initialized")] + Initialized, + [EnumMember(Value = "Resolved")] + Resolved, + [EnumMember(Value = "InvalidSyntax")] + InvalidSyntax, + [EnumMember(Value = "MSINotEnabled")] + MSINotEnabled, + [EnumMember(Value = "VaultNotFound")] + VaultNotFound, + [EnumMember(Value = "SecretNotFound")] + SecretNotFound, + [EnumMember(Value = "SecretVersionNotFound")] + SecretVersionNotFound, + [EnumMember(Value = "AccessToKeyVaultDenied")] + AccessToKeyVaultDenied, + [EnumMember(Value = "OtherReasons")] + OtherReasons, + [EnumMember(Value = "FetchTimedOut")] + FetchTimedOut, + [EnumMember(Value = "UnauthorizedClient")] + UnauthorizedClient + } + internal static class ResolveStatusEnumExtension + { + internal static string ToSerializedValue(this ResolveStatus? value) + { + return value == null ? null : ((ResolveStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ResolveStatus value) + { + switch( value ) + { + case ResolveStatus.Initialized: + return "Initialized"; + case ResolveStatus.Resolved: + return "Resolved"; + case ResolveStatus.InvalidSyntax: + return "InvalidSyntax"; + case ResolveStatus.MSINotEnabled: + return "MSINotEnabled"; + case ResolveStatus.VaultNotFound: + return "VaultNotFound"; + case ResolveStatus.SecretNotFound: + return "SecretNotFound"; + case ResolveStatus.SecretVersionNotFound: + return "SecretVersionNotFound"; + case ResolveStatus.AccessToKeyVaultDenied: + return "AccessToKeyVaultDenied"; + case ResolveStatus.OtherReasons: + return "OtherReasons"; + case ResolveStatus.FetchTimedOut: + return "FetchTimedOut"; + case ResolveStatus.UnauthorizedClient: + return "UnauthorizedClient"; + } + return null; + } + + internal static ResolveStatus? ParseResolveStatus(this string value) + { + switch( value ) + { + case "Initialized": + return ResolveStatus.Initialized; + case "Resolved": + return ResolveStatus.Resolved; + case "InvalidSyntax": + return ResolveStatus.InvalidSyntax; + case "MSINotEnabled": + return ResolveStatus.MSINotEnabled; + case "VaultNotFound": + return ResolveStatus.VaultNotFound; + case "SecretNotFound": + return ResolveStatus.SecretNotFound; + case "SecretVersionNotFound": + return ResolveStatus.SecretVersionNotFound; + case "AccessToKeyVaultDenied": + return ResolveStatus.AccessToKeyVaultDenied; + case "OtherReasons": + return ResolveStatus.OtherReasons; + case "FetchTimedOut": + return ResolveStatus.FetchTimedOut; + case "UnauthorizedClient": + return ResolveStatus.UnauthorizedClient; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs new file mode 100644 index 000000000000..f649b929bc22 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Sample utterance. + /// + public partial class SampleUtterance + { + /// + /// Initializes a new instance of the SampleUtterance class. + /// + public SampleUtterance() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SampleUtterance class. + /// + /// Text attribute of sample utterance. + /// Links attribute of sample utterance. + /// Question id of sample utterance (for + /// stackoverflow questions titles). + public SampleUtterance(string text = default(string), IList links = default(IList), string qid = default(string)) + { + Text = text; + Links = links; + Qid = qid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets text attribute of sample utterance. + /// + [JsonProperty(PropertyName = "text")] + public string Text { get; set; } + + /// + /// Gets or sets links attribute of sample utterance. + /// + [JsonProperty(PropertyName = "links")] + public IList Links { get; set; } + + /// + /// Gets or sets question id of sample utterance (for stackoverflow + /// questions titles). + /// + [JsonProperty(PropertyName = "qid")] + public string Qid { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs index 5a5d96d804c3..0fb91942b83a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs @@ -95,7 +95,7 @@ public Site() /// ClientCert is required. /// - ClientCertEnabled: true and ClientCertMode: Optional means /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional' + /// 'Required', 'Optional', 'OptionalInteractiveUser' /// client certificate /// authentication comma-separated exclusion paths /// <code>true</code> to @@ -132,6 +132,8 @@ public Site() /// Read-only. /// Status of the last deployment slot /// swap operation. + /// Identity to use for Key + /// Vault Reference authentication. /// HttpsOnly: configures a web site to accept /// only https requests. Issues redirect for /// http requests @@ -140,7 +142,9 @@ public Site() /// 'GeoRedundant' /// Specifies an operation id if /// this site has a pending operation. - public Site(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + /// Checks if Customer provided + /// storage account is required + public Site(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), string keyVaultReferenceIdentity = default(string), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), bool? storageAccountRequired = default(bool?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) : base(location, id, name, kind, type, tags) { State = state; @@ -178,9 +182,11 @@ public Site() IsDefaultContainer = isDefaultContainer; DefaultHostName = defaultHostName; SlotSwapStatus = slotSwapStatus; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; HttpsOnly = httpsOnly; RedundancyMode = redundancyMode; InProgressOperationId = inProgressOperationId; + StorageAccountRequired = storageAccountRequired; Identity = identity; CustomInit(); } @@ -344,7 +350,7 @@ public Site() /// ClientCert is required. /// - ClientCertEnabled: true and ClientCertMode: Optional means /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional' + /// 'Required', 'Optional', 'OptionalInteractiveUser' /// [JsonProperty(PropertyName = "properties.clientCertMode")] public ClientCertMode? ClientCertMode { get; set; } @@ -449,6 +455,13 @@ public Site() [JsonProperty(PropertyName = "properties.slotSwapStatus")] public SlotSwapStatus SlotSwapStatus { get; private set; } + /// + /// Gets or sets identity to use for Key Vault Reference + /// authentication. + /// + [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] + public string KeyVaultReferenceIdentity { get; set; } + /// /// Gets or sets httpsOnly: configures a web site to accept only https /// requests. Issues redirect for @@ -471,6 +484,13 @@ public Site() [JsonProperty(PropertyName = "properties.inProgressOperationId")] public System.Guid? InProgressOperationId { get; private set; } + /// + /// Gets or sets checks if Customer provided storage account is + /// required + /// + [JsonProperty(PropertyName = "properties.storageAccountRequired")] + public bool? StorageAccountRequired { get; set; } + /// /// [JsonProperty(PropertyName = "identity")] diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs index a87bf293faac..211394661964 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs @@ -46,6 +46,10 @@ public SiteAuthSettings() /// Authentication / Authorization feature in use for the current app. /// The setting in this value can control the behavior of certain /// features in the Authentication / Authorization module. + /// The ConfigVersion of the Authentication + /// / Authorization feature in use for the current app. + /// The setting in this value can control the behavior of the control + /// plane for Authentication / Authorization. /// The action to take when /// an unauthenticated client attempts to access the app. Possible /// values include: 'RedirectToLoginPage', 'AllowAnonymous' @@ -205,11 +209,12 @@ public SiteAuthSettings() /// auth settings. /// If the path is relative, base will the site's root /// directory. - public SiteAuthSettings(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), string runtimeVersion = default(string), UnauthenticatedClientAction? unauthenticatedClientAction = default(UnauthenticatedClientAction?), bool? tokenStoreEnabled = default(bool?), IList allowedExternalRedirectUrls = default(IList), BuiltInAuthenticationProvider? defaultProvider = default(BuiltInAuthenticationProvider?), double? tokenRefreshExtensionHours = default(double?), string clientId = default(string), string clientSecret = default(string), string clientSecretSettingName = default(string), string clientSecretCertificateThumbprint = default(string), string issuer = default(string), bool? validateIssuer = default(bool?), IList allowedAudiences = default(IList), IList additionalLoginParams = default(IList), string aadClaimsAuthorization = default(string), string googleClientId = default(string), string googleClientSecret = default(string), string googleClientSecretSettingName = default(string), IList googleOAuthScopes = default(IList), string facebookAppId = default(string), string facebookAppSecret = default(string), string facebookAppSecretSettingName = default(string), IList facebookOAuthScopes = default(IList), string gitHubClientId = default(string), string gitHubClientSecret = default(string), string gitHubClientSecretSettingName = default(string), IList gitHubOAuthScopes = default(IList), string twitterConsumerKey = default(string), string twitterConsumerSecret = default(string), string twitterConsumerSecretSettingName = default(string), string microsoftAccountClientId = default(string), string microsoftAccountClientSecret = default(string), string microsoftAccountClientSecretSettingName = default(string), IList microsoftAccountOAuthScopes = default(IList), string isAuthFromFile = default(string), string authFilePath = default(string)) + public SiteAuthSettings(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), string runtimeVersion = default(string), string configVersion = default(string), UnauthenticatedClientAction? unauthenticatedClientAction = default(UnauthenticatedClientAction?), bool? tokenStoreEnabled = default(bool?), IList allowedExternalRedirectUrls = default(IList), BuiltInAuthenticationProvider? defaultProvider = default(BuiltInAuthenticationProvider?), double? tokenRefreshExtensionHours = default(double?), string clientId = default(string), string clientSecret = default(string), string clientSecretSettingName = default(string), string clientSecretCertificateThumbprint = default(string), string issuer = default(string), bool? validateIssuer = default(bool?), IList allowedAudiences = default(IList), IList additionalLoginParams = default(IList), string aadClaimsAuthorization = default(string), string googleClientId = default(string), string googleClientSecret = default(string), string googleClientSecretSettingName = default(string), IList googleOAuthScopes = default(IList), string facebookAppId = default(string), string facebookAppSecret = default(string), string facebookAppSecretSettingName = default(string), IList facebookOAuthScopes = default(IList), string gitHubClientId = default(string), string gitHubClientSecret = default(string), string gitHubClientSecretSettingName = default(string), IList gitHubOAuthScopes = default(IList), string twitterConsumerKey = default(string), string twitterConsumerSecret = default(string), string twitterConsumerSecretSettingName = default(string), string microsoftAccountClientId = default(string), string microsoftAccountClientSecret = default(string), string microsoftAccountClientSecretSettingName = default(string), IList microsoftAccountOAuthScopes = default(IList), string isAuthFromFile = default(string), string authFilePath = default(string)) : base(id, name, kind, type) { Enabled = enabled; RuntimeVersion = runtimeVersion; + ConfigVersion = configVersion; UnauthenticatedClientAction = unauthenticatedClientAction; TokenStoreEnabled = tokenStoreEnabled; AllowedExternalRedirectUrls = allowedExternalRedirectUrls; @@ -270,6 +275,15 @@ public SiteAuthSettings() [JsonProperty(PropertyName = "properties.runtimeVersion")] public string RuntimeVersion { get; set; } + /// + /// Gets or sets the ConfigVersion of the Authentication / + /// Authorization feature in use for the current app. + /// The setting in this value can control the behavior of the control + /// plane for Authentication / Authorization. + /// + [JsonProperty(PropertyName = "properties.configVersion")] + public string ConfigVersion { get; set; } + /// /// Gets or sets the action to take when an unauthenticated client /// attempts to access the app. Possible values include: diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs index 09a72225be37..eff84b23c039 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs @@ -64,6 +64,8 @@ public SiteConfig() /// <code>false</code>. /// Publishing user name. /// Application settings. + /// List of Azure Storage + /// Accounts. /// Connection strings. /// Site MachineKey. /// Handler mappings. @@ -89,7 +91,8 @@ public SiteConfig() /// Virtual applications. /// Site load balancing. Possible values /// include: 'WeightedRoundRobin', 'LeastRequests', - /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash', + /// 'PerSiteRoundRobin' /// This is work around for polymorphic /// types. /// Site limits. @@ -98,6 +101,12 @@ public SiteConfig() /// Auto Heal rules. /// Tracing options. /// Virtual Network name. + /// Virtual Network Route All + /// enabled. This causes all outbound traffic to have Virtual Network + /// Security Groups and User Defined Routes applied. + /// The number of private ports + /// assigned to this app. These will be assigned dynamically on + /// runtime. /// Cross-Origin Resource Sharing (CORS) /// settings. /// Push endpoint settings. @@ -113,6 +122,8 @@ public SiteConfig() /// Id /// Explicit Managed Service /// Identity Id + /// Identity to use for Key + /// Vault Reference authentication. /// IP security restrictions for /// main. /// IP security restrictions @@ -124,13 +135,38 @@ public SiteConfig() /// MinTlsVersion: configures the minimum /// version of TLS required for SSL requests. Possible values include: /// '1.0', '1.1', '1.2' + /// ScmMinTlsVersion: configures the + /// minimum version of TLS required for SSL requests for SCM site. + /// Possible values include: '1.0', '1.1', '1.2' /// State of FTP / FTPS service. Possible /// values include: 'AllAllowed', 'FtpsOnly', 'Disabled' /// Number of preWarmed instances. /// This setting only applies to the Consumption and Elastic /// Plans + /// Maximum number of workers that + /// a site can scale out to. + /// This setting only applies to the Consumption and Elastic Premium + /// Plans /// Health check path - public SiteConfig(int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), string healthCheckPath = default(string)) + /// Gets or sets a + /// value indicating whether functions runtime scale monitoring is + /// enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but + /// will instead call to the + /// runtime to get scale status. + /// Sets the time zone a site uses for + /// generating timestamps. Compatible with Linux and Windows App + /// Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence + /// over this config. For Linux, expects tz database values + /// https://www.iana.org/time-zones (for a quick reference see + /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For + /// Windows, expects one of the time zones listed under + /// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows + /// NT\CurrentVersion\Time Zones + /// Number of minimum + /// instance count for a site + /// This setting only applies to the Elastic Plans + public SiteConfig(int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IDictionary azureStorageAccounts = default(IDictionary), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), bool? vnetRouteAllEnabled = default(bool?), int? vnetPrivatePortsCount = default(int?), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), string keyVaultReferenceIdentity = default(string), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string scmMinTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), int? functionAppScaleLimit = default(int?), string healthCheckPath = default(string), bool? functionsRuntimeScaleMonitoringEnabled = default(bool?), string websiteTimeZone = default(string), int? minimumElasticInstanceCount = default(int?)) { NumberOfWorkers = numberOfWorkers; DefaultDocuments = defaultDocuments; @@ -150,6 +186,7 @@ public SiteConfig() DetailedErrorLoggingEnabled = detailedErrorLoggingEnabled; PublishingUsername = publishingUsername; AppSettings = appSettings; + AzureStorageAccounts = azureStorageAccounts; ConnectionStrings = connectionStrings; MachineKey = machineKey; HandlerMappings = handlerMappings; @@ -171,6 +208,8 @@ public SiteConfig() AutoHealRules = autoHealRules; TracingOptions = tracingOptions; VnetName = vnetName; + VnetRouteAllEnabled = vnetRouteAllEnabled; + VnetPrivatePortsCount = vnetPrivatePortsCount; Cors = cors; Push = push; ApiDefinition = apiDefinition; @@ -179,14 +218,20 @@ public SiteConfig() LocalMySqlEnabled = localMySqlEnabled; ManagedServiceIdentityId = managedServiceIdentityId; XManagedServiceIdentityId = xManagedServiceIdentityId; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; IpSecurityRestrictions = ipSecurityRestrictions; ScmIpSecurityRestrictions = scmIpSecurityRestrictions; ScmIpSecurityRestrictionsUseMain = scmIpSecurityRestrictionsUseMain; Http20Enabled = http20Enabled; MinTlsVersion = minTlsVersion; + ScmMinTlsVersion = scmMinTlsVersion; FtpsState = ftpsState; PreWarmedInstanceCount = preWarmedInstanceCount; + FunctionAppScaleLimit = functionAppScaleLimit; HealthCheckPath = healthCheckPath; + FunctionsRuntimeScaleMonitoringEnabled = functionsRuntimeScaleMonitoringEnabled; + WebsiteTimeZone = websiteTimeZone; + MinimumElasticInstanceCount = minimumElasticInstanceCount; CustomInit(); } @@ -311,6 +356,12 @@ public SiteConfig() [JsonProperty(PropertyName = "appSettings")] public IList AppSettings { get; set; } + /// + /// Gets or sets list of Azure Storage Accounts. + /// + [JsonProperty(PropertyName = "azureStorageAccounts")] + public IDictionary AzureStorageAccounts { get; set; } + /// /// Gets or sets connection strings. /// @@ -408,7 +459,7 @@ public SiteConfig() /// /// Gets or sets site load balancing. Possible values include: /// 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - /// 'WeightedTotalTraffic', 'RequestHash' + /// 'WeightedTotalTraffic', 'RequestHash', 'PerSiteRoundRobin' /// [JsonProperty(PropertyName = "loadBalancing")] public SiteLoadBalancing? LoadBalancing { get; set; } @@ -451,6 +502,21 @@ public SiteConfig() [JsonProperty(PropertyName = "vnetName")] public string VnetName { get; set; } + /// + /// Gets or sets virtual Network Route All enabled. This causes all + /// outbound traffic to have Virtual Network Security Groups and User + /// Defined Routes applied. + /// + [JsonProperty(PropertyName = "vnetRouteAllEnabled")] + public bool? VnetRouteAllEnabled { get; set; } + + /// + /// Gets or sets the number of private ports assigned to this app. + /// These will be assigned dynamically on runtime. + /// + [JsonProperty(PropertyName = "vnetPrivatePortsCount")] + public int? VnetPrivatePortsCount { get; set; } + /// /// Gets or sets cross-Origin Resource Sharing (CORS) settings. /// @@ -502,6 +568,13 @@ public SiteConfig() [JsonProperty(PropertyName = "xManagedServiceIdentityId")] public int? XManagedServiceIdentityId { get; set; } + /// + /// Gets or sets identity to use for Key Vault Reference + /// authentication. + /// + [JsonProperty(PropertyName = "keyVaultReferenceIdentity")] + public string KeyVaultReferenceIdentity { get; set; } + /// /// Gets or sets IP security restrictions for main. /// @@ -535,6 +608,14 @@ public SiteConfig() [JsonProperty(PropertyName = "minTlsVersion")] public string MinTlsVersion { get; set; } + /// + /// Gets or sets scmMinTlsVersion: configures the minimum version of + /// TLS required for SSL requests for SCM site. Possible values + /// include: '1.0', '1.1', '1.2' + /// + [JsonProperty(PropertyName = "scmMinTlsVersion")] + public string ScmMinTlsVersion { get; set; } + /// /// Gets or sets state of FTP / FTPS service. Possible values include: /// 'AllAllowed', 'FtpsOnly', 'Disabled' @@ -549,12 +630,52 @@ public SiteConfig() [JsonProperty(PropertyName = "preWarmedInstanceCount")] public int? PreWarmedInstanceCount { get; set; } + /// + /// Gets or sets maximum number of workers that a site can scale out + /// to. + /// This setting only applies to the Consumption and Elastic Premium + /// Plans + /// + [JsonProperty(PropertyName = "functionAppScaleLimit")] + public int? FunctionAppScaleLimit { get; set; } + /// /// Gets or sets health check path /// [JsonProperty(PropertyName = "healthCheckPath")] public string HealthCheckPath { get; set; } + /// + /// Gets or sets a value indicating whether functions runtime scale + /// monitoring is enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but + /// will instead call to the + /// runtime to get scale status. + /// + [JsonProperty(PropertyName = "functionsRuntimeScaleMonitoringEnabled")] + public bool? FunctionsRuntimeScaleMonitoringEnabled { get; set; } + + /// + /// Gets or sets sets the time zone a site uses for generating + /// timestamps. Compatible with Linux and Windows App Service. Setting + /// the WEBSITE_TIME_ZONE app setting takes precedence over this + /// config. For Linux, expects tz database values + /// https://www.iana.org/time-zones (for a quick reference see + /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For + /// Windows, expects one of the time zones listed under + /// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows + /// NT\CurrentVersion\Time Zones + /// + [JsonProperty(PropertyName = "websiteTimeZone")] + public string WebsiteTimeZone { get; set; } + + /// + /// Gets or sets number of minimum instance count for a site + /// This setting only applies to the Elastic Plans + /// + [JsonProperty(PropertyName = "minimumElasticInstanceCount")] + public int? MinimumElasticInstanceCount { get; set; } + /// /// Validate the object. /// @@ -575,6 +696,18 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "PreWarmedInstanceCount", 0); } + if (FunctionAppScaleLimit < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "FunctionAppScaleLimit", 0); + } + if (MinimumElasticInstanceCount > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MinimumElasticInstanceCount", 20); + } + if (MinimumElasticInstanceCount < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MinimumElasticInstanceCount", 0); + } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs new file mode 100644 index 000000000000..d331ddb6de0e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Site config properties dictionary. + /// + public partial class SiteConfigPropertiesDictionary + { + /// + /// Initializes a new instance of the SiteConfigPropertiesDictionary + /// class. + /// + public SiteConfigPropertiesDictionary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SiteConfigPropertiesDictionary + /// class. + /// + /// <code>true</code> + /// if use32BitWorkerProcess should be set to true for the stack; + /// otherwise, <code>false</code>. + /// LinuxFxVersion configuration + /// setting. + /// JavaVersion configuration + /// setting. + /// PowerShellVersion configuration + /// setting. + public SiteConfigPropertiesDictionary(bool? use32BitWorkerProcess = default(bool?), string linuxFxVersion = default(string), string javaVersion = default(string), string powerShellVersion = default(string)) + { + Use32BitWorkerProcess = use32BitWorkerProcess; + LinuxFxVersion = linuxFxVersion; + JavaVersion = javaVersion; + PowerShellVersion = powerShellVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if + /// use32BitWorkerProcess should be set to true for the stack; + /// otherwise, &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "use32BitWorkerProcess")] + public bool? Use32BitWorkerProcess { get; private set; } + + /// + /// Gets linuxFxVersion configuration setting. + /// + [JsonProperty(PropertyName = "linuxFxVersion")] + public string LinuxFxVersion { get; private set; } + + /// + /// Gets javaVersion configuration setting. + /// + [JsonProperty(PropertyName = "javaVersion")] + public string JavaVersion { get; private set; } + + /// + /// Gets powerShellVersion configuration setting. + /// + [JsonProperty(PropertyName = "powerShellVersion")] + public string PowerShellVersion { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs index c51daa41c62e..67383d2060fc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs @@ -70,6 +70,8 @@ public SiteConfigResource() /// <code>false</code>. /// Publishing user name. /// Application settings. + /// List of Azure Storage + /// Accounts. /// Connection strings. /// Site MachineKey. /// Handler mappings. @@ -95,7 +97,8 @@ public SiteConfigResource() /// Virtual applications. /// Site load balancing. Possible values /// include: 'WeightedRoundRobin', 'LeastRequests', - /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash', + /// 'PerSiteRoundRobin' /// This is work around for polymorphic /// types. /// Site limits. @@ -104,6 +107,12 @@ public SiteConfigResource() /// Auto Heal rules. /// Tracing options. /// Virtual Network name. + /// Virtual Network Route All + /// enabled. This causes all outbound traffic to have Virtual Network + /// Security Groups and User Defined Routes applied. + /// The number of private ports + /// assigned to this app. These will be assigned dynamically on + /// runtime. /// Cross-Origin Resource Sharing (CORS) /// settings. /// Push endpoint settings. @@ -119,6 +128,8 @@ public SiteConfigResource() /// Id /// Explicit Managed Service /// Identity Id + /// Identity to use for Key + /// Vault Reference authentication. /// IP security restrictions for /// main. /// IP security restrictions @@ -130,13 +141,38 @@ public SiteConfigResource() /// MinTlsVersion: configures the minimum /// version of TLS required for SSL requests. Possible values include: /// '1.0', '1.1', '1.2' + /// ScmMinTlsVersion: configures the + /// minimum version of TLS required for SSL requests for SCM site. + /// Possible values include: '1.0', '1.1', '1.2' /// State of FTP / FTPS service. Possible /// values include: 'AllAllowed', 'FtpsOnly', 'Disabled' /// Number of preWarmed instances. /// This setting only applies to the Consumption and Elastic /// Plans + /// Maximum number of workers that + /// a site can scale out to. + /// This setting only applies to the Consumption and Elastic Premium + /// Plans /// Health check path - public SiteConfigResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), string healthCheckPath = default(string)) + /// Gets or sets a + /// value indicating whether functions runtime scale monitoring is + /// enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but + /// will instead call to the + /// runtime to get scale status. + /// Sets the time zone a site uses for + /// generating timestamps. Compatible with Linux and Windows App + /// Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence + /// over this config. For Linux, expects tz database values + /// https://www.iana.org/time-zones (for a quick reference see + /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For + /// Windows, expects one of the time zones listed under + /// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows + /// NT\CurrentVersion\Time Zones + /// Number of minimum + /// instance count for a site + /// This setting only applies to the Elastic Plans + public SiteConfigResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IDictionary azureStorageAccounts = default(IDictionary), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), bool? vnetRouteAllEnabled = default(bool?), int? vnetPrivatePortsCount = default(int?), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), string keyVaultReferenceIdentity = default(string), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string scmMinTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), int? functionAppScaleLimit = default(int?), string healthCheckPath = default(string), bool? functionsRuntimeScaleMonitoringEnabled = default(bool?), string websiteTimeZone = default(string), int? minimumElasticInstanceCount = default(int?)) : base(id, name, kind, type) { NumberOfWorkers = numberOfWorkers; @@ -157,6 +193,7 @@ public SiteConfigResource() DetailedErrorLoggingEnabled = detailedErrorLoggingEnabled; PublishingUsername = publishingUsername; AppSettings = appSettings; + AzureStorageAccounts = azureStorageAccounts; ConnectionStrings = connectionStrings; MachineKey = machineKey; HandlerMappings = handlerMappings; @@ -178,6 +215,8 @@ public SiteConfigResource() AutoHealRules = autoHealRules; TracingOptions = tracingOptions; VnetName = vnetName; + VnetRouteAllEnabled = vnetRouteAllEnabled; + VnetPrivatePortsCount = vnetPrivatePortsCount; Cors = cors; Push = push; ApiDefinition = apiDefinition; @@ -186,14 +225,20 @@ public SiteConfigResource() LocalMySqlEnabled = localMySqlEnabled; ManagedServiceIdentityId = managedServiceIdentityId; XManagedServiceIdentityId = xManagedServiceIdentityId; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; IpSecurityRestrictions = ipSecurityRestrictions; ScmIpSecurityRestrictions = scmIpSecurityRestrictions; ScmIpSecurityRestrictionsUseMain = scmIpSecurityRestrictionsUseMain; Http20Enabled = http20Enabled; MinTlsVersion = minTlsVersion; + ScmMinTlsVersion = scmMinTlsVersion; FtpsState = ftpsState; PreWarmedInstanceCount = preWarmedInstanceCount; + FunctionAppScaleLimit = functionAppScaleLimit; HealthCheckPath = healthCheckPath; + FunctionsRuntimeScaleMonitoringEnabled = functionsRuntimeScaleMonitoringEnabled; + WebsiteTimeZone = websiteTimeZone; + MinimumElasticInstanceCount = minimumElasticInstanceCount; CustomInit(); } @@ -318,6 +363,12 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.appSettings")] public IList AppSettings { get; set; } + /// + /// Gets or sets list of Azure Storage Accounts. + /// + [JsonProperty(PropertyName = "properties.azureStorageAccounts")] + public IDictionary AzureStorageAccounts { get; set; } + /// /// Gets or sets connection strings. /// @@ -415,7 +466,7 @@ public SiteConfigResource() /// /// Gets or sets site load balancing. Possible values include: /// 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - /// 'WeightedTotalTraffic', 'RequestHash' + /// 'WeightedTotalTraffic', 'RequestHash', 'PerSiteRoundRobin' /// [JsonProperty(PropertyName = "properties.loadBalancing")] public SiteLoadBalancing? LoadBalancing { get; set; } @@ -458,6 +509,21 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.vnetName")] public string VnetName { get; set; } + /// + /// Gets or sets virtual Network Route All enabled. This causes all + /// outbound traffic to have Virtual Network Security Groups and User + /// Defined Routes applied. + /// + [JsonProperty(PropertyName = "properties.vnetRouteAllEnabled")] + public bool? VnetRouteAllEnabled { get; set; } + + /// + /// Gets or sets the number of private ports assigned to this app. + /// These will be assigned dynamically on runtime. + /// + [JsonProperty(PropertyName = "properties.vnetPrivatePortsCount")] + public int? VnetPrivatePortsCount { get; set; } + /// /// Gets or sets cross-Origin Resource Sharing (CORS) settings. /// @@ -509,6 +575,13 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.xManagedServiceIdentityId")] public int? XManagedServiceIdentityId { get; set; } + /// + /// Gets or sets identity to use for Key Vault Reference + /// authentication. + /// + [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] + public string KeyVaultReferenceIdentity { get; set; } + /// /// Gets or sets IP security restrictions for main. /// @@ -542,6 +615,14 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.minTlsVersion")] public string MinTlsVersion { get; set; } + /// + /// Gets or sets scmMinTlsVersion: configures the minimum version of + /// TLS required for SSL requests for SCM site. Possible values + /// include: '1.0', '1.1', '1.2' + /// + [JsonProperty(PropertyName = "properties.scmMinTlsVersion")] + public string ScmMinTlsVersion { get; set; } + /// /// Gets or sets state of FTP / FTPS service. Possible values include: /// 'AllAllowed', 'FtpsOnly', 'Disabled' @@ -556,12 +637,52 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.preWarmedInstanceCount")] public int? PreWarmedInstanceCount { get; set; } + /// + /// Gets or sets maximum number of workers that a site can scale out + /// to. + /// This setting only applies to the Consumption and Elastic Premium + /// Plans + /// + [JsonProperty(PropertyName = "properties.functionAppScaleLimit")] + public int? FunctionAppScaleLimit { get; set; } + /// /// Gets or sets health check path /// [JsonProperty(PropertyName = "properties.healthCheckPath")] public string HealthCheckPath { get; set; } + /// + /// Gets or sets a value indicating whether functions runtime scale + /// monitoring is enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but + /// will instead call to the + /// runtime to get scale status. + /// + [JsonProperty(PropertyName = "properties.functionsRuntimeScaleMonitoringEnabled")] + public bool? FunctionsRuntimeScaleMonitoringEnabled { get; set; } + + /// + /// Gets or sets sets the time zone a site uses for generating + /// timestamps. Compatible with Linux and Windows App Service. Setting + /// the WEBSITE_TIME_ZONE app setting takes precedence over this + /// config. For Linux, expects tz database values + /// https://www.iana.org/time-zones (for a quick reference see + /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For + /// Windows, expects one of the time zones listed under + /// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows + /// NT\CurrentVersion\Time Zones + /// + [JsonProperty(PropertyName = "properties.websiteTimeZone")] + public string WebsiteTimeZone { get; set; } + + /// + /// Gets or sets number of minimum instance count for a site + /// This setting only applies to the Elastic Plans + /// + [JsonProperty(PropertyName = "properties.minimumElasticInstanceCount")] + public int? MinimumElasticInstanceCount { get; set; } + /// /// Validate the object. /// @@ -582,6 +703,18 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "PreWarmedInstanceCount", 0); } + if (FunctionAppScaleLimit < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "FunctionAppScaleLimit", 0); + } + if (MinimumElasticInstanceCount > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MinimumElasticInstanceCount", 20); + } + if (MinimumElasticInstanceCount < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MinimumElasticInstanceCount", 0); + } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs index f7bae36f84b6..8b93ae4f1798 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs @@ -30,7 +30,9 @@ public enum SiteLoadBalancing [EnumMember(Value = "WeightedTotalTraffic")] WeightedTotalTraffic, [EnumMember(Value = "RequestHash")] - RequestHash + RequestHash, + [EnumMember(Value = "PerSiteRoundRobin")] + PerSiteRoundRobin } internal static class SiteLoadBalancingEnumExtension { @@ -53,6 +55,8 @@ internal static string ToSerializedValue(this SiteLoadBalancing value) return "WeightedTotalTraffic"; case SiteLoadBalancing.RequestHash: return "RequestHash"; + case SiteLoadBalancing.PerSiteRoundRobin: + return "PerSiteRoundRobin"; } return null; } @@ -71,6 +75,8 @@ internal static string ToSerializedValue(this SiteLoadBalancing value) return SiteLoadBalancing.WeightedTotalTraffic; case "RequestHash": return SiteLoadBalancing.RequestHash; + case "PerSiteRoundRobin": + return SiteLoadBalancing.PerSiteRoundRobin; } return null; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs index 567a5fb54af7..c183d9977fa6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs @@ -93,7 +93,7 @@ public SitePatchResource() /// ClientCert is required. /// - ClientCertEnabled: true and ClientCertMode: Optional means /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional' + /// 'Required', 'Optional', 'OptionalInteractiveUser' /// client certificate /// authentication comma-separated exclusion paths /// <code>true</code> to @@ -130,6 +130,8 @@ public SitePatchResource() /// Read-only. /// Status of the last deployment slot /// swap operation. + /// Identity to use for Key + /// Vault Reference authentication. /// HttpsOnly: configures a web site to accept /// only https requests. Issues redirect for /// http requests @@ -138,7 +140,9 @@ public SitePatchResource() /// 'GeoRedundant' /// Specifies an operation id if /// this site has a pending operation. - public SitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + /// Checks if Customer provided + /// storage account is required + public SitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), string keyVaultReferenceIdentity = default(string), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), bool? storageAccountRequired = default(bool?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) : base(id, name, kind, type) { State = state; @@ -176,9 +180,11 @@ public SitePatchResource() IsDefaultContainer = isDefaultContainer; DefaultHostName = defaultHostName; SlotSwapStatus = slotSwapStatus; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; HttpsOnly = httpsOnly; RedundancyMode = redundancyMode; InProgressOperationId = inProgressOperationId; + StorageAccountRequired = storageAccountRequired; Identity = identity; CustomInit(); } @@ -342,7 +348,7 @@ public SitePatchResource() /// ClientCert is required. /// - ClientCertEnabled: true and ClientCertMode: Optional means /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional' + /// 'Required', 'Optional', 'OptionalInteractiveUser' /// [JsonProperty(PropertyName = "properties.clientCertMode")] public ClientCertMode? ClientCertMode { get; set; } @@ -447,6 +453,13 @@ public SitePatchResource() [JsonProperty(PropertyName = "properties.slotSwapStatus")] public SlotSwapStatus SlotSwapStatus { get; private set; } + /// + /// Gets or sets identity to use for Key Vault Reference + /// authentication. + /// + [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] + public string KeyVaultReferenceIdentity { get; set; } + /// /// Gets or sets httpsOnly: configures a web site to accept only https /// requests. Issues redirect for @@ -469,6 +482,13 @@ public SitePatchResource() [JsonProperty(PropertyName = "properties.inProgressOperationId")] public System.Guid? InProgressOperationId { get; private set; } + /// + /// Gets or sets checks if Customer provided storage account is + /// required + /// + [JsonProperty(PropertyName = "properties.storageAccountRequired")] + public bool? StorageAccountRequired { get; set; } + /// /// [JsonProperty(PropertyName = "identity")] diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs index c2544d5f558f..5cd75347d76b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs @@ -51,7 +51,9 @@ public SiteSourceControl() /// <code>true</code> for a /// Mercurial repository; <code>false</code> for a Git /// repository. - public SiteSourceControl(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repoUrl = default(string), string branch = default(string), bool? isManualIntegration = default(bool?), bool? isGitHubAction = default(bool?), bool? deploymentRollbackEnabled = default(bool?), bool? isMercurial = default(bool?)) + /// If GitHub Action is + /// selected, than the associated configuration. + public SiteSourceControl(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repoUrl = default(string), string branch = default(string), bool? isManualIntegration = default(bool?), bool? isGitHubAction = default(bool?), bool? deploymentRollbackEnabled = default(bool?), bool? isMercurial = default(bool?), GitHubActionConfiguration gitHubActionConfiguration = default(GitHubActionConfiguration)) : base(id, name, kind, type) { RepoUrl = repoUrl; @@ -60,6 +62,7 @@ public SiteSourceControl() IsGitHubAction = isGitHubAction; DeploymentRollbackEnabled = deploymentRollbackEnabled; IsMercurial = isMercurial; + GitHubActionConfiguration = gitHubActionConfiguration; CustomInit(); } @@ -114,5 +117,12 @@ public SiteSourceControl() [JsonProperty(PropertyName = "properties.isMercurial")] public bool? IsMercurial { get; set; } + /// + /// Gets or sets if GitHub Action is selected, than the associated + /// configuration. + /// + [JsonProperty(PropertyName = "properties.gitHubActionConfiguration")] + public GitHubActionConfiguration GitHubActionConfiguration { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs index 87d1de6bc667..dfa25b2e6273 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs @@ -33,14 +33,17 @@ public SkuCapacity() /// Service plan SKU. /// Maximum number of workers for this App /// Service plan SKU. + /// Maximum number of Elastic workers for + /// this App Service plan SKU. /// Default number of workers for this /// App Service plan SKU. /// Available scale configurations for an App /// Service plan. - public SkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string)) + public SkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? elasticMaximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string)) { Minimum = minimum; Maximum = maximum; + ElasticMaximum = elasticMaximum; DefaultProperty = defaultProperty; ScaleType = scaleType; CustomInit(); @@ -65,6 +68,13 @@ public SkuCapacity() [JsonProperty(PropertyName = "maximum")] public int? Maximum { get; set; } + /// + /// Gets or sets maximum number of Elastic workers for this App Service + /// plan SKU. + /// + [JsonProperty(PropertyName = "elasticMaximum")] + public int? ElasticMaximum { get; set; } + /// /// Gets or sets default number of workers for this App Service plan /// SKU. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs index a990199a9a26..a3a68be1409f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs @@ -23,7 +23,10 @@ public static class SkuName public const string Premium = "Premium"; public const string Dynamic = "Dynamic"; public const string Isolated = "Isolated"; + public const string IsolatedV2 = "IsolatedV2"; public const string PremiumV2 = "PremiumV2"; + public const string PremiumV3 = "PremiumV3"; + public const string PremiumContainer = "PremiumContainer"; public const string ElasticPremium = "ElasticPremium"; public const string ElasticIsolated = "ElasticIsolated"; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs index 72d2b4cc304e..8eb176a65999 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs @@ -30,11 +30,13 @@ public SlowRequestsBasedTrigger() /// Initializes a new instance of the SlowRequestsBasedTrigger class. /// /// Time taken. + /// Request Path. /// Request Count. /// Time interval. - public SlowRequestsBasedTrigger(string timeTaken = default(string), int? count = default(int?), string timeInterval = default(string)) + public SlowRequestsBasedTrigger(string timeTaken = default(string), string path = default(string), int? count = default(int?), string timeInterval = default(string)) { TimeTaken = timeTaken; + Path = path; Count = count; TimeInterval = timeInterval; CustomInit(); @@ -51,6 +53,12 @@ public SlowRequestsBasedTrigger() [JsonProperty(PropertyName = "timeTaken")] public string TimeTaken { get; set; } + /// + /// Gets or sets request Path. + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + /// /// Gets or sets request Count. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs index 4bc2716c9e59..eb43178a5279 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs @@ -43,6 +43,18 @@ public StackMajorVersion() /// <code>true</code> if /// this supports Application Insights; otherwise, /// <code>false</code>. + /// <appSettings> + /// <appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" /> + /// </appSettings> + /// Example: All the function apps need AppSetting: + /// "FUNCTIONS_WORKER_RUNTIME" to be set stack name + /// <siteConfigProperties> + /// <siteConfigProperty name="Use32BitWorkerProcess" value="false" + /// /> + /// </siteConfigProperties> + /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be + /// set to 0 /// <code>true</code> if this stack /// is in Preview, otherwise <code>false</code>. /// <code>true</code> if this @@ -51,13 +63,15 @@ public StackMajorVersion() /// <code>true</code> if this stack /// should be hidden for new customers on portal, otherwise /// <code>false</code>. - public StackMajorVersion(string displayVersion = default(string), string runtimeVersion = default(string), bool? isDefault = default(bool?), IList minorVersions = default(IList), bool? applicationInsights = default(bool?), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?)) + public StackMajorVersion(string displayVersion = default(string), string runtimeVersion = default(string), bool? isDefault = default(bool?), IList minorVersions = default(IList), bool? applicationInsights = default(bool?), IDictionary appSettingsDictionary = default(IDictionary), IDictionary siteConfigPropertiesDictionary = default(IDictionary), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?)) { DisplayVersion = displayVersion; RuntimeVersion = runtimeVersion; IsDefault = isDefault; MinorVersions = minorVersions; ApplicationInsights = applicationInsights; + AppSettingsDictionary = appSettingsDictionary; + SiteConfigPropertiesDictionary = siteConfigPropertiesDictionary; IsPreview = isPreview; IsDeprecated = isDeprecated; IsHidden = isHidden; @@ -103,6 +117,28 @@ public StackMajorVersion() [JsonProperty(PropertyName = "applicationInsights")] public bool? ApplicationInsights { get; set; } + /// + /// Gets or sets &lt;appSettings&gt; + /// &lt;appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" + /// /&gt; + /// &lt;/appSettings&gt; + /// Example: All the function apps need AppSetting: + /// "FUNCTIONS_WORKER_RUNTIME" to be set stack name + /// + [JsonProperty(PropertyName = "appSettingsDictionary")] + public IDictionary AppSettingsDictionary { get; set; } + + /// + /// Gets or sets &lt;siteConfigProperties&gt; + /// &lt;siteConfigProperty name="Use32BitWorkerProcess" + /// value="false" /&gt; + /// &lt;/siteConfigProperties&gt; + /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be + /// set to 0 + /// + [JsonProperty(PropertyName = "siteConfigPropertiesDictionary")] + public IDictionary SiteConfigPropertiesDictionary { get; set; } + /// /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this /// stack is in Preview, otherwise diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs new file mode 100644 index 000000000000..d12283ab5958 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for StackPreferredOs. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum StackPreferredOs + { + [EnumMember(Value = "Windows")] + Windows, + [EnumMember(Value = "Linux")] + Linux + } + internal static class StackPreferredOsEnumExtension + { + internal static string ToSerializedValue(this StackPreferredOs? value) + { + return value == null ? null : ((StackPreferredOs)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this StackPreferredOs value) + { + switch( value ) + { + case StackPreferredOs.Windows: + return "Windows"; + case StackPreferredOs.Linux: + return "Linux"; + } + return null; + } + + internal static StackPreferredOs? ParseStackPreferredOs(this string value) + { + switch( value ) + { + case "Windows": + return StackPreferredOs.Windows; + case "Linux": + return StackPreferredOs.Linux; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs index c775cdc8eb11..05fb910f6b8d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs @@ -38,8 +38,9 @@ public StampCapacity() /// Shared/dedicated workers. Possible values /// include: 'Shared', 'Dedicated', 'Dynamic' /// Size of the machines. Possible values - /// include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', - /// 'NestedSmall', 'Default' + /// include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'SmallV3', + /// 'MediumV3', 'LargeV3', 'NestedSmall', 'NestedSmallLinux', + /// 'Default' /// Size ID of machines: /// 0 - Small /// 1 - Medium @@ -109,8 +110,8 @@ public StampCapacity() /// /// Gets or sets size of the machines. Possible values include: - /// 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'NestedSmall', - /// 'Default' + /// 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'SmallV3', + /// 'MediumV3', 'LargeV3', 'NestedSmall', 'NestedSmallLinux', 'Default' /// [JsonProperty(PropertyName = "workerSize")] public WorkerSizeOptions? WorkerSize { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs index 656ca9e54a50..524500cd9567 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs @@ -45,6 +45,8 @@ public StaticSiteARMResource() /// URL for the repository of the static /// site. /// The target branch in the repository. + /// The provider that submitted the last + /// deployment to the primary environment of the static site. /// The custom domains associated with this /// static site. /// A user's github repository token. @@ -52,16 +54,30 @@ public StaticSiteARMResource() /// secrets. /// Build properties to configure on the /// repository. - public StaticSiteARMResource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), SkuDescription sku = default(SkuDescription)) + /// Template options for generating a + /// new repository. + /// The content distribution + /// endpoint for the static site. + /// Identity to use for Key + /// Vault Reference authentication. + /// User provided function apps + /// registered with the static site + public StaticSiteARMResource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), string provider = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), StaticSiteTemplateOptions templateProperties = default(StaticSiteTemplateOptions), string contentDistributionEndpoint = default(string), string keyVaultReferenceIdentity = default(string), IList userProvidedFunctionApps = default(IList), SkuDescription sku = default(SkuDescription), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) : base(location, id, name, kind, type, tags) { DefaultHostname = defaultHostname; RepositoryUrl = repositoryUrl; Branch = branch; + Provider = provider; CustomDomains = customDomains; RepositoryToken = repositoryToken; BuildProperties = buildProperties; + TemplateProperties = templateProperties; + ContentDistributionEndpoint = contentDistributionEndpoint; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + UserProvidedFunctionApps = userProvidedFunctionApps; Sku = sku; + Identity = identity; CustomInit(); } @@ -88,6 +104,13 @@ public StaticSiteARMResource() [JsonProperty(PropertyName = "properties.branch")] public string Branch { get; set; } + /// + /// Gets the provider that submitted the last deployment to the primary + /// environment of the static site. + /// + [JsonProperty(PropertyName = "properties.provider")] + public string Provider { get; private set; } + /// /// Gets the custom domains associated with this static site. /// @@ -107,11 +130,40 @@ public StaticSiteARMResource() [JsonProperty(PropertyName = "properties.buildProperties")] public StaticSiteBuildProperties BuildProperties { get; set; } + /// + /// Gets or sets template options for generating a new repository. + /// + [JsonProperty(PropertyName = "properties.templateProperties")] + public StaticSiteTemplateOptions TemplateProperties { get; set; } + + /// + /// Gets the content distribution endpoint for the static site. + /// + [JsonProperty(PropertyName = "properties.contentDistributionEndpoint")] + public string ContentDistributionEndpoint { get; private set; } + + /// + /// Gets identity to use for Key Vault Reference authentication. + /// + [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] + public string KeyVaultReferenceIdentity { get; private set; } + + /// + /// Gets user provided function apps registered with the static site + /// + [JsonProperty(PropertyName = "properties.userProvidedFunctionApps")] + public IList UserProvidedFunctionApps { get; private set; } + /// /// [JsonProperty(PropertyName = "sku")] public SkuDescription Sku { get; set; } + /// + /// + [JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity { get; set; } + /// /// Validate the object. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs index b82f1efcf925..12a4c431d1fe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.WebSites.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -48,7 +50,9 @@ public StaticSiteBuildARMResource() /// The status of the static site build. Possible /// values include: 'WaitingForDeployment', 'Uploading', 'Deploying', /// 'Ready', 'Failed', 'Deleting', 'Detached' - public StaticSiteBuildARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string buildId = default(string), string sourceBranch = default(string), string pullRequestTitle = default(string), string hostname = default(string), System.DateTime? createdTimeUtc = default(System.DateTime?), System.DateTime? lastUpdatedOn = default(System.DateTime?), string status = default(string)) + /// User provided function apps + /// registered with the static site build + public StaticSiteBuildARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string buildId = default(string), string sourceBranch = default(string), string pullRequestTitle = default(string), string hostname = default(string), System.DateTime? createdTimeUtc = default(System.DateTime?), System.DateTime? lastUpdatedOn = default(System.DateTime?), string status = default(string), IList userProvidedFunctionApps = default(IList)) : base(id, name, kind, type) { BuildId = buildId; @@ -58,6 +62,7 @@ public StaticSiteBuildARMResource() CreatedTimeUtc = createdTimeUtc; LastUpdatedOn = lastUpdatedOn; Status = status; + UserProvidedFunctionApps = userProvidedFunctionApps; CustomInit(); } @@ -111,5 +116,12 @@ public StaticSiteBuildARMResource() [JsonProperty(PropertyName = "properties.status")] public string Status { get; private set; } + /// + /// Gets user provided function apps registered with the static site + /// build + /// + [JsonProperty(PropertyName = "properties.userProvidedFunctionApps")] + public IList UserProvidedFunctionApps { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs index be1c6117947d..1fb669c33640 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs @@ -33,13 +33,29 @@ public StaticSiteBuildProperties() /// repository. /// The path to the api code within the /// repository. - /// The path of the app artifacts - /// after building. - public StaticSiteBuildProperties(string appLocation = default(string), string apiLocation = default(string), string appArtifactLocation = default(string)) + /// Deprecated: The path of the app + /// artifacts after building (deprecated in favor of + /// OutputLocation) + /// The output path of the app after + /// building. + /// A custom command to run during + /// deployment of the static content application. + /// A custom command to run during + /// deployment of the Azure Functions API application. + /// Skip Github Action + /// workflow generation. + /// Github Action secret + /// name override. + public StaticSiteBuildProperties(string appLocation = default(string), string apiLocation = default(string), string appArtifactLocation = default(string), string outputLocation = default(string), string appBuildCommand = default(string), string apiBuildCommand = default(string), bool? skipGithubActionWorkflowGeneration = default(bool?), string githubActionSecretNameOverride = default(string)) { AppLocation = appLocation; ApiLocation = apiLocation; AppArtifactLocation = appArtifactLocation; + OutputLocation = outputLocation; + AppBuildCommand = appBuildCommand; + ApiBuildCommand = apiBuildCommand; + SkipGithubActionWorkflowGeneration = skipGithubActionWorkflowGeneration; + GithubActionSecretNameOverride = githubActionSecretNameOverride; CustomInit(); } @@ -61,10 +77,43 @@ public StaticSiteBuildProperties() public string ApiLocation { get; set; } /// - /// Gets or sets the path of the app artifacts after building. + /// Gets or sets deprecated: The path of the app artifacts after + /// building (deprecated in favor of OutputLocation) /// [JsonProperty(PropertyName = "appArtifactLocation")] public string AppArtifactLocation { get; set; } + /// + /// Gets or sets the output path of the app after building. + /// + [JsonProperty(PropertyName = "outputLocation")] + public string OutputLocation { get; set; } + + /// + /// Gets or sets a custom command to run during deployment of the + /// static content application. + /// + [JsonProperty(PropertyName = "appBuildCommand")] + public string AppBuildCommand { get; set; } + + /// + /// Gets or sets a custom command to run during deployment of the Azure + /// Functions API application. + /// + [JsonProperty(PropertyName = "apiBuildCommand")] + public string ApiBuildCommand { get; set; } + + /// + /// Gets or sets skip Github Action workflow generation. + /// + [JsonProperty(PropertyName = "skipGithubActionWorkflowGeneration")] + public bool? SkipGithubActionWorkflowGeneration { get; set; } + + /// + /// Gets or sets github Action secret name override. + /// + [JsonProperty(PropertyName = "githubActionSecretNameOverride")] + public string GithubActionSecretNameOverride { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs index b2dca77065cf..2a2403117477 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs @@ -42,11 +42,19 @@ public StaticSiteCustomDomainOverviewARMResource() /// domain. /// The date and time on which the custom /// domain was created for the static site. - public StaticSiteCustomDomainOverviewARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string domainName = default(string), System.DateTime? createdOn = default(System.DateTime?)) + /// The status of the custom domain. Possible + /// values include: 'RetrievingValidationToken', 'Validating', + /// 'Adding', 'Ready', 'Failed', 'Deleting' + /// The TXT record validation + /// token + public StaticSiteCustomDomainOverviewARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string domainName = default(string), System.DateTime? createdOn = default(System.DateTime?), string status = default(string), string validationToken = default(string), string errorMessage = default(string)) : base(id, name, kind, type) { DomainName = domainName; CreatedOn = createdOn; + Status = status; + ValidationToken = validationToken; + ErrorMessage = errorMessage; CustomInit(); } @@ -68,5 +76,24 @@ public StaticSiteCustomDomainOverviewARMResource() [JsonProperty(PropertyName = "properties.createdOn")] public System.DateTime? CreatedOn { get; private set; } + /// + /// Gets the status of the custom domain. Possible values include: + /// 'RetrievingValidationToken', 'Validating', 'Adding', 'Ready', + /// 'Failed', 'Deleting' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets the TXT record validation token + /// + [JsonProperty(PropertyName = "properties.validationToken")] + public string ValidationToken { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "properties.errorMessage")] + public string ErrorMessage { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs new file mode 100644 index 000000000000..caee85ae6064 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static Site Custom Domain Request Properties ARM resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticSiteCustomDomainRequestPropertiesARMResource : ProxyOnlyResource + { + /// + /// Initializes a new instance of the + /// StaticSiteCustomDomainRequestPropertiesARMResource class. + /// + public StaticSiteCustomDomainRequestPropertiesARMResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// StaticSiteCustomDomainRequestPropertiesARMResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Validation method for adding a + /// custom domain + public StaticSiteCustomDomainRequestPropertiesARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string validationMethod = default(string)) + : base(id, name, kind, type) + { + ValidationMethod = validationMethod; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets validation method for adding a custom domain + /// + [JsonProperty(PropertyName = "properties.validationMethod")] + public string ValidationMethod { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs index a4de50863546..eba8b1721766 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs @@ -43,6 +43,8 @@ public StaticSitePatchResource() /// URL for the repository of the static /// site. /// The target branch in the repository. + /// The provider that submitted the last + /// deployment to the primary environment of the static site. /// The custom domains associated with this /// static site. /// A user's github repository token. @@ -50,15 +52,28 @@ public StaticSitePatchResource() /// secrets. /// Build properties to configure on the /// repository. - public StaticSitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties)) + /// Template options for generating a + /// new repository. + /// The content distribution + /// endpoint for the static site. + /// Identity to use for Key + /// Vault Reference authentication. + /// User provided function apps + /// registered with the static site + public StaticSitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), string provider = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), StaticSiteTemplateOptions templateProperties = default(StaticSiteTemplateOptions), string contentDistributionEndpoint = default(string), string keyVaultReferenceIdentity = default(string), IList userProvidedFunctionApps = default(IList)) : base(id, name, kind, type) { DefaultHostname = defaultHostname; RepositoryUrl = repositoryUrl; Branch = branch; + Provider = provider; CustomDomains = customDomains; RepositoryToken = repositoryToken; BuildProperties = buildProperties; + TemplateProperties = templateProperties; + ContentDistributionEndpoint = contentDistributionEndpoint; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + UserProvidedFunctionApps = userProvidedFunctionApps; CustomInit(); } @@ -85,6 +100,13 @@ public StaticSitePatchResource() [JsonProperty(PropertyName = "properties.branch")] public string Branch { get; set; } + /// + /// Gets the provider that submitted the last deployment to the primary + /// environment of the static site. + /// + [JsonProperty(PropertyName = "properties.provider")] + public string Provider { get; private set; } + /// /// Gets the custom domains associated with this static site. /// @@ -104,5 +126,29 @@ public StaticSitePatchResource() [JsonProperty(PropertyName = "properties.buildProperties")] public StaticSiteBuildProperties BuildProperties { get; set; } + /// + /// Gets or sets template options for generating a new repository. + /// + [JsonProperty(PropertyName = "properties.templateProperties")] + public StaticSiteTemplateOptions TemplateProperties { get; set; } + + /// + /// Gets the content distribution endpoint for the static site. + /// + [JsonProperty(PropertyName = "properties.contentDistributionEndpoint")] + public string ContentDistributionEndpoint { get; private set; } + + /// + /// Gets identity to use for Key Vault Reference authentication. + /// + [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] + public string KeyVaultReferenceIdentity { get; private set; } + + /// + /// Gets user provided function apps registered with the static site + /// + [JsonProperty(PropertyName = "properties.userProvidedFunctionApps")] + public IList UserProvidedFunctionApps { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs new file mode 100644 index 000000000000..ad8cb9674adf --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs @@ -0,0 +1,91 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Template Options for the static site. + /// + public partial class StaticSiteTemplateOptions + { + /// + /// Initializes a new instance of the StaticSiteTemplateOptions class. + /// + public StaticSiteTemplateOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StaticSiteTemplateOptions class. + /// + /// URL of the template repository. + /// The newly generated repository will be based on this one. + /// Owner of the newly generated + /// repository. + /// Name of the newly generated + /// repository. + /// Description of the newly generated + /// repository. + /// Whether or not the newly generated + /// repository is a private repository. Defaults to false (i.e. + /// public). + public StaticSiteTemplateOptions(string templateRepositoryUrl = default(string), string owner = default(string), string repositoryName = default(string), string description = default(string), bool? isPrivate = default(bool?)) + { + TemplateRepositoryUrl = templateRepositoryUrl; + Owner = owner; + RepositoryName = repositoryName; + Description = description; + IsPrivate = isPrivate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URL of the template repository. The newly generated + /// repository will be based on this one. + /// + [JsonProperty(PropertyName = "templateRepositoryUrl")] + public string TemplateRepositoryUrl { get; set; } + + /// + /// Gets or sets owner of the newly generated repository. + /// + [JsonProperty(PropertyName = "owner")] + public string Owner { get; set; } + + /// + /// Gets or sets name of the newly generated repository. + /// + [JsonProperty(PropertyName = "repositoryName")] + public string RepositoryName { get; set; } + + /// + /// Gets or sets description of the newly generated repository. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets whether or not the newly generated repository is a + /// private repository. Defaults to false (i.e. public). + /// + [JsonProperty(PropertyName = "isPrivate")] + public bool? IsPrivate { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs new file mode 100644 index 000000000000..d21a687e9567 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A static site user provided function. + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticSiteUserProvidedFunctionApp : ProxyOnlyResource + { + /// + /// Initializes a new instance of the StaticSiteUserProvidedFunctionApp + /// class. + /// + public StaticSiteUserProvidedFunctionApp() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StaticSiteUserProvidedFunctionApp + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The resource id of the function + /// app registered with the static site + /// The region of the function app + /// registered with the static site + /// The date and time on which the function app + /// was registered with the static site. + public StaticSiteUserProvidedFunctionApp(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string functionAppResourceId = default(string), string functionAppRegion = default(string), System.DateTime? createdOn = default(System.DateTime?)) + : base(id, name, kind, type) + { + FunctionAppResourceId = functionAppResourceId; + FunctionAppRegion = functionAppRegion; + CreatedOn = createdOn; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource id of the function app registered with + /// the static site + /// + [JsonProperty(PropertyName = "properties.functionAppResourceId")] + public string FunctionAppResourceId { get; set; } + + /// + /// Gets or sets the region of the function app registered with the + /// static site + /// + [JsonProperty(PropertyName = "properties.functionAppRegion")] + public string FunctionAppRegion { get; set; } + + /// + /// Gets the date and time on which the function app was registered + /// with the static site. + /// + [JsonProperty(PropertyName = "properties.createdOn")] + public System.DateTime? CreatedOn { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs new file mode 100644 index 000000000000..b7652412f1c0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static Site User Provided Function App ARM resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticSiteUserProvidedFunctionAppARMResource : ProxyOnlyResource + { + /// + /// Initializes a new instance of the + /// StaticSiteUserProvidedFunctionAppARMResource class. + /// + public StaticSiteUserProvidedFunctionAppARMResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// StaticSiteUserProvidedFunctionAppARMResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The resource id of the function + /// app registered with the static site + /// The region of the function app + /// registered with the static site + /// The date and time on which the function app + /// was registered with the static site. + public StaticSiteUserProvidedFunctionAppARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string functionAppResourceId = default(string), string functionAppRegion = default(string), System.DateTime? createdOn = default(System.DateTime?)) + : base(id, name, kind, type) + { + FunctionAppResourceId = functionAppResourceId; + FunctionAppRegion = functionAppRegion; + CreatedOn = createdOn; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource id of the function app registered with + /// the static site + /// + [JsonProperty(PropertyName = "properties.functionAppResourceId")] + public string FunctionAppResourceId { get; set; } + + /// + /// Gets or sets the region of the function app registered with the + /// static site + /// + [JsonProperty(PropertyName = "properties.functionAppRegion")] + public string FunctionAppRegion { get; set; } + + /// + /// Gets the date and time on which the function app was registered + /// with the static site. + /// + [JsonProperty(PropertyName = "properties.createdOn")] + public System.DateTime? CreatedOn { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs new file mode 100644 index 000000000000..ec3255096a8f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static site zip deployment ARM resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticSiteZipDeploymentARMResource : ProxyOnlyResource + { + /// + /// Initializes a new instance of the + /// StaticSiteZipDeploymentARMResource class. + /// + public StaticSiteZipDeploymentARMResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// StaticSiteZipDeploymentARMResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// URL for the zipped app content + /// URL for the zipped api content + /// A title to label the + /// deployment + /// The provider submitting this + /// deployment + /// The language of the api content, if + /// it exists + public StaticSiteZipDeploymentARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string appZipUrl = default(string), string apiZipUrl = default(string), string deploymentTitle = default(string), string provider = default(string), string functionLanguage = default(string)) + : base(id, name, kind, type) + { + AppZipUrl = appZipUrl; + ApiZipUrl = apiZipUrl; + DeploymentTitle = deploymentTitle; + Provider = provider; + FunctionLanguage = functionLanguage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URL for the zipped app content + /// + [JsonProperty(PropertyName = "properties.appZipUrl")] + public string AppZipUrl { get; set; } + + /// + /// Gets or sets URL for the zipped api content + /// + [JsonProperty(PropertyName = "properties.apiZipUrl")] + public string ApiZipUrl { get; set; } + + /// + /// Gets or sets a title to label the deployment + /// + [JsonProperty(PropertyName = "properties.deploymentTitle")] + public string DeploymentTitle { get; set; } + + /// + /// Gets or sets the provider submitting this deployment + /// + [JsonProperty(PropertyName = "properties.provider")] + public string Provider { get; set; } + + /// + /// Gets or sets the language of the api content, if it exists + /// + [JsonProperty(PropertyName = "properties.functionLanguage")] + public string FunctionLanguage { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs new file mode 100644 index 000000000000..33b41a8623e2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Preview for the Static Site Workflow to be generated + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticSitesWorkflowPreview : ProxyOnlyResource + { + /// + /// Initializes a new instance of the StaticSitesWorkflowPreview class. + /// + public StaticSitesWorkflowPreview() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StaticSitesWorkflowPreview class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The path for the workflow file to be + /// generated + /// The contents for the workflow file to be + /// generated + public StaticSitesWorkflowPreview(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string path = default(string), string contents = default(string)) + : base(id, name, kind, type) + { + Path = path; + Contents = contents; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the path for the workflow file to be generated + /// + [JsonProperty(PropertyName = "properties.path")] + public string Path { get; private set; } + + /// + /// Gets the contents for the workflow file to be generated + /// + [JsonProperty(PropertyName = "properties.contents")] + public string Contents { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs new file mode 100644 index 000000000000..98297a655dbd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request entity for previewing the Static Site workflow + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticSitesWorkflowPreviewRequest : ProxyOnlyResource + { + /// + /// Initializes a new instance of the StaticSitesWorkflowPreviewRequest + /// class. + /// + public StaticSitesWorkflowPreviewRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StaticSitesWorkflowPreviewRequest + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// URL for the repository of the static + /// site. + /// The target branch in the repository. + /// Build properties to configure on the + /// repository. + public StaticSitesWorkflowPreviewRequest(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repositoryUrl = default(string), string branch = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties)) + : base(id, name, kind, type) + { + RepositoryUrl = repositoryUrl; + Branch = branch; + BuildProperties = buildProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URL for the repository of the static site. + /// + [JsonProperty(PropertyName = "properties.repositoryUrl")] + public string RepositoryUrl { get; set; } + + /// + /// Gets or sets the target branch in the repository. + /// + [JsonProperty(PropertyName = "properties.branch")] + public string Branch { get; set; } + + /// + /// Gets or sets build properties to configure on the repository. + /// + [JsonProperty(PropertyName = "properties.buildProperties")] + public StaticSiteBuildProperties BuildProperties { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs new file mode 100644 index 000000000000..c53ab12d6064 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Identify the status of the most severe insight generated by the + /// detector. + /// + public partial class Status + { + /// + /// Initializes a new instance of the Status class. + /// + public Status() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Status class. + /// + /// Descriptive message. + /// Level of the most severe insight generated + /// by the detector. Possible values include: 'Critical', 'Warning', + /// 'Info', 'Success', 'None' + public Status(string message = default(string), InsightStatus? statusId = default(InsightStatus?)) + { + Message = message; + StatusId = statusId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets descriptive message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets level of the most severe insight generated by the + /// detector. Possible values include: 'Critical', 'Warning', 'Info', + /// 'Success', 'None' + /// + [JsonProperty(PropertyName = "statusId")] + public InsightStatus? StatusId { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs index f5a0016591e9..6727f0e7576e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs @@ -32,13 +32,15 @@ public StatusCodesBasedTrigger() /// HTTP status code. /// Request Sub Status. /// Win32 error code. + /// Request Path /// Request Count. /// Time interval. - public StatusCodesBasedTrigger(int? status = default(int?), int? subStatus = default(int?), int? win32Status = default(int?), int? count = default(int?), string timeInterval = default(string)) + public StatusCodesBasedTrigger(int? status = default(int?), int? subStatus = default(int?), int? win32Status = default(int?), string path = default(string), int? count = default(int?), string timeInterval = default(string)) { Status = status; SubStatus = subStatus; Win32Status = win32Status; + Path = path; Count = count; TimeInterval = timeInterval; CustomInit(); @@ -67,6 +69,12 @@ public StatusCodesBasedTrigger() [JsonProperty(PropertyName = "win32Status")] public int? Win32Status { get; set; } + /// + /// Gets or sets request Path + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + /// /// Gets or sets request Count. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs new file mode 100644 index 000000000000..e3d3dfe55380 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Trigger based on range of status codes. + /// + public partial class StatusCodesRangeBasedTrigger + { + /// + /// Initializes a new instance of the StatusCodesRangeBasedTrigger + /// class. + /// + public StatusCodesRangeBasedTrigger() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StatusCodesRangeBasedTrigger + /// class. + /// + /// HTTP status code. + /// Request Count. + /// Time interval. + public StatusCodesRangeBasedTrigger(string statusCodes = default(string), string path = default(string), int? count = default(int?), string timeInterval = default(string)) + { + StatusCodes = statusCodes; + Path = path; + Count = count; + TimeInterval = timeInterval; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets HTTP status code. + /// + [JsonProperty(PropertyName = "statusCodes")] + public string StatusCodes { get; set; } + + /// + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + + /// + /// Gets or sets request Count. + /// + [JsonProperty(PropertyName = "count")] + public int? Count { get; set; } + + /// + /// Gets or sets time interval. + /// + [JsonProperty(PropertyName = "timeInterval")] + public string TimeInterval { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs new file mode 100644 index 000000000000..cb1f2518c84d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// String list resource. + /// + public partial class StringList : ProxyOnlyResource + { + /// + /// Initializes a new instance of the StringList class. + /// + public StringList() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StringList class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// List of string resources. + public StringList(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList properties = default(IList)) + : base(id, name, kind, type) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of string resources. + /// + [JsonProperty(PropertyName = "properties")] + public IList Properties { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs new file mode 100644 index 000000000000..46fd238f182d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines a unique Support Topic + /// + public partial class SupportTopic + { + /// + /// Initializes a new instance of the SupportTopic class. + /// + public SupportTopic() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SupportTopic class. + /// + /// Support Topic Id + /// Unique resource Id + public SupportTopic(string id = default(string), string pesId = default(string)) + { + Id = id; + PesId = pesId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets support Topic Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets unique resource Id + /// + [JsonProperty(PropertyName = "pesId")] + public string PesId { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs index a582a0780b0e..cfab40caac5c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs @@ -34,7 +34,8 @@ public ValidateRequest() /// /// Resource name to verify. /// Resource type used for verification. Possible - /// values include: 'ServerFarm', 'Site' + /// values include: 'ServerFarm', 'Site', + /// 'Microsoft.Web/hostingEnvironments' /// Expected location of the resource. /// ARM resource ID of an App Service plan /// that would host the app. @@ -63,7 +64,9 @@ public ValidateRequest() /// Image tag /// Platform (windows or /// linux) - public ValidateRequest(string name, string type, string location, string serverFarmId = default(string), string skuName = default(string), bool? needLinuxWorkers = default(bool?), bool? isSpot = default(bool?), int? capacity = default(int?), string hostingEnvironment = default(string), bool? isXenon = default(bool?), string containerRegistryBaseUrl = default(string), string containerRegistryUsername = default(string), string containerRegistryPassword = default(string), string containerImageRepository = default(string), string containerImageTag = default(string), string containerImagePlatform = default(string)) + /// App Service Environment + /// Properties + public ValidateRequest(string name, string type, string location, string serverFarmId = default(string), string skuName = default(string), bool? needLinuxWorkers = default(bool?), bool? isSpot = default(bool?), int? capacity = default(int?), string hostingEnvironment = default(string), bool? isXenon = default(bool?), string containerRegistryBaseUrl = default(string), string containerRegistryUsername = default(string), string containerRegistryPassword = default(string), string containerImageRepository = default(string), string containerImageTag = default(string), string containerImagePlatform = default(string), AppServiceEnvironment appServiceEnvironment = default(AppServiceEnvironment)) { Name = name; Type = type; @@ -81,6 +84,7 @@ public ValidateRequest() ContainerImageRepository = containerImageRepository; ContainerImageTag = containerImageTag; ContainerImagePlatform = containerImagePlatform; + AppServiceEnvironment = appServiceEnvironment; CustomInit(); } @@ -97,7 +101,7 @@ public ValidateRequest() /// /// Gets or sets resource type used for verification. Possible values - /// include: 'ServerFarm', 'Site' + /// include: 'ServerFarm', 'Site', 'Microsoft.Web/hostingEnvironments' /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } @@ -194,6 +198,12 @@ public ValidateRequest() [JsonProperty(PropertyName = "properties.containerImagePlatform")] public string ContainerImagePlatform { get; set; } + /// + /// Gets or sets app Service Environment Properties + /// + [JsonProperty(PropertyName = "properties.appServiceEnvironment")] + public AppServiceEnvironment AppServiceEnvironment { get; set; } + /// /// Validate the object. /// @@ -218,6 +228,10 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "Capacity", 1); } + if (AppServiceEnvironment != null) + { + AppServiceEnvironment.Validate(); + } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs index 511049be371b..1c771a665519 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs @@ -18,5 +18,6 @@ public static class ValidateResourceTypes { public const string ServerFarm = "ServerFarm"; public const string Site = "Site"; + public const string MicrosoftWebHostingEnvironments = "Microsoft.Web/hostingEnvironments"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs index a9162d3a1626..55e03d256121 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.WebSites.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -34,7 +35,7 @@ public VirtualNetworkProfile() /// Resource type of the Virtual Network /// (read-only). /// Subnet within the Virtual Network. - public VirtualNetworkProfile(string id = default(string), string name = default(string), string type = default(string), string subnet = default(string)) + public VirtualNetworkProfile(string id, string name = default(string), string type = default(string), string subnet = default(string)) { Id = id; Name = name; @@ -72,5 +73,18 @@ public VirtualNetworkProfile() [JsonProperty(PropertyName = "subnet")] public string Subnet { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs index 0afb85613b5f..bfd2641e12d9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs @@ -41,12 +41,15 @@ public VnetParameters() /// The name of the VNET to be validated /// The subnet name to be /// validated - public VnetParameters(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string vnetResourceGroup = default(string), string vnetName = default(string), string vnetSubnetName = default(string)) + /// The ARM Resource ID of the subnet to + /// validate + public VnetParameters(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string vnetResourceGroup = default(string), string vnetName = default(string), string vnetSubnetName = default(string), string subnetResourceId = default(string)) : base(id, name, kind, type) { VnetResourceGroup = vnetResourceGroup; VnetName = vnetName; VnetSubnetName = vnetSubnetName; + SubnetResourceId = subnetResourceId; CustomInit(); } @@ -73,5 +76,11 @@ public VnetParameters() [JsonProperty(PropertyName = "properties.vnetSubnetName")] public string VnetSubnetName { get; set; } + /// + /// Gets or sets the ARM Resource ID of the subnet to validate + /// + [JsonProperty(PropertyName = "properties.subnetResourceId")] + public string SubnetResourceId { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs index f72ab080b2cf..fc6cb6a7c8e2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs @@ -40,15 +40,21 @@ public VnetValidationFailureDetails() /// Resource Name. /// Kind of resource. /// Resource type. + /// Text describing the validation + /// outcome. /// A flag describing whether or not validation /// failed. /// A list of tests that failed in the /// validation. - public VnetValidationFailureDetails(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? failed = default(bool?), IList failedTests = default(IList)) + /// A list of warnings generated during + /// validation. + public VnetValidationFailureDetails(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string message = default(string), bool? failed = default(bool?), IList failedTests = default(IList), IList warnings = default(IList)) : base(id, name, kind, type) { + Message = message; Failed = failed; FailedTests = failedTests; + Warnings = warnings; CustomInit(); } @@ -57,6 +63,12 @@ public VnetValidationFailureDetails() /// partial void CustomInit(); + /// + /// Gets or sets text describing the validation outcome. + /// + [JsonProperty(PropertyName = "properties.message")] + public string Message { get; set; } + /// /// Gets or sets a flag describing whether or not validation failed. /// @@ -69,5 +81,11 @@ public VnetValidationFailureDetails() [JsonProperty(PropertyName = "properties.failedTests")] public IList FailedTests { get; set; } + /// + /// Gets or sets a list of warnings generated during validation. + /// + [JsonProperty(PropertyName = "properties.warnings")] + public IList Warnings { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs new file mode 100644 index 000000000000..1401f5751420 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Web App stack major version. + /// + public partial class WebAppMajorVersion + { + /// + /// Initializes a new instance of the WebAppMajorVersion class. + /// + public WebAppMajorVersion() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebAppMajorVersion class. + /// + /// Web App stack major version (display + /// only). + /// Web App stack major version name. + /// Minor versions associated with the + /// major version. + public WebAppMajorVersion(string displayText = default(string), string value = default(string), IList minorVersions = default(IList)) + { + DisplayText = displayText; + Value = value; + MinorVersions = minorVersions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets web App stack major version (display only). + /// + [JsonProperty(PropertyName = "displayText")] + public string DisplayText { get; private set; } + + /// + /// Gets web App stack major version name. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Gets minor versions associated with the major version. + /// + [JsonProperty(PropertyName = "minorVersions")] + public IList MinorVersions { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs new file mode 100644 index 000000000000..3b7864390773 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Web App stack minor version. + /// + public partial class WebAppMinorVersion + { + /// + /// Initializes a new instance of the WebAppMinorVersion class. + /// + public WebAppMinorVersion() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebAppMinorVersion class. + /// + /// Web App stack minor version (display + /// only). + /// Web App stack major version name. + /// Settings associated with the minor + /// version. + public WebAppMinorVersion(string displayText = default(string), string value = default(string), WebAppRuntimes stackSettings = default(WebAppRuntimes)) + { + DisplayText = displayText; + Value = value; + StackSettings = stackSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets web App stack minor version (display only). + /// + [JsonProperty(PropertyName = "displayText")] + public string DisplayText { get; private set; } + + /// + /// Gets web App stack major version name. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Gets settings associated with the minor version. + /// + [JsonProperty(PropertyName = "stackSettings")] + public WebAppRuntimes StackSettings { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs new file mode 100644 index 000000000000..9b2842b0248a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs @@ -0,0 +1,152 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Web App runtime settings. + /// + public partial class WebAppRuntimeSettings + { + /// + /// Initializes a new instance of the WebAppRuntimeSettings class. + /// + public WebAppRuntimeSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebAppRuntimeSettings class. + /// + /// Web App stack minor version (runtime + /// only). + /// <code>true</code> if + /// remote debugging is supported for the stack; otherwise, + /// <code>false</code>. + /// Application Insights settings + /// associated with the minor version. + /// GitHub Actions settings + /// associated with the minor version. + /// <code>true</code> if the stack + /// is in preview; otherwise, <code>false</code>. + /// <code>true</code> if the + /// stack is deprecated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the stack + /// should be hidden; otherwise, + /// <code>false</code>. + /// End-of-life date for the minor + /// version. + /// <code>true</code> if the + /// stack version is auto-updated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the + /// minor version is early-access; otherwise, + /// <code>false</code>. + public WebAppRuntimeSettings(string runtimeVersion = default(string), bool? remoteDebuggingSupported = default(bool?), AppInsightsWebAppStackSettings appInsightsSettings = default(AppInsightsWebAppStackSettings), GitHubActionWebAppStackSettings gitHubActionSettings = default(GitHubActionWebAppStackSettings), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) + { + RuntimeVersion = runtimeVersion; + RemoteDebuggingSupported = remoteDebuggingSupported; + AppInsightsSettings = appInsightsSettings; + GitHubActionSettings = gitHubActionSettings; + IsPreview = isPreview; + IsDeprecated = isDeprecated; + IsHidden = isHidden; + EndOfLifeDate = endOfLifeDate; + IsAutoUpdate = isAutoUpdate; + IsEarlyAccess = isEarlyAccess; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets web App stack minor version (runtime only). + /// + [JsonProperty(PropertyName = "runtimeVersion")] + public string RuntimeVersion { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if remote + /// debugging is supported for the stack; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "remoteDebuggingSupported")] + public bool? RemoteDebuggingSupported { get; private set; } + + /// + /// Gets application Insights settings associated with the minor + /// version. + /// + [JsonProperty(PropertyName = "appInsightsSettings")] + public AppInsightsWebAppStackSettings AppInsightsSettings { get; private set; } + + /// + /// Gets gitHub Actions settings associated with the minor version. + /// + [JsonProperty(PropertyName = "gitHubActionSettings")] + public GitHubActionWebAppStackSettings GitHubActionSettings { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// in preview; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isPreview")] + public bool? IsPreview { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// deprecated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDeprecated")] + public bool? IsDeprecated { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// should be hidden; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden { get; private set; } + + /// + /// Gets end-of-life date for the minor version. + /// + [JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// version is auto-updated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isAutoUpdate")] + public bool? IsAutoUpdate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the minor + /// version is early-access; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isEarlyAccess")] + public bool? IsEarlyAccess { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs new file mode 100644 index 000000000000..06510ee15e8e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Web App stack runtimes. + /// + public partial class WebAppRuntimes + { + /// + /// Initializes a new instance of the WebAppRuntimes class. + /// + public WebAppRuntimes() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebAppRuntimes class. + /// + /// Linux-specific settings + /// associated with the minor version. + /// Windows-specific settings + /// associated with the minor version. + /// Linux-specific settings + /// associated with the Java container minor version. + /// Windows-specific settings + /// associated with the Java container minor version. + public WebAppRuntimes(WebAppRuntimeSettings linuxRuntimeSettings = default(WebAppRuntimeSettings), WebAppRuntimeSettings windowsRuntimeSettings = default(WebAppRuntimeSettings), LinuxJavaContainerSettings linuxContainerSettings = default(LinuxJavaContainerSettings), WindowsJavaContainerSettings windowsContainerSettings = default(WindowsJavaContainerSettings)) + { + LinuxRuntimeSettings = linuxRuntimeSettings; + WindowsRuntimeSettings = windowsRuntimeSettings; + LinuxContainerSettings = linuxContainerSettings; + WindowsContainerSettings = windowsContainerSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets linux-specific settings associated with the minor version. + /// + [JsonProperty(PropertyName = "linuxRuntimeSettings")] + public WebAppRuntimeSettings LinuxRuntimeSettings { get; private set; } + + /// + /// Gets windows-specific settings associated with the minor version. + /// + [JsonProperty(PropertyName = "windowsRuntimeSettings")] + public WebAppRuntimeSettings WindowsRuntimeSettings { get; private set; } + + /// + /// Gets linux-specific settings associated with the Java container + /// minor version. + /// + [JsonProperty(PropertyName = "linuxContainerSettings")] + public LinuxJavaContainerSettings LinuxContainerSettings { get; private set; } + + /// + /// Gets windows-specific settings associated with the Java container + /// minor version. + /// + [JsonProperty(PropertyName = "windowsContainerSettings")] + public WindowsJavaContainerSettings WindowsContainerSettings { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs new file mode 100644 index 000000000000..37690ec2fb2d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Web App stack. + /// + [Rest.Serialization.JsonTransformation] + public partial class WebAppStack : ProxyOnlyResource + { + /// + /// Initializes a new instance of the WebAppStack class. + /// + public WebAppStack() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebAppStack class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Web App stack location. + /// Web App stack (display only). + /// Web App stack name. + /// List of major versions + /// available. + /// Web App stack preferred OS. Possible + /// values include: 'Windows', 'Linux' + public WebAppStack(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string location = default(string), string displayText = default(string), string value = default(string), IList majorVersions = default(IList), StackPreferredOs? preferredOs = default(StackPreferredOs?)) + : base(id, name, kind, type) + { + Location = location; + DisplayText = displayText; + Value = value; + MajorVersions = majorVersions; + PreferredOs = preferredOs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets web App stack location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets web App stack (display only). + /// + [JsonProperty(PropertyName = "properties.displayText")] + public string DisplayText { get; private set; } + + /// + /// Gets web App stack name. + /// + [JsonProperty(PropertyName = "properties.value")] + public string Value { get; private set; } + + /// + /// Gets list of major versions available. + /// + [JsonProperty(PropertyName = "properties.majorVersions")] + public IList MajorVersions { get; private set; } + + /// + /// Gets web App stack preferred OS. Possible values include: + /// 'Windows', 'Linux' + /// + [JsonProperty(PropertyName = "properties.preferredOs")] + public StackPreferredOs? PreferredOs { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs new file mode 100644 index 000000000000..a773a9d589ab --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs @@ -0,0 +1,130 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Windows Java Container settings. + /// + public partial class WindowsJavaContainerSettings + { + /// + /// Initializes a new instance of the WindowsJavaContainerSettings + /// class. + /// + public WindowsJavaContainerSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WindowsJavaContainerSettings + /// class. + /// + /// Java container (runtime only). + /// Java container version (runtime + /// only). + /// <code>true</code> if the stack + /// is in preview; otherwise, <code>false</code>. + /// <code>true</code> if the + /// stack is deprecated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the stack + /// should be hidden; otherwise, + /// <code>false</code>. + /// End-of-life date for the minor + /// version. + /// <code>true</code> if the + /// stack version is auto-updated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the + /// minor version is early-access; otherwise, + /// <code>false</code>. + public WindowsJavaContainerSettings(string javaContainer = default(string), string javaContainerVersion = default(string), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) + { + JavaContainer = javaContainer; + JavaContainerVersion = javaContainerVersion; + IsPreview = isPreview; + IsDeprecated = isDeprecated; + IsHidden = isHidden; + EndOfLifeDate = endOfLifeDate; + IsAutoUpdate = isAutoUpdate; + IsEarlyAccess = isEarlyAccess; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets java container (runtime only). + /// + [JsonProperty(PropertyName = "javaContainer")] + public string JavaContainer { get; private set; } + + /// + /// Gets java container version (runtime only). + /// + [JsonProperty(PropertyName = "javaContainerVersion")] + public string JavaContainerVersion { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// in preview; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isPreview")] + public bool? IsPreview { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// deprecated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDeprecated")] + public bool? IsDeprecated { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// should be hidden; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden { get; private set; } + + /// + /// Gets end-of-life date for the minor version. + /// + [JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// version is auto-updated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isAutoUpdate")] + public bool? IsAutoUpdate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the minor + /// version is early-access; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isEarlyAccess")] + public bool? IsEarlyAccess { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPool.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPool.cs deleted file mode 100644 index 326c9ba160f2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPool.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Worker pool of an App Service Environment. - /// - public partial class WorkerPool - { - /// - /// Initializes a new instance of the WorkerPool class. - /// - public WorkerPool() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WorkerPool class. - /// - /// Worker size ID for referencing this - /// worker pool. - /// Shared or dedicated app hosting. Possible - /// values include: 'Shared', 'Dedicated', 'Dynamic' - /// VM size of the worker pool - /// instances. - /// Number of instances in the worker - /// pool. - /// Names of all instances in the worker - /// pool (read only). - public WorkerPool(int? workerSizeId = default(int?), ComputeModeOptions? computeMode = default(ComputeModeOptions?), string workerSize = default(string), int? workerCount = default(int?), IList instanceNames = default(IList)) - { - WorkerSizeId = workerSizeId; - ComputeMode = computeMode; - WorkerSize = workerSize; - WorkerCount = workerCount; - InstanceNames = instanceNames; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets worker size ID for referencing this worker pool. - /// - [JsonProperty(PropertyName = "workerSizeId")] - public int? WorkerSizeId { get; set; } - - /// - /// Gets or sets shared or dedicated app hosting. Possible values - /// include: 'Shared', 'Dedicated', 'Dynamic' - /// - [JsonProperty(PropertyName = "computeMode")] - public ComputeModeOptions? ComputeMode { get; set; } - - /// - /// Gets or sets VM size of the worker pool instances. - /// - [JsonProperty(PropertyName = "workerSize")] - public string WorkerSize { get; set; } - - /// - /// Gets or sets number of instances in the worker pool. - /// - [JsonProperty(PropertyName = "workerCount")] - public int? WorkerCount { get; set; } - - /// - /// Gets names of all instances in the worker pool (read only). - /// - [JsonProperty(PropertyName = "instanceNames")] - public IList InstanceNames { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs index 32d869df6f66..0d125a3fdfe8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs @@ -33,8 +33,16 @@ public enum WorkerSizeOptions D2, [EnumMember(Value = "D3")] D3, + [EnumMember(Value = "SmallV3")] + SmallV3, + [EnumMember(Value = "MediumV3")] + MediumV3, + [EnumMember(Value = "LargeV3")] + LargeV3, [EnumMember(Value = "NestedSmall")] NestedSmall, + [EnumMember(Value = "NestedSmallLinux")] + NestedSmallLinux, [EnumMember(Value = "Default")] Default } @@ -61,8 +69,16 @@ internal static string ToSerializedValue(this WorkerSizeOptions value) return "D2"; case WorkerSizeOptions.D3: return "D3"; + case WorkerSizeOptions.SmallV3: + return "SmallV3"; + case WorkerSizeOptions.MediumV3: + return "MediumV3"; + case WorkerSizeOptions.LargeV3: + return "LargeV3"; case WorkerSizeOptions.NestedSmall: return "NestedSmall"; + case WorkerSizeOptions.NestedSmallLinux: + return "NestedSmallLinux"; case WorkerSizeOptions.Default: return "Default"; } @@ -85,8 +101,16 @@ internal static string ToSerializedValue(this WorkerSizeOptions value) return WorkerSizeOptions.D2; case "D3": return WorkerSizeOptions.D3; + case "SmallV3": + return WorkerSizeOptions.SmallV3; + case "MediumV3": + return WorkerSizeOptions.MediumV3; + case "LargeV3": + return WorkerSizeOptions.LargeV3; case "NestedSmall": return WorkerSizeOptions.NestedSmall; + case "NestedSmallLinux": + return WorkerSizeOptions.NestedSmallLinux; case "Default": return WorkerSizeOptions.Default; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperations.cs index 547de71de032..cb24dc93b4ce 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperations.cs @@ -58,7 +58,7 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// /// /// Headers that will be added to request. @@ -231,13 +231,14 @@ internal ProviderOperations(WebSiteManagementClient client) } /// - /// Gets all available operations for the Microsoft.Web resource provider. Also - /// exposes resource metric definitions + /// Get available Function app frameworks and their versions /// /// - /// Description for Gets all available operations for the Microsoft.Web - /// resource provider. Also exposes resource metric definitions + /// Description for Get available Function app frameworks and their versions /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// /// /// Headers that will be added to request. /// @@ -259,7 +260,7 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetFunctionAppStacksWithHttpMessagesAsync(string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -272,13 +273,18 @@ internal ProviderOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("stackOsType", stackOsType); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunctionAppStacks", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/operations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/functionAppStacks").ToString(); List _queryParameters = new List(); + if (stackOsType != null) + { + _queryParameters.Add(string.Format("stackOsType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(stackOsType, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -371,7 +377,7 @@ internal ProviderOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -384,7 +390,7 @@ internal ProviderOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -404,14 +410,17 @@ internal ProviderOperations(WebSiteManagementClient client) } /// - /// Get available application frameworks and their versions + /// Get available Function app frameworks and their versions for location /// /// - /// Description for Get available application frameworks and their versions + /// Description for Get available Function app frameworks and their versions + /// for location /// - /// - /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// + /// Function App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' /// /// /// Headers that will be added to request. @@ -434,11 +443,11 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAvailableStacksOnPremWithHttpMessagesAsync(string osTypeSelected = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetFunctionAppStacksForLocationWithHttpMessagesAsync(string location, string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); } if (Client.ApiVersion == null) { @@ -451,18 +460,19 @@ internal ProviderOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("osTypeSelected", osTypeSelected); + tracingParameters.Add("location", location); + tracingParameters.Add("stackOsType", stackOsType); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAvailableStacksOnPrem", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunctionAppStacksForLocation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/locations/{location}/functionAppStacks").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); List _queryParameters = new List(); - if (osTypeSelected != null) + if (stackOsType != null) { - _queryParameters.Add(string.Format("osTypeSelected={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(osTypeSelected, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("stackOsType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(stackOsType, Client.SerializationSettings).Trim('"')))); } if (Client.ApiVersion != null) { @@ -556,7 +566,7 @@ internal ProviderOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -569,7 +579,7 @@ internal ProviderOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -589,13 +599,17 @@ internal ProviderOperations(WebSiteManagementClient client) } /// - /// Get available application frameworks and their versions + /// Get available Web app frameworks and their versions for location /// /// - /// Description for Get available application frameworks and their versions + /// Description for Get available Web app frameworks and their versions for + /// location /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Web App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' /// /// /// Headers that will be added to request. @@ -618,11 +632,15 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAvailableStacksNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetWebAppStacksForLocationWithHttpMessagesAsync(string location, string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -631,14 +649,24 @@ internal ProviderOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("location", location); + tracingParameters.Add("stackOsType", stackOsType); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAvailableStacksNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebAppStacksForLocation", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/locations/{location}/webAppStacks").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); List _queryParameters = new List(); + if (stackOsType != null) + { + _queryParameters.Add(string.Format("stackOsType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(stackOsType, Client.SerializationSettings).Trim('"')))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -727,7 +755,7 @@ internal ProviderOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -740,7 +768,7 @@ internal ProviderOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -767,9 +795,6 @@ internal ProviderOperations(WebSiteManagementClient client) /// Description for Gets all available operations for the Microsoft.Web /// resource provider. Also exposes resource metric definitions /// - /// - /// The NextLink from the previous successful call to List operation. - /// /// /// Headers that will be added to request. /// @@ -791,11 +816,11 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListOperationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -804,14 +829,17 @@ internal ProviderOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListOperationsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/operations").ToString(); List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -932,6 +960,1400 @@ internal ProviderOperations(WebSiteManagementClient client) return _result; } + /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// 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>> GetWebAppStacksWithHttpMessagesAsync(string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("stackOsType", stackOsType); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetWebAppStacks", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/webAppStacks").ToString(); + List _queryParameters = new List(); + if (stackOsType != null) + { + _queryParameters.Add(string.Format("stackOsType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(stackOsType, Client.SerializationSettings).Trim('"')))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get available application frameworks and their versions + /// + /// + /// Description for Get available application frameworks and their versions + /// + /// + /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', + /// 'LinuxFunctions', 'All' + /// + /// + /// 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>> GetAvailableStacksOnPremWithHttpMessagesAsync(string osTypeSelected = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("osTypeSelected", osTypeSelected); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAvailableStacksOnPrem", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (osTypeSelected != null) + { + _queryParameters.Add(string.Format("osTypeSelected={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(osTypeSelected, Client.SerializationSettings).Trim('"')))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get available application frameworks and their versions + /// + /// + /// Description for Get available application frameworks and their versions + /// + /// + /// 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>> GetAvailableStacksNextWithHttpMessagesAsync(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, "GetAvailableStacksNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their versions + /// + /// + /// 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>> GetFunctionAppStacksNextWithHttpMessagesAsync(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, "GetFunctionAppStacksNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get available Function app frameworks and their versions for location + /// + /// + /// Description for Get available Function app frameworks and their versions + /// for location + /// + /// + /// 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>> GetFunctionAppStacksForLocationNextWithHttpMessagesAsync(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, "GetFunctionAppStacksForLocationNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions for + /// location + /// + /// + /// 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>> GetWebAppStacksForLocationNextWithHttpMessagesAsync(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, "GetWebAppStacksForLocationNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all available operations for the Microsoft.Web resource provider. Also + /// exposes resource metric definitions + /// + /// + /// Description for Gets all available operations for the Microsoft.Web + /// resource provider. Also exposes resource metric definitions + /// + /// + /// 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 (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// 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>> GetWebAppStacksNextWithHttpMessagesAsync(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, "GetWebAppStacksNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Get available application frameworks and their versions /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperationsExtensions.cs index 0e9f90c4e7ac..0ee4f139be05 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperationsExtensions.cs @@ -32,7 +32,7 @@ public static partial class ProviderOperationsExtensions /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// public static IPage GetAvailableStacks(this IProviderOperations operations, string osTypeSelected = default(string)) { @@ -50,7 +50,7 @@ public static partial class ProviderOperationsExtensions /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// /// /// The cancellation token. @@ -63,6 +63,142 @@ public static partial class ProviderOperationsExtensions } } + /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + public static IPage GetFunctionAppStacks(this IProviderOperations operations, string stackOsType = default(string)) + { + return operations.GetFunctionAppStacksAsync(stackOsType).GetAwaiter().GetResult(); + } + + /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The cancellation token. + /// + public static async Task> GetFunctionAppStacksAsync(this IProviderOperations operations, string stackOsType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetFunctionAppStacksWithHttpMessagesAsync(stackOsType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get available Function app frameworks and their versions for location + /// + /// + /// Description for Get available Function app frameworks and their versions + /// for location + /// + /// + /// The operations group for this extension method. + /// + /// + /// Function App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + public static IPage GetFunctionAppStacksForLocation(this IProviderOperations operations, string location, string stackOsType = default(string)) + { + return operations.GetFunctionAppStacksForLocationAsync(location, stackOsType).GetAwaiter().GetResult(); + } + + /// + /// Get available Function app frameworks and their versions for location + /// + /// + /// Description for Get available Function app frameworks and their versions + /// for location + /// + /// + /// The operations group for this extension method. + /// + /// + /// Function App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The cancellation token. + /// + public static async Task> GetFunctionAppStacksForLocationAsync(this IProviderOperations operations, string location, string stackOsType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetFunctionAppStacksForLocationWithHttpMessagesAsync(location, stackOsType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions for + /// location + /// + /// + /// The operations group for this extension method. + /// + /// + /// Web App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + public static IPage GetWebAppStacksForLocation(this IProviderOperations operations, string location, string stackOsType = default(string)) + { + return operations.GetWebAppStacksForLocationAsync(location, stackOsType).GetAwaiter().GetResult(); + } + + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions for + /// location + /// + /// + /// The operations group for this extension method. + /// + /// + /// Web App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The cancellation token. + /// + public static async Task> GetWebAppStacksForLocationAsync(this IProviderOperations operations, string location, string stackOsType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWebAppStacksForLocationWithHttpMessagesAsync(location, stackOsType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets all available operations for the Microsoft.Web resource provider. Also /// exposes resource metric definitions @@ -101,6 +237,46 @@ public static IPage ListOperations(this IProviderOperat } } + /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + public static IPage GetWebAppStacks(this IProviderOperations operations, string stackOsType = default(string)) + { + return operations.GetWebAppStacksAsync(stackOsType).GetAwaiter().GetResult(); + } + + /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The cancellation token. + /// + public static async Task> GetWebAppStacksAsync(this IProviderOperations operations, string stackOsType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWebAppStacksWithHttpMessagesAsync(stackOsType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get available application frameworks and their versions /// @@ -112,7 +288,7 @@ public static IPage ListOperations(this IProviderOperat /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// public static IPage GetAvailableStacksOnPrem(this IProviderOperations operations, string osTypeSelected = default(string)) { @@ -130,7 +306,7 @@ public static IPage ListOperations(this IProviderOperat /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// /// /// The cancellation token. @@ -183,6 +359,130 @@ public static IPage GetAvailableStacksNext(this IProvi } } + /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetFunctionAppStacksNext(this IProviderOperations operations, string nextPageLink) + { + return operations.GetFunctionAppStacksNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetFunctionAppStacksNextAsync(this IProviderOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetFunctionAppStacksNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get available Function app frameworks and their versions for location + /// + /// + /// Description for Get available Function app frameworks and their versions + /// for location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetFunctionAppStacksForLocationNext(this IProviderOperations operations, string nextPageLink) + { + return operations.GetFunctionAppStacksForLocationNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get available Function app frameworks and their versions for location + /// + /// + /// Description for Get available Function app frameworks and their versions + /// for location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetFunctionAppStacksForLocationNextAsync(this IProviderOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetFunctionAppStacksForLocationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions for + /// location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetWebAppStacksForLocationNext(this IProviderOperations operations, string nextPageLink) + { + return operations.GetWebAppStacksForLocationNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions for + /// location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetWebAppStacksForLocationNextAsync(this IProviderOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWebAppStacksForLocationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets all available operations for the Microsoft.Web resource provider. Also /// exposes resource metric definitions @@ -227,6 +527,46 @@ public static IPage ListOperationsNext(this IProviderOp } } + /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetWebAppStacksNext(this IProviderOperations operations, string nextPageLink) + { + return operations.GetWebAppStacksNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetWebAppStacksNextAsync(this IProviderOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWebAppStacksNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get available application frameworks and their versions /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs index 1c65562c417c..6ff03fcd7313 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs @@ -19,50 +19,42 @@ public static IEnumerable> ApiInfo_WebSiteManageme { return new Tuple[] { - new Tuple("CertificateRegistration", "AppServiceCertificateOrders", "2020-06-01"), - new Tuple("CertificateRegistration", "CertificateRegistrationProvider", "2020-06-01"), - new Tuple("DomainRegistration", "DomainRegistrationProvider", "2020-06-01"), - new Tuple("DomainRegistration", "Domains", "2020-06-01"), - new Tuple("DomainRegistration", "TopLevelDomains", "2020-06-01"), - new Tuple("Web", "AppServiceEnvironments", "2020-06-01"), - new Tuple("Web", "AppServicePlans", "2020-06-01"), - new Tuple("Web", "Certificates", "2020-06-01"), - new Tuple("Web", "CheckNameAvailability", "2020-06-01"), - new Tuple("Web", "DeletedWebApps", "2020-06-01"), - new Tuple("Web", "Diagnostics", "2020-06-01"), - new Tuple("Web", "GetPublishingUser", "2020-06-01"), - new Tuple("Web", "GetSourceControl", "2020-06-01"), - new Tuple("Web", "GetSubscriptionDeploymentLocations", "2020-06-01"), - new Tuple("Web", "ListBillingMeters", "2020-06-01"), - new Tuple("Web", "ListGeoRegions", "2020-06-01"), - new Tuple("Web", "ListPremierAddOnOffers", "2020-06-01"), - new Tuple("Web", "ListSiteIdentifiersAssignedToHostName", "2020-06-01"), - new Tuple("Web", "ListSkus", "2020-06-01"), - new Tuple("Web", "ListSourceControls", "2020-06-01"), - new Tuple("Web", "Provider", "2020-06-01"), - new Tuple("Web", "Recommendations", "2020-06-01"), - new Tuple("Web", "ResourceHealthMetadata", "2020-06-01"), - new Tuple("Web", "StaticSites", "2020-06-01"), - new Tuple("Web", "UpdatePublishingUser", "2020-06-01"), - new Tuple("Web", "UpdateSourceControl", "2020-06-01"), - new Tuple("Web", "Validate", "2020-06-01"), - new Tuple("Web", "VerifyHostingEnvironmentVnet", "2020-06-01"), - new Tuple("Web", "WebApps", "2020-06-01"), - new Tuple("WebSiteManagementClient", "Move", "2020-06-01"), - new Tuple("WebSiteManagementClient", "ValidateMove", "2020-06-01"), + new Tuple("CertificateRegistration", "AppServiceCertificateOrders", "2020-12-01"), + new Tuple("CertificateRegistration", "CertificateOrdersDiagnostics", "2020-12-01"), + new Tuple("CertificateRegistration", "CertificateRegistrationProvider", "2020-12-01"), + new Tuple("DomainRegistration", "DomainRegistrationProvider", "2020-12-01"), + new Tuple("DomainRegistration", "Domains", "2020-12-01"), + new Tuple("DomainRegistration", "TopLevelDomains", "2020-12-01"), + new Tuple("Web", "AppServiceEnvironments", "2020-12-01"), + new Tuple("Web", "AppServicePlans", "2020-12-01"), + new Tuple("Web", "Certificates", "2020-12-01"), + new Tuple("Web", "CheckNameAvailability", "2020-12-01"), + new Tuple("Web", "DeletedWebApps", "2020-12-01"), + new Tuple("Web", "Diagnostics", "2020-12-01"), + new Tuple("Web", "GenerateGithubAccessTokenForAppserviceCLIAsync", "2020-12-01"), + new Tuple("Web", "GetPublishingUser", "2020-12-01"), + new Tuple("Web", "GetSourceControl", "2020-12-01"), + new Tuple("Web", "GetSubscriptionDeploymentLocations", "2020-12-01"), + new Tuple("Web", "Global", "2020-12-01"), + new Tuple("Web", "ListBillingMeters", "2020-12-01"), + new Tuple("Web", "ListGeoRegions", "2020-12-01"), + new Tuple("Web", "ListPremierAddOnOffers", "2020-12-01"), + new Tuple("Web", "ListSiteIdentifiersAssignedToHostName", "2020-12-01"), + new Tuple("Web", "ListSkus", "2020-12-01"), + new Tuple("Web", "ListSourceControls", "2020-12-01"), + new Tuple("Web", "Provider", "2020-12-01"), + new Tuple("Web", "Recommendations", "2020-12-01"), + new Tuple("Web", "ResourceHealthMetadata", "2020-12-01"), + new Tuple("Web", "StaticSites", "2020-12-01"), + new Tuple("Web", "UpdatePublishingUser", "2020-12-01"), + new Tuple("Web", "UpdateSourceControl", "2020-12-01"), + new Tuple("Web", "Validate", "2020-12-01"), + new Tuple("Web", "VerifyHostingEnvironmentVnet", "2020-12-01"), + new Tuple("Web", "WebApps", "2020-12-01"), + new Tuple("WebSiteManagementClient", "Move", "2020-12-01"), + new Tuple("WebSiteManagementClient", "ValidateMove", "2020-12-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-06 --csharp-sdks-folder=K:\\DotNet-SDK\\Sep-2020\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "1b04f5fce19cd330dcc0eec11a98e499c0cda50d"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperations.cs index a8a84874472b..197075937acc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperations.cs @@ -51,11 +51,18 @@ internal StaticSitesOperations(WebSiteManagementClient client) public WebSiteManagementClient Client { get; private set; } /// - /// Get all Static Sites for a subscription. + /// Generates a preview workflow file for the static site /// /// - /// Description for Get all Static Sites for a subscription. + /// Description for Generates a preview workflow file for the static site /// + /// + /// Location where you plan to create the static site. + /// + /// + /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. + /// See example. + /// /// /// Headers that will be added to request. /// @@ -77,8 +84,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PreviewWorkflowWithHttpMessagesAsync(string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (staticSitesWorkflowPreviewRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSitesWorkflowPreviewRequest"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -94,12 +109,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("staticSitesWorkflowPreviewRequest", staticSitesWorkflowPreviewRequest); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "PreviewWorkflow", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/previewStaticSiteWorkflowFile").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -113,7 +131,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -144,6 +162,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(staticSitesWorkflowPreviewRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSitesWorkflowPreviewRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -194,7 +218,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -207,7 +231,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -227,14 +251,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static sites in the specified resource group. + /// Get all Static Sites for a subscription. /// /// - /// Description for Gets all static sites in the specified resource group. + /// Description for Get all Static Sites for a subscription. /// - /// - /// Name of the resource group to which the resource belongs. - /// /// /// Headers that will be added to request. /// @@ -256,27 +277,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetStaticSitesByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -292,14 +294,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSitesByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -427,17 +427,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the details of a static site. + /// Gets all static sites in the specified resource group. /// /// - /// Description for Gets the details of a static site. + /// Description for Gets all static sites in the specified resource group. /// /// /// Name of the resource group to which the resource belongs. /// - /// - /// Name of the static site. - /// /// /// Headers that will be added to request. /// @@ -459,7 +456,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetStaticSitesByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -480,10 +477,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); } } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -500,15 +493,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSitesByResourceGroup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -603,7 +594,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -616,7 +607,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -636,21 +627,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates a new static site in an existing resource group, or updates an - /// existing static site. + /// Gets the details of a static site. /// /// - /// Description for Creates a new static site in an existing resource group, or - /// updates an existing static site. + /// Description for Gets the details of a static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site to create or update. - /// - /// - /// A JSON representation of the staticsite properties. See example. + /// Name of the static site. /// /// /// Headers that will be added to request. @@ -673,7 +659,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -698,14 +684,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (staticSiteEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteEnvelope"); - } - if (staticSiteEnvelope != null) - { - staticSiteEnvelope.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -723,9 +701,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("staticSiteEnvelope", staticSiteEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSite", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -745,7 +722,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -776,12 +753,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(staticSiteEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -802,7 +773,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -857,24 +828,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -882,6 +835,36 @@ internal StaticSitesOperations(WebSiteManagementClient client) return _result; } + /// + /// Creates a new static site in an existing resource group, or updates an + /// existing static site. + /// + /// + /// Description for Creates a new static site in an existing resource group, or + /// updates an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Deletes a static site. /// @@ -895,6 +878,36 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// Name of the static site to delete. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteStaticSiteWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a new static site in an existing resource group, or updates an + /// existing static site. + /// + /// + /// Description for Creates a new static site in an existing resource group, or + /// updates an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. + /// + /// /// Headers that will be added to request. /// /// @@ -903,6 +916,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -912,7 +928,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSitePatchResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -937,6 +953,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (staticSiteEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -954,8 +974,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("staticSiteEnvelope", staticSiteEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateStaticSite", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -975,7 +996,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1006,6 +1027,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(staticSiteEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -1056,13 +1083,49 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1071,21 +1134,19 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates a new static site in an existing resource group, or updates an - /// existing static site. + /// Gets the list of users of a static site. /// /// - /// Description for Creates a new static site in an existing resource group, or - /// updates an existing static site. + /// Description for Gets the list of users of a static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site to create or update. + /// Name of the static site. /// - /// - /// A JSON representation of the staticsite properties. See example. + /// + /// The auth provider for the users. /// /// /// Headers that will be added to request. @@ -1108,7 +1169,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSitePatchResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteUsersWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1133,9 +1194,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (staticSiteEnvelope == null) + if (authprovider == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "authprovider"); } if (Client.SubscriptionId == null) { @@ -1154,15 +1215,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("staticSiteEnvelope", staticSiteEnvelope); + tracingParameters.Add("authprovider", authprovider); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteUsers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{authprovider}", System.Uri.EscapeDataString(authprovider)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1176,7 +1238,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1207,12 +1269,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(staticSiteEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1233,7 +1289,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1263,7 +1319,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1276,25 +1332,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1314,19 +1352,22 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the list of users of a static site. + /// Deletes the user entry from the static site. /// /// - /// Description for Gets the list of users of a static site. + /// Description for Deletes the user entry from the static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. + /// Name of the staticsite. /// /// - /// The auth provider for the users. + /// The auth provider for this user. + /// + /// + /// The user id of the user. /// /// /// Headers that will be added to request. @@ -1337,9 +1378,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1349,7 +1387,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteUsersWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteStaticSiteUserWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, string userid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1378,6 +1416,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "authprovider"); } + if (userid == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "userid"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1396,15 +1438,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("authprovider", authprovider); + tracingParameters.Add("userid", userid); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteUsers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSiteUser", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{authprovider}", System.Uri.EscapeDataString(authprovider)); + _url = _url.Replace("{userid}", System.Uri.EscapeDataString(userid)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1418,7 +1462,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1499,31 +1543,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1532,16 +1558,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Deletes the user entry from the static site. + /// Updates a user entry with the listed roles /// /// - /// Description for Deletes the user entry from the static site. + /// Description for Updates a user entry with the listed roles /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the staticsite. + /// Name of the static site. /// /// /// The auth provider for this user. @@ -1549,6 +1575,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// The user id of the user. /// + /// + /// A JSON representation of the StaticSiteUser properties. See example. + /// /// /// Headers that will be added to request. /// @@ -1558,6 +1587,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1567,7 +1599,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteStaticSiteUserWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, string userid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateStaticSiteUserWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, string userid, StaticSiteUserARMResource staticSiteUserEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1600,6 +1632,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "userid"); } + if (staticSiteUserEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1619,8 +1655,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("authprovider", authprovider); tracingParameters.Add("userid", userid); + tracingParameters.Add("staticSiteUserEnvelope", staticSiteUserEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSiteUser", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateStaticSiteUser", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1642,7 +1679,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1673,6 +1710,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(staticSiteUserEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -1723,13 +1766,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1738,10 +1799,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Updates a user entry with the listed roles + /// Gets all static site builds for a particular static site. /// /// - /// Description for Updates a user entry with the listed roles + /// Description for Gets all static site builds for a particular static site. /// /// /// Name of the resource group to which the resource belongs. @@ -1749,15 +1810,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The auth provider for this user. - /// - /// - /// The user id of the user. - /// - /// - /// A JSON representation of the StaticSiteUser properties. See example. - /// /// /// Headers that will be added to request. /// @@ -1779,7 +1831,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateStaticSiteUserWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, string userid, StaticSiteUserARMResource staticSiteUserEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetStaticSiteBuildsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1804,18 +1856,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (authprovider == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authprovider"); - } - if (userid == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "userid"); - } - if (staticSiteUserEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1833,19 +1873,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("authprovider", authprovider); - tracingParameters.Add("userid", userid); - tracingParameters.Add("staticSiteUserEnvelope", staticSiteUserEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateStaticSiteUser", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuilds", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{authprovider}", System.Uri.EscapeDataString(authprovider)); - _url = _url.Replace("{userid}", System.Uri.EscapeDataString(userid)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1859,7 +1894,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1890,12 +1925,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(staticSiteUserEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1946,7 +1975,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1959,7 +1988,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1979,10 +2008,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static site builds for a particular static site. + /// Gets the details of a static site build. /// /// - /// Description for Gets all static site builds for a particular static site. + /// Description for Gets the details of a static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -1990,6 +2019,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// + /// + /// The stage site identifier. + /// /// /// Headers that will be added to request. /// @@ -2011,7 +2043,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetStaticSiteBuildsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2036,6 +2068,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (environmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2053,14 +2089,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("environmentName", environmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuilds", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuild", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2155,7 +2193,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2168,7 +2206,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2188,10 +2226,38 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the details of a static site build. + /// Deletes a static site build. /// /// - /// Description for Gets the details of a static site build. + /// Description for Deletes a static site build. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates the app settings of a static site build. + /// + /// + /// Description for Creates or updates the app settings of a static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -2199,9 +2265,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// + /// + /// The dictionary containing the static site app settings to update. + /// /// /// Headers that will be added to request. /// @@ -2223,7 +2292,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteBuildAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2248,9 +2317,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (prId == null) + if (environmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } + if (appSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "prId"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); } if (Client.SubscriptionId == null) { @@ -2269,16 +2342,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("prId", prId); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuild", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteBuildAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/appsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2292,7 +2366,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2323,6 +2397,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(appSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -2373,7 +2453,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2386,7 +2466,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2406,10 +2486,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Deletes a static site build. + /// Creates or updates the function app settings of a static site build. /// /// - /// Description for Deletes a static site build. + /// Description for Creates or updates the function app settings of a static + /// site build. /// /// /// Name of the resource group to which the resource belongs. @@ -2417,9 +2498,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// + /// + /// The dictionary containing the static site function app settings to update. + /// /// /// Headers that will be added to request. /// @@ -2429,6 +2513,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -2438,7 +2525,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2463,13 +2550,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (prId == null) + if (environmentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "prId"); + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); } - if (Client.SubscriptionId == null) + if (appSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (Client.ApiVersion == null) { @@ -2484,16 +2575,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("prId", prId); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSiteBuild", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteBuildFunctionAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/functionappsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2507,7 +2599,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2538,6 +2630,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(appSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -2558,7 +2656,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2588,13 +2686,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -2603,11 +2719,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates or updates the function app settings of a static site build. + /// Gets the functions of a particular static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site build. + /// Description for Gets the functions of a particular static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -2615,11 +2730,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - /// - /// /// /// Headers that will be added to request. /// @@ -2641,7 +2754,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteBuildFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2666,13 +2779,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (prId == null) + if (environmentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "prId"); - } - if (appSettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); } if (Client.SubscriptionId == null) { @@ -2691,17 +2800,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("prId", prId); - tracingParameters.Add("appSettings", appSettings); + tracingParameters.Add("environmentName", environmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteBuildFunctionAppSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/config/functionappsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/functions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2715,7 +2823,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2746,12 +2854,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(appSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -2772,7 +2874,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2802,7 +2904,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2815,25 +2917,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2853,10 +2937,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the functions of a particular static site build. + /// Gets the application settings of a static site build. /// /// - /// Description for Gets the functions of a particular static site build. + /// Description for Gets the application settings of a static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -2864,7 +2948,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -2888,7 +2972,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteBuildFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListStaticSiteBuildAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2913,9 +2997,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (prId == null) + if (environmentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "prId"); + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); } if (Client.SubscriptionId == null) { @@ -2934,16 +3018,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("prId", prId); + tracingParameters.Add("environmentName", environmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/functions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listAppSettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2957,7 +3041,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3038,7 +3122,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3051,7 +3135,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3071,10 +3155,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the application settings of a static site. + /// Gets the application settings of a static site build. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Gets the application settings of a static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -3082,7 +3166,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -3106,7 +3190,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3131,9 +3215,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (prId == null) + if (environmentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "prId"); + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); } if (Client.SubscriptionId == null) { @@ -3152,16 +3236,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("prId", prId); + tracingParameters.Add("environmentName", environmentName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctionAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/listFunctionAppSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listFunctionAppSettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3226,7 +3310,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3281,24 +3365,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -3307,11 +3373,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates or updates the function app settings of a static site. + /// Gets the details of the user provided function apps registered with a + /// static site build /// /// - /// Description for Creates or updates the function app settings of a static - /// site. + /// Description for Gets the details of the user provided function apps + /// registered with a static site build /// /// /// Name of the resource group to which the resource belongs. @@ -3319,7 +3386,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// /// /// Headers that will be added to request. @@ -3342,7 +3410,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetUserProvidedFunctionAppsForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3367,9 +3435,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (appSettings == null) + if (environmentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); } if (Client.SubscriptionId == null) { @@ -3388,15 +3456,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("appSettings", appSettings); + tracingParameters.Add("environmentName", environmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteFunctionAppSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppsForStaticSiteBuild", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3410,7 +3479,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3441,12 +3510,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(appSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -3467,7 +3530,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3497,7 +3560,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3510,25 +3573,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3548,10 +3593,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates an invitation link for a user with the role + /// Gets the details of the user provided function app registered with a static + /// site build /// /// - /// Description for Creates an invitation link for a user with the role + /// Description for Gets the details of the user provided function app + /// registered with a static site build /// /// /// Name of the resource group to which the resource belongs. @@ -3559,7 +3606,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// /// /// Headers that will be added to request. @@ -3582,7 +3633,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateUserRolesInvitationLinkWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetUserProvidedFunctionAppForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3607,9 +3658,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (staticSiteUserRolesInvitationEnvelope == null) + if (environmentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserRolesInvitationEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } + if (functionAppName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); } if (Client.SubscriptionId == null) { @@ -3628,15 +3683,18 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("staticSiteUserRolesInvitationEnvelope", staticSiteUserRolesInvitationEnvelope); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("functionAppName", functionAppName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateUserRolesInvitationLink", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppForStaticSiteBuild", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3650,7 +3708,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3681,12 +3739,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(staticSiteUserRolesInvitationEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserRolesInvitationEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -3737,7 +3789,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3750,7 +3802,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3770,17 +3822,65 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static site custom domains for a particular static site. + /// Register a user provided function app with a static site build /// /// - /// Description for Gets all static site custom domains for a particular static - /// site. + /// Description for Register a user provided function app with a static site + /// build /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> RegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Detach the user provided function app from the static site build + /// + /// + /// Description for Detach the user provided function app from the static site + /// build + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// /// /// Headers that will be added to request. @@ -3791,9 +3891,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -3803,7 +3900,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteCustomDomainsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DetachUserProvidedFunctionAppFromStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3828,6 +3925,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (environmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } + if (functionAppName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -3845,14 +3950,18 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("functionAppName", functionAppName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteCustomDomains", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DetachUserProvidedFunctionAppFromStaticSiteBuild", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3866,7 +3975,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3917,7 +4026,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3947,31 +4056,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -3980,12 +4071,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates a new static site custom domain in an existing resource group and - /// static site. + /// Deploys zipped content to a specific environment of a static site. /// /// - /// Description for Creates a new static site custom domain in an existing - /// resource group and static site. + /// Description for Deploys zipped content to a specific environment of a + /// static site. /// /// /// Name of the resource group to which the resource belongs. @@ -3993,19 +4083,51 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The custom domain to create. + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. /// /// - /// Headers that will be added to request. + /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// + public async Task CreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginCreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates the app settings of a static site. + /// + /// + /// Description for Creates or updates the app settings of a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The dictionary containing the static site app settings to update. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// /// Thrown when unable to deserialize the response /// /// @@ -4017,7 +4139,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4042,9 +4164,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainName == null) + if (appSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); } if (Client.SubscriptionId == null) { @@ -4063,16 +4185,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainName", domainName); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteCustomDomain", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/appsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4117,6 +4238,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(appSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -4137,7 +4264,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4167,7 +4294,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4180,25 +4307,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4218,10 +4327,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Deletes a custom domain. + /// Creates or updates the function app settings of a static site. /// /// - /// Description for Deletes a custom domain. + /// Description for Creates or updates the function app settings of a static + /// site. /// /// /// Name of the resource group to which the resource belongs. @@ -4229,8 +4339,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The custom domain to delete. + /// + /// The dictionary containing the static site function app settings to update. /// /// /// Headers that will be added to request. @@ -4241,6 +4351,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -4250,7 +4363,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4275,9 +4388,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainName == null) + if (appSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); } if (Client.SubscriptionId == null) { @@ -4296,16 +4409,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainName", domainName); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSiteCustomDomain", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteFunctionAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4319,7 +4431,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -4350,6 +4462,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(appSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -4370,7 +4488,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4400,13 +4518,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4415,11 +4551,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Validates a particular custom domain can be added to a static site. + /// Creates an invitation link for a user with the role /// /// - /// Description for Validates a particular custom domain can be added to a - /// static site. + /// Description for Creates an invitation link for a user with the role /// /// /// Name of the resource group to which the resource belongs. @@ -4427,8 +4562,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The custom domain to validate. + /// /// /// /// Headers that will be added to request. @@ -4439,6 +4573,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -4448,7 +4585,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateUserRolesInvitationLinkWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4473,9 +4610,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainName == null) + if (staticSiteUserRolesInvitationEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserRolesInvitationEnvelope"); } if (Client.SubscriptionId == null) { @@ -4494,16 +4631,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainName", domainName); + tracingParameters.Add("staticSiteUserRolesInvitationEnvelope", staticSiteUserRolesInvitationEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ValidateCustomDomainCanBeAddedToStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateUserRolesInvitationLink", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4548,6 +4684,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(staticSiteUserRolesInvitationEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserRolesInvitationEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -4568,7 +4710,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4598,13 +4740,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4613,16 +4773,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Detaches a static site. + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Detaches a static site. + /// Description for Gets all static site custom domains for a particular static + /// site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site to detach. + /// Name of the static site resource to search in. /// /// /// Headers that will be added to request. @@ -4633,6 +4794,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -4642,7 +4806,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteCustomDomainsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4685,11 +4849,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DetachStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteCustomDomains", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -4705,7 +4869,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -4756,7 +4920,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4786,13 +4950,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4801,16 +4983,20 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the functions of a static site. + /// Gets an existing custom domain for a particular static site. /// /// - /// Description for Gets the functions of a static site. + /// Description for Gets an existing custom domain for a particular static + /// site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. + /// Name of the static site resource to search in. + /// + /// + /// The custom domain name. /// /// /// Headers that will be added to request. @@ -4833,7 +5019,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4858,6 +5044,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -4875,14 +5065,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainName", domainName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteCustomDomain", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4977,7 +5169,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4990,7 +5182,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5010,10 +5202,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the application settings of a static site. + /// Creates a new static site custom domain in an existing resource group and + /// static site. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. /// /// /// Name of the resource group to which the resource belongs. @@ -5021,32 +5215,5522 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// /// - /// Headers that will be added to request. + /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added to a + /// static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDetachStaticSiteWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the functions of a static site. + /// + /// + /// Description for Gets the functions of a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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>> ListStaticSiteFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctions", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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> ListStaticSiteAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteAppSettings", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listAppSettings").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the roles configured for the static site. + /// + /// + /// Description for Lists the roles configured for the static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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> ListStaticSiteConfiguredRolesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteConfiguredRoles", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listConfiguredRoles").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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> ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctionAppSettings", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the secrets for an existing static site. + /// + /// + /// Description for Lists the secrets for an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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> ListStaticSiteSecretsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteSecrets", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the list of private endpoint connections associated with a static site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionList", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// 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> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// 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> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateLinkResources").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Resets the api key for an existing static site. + /// + /// + /// Description for Resets the api key for an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// + /// + /// 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 ResetStaticSiteApiKeyWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (resetPropertiesEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resetPropertiesEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("resetPropertiesEnvelope", resetPropertiesEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ResetStaticSiteApiKey", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(resetPropertiesEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(resetPropertiesEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Gets the details of the user provided function apps registered with a + /// static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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>> GetUserProvidedFunctionAppsForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppsForStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the details of the user provided function app registered with a static + /// site + /// + /// + /// Description for Gets the details of the user provided function app + /// registered with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + /// + /// 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> GetUserProvidedFunctionAppForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (functionAppName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("functionAppName", functionAppName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppForStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> RegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginRegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Detach the user provided function app from the static site + /// + /// + /// Description for Detach the user provided function app from the static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + /// + /// 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 DetachUserProvidedFunctionAppFromStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (functionAppName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("functionAppName", functionAppName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "DetachUserProvidedFunctionAppFromStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task CreateZipDeploymentForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginCreateZipDeploymentForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a new static site in an existing resource group, or updates an + /// existing static site. + /// + /// + /// Description for Creates a new static site in an existing resource group, or + /// updates an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. + /// + /// + /// 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> BeginCreateOrUpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (staticSiteEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteEnvelope"); + } + if (staticSiteEnvelope != null) + { + staticSiteEnvelope.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("staticSiteEnvelope", staticSiteEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a static site. + /// + /// + /// Description for Deletes a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to delete. + /// + /// + /// 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 BeginDeleteStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Deletes a static site build. + /// + /// + /// Description for Deletes a static site build. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// 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 BeginDeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (environmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteStaticSiteBuild", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Register a user provided function app with a static site build + /// + /// + /// Description for Register a user provided function app with a static site + /// build + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// 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> BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (environmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } + if (functionAppName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); + } + if (staticSiteUserProvidedFunctionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserProvidedFunctionEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("functionAppName", functionAppName); + tracingParameters.Add("staticSiteUserProvidedFunctionEnvelope", staticSiteUserProvidedFunctionEnvelope); + tracingParameters.Add("isForced", isForced); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRegisterUserProvidedFunctionAppWithStaticSiteBuild", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (isForced != null) + { + _queryParameters.Add(string.Format("isForced={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(isForced, Client.SerializationSettings).Trim('"')))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteUserProvidedFunctionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserProvidedFunctionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deploys zipped content to a specific environment of a static site. + /// + /// + /// Description for Deploys zipped content to a specific environment of a + /// static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + /// + /// 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 BeginCreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (environmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } + if (staticSiteZipDeploymentEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteZipDeploymentEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("staticSiteZipDeploymentEnvelope", staticSiteZipDeploymentEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateZipDeploymentForStaticSiteBuild", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/zipdeploy").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteZipDeploymentEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteZipDeploymentEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Creates a new static site custom domain in an existing resource group and + /// static site. + /// + /// + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// 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> BeginCreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (domainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + } + if (staticSiteCustomDomainRequestPropertiesEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteCustomDomainRequestPropertiesEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("domainName", domainName); + tracingParameters.Add("staticSiteCustomDomainRequestPropertiesEnvelope", staticSiteCustomDomainRequestPropertiesEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateStaticSiteCustomDomain", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteCustomDomainRequestPropertiesEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteCustomDomainRequestPropertiesEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + /// + /// 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 BeginDeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (domainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("domainName", domainName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteStaticSiteCustomDomain", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added to a + /// static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// 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 BeginValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (domainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + } + if (staticSiteCustomDomainRequestPropertiesEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteCustomDomainRequestPropertiesEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("domainName", domainName); + tracingParameters.Add("staticSiteCustomDomainRequestPropertiesEnvelope", staticSiteCustomDomainRequestPropertiesEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginValidateCustomDomainCanBeAddedToStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteCustomDomainRequestPropertiesEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteCustomDomainRequestPropertiesEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + /// + /// 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 BeginDetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDetachStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// 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> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (privateEndpointWrapper == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnection", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(privateEndpointWrapper != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// 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> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 204) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// 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> BeginRegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (functionAppName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); + } + if (staticSiteUserProvidedFunctionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserProvidedFunctionEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("functionAppName", functionAppName); + tracingParameters.Add("staticSiteUserProvidedFunctionEnvelope", staticSiteUserProvidedFunctionEnvelope); + tracingParameters.Add("isForced", isForced); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRegisterUserProvidedFunctionAppWithStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (isForced != null) + { + _queryParameters.Add(string.Format("isForced={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(isForced, Client.SerializationSettings).Trim('"')))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteUserProvidedFunctionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserProvidedFunctionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + /// + /// 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 BeginCreateZipDeploymentForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { @@ -5067,6 +10751,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (staticSiteZipDeploymentEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteZipDeploymentEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5084,12 +10772,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("staticSiteZipDeploymentEnvelope", staticSiteZipDeploymentEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctionAppSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateZipDeploymentForStaticSite", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/zipdeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -5105,7 +10794,166 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteZipDeploymentEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteZipDeploymentEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Get all Static Sites for a subscription. + /// + /// + /// Description for Get all Static Sites for a 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5156,7 +11004,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -5186,7 +11034,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5199,25 +11047,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5237,16 +11067,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Lists the secrets for an existing static site. + /// Gets all static sites in the specified resource group. /// /// - /// Description for Lists the secrets for an existing static site. + /// Description for Gets all static sites in the specified resource group. /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -5269,38 +11096,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListStaticSiteSecretsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetStaticSitesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -5309,22 +11109,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteSecrets", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSitesByResourceGroupNext", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -5332,7 +11124,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5413,7 +11205,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5426,7 +11218,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5446,18 +11238,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Resets the api key for an existing static site. + /// Gets the list of users of a static site. /// /// - /// Description for Resets the api key for an existing static site. + /// Description for Gets the list of users of a static site. /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -5468,6 +11255,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -5477,42 +11267,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ResetStaticSiteApiKeyWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteUsersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (resetPropertiesEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resetPropertiesEnvelope"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -5521,23 +11280,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("resetPropertiesEnvelope", resetPropertiesEnvelope); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ResetStaticSiteApiKey", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteUsersNext", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -5576,12 +11326,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(resetPropertiesEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(resetPropertiesEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -5632,13 +11376,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -5647,10 +11409,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Get all Static Sites for a subscription. + /// Gets all static site builds for a particular static site. /// /// - /// Description for Get all Static Sites for a subscription. + /// Description for Gets all static site builds for a particular static site. /// /// /// The NextLink from the previous successful call to List operation. @@ -5676,7 +11438,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetStaticSiteBuildsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -5691,7 +11453,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuildsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -5785,7 +11547,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5798,7 +11560,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5818,10 +11580,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static sites in the specified resource group. + /// Gets the functions of a particular static site build. /// /// - /// Description for Gets all static sites in the specified resource group. + /// Description for Gets the functions of a particular static site build. /// /// /// The NextLink from the previous successful call to List operation. @@ -5847,7 +11609,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetStaticSitesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteBuildFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -5862,7 +11624,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSitesByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -5956,7 +11718,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5969,7 +11731,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5989,10 +11751,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the list of users of a static site. + /// Gets the details of the user provided function apps registered with a + /// static site build /// /// - /// Description for Gets the list of users of a static site. + /// Description for Gets the details of the user provided function apps + /// registered with a static site build /// /// /// The NextLink from the previous successful call to List operation. @@ -6018,7 +11782,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteUsersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetUserProvidedFunctionAppsForStaticSiteBuildNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -6033,7 +11797,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteUsersNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppsForStaticSiteBuildNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -6046,7 +11810,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6127,7 +11891,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6140,7 +11904,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6160,10 +11924,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static site builds for a particular static site. + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Gets all static site builds for a particular static site. + /// Description for Gets all static site custom domains for a particular static + /// site. /// /// /// The NextLink from the previous successful call to List operation. @@ -6189,7 +11954,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetStaticSiteBuildsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteCustomDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -6204,7 +11969,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuildsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteCustomDomainsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -6298,7 +12063,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6311,7 +12076,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6331,10 +12096,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the functions of a particular static site build. + /// Gets the functions of a static site. /// /// - /// Description for Gets the functions of a particular static site build. + /// Description for Gets the functions of a static site. /// /// /// The NextLink from the previous successful call to List operation. @@ -6360,7 +12125,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteBuildFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -6375,7 +12140,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctionsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -6502,11 +12267,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static site custom domains for a particular static site. + /// Gets the list of private endpoint connections associated with a static site /// /// - /// Description for Gets all static site custom domains for a particular static - /// site. + /// Description for Gets the list of private endpoint connections associated + /// with a static site /// /// /// The NextLink from the previous successful call to List operation. @@ -6532,7 +12297,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteCustomDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -6547,7 +12312,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteCustomDomainsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -6641,7 +12406,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6654,7 +12419,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6674,10 +12439,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the functions of a static site. + /// Gets the details of the user provided function apps registered with a + /// static site /// /// - /// Description for Gets the functions of a static site. + /// Description for Gets the details of the user provided function apps + /// registered with a static site /// /// /// The NextLink from the previous successful call to List operation. @@ -6703,7 +12470,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetUserProvidedFunctionAppsForStaticSiteNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -6718,7 +12485,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctionsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppsForStaticSiteNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -6812,7 +12579,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6825,7 +12592,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperationsExtensions.cs index 4fea3668e831..78c4805f4470 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperationsExtensions.cs @@ -21,6 +21,54 @@ namespace Microsoft.Azure.Management.WebSites /// public static partial class StaticSitesOperationsExtensions { + /// + /// Generates a preview workflow file for the static site + /// + /// + /// Description for Generates a preview workflow file for the static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Location where you plan to create the static site. + /// + /// + /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. + /// See example. + /// + public static StaticSitesWorkflowPreview PreviewWorkflow(this IStaticSitesOperations operations, string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest) + { + return operations.PreviewWorkflowAsync(location, staticSitesWorkflowPreviewRequest).GetAwaiter().GetResult(); + } + + /// + /// Generates a preview workflow file for the static site + /// + /// + /// Description for Generates a preview workflow file for the static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Location where you plan to create the static site. + /// + /// + /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. + /// See example. + /// + /// + /// The cancellation token. + /// + public static async Task PreviewWorkflowAsync(this IStaticSitesOperations operations, string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PreviewWorkflowWithHttpMessagesAsync(location, staticSitesWorkflowPreviewRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get all Static Sites for a subscription. /// @@ -528,12 +576,12 @@ public static IPage GetStaticSiteBuilds(this IStatic /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - public static StaticSiteBuildARMResource GetStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId) + public static StaticSiteBuildARMResource GetStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) { - return operations.GetStaticSiteBuildAsync(resourceGroupName, name, prId).GetAwaiter().GetResult(); + return operations.GetStaticSiteBuildAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); } /// @@ -551,15 +599,15 @@ public static StaticSiteBuildARMResource GetStaticSiteBuild(this IStaticSitesOpe /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task GetStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, prId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -580,12 +628,12 @@ public static StaticSiteBuildARMResource GetStaticSiteBuild(this IStaticSitesOpe /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - public static void DeleteStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId) + public static void DeleteStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) { - operations.DeleteStaticSiteBuildAsync(resourceGroupName, name, prId).GetAwaiter().GetResult(); + operations.DeleteStaticSiteBuildAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); } /// @@ -603,23 +651,22 @@ public static void DeleteStaticSiteBuild(this IStaticSitesOperations operations, /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task DeleteStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, prId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Creates or updates the function app settings of a static site build. + /// Creates or updates the app settings of a static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site build. + /// Description for Creates or updates the app settings of a static site build. /// /// /// The operations group for this extension method. @@ -630,22 +677,22 @@ public static void DeleteStaticSiteBuild(this IStaticSitesOperations operations, /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// + /// The dictionary containing the static site app settings to update. /// - public static StringDictionary CreateOrUpdateStaticSiteBuildFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, StringDictionary appSettings) + public static StringDictionary CreateOrUpdateStaticSiteBuildAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StringDictionary appSettings) { - return operations.CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(resourceGroupName, name, prId, appSettings).GetAwaiter().GetResult(); + return operations.CreateOrUpdateStaticSiteBuildAppSettingsAsync(resourceGroupName, name, environmentName, appSettings).GetAwaiter().GetResult(); } /// - /// Creates or updates the function app settings of a static site build. + /// Creates or updates the app settings of a static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site build. + /// Description for Creates or updates the app settings of a static site build. /// /// /// The operations group for this extension method. @@ -656,27 +703,29 @@ public static StringDictionary CreateOrUpdateStaticSiteBuildFunctionAppSettings( /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// + /// The dictionary containing the static site app settings to update. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateStaticSiteBuildAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, prId, appSettings, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateStaticSiteBuildAppSettingsWithHttpMessagesAsync(resourceGroupName, name, environmentName, appSettings, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the functions of a particular static site build. + /// Creates or updates the function app settings of a static site build. /// /// - /// Description for Gets the functions of a particular static site build. + /// Description for Creates or updates the function app settings of a static + /// site build. /// /// /// The operations group for this extension method. @@ -687,19 +736,23 @@ public static StringDictionary CreateOrUpdateStaticSiteBuildFunctionAppSettings( /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - public static IPage ListStaticSiteBuildFunctions(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId) + /// + /// The dictionary containing the static site function app settings to update. + /// + public static StringDictionary CreateOrUpdateStaticSiteBuildFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StringDictionary appSettings) { - return operations.ListStaticSiteBuildFunctionsAsync(resourceGroupName, name, prId).GetAwaiter().GetResult(); + return operations.CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(resourceGroupName, name, environmentName, appSettings).GetAwaiter().GetResult(); } /// - /// Gets the functions of a particular static site build. + /// Creates or updates the function app settings of a static site build. /// /// - /// Description for Gets the functions of a particular static site build. + /// Description for Creates or updates the function app settings of a static + /// site build. /// /// /// The operations group for this extension method. @@ -710,25 +763,28 @@ public static IPage ListStaticSiteBuildFu /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// + /// + /// The dictionary containing the static site function app settings to update. + /// /// /// The cancellation token. /// - public static async Task> ListStaticSiteBuildFunctionsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteBuildFunctionsWithHttpMessagesAsync(resourceGroupName, name, prId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, environmentName, appSettings, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the application settings of a static site. + /// Gets the functions of a particular static site build. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Gets the functions of a particular static site build. /// /// /// The operations group for this extension method. @@ -739,19 +795,19 @@ public static IPage ListStaticSiteBuildFu /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - public static StringDictionary ListStaticSiteBuildFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId) + public static IPage ListStaticSiteBuildFunctions(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) { - return operations.ListStaticSiteBuildFunctionAppSettingsAsync(resourceGroupName, name, prId).GetAwaiter().GetResult(); + return operations.ListStaticSiteBuildFunctionsAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); } /// - /// Gets the application settings of a static site. + /// Gets the functions of a particular static site build. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Gets the functions of a particular static site build. /// /// /// The operations group for this extension method. @@ -762,26 +818,25 @@ public static StringDictionary ListStaticSiteBuildFunctionAppSettings(this IStat /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task ListStaticSiteBuildFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListStaticSiteBuildFunctionsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, prId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListStaticSiteBuildFunctionsWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates the function app settings of a static site. + /// Gets the application settings of a static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site. + /// Description for Gets the application settings of a static site build. /// /// /// The operations group for this extension method. @@ -792,19 +847,19 @@ public static StringDictionary ListStaticSiteBuildFunctionAppSettings(this IStat /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// - public static StringDictionary CreateOrUpdateStaticSiteFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings) + public static StringDictionary ListStaticSiteBuildAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) { - return operations.CreateOrUpdateStaticSiteFunctionAppSettingsAsync(resourceGroupName, name, appSettings).GetAwaiter().GetResult(); + return operations.ListStaticSiteBuildAppSettingsAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); } /// - /// Creates or updates the function app settings of a static site. + /// Gets the application settings of a static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site. + /// Description for Gets the application settings of a static site build. /// /// /// The operations group for this extension method. @@ -815,24 +870,25 @@ public static StringDictionary CreateOrUpdateStaticSiteFunctionAppSettings(this /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateStaticSiteFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListStaticSiteBuildAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, appSettings, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListStaticSiteBuildAppSettingsWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates an invitation link for a user with the role + /// Gets the application settings of a static site build. /// /// - /// Description for Creates an invitation link for a user with the role + /// Description for Gets the application settings of a static site build. /// /// /// The operations group for this extension method. @@ -843,18 +899,19 @@ public static StringDictionary CreateOrUpdateStaticSiteFunctionAppSettings(this /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// - public static StaticSiteUserInvitationResponseResource CreateUserRolesInvitationLink(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope) + public static StringDictionary ListStaticSiteBuildFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) { - return operations.CreateUserRolesInvitationLinkAsync(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope).GetAwaiter().GetResult(); + return operations.ListStaticSiteBuildFunctionAppSettingsAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); } /// - /// Creates an invitation link for a user with the role + /// Gets the application settings of a static site build. /// /// - /// Description for Creates an invitation link for a user with the role + /// Description for Gets the application settings of a static site build. /// /// /// The operations group for this extension method. @@ -865,25 +922,27 @@ public static StaticSiteUserInvitationResponseResource CreateUserRolesInvitation /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task CreateUserRolesInvitationLinkAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListStaticSiteBuildFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateUserRolesInvitationLinkWithHttpMessagesAsync(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all static site custom domains for a particular static site. + /// Gets the details of the user provided function apps registered with a + /// static site build /// /// - /// Description for Gets all static site custom domains for a particular static - /// site. + /// Description for Gets the details of the user provided function apps + /// registered with a static site build /// /// /// The operations group for this extension method. @@ -892,19 +951,23 @@ public static StaticSiteUserInvitationResponseResource CreateUserRolesInvitation /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site. /// - public static IPage ListStaticSiteCustomDomains(this IStaticSitesOperations operations, string resourceGroupName, string name) + /// + /// The stage site identifier. + /// + public static IPage GetUserProvidedFunctionAppsForStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) { - return operations.ListStaticSiteCustomDomainsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.GetUserProvidedFunctionAppsForStaticSiteBuildAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); } /// - /// Gets all static site custom domains for a particular static site. + /// Gets the details of the user provided function apps registered with a + /// static site build /// /// - /// Description for Gets all static site custom domains for a particular static - /// site. + /// Description for Gets the details of the user provided function apps + /// registered with a static site build /// /// /// The operations group for this extension method. @@ -913,26 +976,29 @@ public static IPage ListStaticSiteCus /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site. + /// + /// + /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task> ListStaticSiteCustomDomainsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetUserProvidedFunctionAppsForStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteCustomDomainsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetUserProvidedFunctionAppsForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates a new static site custom domain in an existing resource group and - /// static site. + /// Gets the details of the user provided function app registered with a static + /// site build /// /// - /// Description for Creates a new static site custom domain in an existing - /// resource group and static site. + /// Description for Gets the details of the user provided function app + /// registered with a static site build /// /// /// The operations group for this extension method. @@ -943,21 +1009,24 @@ public static IPage ListStaticSiteCus /// /// Name of the static site. /// - /// - /// The custom domain to create. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// - public static StaticSiteCustomDomainOverviewARMResource CreateOrUpdateStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) + public static StaticSiteUserProvidedFunctionAppARMResource GetUserProvidedFunctionAppForStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName) { - return operations.CreateOrUpdateStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); + return operations.GetUserProvidedFunctionAppForStaticSiteBuildAsync(resourceGroupName, name, environmentName, functionAppName).GetAwaiter().GetResult(); } /// - /// Creates a new static site custom domain in an existing resource group and - /// static site. + /// Gets the details of the user provided function app registered with a static + /// site build /// /// - /// Description for Creates a new static site custom domain in an existing - /// resource group and static site. + /// Description for Gets the details of the user provided function app + /// registered with a static site build /// /// /// The operations group for this extension method. @@ -968,25 +1037,29 @@ public static StaticSiteCustomDomainOverviewARMResource CreateOrUpdateStaticSite /// /// Name of the static site. /// - /// - /// The custom domain to create. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetUserProvidedFunctionAppForStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetUserProvidedFunctionAppForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes a custom domain. + /// Register a user provided function app with a static site build /// /// - /// Description for Deletes a custom domain. + /// Description for Register a user provided function app with a static site + /// build /// /// /// The operations group for this extension method. @@ -997,19 +1070,33 @@ public static StaticSiteCustomDomainOverviewARMResource CreateOrUpdateStaticSite /// /// Name of the static site. /// - /// - /// The custom domain to delete. + /// + /// The stage site identifier. /// - public static void DeleteStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + public static StaticSiteUserProvidedFunctionAppARMResource RegisterUserProvidedFunctionAppWithStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?)) { - operations.DeleteStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); + return operations.RegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced).GetAwaiter().GetResult(); } /// - /// Deletes a custom domain. + /// Register a user provided function app with a static site build /// /// - /// Description for Deletes a custom domain. + /// Description for Register a user provided function app with a static site + /// build /// /// /// The operations group for this extension method. @@ -1020,23 +1107,39 @@ public static void DeleteStaticSiteCustomDomain(this IStaticSitesOperations oper /// /// Name of the static site. /// - /// - /// The custom domain to delete. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. /// /// /// The cancellation token. /// - public static async Task DeleteStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.RegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Validates a particular custom domain can be added to a static site. + /// Detach the user provided function app from the static site build /// /// - /// Description for Validates a particular custom domain can be added to a - /// static site. + /// Description for Detach the user provided function app from the static site + /// build /// /// /// The operations group for this extension method. @@ -1047,20 +1150,23 @@ public static void DeleteStaticSiteCustomDomain(this IStaticSitesOperations oper /// /// Name of the static site. /// - /// - /// The custom domain to validate. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// - public static void ValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) + public static void DetachUserProvidedFunctionAppFromStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName) { - operations.ValidateCustomDomainCanBeAddedToStaticSiteAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); + operations.DetachUserProvidedFunctionAppFromStaticSiteBuildAsync(resourceGroupName, name, environmentName, functionAppName).GetAwaiter().GetResult(); } /// - /// Validates a particular custom domain can be added to a static site. + /// Detach the user provided function app from the static site build /// /// - /// Description for Validates a particular custom domain can be added to a - /// static site. + /// Description for Detach the user provided function app from the static site + /// build /// /// /// The operations group for this extension method. @@ -1071,22 +1177,26 @@ public static void ValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesO /// /// Name of the static site. /// - /// - /// The custom domain to validate. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// /// /// The cancellation token. /// - public static async Task ValidateCustomDomainCanBeAddedToStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DetachUserProvidedFunctionAppFromStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DetachUserProvidedFunctionAppFromStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Detaches a static site. + /// Deploys zipped content to a specific environment of a static site. /// /// - /// Description for Detaches a static site. + /// Description for Deploys zipped content to a specific environment of a + /// static site. /// /// /// The operations group for this extension method. @@ -1095,18 +1205,26 @@ public static void ValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesO /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site to detach. + /// Name of the static site. /// - public static void DetachStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + public static void CreateZipDeploymentForStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) { - operations.DetachStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + operations.CreateZipDeploymentForStaticSiteBuildAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope).GetAwaiter().GetResult(); } /// - /// Detaches a static site. + /// Deploys zipped content to a specific environment of a static site. /// /// - /// Description for Detaches a static site. + /// Description for Deploys zipped content to a specific environment of a + /// static site. /// /// /// The operations group for this extension method. @@ -1115,21 +1233,28 @@ public static void DetachStaticSite(this IStaticSitesOperations operations, stri /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site to detach. + /// Name of the static site. + /// + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. /// /// /// The cancellation token. /// - public static async Task DetachStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateZipDeploymentForStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DetachStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.CreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Gets the functions of a static site. + /// Creates or updates the app settings of a static site. /// /// - /// Description for Gets the functions of a static site. + /// Description for Creates or updates the app settings of a static site. /// /// /// The operations group for this extension method. @@ -1140,16 +1265,19 @@ public static void DetachStaticSite(this IStaticSitesOperations operations, stri /// /// Name of the static site. /// - public static IPage ListStaticSiteFunctions(this IStaticSitesOperations operations, string resourceGroupName, string name) + /// + /// The dictionary containing the static site app settings to update. + /// + public static StringDictionary CreateOrUpdateStaticSiteAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings) { - return operations.ListStaticSiteFunctionsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.CreateOrUpdateStaticSiteAppSettingsAsync(resourceGroupName, name, appSettings).GetAwaiter().GetResult(); } /// - /// Gets the functions of a static site. + /// Creates or updates the app settings of a static site. /// /// - /// Description for Gets the functions of a static site. + /// Description for Creates or updates the app settings of a static site. /// /// /// The operations group for this extension method. @@ -1160,22 +1288,26 @@ public static IPage ListStaticSiteFunctio /// /// Name of the static site. /// + /// + /// The dictionary containing the static site app settings to update. + /// /// /// The cancellation token. /// - public static async Task> ListStaticSiteFunctionsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateStaticSiteAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteFunctionsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateStaticSiteAppSettingsWithHttpMessagesAsync(resourceGroupName, name, appSettings, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the application settings of a static site. + /// Creates or updates the function app settings of a static site. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Creates or updates the function app settings of a static + /// site. /// /// /// The operations group for this extension method. @@ -1186,16 +1318,20 @@ public static IPage ListStaticSiteFunctio /// /// Name of the static site. /// - public static StringDictionary ListStaticSiteFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name) + /// + /// The dictionary containing the static site function app settings to update. + /// + public static StringDictionary CreateOrUpdateStaticSiteFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings) { - return operations.ListStaticSiteFunctionAppSettingsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.CreateOrUpdateStaticSiteFunctionAppSettingsAsync(resourceGroupName, name, appSettings).GetAwaiter().GetResult(); } /// - /// Gets the application settings of a static site. + /// Creates or updates the function app settings of a static site. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Creates or updates the function app settings of a static + /// site. /// /// /// The operations group for this extension method. @@ -1206,22 +1342,25 @@ public static StringDictionary ListStaticSiteFunctionAppSettings(this IStaticSit /// /// Name of the static site. /// + /// + /// The dictionary containing the static site function app settings to update. + /// /// /// The cancellation token. /// - public static async Task ListStaticSiteFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateStaticSiteFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, appSettings, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists the secrets for an existing static site. + /// Creates an invitation link for a user with the role /// /// - /// Description for Lists the secrets for an existing static site. + /// Description for Creates an invitation link for a user with the role /// /// /// The operations group for this extension method. @@ -1232,16 +1371,18 @@ public static StringDictionary ListStaticSiteFunctionAppSettings(this IStaticSit /// /// Name of the static site. /// - public static StringDictionary ListStaticSiteSecrets(this IStaticSitesOperations operations, string resourceGroupName, string name) + /// + /// + public static StaticSiteUserInvitationResponseResource CreateUserRolesInvitationLink(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope) { - return operations.ListStaticSiteSecretsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.CreateUserRolesInvitationLinkAsync(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope).GetAwaiter().GetResult(); } /// - /// Lists the secrets for an existing static site. + /// Creates an invitation link for a user with the role /// /// - /// Description for Lists the secrets for an existing static site. + /// Description for Creates an invitation link for a user with the role /// /// /// The operations group for this extension method. @@ -1252,22 +1393,25 @@ public static StringDictionary ListStaticSiteSecrets(this IStaticSitesOperations /// /// Name of the static site. /// + /// + /// /// /// The cancellation token. /// - public static async Task ListStaticSiteSecretsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateUserRolesInvitationLinkAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteSecretsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUserRolesInvitationLinkWithHttpMessagesAsync(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Resets the api key for an existing static site. + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Resets the api key for an existing static site. + /// Description for Gets all static site custom domains for a particular static + /// site. /// /// /// The operations group for this extension method. @@ -1276,20 +1420,19 @@ public static StringDictionary ListStaticSiteSecrets(this IStaticSitesOperations /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. - /// - /// + /// Name of the static site resource to search in. /// - public static void ResetStaticSiteApiKey(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope) + public static IPage ListStaticSiteCustomDomains(this IStaticSitesOperations operations, string resourceGroupName, string name) { - operations.ResetStaticSiteApiKeyAsync(resourceGroupName, name, resetPropertiesEnvelope).GetAwaiter().GetResult(); + return operations.ListStaticSiteCustomDomainsAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// - /// Resets the api key for an existing static site. + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Resets the api key for an existing static site. + /// Description for Gets all static site custom domains for a particular static + /// site. /// /// /// The operations group for this extension method. @@ -1298,16 +1441,1832 @@ public static void ResetStaticSiteApiKey(this IStaticSitesOperations operations, /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. - /// - /// + /// Name of the static site resource to search in. /// /// /// The cancellation token. /// - public static async Task ResetStaticSiteApiKeyAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListStaticSiteCustomDomainsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.ResetStaticSiteApiKeyWithHttpMessagesAsync(resourceGroupName, name, resetPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListStaticSiteCustomDomainsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets an existing custom domain for a particular static site. + /// + /// + /// Description for Gets an existing custom domain for a particular static + /// site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site resource to search in. + /// + /// + /// The custom domain name. + /// + public static StaticSiteCustomDomainOverviewARMResource GetStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) + { + return operations.GetStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); + } + + /// + /// Gets an existing custom domain for a particular static site. + /// + /// + /// Description for Gets an existing custom domain for a particular static + /// site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site resource to search in. + /// + /// + /// The custom domain name. + /// + /// + /// The cancellation token. + /// + public static async Task GetStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new static site custom domain in an existing resource group and + /// static site. + /// + /// + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + public static StaticSiteCustomDomainOverviewARMResource CreateOrUpdateStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) + { + return operations.CreateOrUpdateStaticSiteCustomDomainAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Creates a new static site custom domain in an existing resource group and + /// static site. + /// + /// + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + public static void DeleteStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) + { + operations.DeleteStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added to a + /// static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + public static void ValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) + { + operations.ValidateCustomDomainCanBeAddedToStaticSiteAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added to a + /// static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// The cancellation token. + /// + public static async Task ValidateCustomDomainCanBeAddedToStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + public static void DetachStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + operations.DetachStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + /// + /// The cancellation token. + /// + public static async Task DetachStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DetachStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the functions of a static site. + /// + /// + /// Description for Gets the functions of a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static IPage ListStaticSiteFunctions(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.ListStaticSiteFunctionsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the functions of a static site. + /// + /// + /// Description for Gets the functions of a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task> ListStaticSiteFunctionsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStaticSiteFunctionsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static StringDictionary ListStaticSiteAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.ListStaticSiteAppSettingsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task ListStaticSiteAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStaticSiteAppSettingsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the roles configured for the static site. + /// + /// + /// Description for Lists the roles configured for the static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static StringList ListStaticSiteConfiguredRoles(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.ListStaticSiteConfiguredRolesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Lists the roles configured for the static site. + /// + /// + /// Description for Lists the roles configured for the static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task ListStaticSiteConfiguredRolesAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStaticSiteConfiguredRolesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static StringDictionary ListStaticSiteFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.ListStaticSiteFunctionAppSettingsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task ListStaticSiteFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the secrets for an existing static site. + /// + /// + /// Description for Lists the secrets for an existing static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static StringDictionary ListStaticSiteSecrets(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.ListStaticSiteSecretsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Lists the secrets for an existing static site. + /// + /// + /// Description for Lists the secrets for an existing static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task ListStaticSiteSecretsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStaticSiteSecretsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the list of private endpoint connections associated with a static site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static IPage GetPrivateEndpointConnectionList(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.GetPrivateEndpointConnectionListAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of private endpoint connections associated with a static site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + return operations.ApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + /// + /// The cancellation token. + /// + public static async Task ApproveOrRejectPrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + public static object DeletePrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task DeletePrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.GetPrivateLinkResourcesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateLinkResourcesAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Resets the api key for an existing static site. + /// + /// + /// Description for Resets the api key for an existing static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// + public static void ResetStaticSiteApiKey(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope) + { + operations.ResetStaticSiteApiKeyAsync(resourceGroupName, name, resetPropertiesEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Resets the api key for an existing static site. + /// + /// + /// Description for Resets the api key for an existing static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ResetStaticSiteApiKeyAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ResetStaticSiteApiKeyWithHttpMessagesAsync(resourceGroupName, name, resetPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the details of the user provided function apps registered with a + /// static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static IPage GetUserProvidedFunctionAppsForStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.GetUserProvidedFunctionAppsForStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the details of the user provided function apps registered with a + /// static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task> GetUserProvidedFunctionAppsForStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUserProvidedFunctionAppsForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the details of the user provided function app registered with a static + /// site + /// + /// + /// Description for Gets the details of the user provided function app + /// registered with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + public static StaticSiteUserProvidedFunctionAppARMResource GetUserProvidedFunctionAppForStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName) + { + return operations.GetUserProvidedFunctionAppForStaticSiteAsync(resourceGroupName, name, functionAppName).GetAwaiter().GetResult(); + } + + /// + /// Gets the details of the user provided function app registered with a static + /// site + /// + /// + /// Description for Gets the details of the user provided function app + /// registered with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + /// + /// The cancellation token. + /// + public static async Task GetUserProvidedFunctionAppForStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUserProvidedFunctionAppForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + public static StaticSiteUserProvidedFunctionAppARMResource RegisterUserProvidedFunctionAppWithStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?)) + { + return operations.RegisterUserProvidedFunctionAppWithStaticSiteAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced).GetAwaiter().GetResult(); + } + + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// The cancellation token. + /// + public static async Task RegisterUserProvidedFunctionAppWithStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Detach the user provided function app from the static site + /// + /// + /// Description for Detach the user provided function app from the static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + public static void DetachUserProvidedFunctionAppFromStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName) + { + operations.DetachUserProvidedFunctionAppFromStaticSiteAsync(resourceGroupName, name, functionAppName).GetAwaiter().GetResult(); + } + + /// + /// Detach the user provided function app from the static site + /// + /// + /// Description for Detach the user provided function app from the static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + /// + /// The cancellation token. + /// + public static async Task DetachUserProvidedFunctionAppFromStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DetachUserProvidedFunctionAppFromStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + public static void CreateZipDeploymentForStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) + { + operations.CreateZipDeploymentForStaticSiteAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + /// + /// The cancellation token. + /// + public static async Task CreateZipDeploymentForStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.CreateZipDeploymentForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates a new static site in an existing resource group, or updates an + /// existing static site. + /// + /// + /// Description for Creates a new static site in an existing resource group, or + /// updates an existing static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. + /// + public static StaticSiteARMResource BeginCreateOrUpdateStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope) + { + return operations.BeginCreateOrUpdateStaticSiteAsync(resourceGroupName, name, staticSiteEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Creates a new static site in an existing resource group, or updates an + /// existing static site. + /// + /// + /// Description for Creates a new static site in an existing resource group, or + /// updates an existing static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteEnvelope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a static site. + /// + /// + /// Description for Deletes a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to delete. + /// + public static void BeginDeleteStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + operations.BeginDeleteStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Deletes a static site. + /// + /// + /// Description for Deletes a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to delete. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deletes a static site build. + /// + /// + /// Description for Deletes a static site build. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + public static void BeginDeleteStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) + { + operations.BeginDeleteStaticSiteBuildAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a static site build. + /// + /// + /// Description for Deletes a static site build. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Register a user provided function app with a static site build + /// + /// + /// Description for Register a user provided function app with a static site + /// build + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + public static StaticSiteUserProvidedFunctionAppARMResource BeginRegisterUserProvidedFunctionAppWithStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?)) + { + return operations.BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced).GetAwaiter().GetResult(); + } + + /// + /// Register a user provided function app with a static site build + /// + /// + /// Description for Register a user provided function app with a static site + /// build + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deploys zipped content to a specific environment of a static site. + /// + /// + /// Description for Deploys zipped content to a specific environment of a + /// static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + public static void BeginCreateZipDeploymentForStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) + { + operations.BeginCreateZipDeploymentForStaticSiteBuildAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Deploys zipped content to a specific environment of a static site. + /// + /// + /// Description for Deploys zipped content to a specific environment of a + /// static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateZipDeploymentForStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginCreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates a new static site custom domain in an existing resource group and + /// static site. + /// + /// + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + public static StaticSiteCustomDomainOverviewARMResource BeginCreateOrUpdateStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) + { + return operations.BeginCreateOrUpdateStaticSiteCustomDomainAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Creates a new static site custom domain in an existing resource group and + /// static site. + /// + /// + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + public static void BeginDeleteStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) + { + operations.BeginDeleteStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added to a + /// static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + public static void BeginValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) + { + operations.BeginValidateCustomDomainCanBeAddedToStaticSiteAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added to a + /// static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// The cancellation token. + /// + public static async Task BeginValidateCustomDomainCanBeAddedToStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + public static void BeginDetachStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + operations.BeginDetachStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDetachStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDetachStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + return operations.BeginApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + /// + /// The cancellation token. + /// + public static async Task BeginApproveOrRejectPrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + public static object BeginDeletePrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeletePrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + public static StaticSiteUserProvidedFunctionAppARMResource BeginRegisterUserProvidedFunctionAppWithStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?)) + { + return operations.BeginRegisterUserProvidedFunctionAppWithStaticSiteAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced).GetAwaiter().GetResult(); + } + + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRegisterUserProvidedFunctionAppWithStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginRegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + public static void BeginCreateZipDeploymentForStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) + { + operations.BeginCreateZipDeploymentForStaticSiteAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateZipDeploymentForStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginCreateZipDeploymentForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -1510,6 +3469,50 @@ public static IPage ListStaticSiteBuildFu } } + /// + /// Gets the details of the user provided function apps registered with a + /// static site build + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site build + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetUserProvidedFunctionAppsForStaticSiteBuildNext(this IStaticSitesOperations operations, string nextPageLink) + { + return operations.GetUserProvidedFunctionAppsForStaticSiteBuildNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the details of the user provided function apps registered with a + /// static site build + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site build + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetUserProvidedFunctionAppsForStaticSiteBuildNextAsync(this IStaticSitesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUserProvidedFunctionAppsForStaticSiteBuildNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets all static site custom domains for a particular static site. /// @@ -1592,5 +3595,91 @@ public static IPage ListStaticSiteFunctio } } + /// + /// Gets the list of private endpoint connections associated with a static site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetPrivateEndpointConnectionListNext(this IStaticSitesOperations operations, string nextPageLink) + { + return operations.GetPrivateEndpointConnectionListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of private endpoint connections associated with a static site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListNextAsync(this IStaticSitesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the details of the user provided function apps registered with a + /// static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetUserProvidedFunctionAppsForStaticSiteNext(this IStaticSitesOperations operations, string nextPageLink) + { + return operations.GetUserProvidedFunctionAppsForStaticSiteNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the details of the user provided function apps registered with a + /// static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetUserProvidedFunctionAppsForStaticSiteNextAsync(this IStaticSitesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUserProvidedFunctionAppsForStaticSiteNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperations.cs index 4329eceb1edf..806555a718ec 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperations.cs @@ -6331,10 +6331,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the connection strings of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Replaces the connection strings of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -6342,9 +6342,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Connection strings of the app or deployment slot. See example. - /// /// /// Headers that will be added to request. /// @@ -6366,7 +6363,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetAppSettingsKeyVaultReferencesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6391,10 +6388,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionStrings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionStrings"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -6412,13 +6405,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionStrings", connectionStrings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateConnectionStrings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingsKeyVaultReferences", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -6434,7 +6426,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6465,12 +6457,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionStrings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionStrings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -6521,7 +6507,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6534,7 +6520,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6554,10 +6540,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the connection strings of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Gets the connection strings of an app. + /// Description for Gets the config reference and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -6565,6 +6551,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// App Setting key name. + /// /// /// Headers that will be added to request. /// @@ -6586,7 +6575,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAppSettingKeyVaultReferenceWithHttpMessagesAsync(string resourceGroupName, string name, string appSettingKey, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6611,214 +6600,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStrings", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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")) + if (appSettingKey == null) { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the logging configuration of an app. - /// - /// - /// Description for Gets the logging configuration of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// 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> GetDiagnosticLogsConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettingKey"); } if (Client.SubscriptionId == null) { @@ -6837,14 +6621,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("appSettingKey", appSettingKey); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticLogsConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingKeyVaultReference", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings/{appSettingKey}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{appSettingKey}", System.Uri.EscapeDataString(appSettingKey)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -6939,7 +6725,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6952,7 +6738,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6972,10 +6758,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the logging configuration of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Updates the logging configuration of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -6983,10 +6769,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// A SiteLogsConfig JSON object that contains the logging configuration to - /// change in the "properties" property. - /// /// /// Headers that will be added to request. /// @@ -7008,7 +6790,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateDiagnosticLogsConfigWithHttpMessagesAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetSiteConnectionStringKeyVaultReferencesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7033,14 +6815,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteLogsConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteLogsConfig"); - } - if (siteLogsConfig != null) - { - siteLogsConfig.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -7058,13 +6832,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteLogsConfig", siteLogsConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateDiagnosticLogsConfig", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReferences", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -7080,7 +6853,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7111,12 +6884,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteLogsConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteLogsConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -7167,7 +6934,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7180,7 +6947,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7200,10 +6967,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the metadata of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Replaces the metadata of an app. + /// Description for Gets the config reference and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -7211,8 +6978,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Edited metadata of the app or deployment slot. See example. + /// /// /// /// Headers that will be added to request. @@ -7235,7 +7001,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateMetadataWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary metadata, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSiteConnectionStringKeyVaultReferenceWithHttpMessagesAsync(string resourceGroupName, string name, string connectionStringKey, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7260,9 +7026,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (metadata == null) + if (connectionStringKey == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionStringKey"); } if (Client.SubscriptionId == null) { @@ -7281,15 +7047,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("metadata", metadata); + tracingParameters.Add("connectionStringKey", connectionStringKey); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateMetadata", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReference", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings/{connectionStringKey}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{connectionStringKey}", System.Uri.EscapeDataString(connectionStringKey)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -7303,7 +7070,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7334,12 +7101,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(metadata != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -7390,7 +7151,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7403,7 +7164,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7423,10 +7184,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the metadata of an app. + /// Replaces the connection strings of an app. /// /// - /// Description for Gets the metadata of an app. + /// Description for Replaces the connection strings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -7434,6 +7195,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Connection strings of the app or deployment slot. See example. + /// /// /// Headers that will be added to request. /// @@ -7455,7 +7219,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListMetadataWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7480,6 +7244,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (connectionStrings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionStrings"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -7497,12 +7265,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("connectionStrings", connectionStrings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMetadata", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateConnectionStrings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -7518,7 +7287,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7549,6 +7318,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionStrings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionStrings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -7599,7 +7374,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7612,7 +7387,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7632,10 +7407,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Git/FTP publishing credentials of an app. + /// Gets the connection strings of an app. /// /// - /// Description for Gets the Git/FTP publishing credentials of an app. + /// Description for Gets the connection strings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -7644,32 +7419,213 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListPublishingCredentialsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// 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> ListConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListPublishingCredentialsWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStrings", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; } /// - /// Updates the Push settings associated with web app. + /// Gets the logging configuration of an app. /// /// - /// Description for Updates the Push settings associated with web app. + /// Description for Gets the logging configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Push settings associated with web app. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -7692,7 +7648,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSitePushSettingsWithHttpMessagesAsync(string resourceGroupName, string name, PushSettings pushSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDiagnosticLogsConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7717,14 +7673,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (pushSettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "pushSettings"); - } - if (pushSettings != null) - { - pushSettings.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -7742,13 +7690,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("pushSettings", pushSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSitePushSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticLogsConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -7764,7 +7711,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7795,12 +7742,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(pushSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pushSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -7851,7 +7792,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7864,7 +7805,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7884,16 +7825,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Push settings associated with web app. + /// Updates the logging configuration of an app. /// /// - /// Description for Gets the Push settings associated with web app. + /// Description for Updates the logging configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// A SiteLogsConfig JSON object that contains the logging configuration to + /// change in the "properties" property. /// /// /// Headers that will be added to request. @@ -7916,7 +7861,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSitePushSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDiagnosticLogsConfigWithHttpMessagesAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7941,6 +7886,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteLogsConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteLogsConfig"); + } + if (siteLogsConfig != null) + { + siteLogsConfig.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -7958,12 +7911,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteLogsConfig", siteLogsConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSitePushSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateDiagnosticLogsConfig", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -7979,7 +7933,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8010,6 +7964,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteLogsConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteLogsConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -8060,7 +8020,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8073,7 +8033,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8093,12 +8053,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the names of app settings and connection strings that stick to the - /// slot (not swapped). + /// Replaces the metadata of an app. /// /// - /// Description for Gets the names of app settings and connection strings that - /// stick to the slot (not swapped). + /// Description for Replaces the metadata of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -8106,6 +8064,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Edited metadata of the app or deployment slot. See example. + /// /// /// Headers that will be added to request. /// @@ -8127,7 +8088,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSlotConfigurationNamesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateMetadataWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary metadata, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8152,6 +8113,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (metadata == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -8169,12 +8134,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("metadata", metadata); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlotConfigurationNames", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateMetadata", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -8190,7 +8156,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8221,6 +8187,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(metadata != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -8271,7 +8243,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8284,7 +8256,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8304,12 +8276,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the names of application settings and connection string that remain - /// with the slot during swap operation. + /// Gets the metadata of an app. /// /// - /// Description for Updates the names of application settings and connection - /// string that remain with the slot during swap operation. + /// Description for Gets the metadata of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -8317,9 +8287,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Names of application settings and connection strings. See example. - /// /// /// Headers that will be added to request. /// @@ -8341,7 +8308,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSlotConfigurationNamesWithHttpMessagesAsync(string resourceGroupName, string name, SlotConfigNamesResource slotConfigNames, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListMetadataWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8366,10 +8333,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotConfigNames == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotConfigNames"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -8387,13 +8350,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotConfigNames", slotConfigNames); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSlotConfigurationNames", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMetadata", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -8409,7 +8371,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8440,12 +8402,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotConfigNames != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotConfigNames, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -8496,7 +8452,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8509,7 +8465,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8529,12 +8485,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the configuration of an app, such as platform version and bitness, - /// default documents, virtual applications, Always On, etc. + /// Gets the Git/FTP publishing credentials of an app. /// /// - /// Description for Gets the configuration of an app, such as platform version - /// and bitness, default documents, virtual applications, Always On, etc. + /// Description for Gets the Git/FTP publishing credentials of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -8543,6 +8497,34 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListPublishingCredentialsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListPublishingCredentialsWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the Push settings associated with web app. + /// + /// + /// Description for Updates the Push settings associated with web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Push settings associated with web app. + /// + /// /// Headers that will be added to request. /// /// @@ -8563,7 +8545,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSitePushSettingsWithHttpMessagesAsync(string resourceGroupName, string name, PushSettings pushSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8588,6 +8570,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (pushSettings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "pushSettings"); + } + if (pushSettings != null) + { + pushSettings.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -8605,12 +8595,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("pushSettings", pushSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSitePushSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -8626,7 +8617,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8657,6 +8648,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(pushSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pushSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -8707,7 +8704,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8720,7 +8717,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8740,19 +8737,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the configuration of an app. + /// Gets the Push settings associated with web app. /// /// - /// Description for Updates the configuration of an app. + /// Description for Gets the Push settings associated with web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON representation of a SiteConfig object. See example. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -8775,7 +8769,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSitePushSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8800,14 +8794,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); - } - if (siteConfig != null) - { - siteConfig.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -8825,13 +8811,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSitePushSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -8847,7 +8832,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8878,12 +8863,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -8934,7 +8913,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8947,7 +8926,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8967,10 +8946,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the configuration of an app. + /// Gets the names of app settings and connection strings that stick to the + /// slot (not swapped). /// /// - /// Description for Updates the configuration of an app. + /// Description for Gets the names of app settings and connection strings that + /// stick to the slot (not swapped). /// /// /// Name of the resource group to which the resource belongs. @@ -8978,9 +8959,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteConfig object. See example. - /// /// /// Headers that will be added to request. /// @@ -9002,7 +8980,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSlotConfigurationNamesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9027,10 +9005,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -9048,13 +9022,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlotConfigurationNames", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -9070,7 +9043,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -9101,12 +9074,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -9157,7 +9124,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -9170,7 +9137,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -9190,12 +9157,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a list of web app configuration snapshots identifiers. Each element of - /// the list contains a timestamp and the ID of the snapshot. + /// Updates the names of application settings and connection string that remain + /// with the slot during swap operation. /// /// - /// Description for Gets a list of web app configuration snapshots identifiers. - /// Each element of the list contains a timestamp and the ID of the snapshot. + /// Description for Updates the names of application settings and connection + /// string that remain with the slot during swap operation. /// /// /// Name of the resource group to which the resource belongs. @@ -9203,6 +9170,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Names of application settings and connection strings. See example. + /// /// /// Headers that will be added to request. /// @@ -9224,7 +9194,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationSnapshotInfoWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSlotConfigurationNamesWithHttpMessagesAsync(string resourceGroupName, string name, SlotConfigNamesResource slotConfigNames, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9249,6 +9219,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slotConfigNames == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slotConfigNames"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -9266,12 +9240,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slotConfigNames", slotConfigNames); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfo", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSlotConfigurationNames", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -9287,7 +9262,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -9318,6 +9293,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotConfigNames != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotConfigNames, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -9368,7 +9349,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -9381,7 +9362,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -9401,11 +9382,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a snapshot of the configuration of an app at a previous point in time. + /// Gets the configuration of an app, such as platform version and bitness, + /// default documents, virtual applications, Always On, etc. /// /// - /// Description for Gets a snapshot of the configuration of an app at a - /// previous point in time. + /// Description for Gets the configuration of an app, such as platform version + /// and bitness, default documents, virtual applications, Always On, etc. /// /// /// Name of the resource group to which the resource belongs. @@ -9413,9 +9395,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of the snapshot to read. - /// /// /// Headers that will be added to request. /// @@ -9437,7 +9416,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetConfigurationSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9462,10 +9441,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (snapshotId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -9483,16 +9458,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSnapshot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -9620,10 +9593,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Reverts the configuration of an app to a previous snapshot. + /// Updates the configuration of an app. /// /// - /// Description for Reverts the configuration of an app to a previous snapshot. + /// Description for Updates the configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -9631,8 +9604,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of the snapshot to read. + /// + /// JSON representation of a SiteConfig object. See example. /// /// /// Headers that will be added to request. @@ -9643,6 +9616,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -9652,7 +9628,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RecoverSiteConfigurationSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9677,202 +9653,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (snapshotId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("snapshotId", snapshotId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RecoverSiteConfigurationSnapshot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 204) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Gets the last lines of docker logs for the given site - /// - /// - /// Description for Gets the last lines of docker logs for the given site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// 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> GetWebSiteContainerLogsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) + if (siteConfig == null) { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } + throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); } - if (name == null) + if (siteConfig != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + siteConfig.Validate(); } if (Client.SubscriptionId == null) { @@ -9891,12 +9678,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebSiteContainerLogs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -9912,7 +9700,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -9943,6 +9731,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -9955,7 +9749,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -9963,16 +9757,15 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -9982,10 +9775,6 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -9998,7 +9787,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -10008,7 +9797,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -10018,16 +9820,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the ZIP archived docker log files for the given site + /// Updates the configuration of an app. /// /// - /// Description for Gets the ZIP archived docker log files for the given site + /// Description for Updates the configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// JSON representation of a SiteConfig object. See example. /// /// /// Headers that will be added to request. @@ -10035,7 +9840,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -10050,7 +9855,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContainerLogsZipWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10075,6 +9880,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -10092,12 +9901,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetContainerLogsZip", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -10113,7 +9923,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -10144,6 +9954,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -10156,7 +9972,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -10164,16 +9980,15 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -10183,10 +9998,6 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -10199,7 +10010,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -10209,7 +10020,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -10219,16 +10043,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List continuous web jobs for an app, or a deployment slot. + /// Gets a list of web app configuration snapshots identifiers. Each element of + /// the list contains a timestamp and the ID of the snapshot. /// /// - /// Description for List continuous web jobs for an app, or a deployment slot. + /// Description for Gets a list of web app configuration snapshots identifiers. + /// Each element of the list contains a timestamp and the ID of the snapshot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -10251,7 +10077,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListContinuousWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationSnapshotInfoWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10294,11 +10120,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfo", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -10395,7 +10221,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -10408,7 +10234,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -10428,20 +10254,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a continuous web job by its ID for an app, or a deployment slot. + /// Gets a snapshot of the configuration of an app at a previous point in time. /// /// - /// Description for Gets a continuous web job by its ID for an app, or a - /// deployment slot. + /// Description for Gets a snapshot of the configuration of an app at a + /// previous point in time. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// The ID of the snapshot to read. /// /// /// Headers that will be added to request. @@ -10464,7 +10290,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetConfigurationSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10489,9 +10315,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (snapshotId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); } if (Client.SubscriptionId == null) { @@ -10510,16 +10336,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetContinuousWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSnapshot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -10584,7 +10410,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -10614,7 +10440,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -10627,7 +10453,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -10647,20 +10473,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a continuous web job by its ID for an app, or a deployment slot. + /// Reverts the configuration of an app to a previous snapshot. /// /// - /// Description for Delete a continuous web job by its ID for an app, or a - /// deployment slot. + /// Description for Reverts the configuration of an app to a previous snapshot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// The ID of the snapshot to read. /// /// /// Headers that will be added to request. @@ -10680,7 +10505,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RecoverSiteConfigurationSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10705,9 +10530,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (snapshotId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); } if (Client.SubscriptionId == null) { @@ -10726,16 +10551,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteContinuousWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RecoverSiteConfigurationSnapshot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -10749,7 +10574,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -10800,7 +10625,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -10845,20 +10670,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start a continuous web job for an app, or a deployment slot. + /// Gets the last lines of docker logs for the given site /// /// - /// Description for Start a continuous web job for an app, or a deployment - /// slot. + /// Description for Gets the last lines of docker logs for the given site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -10866,9 +10687,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -10878,7 +10702,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWebSiteContainerLogsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10903,10 +10727,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -10924,16 +10744,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartContinuousWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebSiteContainerLogs", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -10990,7 +10808,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -10998,15 +10816,16 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -11016,6 +10835,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -11028,13 +10851,18 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -11043,19 +10871,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Stop a continuous web job for an app, or a deployment slot. + /// Gets the ZIP archived docker log files for the given site /// /// - /// Description for Stop a continuous web job for an app, or a deployment slot. + /// Description for Gets the ZIP archived docker log files for the given site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -11063,9 +10888,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -11075,7 +10903,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContainerLogsZipWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11100,10 +10928,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -11121,16 +10945,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopContinuousWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetContainerLogsZip", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -11187,7 +11009,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -11195,15 +11017,16 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -11213,6 +11036,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -11225,13 +11052,18 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -11240,16 +11072,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployments for an app, or a deployment slot. + /// List continuous web jobs for an app, or a deployment slot. /// /// - /// Description for List deployments for an app, or a deployment slot. + /// Description for List continuous web jobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// /// /// Headers that will be added to request. @@ -11272,7 +11104,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDeploymentsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListContinuousWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11315,11 +11147,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeployments", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobs", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -11416,7 +11248,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -11429,7 +11261,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -11449,20 +11281,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a deployment by its ID for an app, or a deployment slot. + /// Gets a continuous web job by its ID for an app, or a deployment slot. /// /// - /// Description for Get a deployment by its ID for an app, or a deployment - /// slot. + /// Description for Gets a continuous web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Deployment ID. + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -11485,7 +11317,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11510,9 +11342,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -11531,16 +11363,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDeployment", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetContinuousWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -11605,7 +11437,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -11635,7 +11467,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -11648,7 +11480,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -11668,22 +11500,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create a deployment for an app, or a deployment slot. + /// Delete a continuous web job by its ID for an app, or a deployment slot. /// /// - /// Description for Create a deployment for an app, or a deployment slot. + /// Description for Delete a continuous web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// ID of an existing deployment. + /// Site name. /// - /// - /// Deployment details. + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -11694,9 +11524,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -11706,7 +11533,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Deployment deployment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11731,13 +11558,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); - } - if (deployment == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deployment"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -11756,17 +11579,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); - tracingParameters.Add("deployment", deployment); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateDeployment", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteContinuousWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -11780,7 +11602,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -11811,12 +11633,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(deployment != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deployment, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -11837,7 +11653,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -11867,31 +11683,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -11900,20 +11698,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a deployment by its ID for an app, or a deployment slot. + /// Start a continuous web job for an app, or a deployment slot. /// /// - /// Description for Delete a deployment by its ID for an app, or a deployment + /// Description for Start a continuous web job for an app, or a deployment /// slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Deployment ID. + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -11933,7 +11731,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StartContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11958,9 +11756,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -11979,16 +11777,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteDeployment", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartContinuousWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -12002,7 +11800,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -12053,7 +11851,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -12098,22 +11896,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployment log for specific deployment for an app, or a deployment - /// slot. + /// Stop a continuous web job for an app, or a deployment slot. /// /// - /// Description for List deployment log for specific deployment for an app, or - /// a deployment slot. + /// Description for Stop a continuous web job for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// The ID of a specific deployment. This is the value of the name property in - /// the JSON response from "GET /api/sites/{siteName}/deployments". + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -12124,9 +11919,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -12136,7 +11928,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListDeploymentLogWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -12161,9 +11953,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -12182,16 +11974,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentLog", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopContinuousWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -12205,7 +11997,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -12256,7 +12048,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -12286,31 +12078,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -12319,14 +12093,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Discovers an existing app backup that can be restored from a blob in Azure - /// storage. Use this to get information about the databases stored in a - /// backup. + /// List deployments for an app, or a deployment slot. /// /// - /// Description for Discovers an existing app backup that can be restored from - /// a blob in Azure storage. Use this to get information about the databases - /// stored in a backup. + /// Description for List deployments for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -12334,10 +12104,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// A RestoreRequest object that includes Azure storage URL and blog name for - /// discovery of backup. - /// /// /// Headers that will be added to request. /// @@ -12359,7 +12125,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DiscoverBackupWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDeploymentsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -12384,14 +12150,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -12409,13 +12167,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DiscoverBackup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeployments", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -12431,7 +12188,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -12462,12 +12219,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -12518,7 +12269,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -12531,7 +12282,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -12551,11 +12302,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Lists ownership identifiers for domain associated with web app. + /// Get a deployment by its ID for an app, or a deployment slot. /// /// - /// Description for Lists ownership identifiers for domain associated with web - /// app. + /// Description for Get a deployment by its ID for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. @@ -12563,6 +12314,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Deployment ID. + /// /// /// Headers that will be added to request. /// @@ -12584,7 +12338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDomainOwnershipIdentifiersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -12609,6 +12363,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -12626,14 +12384,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDeployment", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -12728,7 +12488,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -12741,7 +12501,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -12761,10 +12521,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get domain ownership identifier for web app. + /// Create a deployment for an app, or a deployment slot. /// /// - /// Description for Get domain ownership identifier for web app. + /// Description for Create a deployment for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -12772,8 +12532,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. + /// + /// ID of an existing deployment. + /// + /// + /// Deployment details. /// /// /// Headers that will be added to request. @@ -12796,7 +12559,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Deployment deployment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -12821,9 +12584,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } + if (deployment == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deployment"); } if (Client.SubscriptionId == null) { @@ -12842,16 +12609,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("id", id); + tracingParameters.Add("deployment", deployment); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifier", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateDeployment", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -12865,7 +12633,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -12896,6 +12664,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(deployment != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deployment, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -12946,7 +12720,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -12959,7 +12733,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -12979,12 +12753,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a domain ownership identifier for web app, or updates an existing - /// ownership identifier. + /// Delete a deployment by its ID for an app, or a deployment slot. /// /// - /// Description for Creates a domain ownership identifier for web app, or - /// updates an existing ownership identifier. + /// Description for Delete a deployment by its ID for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. @@ -12992,11 +12765,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. - /// - /// - /// A JSON representation of the domain ownership properties. + /// + /// Deployment ID. /// /// /// Headers that will be added to request. @@ -13007,9 +12777,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -13019,7 +12786,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13044,13 +12811,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } - if (domainOwnershipIdentifier == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (Client.SubscriptionId == null) { @@ -13069,17 +12832,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); - tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); + tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateDomainOwnershipIdentifier", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteDeployment", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -13093,7 +12855,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -13124,12 +12886,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(domainOwnershipIdentifier != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -13150,7 +12906,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -13180,31 +12936,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -13213,10 +12951,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a domain ownership identifier for a web app. + /// List deployment log for specific deployment for an app, or a deployment + /// slot. /// /// - /// Description for Deletes a domain ownership identifier for a web app. + /// Description for List deployment log for specific deployment for an app, or + /// a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -13224,8 +12964,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. + /// + /// The ID of a specific deployment. This is the value of the name property in + /// the JSON response from "GET /api/sites/{siteName}/deployments". /// /// /// Headers that will be added to request. @@ -13236,6 +12977,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -13245,7 +12989,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListDeploymentLogWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13270,9 +13014,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (Client.SubscriptionId == null) { @@ -13291,16 +13035,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteDomainOwnershipIdentifier", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentLog", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -13314,7 +13058,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -13365,7 +13109,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -13395,13 +13139,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -13410,12 +13172,14 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a domain ownership identifier for web app, or updates an existing - /// ownership identifier. + /// Discovers an existing app backup that can be restored from a blob in Azure + /// storage. Use this to get information about the databases stored in a + /// backup. /// /// - /// Description for Creates a domain ownership identifier for web app, or - /// updates an existing ownership identifier. + /// Description for Discovers an existing app backup that can be restored from + /// a blob in Azure storage. Use this to get information about the databases + /// stored in a backup. /// /// /// Name of the resource group to which the resource belongs. @@ -13423,11 +13187,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. - /// - /// - /// A JSON representation of the domain ownership properties. + /// + /// A RestoreRequest object that includes Azure storage URL and blog name for + /// discovery of backup. /// /// /// Headers that will be added to request. @@ -13450,7 +13212,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DiscoverBackupWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13475,13 +13237,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - if (domainOwnershipIdentifier == null) + if (request != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + request.Validate(); } if (Client.SubscriptionId == null) { @@ -13500,17 +13262,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); - tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); + tracingParameters.Add("request", request); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateDomainOwnershipIdentifier", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DiscoverBackup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -13524,7 +13284,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -13555,9 +13315,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(domainOwnershipIdentifier != null) + if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -13611,7 +13371,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -13624,7 +13384,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -13644,16 +13404,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the status of the last MSDeploy operation. + /// Lists ownership identifiers for domain associated with web app. /// /// - /// Description for Get the status of the last MSDeploy operation. + /// Description for Lists ownership identifiers for domain associated with web + /// app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -13676,7 +13437,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMSDeployStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDomainOwnershipIdentifiersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13719,11 +13480,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -13820,7 +13581,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -13833,7 +13594,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -13853,44 +13614,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Get domain ownership identifier for web app. /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Get domain ownership identifier for web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Details of MSDeploy operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateMSDeployOperationWithHttpMessagesAsync(resourceGroupName, name, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Name of the app. /// - /// - /// Name of web app. + /// + /// Name of domain ownership identifier. /// /// /// Headers that will be added to request. @@ -13913,7 +13649,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMSDeployLogWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13938,6 +13674,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainOwnershipIdentifierName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -13955,14 +13695,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployLog", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifier", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14027,7 +13769,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14057,7 +13799,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -14070,7 +13812,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -14090,16 +13832,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the functions for a web site, or a deployment slot. + /// Creates a domain ownership identifier for web app, or updates an existing + /// ownership identifier. /// /// - /// Description for List the functions for a web site, or a deployment slot. + /// Description for Creates a domain ownership identifier for web app, or + /// updates an existing ownership identifier. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// + /// Name of domain ownership identifier. + /// + /// + /// A JSON representation of the domain ownership properties. /// /// /// Headers that will be added to request. @@ -14122,7 +13872,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -14147,6 +13897,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainOwnershipIdentifierName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } + if (domainOwnershipIdentifier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -14164,14 +13922,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateDomainOwnershipIdentifier", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14185,7 +13946,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -14216,6 +13977,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(domainOwnershipIdentifier != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -14236,7 +14003,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14266,7 +14033,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -14279,7 +14046,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -14299,17 +14066,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Fetch a short lived token that can be exchanged for a master key. + /// Deletes a domain ownership identifier for a web app. /// /// - /// Description for Fetch a short lived token that can be exchanged for a - /// master key. + /// Description for Deletes a domain ownership identifier for a web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Name of domain ownership identifier. /// /// /// Headers that will be added to request. @@ -14320,9 +14089,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -14332,7 +14098,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetFunctionsAdminTokenWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -14357,6 +14123,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainOwnershipIdentifierName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -14374,14 +14144,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetFunctionsAdminToken", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteDomainOwnershipIdentifier", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14395,7 +14167,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -14446,7 +14218,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14476,31 +14248,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -14509,20 +14263,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function information by its ID for web site, or a deployment slot. + /// Creates a domain ownership identifier for web app, or updates an existing + /// ownership identifier. /// /// - /// Description for Get function information by its ID for web site, or a - /// deployment slot. + /// Description for Creates a domain ownership identifier for web app, or + /// updates an existing ownership identifier. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Function name. + /// + /// Name of domain ownership identifier. + /// + /// + /// A JSON representation of the domain ownership properties. /// /// /// Headers that will be added to request. @@ -14545,7 +14303,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -14570,9 +14328,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } + if (domainOwnershipIdentifier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); } if (Client.SubscriptionId == null) { @@ -14591,16 +14353,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetFunction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateDomainOwnershipIdentifier", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14614,7 +14377,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -14645,6 +14408,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(domainOwnershipIdentifier != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -14665,7 +14434,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14695,7 +14464,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -14708,7 +14477,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -14728,50 +14497,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create function for web site, or a deployment slot. - /// - /// - /// Description for Create function for web site, or a deployment slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// - /// - /// Function name. - /// - /// - /// Function details. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateFunctionWithHttpMessagesAsync(resourceGroupName, name, functionName, functionEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Delete a function for web site, or a deployment slot. + /// Get the status of the last MSDeploy operation. /// /// - /// Description for Delete a function for web site, or a deployment slot. + /// Description for Get the status of the last MSDeploy operation. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Function name. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -14782,6 +14517,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -14791,7 +14529,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMSDeployStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -14816,10 +14554,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -14837,16 +14571,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteFunction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployStatus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14860,7 +14592,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -14911,7 +14643,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14941,13 +14673,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -14956,25 +14706,44 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Add or update a function secret. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Add or update a function secret. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of web app. /// - /// - /// The name of the function. + /// + /// Details of MSDeploy operation /// - /// - /// The name of the key. + /// + /// The headers that will be added to request. /// - /// - /// The key to create or update + /// + /// The cancellation token. + /// + public async Task> CreateMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateMSDeployOperationWithHttpMessagesAsync(resourceGroupName, name, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. /// /// /// Headers that will be added to request. @@ -14997,7 +14766,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateFunctionSecretWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMSDeployLogWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15022,18 +14791,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (keyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); - } - if (key == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "key"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -15051,19 +14808,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("keyName", keyName); - tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateFunctionSecret", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployLog", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -15077,7 +14829,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15108,12 +14860,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(key != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -15134,7 +14880,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -15164,7 +14910,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -15177,25 +14923,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -15215,10 +14943,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a function secret. + /// List the functions for a web site, or a deployment slot. /// /// - /// Description for Delete a function secret. + /// Description for List the functions for a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -15226,12 +14954,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// The name of the function. - /// - /// - /// The name of the key. - /// /// /// Headers that will be added to request. /// @@ -15241,6 +14963,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -15250,7 +14975,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteFunctionSecretWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15275,14 +15000,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (keyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -15300,18 +15017,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("keyName", keyName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteFunctionSecret", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -15325,7 +15038,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15376,7 +15089,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -15406,13 +15119,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -15421,20 +15152,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function keys for a function in a web site, or a deployment slot. + /// Fetch a short lived token that can be exchanged for a master key. /// /// - /// Description for Get function keys for a function in a web site, or a - /// deployment slot. + /// Description for Fetch a short lived token that can be exchanged for a + /// master key. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Function name. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -15457,7 +15185,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListFunctionKeysWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetFunctionsAdminTokenWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15482,10 +15210,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -15503,16 +15227,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunctionsAdminToken", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -15526,7 +15248,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15607,7 +15329,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -15620,7 +15342,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -15640,10 +15362,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function secrets for a function in a web site, or a deployment slot. + /// Get function information by its ID for web site, or a deployment slot. /// /// - /// Description for Get function secrets for a function in a web site, or a + /// Description for Get function information by its ID for web site, or a /// deployment slot. /// /// @@ -15676,7 +15398,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListFunctionSecretsWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15724,11 +15446,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionSecrets", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); @@ -15745,7 +15467,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15796,7 +15518,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -15826,7 +15548,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -15839,7 +15561,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -15859,10 +15581,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get host secrets for a function app. + /// Create function for web site, or a deployment slot. /// /// - /// Description for Get host secrets for a function app. + /// Description for Create function for web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -15870,6 +15592,40 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// Function name. + /// + /// + /// Function details. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateFunctionWithHttpMessagesAsync(resourceGroupName, name, functionName, functionEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a function for web site, or a deployment slot. + /// + /// + /// Description for Delete a function for web site, or a deployment slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Function name. + /// /// /// Headers that will be added to request. /// @@ -15879,9 +15635,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -15891,7 +15644,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListHostKeysWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15916,6 +15669,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -15933,14 +15690,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteFunction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -15954,7 +15713,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16005,7 +15764,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16035,31 +15794,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -16068,16 +15809,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// This is to allow calling via powershell and ARM template. + /// Add or update a function secret. /// /// - /// Description for This is to allow calling via powershell and ARM template. + /// Description for Add or update a function secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// The name of the function. + /// + /// + /// The name of the key. + /// + /// + /// The key to create or update /// /// /// Headers that will be added to request. @@ -16088,6 +15838,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -16097,7 +15850,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ListSyncStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateFunctionSecretWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16122,6 +15875,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } + if (key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "key"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -16139,14 +15904,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyName", keyName); + tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSyncStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateFunctionSecret", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -16160,7 +15930,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16191,6 +15961,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(key != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -16211,7 +15987,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16241,13 +16017,49 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -16256,16 +16068,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Syncs function trigger metadata to the management database + /// Delete a function secret. /// /// - /// Description for Syncs function trigger metadata to the management database + /// Description for Delete a function secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// The name of the function. + /// + /// + /// The name of the key. /// /// /// Headers that will be added to request. @@ -16285,7 +16103,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteFunctionSecretWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16310,6 +16128,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -16327,14 +16153,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncFunctions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteFunctionSecret", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -16348,7 +16178,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16399,7 +16229,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16444,10 +16274,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Add or update a host level secret. + /// Get function keys for a function in a web site, or a deployment slot. /// /// - /// Description for Add or update a host level secret. + /// Description for Get function keys for a function in a web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -16455,14 +16286,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// The type of host key. - /// - /// - /// The name of the key. - /// - /// - /// The key to create or update + /// + /// Function name. /// /// /// Headers that will be added to request. @@ -16485,7 +16310,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHostSecretWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListFunctionKeysWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16510,17 +16335,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (keyType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); - } - if (keyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); - } - if (key == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "key"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (Client.SubscriptionId == null) { @@ -16539,19 +16356,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("keyType", keyType); - tracingParameters.Add("keyName", keyName); - tracingParameters.Add("key", key); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostSecret", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionKeys", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -16565,7 +16379,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16596,12 +16410,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(key != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -16622,7 +16430,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16652,7 +16460,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -16665,25 +16473,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -16703,10 +16493,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a host level secret. + /// Get function secrets for a function in a web site, or a deployment slot. /// /// - /// Description for Delete a host level secret. + /// Description for Get function secrets for a function in a web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -16714,11 +16505,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// The type of host key. - /// - /// - /// The name of the key. + /// + /// Function name. /// /// /// Headers that will be added to request. @@ -16729,6 +16517,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -16738,7 +16529,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHostSecretWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListFunctionSecretsWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16763,13 +16554,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (keyType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); - } - if (keyName == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (Client.SubscriptionId == null) { @@ -16788,18 +16575,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("keyType", keyType); - tracingParameters.Add("keyName", keyName); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHostSecret", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionSecrets", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -16813,7 +16598,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16864,7 +16649,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16894,13 +16679,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -16909,16 +16712,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get hostname bindings for an app or a deployment slot. + /// Get host secrets for a function app. /// /// - /// Description for Get hostname bindings for an app or a deployment slot. + /// Description for Get host secrets for a function app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// /// /// Headers that will be added to request. @@ -16941,7 +16744,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListHostNameBindingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListHostKeysWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16984,11 +16787,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostKeys", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -17004,7 +16807,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17085,7 +16888,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -17098,7 +16901,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -17118,12 +16921,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the named hostname binding for an app (or deployment slot, if - /// specified). + /// This is to allow calling via powershell and ARM template. /// /// - /// Description for Get the named hostname binding for an app (or deployment - /// slot, if specified). + /// Description for This is to allow calling via powershell and ARM template. /// /// /// Name of the resource group to which the resource belongs. @@ -17131,9 +16932,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Hostname in the hostname binding. - /// /// /// Headers that will be added to request. /// @@ -17143,9 +16941,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -17155,7 +16950,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ListSyncStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -17180,10 +16975,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -17201,16 +16992,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHostNameBinding", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncStatus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17224,7 +17013,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17275,7 +17064,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -17305,31 +17094,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -17338,10 +17109,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a hostname binding for an app. + /// Syncs function trigger metadata to the management database /// /// - /// Description for Creates a hostname binding for an app. + /// Description for Syncs function trigger metadata to the management database /// /// /// Name of the resource group to which the resource belongs. @@ -17349,13 +17120,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Hostname in the hostname binding. - /// - /// - /// Binding details. This is the JSON representation of a HostNameBinding - /// object. - /// /// /// Headers that will be added to request. /// @@ -17365,9 +17129,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -17377,7 +17138,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -17402,14 +17163,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } - if (hostNameBinding == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostNameBinding"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -17427,17 +17180,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostName", hostName); - tracingParameters.Add("hostNameBinding", hostNameBinding); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostNameBinding", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncFunctions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17451,7 +17201,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17482,12 +17232,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(hostNameBinding != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostNameBinding, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -17508,7 +17252,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -17538,31 +17282,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -17571,19 +17297,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a hostname binding for an app. + /// Add or update a host level secret. /// /// - /// Description for Deletes a hostname binding for an app. + /// Description for Add or update a host level secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Hostname in the hostname binding. + /// + /// The type of host key. + /// + /// + /// The name of the key. + /// + /// + /// The key to create or update /// /// /// Headers that will be added to request. @@ -17594,6 +17326,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -17603,7 +17338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHostSecretWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -17628,9 +17363,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostName == null) + if (keyType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } + if (key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "key"); } if (Client.SubscriptionId == null) { @@ -17649,16 +17392,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostName", hostName); + tracingParameters.Add("keyType", keyType); + tracingParameters.Add("keyName", keyName); + tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHostNameBinding", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostSecret", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); + _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17672,7 +17418,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17703,6 +17449,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(key != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -17723,7 +17475,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -17753,13 +17505,49 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -17768,23 +17556,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Retrieves a specific Service Bus Hybrid Connection used by this Web App. + /// Delete a host level secret. /// /// - /// Description for Retrieves a specific Service Bus Hybrid Connection used by - /// this Web App. + /// Description for Delete a host level secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Site name. /// - /// - /// The namespace for this hybrid connection. + /// + /// The type of host key. /// - /// - /// The relay name for this hybrid connection. + /// + /// The name of the key. /// /// /// Headers that will be added to request. @@ -17795,9 +17582,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -17807,7 +17591,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHostSecretWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -17832,13 +17616,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) + if (keyType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); } - if (relayName == null) + if (keyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); } if (Client.SubscriptionId == null) { @@ -17857,18 +17641,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); + tracingParameters.Add("keyType", keyType); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHybridConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHostSecret", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17882,7 +17666,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17933,7 +17717,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -17963,31 +17747,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -17996,25 +17762,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new Hybrid Connection using a Service Bus relay. + /// Get hostname bindings for an app or a deployment slot. /// /// - /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Description for Get hostname bindings for an app or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. - /// - /// - /// The relay name for this hybrid connection. - /// - /// - /// The details of the hybrid connection. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -18037,7 +17794,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListHostNameBindingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18062,18 +17819,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -18091,19 +17836,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHybridConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18117,7 +17857,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -18148,12 +17888,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -18204,7 +17938,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -18217,7 +17951,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -18237,22 +17971,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Removes a Hybrid Connection from this site. + /// Get the named hostname binding for an app (or deployment slot, if + /// specified). /// /// - /// Description for Removes a Hybrid Connection from this site. + /// Description for Get the named hostname binding for an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. + /// Name of the app. /// - /// - /// The relay name for this hybrid connection. + /// + /// Hostname in the hostname binding. /// /// /// Headers that will be added to request. @@ -18263,6 +17996,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -18272,7 +18008,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18297,13 +18033,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); } if (Client.SubscriptionId == null) { @@ -18322,18 +18054,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHybridConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetHostNameBinding", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18347,7 +18077,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -18398,7 +18128,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -18428,13 +18158,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -18443,25 +18191,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new Hybrid Connection using a Service Bus relay. + /// Creates a hostname binding for an app. /// /// - /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Description for Creates a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. + /// Name of the app. /// - /// - /// The relay name for this hybrid connection. + /// + /// Hostname in the hostname binding. /// - /// - /// The details of the hybrid connection. + /// + /// Binding details. This is the JSON representation of a HostNameBinding + /// object. /// /// /// Headers that will be added to request. @@ -18484,7 +18230,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18509,17 +18255,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); } - if (connectionEnvelope == null) + if (hostNameBinding == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostNameBinding"); } if (Client.SubscriptionId == null) { @@ -18538,19 +18280,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("hostName", hostName); + tracingParameters.Add("hostNameBinding", hostNameBinding); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateHybridConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostNameBinding", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18564,7 +18304,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -18595,9 +18335,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) + if(hostNameBinding != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostNameBinding, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -18651,7 +18391,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -18664,7 +18404,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -18684,17 +18424,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Deletes a hostname binding for an app. /// /// - /// Description for Retrieves all Service Bus Hybrid Connections used by this - /// Web App. + /// Description for Deletes a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. + /// + /// + /// Hostname in the hostname binding. /// /// /// Headers that will be added to request. @@ -18705,9 +18447,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -18717,7 +18456,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListHybridConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18742,6 +18481,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (hostName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -18759,14 +18502,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHybridConnections", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHostNameBinding", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18780,7 +18525,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -18831,7 +18576,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -18861,31 +18606,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -18894,18 +18621,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets hybrid connections configured for an app (or deployment slot, if - /// specified). + /// Retrieves a specific Service Bus Hybrid Connection used by this Web App. /// /// - /// Description for Gets hybrid connections configured for an app (or - /// deployment slot, if specified). + /// Description for Retrieves a specific Service Bus Hybrid Connection used by + /// this Web App. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. + /// + /// + /// The namespace for this hybrid connection. + /// + /// + /// The relay name for this hybrid connection. /// /// /// Headers that will be added to request. @@ -18928,7 +18660,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListRelayServiceConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18953,6 +18685,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (namespaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (relayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -18970,14 +18710,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRelayServiceConnections", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetHybridConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19072,7 +18816,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -19085,7 +18829,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -19105,19 +18849,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a hybrid connection configuration by its name. + /// Creates a new Hybrid Connection using a Service Bus relay. /// /// - /// Description for Gets a hybrid connection configuration by its name. + /// Description for Creates a new Hybrid Connection using a Service Bus relay. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of the hybrid connection. + /// + /// The namespace for this hybrid connection. + /// + /// + /// The relay name for this hybrid connection. + /// + /// + /// The details of the hybrid connection. /// /// /// Headers that will be added to request. @@ -19140,7 +18890,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -19165,9 +18915,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (relayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -19186,16 +18944,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetRelayServiceConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHybridConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19209,7 +18970,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -19240,6 +19001,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -19290,7 +19057,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -19303,7 +19070,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -19323,24 +19090,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new hybrid connection configuration (PUT), or updates an existing - /// one (PATCH). + /// Removes a Hybrid Connection from this site. /// /// - /// Description for Creates a new hybrid connection configuration (PUT), or - /// updates an existing one (PATCH). + /// Description for Removes a Hybrid Connection from this site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of the hybrid connection configuration. + /// + /// The namespace for this hybrid connection. /// - /// - /// Details of the hybrid connection configuration. + /// + /// The relay name for this hybrid connection. /// /// /// Headers that will be added to request. @@ -19351,9 +19116,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -19363,7 +19125,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -19388,13 +19150,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (connectionEnvelope == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } if (Client.SubscriptionId == null) { @@ -19413,17 +19175,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateRelayServiceConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHybridConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19437,7 +19200,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -19468,12 +19231,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -19494,7 +19251,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -19524,31 +19281,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -19557,19 +19296,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a relay service connection by its name. + /// Creates a new Hybrid Connection using a Service Bus relay. /// /// - /// Description for Deletes a relay service connection by its name. + /// Description for Creates a new Hybrid Connection using a Service Bus relay. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of the hybrid connection configuration. + /// + /// The namespace for this hybrid connection. + /// + /// + /// The relay name for this hybrid connection. + /// + /// + /// The details of the hybrid connection. /// /// /// Headers that will be added to request. @@ -19580,6 +19325,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -19589,7 +19337,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -19614,9 +19362,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (relayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -19635,16 +19391,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteRelayServiceConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateHybridConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19658,7 +19417,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -19689,6 +19448,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -19709,7 +19474,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -19739,13 +19504,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -19754,24 +19537,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new hybrid connection configuration (PUT), or updates an existing - /// one (PATCH). + /// Retrieves all Service Bus Hybrid Connections used by this Web App. /// /// - /// Description for Creates a new hybrid connection configuration (PUT), or - /// updates an existing one (PATCH). + /// Description for Retrieves all Service Bus Hybrid Connections used by this + /// Web App. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the hybrid connection configuration. - /// - /// - /// Details of the hybrid connection configuration. + /// The name of the web app. /// /// /// Headers that will be added to request. @@ -19794,7 +19570,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListHybridConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -19819,14 +19595,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -19844,17 +19612,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateRelayServiceConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHybridConnections", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19868,7 +19633,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -19899,12 +19664,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -19955,7 +19714,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -19968,7 +19727,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -19988,10 +19747,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Gets hybrid connections configured for an app (or deployment slot, if + /// specified). /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Gets hybrid connections configured for an app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -20020,7 +19781,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceIdentifiersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListRelayServiceConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20063,11 +19824,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListRelayServiceConnections", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -20164,7 +19925,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -20177,7 +19938,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -20197,10 +19958,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Gets a hybrid connection configuration by its name. /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Gets a hybrid connection configuration by its name. /// /// /// Name of the resource group to which the resource belongs. @@ -20208,7 +19969,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// + /// + /// Name of the hybrid connection. /// /// /// Headers that will be added to request. @@ -20231,7 +19993,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceInfoWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20256,9 +20018,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) + if (entityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); } if (Client.SubscriptionId == null) { @@ -20277,16 +20039,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceInfo", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetRelayServiceConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20381,7 +20143,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -20394,7 +20156,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -20414,19 +20176,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the status of the last MSDeploy operation. + /// Creates a new hybrid connection configuration (PUT), or updates an existing + /// one (PATCH). /// /// - /// Description for Get the status of the last MSDeploy operation. + /// Description for Creates a new hybrid connection configuration (PUT), or + /// updates an existing one (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// ID of web app instance. + /// + /// Name of the hybrid connection configuration. + /// + /// + /// Details of the hybrid connection configuration. /// /// /// Headers that will be added to request. @@ -20449,7 +20216,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceMsDeployStatusWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20474,9 +20241,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) + if (entityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -20495,16 +20266,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("entityName", entityName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMsDeployStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateRelayServiceConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20518,7 +20290,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -20549,6 +20321,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -20599,7 +20377,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -20612,7 +20390,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -20632,50 +20410,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. - /// - /// - /// Description for Invoke the MSDeploy web app extension. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// ID of web app instance. - /// - /// - /// Details of MSDeploy operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateInstanceMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateInstanceMSDeployOperationWithHttpMessagesAsync(resourceGroupName, name, instanceId, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the MSDeploy Log for the last MSDeploy operation. + /// Deletes a relay service connection by its name. /// /// - /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Description for Deletes a relay service connection by its name. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// ID of web app instance. + /// + /// Name of the hybrid connection configuration. /// /// /// Headers that will be added to request. @@ -20686,9 +20433,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -20698,7 +20442,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceMSDeployLogWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20723,9 +20467,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) + if (entityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); } if (Client.SubscriptionId == null) { @@ -20744,16 +20488,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMSDeployLog", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteRelayServiceConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20767,7 +20511,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -20848,31 +20592,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -20881,22 +20607,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Creates a new hybrid connection configuration (PUT), or updates an existing + /// one (PATCH). /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Creates a new hybrid connection configuration (PUT), or + /// updates an existing one (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// Name of the hybrid connection configuration. + /// + /// + /// Details of the hybrid connection configuration. /// /// /// Headers that will be added to request. @@ -20919,7 +20647,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessesWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20944,9 +20672,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) + if (entityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -20965,16 +20697,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("entityName", entityName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcesses", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateRelayServiceConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20988,7 +20721,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -21019,6 +20752,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -21039,7 +20778,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -21069,7 +20808,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -21082,7 +20821,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -21102,25 +20841,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Gets all scale-out instances of an app. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Gets all scale-out instances of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. - /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// Name of the app. /// /// /// Headers that will be added to request. @@ -21143,7 +20873,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceIdentifiersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -21168,14 +20898,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -21193,18 +20915,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -21269,7 +20987,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -21299,7 +21017,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -21312,7 +21030,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -21332,25 +21050,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Terminate a process by its ID for a web site, or a deployment slot, or - /// specific scaled-out instance in a web site. + /// Gets all scale-out instances of an app. /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Gets all scale-out instances of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -21361,6 +21072,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -21370,7 +21084,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteInstanceProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceInfoWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -21395,10 +21109,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -21420,17 +21130,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceProcess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceInfo", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -21445,7 +21153,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -21496,7 +21204,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -21526,13 +21234,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -21541,25 +21267,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a memory dump of a process by its ID for a specific scaled-out instance - /// in a web site. + /// Get the status of the last MSDeploy operation. /// /// - /// Description for Get a memory dump of a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Get the status of the last MSDeploy operation. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of web app. /// /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// ID of web app instance. /// /// /// Headers that will be added to request. @@ -21582,7 +21302,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceMsDeployStatusWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -21607,10 +21327,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -21632,17 +21348,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessDump", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMsDeployStatus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -21700,7 +21414,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -21708,7 +21422,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -21738,7 +21452,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -21748,7 +21462,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -21758,25 +21485,50 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of web app. /// - /// - /// PID. + /// + /// ID of web app instance. + /// + /// + /// Details of MSDeploy operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateInstanceMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateInstanceMSDeployOperationWithHttpMessagesAsync(resourceGroupName, name, instanceId, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. /// /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// ID of web app instance. /// /// /// Headers that will be added to request. @@ -21799,7 +21551,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceMSDeployLogWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -21824,10 +21576,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -21849,17 +21597,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModules", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMSDeployLog", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -21955,7 +21701,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -21968,7 +21714,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -21988,12 +21734,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -22001,12 +21747,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// PID. - /// - /// - /// Module base address. - /// /// /// ID of a specific scaled-out instance. This is the value of the name /// property in the JSON response from "GET api/sites/{siteName}/instances". @@ -22032,7 +21772,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessesWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22057,14 +21797,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (baseAddress == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); - } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -22086,19 +21818,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessModule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcesses", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -22194,7 +21922,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -22207,7 +21935,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -22227,12 +21955,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -22268,7 +21996,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22321,11 +22049,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("processId", processId); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreads", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); @@ -22424,7 +22152,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -22437,7 +22165,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -22457,18 +22185,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Shows whether an app can be cloned to another resource group or - /// subscription. + /// Terminate a process by its ID for a web site, or a deployment slot, or + /// specific scaled-out instance in a web site. /// /// - /// Description for Shows whether an app can be cloned to another resource - /// group or subscription. + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -22479,9 +22214,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -22491,7 +22223,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> IsCloneableWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteInstanceProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22516,6 +22248,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -22533,14 +22273,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "IsCloneable", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceProcess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -22554,7 +22298,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -22605,7 +22349,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -22635,31 +22379,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -22668,16 +22394,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Get a memory dump of a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets existing backups of an app. + /// Description for Get a memory dump of a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -22700,7 +22435,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteBackupsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22725,6 +22460,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -22742,14 +22485,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackups", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessDump", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -22763,7 +22510,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -22806,7 +22553,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -22814,7 +22561,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -22844,7 +22591,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -22854,20 +22601,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -22877,16 +22611,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// This is to allow calling via powershell and ARM template. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for This is to allow calling via powershell and ARM template. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -22909,7 +22652,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSyncFunctionTriggersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22934,6 +22677,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -22951,14 +22702,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSyncFunctionTriggers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModules", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -22972,7 +22727,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -23023,7 +22778,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -23053,7 +22808,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -23066,7 +22821,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -23086,78 +22841,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a web app. - /// - /// - /// Description for Restores a web app. - /// - /// - /// Azure subscription. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Migration migrationOptions. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> MigrateStorageWithHttpMessagesAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginMigrateStorageWithHttpMessagesAsync(subscriptionName, resourceGroupName, name, migrationOptions, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrates a local (in-app) MySql database to a remote MySql database. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Migrates a local (in-app) MySql database to a remote MySql - /// database. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// MySql migration options. - /// - /// - /// The headers that will be added to request. + /// Site name. /// - /// - /// The cancellation token. + /// + /// PID. /// - public async Task> MigrateMySqlWithHttpMessagesAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginMigrateMySqlWithHttpMessagesAsync(resourceGroupName, name, migrationRequestEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns the status of MySql in app migration, if one is active, and whether - /// or not MySql in app is enabled - /// - /// - /// Description for Returns the status of MySql in app migration, if one is - /// active, and whether or not MySql in app is enabled - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Module base address. /// - /// - /// Name of web app. + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -23180,7 +22885,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMigrateMySqlStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -23205,6 +22910,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (baseAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -23222,14 +22939,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("baseAddress", baseAddress); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMigrateMySqlStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessModule", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -23294,7 +23017,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -23324,7 +23047,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -23337,7 +23060,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -23357,16 +23080,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a Swift Virtual Network connection. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets a Swift Virtual Network connection. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -23389,7 +23121,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -23414,6 +23146,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -23431,14 +23171,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSwiftVirtualNetworkConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreads", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -23503,7 +23247,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -23533,7 +23277,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -23546,7 +23290,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -23566,17 +23310,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. + /// Shows whether an app can be cloned to another resource group or + /// subscription. /// /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. + /// Description for Shows whether an app can be cloned to another resource + /// group or subscription. /// /// /// Name of the resource group to which the resource belongs. @@ -23584,9 +23323,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Properties of the Virtual Network connection. See example. - /// /// /// Headers that will be added to request. /// @@ -23608,7 +23344,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> IsCloneableWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -23633,10 +23369,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -23654,13 +23386,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateSwiftVirtualNetworkConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "IsCloneable", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -23676,7 +23407,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -23707,12 +23438,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -23763,7 +23488,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -23776,7 +23501,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -23796,12 +23521,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a Swift Virtual Network connection from an app (or deployment - /// slot). + /// Gets existing backups of an app. /// /// - /// Description for Deletes a Swift Virtual Network connection from an app (or - /// deployment slot). + /// Description for Gets existing backups of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -23818,6 +23541,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -23827,7 +23553,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSwiftVirtualNetworkWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteBackupsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -23870,11 +23596,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSwiftVirtualNetwork", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackups", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -23890,7 +23616,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -23941,7 +23667,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -23971,13 +23697,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -23986,17 +23730,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. + /// This is to allow calling via powershell and ARM template. /// /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. + /// Description for This is to allow calling via powershell and ARM template. /// /// /// Name of the resource group to which the resource belongs. @@ -24004,9 +23741,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Properties of the Virtual Network connection. See example. - /// /// /// Headers that will be added to request. /// @@ -24028,7 +23762,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSyncFunctionTriggersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24053,10 +23787,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -24074,13 +23804,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSwiftVirtualNetworkConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncFunctionTriggers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -24096,7 +23825,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -24127,12 +23856,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -24183,7 +23906,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -24196,7 +23919,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -24216,21 +23939,78 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all network features used by the app (or deployment slot, if - /// specified). + /// Restores a web app. /// /// - /// Description for Gets all network features used by the app (or deployment - /// slot, if specified). + /// Description for Restores a web app. /// + /// + /// Azure subscription. + /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// The type of view. This can either be "summary" or "detailed". + /// + /// Migration migrationOptions. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> MigrateStorageWithHttpMessagesAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginMigrateStorageWithHttpMessagesAsync(subscriptionName, resourceGroupName, name, migrationOptions, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Migrates a local (in-app) MySql database to a remote MySql database. + /// + /// + /// Description for Migrates a local (in-app) MySql database to a remote MySql + /// database. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// MySql migration options. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> MigrateMySqlWithHttpMessagesAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginMigrateMySqlWithHttpMessagesAsync(resourceGroupName, name, migrationRequestEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the status of MySql in app migration, if one is active, and whether + /// or not MySql in app is enabled + /// + /// + /// Description for Returns the status of MySql in app migration, if one is + /// active, and whether or not MySql in app is enabled + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. /// /// /// Headers that will be added to request. @@ -24253,7 +24033,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListNetworkFeaturesWithHttpMessagesAsync(string resourceGroupName, string name, string view, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMigrateMySqlStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24278,10 +24058,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (view == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "view"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -24299,16 +24075,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("view", view); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNetworkFeatures", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMigrateMySqlStatus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{view}", System.Uri.EscapeDataString(view)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -24373,7 +24147,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -24403,7 +24177,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -24416,7 +24190,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -24436,12 +24210,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Gets a Swift Virtual Network connection. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Gets a Swift Virtual Network connection. /// /// /// Name of the resource group to which the resource belongs. @@ -24449,9 +24221,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// GUID of the operation. - /// /// /// Headers that will be added to request. /// @@ -24473,7 +24242,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24498,10 +24267,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -24519,16 +24284,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSwiftVirtualNetworkConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -24593,7 +24356,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -24623,7 +24386,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -24636,25 +24399,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -24674,26 +24419,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site (To be deprecated). + /// Deletes a Swift Virtual Network connection from an app (or deployment + /// slot). /// /// - /// Description for Start capturing network packets for the site (To be - /// deprecated). + /// Description for Deletes a Swift Virtual Network connection from an app (or + /// deployment slot). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -24704,9 +24441,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -24716,7 +24450,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> StartWebSiteNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSwiftVirtualNetworkWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24758,31 +24492,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartWebSiteNetworkTrace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSwiftVirtualNetwork", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -24794,7 +24513,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -24845,7 +24564,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -24875,31 +24594,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -24908,50 +24609,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Gets all network features used by the app (or deployment slot, if + /// specified). /// /// - /// Description for Start capturing network packets for the site. + /// Description for Gets all network features used by the app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> StartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stop ongoing capturing network packets for the site. - /// - /// - /// Description for Stop ongoing capturing network packets for the site. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Name of the app. /// - /// - /// The name of the web app. + /// + /// The type of view. Only "summary" is supported at this time. /// /// /// Headers that will be added to request. @@ -24962,6 +24634,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -24971,7 +24646,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopWebSiteNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListNetworkFeaturesWithHttpMessagesAsync(string resourceGroupName, string name, string view, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24996,6 +24671,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (view == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "view"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -25013,14 +24692,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("view", view); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopWebSiteNetworkTrace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNetworkFeatures", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{view}", System.Uri.EscapeDataString(view)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -25034,7 +24715,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -25085,7 +24766,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25115,13 +24796,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -25167,7 +24866,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTracesWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -25215,11 +24914,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraces", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); @@ -25287,7 +24986,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25342,6 +25041,24 @@ internal WebAppsOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -25350,21 +25067,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Start capturing network packets for the site (To be deprecated). /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Start capturing network packets for the site (To be + /// deprecated). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// GUID of the operation. + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. /// /// /// Headers that will be added to request. @@ -25387,7 +25109,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTraceOperationV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> StartWebSiteNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -25412,10 +25134,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -25433,18 +25151,31 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationV2", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartWebSiteNetworkTrace", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -25456,7 +25187,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -25507,7 +25238,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25537,7 +25268,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -25550,25 +25281,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -25588,21 +25301,50 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Start capturing network packets for the site. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// GUID of the operation. + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> StartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stop ongoing capturing network packets for the site. + /// + /// + /// Description for Stop ongoing capturing network packets for the site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. /// /// /// Headers that will be added to request. @@ -25613,9 +25355,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -25625,7 +25364,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTracesV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopWebSiteNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -25650,10 +25389,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -25671,16 +25406,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesV2", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopWebSiteNetworkTrace", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -25694,7 +25427,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -25745,7 +25478,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25775,31 +25508,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -25808,11 +25523,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Generates a new publishing password for an app (or deployment slot, if - /// specified). + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Generates a new publishing password for an app (or + /// Description for Gets a named operation for a network trace capturing (or /// deployment slot, if specified). /// /// @@ -25821,6 +25536,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// GUID of the operation. + /// /// /// Headers that will be added to request. /// @@ -25830,6 +25548,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -25839,7 +25560,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task GenerateNewSitePublishingPasswordWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTracesWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -25864,6 +25585,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -25881,14 +25606,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GenerateNewSitePublishingPassword", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraces", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -25902,7 +25629,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -25953,7 +25680,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25983,13 +25710,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -25998,22 +25743,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets perfmon counters for web app. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Gets perfmon counters for web app. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Return only usages/metrics specified in the filter. Filter conforms to - /// odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and - /// endTime eq 2014-12-31T23:59:59Z and timeGrain eq - /// duration'[Hour|Minute|Day]'. + /// + /// GUID of the operation. /// /// /// Headers that will be added to request. @@ -26036,7 +25780,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPerfMonCountersWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTraceOperationV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26061,6 +25805,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -26078,21 +25826,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("filter", filter); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCounters", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationV2", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -26155,7 +25900,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -26185,7 +25930,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -26198,7 +25943,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -26218,16 +25981,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets web app's event logs. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Gets web app's event logs. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// GUID of the operation. /// /// /// Headers that will be added to request. @@ -26250,7 +26018,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSitePhpErrorLogFlagWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTracesV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26275,6 +26043,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -26292,14 +26064,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSitePhpErrorLogFlag", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesV2", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -26394,7 +26168,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -26407,7 +26181,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -26427,10 +26201,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the premier add-ons of an app. + /// Generates a new publishing password for an app (or deployment slot, if + /// specified). /// /// - /// Description for Gets the premier add-ons of an app. + /// Description for Generates a new publishing password for an app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -26447,9 +26223,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -26459,7 +26232,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListPremierAddOnsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task GenerateNewSitePublishingPasswordWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26502,11 +26275,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPremierAddOns", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GenerateNewSitePublishingPassword", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -26522,7 +26295,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -26573,7 +26346,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -26603,31 +26376,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -26636,19 +26391,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named add-on of an app. + /// Gets perfmon counters for web app. /// /// - /// Description for Gets a named add-on of an app. + /// Description for Gets perfmon counters for web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// Add-on name. + /// + /// Return only usages/metrics specified in the filter. Filter conforms to + /// odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and + /// endTime eq 2014-12-31T23:59:59Z and timeGrain eq + /// duration'[Hour|Minute|Day]'. /// /// /// Headers that will be added to request. @@ -26671,7 +26429,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPerfMonCountersWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26696,10 +26454,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -26717,18 +26471,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPremierAddOn", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCounters", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -26821,7 +26578,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -26834,7 +26591,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -26854,22 +26611,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates a named add-on of an app. + /// Gets web app's event logs. /// /// - /// Description for Updates a named add-on of an app. + /// Description for Gets web app's event logs. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Add-on name. - /// - /// - /// A JSON representation of the edited premier add-on. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -26892,7 +26643,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddPremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSitePhpErrorLogFlagWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26917,18 +26668,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } - if (premierAddOn == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); - } - if (premierAddOn != null) - { - premierAddOn.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -26946,17 +26685,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); - tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddPremierAddOn", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSitePhpErrorLogFlag", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -26970,7 +26706,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27001,12 +26737,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(premierAddOn != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -27057,7 +26787,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -27070,7 +26800,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -27090,10 +26820,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a premier add-on from an app. + /// Gets the premier add-ons of an app. /// /// - /// Description for Delete a premier add-on from an app. + /// Description for Gets the premier add-ons of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -27101,9 +26831,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Add-on name. - /// /// /// Headers that will be added to request. /// @@ -27113,6 +26840,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -27122,7 +26852,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeletePremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPremierAddOnsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27147,10 +26877,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -27168,16 +26894,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeletePremierAddOn", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPremierAddOns", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -27191,7 +26915,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27272,13 +26996,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -27287,10 +27029,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates a named add-on of an app. + /// Gets a named add-on of an app. /// /// - /// Description for Updates a named add-on of an app. + /// Description for Gets a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -27301,9 +27043,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Add-on name. /// - /// - /// A JSON representation of the edited premier add-on. - /// /// /// Headers that will be added to request. /// @@ -27325,7 +27064,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdatePremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27354,10 +27093,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); } - if (premierAddOn == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -27376,9 +27111,8 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("premierAddOnName", premierAddOnName); - tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdatePremierAddOn", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPremierAddOn", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -27399,7 +27133,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27430,12 +27164,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(premierAddOn != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -27519,18 +27247,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Updates a named add-on of an app. /// /// - /// Description for Gets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Updates a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. + /// + /// + /// Add-on name. + /// + /// + /// A JSON representation of the edited premier add-on. /// /// /// Headers that will be added to request. @@ -27553,7 +27285,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateAccessWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AddPremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27578,6 +27310,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (premierAddOnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } + if (premierAddOn == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); + } + if (premierAddOn != null) + { + premierAddOn.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -27595,14 +27339,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateAccess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddPremierAddOn", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -27616,7 +27363,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27647,6 +27394,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(premierAddOn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -27697,7 +27450,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -27710,7 +27463,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -27730,21 +27483,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Sets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Delete a premier add-on from an app. /// /// - /// Description for Sets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Delete a premier add-on from an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. /// - /// - /// The information for the private access + /// + /// Add-on name. /// /// /// Headers that will be added to request. @@ -27755,9 +27506,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -27767,7 +27515,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PutPrivateAccessVnetWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeletePremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27792,9 +27540,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (access == null) + if (premierAddOnName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "access"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); } if (Client.SubscriptionId == null) { @@ -27813,15 +27561,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("access", access); + tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PutPrivateAccessVnet", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeletePremierAddOn", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -27835,7 +27584,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27866,12 +27615,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(access != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(access, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -27922,31 +27665,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -27955,18 +27680,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Updates a named add-on of an app. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Updates a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// + /// Add-on name. + /// + /// + /// A JSON representation of the edited premier add-on. /// /// /// Headers that will be added to request. @@ -27989,7 +27718,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdatePremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28014,6 +27743,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (premierAddOnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } + if (premierAddOn == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -28031,14 +27768,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcesses", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdatePremierAddOn", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28052,7 +27792,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -28083,6 +27823,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(premierAddOn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -28103,7 +27849,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28133,7 +27879,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -28146,7 +27892,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -28166,21 +27912,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Gets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Gets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// The name of the web app. /// /// /// Headers that will be added to request. @@ -28203,7 +27946,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateAccessWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28228,10 +27971,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -28249,16 +27988,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateAccess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28323,7 +28060,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28353,7 +28090,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -28366,7 +28103,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -28386,21 +28123,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Terminate a process by its ID for a web site, or a deployment slot, or - /// specific scaled-out instance in a web site. + /// Sets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Sets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// PID. + /// + /// The information for the private access /// /// /// Headers that will be added to request. @@ -28411,6 +28148,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -28420,7 +28160,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PutPrivateAccessVnetWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28445,9 +28185,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (access == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "access"); } if (Client.SubscriptionId == null) { @@ -28466,16 +28206,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("access", access); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteProcess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "PutPrivateAccessVnet", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28489,7 +28228,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -28520,6 +28259,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(access != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(access, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -28540,7 +28285,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28570,13 +28315,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -28585,21 +28348,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a memory dump of a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Get a memory dump of a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the site. /// /// /// Headers that will be added to request. @@ -28622,7 +28381,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28647,10 +28406,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -28668,16 +28423,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessDump", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionList", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28734,7 +28487,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -28742,7 +28495,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28772,7 +28525,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -28782,7 +28535,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -28792,21 +28558,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Gets a private endpoint connection /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Gets a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. /// - /// - /// PID. + /// + /// Name of the private endpoint connection. /// /// /// Headers that will be added to request. @@ -28829,7 +28593,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28854,9 +28618,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } if (Client.SubscriptionId == null) { @@ -28875,16 +28639,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessModules", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28949,7 +28713,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28979,7 +28743,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -28992,7 +28756,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -29012,24 +28776,72 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Approves or rejects a private endpoint connection /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. /// - /// - /// PID. + /// /// - /// - /// Module base address. + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. /// /// /// Headers that will be added to request. @@ -29052,7 +28864,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29077,14 +28889,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (baseAddress == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -29102,18 +28906,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessModule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -29178,7 +28978,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -29208,7 +29008,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -29221,7 +29021,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -29241,12 +29041,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -29254,9 +29054,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// PID. - /// /// /// Headers that will be added to request. /// @@ -29278,7 +29075,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29303,10 +29100,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -29324,16 +29117,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreads", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcesses", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -29428,7 +29219,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -29441,7 +29232,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -29461,16 +29252,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get public certificates for an app or a deployment slot. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Get public certificates for an app or a deployment slot. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. /// /// /// Headers that will be added to request. @@ -29493,7 +29289,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublicCertificatesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29518,6 +29314,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -29535,14 +29335,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificates", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -29607,7 +29409,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -29637,7 +29439,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -29650,7 +29452,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -29670,21 +29472,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the named public certificate for an app (or deployment slot, if - /// specified). + /// Terminate a process by its ID for a web site, or a deployment slot, or + /// specific scaled-out instance in a web site. /// /// - /// Description for Get the named public certificate for an app (or deployment - /// slot, if specified). + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Public certificate name. + /// + /// PID. /// /// /// Headers that will be added to request. @@ -29695,9 +29497,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -29707,7 +29506,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29732,9 +29531,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publicCertificateName == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (Client.SubscriptionId == null) { @@ -29753,16 +29552,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publicCertificateName", publicCertificateName); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPublicCertificate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteProcess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -29776,7 +29575,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -29827,7 +29626,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -29857,31 +29656,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -29890,23 +29671,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a hostname binding for an app. + /// Get a memory dump of a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Creates a hostname binding for an app. + /// Description for Get a memory dump of a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Public certificate name. + /// Site name. /// - /// - /// Public certificate details. This is the JSON representation of a - /// PublicCertificate object. + /// + /// PID. /// /// /// Headers that will be added to request. @@ -29929,7 +29708,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdatePublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29954,13 +29733,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publicCertificateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); - } - if (publicCertificate == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificate"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (Client.SubscriptionId == null) { @@ -29979,17 +29754,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publicCertificateName", publicCertificateName); - tracingParameters.Add("publicCertificate", publicCertificate); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdatePublicCertificate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessDump", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -30003,7 +29777,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30034,12 +29808,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(publicCertificate != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publicCertificate, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -30052,7 +29820,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -30060,7 +29828,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30090,7 +29858,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -30100,20 +29868,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -30123,19 +29878,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a hostname binding for an app. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Deletes a hostname binding for an app. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Public certificate name. + /// + /// PID. /// /// /// Headers that will be added to request. @@ -30146,6 +29903,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -30155,7 +29915,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeletePublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -30180,9 +29940,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publicCertificateName == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (Client.SubscriptionId == null) { @@ -30201,16 +29961,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publicCertificateName", publicCertificateName); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeletePublicCertificate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessModules", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -30224,7 +29984,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30275,7 +30035,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30305,13 +30065,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -30320,21 +30098,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the publishing profile for an app (or deployment slot, if specified). + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Gets the publishing profile for an app (or deployment slot, - /// if specified). + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Specifies publishingProfileOptions for publishing profile. For example, use - /// {"format": "FileZilla3"} to get a FileZilla publishing profile. + /// + /// PID. + /// + /// + /// Module base address. /// /// /// Headers that will be added to request. @@ -30357,7 +30138,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListPublishingProfileXmlWithSecretsWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -30382,9 +30163,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publishingProfileOptions == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publishingProfileOptions"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (baseAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); } if (Client.SubscriptionId == null) { @@ -30403,15 +30188,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publishingProfileOptions", publishingProfileOptions); + tracingParameters.Add("processId", processId); + tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublishingProfileXmlWithSecrets", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessModule", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -30425,7 +30213,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30456,12 +30244,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(publishingProfileOptions != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publishingProfileOptions, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -30474,7 +30256,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -30482,7 +30264,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30512,7 +30294,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -30522,7 +30304,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -30532,18 +30327,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Resets the configuration settings of the current slot if they were - /// previously modified by calling the API with POST. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Resets the configuration settings of the current slot if - /// they were previously modified by calling the API with POST. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. /// /// /// Headers that will be added to request. @@ -30554,6 +30352,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -30563,7 +30364,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ResetProductionSlotConfigWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -30588,6 +30389,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -30605,14 +30410,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ResetProductionSlotConfig", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreads", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -30626,7 +30433,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30677,7 +30484,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30707,13 +30514,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -30722,10 +30547,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restarts an app (or deployment slot, if specified). + /// Get public certificates for an app or a deployment slot. /// /// - /// Description for Restarts an app (or deployment slot, if specified). + /// Description for Get public certificates for an app or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -30733,14 +30558,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Specify true to apply the configuration settings and restarts the app only - /// if necessary. By default, the API always restarts and reprovisions the app. - /// - /// - /// Specify true to block until the app is restarted. By default, it is set to - /// false, and the API responds immediately (asynchronous). - /// /// /// Headers that will be added to request. /// @@ -30750,6 +30567,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -30759,7 +30579,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string name, bool? softRestart = default(bool?), bool? synchronous = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPublicCertificatesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -30801,26 +30621,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("softRestart", softRestart); - tracingParameters.Add("synchronous", synchronous); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Restart", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificates", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (softRestart != null) - { - _queryParameters.Add(string.Format("softRestart={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softRestart, Client.SerializationSettings).Trim('"')))); - } - if (synchronous != null) - { - _queryParameters.Add(string.Format("synchronous={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(synchronous, Client.SerializationSettings).Trim('"')))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -30832,7 +30642,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30913,13 +30723,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -30928,10 +30756,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores an app from a backup blob in Azure Storage. + /// Get the named public certificate for an app (or deployment slot, if + /// specified). /// /// - /// Description for Restores an app from a backup blob in Azure Storage. + /// Description for Get the named public certificate for an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -30939,91 +30769,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Information on restore request . - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreFromBackupBlobWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreFromBackupBlobWithHttpMessagesAsync(resourceGroupName, name, request, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Restores a deleted web app to this web app. - /// - /// - /// Description for Restores a deleted web app to this web app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Deleted web app restore information. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreFromDeletedAppWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreFromDeletedAppWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Restores a web app from a snapshot. - /// - /// - /// Description for Restores a web app from a snapshot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Snapshot restore settings. Snapshot information can be obtained by calling - /// GetDeletedSites or GetSiteSnapshots API. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreSnapshotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get list of siteextensions for a web site, or a deployment slot. - /// - /// - /// Description for Get list of siteextensions for a web site, or a deployment - /// slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. + /// + /// Public certificate name. /// /// /// Headers that will be added to request. @@ -31046,7 +30793,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteExtensionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31071,6 +30818,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (publicCertificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -31088,14 +30839,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPublicCertificate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -31160,7 +30913,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -31190,7 +30943,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -31203,7 +30956,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -31223,21 +30976,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get site extension information by its ID for a web site, or a deployment - /// slot. + /// Creates a hostname binding for an app. /// /// - /// Description for Get site extension information by its ID for a web site, or - /// a deployment slot. + /// Description for Creates a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Site extension name. + /// + /// Public certificate name. + /// + /// + /// Public certificate details. This is the JSON representation of a + /// PublicCertificate object. /// /// /// Headers that will be added to request. @@ -31260,7 +31015,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdatePublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31285,9 +31040,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) + if (publicCertificateName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } + if (publicCertificate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificate"); } if (Client.SubscriptionId == null) { @@ -31306,16 +31065,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("publicCertificateName", publicCertificateName); + tracingParameters.Add("publicCertificate", publicCertificate); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSiteExtension", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdatePublicCertificate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -31329,7 +31089,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -31360,6 +31120,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(publicCertificate != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publicCertificate, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -31380,7 +31146,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -31410,7 +31176,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -31423,7 +31189,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -31443,48 +31209,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Install site extension on a web site, or a deployment slot. - /// - /// - /// Description for Install site extension on a web site, or a deployment slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// - /// - /// Site extension name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> InstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginInstallSiteExtensionWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Remove a site extension from a web site, or a deployment slot. + /// Deletes a hostname binding for an app. /// /// - /// Description for Remove a site extension from a web site, or a deployment - /// slot. + /// Description for Deletes a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Site extension name. + /// + /// Public certificate name. /// /// /// Headers that will be added to request. @@ -31504,7 +31241,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeletePublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31529,9 +31266,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) + if (publicCertificateName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); } if (Client.SubscriptionId == null) { @@ -31550,16 +31287,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSiteExtension", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeletePublicCertificate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -31624,7 +31361,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -31669,11 +31406,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Copies a deployment slot to another deployment slot of an app. + /// Gets the publishing profile for an app (or deployment slot, if specified). /// /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. + /// Description for Gets the publishing profile for an app (or deployment slot, + /// if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -31681,34 +31418,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task CopyProductionSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginCopyProductionSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets an app's deployment slots. - /// - /// - /// Description for Gets an app's deployment slots. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. + /// + /// Specifies publishingProfileOptions for publishing profile. For example, use + /// {"format": "FileZilla3"} to get a FileZilla publishing profile. /// /// /// Headers that will be added to request. @@ -31731,7 +31443,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSlotsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPublishingProfileXmlWithSecretsWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31756,6 +31468,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (publishingProfileOptions == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publishingProfileOptions"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -31773,12 +31489,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("publishingProfileOptions", publishingProfileOptions); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlots", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublishingProfileXmlWithSecrets", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -31794,7 +31511,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -31825,6 +31542,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(publishingProfileOptions != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publishingProfileOptions, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -31837,7 +31560,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -31875,7 +31598,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -31885,20 +31608,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -31908,10 +31618,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the details of a web, mobile, or API app. + /// Resets the configuration settings of the current slot if they were + /// previously modified by calling the API with POST. /// /// - /// Description for Gets the details of a web, mobile, or API app. + /// Description for Resets the configuration settings of the current slot if + /// they were previously modified by calling the API with POST. /// /// /// Name of the resource group to which the resource belongs. @@ -31919,10 +31631,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the deployment slot. By default, this API returns the production - /// slot. - /// /// /// Headers that will be added to request. /// @@ -31932,9 +31640,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -31944,7 +31649,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ResetProductionSlotConfigWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31969,10 +31674,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -31990,16 +31691,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ResetProductionSlotConfig", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -32013,7 +31712,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -32064,7 +31763,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -32094,31 +31793,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -32127,64 +31808,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new web, mobile, or API app in an existing resource group, or - /// updates an existing app. - /// - /// - /// Description for Creates a new web, mobile, or API app in an existing - /// resource group, or updates an existing app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Unique name of the app to create or update. To create or update a - /// deployment slot, use the {slot} parameter. - /// - /// - /// A JSON representation of the app properties. See example. - /// - /// - /// Name of the deployment slot to create or update. By default, this API - /// attempts to create or modify the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateSlotWithHttpMessagesAsync(resourceGroupName, name, siteEnvelope, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a web, mobile, or API app, or one of the deployment slots. + /// Restarts an app (or deployment slot, if specified). /// /// - /// Description for Deletes a web, mobile, or API app, or one of the deployment - /// slots. + /// Description for Restarts an app (or deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app to delete. - /// - /// - /// Name of the deployment slot to delete. By default, the API deletes the - /// production slot. + /// Name of the app. /// - /// - /// If true, web app metrics are also deleted. + /// + /// Specify true to apply the configuration settings and restarts the app only + /// if necessary. By default, the API always restarts and reprovisions the app. /// - /// - /// Specify true if the App Service plan will be empty after app deletion and - /// you want to delete the empty App Service plan. By default, the empty App - /// Service plan is not deleted. + /// + /// Specify true to block until the app is restarted. By default, it is set to + /// false, and the API responds immediately (asynchronous). /// /// /// Headers that will be added to request. @@ -32204,7 +31845,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, bool? deleteMetrics = default(bool?), bool? deleteEmptyServerFarm = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string name, bool? softRestart = default(bool?), bool? synchronous = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -32229,10 +31870,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -32250,27 +31887,25 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("deleteMetrics", deleteMetrics); - tracingParameters.Add("deleteEmptyServerFarm", deleteEmptyServerFarm); + tracingParameters.Add("softRestart", softRestart); + tracingParameters.Add("synchronous", synchronous); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Restart", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (deleteMetrics != null) + if (softRestart != null) { - _queryParameters.Add(string.Format("deleteMetrics={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteMetrics, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("softRestart={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softRestart, Client.SerializationSettings).Trim('"')))); } - if (deleteEmptyServerFarm != null) + if (synchronous != null) { - _queryParameters.Add(string.Format("deleteEmptyServerFarm={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteEmptyServerFarm, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("synchronous={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(synchronous, Client.SerializationSettings).Trim('"')))); } if (Client.ApiVersion != null) { @@ -32283,7 +31918,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -32334,7 +31969,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -32379,26 +32014,102 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new web, mobile, or API app in an existing resource group, or - /// updates an existing app. + /// Restores an app from a backup blob in Azure Storage. /// /// - /// Description for Creates a new web, mobile, or API app in an existing - /// resource group, or updates an existing app. + /// Description for Restores an app from a backup blob in Azure Storage. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Unique name of the app to create or update. To create or update a - /// deployment slot, use the {slot} parameter. + /// Name of the app. /// - /// - /// A JSON representation of the app properties. See example. + /// + /// Information on restore request . /// - /// - /// Name of the deployment slot to create or update. By default, this API - /// attempts to create or modify the production slot. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFromBackupBlobWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFromBackupBlobWithHttpMessagesAsync(resourceGroupName, name, request, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores a deleted web app to this web app. + /// + /// + /// Description for Restores a deleted web app to this web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Deleted web app restore information. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFromDeletedAppWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFromDeletedAppWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores a web app from a snapshot. + /// + /// + /// Description for Restores a web app from a snapshot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Snapshot restore settings. Snapshot information can be obtained by calling + /// GetDeletedSites or GetSiteSnapshots API. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreSnapshotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get list of siteextensions for a web site, or a deployment slot. + /// + /// + /// Description for Get list of siteextensions for a web site, or a deployment + /// slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. /// /// /// Headers that will be added to request. @@ -32421,7 +32132,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, SitePatchResource siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteExtensionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -32446,14 +32157,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -32471,17 +32174,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteEnvelope", siteEnvelope); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -32495,7 +32195,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -32526,12 +32226,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -32552,7 +32246,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -32582,7 +32276,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -32595,25 +32289,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -32633,23 +32309,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Analyze a custom hostname. + /// Get site extension information by its ID for a web site, or a deployment + /// slot. /// /// - /// Description for Analyze a custom hostname. + /// Description for Get site extension information by its ID for a web site, or + /// a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Site name. /// - /// - /// Custom hostname. + /// + /// Site extension name. /// /// /// Headers that will be added to request. @@ -32672,7 +32346,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AnalyzeCustomHostnameSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -32697,9 +32371,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (Client.SubscriptionId == null) { @@ -32718,23 +32392,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("hostName", hostName); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AnalyzeCustomHostnameSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteExtension", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (hostName != null) - { - _queryParameters.Add(string.Format("hostName={0}", System.Uri.EscapeDataString(hostName))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -32797,7 +32466,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -32827,7 +32496,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -32840,7 +32509,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -32860,25 +32529,48 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Applies the configuration settings from the target slot onto the current - /// slot. + /// Install site extension on a web site, or a deployment slot. /// /// - /// Description for Applies the configuration settings from the target slot - /// onto the current slot. + /// Description for Install site extension on a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// JSON object that contains the target slot name. See example. + /// + /// Site extension name. /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> InstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginInstallSiteExtensionWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Remove a site extension from a web site, or a deployment slot. + /// + /// + /// Description for Remove a site extension from a web site, or a deployment + /// slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Site extension name. /// /// /// Headers that will be added to request. @@ -32898,7 +32590,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ApplySlotConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -32923,17 +32615,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); - } - if (slotSwapEntity != null) - { - slotSwapEntity.Validate(); - } - if (slot == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (Client.SubscriptionId == null) { @@ -32952,17 +32636,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); - tracingParameters.Add("slot", slot); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ApplySlotConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSiteExtension", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -32976,7 +32659,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -33007,12 +32690,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -33033,7 +32710,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -33078,10 +32755,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a backup of an app. + /// Gets an app's deployment slots. /// /// - /// Description for Creates a backup of an app. + /// Description for Gets an app's deployment slots. /// /// /// Name of the resource group to which the resource belongs. @@ -33089,14 +32766,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Backup configuration. You can use the JSON response from the POST action as - /// input here. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// create a backup for the production slot. - /// /// /// Headers that will be added to request. /// @@ -33118,7 +32787,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSlotsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33143,18 +32812,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -33172,17 +32829,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BackupSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlots", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -33196,7 +32850,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -33227,12 +32881,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -33283,7 +32931,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -33296,7 +32944,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -33316,10 +32964,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Gets the details of a web, mobile, or API app. /// /// - /// Description for Gets existing backups of an app. + /// Description for Gets the details of a web, mobile, or API app. /// /// /// Name of the resource group to which the resource belongs. @@ -33328,8 +32976,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// backups of the production slot. + /// Name of the deployment slot. By default, this API returns the production + /// slot. /// /// /// Headers that will be added to request. @@ -33352,7 +33000,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBackupsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33400,11 +33048,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBackupsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -33472,7 +33120,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -33502,7 +33150,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -33515,7 +33163,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -33535,23 +33183,63 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a backup of an app by its ID. + /// Creates a new web, mobile, or API app in an existing resource group, or + /// updates an existing app. /// /// - /// Description for Gets a backup of an app by its ID. + /// Description for Creates a new web, mobile, or API app in an existing + /// resource group, or updates an existing app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Unique name of the app to create or update. To create or update a + /// deployment slot, use the {slot} parameter. /// - /// - /// ID of the backup. + /// + /// A JSON representation of the app properties. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get a - /// backup of the production slot. + /// Name of the deployment slot to create or update. By default, this API + /// attempts to create or modify the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateSlotWithHttpMessagesAsync(resourceGroupName, name, siteEnvelope, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a web, mobile, or API app, or one of the deployment slots. + /// + /// + /// Description for Deletes a web, mobile, or API app, or one of the deployment + /// slots. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app to delete. + /// + /// + /// Name of the deployment slot to delete. By default, the API deletes the + /// production slot. + /// + /// + /// If true, web app metrics are also deleted. + /// + /// + /// Specify false if you want to keep empty App Service plan. By default, empty + /// App Service plan is deleted. /// /// /// Headers that will be added to request. @@ -33562,9 +33250,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -33574,7 +33259,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetBackupStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, bool? deleteMetrics = default(bool?), bool? deleteEmptyServerFarm = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33599,10 +33284,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -33624,20 +33305,28 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); tracingParameters.Add("slot", slot); + tracingParameters.Add("deleteMetrics", deleteMetrics); + tracingParameters.Add("deleteEmptyServerFarm", deleteEmptyServerFarm); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetBackupStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (deleteMetrics != null) + { + _queryParameters.Add(string.Format("deleteMetrics={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteMetrics, Client.SerializationSettings).Trim('"')))); + } + if (deleteEmptyServerFarm != null) + { + _queryParameters.Add(string.Format("deleteEmptyServerFarm={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteEmptyServerFarm, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -33649,7 +33338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -33700,7 +33389,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -33730,31 +33419,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -33763,23 +33434,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a backup of an app by its ID. + /// Creates a new web, mobile, or API app in an existing resource group, or + /// updates an existing app. /// /// - /// Description for Deletes a backup of an app by its ID. + /// Description for Creates a new web, mobile, or API app in an existing + /// resource group, or updates an existing app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Unique name of the app to create or update. To create or update a + /// deployment slot, use the {slot} parameter. /// - /// - /// ID of the backup. + /// + /// A JSON representation of the app properties. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete a backup of the production slot. + /// Name of the deployment slot to create or update. By default, this API + /// attempts to create or modify the production slot. /// /// /// Headers that will be added to request. @@ -33790,6 +33464,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -33799,7 +33476,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteBackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, SitePatchResource siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33824,9 +33501,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) + if (siteEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); } if (slot == null) { @@ -33849,17 +33526,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); + tracingParameters.Add("siteEnvelope", siteEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteBackupSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -33874,7 +33550,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -33905,6 +33581,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -33925,7 +33607,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -33955,13 +33637,49 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -33970,16 +33688,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets status of a web app backup that may be in progress, including secrets - /// associated with the backup, such as the Azure Storage SAS URL. Also can be - /// used to update the SAS URL for the backup if a new URL is passed in the - /// request body. + /// Analyze a custom hostname. /// /// - /// Description for Gets status of a web app backup that may be in progress, - /// including secrets associated with the backup, such as the Azure Storage SAS - /// URL. Also can be used to update the SAS URL for the backup if a new URL is - /// passed in the request body. + /// Description for Analyze a custom hostname. /// /// /// Name of the resource group to which the resource belongs. @@ -33987,16 +33699,13 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of web app. /// - /// - /// ID of backup. - /// - /// - /// Information on backup request. - /// /// /// Name of web app slot. If not specified then will default to production /// slot. /// + /// + /// Custom hostname. + /// /// /// Headers that will be added to request. /// @@ -34018,7 +33727,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListBackupStatusSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AnalyzeCustomHostnameSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34043,18 +33752,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); - } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -34076,21 +33773,23 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); - tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBackupStatusSecretsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AnalyzeCustomHostnameSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (hostName != null) + { + _queryParameters.Add(string.Format("hostName={0}", System.Uri.EscapeDataString(hostName))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -34102,7 +33801,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -34133,12 +33832,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -34189,7 +33882,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -34202,7 +33895,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -34222,12 +33915,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a specific backup to another app (or deployment slot, if - /// specified). + /// Applies the configuration settings from the target slot onto the current + /// slot. /// /// - /// Description for Restores a specific backup to another app (or deployment - /// slot, if specified). + /// Description for Applies the configuration settings from the target slot + /// onto the current slot. /// /// /// Name of the resource group to which the resource belongs. @@ -34235,44 +33928,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// ID of the backup. - /// - /// - /// Information on restore request . - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restore a backup of the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreSlotWithHttpMessagesAsync(resourceGroupName, name, backupId, request, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// List the configurations of an app - /// - /// - /// Description for List the configurations of an app - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. + /// + /// JSON object that contains the target slot name. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. /// /// /// Headers that will be added to request. @@ -34283,9 +33944,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -34295,7 +33953,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ApplySlotConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34320,6 +33978,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slotSwapEntity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -34341,13 +34007,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ApplySlotConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -34364,7 +34031,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -34395,6 +34062,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -34445,31 +34118,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -34478,10 +34133,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the application settings of an app. + /// Creates a backup of an app. /// /// - /// Description for Replaces the application settings of an app. + /// Description for Creates a backup of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -34489,12 +34144,13 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Application settings of the app. + /// + /// Backup configuration. You can use the JSON response from the POST action as + /// input here. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// update the application settings for the production slot. + /// create a backup for the production slot. /// /// /// Headers that will be added to request. @@ -34517,7 +34173,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateApplicationSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34542,9 +34198,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (appSettings == null) + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); } if (slot == null) { @@ -34567,14 +34227,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("appSettings", appSettings); + tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateApplicationSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BackupSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -34591,7 +34251,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -34622,9 +34282,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(appSettings != null) + if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -34678,7 +34338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -34691,7 +34351,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -34711,10 +34371,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the application settings of an app. + /// Gets existing backups of an app. /// /// - /// Description for Gets the application settings of an app. + /// Description for Gets existing backups of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -34724,7 +34384,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// /// Name of the deployment slot. If a slot is not specified, the API will get - /// the application settings for the production slot. + /// backups of the production slot. /// /// /// Headers that will be added to request. @@ -34747,7 +34407,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListApplicationSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBackupsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34795,11 +34455,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListApplicationSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBackupsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -34816,7 +34476,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -34897,7 +34557,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -34910,7 +34570,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -34930,25 +34590,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the Authentication / Authorization settings associated with web - /// app. + /// Gets a backup of an app by its ID. /// /// - /// Description for Updates the Authentication / Authorization settings - /// associated with web app. + /// Description for Gets a backup of an app by its ID. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Auth settings associated with web app. + /// + /// ID of the backup. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will get a + /// backup of the production slot. /// /// /// Headers that will be added to request. @@ -34971,7 +34629,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetBackupStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34996,9 +34654,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteAuthSettings == null) + if (backupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteAuthSettings"); + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); } if (slot == null) { @@ -35021,16 +34679,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteAuthSettings", siteAuthSettings); + tracingParameters.Add("backupId", backupId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAuthSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetBackupStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -35045,7 +34704,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -35076,12 +34735,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteAuthSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteAuthSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -35132,7 +34785,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -35145,7 +34798,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -35165,10 +34818,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Authentication/Authorization settings of an app. + /// Deletes a backup of an app by its ID. /// /// - /// Description for Gets the Authentication/Authorization settings of an app. + /// Description for Deletes a backup of an app by its ID. /// /// /// Name of the resource group to which the resource belongs. @@ -35176,9 +34829,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// ID of the backup. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete a backup of the production slot. /// /// /// Headers that will be added to request. @@ -35189,9 +34845,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -35201,7 +34854,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteBackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -35226,6 +34879,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (backupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -35247,15 +34904,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("backupId", backupId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAuthSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteBackupSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -35270,7 +34929,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -35321,7 +34980,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -35351,31 +35010,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -35384,12 +35025,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates site's Authentication / Authorization settings for apps via the V2 - /// format + /// Gets status of a web app backup that may be in progress, including secrets + /// associated with the backup, such as the Azure Storage SAS URL. Also can be + /// used to update the SAS URL for the backup if a new URL is passed in the + /// request body. /// /// - /// Description for Updates site's Authentication / Authorization settings for - /// apps via the V2 format + /// Description for Gets status of a web app backup that may be in progress, + /// including secrets associated with the backup, such as the Azure Storage SAS + /// URL. Also can be used to update the SAS URL for the backup if a new URL is + /// passed in the request body. /// /// /// Name of the resource group to which the resource belongs. @@ -35397,8 +35042,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of web app. /// - /// - /// Auth settings associated with web app. + /// + /// ID of backup. + /// + /// + /// Information on backup request. /// /// /// Name of web app slot. If not specified then will default to production @@ -35425,7 +35073,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListBackupStatusSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -35450,9 +35098,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteAuthSettingsV2 == null) + if (backupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteAuthSettingsV2"); + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); } if (slot == null) { @@ -35475,16 +35131,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteAuthSettingsV2", siteAuthSettingsV2); + tracingParameters.Add("backupId", backupId); + tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAuthSettingsV2Slot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBackupStatusSecretsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -35499,7 +35157,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -35530,9 +35188,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteAuthSettingsV2 != null) + if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteAuthSettingsV2, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -35586,7 +35244,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -35599,7 +35257,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -35619,12 +35277,49 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets site's Authentication / Authorization settings for apps via the V2 - /// format + /// Restores a specific backup to another app (or deployment slot, if + /// specified). /// /// - /// Description for Gets site's Authentication / Authorization settings for - /// apps via the V2 format + /// Description for Restores a specific backup to another app (or deployment + /// slot, if specified). + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// ID of the backup. + /// + /// + /// Information on restore request . + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// restore a backup of the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreSlotWithHttpMessagesAsync(resourceGroupName, name, backupId, request, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + /// given site. + /// + /// + /// Description for Returns whether Scm basic auth is allowed and whether Ftp + /// is allowed for a given site. /// /// /// Name of the resource group to which the resource belongs. @@ -35633,8 +35328,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. /// /// /// Headers that will be added to request. @@ -35657,7 +35350,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetBasicPublishingCredentialsPoliciesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -35705,11 +35398,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAuthSettingsV2Slot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetBasicPublishingCredentialsPoliciesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -35807,7 +35500,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -35820,7 +35513,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -35840,10 +35533,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the Azure storage account configurations of an app. + /// Returns whether FTP is allowed on the site or not. /// /// - /// Description for Updates the Azure storage account configurations of an app. + /// Description for Returns whether FTP is allowed on the site or not. /// /// /// Name of the resource group to which the resource belongs. @@ -35851,12 +35544,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Azure storage accounts of the app. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. /// /// /// Headers that will be added to request. @@ -35879,7 +35567,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetFtpAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -35904,10 +35592,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (azureStorageAccounts == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "azureStorageAccounts"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -35929,14 +35613,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("azureStorageAccounts", azureStorageAccounts); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAzureStorageAccountsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFtpAllowedSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -35953,7 +35636,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -35984,12 +35667,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(azureStorageAccounts != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(azureStorageAccounts, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -36040,7 +35717,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -36053,7 +35730,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -36073,10 +35750,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Azure storage account configurations of an app. + /// Updates whether FTP is allowed on the site or not. /// /// - /// Description for Gets the Azure storage account configurations of an app. + /// Description for Updates whether FTP is allowed on the site or not. /// /// /// Name of the resource group to which the resource belongs. @@ -36084,9 +35761,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. /// /// /// Headers that will be added to request. @@ -36109,7 +35786,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateFtpAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36134,6 +35811,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (csmPublishingAccessPoliciesEntity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "csmPublishingAccessPoliciesEntity"); + } + if (csmPublishingAccessPoliciesEntity != null) + { + csmPublishingAccessPoliciesEntity.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -36155,13 +35840,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("csmPublishingAccessPoliciesEntity", csmPublishingAccessPoliciesEntity); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAzureStorageAccountsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateFtpAllowedSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -36178,7 +35864,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -36209,6 +35895,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(csmPublishingAccessPoliciesEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(csmPublishingAccessPoliciesEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -36259,7 +35951,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -36272,7 +35964,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -36292,10 +35984,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the backup configuration of an app. + /// Returns whether Scm basic auth is allowed on the site or not. /// /// - /// Description for Updates the backup configuration of an app. + /// Description for Returns whether Scm basic auth is allowed on the site or + /// not. /// /// /// Name of the resource group to which the resource belongs. @@ -36303,12 +35996,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Edited backup configuration. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -36331,7 +36019,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetScmAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36356,14 +36044,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -36385,14 +36065,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateBackupConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetScmAllowedSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -36409,7 +36088,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -36440,12 +36119,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -36496,7 +36169,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -36509,7 +36182,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -36529,10 +36202,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes the backup configuration of an app. + /// Updates whether user publishing credentials are allowed on the site or not. /// /// - /// Description for Deletes the backup configuration of an app. + /// Description for Updates whether user publishing credentials are allowed on + /// the site or not. /// /// /// Name of the resource group to which the resource belongs. @@ -36540,9 +36214,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -36553,6 +36227,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -36562,7 +36239,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateScmAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36587,6 +36264,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (csmPublishingAccessPoliciesEntity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "csmPublishingAccessPoliciesEntity"); + } + if (csmPublishingAccessPoliciesEntity != null) + { + csmPublishingAccessPoliciesEntity.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -36608,13 +36293,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("csmPublishingAccessPoliciesEntity", csmPublishingAccessPoliciesEntity); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteBackupConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateScmAllowedSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -36631,7 +36317,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -36662,6 +36348,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(csmPublishingAccessPoliciesEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(csmPublishingAccessPoliciesEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -36712,13 +36404,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -36727,10 +36437,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the backup configuration of an app. + /// List the configurations of an app /// /// - /// Description for Gets the backup configuration of an app. + /// Description for List the configurations of an app /// /// /// Name of the resource group to which the resource belongs. @@ -36739,8 +36449,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the backup configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -36763,7 +36473,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36811,11 +36521,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetBackupConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -36832,7 +36542,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -36913,7 +36623,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -36926,7 +36636,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -36946,10 +36656,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the connection strings of an app. + /// Replaces the application settings of an app. /// /// - /// Description for Replaces the connection strings of an app. + /// Description for Replaces the application settings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -36957,12 +36667,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Connection strings of the app or deployment slot. See example. + /// + /// Application settings of the app. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// update the connection settings for the production slot. + /// update the application settings for the production slot. /// /// /// Headers that will be added to request. @@ -36985,7 +36695,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateConnectionStringsSlotWithHttpMessagesAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateApplicationSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37010,9 +36720,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionStrings == null) + if (appSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionStrings"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); } if (slot == null) { @@ -37035,14 +36745,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionStrings", connectionStrings); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateConnectionStringsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateApplicationSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37090,9 +36800,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionStrings != null) + if(appSettings != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionStrings, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -37146,7 +36856,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37159,7 +36869,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -37179,10 +36889,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the connection strings of an app. + /// Gets the application settings of an app. /// /// - /// Description for Gets the connection strings of an app. + /// Description for Gets the application settings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -37192,7 +36902,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// /// Name of the deployment slot. If a slot is not specified, the API will get - /// the connection settings for the production slot. + /// the application settings for the production slot. /// /// /// Headers that will be added to request. @@ -37215,7 +36925,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListConnectionStringsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListApplicationSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37263,11 +36973,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStringsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListApplicationSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37365,7 +37075,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37378,7 +37088,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -37398,20 +37108,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the logging configuration of an app. + /// Updates the Authentication / Authorization settings associated with web + /// app. /// /// - /// Description for Gets the logging configuration of an app. + /// Description for Updates the Authentication / Authorization settings + /// associated with web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. + /// + /// + /// Auth settings associated with web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the logging configuration for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -37434,7 +37149,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDiagnosticLogsConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37459,6 +37174,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteAuthSettings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteAuthSettings"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -37480,13 +37199,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteAuthSettings", siteAuthSettings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticLogsConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAuthSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37503,7 +37223,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -37534,6 +37254,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteAuthSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteAuthSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -37584,7 +37310,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37597,7 +37323,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -37617,10 +37343,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the logging configuration of an app. + /// Gets the Authentication/Authorization settings of an app. /// /// - /// Description for Updates the logging configuration of an app. + /// Description for Gets the Authentication/Authorization settings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -37628,13 +37354,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// A SiteLogsConfig JSON object that contains the logging configuration to - /// change in the "properties" property. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the logging configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the settings for the production slot. /// /// /// Headers that will be added to request. @@ -37657,7 +37379,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateDiagnosticLogsConfigSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37682,14 +37404,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteLogsConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteLogsConfig"); - } - if (siteLogsConfig != null) - { - siteLogsConfig.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -37711,14 +37425,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteLogsConfig", siteLogsConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateDiagnosticLogsConfigSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAuthSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37735,7 +37448,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -37766,12 +37479,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteLogsConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteLogsConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -37822,7 +37529,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37835,7 +37542,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -37855,23 +37562,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the metadata of an app. + /// Updates site's Authentication / Authorization settings for apps via the V2 + /// format /// /// - /// Description for Replaces the metadata of an app. + /// Description for Updates site's Authentication / Authorization settings for + /// apps via the V2 format /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// Edited metadata of the app or deployment slot. See example. + /// + /// Auth settings associated with web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the metadata for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -37894,7 +37603,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateMetadataSlotWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary metadata, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37919,9 +37628,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (metadata == null) + if (siteAuthSettingsV2 == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteAuthSettingsV2"); } if (slot == null) { @@ -37944,14 +37653,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("metadata", metadata); + tracingParameters.Add("siteAuthSettingsV2", siteAuthSettingsV2); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateMetadataSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAuthSettingsV2Slot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37999,9 +37708,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(metadata != null) + if(siteAuthSettingsV2 != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteAuthSettingsV2, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -38055,7 +37764,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38068,7 +37777,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -38088,10 +37797,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the metadata of an app. + /// Gets site's Authentication / Authorization settings for apps via the V2 + /// format /// /// - /// Description for Gets the metadata of an app. + /// Description for Gets site's Authentication / Authorization settings for + /// apps via the V2 format /// /// /// Name of the resource group to which the resource belongs. @@ -38101,7 +37812,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// /// Name of the deployment slot. If a slot is not specified, the API will get - /// the metadata for the production slot. + /// the settings for the production slot. /// /// /// Headers that will be added to request. @@ -38124,7 +37835,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListMetadataSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38172,11 +37883,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMetadataSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAuthSettingsV2Slot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -38193,7 +37904,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -38274,7 +37985,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38287,7 +37998,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -38307,10 +38018,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Git/FTP publishing credentials of an app. + /// Updates the Azure storage account configurations of an app. /// /// - /// Description for Gets the Git/FTP publishing credentials of an app. + /// Description for Updates the Azure storage account configurations of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -38318,41 +38029,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the publishing credentials for the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ListPublishingCredentialsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginListPublishingCredentialsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates the Push settings associated with web app. - /// - /// - /// Description for Updates the Push settings associated with web app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Push settings associated with web app. + /// + /// Azure storage accounts of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. /// /// /// Headers that will be added to request. @@ -38375,7 +38057,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSitePushSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, PushSettings pushSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38400,13 +38082,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (pushSettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "pushSettings"); - } - if (pushSettings != null) + if (azureStorageAccounts == null) { - pushSettings.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "azureStorageAccounts"); } if (slot == null) { @@ -38429,14 +38107,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("pushSettings", pushSettings); + tracingParameters.Add("azureStorageAccounts", azureStorageAccounts); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSitePushSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAzureStorageAccountsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -38484,9 +38162,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(pushSettings != null) + if(azureStorageAccounts != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pushSettings, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(azureStorageAccounts, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -38540,7 +38218,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38553,7 +38231,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -38573,20 +38251,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Push settings associated with web app. + /// Gets the Azure storage account configurations of an app. /// /// - /// Description for Gets the Push settings associated with web app. + /// Description for Gets the Azure storage account configurations of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. /// /// /// Headers that will be added to request. @@ -38609,7 +38287,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSitePushSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38657,11 +38335,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSitePushSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAzureStorageAccountsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -38759,7 +38437,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38772,7 +38450,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -38792,12 +38470,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the configuration of an app, such as platform version and bitness, - /// default documents, virtual applications, Always On, etc. + /// Updates the backup configuration of an app. /// /// - /// Description for Gets the configuration of an app, such as platform version - /// and bitness, default documents, virtual applications, Always On, etc. + /// Description for Updates the backup configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -38805,9 +38481,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Edited backup configuration. + /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// update the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -38830,7 +38509,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38855,6 +38534,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -38876,13 +38563,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateBackupConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -38899,7 +38587,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -38930,6 +38618,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -38980,7 +38674,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38993,7 +38687,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -39013,10 +38707,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the configuration of an app. + /// Deletes the backup configuration of an app. /// /// - /// Description for Updates the configuration of an app. + /// Description for Deletes the backup configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -39024,12 +38718,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteConfig object. See example. - /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// update configuration for the production slot. + /// delete the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -39040,9 +38731,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -39052,7 +38740,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39077,14 +38765,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); - } - if (siteConfig != null) - { - siteConfig.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -39106,14 +38786,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteBackupConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -39130,7 +38809,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -39161,12 +38840,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -39217,31 +38890,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -39250,10 +38905,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the configuration of an app. + /// Gets the backup configuration of an app. /// /// - /// Description for Updates the configuration of an app. + /// Description for Gets the backup configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -39261,12 +38916,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteConfig object. See example. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -39289,7 +38941,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39314,10 +38966,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -39339,14 +38987,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetBackupConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -39363,7 +39010,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -39394,12 +39041,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -39450,7 +39091,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -39463,7 +39104,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -39483,12 +39124,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a list of web app configuration snapshots identifiers. Each element of - /// the list contains a timestamp and the ID of the snapshot. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Gets a list of web app configuration snapshots identifiers. - /// Each element of the list contains a timestamp and the ID of the snapshot. + /// Description for Gets the config reference app settings and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -39497,8 +39136,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -39521,7 +39158,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationSnapshotInfoSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetAppSettingsKeyVaultReferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39569,11 +39206,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingsKeyVaultReferencesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -39671,7 +39308,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -39684,7 +39321,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -39704,11 +39341,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a snapshot of the configuration of an app at a previous point in time. + /// Gets the config reference and status of an app /// /// - /// Description for Gets a snapshot of the configuration of an app at a - /// previous point in time. + /// Description for Gets the config reference and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -39716,12 +39352,10 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of the snapshot to read. + /// + /// App Setting key name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -39744,7 +39378,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetConfigurationSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAppSettingKeyVaultReferenceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string appSettingKey, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39769,9 +39403,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (snapshotId == null) + if (appSettingKey == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettingKey"); } if (slot == null) { @@ -39794,17 +39428,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("snapshotId", snapshotId); + tracingParameters.Add("appSettingKey", appSettingKey); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSnapshotSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingKeyVaultReferenceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings/{appSettingKey}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); + _url = _url.Replace("{appSettingKey}", System.Uri.EscapeDataString(appSettingKey)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -39900,7 +39534,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -39913,7 +39547,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -39933,10 +39567,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Reverts the configuration of an app to a previous snapshot. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Reverts the configuration of an app to a previous snapshot. + /// Description for Gets the config reference app settings and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -39944,12 +39578,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of the snapshot to read. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -39960,6 +39589,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -39969,7 +39601,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RecoverSiteConfigurationSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetSiteConnectionStringKeyVaultReferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39994,10 +39626,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (snapshotId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -40019,17 +39647,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RecoverSiteConfigurationSnapshotSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReferencesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -40044,7 +39670,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -40095,7 +39721,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -40125,13 +39751,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -40140,20 +39784,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the last lines of docker logs for the given site + /// Gets the config reference and status of an app /// /// - /// Description for Gets the last lines of docker logs for the given site + /// Description for Gets the config reference and status of an app /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. /// /// /// Headers that will be added to request. @@ -40161,7 +39805,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -40176,7 +39820,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWebSiteContainerLogsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSiteConnectionStringKeyVaultReferenceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string connectionStringKey, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40201,6 +39845,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (connectionStringKey == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionStringKey"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -40222,15 +39870,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("connectionStringKey", connectionStringKey); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebSiteContainerLogsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReferenceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings/{connectionStringKey}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{connectionStringKey}", System.Uri.EscapeDataString(connectionStringKey)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -40245,7 +39895,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -40288,7 +39938,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -40296,16 +39946,15 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -40315,10 +39964,6 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -40331,7 +39976,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -40341,7 +39986,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -40351,20 +40009,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the ZIP archived docker log files for the given site + /// Replaces the connection strings of an app. /// /// - /// Description for Gets the ZIP archived docker log files for the given site + /// Description for Replaces the connection strings of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Connection strings of the app or deployment slot. See example. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the connection settings for the production slot. /// /// /// Headers that will be added to request. @@ -40372,7 +40033,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -40387,7 +40048,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContainerLogsZipSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateConnectionStringsSlotWithHttpMessagesAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40412,6 +40073,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (connectionStrings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionStrings"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -40433,13 +40098,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("connectionStrings", connectionStrings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetContainerLogsZipSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateConnectionStringsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -40456,7 +40122,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -40487,6 +40153,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionStrings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionStrings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -40499,7 +40171,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -40507,16 +40179,15 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -40526,10 +40197,6 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -40542,7 +40209,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -40552,7 +40219,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -40562,20 +40242,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List continuous web jobs for an app, or a deployment slot. + /// Gets the connection strings of an app. /// /// - /// Description for List continuous web jobs for an app, or a deployment slot. + /// Description for Gets the connection strings of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the connection settings for the production slot. /// /// /// Headers that will be added to request. @@ -40598,7 +40278,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListContinuousWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListConnectionStringsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40646,11 +40326,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStringsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -40667,7 +40347,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -40748,7 +40428,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -40761,7 +40441,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -40781,24 +40461,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a continuous web job by its ID for an app, or a deployment slot. + /// Gets the logging configuration of an app. /// /// - /// Description for Gets a continuous web job by its ID for an app, or a - /// deployment slot. + /// Description for Gets the logging configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the logging configuration for the production slot. /// /// /// Headers that will be added to request. @@ -40821,7 +40497,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDiagnosticLogsConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40846,10 +40522,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -40871,17 +40543,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetContinuousWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticLogsConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -40947,7 +40617,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -40977,7 +40647,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -40990,7 +40660,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -41010,24 +40680,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a continuous web job by its ID for an app, or a deployment slot. + /// Updates the logging configuration of an app. /// /// - /// Description for Delete a continuous web job by its ID for an app, or a - /// deployment slot. + /// Description for Updates the logging configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// A SiteLogsConfig JSON object that contains the logging configuration to + /// change in the "properties" property. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the logging configuration for the production slot. /// /// /// Headers that will be added to request. @@ -41038,6 +40708,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -41047,7 +40720,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDiagnosticLogsConfigSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41072,9 +40745,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (siteLogsConfig == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteLogsConfig"); + } + if (siteLogsConfig != null) + { + siteLogsConfig.Validate(); } if (slot == null) { @@ -41097,17 +40774,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("siteLogsConfig", siteLogsConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteContinuousWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateDiagnosticLogsConfigSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -41122,7 +40798,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -41153,6 +40829,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteLogsConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteLogsConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -41173,7 +40855,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -41203,13 +40885,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -41218,24 +40918,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start a continuous web job for an app, or a deployment slot. + /// Replaces the metadata of an app. /// /// - /// Description for Start a continuous web job for an app, or a deployment - /// slot. + /// Description for Replaces the metadata of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// Edited metadata of the app or deployment slot. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the metadata for the production slot. /// /// /// Headers that will be added to request. @@ -41246,6 +40945,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -41255,7 +40957,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateMetadataSlotWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary metadata, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41280,9 +40982,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (metadata == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); } if (slot == null) { @@ -41305,17 +41007,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("metadata", metadata); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartContinuousWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateMetadataSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -41330,7 +41031,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -41361,6 +41062,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(metadata != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -41381,7 +41088,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -41411,13 +41118,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -41426,23 +41151,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Stop a continuous web job for an app, or a deployment slot. + /// Gets the metadata of an app. /// /// - /// Description for Stop a continuous web job for an app, or a deployment slot. + /// Description for Gets the metadata of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the metadata for the production slot. /// /// /// Headers that will be added to request. @@ -41453,6 +41175,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -41462,7 +41187,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListMetadataSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41487,10 +41212,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -41512,17 +41233,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopContinuousWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMetadataSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -41588,7 +41307,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -41618,13 +41337,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -41633,10 +41370,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployments for an app, or a deployment slot. + /// Gets the Git/FTP publishing credentials of an app. /// /// - /// Description for List deployments for an app, or a deployment slot. + /// Description for Gets the Git/FTP publishing credentials of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -41645,8 +41382,40 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the publishing credentials for the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListPublishingCredentialsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListPublishingCredentialsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the Push settings associated with web app. + /// + /// + /// Description for Updates the Push settings associated with web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Push settings associated with web app. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -41669,7 +41438,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDeploymentsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSitePushSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, PushSettings pushSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41694,6 +41463,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (pushSettings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "pushSettings"); + } + if (pushSettings != null) + { + pushSettings.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -41715,13 +41492,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("pushSettings", pushSettings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSitePushSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -41738,7 +41516,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -41769,6 +41547,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(pushSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pushSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -41819,7 +41603,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -41832,7 +41616,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -41852,24 +41636,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a deployment by its ID for an app, or a deployment slot. + /// Gets the Push settings associated with web app. /// /// - /// Description for Get a deployment by its ID for an app, or a deployment - /// slot. + /// Description for Gets the Push settings associated with web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Deployment ID. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets a - /// deployment for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -41892,7 +41672,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSitePushSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41917,10 +41697,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -41942,17 +41718,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDeploymentSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSitePushSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -41967,7 +41741,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -42048,7 +41822,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -42061,7 +41835,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -42081,10 +41855,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create a deployment for an app, or a deployment slot. + /// Gets the configuration of an app, such as platform version and bitness, + /// default documents, virtual applications, Always On, etc. /// /// - /// Description for Create a deployment for an app, or a deployment slot. + /// Description for Gets the configuration of an app, such as platform version + /// and bitness, default documents, virtual applications, Always On, etc. /// /// /// Name of the resource group to which the resource belongs. @@ -42092,15 +41868,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// ID of an existing deployment. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API creates a - /// deployment for the production slot. - /// - /// - /// Deployment details. + /// Name of the deployment slot. If a slot is not specified, the API will + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -42123,7 +41893,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Deployment deployment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -42148,18 +41918,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (deployment == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "deployment"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -42177,18 +41939,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); - tracingParameters.Add("deployment", deployment); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateDeploymentSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -42203,7 +41962,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -42234,12 +41993,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(deployment != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deployment, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -42290,7 +42043,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -42303,7 +42056,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -42323,11 +42076,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a deployment by its ID for an app, or a deployment slot. + /// Updates the configuration of an app. /// /// - /// Description for Delete a deployment by its ID for an app, or a deployment - /// slot. + /// Description for Updates the configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -42335,12 +42087,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Deployment ID. + /// + /// JSON representation of a SiteConfig object. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update configuration for the production slot. /// /// /// Headers that will be added to request. @@ -42351,6 +42103,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -42360,7 +42115,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -42385,9 +42140,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (siteConfig == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); + } + if (siteConfig != null) + { + siteConfig.Validate(); } if (slot == null) { @@ -42410,17 +42169,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteDeploymentSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -42435,7 +42193,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -42466,6 +42224,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -42486,7 +42250,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -42516,13 +42280,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -42531,12 +42313,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployment log for specific deployment for an app, or a deployment - /// slot. + /// Updates the configuration of an app. /// /// - /// Description for List deployment log for specific deployment for an app, or - /// a deployment slot. + /// Description for Updates the configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -42544,13 +42324,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of a specific deployment. This is the value of the name property in - /// the JSON response from "GET /api/sites/{siteName}/deployments". + /// + /// JSON representation of a SiteConfig object. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update configuration for the production slot. /// /// /// Headers that will be added to request. @@ -42573,7 +42352,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListDeploymentLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -42598,9 +42377,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (siteConfig == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); } if (slot == null) { @@ -42623,17 +42402,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentLogSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -42648,7 +42426,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -42679,6 +42457,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -42729,7 +42513,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -42742,7 +42526,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -42762,14 +42546,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Discovers an existing app backup that can be restored from a blob in Azure - /// storage. Use this to get information about the databases stored in a - /// backup. + /// Gets a list of web app configuration snapshots identifiers. Each element of + /// the list contains a timestamp and the ID of the snapshot. /// /// - /// Description for Discovers an existing app backup that can be restored from - /// a blob in Azure storage. Use this to get information about the databases - /// stored in a backup. + /// Description for Gets a list of web app configuration snapshots identifiers. + /// Each element of the list contains a timestamp and the ID of the snapshot. /// /// /// Name of the resource group to which the resource belongs. @@ -42777,13 +42559,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// A RestoreRequest object that includes Azure storage URL and blog name for - /// discovery of backup. - /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// perform discovery for the production slot. + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -42806,7 +42584,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DiscoverBackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationSnapshotInfoSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -42831,14 +42609,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -42860,14 +42630,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DiscoverBackupSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -42884,7 +42653,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -42915,12 +42684,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -42971,7 +42734,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -42984,7 +42747,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -43004,11 +42767,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Lists ownership identifiers for domain associated with web app. + /// Gets a snapshot of the configuration of an app at a previous point in time. /// /// - /// Description for Lists ownership identifiers for domain associated with web - /// app. + /// Description for Gets a snapshot of the configuration of an app at a + /// previous point in time. /// /// /// Name of the resource group to which the resource belongs. @@ -43016,9 +42779,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// The ID of the snapshot to read. + /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -43041,7 +42807,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDomainOwnershipIdentifiersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetConfigurationSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43066,6 +42832,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (snapshotId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -43087,15 +42857,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSnapshotSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -43191,7 +42963,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -43204,7 +42976,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -43224,10 +42996,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get domain ownership identifier for web app. + /// Reverts the configuration of an app to a previous snapshot. /// /// - /// Description for Get domain ownership identifier for web app. + /// Description for Reverts the configuration of an app to a previous snapshot. /// /// /// Name of the resource group to which the resource belongs. @@ -43235,12 +43007,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. + /// + /// The ID of the snapshot to read. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -43251,9 +43023,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -43263,7 +43032,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RecoverSiteConfigurationSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43288,9 +43057,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) + if (snapshotId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); } if (slot == null) { @@ -43313,17 +43082,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifierSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RecoverSiteConfigurationSnapshotSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); + _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -43338,7 +43107,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -43389,7 +43158,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -43419,31 +43188,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -43452,28 +43203,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a domain ownership identifier for web app, or updates an existing - /// ownership identifier. + /// Gets the last lines of docker logs for the given site /// /// - /// Description for Creates a domain ownership identifier for web app, or - /// updates an existing ownership identifier. + /// Description for Gets the last lines of docker logs for the given site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of domain ownership identifier. - /// - /// - /// A JSON representation of the domain ownership properties. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -43481,7 +43224,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -43496,7 +43239,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWebSiteContainerLogsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43521,14 +43264,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } - if (domainOwnershipIdentifier == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -43550,18 +43285,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); - tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateDomainOwnershipIdentifierSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebSiteContainerLogsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -43576,7 +43308,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -43607,12 +43339,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(domainOwnershipIdentifier != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -43625,7 +43351,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -43633,15 +43359,16 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -43651,6 +43378,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -43663,7 +43394,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -43673,20 +43404,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -43696,23 +43414,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a domain ownership identifier for a web app. + /// Gets the ZIP archived docker log files for the given site /// /// - /// Description for Deletes a domain ownership identifier for a web app. + /// Description for Gets the ZIP archived docker log files for the given site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of domain ownership identifier. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -43720,9 +43435,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -43732,7 +43450,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContainerLogsZipSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43757,10 +43475,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -43782,17 +43496,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteDomainOwnershipIdentifierSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetContainerLogsZipSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -43807,7 +43519,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -43850,7 +43562,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -43860,13 +43572,14 @@ internal WebAppsOperations(WebSiteManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -43876,6 +43589,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -43888,13 +43605,18 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -43903,28 +43625,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a domain ownership identifier for web app, or updates an existing - /// ownership identifier. + /// List continuous web jobs for an app, or a deployment slot. /// /// - /// Description for Creates a domain ownership identifier for web app, or - /// updates an existing ownership identifier. + /// Description for List continuous web jobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of domain ownership identifier. - /// - /// - /// A JSON representation of the domain ownership properties. + /// Site name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -43947,7 +43661,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListContinuousWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43972,14 +43686,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } - if (domainOwnershipIdentifier == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -44001,18 +43707,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); - tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateDomainOwnershipIdentifierSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44027,7 +43730,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -44058,12 +43761,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(domainOwnershipIdentifier != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -44114,7 +43811,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -44127,7 +43824,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -44147,20 +43844,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the status of the last MSDeploy operation. + /// Gets a continuous web job by its ID for an app, or a deployment slot. /// /// - /// Description for Get the status of the last MSDeploy operation. + /// Description for Gets a continuous web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. + /// + /// + /// Name of Web Job. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -44183,7 +43884,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMSDeployStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44208,6 +43909,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -44229,15 +43934,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetContinuousWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44303,7 +44010,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -44333,7 +44040,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -44346,7 +44053,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -44366,52 +44073,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Delete a continuous web job by its ID for an app, or a deployment slot. /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Delete a continuous web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// Details of MSDeploy operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateMSDeployOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Site name. /// - /// - /// Name of web app. + /// + /// Name of Web Job. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -44422,9 +44101,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -44434,7 +44110,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMSDeployLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44459,6 +44135,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -44480,15 +44160,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployLogSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteContinuousWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44503,7 +44185,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -44554,7 +44236,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -44584,31 +44266,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -44617,10 +44281,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the functions for a web site, or a deployment slot. + /// Start a continuous web job for an app, or a deployment slot. /// /// - /// Description for List the functions for a web site, or a deployment slot. + /// Description for Start a continuous web job for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. @@ -44628,8 +44293,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// Name of Web Job. + /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -44640,9 +44309,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -44652,7 +44318,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceFunctionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StartContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44677,6 +44343,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -44698,15 +44368,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceFunctionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartContinuousWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44721,7 +44393,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -44802,31 +44474,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -44835,21 +44489,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Fetch a short lived token that can be exchanged for a master key. + /// Stop a continuous web job for an app, or a deployment slot. /// /// - /// Description for Fetch a short lived token that can be exchanged for a - /// master key. + /// Description for Stop a continuous web job for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. + /// + /// + /// Name of Web Job. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -44860,9 +44516,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -44872,7 +44525,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetFunctionsAdminTokenSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44897,6 +44550,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -44918,15 +44575,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetFunctionsAdminTokenSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopContinuousWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44941,7 +44600,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -44992,7 +44651,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -45022,31 +44681,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -45055,23 +44696,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function information by its ID for web site, or a deployment slot. + /// List deployments for an app, or a deployment slot. /// /// - /// Description for Get function information by its ID for web site, or a - /// deployment slot. + /// Description for List deployments for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Function name. + /// Name of the app. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -45094,7 +44732,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDeploymentsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -45119,10 +44757,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -45144,17 +44778,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceFunctionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45220,7 +44852,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -45250,7 +44882,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -45263,7 +44895,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -45283,56 +44915,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create function for web site, or a deployment slot. - /// - /// - /// Description for Create function for web site, or a deployment slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// - /// - /// Function name. - /// - /// - /// Name of the deployment slot. - /// - /// - /// Function details. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateInstanceFunctionSlotWithHttpMessagesAsync(resourceGroupName, name, functionName, slot, functionEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Delete a function for web site, or a deployment slot. + /// Get a deployment by its ID for an app, or a deployment slot. /// /// - /// Description for Delete a function for web site, or a deployment slot. + /// Description for Get a deployment by its ID for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Function name. + /// + /// Deployment ID. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API gets a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -45343,6 +44943,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -45352,7 +44955,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -45377,9 +44980,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (slot == null) { @@ -45402,17 +45005,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceFunctionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDeploymentSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45427,7 +45030,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -45478,7 +45081,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -45508,13 +45111,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -45523,28 +45144,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Add or update a function secret. + /// Create a deployment for an app, or a deployment slot. /// /// - /// Description for Add or update a function secret. + /// Description for Create a deployment for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// The name of the function. + /// Name of the app. /// - /// - /// The name of the key. + /// + /// ID of an existing deployment. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API creates a + /// deployment for the production slot. /// - /// - /// The key to create or update + /// + /// Deployment details. /// /// /// Headers that will be added to request. @@ -45567,7 +45186,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateFunctionSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Deployment deployment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -45592,21 +45211,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (keyName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (key == null) + if (deployment == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "key"); + throw new ValidationException(ValidationRules.CannotBeNull, "deployment"); } if (Client.SubscriptionId == null) { @@ -45625,20 +45240,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("keyName", keyName); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); - tracingParameters.Add("key", key); + tracingParameters.Add("deployment", deployment); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateFunctionSecretSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateDeploymentSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45684,9 +45297,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(key != null) + if(deployment != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deployment, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -45710,7 +45323,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -45740,7 +45353,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -45753,25 +45366,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -45791,25 +45386,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a function secret. + /// Delete a deployment by its ID for an app, or a deployment slot. /// /// - /// Description for Delete a function secret. + /// Description for Delete a deployment by its ID for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// The name of the function. + /// Name of the app. /// - /// - /// The name of the key. + /// + /// Deployment ID. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -45829,7 +45423,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteFunctionSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -45854,13 +45448,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (keyName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (slot == null) { @@ -45883,19 +45473,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("keyName", keyName); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteFunctionSecretSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteDeploymentSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45961,7 +45549,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -46006,23 +45594,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function keys for a function in a web site, or a deployment slot. + /// List deployment log for specific deployment for an app, or a deployment + /// slot. /// /// - /// Description for Get function keys for a function in a web site, or a - /// deployment slot. + /// Description for List deployment log for specific deployment for an app, or + /// a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Function name. + /// + /// The ID of a specific deployment. This is the value of the name property in + /// the JSON response from "GET /api/sites/{siteName}/deployments". /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -46045,7 +45636,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListFunctionKeysSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListDeploymentLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46070,9 +45661,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (slot == null) { @@ -46095,17 +45686,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionKeysSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentLogSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -46120,7 +45711,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -46201,7 +45792,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -46214,7 +45805,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -46234,23 +45825,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function secrets for a function in a web site, or a deployment slot. + /// Discovers an existing app backup that can be restored from a blob in Azure + /// storage. Use this to get information about the databases stored in a + /// backup. /// /// - /// Description for Get function secrets for a function in a web site, or a - /// deployment slot. + /// Description for Discovers an existing app backup that can be restored from + /// a blob in Azure storage. Use this to get information about the databases + /// stored in a backup. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Function name. + /// + /// A RestoreRequest object that includes Azure storage URL and blog name for + /// discovery of backup. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// perform discovery for the production slot. /// /// /// Headers that will be added to request. @@ -46273,7 +45869,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListFunctionSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DiscoverBackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46298,9 +45894,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); } if (slot == null) { @@ -46323,17 +45923,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionSecretsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DiscoverBackupSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -46379,6 +45978,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -46429,7 +46034,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -46442,7 +46047,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -46462,19 +46067,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get host secrets for a function app. + /// Lists ownership identifiers for domain associated with web app. /// /// - /// Description for Get host secrets for a function app. + /// Description for Lists ownership identifiers for domain associated with web + /// app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -46497,7 +46104,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListHostKeysSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDomainOwnershipIdentifiersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46545,11 +46152,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostKeysSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -46566,7 +46173,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -46647,7 +46254,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -46660,7 +46267,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -46680,10 +46287,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// This is to allow calling via powershell and ARM template. + /// Get domain ownership identifier for web app. /// /// - /// Description for This is to allow calling via powershell and ARM template. + /// Description for Get domain ownership identifier for web app. /// /// /// Name of the resource group to which the resource belongs. @@ -46691,8 +46298,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of domain ownership identifier. + /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -46703,6 +46314,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -46712,7 +46326,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ListSyncStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46737,202 +46351,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSyncStatusSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 204) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Syncs function trigger metadata to the management database - /// - /// - /// Description for Syncs function trigger metadata to the management database - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. - /// - /// - /// 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 SyncFunctionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); } if (slot == null) { @@ -46955,15 +46376,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifierSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -46978,7 +46401,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -47029,7 +46452,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -47059,13 +46482,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -47074,28 +46515,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Add or update a host level secret. + /// Creates a domain ownership identifier for web app, or updates an existing + /// ownership identifier. /// /// - /// Description for Add or update a host level secret. + /// Description for Creates a domain ownership identifier for web app, or + /// updates an existing ownership identifier. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// The type of host key. + /// + /// Name of domain ownership identifier. /// - /// - /// The name of the key. + /// + /// A JSON representation of the domain ownership properties. /// /// - /// Name of the deployment slot. - /// - /// - /// The key to create or update + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -47118,7 +46559,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHostSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47143,22 +46584,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (keyType == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); } - if (keyName == null) + if (domainOwnershipIdentifier == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (key == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "key"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -47176,20 +46613,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("keyType", keyType); - tracingParameters.Add("keyName", keyName); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("slot", slot); - tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostSecretSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateDomainOwnershipIdentifierSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -47235,9 +46670,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(key != null) + if(domainOwnershipIdentifier != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -47261,7 +46696,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -47291,7 +46726,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -47304,25 +46739,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -47342,25 +46759,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a host level secret. + /// Deletes a domain ownership identifier for a web app. /// /// - /// Description for Delete a host level secret. + /// Description for Deletes a domain ownership identifier for a web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// The type of host key. + /// Name of the app. /// - /// - /// The name of the key. + /// + /// Name of domain ownership identifier. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -47380,7 +46795,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHostSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47405,13 +46820,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (keyType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); - } - if (keyName == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); } if (slot == null) { @@ -47434,19 +46845,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("keyType", keyType); - tracingParameters.Add("keyName", keyName); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHostSecretSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteDomainOwnershipIdentifierSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -47512,7 +46921,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -47557,10 +46966,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get hostname bindings for an app or a deployment slot. + /// Creates a domain ownership identifier for web app, or updates an existing + /// ownership identifier. /// /// - /// Description for Get hostname bindings for an app or a deployment slot. + /// Description for Creates a domain ownership identifier for web app, or + /// updates an existing ownership identifier. /// /// /// Name of the resource group to which the resource belongs. @@ -47568,9 +46979,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of domain ownership identifier. + /// + /// + /// A JSON representation of the domain ownership properties. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets - /// hostname bindings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -47593,7 +47010,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListHostNameBindingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47618,6 +47035,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainOwnershipIdentifierName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } + if (domainOwnershipIdentifier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -47639,15 +47064,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateDomainOwnershipIdentifierSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -47662,7 +47090,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -47693,6 +47121,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(domainOwnershipIdentifier != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -47743,7 +47177,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -47756,7 +47190,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -47776,25 +47210,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the named hostname binding for an app (or deployment slot, if - /// specified). + /// Get the status of the last MSDeploy operation. /// /// - /// Description for Get the named hostname binding for an app (or deployment - /// slot, if specified). + /// Description for Get the status of the last MSDeploy operation. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API the named - /// binding for the production slot. - /// - /// - /// Hostname in the hostname binding. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -47817,7 +47246,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMSDeployStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47846,10 +47275,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (hostName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -47868,17 +47293,15 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHostNameBindingSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -47973,7 +47396,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -47986,7 +47409,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -48006,27 +47429,52 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a hostname binding for an app. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Creates a hostname binding for an app. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// Hostname in the hostname binding. + /// + /// Name of web app slot. If not specified then will default to production + /// slot. /// - /// - /// Binding details. This is the JSON representation of a HostNameBinding - /// object. + /// + /// Details of MSDeploy operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateMSDeployOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// create a binding for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -48049,7 +47497,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMSDeployLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -48074,14 +47522,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } - if (hostNameBinding == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostNameBinding"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -48103,18 +47543,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostName", hostName); - tracingParameters.Add("hostNameBinding", hostNameBinding); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostNameBindingSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployLogSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -48129,7 +47566,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -48160,12 +47597,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(hostNameBinding != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostNameBinding, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -48186,7 +47617,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -48216,7 +47647,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -48229,7 +47660,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -48249,23 +47680,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a hostname binding for an app. + /// List the functions for a web site, or a deployment slot. /// /// - /// Description for Deletes a hostname binding for an app. + /// Description for List the functions for a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. - /// - /// - /// Hostname in the hostname binding. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -48276,6 +47703,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -48285,7 +47715,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceFunctionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -48314,10 +47744,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (hostName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -48336,17 +47762,15 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHostNameBindingSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceFunctionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -48360,7 +47784,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -48411,7 +47835,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -48441,13 +47865,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -48456,26 +47898,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Retrieves a specific Service Bus Hybrid Connection used by this Web App. + /// Fetch a short lived token that can be exchanged for a master key. /// /// - /// Description for Retrieves a specific Service Bus Hybrid Connection used by - /// this Web App. + /// Description for Fetch a short lived token that can be exchanged for a + /// master key. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. - /// - /// - /// The relay name for this hybrid connection. + /// Name of web app. /// /// - /// The name of the slot for the web app. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -48498,7 +47935,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetFunctionsAdminTokenSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -48523,14 +47960,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -48552,19 +47981,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHybridConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunctionsAdminTokenSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -48660,7 +48085,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -48673,7 +48098,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -48693,28 +48118,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new Hybrid Connection using a Service Bus relay. + /// Get function information by its ID for web site, or a deployment slot. /// /// - /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Description for Get function information by its ID for web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. - /// - /// - /// The relay name for this hybrid connection. + /// Site name. /// - /// - /// The details of the hybrid connection. + /// + /// Function name. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -48737,7 +48157,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -48762,17 +48182,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); - } - if (connectionEnvelope == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (slot == null) { @@ -48795,20 +48207,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHybridConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceFunctionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -48823,7 +48232,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -48854,12 +48263,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -48880,7 +48283,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -48910,7 +48313,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -48923,7 +48326,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -48943,25 +48346,56 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Removes a Hybrid Connection from this site. + /// Create function for web site, or a deployment slot. /// /// - /// Description for Removes a Hybrid Connection from this site. + /// Description for Create function for web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Site name. /// - /// - /// The namespace for this hybrid connection. + /// + /// Function name. /// - /// - /// The relay name for this hybrid connection. + /// + /// Name of the deployment slot. + /// + /// + /// Function details. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateInstanceFunctionSlotWithHttpMessagesAsync(resourceGroupName, name, functionName, slot, functionEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a function for web site, or a deployment slot. + /// + /// + /// Description for Delete a function for web site, or a deployment slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Function name. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -48981,7 +48415,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49006,13 +48440,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (slot == null) { @@ -49035,19 +48465,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHybridConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceFunctionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49113,7 +48541,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -49158,28 +48586,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new Hybrid Connection using a Service Bus relay. + /// Add or update a function secret. /// /// - /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Description for Add or update a function secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. + /// Site name. /// - /// - /// The relay name for this hybrid connection. + /// + /// The name of the function. /// - /// - /// The details of the hybrid connection. + /// + /// The name of the key. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. + /// + /// + /// The key to create or update /// /// /// Headers that will be added to request. @@ -49202,7 +48630,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateFunctionSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49227,22 +48655,22 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } - if (connectionEnvelope == null) + if (keyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "key"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -49260,20 +48688,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); + tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateHybridConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateFunctionSecretSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49288,7 +48716,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -49319,9 +48747,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) + if(key != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -49345,7 +48773,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -49375,7 +48803,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -49388,7 +48816,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -49408,20 +48854,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Delete a function secret. /// /// - /// Description for Retrieves all Service Bus Hybrid Connections used by this - /// Web App. + /// Description for Delete a function secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Site name. + /// + /// + /// The name of the function. + /// + /// + /// The name of the key. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -49432,9 +48883,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -49444,7 +48892,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListHybridConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteFunctionSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49469,6 +48917,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -49490,15 +48946,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHybridConnectionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteFunctionSecretSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49513,7 +48973,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -49564,7 +49024,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -49594,31 +49054,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -49627,22 +49069,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets hybrid connections configured for an app (or deployment slot, if - /// specified). + /// Get function keys for a function in a web site, or a deployment slot. /// /// - /// Description for Gets hybrid connections configured for an app (or - /// deployment slot, if specified). + /// Description for Get function keys for a function in a web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// Function name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// hybrid connections for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -49665,7 +49108,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListRelayServiceConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListFunctionKeysSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49690,6 +49133,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -49711,15 +49158,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRelayServiceConnectionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionKeysSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49734,7 +49183,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -49815,7 +49264,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -49828,7 +49277,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -49848,23 +49297,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a hybrid connection configuration by its name. + /// Get function secrets for a function in a web site, or a deployment slot. /// /// - /// Description for Gets a hybrid connection configuration by its name. + /// Description for Get function secrets for a function in a web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Name of the hybrid connection. + /// + /// Function name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get a - /// hybrid connection for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -49887,7 +49336,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListFunctionSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49912,9 +49361,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (slot == null) { @@ -49937,17 +49386,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetRelayServiceConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionSecretsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49962,7 +49411,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50043,7 +49492,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -50056,7 +49505,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -50076,28 +49525,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new hybrid connection configuration (PUT), or updates an existing - /// one (PATCH). + /// Get host secrets for a function app. /// /// - /// Description for Creates a new hybrid connection configuration (PUT), or - /// updates an existing one (PATCH). + /// Description for Get host secrets for a function app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the hybrid connection configuration. - /// - /// - /// Details of the hybrid connection configuration. + /// Site name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// create or update a hybrid connection for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -50120,7 +49560,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListHostKeysSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -50145,14 +49585,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -50174,18 +49606,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateRelayServiceConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostKeysSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -50200,7 +49629,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50231,12 +49660,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -50287,7 +49710,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -50300,7 +49723,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -50320,10 +49743,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a relay service connection by its name. + /// This is to allow calling via powershell and ARM template. /// /// - /// Description for Deletes a relay service connection by its name. + /// Description for This is to allow calling via powershell and ARM template. /// /// /// Name of the resource group to which the resource belongs. @@ -50331,12 +49754,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the hybrid connection configuration. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete a hybrid connection for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -50356,7 +49775,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ListSyncStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -50381,10 +49800,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -50406,17 +49821,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteRelayServiceConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -50431,7 +49844,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50482,7 +49895,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -50527,12 +49940,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new hybrid connection configuration (PUT), or updates an existing - /// one (PATCH). + /// Syncs function trigger metadata to the management database /// /// - /// Description for Creates a new hybrid connection configuration (PUT), or - /// updates an existing one (PATCH). + /// Description for Syncs function trigger metadata to the management database /// /// /// Name of the resource group to which the resource belongs. @@ -50540,15 +49951,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the hybrid connection configuration. - /// - /// - /// Details of the hybrid connection configuration. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// create or update a hybrid connection for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -50559,9 +49963,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -50571,7 +49972,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncFunctionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -50596,14 +49997,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -50625,18 +50018,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateRelayServiceConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -50651,7 +50041,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50682,12 +50072,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -50708,7 +50092,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -50738,31 +50122,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -50771,20 +50137,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Add or update a host level secret. /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Add or update a host level secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// The type of host key. + /// + /// + /// The name of the key. /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets the - /// production slot instances. + /// Name of the deployment slot. + /// + /// + /// The key to create or update /// /// /// Headers that will be added to request. @@ -50807,7 +50181,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceIdentifiersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHostSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -50832,10 +50206,22 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (keyType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "key"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -50853,15 +50239,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("keyType", keyType); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); + tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostSecretSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -50876,7 +50267,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50907,6 +50298,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(key != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -50927,7 +50324,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -50957,7 +50354,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -50970,7 +50367,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -50990,22 +50405,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Delete a host level secret. /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Delete a host level secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// + /// + /// The type of host key. + /// + /// + /// The name of the key. /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets the - /// production slot instances. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -51016,9 +50434,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -51028,7 +50443,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceInfoSlotWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHostSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -51053,9 +50468,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) + if (keyType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); } if (slot == null) { @@ -51078,17 +50497,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("keyType", keyType); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceInfoSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHostSecretSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -51103,7 +50524,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -51154,7 +50575,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -51184,31 +50605,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -51217,23 +50620,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the status of the last MSDeploy operation. + /// Get hostname bindings for an app or a deployment slot. /// /// - /// Description for Get the status of the last MSDeploy operation. + /// Description for Get hostname bindings for an app or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// ID of web app instance. + /// Name of the deployment slot. If a slot is not specified, the API gets + /// hostname bindings for the production slot. /// /// /// Headers that will be added to request. @@ -51256,7 +50656,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceMsDeployStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListHostNameBindingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -51285,10 +50685,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -51307,17 +50703,15 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMsDeployStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -51412,7 +50806,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -51425,7 +50819,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -51445,58 +50839,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. - /// - /// - /// Description for Invoke the MSDeploy web app extension. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// ID of web app instance. - /// - /// - /// Details of MSDeploy operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, instanceId, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the MSDeploy Log for the last MSDeploy operation. + /// Get the named hostname binding for an app (or deployment slot, if + /// specified). /// /// - /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Description for Get the named hostname binding for an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API the named + /// binding for the production slot. /// - /// - /// ID of web app instance. + /// + /// Hostname in the hostname binding. /// /// /// Headers that will be added to request. @@ -51519,7 +50880,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceMSDeployLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -51548,9 +50909,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); } if (Client.SubscriptionId == null) { @@ -51570,17 +50931,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMSDeployLogSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetHostNameBindingSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -51645,7 +51006,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -51675,7 +51036,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -51688,7 +51049,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -51708,26 +51069,27 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Creates a hostname binding for an app. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Creates a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// + /// Hostname in the hostname binding. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// Binding details. This is the JSON representation of a HostNameBinding + /// object. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// create a binding for the production slot. /// /// /// Headers that will be added to request. @@ -51750,7 +51112,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -51775,13 +51137,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); } - if (instanceId == null) + if (hostNameBinding == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostNameBinding"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -51800,18 +51166,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("hostName", hostName); + tracingParameters.Add("hostNameBinding", hostNameBinding); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostNameBindingSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -51825,7 +51192,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -51856,6 +51223,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(hostNameBinding != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostNameBinding, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -51876,7 +51249,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -51906,7 +51279,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -51919,7 +51292,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -51939,29 +51312,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Deletes a hostname binding for an app. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Deletes a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// Hostname in the hostname binding. /// /// /// Headers that will be added to request. @@ -51972,9 +51339,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -51984,7 +51348,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52009,17 +51373,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); } if (Client.SubscriptionId == null) { @@ -52038,20 +51398,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHostNameBindingSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -52065,7 +51423,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -52116,7 +51474,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -52146,31 +51504,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -52179,29 +51519,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Terminate a process by its ID for a web site, or a deployment slot, or - /// specific scaled-out instance in a web site. + /// Retrieves a specific Service Bus Hybrid Connection used by this Web App. /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Retrieves a specific Service Bus Hybrid Connection used by + /// this Web App. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// PID. + /// + /// The namespace for this hybrid connection. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// + /// The relay name for this hybrid connection. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -52212,6 +51549,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -52221,7 +51561,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteInstanceProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52246,17 +51586,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (slot == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } - if (instanceId == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -52275,20 +51615,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceProcessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetHybridConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -52302,7 +51642,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -52353,7 +51693,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -52383,13 +51723,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -52398,29 +51756,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a memory dump of a process by its ID for a specific scaled-out instance - /// in a web site. + /// Creates a new Hybrid Connection using a Service Bus relay. /// /// - /// Description for Get a memory dump of a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Creates a new Hybrid Connection using a Service Bus relay. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// PID. + /// + /// The namespace for this hybrid connection. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// + /// The relay name for this hybrid connection. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// The details of the hybrid connection. + /// + /// + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -52443,7 +51800,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessDumpSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52468,17 +51825,21 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (slot == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } - if (instanceId == null) + if (connectionEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -52497,20 +51858,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessDumpSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHybridConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -52524,7 +51886,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -52555,6 +51917,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -52567,7 +51935,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -52575,7 +51943,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -52605,7 +51973,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -52615,7 +51983,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -52625,29 +52006,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Removes a Hybrid Connection from this site. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Removes a Hybrid Connection from this site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// PID. + /// + /// The namespace for this hybrid connection. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// + /// The relay name for this hybrid connection. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -52658,9 +52035,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -52670,7 +52044,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessModulesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52695,17 +52069,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (slot == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } - if (instanceId == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -52724,20 +52098,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHybridConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -52751,7 +52125,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -52832,31 +52206,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -52865,32 +52221,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Creates a new Hybrid Connection using a Service Bus relay. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Creates a new Hybrid Connection using a Service Bus relay. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// PID. + /// + /// The namespace for this hybrid connection. /// - /// - /// Module base address. + /// + /// The relay name for this hybrid connection. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// + /// The details of the hybrid connection. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -52913,7 +52265,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessModuleSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52938,21 +52290,21 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (baseAddress == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } - if (slot == null) + if (connectionEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } - if (instanceId == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -52971,22 +52323,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("baseAddress", baseAddress); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessModuleSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateHybridConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -53000,7 +52351,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53031,6 +52382,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -53051,7 +52408,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -53081,7 +52438,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -53094,7 +52451,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -53114,29 +52471,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Retrieves all Service Bus Hybrid Connections used by this Web App. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Retrieves all Service Bus Hybrid Connections used by this + /// Web App. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// The name of the web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. - /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -53159,7 +52507,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessThreadsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListHybridConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -53184,18 +52532,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -53213,20 +52553,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHybridConnectionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -53291,7 +52627,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -53321,7 +52657,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -53334,7 +52670,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -53354,12 +52690,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Shows whether an app can be cloned to another resource group or - /// subscription. + /// Gets hybrid connections configured for an app (or deployment slot, if + /// specified). /// /// - /// Description for Shows whether an app can be cloned to another resource - /// group or subscription. + /// Description for Gets hybrid connections configured for an app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -53368,8 +52704,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. By default, this API returns information on - /// the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// hybrid connections for the production slot. /// /// /// Headers that will be added to request. @@ -53392,7 +52728,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> IsCloneableSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListRelayServiceConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -53440,11 +52776,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "IsCloneableSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListRelayServiceConnectionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -53461,7 +52797,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53542,7 +52878,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -53555,7 +52891,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -53575,10 +52911,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Gets a hybrid connection configuration by its name. /// /// - /// Description for Gets existing backups of an app. + /// Description for Gets a hybrid connection configuration by its name. /// /// /// Name of the resource group to which the resource belongs. @@ -53586,9 +52922,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the hybrid connection. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// backups of the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get a + /// hybrid connection for the production slot. /// /// /// Headers that will be added to request. @@ -53611,7 +52950,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteBackupsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -53636,6 +52975,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (entityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -53657,15 +53000,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetRelayServiceConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -53680,7 +53025,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53761,7 +53106,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -53774,7 +53119,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -53794,10 +53139,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// This is to allow calling via powershell and ARM template. + /// Creates a new hybrid connection configuration (PUT), or updates an existing + /// one (PATCH). /// /// - /// Description for This is to allow calling via powershell and ARM template. + /// Description for Creates a new hybrid connection configuration (PUT), or + /// updates an existing one (PATCH). /// /// /// Name of the resource group to which the resource belongs. @@ -53805,8 +53152,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the hybrid connection configuration. + /// + /// + /// Details of the hybrid connection configuration. + /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// create or update a hybrid connection for the production slot. /// /// /// Headers that will be added to request. @@ -53829,7 +53183,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSyncFunctionTriggersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -53854,6 +53208,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (entityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -53875,15 +53237,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("entityName", entityName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSyncFunctionTriggersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateRelayServiceConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -53898,7 +53263,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53929,6 +53294,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -53979,7 +53350,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -53992,7 +53363,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -54012,21 +53383,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Returns the status of MySql in app migration, if one is active, and whether - /// or not MySql in app is enabled + /// Deletes a relay service connection by its name. /// /// - /// Description for Returns the status of MySql in app migration, if one is - /// active, and whether or not MySql in app is enabled + /// Description for Deletes a relay service connection by its name. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Name of the hybrid connection configuration. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete a hybrid connection for the production slot. /// /// /// Headers that will be added to request. @@ -54037,9 +53410,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -54049,7 +53419,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMigrateMySqlStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54074,6 +53444,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (entityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -54095,15 +53469,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMigrateMySqlStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteRelayServiceConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -54118,7 +53494,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -54169,7 +53545,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -54199,31 +53575,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -54232,10 +53590,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a Swift Virtual Network connection. + /// Creates a new hybrid connection configuration (PUT), or updates an existing + /// one (PATCH). /// /// - /// Description for Gets a Swift Virtual Network connection. + /// Description for Creates a new hybrid connection configuration (PUT), or + /// updates an existing one (PATCH). /// /// /// Name of the resource group to which the resource belongs. @@ -54243,9 +53603,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the hybrid connection configuration. + /// + /// + /// Details of the hybrid connection configuration. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get a - /// gateway for the production slot's Virtual Network. + /// Name of the deployment slot. If a slot is not specified, the API will + /// create or update a hybrid connection for the production slot. /// /// /// Headers that will be added to request. @@ -54268,7 +53634,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54293,6 +53659,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (entityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -54314,15 +53688,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("entityName", entityName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSwiftVirtualNetworkConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateRelayServiceConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -54337,7 +53714,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -54368,6 +53745,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -54418,7 +53801,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -54431,7 +53814,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -54451,17 +53834,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. + /// Gets all scale-out instances of an app. /// /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. + /// Description for Gets all scale-out instances of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -54469,12 +53845,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Properties of the Virtual Network connection. See example. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API gets the + /// production slot instances. /// /// /// Headers that will be added to request. @@ -54497,7 +53870,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceIdentifiersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54522,10 +53895,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -54547,14 +53916,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateSwiftVirtualNetworkConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -54571,7 +53939,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -54602,12 +53970,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -54658,7 +54020,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -54671,7 +54033,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -54691,12 +54053,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a Swift Virtual Network connection from an app (or deployment - /// slot). + /// Gets all scale-out instances of an app. /// /// - /// Description for Deletes a Swift Virtual Network connection from an app (or - /// deployment slot). + /// Description for Gets all scale-out instances of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -54704,9 +54064,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the connection for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API gets the + /// production slot instances. /// /// /// Headers that will be added to request. @@ -54717,6 +54079,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -54726,7 +54091,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSwiftVirtualNetworkSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceInfoSlotWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54751,6 +54116,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -54772,15 +54141,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSwiftVirtualNetworkSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceInfoSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -54795,7 +54166,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -54846,7 +54217,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -54876,13 +54247,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -54891,30 +54280,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. + /// Get the status of the last MSDeploy operation. /// /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. + /// Description for Get the status of the last MSDeploy operation. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// ID of web app instance. /// /// /// Headers that will be added to request. @@ -54937,7 +54319,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceMsDeployStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54962,14 +54344,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -54987,17 +54369,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSwiftVirtualNetworkConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMsDeployStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -55011,7 +54394,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -55042,12 +54425,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -55098,7 +54475,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -55111,7 +54488,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -55131,25 +54508,58 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all network features used by the app (or deployment slot, if - /// specified). + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Gets all network features used by the app (or deployment - /// slot, if specified). + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// The type of view. This can either be "summary" or "detailed". + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// ID of web app instance. + /// + /// + /// Details of MSDeploy operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, instanceId, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// network features for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// ID of web app instance. /// /// /// Headers that will be added to request. @@ -55172,7 +54582,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListNetworkFeaturesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string view, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceMSDeployLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -55197,14 +54607,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (view == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "view"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -55222,18 +54632,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("view", view); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNetworkFeaturesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMSDeployLogSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{view}", System.Uri.EscapeDataString(view)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -55328,7 +54738,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -55341,7 +54751,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -55361,25 +54771,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// GUID of the operation. + /// Site name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// an operation for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -55402,7 +54813,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -55427,14 +54838,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -55452,18 +54863,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -55528,7 +54939,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -55558,7 +54969,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -55571,25 +54982,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -55609,29 +55002,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site (To be deprecated). + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Start capturing network packets for the site (To be - /// deprecated). + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. + /// Site name. /// - /// - /// The duration to keep capturing in seconds. + /// + /// PID. /// - /// - /// The maximum frame length in bytes (Optional). + /// + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// - /// - /// The Blob URL to store capture file. + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -55654,7 +55047,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> StartWebSiteNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -55679,10 +55072,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -55700,33 +55101,22 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartWebSiteNetworkTraceSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -55738,7 +55128,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -55789,7 +55179,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -55819,7 +55209,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -55832,7 +55222,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -55852,56 +55242,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Terminate a process by its ID for a web site, or a deployment slot, or + /// specific scaled-out instance in a web site. /// /// - /// Description for Start capturing network packets for the site. + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> StartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginStartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stop ongoing capturing network packets for the site. - /// - /// - /// Description for Stop ongoing capturing network packets for the site. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Site name. /// - /// - /// The name of the web app. + /// + /// PID. /// /// - /// The name of the slot for this web app. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -55921,7 +55284,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopWebSiteNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteInstanceProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -55946,10 +55309,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -55967,16 +55338,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopWebSiteNetworkTraceSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceProcessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -55990,7 +55365,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -56041,7 +55416,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -56086,25 +55461,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Get a memory dump of a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Get a memory dump of a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// GUID of the operation. + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// an operation for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -56127,7 +55506,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTracesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessDumpSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -56152,14 +55531,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -56177,18 +55560,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessDumpSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -56245,7 +55630,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -56253,7 +55638,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -56283,7 +55668,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -56293,20 +55678,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -56316,25 +55688,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// GUID of the operation. + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// an operation for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -56357,7 +55733,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTraceOperationSlotV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessModulesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -56382,14 +55758,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -56407,18 +55787,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationSlotV2", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -56483,7 +55865,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -56513,7 +55895,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -56526,25 +55908,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -56564,25 +55928,32 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// GUID of the operation. + /// + /// PID. + /// + /// + /// Module base address. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// an operation for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -56605,7 +55976,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTracesSlotV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessModuleSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -56630,14 +56001,22 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (baseAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -56655,18 +56034,22 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); + tracingParameters.Add("processId", processId); + tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesSlotV2", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessModuleSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -56731,7 +56114,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -56761,7 +56144,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -56774,7 +56157,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -56794,22 +56177,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Generates a new publishing password for an app (or deployment slot, if - /// specified). + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Generates a new publishing password for an app (or - /// deployment slot, if specified). + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API generate a - /// new publishing password for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -56820,6 +56210,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -56829,7 +56222,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task GenerateNewSitePublishingPasswordSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessThreadsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -56854,10 +56247,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -56875,16 +56276,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GenerateNewSitePublishingPasswordSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -56898,7 +56303,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -56949,7 +56354,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -56979,13 +56384,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -56994,26 +56417,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets perfmon counters for web app. + /// Shows whether an app can be cloned to another resource group or + /// subscription. /// /// - /// Description for Gets perfmon counters for web app. + /// Description for Shows whether an app can be cloned to another resource + /// group or subscription. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// Return only usages/metrics specified in the filter. Filter conforms to - /// odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and - /// endTime eq 2014-12-31T23:59:59Z and timeGrain eq - /// duration'[Hour|Minute|Day]'. + /// Name of the deployment slot. By default, this API returns information on + /// the production slot. /// /// /// Headers that will be added to request. @@ -57036,7 +56455,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPerfMonCountersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> IsCloneableSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57083,22 +56502,236 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "IsCloneableSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$filter={0}", filter)); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets existing backups of an app. + /// + /// + /// Description for Gets existing backups of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// backups of the production slot. + /// + /// + /// 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>> ListSiteBackupsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -57110,7 +56743,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -57191,7 +56824,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -57204,7 +56837,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -57224,20 +56857,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets web app's event logs. + /// This is to allow calling via powershell and ARM template. /// /// - /// Description for Gets web app's event logs. + /// Description for This is to allow calling via powershell and ARM template. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -57260,7 +56892,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSitePhpErrorLogFlagSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSyncFunctionTriggersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57308,11 +56940,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSitePhpErrorLogFlagSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncFunctionTriggersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -57329,7 +56961,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -57410,7 +57042,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -57423,7 +57055,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -57443,20 +57075,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the premier add-ons of an app. + /// Returns the status of MySql in app migration, if one is active, and whether + /// or not MySql in app is enabled /// /// - /// Description for Gets the premier add-ons of an app. + /// Description for Returns the status of MySql in app migration, if one is + /// active, and whether or not MySql in app is enabled /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the premier add-ons for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -57479,7 +57112,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListPremierAddOnsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMigrateMySqlStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57527,11 +57160,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPremierAddOnsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMigrateMySqlStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -57629,7 +57262,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -57642,7 +57275,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -57662,10 +57295,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named add-on of an app. + /// Gets a Swift Virtual Network connection. /// /// - /// Description for Gets a named add-on of an app. + /// Description for Gets a Swift Virtual Network connection. /// /// /// Name of the resource group to which the resource belongs. @@ -57673,12 +57306,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Add-on name. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the named add-on for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get a + /// gateway for the production slot's Virtual Network. /// /// /// Headers that will be added to request. @@ -57701,7 +57331,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57726,10 +57356,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -57751,17 +57377,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPremierAddOnSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSwiftVirtualNetworkConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -57857,7 +57481,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -57870,7 +57494,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -57890,10 +57514,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates a named add-on of an app. + /// Deletes a Swift Virtual Network connection from an app (or deployment + /// slot). /// /// - /// Description for Updates a named add-on of an app. + /// Description for Deletes a Swift Virtual Network connection from an app (or + /// deployment slot). /// /// /// Name of the resource group to which the resource belongs. @@ -57901,15 +57527,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Add-on name. - /// - /// - /// A JSON representation of the edited premier add-on. - /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// update the named add-on for the production slot. + /// delete the connection for the production slot. /// /// /// Headers that will be added to request. @@ -57920,9 +57540,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -57932,7 +57549,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddPremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSwiftVirtualNetworkSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57957,18 +57574,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } - if (premierAddOn == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); - } - if (premierAddOn != null) - { - premierAddOn.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -57990,18 +57595,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); - tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddPremierAddOnSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSwiftVirtualNetworkSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -58016,7 +57618,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -58047,12 +57649,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(premierAddOn != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -58073,7 +57669,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -58103,31 +57699,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -58136,10 +57714,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a premier add-on from an app. + /// Gets all network features used by the app (or deployment slot, if + /// specified). /// /// - /// Description for Delete a premier add-on from an app. + /// Description for Gets all network features used by the app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -58147,12 +57727,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Add-on name. + /// + /// The type of view. Only "summary" is supported at this time. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the named add-on for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// network features for the production slot. /// /// /// Headers that will be added to request. @@ -58163,6 +57743,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -58172,7 +57755,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeletePremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListNetworkFeaturesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string view, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58197,9 +57780,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) + if (view == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + throw new ValidationException(ValidationRules.CannotBeNull, "view"); } if (slot == null) { @@ -58222,17 +57805,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("view", view); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeletePremierAddOnSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNetworkFeaturesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); + _url = _url.Replace("{view}", System.Uri.EscapeDataString(view)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -58247,7 +57830,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -58298,7 +57881,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -58328,13 +57911,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -58343,10 +57944,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates a named add-on of an app. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Updates a named add-on of an app. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -58354,15 +57957,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Add-on name. - /// - /// - /// A JSON representation of the edited premier add-on. + /// + /// GUID of the operation. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the named add-on for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// an operation for the production slot. /// /// /// Headers that will be added to request. @@ -58385,7 +57985,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdatePremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58410,13 +58010,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } - if (premierAddOn == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } if (slot == null) { @@ -58439,18 +58035,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); - tracingParameters.Add("premierAddOn", premierAddOn); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdatePremierAddOnSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -58465,7 +58060,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -58496,12 +58091,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(premierAddOn != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -58522,7 +58111,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -58552,7 +58141,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -58565,7 +58154,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -58585,12 +58192,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Start capturing network packets for the site (To be deprecated). /// /// - /// Description for Gets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Start capturing network packets for the site (To be + /// deprecated). /// /// /// Name of the resource group to which the resource belongs. @@ -58599,7 +58205,16 @@ internal WebAppsOperations(WebSiteManagementClient client) /// The name of the web app. /// /// - /// The name of the slot for the web app. + /// The name of the slot for this web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. /// /// /// Headers that will be added to request. @@ -58622,7 +58237,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateAccessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> StartWebSiteNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58668,18 +58283,33 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("durationInSeconds", durationInSeconds); tracingParameters.Add("slot", slot); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateAccessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartWebSiteNetworkTraceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -58691,7 +58321,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -58772,7 +58402,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -58785,7 +58415,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -58805,12 +58435,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Sets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Start capturing network packets for the site. /// /// - /// Description for Sets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. @@ -58818,11 +58446,45 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The name of the web app. /// - /// - /// The information for the private access + /// + /// The name of the slot for this web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> StartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginStartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stop ongoing capturing network packets for the site. + /// + /// + /// Description for Stop ongoing capturing network packets for the site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. /// /// - /// The name of the slot for the web app. + /// The name of the slot for this web app. /// /// /// Headers that will be added to request. @@ -58833,9 +58495,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -58845,7 +58504,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PutPrivateAccessVnetSlotWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopWebSiteNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58870,10 +58529,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (access == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "access"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -58895,14 +58550,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("access", access); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PutPrivateAccessVnetSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopWebSiteNetworkTraceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -58919,7 +58573,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -58950,12 +58604,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(access != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(access, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -58976,7 +58624,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59006,31 +58654,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -59039,18 +58669,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a private endpoint connection + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Gets a private endpoint connection + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// Name of the app. /// - /// + /// + /// GUID of the operation. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// an operation for the production slot. /// /// /// Headers that will be added to request. @@ -59073,7 +58710,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTracesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -59098,9 +58735,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -59119,16 +58760,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -59223,7 +58866,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -59236,7 +58879,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -59256,72 +58899,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a private endpoint connection + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Deletes a private endpoint connection + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// Name of the app. /// - public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// GUID of the operation. /// - /// - /// Name of the site. + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// an operation for the production slot. /// /// /// Headers that will be added to request. @@ -59344,7 +58940,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTraceOperationSlotV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -59369,6 +58965,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -59386,14 +58990,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationSlotV2", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -59458,7 +59066,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59488,7 +59096,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -59501,7 +59109,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -59521,22 +59147,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// + /// GUID of the operation. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// an operation for the production slot. /// /// /// Headers that will be added to request. @@ -59559,7 +59188,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTracesSlotV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -59584,6 +59213,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -59605,15 +59238,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesSlotV2", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -59679,7 +59314,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59709,7 +59344,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -59722,7 +59357,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -59742,25 +59377,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Generates a new publishing password for an app (or deployment slot, if + /// specified). /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Generates a new publishing password for an app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API generate a + /// new publishing password for the production slot. /// /// /// Headers that will be added to request. @@ -59771,9 +59403,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -59783,7 +59412,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task GenerateNewSitePublishingPasswordSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -59808,10 +59437,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -59833,17 +59458,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GenerateNewSitePublishingPasswordSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -59858,7 +59481,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -59909,7 +59532,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59939,31 +59562,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -59972,25 +59577,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Terminate a process by its ID for a web site, or a deployment slot, or - /// specific scaled-out instance in a web site. + /// Gets perfmon counters for web app. /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Gets perfmon counters for web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// Return only usages/metrics specified in the filter. Filter conforms to + /// odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and + /// endTime eq 2014-12-31T23:59:59Z and timeGrain eq + /// duration'[Hour|Minute|Day]'. /// /// /// Headers that will be added to request. @@ -60001,6 +59607,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -60010,7 +59619,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPerfMonCountersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60035,10 +59644,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -60060,20 +59665,23 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteProcessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -60085,7 +59693,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -60136,7 +59744,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -60166,13 +59774,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -60181,25 +59807,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a memory dump of a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets web app's event logs. /// /// - /// Description for Get a memory dump of a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets web app's event logs. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -60222,7 +59843,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessDumpSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSitePhpErrorLogFlagSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60247,10 +59868,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -60272,17 +59889,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessDumpSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSitePhpErrorLogFlagSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -60340,7 +59955,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -60348,7 +59963,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -60378,7 +59993,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -60388,7 +60003,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -60398,25 +60026,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Gets the premier add-ons of an app. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Gets the premier add-ons of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the premier add-ons for the production slot. /// /// /// Headers that will be added to request. @@ -60439,7 +60062,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessModulesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPremierAddOnsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60464,10 +60087,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -60489,17 +60108,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessModulesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPremierAddOnsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -60565,7 +60182,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -60595,7 +60212,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -60608,7 +60225,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -60628,28 +60245,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Gets a named add-on of an app. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Gets a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// - /// - /// Module base address. + /// + /// Add-on name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the named add-on for the production slot. /// /// /// Headers that will be added to request. @@ -60672,7 +60284,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessModuleSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60697,13 +60309,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (baseAddress == null) + if (premierAddOnName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); } if (slot == null) { @@ -60726,19 +60334,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("baseAddress", baseAddress); + tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessModuleSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPremierAddOnSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -60804,7 +60410,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -60834,7 +60440,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -60847,7 +60453,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -60867,25 +60473,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Updates a named add-on of an app. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Updates a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// Add-on name. + /// + /// + /// A JSON representation of the edited premier add-on. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the named add-on for the production slot. /// /// /// Headers that will be added to request. @@ -60908,7 +60515,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessThreadsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AddPremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60933,9 +60540,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (premierAddOnName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } + if (premierAddOn == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); + } + if (premierAddOn != null) + { + premierAddOn.Validate(); } if (slot == null) { @@ -60958,17 +60573,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreadsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddPremierAddOnSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -60983,7 +60599,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -61014,6 +60630,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(premierAddOn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -61034,7 +60656,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -61064,7 +60686,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -61077,7 +60699,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -61097,10 +60719,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get public certificates for an app or a deployment slot. + /// Delete a premier add-on from an app. /// /// - /// Description for Get public certificates for an app or a deployment slot. + /// Description for Delete a premier add-on from an app. /// /// /// Name of the resource group to which the resource belongs. @@ -61108,9 +60730,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Add-on name. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets - /// hostname bindings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the named add-on for the production slot. /// /// /// Headers that will be added to request. @@ -61121,9 +60746,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -61133,7 +60755,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublicCertificatesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeletePremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -61158,6 +60780,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (premierAddOnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -61179,15 +60805,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificatesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeletePremierAddOnSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -61202,7 +60830,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -61283,31 +60911,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -61316,12 +60926,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the named public certificate for an app (or deployment slot, if - /// specified). + /// Updates a named add-on of an app. /// /// - /// Description for Get the named public certificate for an app (or deployment - /// slot, if specified). + /// Description for Updates a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -61329,12 +60937,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API the named - /// binding for the production slot. + /// + /// Add-on name. /// - /// - /// Public certificate name. + /// + /// A JSON representation of the edited premier add-on. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the named add-on for the production slot. /// /// /// Headers that will be added to request. @@ -61357,7 +60968,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdatePremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -61382,13 +60993,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (premierAddOnName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); } - if (publicCertificateName == null) + if (premierAddOn == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -61407,18 +61022,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("slot", slot); - tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPublicCertificateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdatePremierAddOnSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -61432,7 +61048,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -61463,6 +61079,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(premierAddOn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -61513,7 +61135,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -61526,7 +61148,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -61546,27 +61168,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a hostname binding for an app. + /// Gets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Creates a hostname binding for an app. + /// Description for Gets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Public certificate name. - /// - /// - /// Public certificate details. This is the JSON representation of a - /// PublicCertificate object. + /// The name of the web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// create a binding for the production slot. + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -61589,7 +61205,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdatePublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateAccessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -61614,14 +61230,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publicCertificateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); - } - if (publicCertificate == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificate"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -61643,18 +61251,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publicCertificateName", publicCertificateName); - tracingParameters.Add("publicCertificate", publicCertificate); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdatePublicCertificateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateAccessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -61669,7 +61274,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -61700,12 +61305,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(publicCertificate != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publicCertificate, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -61756,7 +61355,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -61769,7 +61368,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -61789,23 +61388,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a hostname binding for an app. + /// Sets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Deletes a hostname binding for an app. + /// Description for Sets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// + /// The information for the private access /// - /// - /// Public certificate name. + /// + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -61816,6 +61416,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -61825,7 +61428,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeletePublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PutPrivateAccessVnetSlotWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -61850,13 +61453,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (access == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "access"); } - if (publicCertificateName == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -61875,18 +61478,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("access", access); tracingParameters.Add("slot", slot); - tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeletePublicCertificateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "PutPrivateAccessVnetSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -61900,7 +61502,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -61931,6 +61533,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(access != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(access, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -61951,7 +61559,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -61981,13 +61589,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -61996,25 +61622,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the publishing profile for an app (or deployment slot, if specified). + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Gets the publishing profile for an app (or deployment slot, - /// if specified). + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Specifies publishingProfileOptions for publishing profile. For example, use - /// {"format": "FileZilla3"} to get a FileZilla publishing profile. + /// Name of the site. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the publishing profile for the production slot. + /// Name of the site deployment slot. /// /// /// Headers that will be added to request. @@ -62037,7 +61658,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListPublishingProfileXmlWithSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetPrivateEndpointConnectionListSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -62062,10 +61683,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publishingProfileOptions == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publishingProfileOptions"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -62087,14 +61704,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publishingProfileOptions", publishingProfileOptions); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublishingProfileXmlWithSecretsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionListSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -62111,7 +61727,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -62142,12 +61758,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(publishingProfileOptions != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publishingProfileOptions, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -62160,7 +61770,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -62198,7 +61808,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -62208,7 +61818,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -62218,22 +61841,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Resets the configuration settings of the current slot if they were - /// previously modified by calling the API with POST. + /// Gets a private endpoint connection /// /// - /// Description for Resets the configuration settings of the current slot if - /// they were previously modified by calling the API with POST. + /// Description for Gets a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of the site. + /// + /// + /// Name of the private endpoint connection. /// /// - /// Name of the deployment slot. If a slot is not specified, the API resets - /// configuration settings for the production slot. + /// Name of the site deployment slot. /// /// /// Headers that will be added to request. @@ -62244,6 +61867,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -62253,7 +61879,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ResetSlotConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -62278,6 +61904,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -62299,15 +61929,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ResetSlotConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -62322,7 +61954,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -62403,13 +62035,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -62418,28 +62068,78 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restarts an app (or deployment slot, if specified). + /// Approves or rejects a private endpoint connection /// /// - /// Description for Restarts an app (or deployment slot, if specified). + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of the site. + /// + /// + /// + /// /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restart the production slot. /// - /// - /// Specify true to apply the configuration settings and restarts the app only - /// if necessary. By default, the API always restarts and reprovisions the app. + /// + /// The headers that will be added to request. /// - /// - /// Specify true to block until the app is restarted. By default, it is set to - /// false, and the API responds immediately (asynchronous). + /// + /// The cancellation token. + /// + public async Task> ApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// /// /// /// Headers that will be added to request. @@ -62450,6 +62150,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -62459,7 +62162,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RestartSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, bool? softRestart = default(bool?), bool? synchronous = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateLinkResourcesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -62506,27 +62209,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("softRestart", softRestart); - tracingParameters.Add("synchronous", synchronous); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RestartSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResourcesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateLinkResources").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (softRestart != null) - { - _queryParameters.Add(string.Format("softRestart={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softRestart, Client.SerializationSettings).Trim('"')))); - } - if (synchronous != null) - { - _queryParameters.Add(string.Format("synchronous={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(synchronous, Client.SerializationSettings).Trim('"')))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -62538,7 +62231,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -62619,13 +62312,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -62634,108 +62345,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores an app from a backup blob in Azure Storage. - /// - /// - /// Description for Restores an app from a backup blob in Azure Storage. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Information on restore request . - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restore a backup of the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreFromBackupBlobSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreFromBackupBlobSlotWithHttpMessagesAsync(resourceGroupName, name, request, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Restores a deleted web app to this web app. - /// - /// - /// Description for Restores a deleted web app to this web app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Deleted web app restore information. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreFromDeletedAppSlotWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreFromDeletedAppSlotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Restores a web app from a snapshot. - /// - /// - /// Description for Restores a web app from a snapshot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Snapshot restore settings. Snapshot information can be obtained by calling - /// GetDeletedSites or GetSiteSnapshots API. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreSnapshotSlotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get list of siteextensions for a web site, or a deployment slot. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Get list of siteextensions for a web site, or a deployment - /// slot. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -62744,8 +62359,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Site name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -62768,7 +62383,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteExtensionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -62816,11 +62431,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -62918,7 +62533,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -62931,7 +62546,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -62951,12 +62566,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get site extension information by its ID for a web site, or a deployment - /// slot. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Get site extension information by its ID for a web site, or - /// a deployment slot. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -62964,12 +62579,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Site extension name. + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -62992,7 +62607,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -63017,9 +62632,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { @@ -63042,17 +62657,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSiteExtensionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -63148,7 +62763,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -63161,7 +62776,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -63181,10 +62796,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Install site extension on a web site, or a deployment slot. + /// Terminate a process by its ID for a web site, or a deployment slot, or + /// specific scaled-out instance in a web site. /// /// - /// Description for Install site extension on a web site, or a deployment slot. + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -63192,32 +62809,208 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Site extension name. + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> InstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// 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 DeleteProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "DeleteProcessSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request - AzureOperationResponse _response = await BeginInstallSiteExtensionSlotWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204 && (int)_statusCode != 404) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; } /// - /// Remove a site extension from a web site, or a deployment slot. + /// Get a memory dump of a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Remove a site extension from a web site, or a deployment - /// slot. + /// Description for Get a memory dump of a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -63225,12 +63018,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Site extension name. + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -63241,6 +63034,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -63250,7 +63046,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessDumpSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -63275,9 +63071,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { @@ -63300,17 +63096,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSiteExtensionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessDumpSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -63325,7 +63121,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -63368,7 +63164,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -63376,7 +63172,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -63406,13 +63202,18 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -63421,58 +63222,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task CopySlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginCopySlotSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the difference in configuration settings between two web app slots. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Get the difference in configuration settings between two - /// web app slots. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// JSON object that contains the target slot name. See example. + /// + /// PID. /// /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -63495,7 +63263,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSlotDifferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessModulesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -63520,13 +63288,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); - } - if (slotSwapEntity != null) + if (processId == null) { - slotSwapEntity.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { @@ -63549,16 +63313,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlotDifferencesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessModulesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -63573,7 +63338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -63604,12 +63369,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -63630,7 +63389,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -63660,7 +63419,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -63673,7 +63432,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -63693,51 +63452,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Swaps two deployment slots of an app. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Swaps two deployment slots of an app. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// Site name. /// - public async Task SwapSlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginSwapSlotSlotWithHttpMessagesAsync(resourceGroupName, name, slotSwapEntity, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns all Snapshots to the user. - /// - /// - /// Description for Returns all Snapshots to the user. - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// PID. /// - /// - /// Website Name. + /// + /// Module base address. /// /// - /// Website Slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -63760,7 +63496,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSnapshotsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessModuleSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -63785,6 +63521,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (baseAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -63806,15 +63550,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessModuleSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -63880,7 +63628,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -63910,7 +63658,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -63923,7 +63671,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -63943,20 +63691,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Returns all Snapshots to the user from DRSecondary endpoint. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Returns all Snapshots to the user from DRSecondary - /// endpoint. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Website Name. + /// Site name. + /// + /// + /// PID. /// /// - /// Website Slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -63979,7 +63732,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSnapshotsFromDRSecondarySlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessThreadsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64004,6 +63757,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -64025,15 +63782,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsFromDRSecondarySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreadsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -64099,7 +63858,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -64129,7 +63888,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -64142,7 +63901,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -64162,10 +63921,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the source control configuration of an app. + /// Get public certificates for an app or a deployment slot. /// /// - /// Description for Gets the source control configuration of an app. + /// Description for Get public certificates for an app or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -64174,8 +63933,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the source control configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API gets + /// hostname bindings for the production slot. /// /// /// Headers that will be added to request. @@ -64198,7 +63957,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPublicCertificatesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64246,11 +64005,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSourceControlSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificatesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -64318,7 +64077,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -64348,7 +64107,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -64361,43 +64120,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -64417,10 +64140,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Get the named public certificate for an app (or deployment slot, if + /// specified). /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Get the named public certificate for an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -64428,41 +64153,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteSourceControl object. See example. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the source control configuration for the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateSourceControlSlotWithHttpMessagesAsync(resourceGroupName, name, siteSourceControl, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes the source control configuration of an app. - /// - /// - /// Description for Deletes the source control configuration of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API the named + /// binding for the production slot. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the source control configuration for the production slot. + /// + /// Public certificate name. /// /// /// Headers that will be added to request. @@ -64473,6 +64169,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -64482,7 +64181,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64511,6 +64210,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (publicCertificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -64529,15 +64232,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); + tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSourceControlSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPublicCertificateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -64551,7 +64256,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -64602,7 +64307,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -64632,13 +64337,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -64647,10 +64370,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Creates a hostname binding for an app. /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Creates a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. @@ -64658,12 +64381,16 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteSourceControl object. See example. + /// + /// Public certificate name. + /// + /// + /// Public certificate details. This is the JSON representation of a + /// PublicCertificate object. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// update the source control configuration for the production slot. + /// create a binding for the production slot. /// /// /// Headers that will be added to request. @@ -64686,7 +64413,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdatePublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64711,9 +64438,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteSourceControl == null) + if (publicCertificateName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } + if (publicCertificate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificate"); } if (slot == null) { @@ -64736,16 +64467,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteSourceControl", siteSourceControl); + tracingParameters.Add("publicCertificateName", publicCertificateName); + tracingParameters.Add("publicCertificate", publicCertificate); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSourceControlSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdatePublicCertificateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -64760,7 +64493,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -64791,9 +64524,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteSourceControl != null) + if(publicCertificate != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publicCertificate, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -64817,7 +64550,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -64847,7 +64580,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -64860,43 +64593,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -64916,10 +64613,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Starts an app (or deployment slot, if specified). + /// Deletes a hostname binding for an app. /// /// - /// Description for Starts an app (or deployment slot, if specified). + /// Description for Deletes a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. @@ -64928,8 +64625,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will start - /// the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. + /// + /// + /// Public certificate name. /// /// /// Headers that will be added to request. @@ -64949,7 +64649,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeletePublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64978,6 +64678,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (publicCertificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -64996,15 +64700,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); + tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeletePublicCertificateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -65018,7 +64724,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -65069,7 +64775,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -65114,47 +64820,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. - /// - /// - /// Description for Start capturing network packets for the site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> StartNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginStartNetworkTraceSlotWithHttpMessagesAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stops an app (or deployment slot, if specified). + /// Gets the publishing profile for an app (or deployment slot, if specified). /// /// - /// Description for Stops an app (or deployment slot, if specified). + /// Description for Gets the publishing profile for an app (or deployment slot, + /// if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -65162,9 +64832,13 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Specifies publishingProfileOptions for publishing profile. For example, use + /// {"format": "FileZilla3"} to get a FileZilla publishing profile. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will stop - /// the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the publishing profile for the production slot. /// /// /// Headers that will be added to request. @@ -65175,6 +64849,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -65184,7 +64861,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPublishingProfileXmlWithSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -65209,6 +64886,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (publishingProfileOptions == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publishingProfileOptions"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -65230,13 +64911,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("publishingProfileOptions", publishingProfileOptions); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublishingProfileXmlWithSecretsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -65284,6 +64966,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(publishingProfileOptions != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publishingProfileOptions, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -65296,7 +64984,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -65334,13 +65022,18 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -65349,19 +65042,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Stop ongoing capturing network packets for the site. + /// Resets the configuration settings of the current slot if they were + /// previously modified by calling the API with POST. /// /// - /// Description for Stop ongoing capturing network packets for the site. + /// Description for Resets the configuration settings of the current slot if + /// they were previously modified by calling the API with POST. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. /// /// - /// The name of the slot for this web app. + /// Name of the deployment slot. If a slot is not specified, the API resets + /// configuration settings for the production slot. /// /// /// Headers that will be added to request. @@ -65381,7 +65077,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ResetSlotConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -65429,11 +65125,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopNetworkTraceSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ResetSlotConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -65501,7 +65197,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -65546,20 +65242,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Sync web app repository. + /// Restarts an app (or deployment slot, if specified). /// /// - /// Description for Sync web app repository. + /// Description for Restarts an app (or deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// restart the production slot. + /// + /// + /// Specify true to apply the configuration settings and restarts the app only + /// if necessary. By default, the API always restarts and reprovisions the app. + /// + /// + /// Specify true to block until the app is restarted. By default, it is set to + /// false, and the API responds immediately (asynchronous). /// /// /// Headers that will be added to request. @@ -65579,7 +65283,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncRepositorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RestartSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, bool? softRestart = default(bool?), bool? synchronous = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -65626,17 +65330,27 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); + tracingParameters.Add("softRestart", softRestart); + tracingParameters.Add("synchronous", synchronous); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncRepositorySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RestartSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (softRestart != null) + { + _queryParameters.Add(string.Format("softRestart={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softRestart, Client.SerializationSettings).Trim('"')))); + } + if (synchronous != null) + { + _queryParameters.Add(string.Format("synchronous={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(synchronous, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -65744,10 +65458,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Syncs function trigger metadata to the management database + /// Restores an app from a backup blob in Azure Storage. /// /// - /// Description for Syncs function trigger metadata to the management database + /// Description for Restores an app from a backup blob in Azure Storage. /// /// /// Name of the resource group to which the resource belongs. @@ -65755,8 +65469,107 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Information on restore request . + /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// restore a backup of the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFromBackupBlobSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFromBackupBlobSlotWithHttpMessagesAsync(resourceGroupName, name, request, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores a deleted web app to this web app. + /// + /// + /// Description for Restores a deleted web app to this web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Deleted web app restore information. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFromDeletedAppSlotWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFromDeletedAppSlotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores a web app from a snapshot. + /// + /// + /// Description for Restores a web app from a snapshot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Snapshot restore settings. Snapshot information can be obtained by calling + /// GetDeletedSites or GetSiteSnapshots API. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreSnapshotSlotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get list of siteextensions for a web site, or a deployment slot. + /// + /// + /// Description for Get list of siteextensions for a web site, or a deployment + /// slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -65767,6 +65580,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -65776,7 +65592,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncFunctionTriggersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteExtensionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -65824,11 +65640,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionTriggersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -65845,7 +65661,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -65896,7 +65712,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -65926,13 +65742,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -65941,10 +65775,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List triggered web jobs for an app, or a deployment slot. + /// Get site extension information by its ID for a web site, or a deployment + /// slot. /// /// - /// Description for List triggered web jobs for an app, or a deployment slot. + /// Description for Get site extension information by its ID for a web site, or + /// a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -65952,9 +65788,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// Site extension name. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -65977,7 +65816,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTriggeredWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66002,6 +65841,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteExtensionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -66023,15 +65866,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteExtensionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -66097,7 +65942,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -66127,7 +65972,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -66140,7 +65985,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -66160,11 +66005,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a triggered web job by its ID for an app, or a deployment slot. + /// Install site extension on a web site, or a deployment slot. /// /// - /// Description for Gets a triggered web job by its ID for an app, or a - /// deployment slot. + /// Description for Install site extension on a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -66172,14 +66016,47 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Name of Web Job. + /// + /// Site extension name. /// /// /// Name of the deployment slot. If a slot is not specified, the API uses the /// production slot. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> InstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginInstallSiteExtensionSlotWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Remove a site extension from a web site, or a deployment slot. + /// + /// + /// Description for Remove a site extension from a web site, or a deployment + /// slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Site extension name. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. + /// + /// /// Headers that will be added to request. /// /// @@ -66188,9 +66065,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -66200,7 +66074,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66225,9 +66099,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (slot == null) { @@ -66250,17 +66124,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSiteExtensionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -66275,7 +66149,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -66326,7 +66200,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -66356,31 +66230,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -66389,24 +66245,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a triggered web job by its ID for an app, or a deployment slot. + /// Get the difference in configuration settings between two web app slots. /// /// - /// Description for Delete a triggered web job by its ID for an app, or a - /// deployment slot. + /// Description for Get the difference in configuration settings between two + /// web app slots. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// JSON object that contains the target slot name. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes - /// web job for the production slot. + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. /// /// /// Headers that will be added to request. @@ -66417,6 +66273,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -66426,7 +66285,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSlotDifferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66451,9 +66310,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (slotSwapEntity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); } if (slot == null) { @@ -66476,17 +66339,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteTriggeredWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlotDifferencesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -66501,7 +66363,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -66532,6 +66394,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -66552,7 +66420,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -66582,13 +66450,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -66597,24 +66483,51 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List a triggered web job's history for an app, or a deployment slot. + /// Swaps two deployment slots of an app. /// /// - /// Description for List a triggered web job's history for an app, or a - /// deployment slot. + /// Description for Swaps two deployment slots of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// JSON object that contains the target slot name. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task SwapSlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginSwapSlotSlotWithHttpMessagesAsync(resourceGroupName, name, slotSwapEntity, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns all Snapshots to the user. + /// + /// + /// Description for Returns all Snapshots to the user. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Website Name. + /// + /// + /// Website Slot. /// /// /// Headers that will be added to request. @@ -66637,7 +66550,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTriggeredWebJobHistorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSnapshotsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66662,10 +66575,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -66687,17 +66596,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobHistorySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -66763,7 +66670,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -66793,7 +66700,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -66806,7 +66713,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -66826,28 +66733,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a triggered web job's history by its ID for an app, , or a deployment - /// slot. + /// Returns all Snapshots to the user from DRSecondary endpoint. /// /// - /// Description for Gets a triggered web job's history by its ID for an app, , - /// or a deployment slot. + /// Description for Returns all Snapshots to the user from DRSecondary + /// endpoint. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. - /// - /// - /// History ID. + /// Website Name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Website Slot. /// /// /// Headers that will be added to request. @@ -66870,7 +66769,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTriggeredWebJobHistorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSnapshotsFromDRSecondarySlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66895,14 +66794,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } - if (id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -66924,19 +66815,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); - tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobHistorySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsFromDRSecondarySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -67002,7 +66889,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -67032,7 +66919,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -67045,7 +66932,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -67065,23 +66952,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Run a triggered web job for an app, or a deployment slot. + /// Gets the source control configuration of an app. /// /// - /// Description for Run a triggered web job for an app, or a deployment slot. + /// Description for Gets the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the source control configuration for the production slot. /// /// /// Headers that will be added to request. @@ -67092,6 +66976,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -67101,7 +66988,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RunTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -67126,10 +67013,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -67151,17 +67034,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RunTriggeredWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSourceControlSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -67176,7 +67057,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -67227,7 +67108,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -67257,13 +67138,67 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -67272,12 +67207,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the quota usage information of an app (or deployment slot, if - /// specified). + /// Updates the source control configuration of an app. /// /// - /// Description for Gets the quota usage information of an app (or deployment - /// slot, if specified). + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -67285,15 +67218,43 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// JSON representation of a SiteSourceControl object. See example. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// quota information of the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the source control configuration for the production slot. /// - /// - /// Return only information specified in the filter (using OData syntax). For - /// example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and - /// startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and - /// timeGrain eq duration'[Hour|Minute|Day]'. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateSourceControlSlotWithHttpMessagesAsync(resourceGroupName, name, siteSourceControl, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the source control configuration of an app. + /// + /// + /// Description for Deletes the source control configuration of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the source control configuration for the production slot. + /// + /// /// /// /// Headers that will be added to request. @@ -67304,9 +67265,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -67316,7 +67274,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListUsagesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string additionalFlags = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -67363,21 +67321,21 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("filter", filter); + tracingParameters.Add("additionalFlags", additionalFlags); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsagesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSourceControlSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) + if (additionalFlags != null) { - _queryParameters.Add(string.Format("$filter={0}", filter)); + _queryParameters.Add(string.Format("additionalFlags={0}", System.Uri.EscapeDataString(additionalFlags))); } if (Client.ApiVersion != null) { @@ -67390,7 +67348,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -67441,7 +67399,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -67471,31 +67429,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -67504,11 +67444,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the virtual networks the app (or deployment slot) is connected to. + /// Updates the source control configuration of an app. /// /// - /// Description for Gets the virtual networks the app (or deployment slot) is - /// connected to. + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -67516,9 +67455,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// JSON representation of a SiteSourceControl object. See example. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// virtual network connections for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the source control configuration for the production slot. /// /// /// Headers that will be added to request. @@ -67541,7 +67483,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVnetConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -67566,6 +67508,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteSourceControl == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -67587,13 +67533,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteSourceControl", siteSourceControl); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVnetConnectionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSourceControlSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -67610,7 +67557,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -67641,6 +67588,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteSourceControl != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -67661,7 +67614,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -67691,7 +67644,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -67704,7 +67657,43 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -67724,12 +67713,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a virtual network the app (or deployment slot) is connected to by - /// name. + /// Starts an app (or deployment slot, if specified). /// /// - /// Description for Gets a virtual network the app (or deployment slot) is - /// connected to by name. + /// Description for Starts an app (or deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -67737,12 +67724,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the virtual network. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the named virtual network for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will start + /// the production slot. /// /// /// Headers that will be added to request. @@ -67753,9 +67737,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -67765,7 +67746,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StartSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -67790,10 +67771,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -67815,17 +67792,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -67840,7 +67815,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -67921,31 +67896,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -67954,28 +67911,57 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a Virtual Network connection to an app or slot (PUT) or updates the - /// connection properties (PATCH). + /// Start capturing network packets for the site. /// /// - /// Description for Adds a Virtual Network connection to an app or slot (PUT) - /// or updates the connection properties (PATCH). + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of an existing Virtual Network. + /// + /// The name of the slot for this web app. /// - /// - /// Properties of the Virtual Network connection. See example. + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> StartNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginStartNetworkTraceSlotWithHttpMessagesAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stops an app (or deployment slot, if specified). + /// + /// + /// Description for Stops an app (or deployment slot, if specified). + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will stop + /// the production slot. /// /// /// Headers that will be added to request. @@ -67986,9 +67972,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -67998,7 +67981,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68023,14 +68006,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68052,18 +68027,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -68078,7 +68050,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68109,12 +68081,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -68165,31 +68131,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -68198,25 +68146,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a connection from an app (or deployment slot to a named virtual - /// network. + /// Stop ongoing capturing network packets for the site. /// /// - /// Description for Deletes a connection from an app (or deployment slot to a - /// named virtual network. + /// Description for Stop ongoing capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the virtual network. + /// The name of the web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the connection for the production slot. + /// The name of the slot for this web app. /// /// /// Headers that will be added to request. @@ -68236,7 +68178,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68261,10 +68203,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68286,17 +68224,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteVnetConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopNetworkTraceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -68311,7 +68247,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68362,7 +68298,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -68407,28 +68343,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a Virtual Network connection to an app or slot (PUT) or updates the - /// connection properties (PATCH). + /// Sync web app repository. /// /// - /// Description for Adds a Virtual Network connection to an app or slot (PUT) - /// or updates the connection properties (PATCH). + /// Description for Sync web app repository. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of an existing Virtual Network. - /// - /// - /// Properties of the Virtual Network connection. See example. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -68439,9 +68367,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -68451,7 +68376,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncRepositorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68476,14 +68401,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68505,18 +68422,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncRepositorySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -68531,7 +68445,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68562,12 +68476,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -68618,31 +68526,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -68651,10 +68541,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets an app's Virtual Network gateway. + /// Syncs function trigger metadata to the management database /// /// - /// Description for Gets an app's Virtual Network gateway. + /// Description for Syncs function trigger metadata to the management database /// /// /// Name of the resource group to which the resource belongs. @@ -68662,15 +68552,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get a - /// gateway for the production slot's Virtual Network. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -68681,9 +68564,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -68693,7 +68573,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncFunctionTriggersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68718,14 +68598,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68747,19 +68619,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionGatewaySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionTriggersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -68774,7 +68642,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68825,7 +68693,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -68855,31 +68723,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -68888,30 +68738,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// List triggered web jobs for an app, or a deployment slot. /// /// - /// Description for Adds a gateway to a connected Virtual Network (PUT) or - /// updates it (PATCH). + /// Description for List triggered web jobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". - /// - /// - /// The properties to update this gateway with. + /// Site name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update a gateway for the production slot's Virtual Network. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -68934,7 +68774,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListTriggeredWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68959,22 +68799,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } - if (connectionEnvelope != null) - { - connectionEnvelope.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68996,20 +68820,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionGatewaySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -69024,7 +68843,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -69055,12 +68874,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -69111,7 +68924,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -69124,7 +68937,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -69144,30 +68957,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Gets a triggered web job by its ID for an app, or a deployment slot. /// /// - /// Description for Adds a gateway to a connected Virtual Network (PUT) or - /// updates it (PATCH). + /// Description for Gets a triggered web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". + /// Site name. /// - /// - /// The properties to update this gateway with. + /// + /// Name of Web Job. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update a gateway for the production slot's Virtual Network. + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -69190,7 +68997,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69215,17 +69022,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (connectionEnvelope == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (slot == null) { @@ -69248,20 +69047,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionGatewaySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -69276,7 +69072,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -69307,12 +69103,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -69333,7 +69123,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -69363,7 +69153,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -69376,7 +69166,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -69396,10 +69186,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List webjobs for an app, or a deployment slot. + /// Delete a triggered web job by its ID for an app, or a deployment slot. /// /// - /// Description for List webjobs for an app, or a deployment slot. + /// Description for Delete a triggered web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -69407,9 +69198,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// Name of Web Job. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes + /// web job for the production slot. /// /// /// Headers that will be added to request. @@ -69420,9 +69214,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -69432,7 +69223,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69457,6 +69248,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -69478,15 +69273,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebJobsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteTriggeredWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -69501,7 +69298,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -69552,7 +69349,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -69582,31 +69379,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -69615,10 +69394,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get webjob information for an app, or a deployment slot. + /// List a triggered web job's history for an app, or a deployment slot. /// /// - /// Description for Get webjob information for an app, or a deployment slot. + /// Description for List a triggered web job's history for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -69627,11 +69407,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Site name. /// /// - /// Name of the web job. + /// Name of Web Job. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -69654,7 +69434,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListTriggeredWebJobHistorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69707,11 +69487,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobHistorySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); @@ -69780,7 +69560,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -69810,7 +69590,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -69823,7 +69603,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -69843,20 +69623,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the difference in configuration settings between two web app slots. + /// Gets a triggered web job's history by its ID for an app, , or a deployment + /// slot. /// /// - /// Description for Get the difference in configuration settings between two - /// web app slots. + /// Description for Gets a triggered web job's history by its ID for an app, , + /// or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// JSON object that contains the target slot name. See example. + /// + /// Name of Web Job. + /// + /// + /// History ID. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -69879,7 +69667,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSlotDifferencesFromProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetTriggeredWebJobHistorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69904,13 +69692,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } - if (slotSwapEntity != null) + if (id == null) { - slotSwapEntity.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -69929,15 +69721,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("id", id); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlotDifferencesFromProduction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobHistorySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -69951,7 +69748,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -69982,12 +69779,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -70008,7 +69799,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70038,7 +69829,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -70051,7 +69842,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -70071,44 +69862,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Swaps two deployment slots of an app. + /// Run a triggered web job for an app, or a deployment slot. /// /// - /// Description for Swaps two deployment slots of an app. + /// Description for Run a triggered web job for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// Site name. /// - public async Task SwapSlotWithProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginSwapSlotWithProductionWithHttpMessagesAsync(resourceGroupName, name, slotSwapEntity, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns all Snapshots to the user. - /// - /// - /// Description for Returns all Snapshots to the user. - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Name of Web Job. /// - /// - /// Website Name. + /// + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -70119,9 +69889,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -70131,7 +69898,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSnapshotsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RunTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -70156,6 +69923,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -70173,14 +69948,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSnapshots", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RunTriggeredWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -70194,7 +69973,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -70245,7 +70024,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70275,31 +70054,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -70308,17 +70069,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Returns all Snapshots to the user from DRSecondary endpoint. + /// Gets the quota usage information of an app (or deployment slot, if + /// specified). /// /// - /// Description for Returns all Snapshots to the user from DRSecondary - /// endpoint. + /// Description for Gets the quota usage information of an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Website Name. + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// quota information of the production slot. + /// + /// + /// Return only information specified in the filter (using OData syntax). For + /// example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and + /// startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and + /// timeGrain eq duration'[Hour|Minute|Day]'. /// /// /// Headers that will be added to request. @@ -70341,7 +70113,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSnapshotsFromDRSecondaryWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListUsagesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -70366,6 +70138,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -70383,16 +70159,23 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsFromDRSecondary", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListUsagesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -70485,7 +70268,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -70498,7 +70281,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -70518,10 +70301,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the source control configuration of an app. + /// Gets the virtual networks the app (or deployment slot) is connected to. /// /// - /// Description for Gets the source control configuration of an app. + /// Description for Gets the virtual networks the app (or deployment slot) is + /// connected to. /// /// /// Name of the resource group to which the resource belongs. @@ -70529,6 +70313,10 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// virtual network connections for the production slot. + /// /// /// Headers that will be added to request. /// @@ -70550,7 +70338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVnetConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -70575,6 +70363,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -70592,14 +70384,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSourceControl", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVnetConnectionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -70664,7 +70458,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70694,7 +70488,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -70707,43 +70501,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -70763,10 +70521,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Gets a virtual network the app (or deployment slot) is connected to by + /// name. /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Gets a virtual network the app (or deployment slot) is + /// connected to by name. /// /// /// Name of the resource group to which the resource belongs. @@ -70774,33 +70534,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteSourceControl object. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateSourceControlWithHttpMessagesAsync(resourceGroupName, name, siteSourceControl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes the source control configuration of an app. - /// - /// - /// Description for Deletes the source control configuration of an app. - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Name of the virtual network. /// - /// - /// Name of the app. + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the named virtual network for the production slot. /// /// /// Headers that will be added to request. @@ -70811,6 +70550,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -70820,7 +70562,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -70845,6 +70587,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -70862,14 +70612,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSourceControl", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -70883,7 +70637,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -70934,7 +70688,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70964,13 +70718,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -70979,10 +70751,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Adds a Virtual Network connection to an app or slot (PUT) or updates the + /// connection properties (PATCH). /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Adds a Virtual Network connection to an app or slot (PUT) + /// or updates the connection properties (PATCH). /// /// /// Name of the resource group to which the resource belongs. @@ -70990,8 +70764,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteSourceControl object. See example. + /// + /// Name of an existing Virtual Network. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update connections for the production slot. /// /// /// Headers that will be added to request. @@ -71014,7 +70795,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71039,9 +70820,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteSourceControl == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -71060,15 +70849,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteSourceControl", siteSourceControl); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSourceControl", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71082,7 +70875,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71113,9 +70906,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteSourceControl != null) + if(connectionEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -71139,7 +70932,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -71169,7 +70962,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -71182,43 +70975,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -71238,10 +70995,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Starts an app (or deployment slot, if specified). + /// Deletes a connection from an app (or deployment slot to a named virtual + /// network. /// /// - /// Description for Starts an app (or deployment slot, if specified). + /// Description for Deletes a connection from an app (or deployment slot to a + /// named virtual network. /// /// /// Name of the resource group to which the resource belongs. @@ -71249,6 +71008,13 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the virtual network. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the connection for the production slot. + /// /// /// Headers that will be added to request. /// @@ -71267,7 +71033,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71292,6 +71058,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -71309,14 +71083,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Start", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteVnetConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71330,7 +71108,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71381,7 +71159,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -71426,50 +71204,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Adds a Virtual Network connection to an app or slot (PUT) or updates the + /// connection properties (PATCH). /// /// - /// Description for Start capturing network packets for the site. + /// Description for Adds a Virtual Network connection to an app or slot (PUT) + /// or updates the connection properties (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// The headers that will be added to request. + /// Name of the app. /// - /// - /// The cancellation token. + /// + /// Name of an existing Virtual Network. /// - public async Task>> StartNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginStartNetworkTraceWithHttpMessagesAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stops an app (or deployment slot, if specified). - /// - /// - /// Description for Stops an app (or deployment slot, if specified). - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Properties of the Virtual Network connection. See example. /// - /// - /// Name of the app. + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update connections for the production slot. /// /// /// Headers that will be added to request. @@ -71480,6 +71236,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -71489,7 +71248,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71514,6 +71273,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -71531,14 +71302,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Stop", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71552,7 +71328,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71583,6 +71359,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -71633,13 +71415,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -71648,16 +71448,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Stop ongoing capturing network packets for the site. + /// Gets an app's Virtual Network gateway. /// /// - /// Description for Stop ongoing capturing network packets for the site. + /// Description for Gets an app's Virtual Network gateway. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. + /// + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get a + /// gateway for the production slot's Virtual Network. /// /// /// Headers that will be added to request. @@ -71668,6 +71478,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -71677,7 +71490,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71702,6 +71515,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -71719,14 +71544,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopNetworkTrace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionGatewaySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71740,7 +71571,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71791,7 +71622,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -71821,13 +71652,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -71836,16 +71685,30 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Sync web app repository. + /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). /// /// - /// Description for Sync web app repository. + /// Description for Adds a gateway to a connected Virtual Network (PUT) or + /// updates it (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// The properties to update this gateway with. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update a gateway for the production slot's Virtual Network. /// /// /// Headers that will be added to request. @@ -71856,6 +71719,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -71865,7 +71731,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncRepositoryWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71890,6 +71756,26 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (connectionEnvelope != null) + { + connectionEnvelope.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -71907,14 +71793,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncRepository", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionGatewaySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71928,7 +71821,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71959,6 +71852,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -72009,13 +71908,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -72024,10 +71941,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Syncs function trigger metadata to the management database + /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). /// /// - /// Description for Syncs function trigger metadata to the management database + /// Description for Adds a gateway to a connected Virtual Network (PUT) or + /// updates it (PATCH). /// /// /// Name of the resource group to which the resource belongs. @@ -72035,6 +71953,19 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// The properties to update this gateway with. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update a gateway for the production slot's Virtual Network. + /// /// /// Headers that will be added to request. /// @@ -72044,6 +71975,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -72053,7 +71987,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncFunctionTriggersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72078,6 +72012,22 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -72095,14 +72045,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionTriggers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionGatewaySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72116,7 +72073,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -72147,6 +72104,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -72167,7 +72130,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -72197,13 +72160,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -72212,10 +72193,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List triggered web jobs for an app, or a deployment slot. + /// List webjobs for an app, or a deployment slot. /// /// - /// Description for List triggered web jobs for an app, or a deployment slot. + /// Description for List webjobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -72223,6 +72204,10 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// /// /// Headers that will be added to request. /// @@ -72244,7 +72229,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTriggeredWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72269,6 +72254,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -72286,14 +72275,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebJobsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72388,7 +72379,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -72401,7 +72392,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -72421,11 +72412,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a triggered web job by its ID for an app, or a deployment slot. + /// Get webjob information for an app, or a deployment slot. /// /// - /// Description for Gets a triggered web job by its ID for an app, or a - /// deployment slot. + /// Description for Get webjob information for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -72434,7 +72424,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Site name. /// /// - /// Name of Web Job. + /// Name of the web job. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -72457,7 +72451,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72486,6 +72480,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -72504,15 +72502,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72577,7 +72577,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -72607,7 +72607,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -72620,7 +72620,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -72640,218 +72640,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a triggered web job by its ID for an app, or a deployment slot. - /// - /// - /// Description for Delete a triggered web job by its ID for an app, or a - /// deployment slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// - /// - /// Name of Web Job. - /// - /// - /// 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 DeleteTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteTriggeredWebJob", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// List a triggered web job's history for an app, or a deployment slot. + /// Get the difference in configuration settings between two web app slots. /// /// - /// Description for List a triggered web job's history for an app, or a - /// deployment slot. + /// Description for Get the difference in configuration settings between two + /// web app slots. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// JSON object that contains the target slot name. See example. /// /// /// Headers that will be added to request. @@ -72874,7 +72676,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTriggeredWebJobHistoryWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSlotDifferencesFromProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72899,9 +72701,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (slotSwapEntity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); } if (Client.SubscriptionId == null) { @@ -72920,16 +72726,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobHistory", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlotDifferencesFromProduction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72943,7 +72748,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -72974,6 +72779,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -72994,7 +72805,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73024,7 +72835,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -73037,7 +72848,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -73057,24 +72868,44 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a triggered web job's history by its ID for an app, , or a deployment - /// slot. + /// Swaps two deployment slots of an app. /// /// - /// Description for Gets a triggered web job's history by its ID for an app, , - /// or a deployment slot. + /// Description for Swaps two deployment slots of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// JSON object that contains the target slot name. See example. /// - /// - /// History ID. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task SwapSlotWithProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginSwapSlotWithProductionWithHttpMessagesAsync(resourceGroupName, name, slotSwapEntity, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns all Snapshots to the user. + /// + /// + /// Description for Returns all Snapshots to the user. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Website Name. /// /// /// Headers that will be added to request. @@ -73097,7 +72928,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTriggeredWebJobHistoryWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSnapshotsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73122,14 +72953,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } - if (id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -73147,18 +72970,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); - tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobHistory", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSnapshots", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -73223,7 +73042,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73253,7 +73072,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -73266,7 +73085,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -73286,19 +73105,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Run a triggered web job for an app, or a deployment slot. + /// Returns all Snapshots to the user from DRSecondary endpoint. /// /// - /// Description for Run a triggered web job for an app, or a deployment slot. + /// Description for Returns all Snapshots to the user from DRSecondary + /// endpoint. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Website Name. /// /// /// Headers that will be added to request. @@ -73309,6 +73126,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -73318,7 +73138,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RunTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSnapshotsFromDRSecondaryWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73343,10 +73163,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -73364,16 +73180,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RunTriggeredWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsFromDRSecondary", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -73387,7 +73201,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -73438,7 +73252,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73468,13 +73282,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -73483,12 +73315,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the quota usage information of an app (or deployment slot, if - /// specified). + /// Gets the source control configuration of an app. /// /// - /// Description for Gets the quota usage information of an app (or deployment - /// slot, if specified). + /// Description for Gets the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -73496,12 +73326,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Return only information specified in the filter (using OData syntax). For - /// example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and - /// startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and - /// timeGrain eq duration'[Hour|Minute|Day]'. - /// /// /// Headers that will be added to request. /// @@ -73523,7 +73347,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73565,21 +73389,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSourceControl", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -73642,7 +73461,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73672,7 +73491,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -73685,7 +73504,43 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -73705,11 +73560,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the virtual networks the app (or deployment slot) is connected to. + /// Updates the source control configuration of an app. /// /// - /// Description for Gets the virtual networks the app (or deployment slot) is - /// connected to. + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -73717,6 +73571,36 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// JSON representation of a SiteSourceControl object. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateSourceControlWithHttpMessagesAsync(resourceGroupName, name, siteSourceControl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the source control configuration of an app. + /// + /// + /// Description for Deletes the source control configuration of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// /// /// Headers that will be added to request. /// @@ -73726,9 +73610,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -73738,7 +73619,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVnetConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, string additionalFlags = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73780,16 +73661,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("additionalFlags", additionalFlags); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVnetConnections", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSourceControl", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (additionalFlags != null) + { + _queryParameters.Add(string.Format("additionalFlags={0}", System.Uri.EscapeDataString(additionalFlags))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -73801,7 +73687,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -73852,7 +73738,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73882,31 +73768,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -73915,12 +73783,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a virtual network the app (or deployment slot) is connected to by - /// name. + /// Updates the source control configuration of an app. /// /// - /// Description for Gets a virtual network the app (or deployment slot) is - /// connected to by name. + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -73928,8 +73794,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the virtual network. + /// + /// JSON representation of a SiteSourceControl object. See example. /// /// /// Headers that will be added to request. @@ -73952,7 +73818,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73977,9 +73843,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) + if (siteSourceControl == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); } if (Client.SubscriptionId == null) { @@ -73998,16 +73864,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("siteSourceControl", siteSourceControl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSourceControl", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74021,7 +73886,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74052,6 +73917,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteSourceControl != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -74072,7 +73943,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -74102,7 +73973,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -74115,7 +73986,43 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -74135,12 +74042,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a Virtual Network connection to an app or slot (PUT) or updates the - /// connection properties (PATCH). + /// Starts an app (or deployment slot, if specified). /// /// - /// Description for Adds a Virtual Network connection to an app or slot (PUT) - /// or updates the connection properties (PATCH). + /// Description for Starts an app (or deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -74148,12 +74053,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of an existing Virtual Network. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// /// /// Headers that will be added to request. /// @@ -74163,9 +74062,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -74175,7 +74071,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StartWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74200,14 +74096,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -74225,17 +74113,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Start", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74249,7 +74134,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74280,12 +74165,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -74336,31 +74215,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -74369,21 +74230,50 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a connection from an app (or deployment slot to a named virtual - /// network. + /// Start capturing network packets for the site. /// /// - /// Description for Deletes a connection from an app (or deployment slot to a - /// named virtual network. + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of the virtual network. + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> StartNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginStartNetworkTraceWithHttpMessagesAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stops an app (or deployment slot, if specified). + /// + /// + /// Description for Stops an app (or deployment slot, if specified). + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. /// /// /// Headers that will be added to request. @@ -74403,7 +74293,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74428,10 +74318,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -74449,16 +74335,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteVnetConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Stop", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74472,7 +74356,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74523,7 +74407,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -74568,24 +74452,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a Virtual Network connection to an app or slot (PUT) or updates the - /// connection properties (PATCH). + /// Stop ongoing capturing network packets for the site. /// /// - /// Description for Adds a Virtual Network connection to an app or slot (PUT) - /// or updates the connection properties (PATCH). + /// Description for Stop ongoing capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of an existing Virtual Network. - /// - /// - /// Properties of the Virtual Network connection. See example. + /// The name of the web app. /// /// /// Headers that will be added to request. @@ -74596,9 +74472,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -74608,7 +74481,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74633,14 +74506,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -74658,17 +74523,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopNetworkTrace", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74682,7 +74544,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74713,12 +74575,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -74739,7 +74595,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -74769,31 +74625,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -74802,22 +74640,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets an app's Virtual Network gateway. + /// Sync web app repository. /// /// - /// Description for Gets an app's Virtual Network gateway. + /// Description for Sync web app repository. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". + /// Name of web app. /// /// /// Headers that will be added to request. @@ -74828,9 +74660,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -74840,7 +74669,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncRepositoryWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74865,14 +74694,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -74890,18 +74711,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionGateway", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncRepository", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74915,7 +74732,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74966,7 +74783,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -74996,31 +74813,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -75029,11 +74828,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Syncs function trigger metadata to the management database /// /// - /// Description for Adds a gateway to a connected Virtual Network (PUT) or - /// updates it (PATCH). + /// Description for Syncs function trigger metadata to the management database /// /// /// Name of the resource group to which the resource belongs. @@ -75041,15 +74839,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". - /// - /// - /// The properties to update this gateway with. - /// /// /// Headers that will be added to request. /// @@ -75059,9 +74848,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -75071,7 +74857,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncFunctionTriggersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75096,22 +74882,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } - if (connectionEnvelope != null) - { - connectionEnvelope.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -75129,19 +74899,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionGateway", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionTriggers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -75155,7 +74920,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -75186,12 +74951,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -75212,7 +74971,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -75242,31 +75001,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -75275,26 +75016,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// List triggered web jobs for an app, or a deployment slot. /// /// - /// Description for Adds a gateway to a connected Virtual Network (PUT) or - /// updates it (PATCH). + /// Description for List triggered web jobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". - /// - /// - /// The properties to update this gateway with. + /// Site name. /// /// /// Headers that will be added to request. @@ -75317,7 +75048,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListTriggeredWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75342,18 +75073,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -75371,19 +75090,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionGateway", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobs", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -75397,7 +75111,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -75428,12 +75142,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -75484,7 +75192,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -75497,7 +75205,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -75517,10 +75225,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List webjobs for an app, or a deployment slot. + /// Gets a triggered web job by its ID for an app, or a deployment slot. /// /// - /// Description for List webjobs for an app, or a deployment slot. + /// Description for Gets a triggered web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -75528,6 +75237,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// Name of Web Job. + /// /// /// Headers that will be added to request. /// @@ -75549,7 +75261,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75574,6 +75286,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -75591,14 +75307,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebJobs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -75663,7 +75381,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -75693,7 +75411,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -75706,7 +75424,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -75726,10 +75444,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get webjob information for an app, or a deployment slot. + /// Delete a triggered web job by its ID for an app, or a deployment slot. /// /// - /// Description for Get webjob information for an app, or a deployment slot. + /// Description for Delete a triggered web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -75738,7 +75457,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Site name. /// /// - /// Name of the web job. + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -75749,9 +75468,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -75761,7 +75477,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75809,11 +75525,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteTriggeredWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); @@ -75830,7 +75546,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -75881,7 +75597,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -75911,31 +75627,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -75944,22 +75642,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new web, mobile, or API app in an existing resource group, or - /// updates an existing app. + /// List a triggered web job's history for an app, or a deployment slot. /// /// - /// Description for Creates a new web, mobile, or API app in an existing - /// resource group, or updates an existing app. + /// Description for List a triggered web job's history for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Unique name of the app to create or update. To create or update a - /// deployment slot, use the {slot} parameter. + /// Site name. /// - /// - /// A JSON representation of the app properties. See example. + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -75982,7 +75678,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListTriggeredWebJobHistoryWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76007,13 +75703,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); - } - if (siteEnvelope != null) + if (webJobName == null) { - siteEnvelope.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -76032,15 +75724,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteEnvelope", siteEnvelope); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobHistory", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -76054,7 +75747,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76085,12 +75778,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -76111,7 +75798,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76141,7 +75828,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -76154,25 +75841,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -76192,24 +75861,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a specific backup to another app (or deployment slot, if - /// specified). + /// Gets a triggered web job's history by its ID for an app, , or a deployment + /// slot. /// /// - /// Description for Restores a specific backup to another app (or deployment - /// slot, if specified). + /// Description for Gets a triggered web job's history by its ID for an app, , + /// or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// ID of the backup. + /// + /// Name of Web Job. /// - /// - /// Information on restore request . + /// + /// History ID. /// /// /// Headers that will be added to request. @@ -76220,6 +75889,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -76229,7 +75901,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetTriggeredWebJobHistoryWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76254,17 +75926,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); - } - if (request == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } - if (request != null) + if (id == null) { - request.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (Client.SubscriptionId == null) { @@ -76283,17 +75951,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); - tracingParameters.Add("request", request); + tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestore", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobHistory", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -76307,7 +75976,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76338,12 +76007,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -76364,7 +76027,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76394,13 +76057,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -76409,16 +76090,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Git/FTP publishing credentials of an app. + /// Run a triggered web job for an app, or a deployment slot. /// /// - /// Description for Gets the Git/FTP publishing credentials of an app. + /// Description for Run a triggered web job for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -76429,9 +76113,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -76441,7 +76122,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListPublishingCredentialsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RunTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76466,6 +76147,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -76483,14 +76168,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListPublishingCredentials", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RunTriggeredWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -76555,7 +76242,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76585,31 +76272,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -76618,19 +76287,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Gets the quota usage information of an app (or deployment slot, if + /// specified). /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Gets the quota usage information of an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Details of MSDeploy operation + /// + /// Return only information specified in the filter (using OData syntax). For + /// example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and + /// startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and + /// timeGrain eq duration'[Hour|Minute|Day]'. /// /// /// Headers that will be added to request. @@ -76653,7 +76327,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76678,10 +76352,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (mSDeploy == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -76699,17 +76369,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("mSDeploy", mSDeploy); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateMSDeployOperation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -76721,7 +76395,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76752,12 +76426,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(mSDeploy != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -76778,7 +76446,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 409) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76808,7 +76476,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -76816,12 +76484,12 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -76841,22 +76509,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create function for web site, or a deployment slot. + /// Gets the virtual networks the app (or deployment slot) is connected to. /// /// - /// Description for Create function for web site, or a deployment slot. + /// Description for Gets the virtual networks the app (or deployment slot) is + /// connected to. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Function name. - /// - /// - /// Function details. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -76879,7 +76542,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVnetConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76904,14 +76567,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (functionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -76929,17 +76584,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("functionEnvelope", functionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateFunction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVnetConnections", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -76953,7 +76605,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76984,12 +76636,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(functionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(functionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -77010,7 +76656,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -77040,7 +76686,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -77048,12 +76694,12 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -77073,22 +76719,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Gets a virtual network the app (or deployment slot) is connected to by + /// name. /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Gets a virtual network the app (or deployment slot) is + /// connected to by name. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// ID of web app instance. + /// Name of the app. /// - /// - /// Details of MSDeploy operation + /// + /// Name of the virtual network. /// /// /// Headers that will be added to request. @@ -77111,7 +76756,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateInstanceMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -77136,13 +76781,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } - if (mSDeploy == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); } if (Client.SubscriptionId == null) { @@ -77161,17 +76802,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); - tracingParameters.Add("mSDeploy", mSDeploy); + tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceMSDeployOperation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -77185,7 +76825,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -77216,12 +76856,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(mSDeploy != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -77242,7 +76876,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 409) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -77272,7 +76906,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -77280,12 +76914,12 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -77305,22 +76939,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a web app. + /// Adds a Virtual Network connection to an app or slot (PUT) or updates the + /// connection properties (PATCH). /// /// - /// Description for Restores a web app. + /// Description for Adds a Virtual Network connection to an app or slot (PUT) + /// or updates the connection properties (PATCH). /// - /// - /// Azure subscription. - /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Migration migrationOptions. + /// + /// Name of an existing Virtual Network. + /// + /// + /// Properties of the Virtual Network connection. See example. /// /// /// Headers that will be added to request. @@ -77343,12 +76979,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginMigrateStorageWithHttpMessagesAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (subscriptionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionName"); - } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -77372,13 +77004,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (migrationOptions == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "migrationOptions"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); } - if (migrationOptions != null) + if (connectionEnvelope == null) { - migrationOptions.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -77395,24 +77027,21 @@ internal WebAppsOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("subscriptionName", subscriptionName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("migrationOptions", migrationOptions); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateStorage", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (subscriptionName != null) - { - _queryParameters.Add(string.Format("subscriptionName={0}", System.Uri.EscapeDataString(subscriptionName))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -77455,9 +77084,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(migrationOptions != null) + if(connectionEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(migrationOptions, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -77511,7 +77140,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -77524,7 +77153,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -77544,20 +77173,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Migrates a local (in-app) MySql database to a remote MySql database. + /// Deletes a connection from an app (or deployment slot to a named virtual + /// network. /// /// - /// Description for Migrates a local (in-app) MySql database to a remote MySql - /// database. + /// Description for Deletes a connection from an app (or deployment slot to a + /// named virtual network. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// MySql migration options. + /// + /// Name of the virtual network. /// /// /// Headers that will be added to request. @@ -77568,9 +77198,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -77580,7 +77207,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginMigrateMySqlWithHttpMessagesAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -77605,13 +77232,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (migrationRequestEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "migrationRequestEnvelope"); - } - if (migrationRequestEnvelope != null) + if (vnetName == null) { - migrationRequestEnvelope.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); } if (Client.SubscriptionId == null) { @@ -77630,15 +77253,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("migrationRequestEnvelope", migrationRequestEnvelope); + tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMySql", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteVnetConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -77652,7 +77276,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -77683,12 +77307,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(migrationRequestEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(migrationRequestEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -77709,7 +77327,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -77739,31 +77357,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -77772,25 +77372,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Adds a Virtual Network connection to an app or slot (PUT) or updates the + /// connection properties (PATCH). /// /// - /// Description for Start capturing network packets for the site. + /// Description for Adds a Virtual Network connection to an app or slot (PUT) + /// or updates the connection properties (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. + /// Name of the app. /// - /// - /// The maximum frame length in bytes (Optional). + /// + /// Name of an existing Virtual Network. /// - /// - /// The Blob URL to store capture file. + /// + /// Properties of the Virtual Network connection. See example. /// /// /// Headers that will be added to request. @@ -77813,7 +77412,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -77838,6 +77437,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -77855,31 +77462,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartWebSiteNetworkTraceOperation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -77891,7 +77486,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -77922,6 +77517,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -77942,7 +77543,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -77972,7 +77573,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -77985,25 +77586,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -78023,10 +77606,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores an app from a backup blob in Azure Storage. + /// Gets an app's Virtual Network gateway. /// /// - /// Description for Restores an app from a backup blob in Azure Storage. + /// Description for Gets an app's Virtual Network gateway. /// /// /// Name of the resource group to which the resource belongs. @@ -78034,8 +77617,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Information on restore request . + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". /// /// /// Headers that will be added to request. @@ -78046,6 +77632,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -78055,7 +77644,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreFromBackupBlobWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78080,13 +77669,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); } - if (request != null) + if (gatewayName == null) { - request.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } if (Client.SubscriptionId == null) { @@ -78105,15 +77694,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromBackupBlob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionGateway", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78127,7 +77719,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -78158,12 +77750,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -78184,7 +77770,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -78214,13 +77800,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -78229,19 +77833,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a deleted web app to this web app. + /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). /// /// - /// Description for Restores a deleted web app to this web app. + /// Description for Adds a gateway to a connected Virtual Network (PUT) or + /// updates it (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Deleted web app restore information. + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// The properties to update this gateway with. /// /// /// Headers that will be added to request. @@ -78252,6 +77863,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -78261,7 +77875,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreFromDeletedAppWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78286,9 +77900,21 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (restoreRequest == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (connectionEnvelope != null) + { + connectionEnvelope.Validate(); } if (Client.SubscriptionId == null) { @@ -78307,15 +77933,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("restoreRequest", restoreRequest); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromDeletedApp", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionGateway", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78329,7 +77959,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -78360,9 +77990,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(restoreRequest != null) + if(connectionEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -78386,7 +78016,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -78416,13 +78046,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -78431,20 +78079,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a web app from a snapshot. + /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). /// /// - /// Description for Restores a web app from a snapshot. + /// Description for Adds a gateway to a connected Virtual Network (PUT) or + /// updates it (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Snapshot restore settings. Snapshot information can be obtained by calling - /// GetDeletedSites or GetSiteSnapshots API. + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// The properties to update this gateway with. /// /// /// Headers that will be added to request. @@ -78455,6 +78109,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -78464,7 +78121,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78489,13 +78146,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (restoreRequest == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); } - if (restoreRequest != null) + if (gatewayName == null) { - restoreRequest.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -78514,15 +78175,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("restoreRequest", restoreRequest); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSnapshot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionGateway", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78536,7 +78201,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -78567,9 +78232,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(restoreRequest != null) + if(connectionEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -78593,7 +78258,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -78623,13 +78288,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -78638,10 +78321,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Install site extension on a web site, or a deployment slot. + /// List webjobs for an app, or a deployment slot. /// /// - /// Description for Install site extension on a web site, or a deployment slot. + /// Description for List webjobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -78649,9 +78332,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Site extension name. - /// /// /// Headers that will be added to request. /// @@ -78673,7 +78353,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginInstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78698,10 +78378,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -78719,16 +78395,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginInstallSiteExtension", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebJobs", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78742,7 +78416,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -78793,7 +78467,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 429) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -78823,7 +78497,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -78836,25 +78510,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -78874,21 +78530,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Copies a deployment slot to another deployment slot of an app. + /// Get webjob information for an app, or a deployment slot. /// /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. + /// Description for Get webjob information for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. + /// + /// Name of the web job. /// /// /// Headers that will be added to request. @@ -78899,6 +78553,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -78908,7 +78565,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginCopyProductionSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78933,13 +78590,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (copySlotEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "copySlotEntity"); - } - if (copySlotEntity != null) + if (webJobName == null) { - copySlotEntity.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -78958,15 +78611,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("copySlotEntity", copySlotEntity); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCopyProductionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78980,7 +78634,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -79011,12 +78665,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(copySlotEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(copySlotEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -79037,7 +78685,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -79067,13 +78715,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -79099,10 +78765,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A JSON representation of the app properties. See example. /// - /// - /// Name of the deployment slot to create or update. By default, this API - /// attempts to create or modify the production slot. - /// /// /// Headers that will be added to request. /// @@ -79124,7 +78786,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79157,10 +78819,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { siteEnvelope.Validate(); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -79179,16 +78837,14 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("siteEnvelope", siteEnvelope); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -79359,10 +79015,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Information on restore request . /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restore a backup of the production slot. - /// /// /// Headers that will be added to request. /// @@ -79381,7 +79033,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79418,10 +79070,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { request.Validate(); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -79441,17 +79089,15 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("backupId", backupId); tracingParameters.Add("request", request); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestore", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -79578,10 +79224,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the publishing credentials for the production slot. - /// /// /// Headers that will be added to request. /// @@ -79603,7 +79245,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListPublishingCredentialsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginListPublishingCredentialsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79628,10 +79270,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -79649,16 +79287,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListPublishingCredentialsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginListPublishingCredentials", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -79797,10 +79433,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of web app. /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// /// /// Details of MSDeploy operation /// @@ -79825,7 +79457,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79850,10 +79482,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (mSDeploy == null) { throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); @@ -79875,17 +79503,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); tracingParameters.Add("mSDeploy", mSDeploy); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateMSDeployOperationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateMSDeployOperation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -80033,9 +79659,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Function name. /// - /// - /// Name of the deployment slot. - /// /// /// Function details. /// @@ -80060,7 +79683,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -80089,10 +79712,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (functionEnvelope == null) { throw new ValidationException(ValidationRules.CannotBeNull, "functionEnvelope"); @@ -80115,18 +79734,16 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("functionName", functionName); - tracingParameters.Add("slot", slot); tracingParameters.Add("functionEnvelope", functionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceFunctionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateFunction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -80271,10 +79888,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of web app. /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// /// /// ID of web app instance. /// @@ -80302,7 +79915,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateInstanceMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -80327,10 +79940,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -80356,18 +79965,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("mSDeploy", mSDeploy); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceMSDeployOperationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceMSDeployOperation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -80502,28 +80109,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Restores a web app. /// /// - /// Description for Start capturing network packets for the site. + /// Description for Restores a web app. /// + /// + /// Azure subscription. + /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). + /// Name of web app. /// - /// - /// The Blob URL to store capture file. + /// + /// Migration migrationOptions. /// /// /// Headers that will be added to request. @@ -80546,8 +80147,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginStartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginMigrateStorageWithHttpMessagesAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (subscriptionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionName"); + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -80571,9 +80176,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (migrationOptions == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "migrationOptions"); + } + if (migrationOptions != null) + { + migrationOptions.Validate(); } if (Client.SubscriptionId == null) { @@ -80590,34 +80199,23 @@ internal WebAppsOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("subscriptionName", subscriptionName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("slot", slot); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("migrationOptions", migrationOptions); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartWebSiteNetworkTraceOperationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateStorage", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) + if (subscriptionName != null) { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + _queryParameters.Add(string.Format("subscriptionName={0}", System.Uri.EscapeDataString(subscriptionName))); } if (Client.ApiVersion != null) { @@ -80630,7 +80228,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -80661,6 +80259,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(migrationOptions != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(migrationOptions, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -80681,7 +80285,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -80711,7 +80315,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -80724,25 +80328,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -80762,20 +80348,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Approves or rejects a private endpoint connection + /// Migrates a local (in-app) MySql database to a remote MySql database. /// /// - /// Description for Approves or rejects a private endpoint connection + /// Description for Migrates a local (in-app) MySql database to a remote MySql + /// database. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. - /// - /// + /// Name of web app. /// - /// + /// + /// MySql migration options. /// /// /// Headers that will be added to request. @@ -80798,7 +80384,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginMigrateMySqlWithHttpMessagesAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -80823,13 +80409,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) + if (migrationRequestEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "migrationRequestEnvelope"); } - if (privateEndpointWrapper == null) + if (migrationRequestEnvelope != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); + migrationRequestEnvelope.Validate(); } if (Client.SubscriptionId == null) { @@ -80848,17 +80434,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); - tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); + tracingParameters.Add("migrationRequestEnvelope", migrationRequestEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMySql", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -80872,7 +80456,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -80903,9 +80487,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(privateEndpointWrapper != null) + if(migrationRequestEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(migrationRequestEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -80929,7 +80513,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -80959,7 +80543,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -80972,25 +80556,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -81010,18 +80576,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a private endpoint connection + /// Start capturing network packets for the site. /// /// - /// Description for Deletes a private endpoint connection + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// The name of the web app. /// - /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. /// /// /// Headers that will be added to request. @@ -81044,7 +80617,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81069,10 +80642,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -81090,18 +80659,31 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginStartWebSiteNetworkTraceOperation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -81113,7 +80695,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -81164,7 +80746,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -81194,7 +80776,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -81207,7 +80789,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -81225,25 +80807,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 204) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -81263,23 +80827,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores an app from a backup blob in Azure Storage. + /// Approves or rejects a private endpoint connection /// /// - /// Description for Restores an app from a backup blob in Azure Storage. + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of the site. /// - /// - /// Information on restore request . + /// /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restore a backup of the production slot. + /// /// /// /// Headers that will be added to request. @@ -81290,6 +80851,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -81299,7 +80863,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreFromBackupBlobSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81324,17 +80888,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) + if (privateEndpointConnectionName == null) { - request.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - if (slot == null) + if (privateEndpointWrapper == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); } if (Client.SubscriptionId == null) { @@ -81353,17 +80913,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); - tracingParameters.Add("slot", slot); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromBackupBlobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -81377,7 +80937,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -81408,9 +80968,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) + if(privateEndpointWrapper != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -81464,13 +81024,49 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -81479,23 +81075,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a deleted web app to this web app. + /// Deletes a private endpoint connection /// /// - /// Description for Restores a deleted web app to this web app. + /// Description for Deletes a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Deleted web app restore information. + /// Name of the site. /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// /// /// /// Headers that will be added to request. @@ -81506,6 +81097,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -81515,7 +81109,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreFromDeletedAppSlotWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81540,13 +81134,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (restoreRequest == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); - } - if (slot == null) + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } if (Client.SubscriptionId == null) { @@ -81565,17 +81155,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("restoreRequest", restoreRequest); - tracingParameters.Add("slot", slot); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromDeletedAppSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -81589,7 +81178,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -81620,12 +81209,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(restoreRequest != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -81646,7 +81229,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -81676,13 +81259,67 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 204) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -81691,24 +81328,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a web app from a snapshot. + /// Restores an app from a backup blob in Azure Storage. /// /// - /// Description for Restores a web app from a snapshot. + /// Description for Restores an app from a backup blob in Azure Storage. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Snapshot restore settings. Snapshot information can be obtained by calling - /// GetDeletedSites or GetSiteSnapshots API. + /// Name of the app. /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// + /// Information on restore request . /// /// /// Headers that will be added to request. @@ -81728,7 +81360,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreFromBackupBlobWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81753,17 +81385,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (restoreRequest == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); - } - if (restoreRequest != null) + if (request == null) { - restoreRequest.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - if (slot == null) + if (request != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + request.Validate(); } if (Client.SubscriptionId == null) { @@ -81782,17 +81410,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("restoreRequest", restoreRequest); - tracingParameters.Add("slot", slot); + tracingParameters.Add("request", request); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSnapshotSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromBackupBlob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -81837,9 +81463,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(restoreRequest != null) + if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -81908,23 +81534,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Install site extension on a web site, or a deployment slot. + /// Restores a deleted web app to this web app. /// /// - /// Description for Install site extension on a web site, or a deployment slot. + /// Description for Restores a deleted web app to this web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Site extension name. + /// Name of web app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// + /// Deleted web app restore information. /// /// /// Headers that will be added to request. @@ -81935,9 +81557,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -81947,7 +81566,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginInstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreFromDeletedAppWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81972,13 +81591,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); - } - if (slot == null) + if (restoreRequest == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); } if (Client.SubscriptionId == null) { @@ -81997,18 +81612,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); - tracingParameters.Add("slot", slot); + tracingParameters.Add("restoreRequest", restoreRequest); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginInstallSiteExtensionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromDeletedApp", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -82022,7 +81634,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -82053,6 +81665,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(restoreRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -82073,7 +81691,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 429) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -82103,49 +81721,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -82154,25 +81736,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Copies a deployment slot to another deployment slot of an app. + /// Restores a web app from a snapshot. /// /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. + /// Description for Restores a web app from a snapshot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. + /// Name of web app. /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. + /// + /// Snapshot restore settings. Snapshot information can be obtained by calling + /// GetDeletedSites or GetSiteSnapshots API. /// /// /// Headers that will be added to request. @@ -82192,7 +81769,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginCopySlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -82217,17 +81794,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (copySlotEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "copySlotEntity"); - } - if (copySlotEntity != null) + if (restoreRequest == null) { - copySlotEntity.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); } - if (slot == null) + if (restoreRequest != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + restoreRequest.Validate(); } if (Client.SubscriptionId == null) { @@ -82246,17 +81819,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("copySlotEntity", copySlotEntity); - tracingParameters.Add("slot", slot); + tracingParameters.Add("restoreRequest", restoreRequest); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCopySlotSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSnapshot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotcopy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -82301,9 +81872,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(copySlotEntity != null) + if(restoreRequest != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(copySlotEntity, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -82372,23 +81943,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Swaps two deployment slots of an app. + /// Install site extension on a web site, or a deployment slot. /// /// - /// Description for Swaps two deployment slots of an app. + /// Description for Install site extension on a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name. See example. + /// Site name. /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. + /// + /// Site extension name. /// /// /// Headers that will be added to request. @@ -82399,6 +81966,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -82408,7 +81978,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginSwapSlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginInstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -82433,17 +82003,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); - } - if (slotSwapEntity != null) - { - slotSwapEntity.Validate(); - } - if (slot == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (Client.SubscriptionId == null) { @@ -82462,17 +82024,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); - tracingParameters.Add("slot", slot); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSwapSlotSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginInstallSiteExtension", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -82486,7 +82047,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -82517,12 +82078,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -82543,7 +82098,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 429) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -82573,13 +82128,49 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -82588,23 +82179,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Creates a new web, mobile, or API app in an existing resource group, or + /// updates an existing app. /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Creates a new web, mobile, or API app in an existing + /// resource group, or updates an existing app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Unique name of the app to create or update. To create or update a + /// deployment slot, use the {slot} parameter. /// - /// - /// JSON representation of a SiteSourceControl object. See example. + /// + /// A JSON representation of the app properties. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the source control configuration for the production slot. + /// Name of the deployment slot to create or update. By default, this API + /// attempts to create or modify the production slot. /// /// /// Headers that will be added to request. @@ -82627,7 +82221,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -82652,9 +82246,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteSourceControl == null) + if (siteEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); + } + if (siteEnvelope != null) + { + siteEnvelope.Validate(); } if (slot == null) { @@ -82677,14 +82275,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteSourceControl", siteSourceControl); + tracingParameters.Add("siteEnvelope", siteEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSourceControlSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -82732,9 +82330,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteSourceControl != null) + if(siteEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -82758,7 +82356,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -82788,7 +82386,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -82801,25 +82399,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -82837,7 +82417,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -82857,28 +82437,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Restores a specific backup to another app (or deployment slot, if + /// specified). /// /// - /// Description for Start capturing network packets for the site. + /// Description for Restores a specific backup to another app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. + /// Name of the app. /// - /// - /// The duration to keep capturing in seconds. + /// + /// ID of the backup. /// - /// - /// The maximum frame length in bytes (Optional). + /// + /// Information on restore request . /// - /// - /// The Blob URL to store capture file. + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// restore a backup of the production slot. /// /// /// Headers that will be added to request. @@ -82889,9 +82469,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -82901,7 +82478,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginStartNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -82926,6 +82503,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (backupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -82947,33 +82536,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("backupId", backupId); + tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartNetworkTraceSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -83016,6 +82593,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -83066,38 +82649,221 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + 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) + if (_shouldTrace) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the Git/FTP publishing credentials of an app. + /// + /// + /// Description for Gets the Git/FTP publishing credentials of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the publishing credentials for the production slot. + /// + /// + /// 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> BeginListPublishingCredentialsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); } - catch (JsonException ex) + if (resourceGroupName.Length < 1) { - _httpRequest.Dispose(); - if (_httpResponse != null) + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginListPublishingCredentialsSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) { - _httpResponse.Dispose(); + _httpRequest.Headers.Remove(_header.Key); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 == 202) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -83117,19 +82883,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Swaps two deployment slots of an app. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Swaps two deployment slots of an app. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// JSON object that contains the target slot name. See example. + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// Details of MSDeploy operation /// /// /// Headers that will be added to request. @@ -83140,6 +82910,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -83149,7 +82922,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginSwapSlotWithProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -83174,13 +82947,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (slotSwapEntity != null) + if (mSDeploy == null) { - slotSwapEntity.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); } if (Client.SubscriptionId == null) { @@ -83199,15 +82972,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("slot", slot); + tracingParameters.Add("mSDeploy", mSDeploy); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSwapSlotWithProduction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateMSDeployOperationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -83221,7 +82996,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -83252,9 +83027,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) + if(mSDeploy != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -83278,7 +83053,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 201 && (int)_statusCode != 409) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -83308,13 +83083,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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 == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -83323,19 +83116,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Create function for web site, or a deployment slot. /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Create function for web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// JSON representation of a SiteSourceControl object. See example. + /// + /// Function name. + /// + /// + /// Name of the deployment slot. + /// + /// + /// Function details. /// /// /// Headers that will be added to request. @@ -83358,7 +83157,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -83383,9 +83182,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteSourceControl == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (functionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionEnvelope"); } if (Client.SubscriptionId == null) { @@ -83404,15 +83211,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteSourceControl", siteSourceControl); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("slot", slot); + tracingParameters.Add("functionEnvelope", functionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSourceControl", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceFunctionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -83457,9 +83268,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteSourceControl != null) + if(functionEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(functionEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -83483,7 +83294,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -83513,7 +83324,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -83521,48 +83332,12 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -83582,25 +83357,4069 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Start capturing network packets for the site. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of web app. /// - /// - /// The duration to keep capturing in seconds. + /// + /// Name of web app slot. If not specified then will default to production + /// slot. /// - /// - /// The maximum frame length in bytes (Optional). + /// + /// ID of web app instance. /// - /// - /// The Blob URL to store capture file. + /// + /// Details of MSDeploy 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> BeginCreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } + if (mSDeploy == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("mSDeploy", mSDeploy); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceMSDeployOperationSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(mSDeploy != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 201 && (int)_statusCode != 409) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Start capturing network packets for the site. + /// + /// + /// Description for Start capturing network packets for the site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. + /// + /// + /// The name of the slot for this web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// 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>> BeginStartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("slot", slot); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginStartWebSiteNetworkTraceOperationSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// + /// + /// 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> BeginApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (privateEndpointWrapper == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnectionSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(privateEndpointWrapper != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// 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> BeginDeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnectionSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 204) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Restores an app from a backup blob in Azure Storage. + /// + /// + /// Description for Restores an app from a backup blob in Azure Storage. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Information on restore request . + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// restore a backup of the production slot. + /// + /// + /// 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 BeginRestoreFromBackupBlobSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("request", request); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromBackupBlobSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Restores a deleted web app to this web app. + /// + /// + /// Description for Restores a deleted web app to this web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Deleted web app restore information. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// 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 BeginRestoreFromDeletedAppSlotWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (restoreRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("restoreRequest", restoreRequest); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromDeletedAppSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(restoreRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Restores a web app from a snapshot. + /// + /// + /// Description for Restores a web app from a snapshot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Snapshot restore settings. Snapshot information can be obtained by calling + /// GetDeletedSites or GetSiteSnapshots API. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// 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 BeginRestoreSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (restoreRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); + } + if (restoreRequest != null) + { + restoreRequest.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("restoreRequest", restoreRequest); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSnapshotSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(restoreRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Install site extension on a web site, or a deployment slot. + /// + /// + /// Description for Install site extension on a web site, or a deployment slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Site extension name. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. + /// + /// + /// 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> BeginInstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (siteExtensionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginInstallSiteExtensionSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 429) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Swaps two deployment slots of an app. + /// + /// + /// Description for Swaps two deployment slots of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name. See example. + /// + /// + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. + /// + /// + /// 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 BeginSwapSlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slotSwapEntity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginSwapSlotSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 source control configuration of an app. + /// + /// + /// Description for Updates the source control configuration of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON representation of a SiteSourceControl object. See example. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the source control configuration for the production slot. + /// + /// + /// 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> BeginCreateOrUpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (siteSourceControl == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("siteSourceControl", siteSourceControl); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSourceControlSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(siteSourceControl != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Start capturing network packets for the site. + /// + /// + /// Description for Start capturing network packets for the site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. + /// + /// + /// The name of the slot for this web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// 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>> BeginStartNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("slot", slot); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginStartNetworkTraceSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Swaps two deployment slots of an app. + /// + /// + /// Description for Swaps two deployment slots of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name. See example. + /// + /// + /// 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 BeginSwapSlotWithProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slotSwapEntity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginSwapSlotWithProduction", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 source control configuration of an app. + /// + /// + /// Description for Updates the source control configuration of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON representation of a SiteSourceControl object. See example. + /// + /// + /// 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> BeginCreateOrUpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (siteSourceControl == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("siteSourceControl", siteSourceControl); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSourceControl", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(siteSourceControl != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Start capturing network packets for the site. + /// + /// + /// Description for Start capturing network packets for the site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// 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>> BeginStartNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginStartNetworkTrace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all apps for a subscription. + /// + /// + /// Description for Get all apps for a 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all web, mobile, and API apps in the specified resource group. + /// + /// + /// Description for Gets all web, mobile, and API apps in the specified + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets existing backups of an app. + /// + /// + /// Description for Gets existing backups of an app. + /// + /// + /// 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>> ListBackupsNextWithHttpMessagesAsync(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, "ListBackupsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List the configurations of an app + /// + /// + /// Description for List the configurations of an app + /// + /// + /// 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("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -83623,38 +87442,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginStartNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetAppSettingsKeyVaultReferencesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -83663,37 +87455,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartNetworkTrace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingsKeyVaultReferencesNext", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -83701,7 +87470,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -83752,7 +87521,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -83782,7 +87551,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -83795,7 +87564,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -83807,13 +87576,166 @@ internal WebAppsOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// 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>> GetSiteConnectionStringKeyVaultReferencesNextWithHttpMessagesAsync(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, "GetSiteConnectionStringKeyVaultReferencesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 == 202) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -83833,10 +87755,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get all apps for a subscription. + /// Gets a list of web app configuration snapshots identifiers. Each element of + /// the list contains a timestamp and the ID of the snapshot. /// /// - /// Description for Get all apps for a subscription. + /// Description for Gets a list of web app configuration snapshots identifiers. + /// Each element of the list contains a timestamp and the ID of the snapshot. /// /// /// The NextLink from the previous successful call to List operation. @@ -83862,7 +87786,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationSnapshotInfoNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -83877,7 +87801,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -83971,7 +87895,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -83984,7 +87908,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -84004,11 +87928,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all web, mobile, and API apps in the specified resource group. + /// List continuous web jobs for an app, or a deployment slot. /// /// - /// Description for Gets all web, mobile, and API apps in the specified - /// resource group. + /// Description for List continuous web jobs for an app, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -84034,7 +87957,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListContinuousWebJobsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -84049,7 +87972,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -84143,7 +88066,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -84156,7 +88079,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -84176,10 +88099,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// List deployments for an app, or a deployment slot. /// /// - /// Description for Gets existing backups of an app. + /// Description for List deployments for an app, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -84205,7 +88128,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBackupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDeploymentsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -84220,7 +88143,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBackupsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -84314,7 +88237,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -84327,7 +88250,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -84347,10 +88270,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the configurations of an app + /// Lists ownership identifiers for domain associated with web app. /// /// - /// Description for List the configurations of an app + /// Description for Lists ownership identifiers for domain associated with web + /// app. /// /// /// The NextLink from the previous successful call to List operation. @@ -84376,7 +88300,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDomainOwnershipIdentifiersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -84391,7 +88315,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -84485,7 +88409,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -84498,7 +88422,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -84518,12 +88442,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a list of web app configuration snapshots identifiers. Each element of - /// the list contains a timestamp and the ID of the snapshot. + /// List the functions for a web site, or a deployment slot. /// /// - /// Description for Gets a list of web app configuration snapshots identifiers. - /// Each element of the list contains a timestamp and the ID of the snapshot. + /// Description for List the functions for a web site, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -84549,7 +88471,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationSnapshotInfoNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -84564,7 +88486,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -84628,7 +88550,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -84658,7 +88580,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -84671,7 +88593,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -84691,10 +88613,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List continuous web jobs for an app, or a deployment slot. + /// Get hostname bindings for an app or a deployment slot. /// /// - /// Description for List continuous web jobs for an app, or a deployment slot. + /// Description for Get hostname bindings for an app or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -84720,7 +88642,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListContinuousWebJobsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListHostNameBindingsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -84735,7 +88657,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -84829,7 +88751,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -84842,7 +88764,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -84862,10 +88784,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployments for an app, or a deployment slot. + /// Gets all scale-out instances of an app. /// /// - /// Description for List deployments for an app, or a deployment slot. + /// Description for Gets all scale-out instances of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -84891,7 +88813,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDeploymentsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceIdentifiersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -84906,7 +88828,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -85000,7 +88922,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -85013,7 +88935,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -85033,11 +88955,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Lists ownership identifiers for domain associated with web app. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Lists ownership identifiers for domain associated with web - /// app. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -85063,7 +88986,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDomainOwnershipIdentifiersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -85078,7 +89001,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -85142,7 +89065,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -85172,7 +89095,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -85185,7 +89108,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -85205,10 +89128,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the functions for a web site, or a deployment slot. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for List the functions for a web site, or a deployment slot. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -85234,7 +89159,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessModulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -85249,7 +89174,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -85343,7 +89268,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -85356,7 +89281,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -85376,10 +89301,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get hostname bindings for an app or a deployment slot. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Get hostname bindings for an app or a deployment slot. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -85405,7 +89332,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListHostNameBindingsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessThreadsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -85420,7 +89347,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -85484,7 +89411,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -85514,7 +89441,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -85527,7 +89454,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -85547,10 +89474,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Gets existing backups of an app. /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Gets existing backups of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -85576,7 +89503,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceIdentifiersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteBackupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -85591,7 +89518,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -85604,7 +89531,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -85685,7 +89612,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -85698,7 +89625,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -85718,12 +89645,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Gets perfmon counters for web app. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Gets perfmon counters for web app. /// /// /// The NextLink from the previous successful call to List operation. @@ -85749,7 +89674,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPerfMonCountersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -85764,7 +89689,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -85828,7 +89753,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -85858,7 +89783,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -85871,7 +89796,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -85891,12 +89816,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// The NextLink from the previous successful call to List operation. @@ -85922,7 +89846,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessModulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -85937,7 +89861,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -86001,7 +89925,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -86031,7 +89955,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -86044,7 +89968,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -86064,12 +89988,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -86095,7 +90019,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessThreadsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -86110,7 +90034,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -86204,7 +90128,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -86217,7 +90141,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -86237,10 +90161,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Gets existing backups of an app. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -86266,7 +90192,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteBackupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessModulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -86281,7 +90207,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessModulesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -86294,7 +90220,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -86345,7 +90271,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -86375,7 +90301,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -86388,7 +90314,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -86408,10 +90334,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets perfmon counters for web app. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets perfmon counters for web app. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -86437,7 +90365,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPerfMonCountersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessThreadsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -86452,7 +90380,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreadsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -86516,7 +90444,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -86546,7 +90474,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -86559,7 +90487,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -86579,12 +90507,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Get public certificates for an app or a deployment slot. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Get public certificates for an app or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -86610,7 +90536,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPublicCertificatesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -86625,7 +90551,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificatesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -86689,7 +90615,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -86719,7 +90645,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -86732,7 +90658,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -86752,12 +90678,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Get list of siteextensions for a web site, or a deployment slot. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Get list of siteextensions for a web site, or a deployment + /// slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -86783,7 +90708,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessModulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteExtensionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -86798,7 +90723,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessModulesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -86892,7 +90817,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -86905,7 +90830,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -86925,12 +90850,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets an app's deployment slots. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets an app's deployment slots. /// /// /// The NextLink from the previous successful call to List operation. @@ -86956,7 +90879,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessThreadsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSlotsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -86971,7 +90894,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreadsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlotsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87035,7 +90958,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -87065,7 +90988,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87078,7 +91001,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87098,10 +91021,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get public certificates for an app or a deployment slot. + /// Gets existing backups of an app. /// /// - /// Description for Get public certificates for an app or a deployment slot. + /// Description for Gets existing backups of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -87127,7 +91050,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublicCertificatesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBackupsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -87142,7 +91065,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificatesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBackupsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87236,7 +91159,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87249,7 +91172,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87269,11 +91192,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of siteextensions for a web site, or a deployment slot. + /// List the configurations of an app /// /// - /// Description for Get list of siteextensions for a web site, or a deployment - /// slot. + /// Description for List the configurations of an app /// /// /// The NextLink from the previous successful call to List operation. @@ -87299,7 +91221,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteExtensionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -87314,7 +91236,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensionsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87378,7 +91300,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -87408,7 +91330,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87421,7 +91343,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87441,10 +91363,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets an app's deployment slots. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Gets an app's deployment slots. + /// Description for Gets the config reference app settings and status of an app /// /// /// The NextLink from the previous successful call to List operation. @@ -87470,7 +91392,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSlotsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetAppSettingsKeyVaultReferencesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -87485,7 +91407,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlotsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingsKeyVaultReferencesSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87579,7 +91501,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87592,7 +91514,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87612,10 +91534,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Gets existing backups of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// The NextLink from the previous successful call to List operation. @@ -87641,7 +91563,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBackupsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetSiteConnectionStringKeyVaultReferencesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -87656,7 +91578,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBackupsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReferencesSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87750,7 +91672,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87763,7 +91685,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87783,10 +91705,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the configurations of an app + /// Gets a list of web app configuration snapshots identifiers. Each element of + /// the list contains a timestamp and the ID of the snapshot. /// /// - /// Description for List the configurations of an app + /// Description for Gets a list of web app configuration snapshots identifiers. + /// Each element of the list contains a timestamp and the ID of the snapshot. /// /// /// The NextLink from the previous successful call to List operation. @@ -87812,7 +91736,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationSnapshotInfoSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -87827,7 +91751,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87921,7 +91845,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87934,7 +91858,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87954,12 +91878,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a list of web app configuration snapshots identifiers. Each element of - /// the list contains a timestamp and the ID of the snapshot. + /// List continuous web jobs for an app, or a deployment slot. /// /// - /// Description for Gets a list of web app configuration snapshots identifiers. - /// Each element of the list contains a timestamp and the ID of the snapshot. + /// Description for List continuous web jobs for an app, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -87985,7 +91907,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationSnapshotInfoSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListContinuousWebJobsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88000,7 +91922,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88094,7 +92016,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88107,7 +92029,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88127,10 +92049,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List continuous web jobs for an app, or a deployment slot. + /// List deployments for an app, or a deployment slot. /// /// - /// Description for List continuous web jobs for an app, or a deployment slot. + /// Description for List deployments for an app, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -88156,7 +92078,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListContinuousWebJobsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDeploymentsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88171,7 +92093,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88265,7 +92187,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88278,7 +92200,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88298,10 +92220,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployments for an app, or a deployment slot. + /// Lists ownership identifiers for domain associated with web app. /// /// - /// Description for List deployments for an app, or a deployment slot. + /// Description for Lists ownership identifiers for domain associated with web + /// app. /// /// /// The NextLink from the previous successful call to List operation. @@ -88327,7 +92250,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDeploymentsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDomainOwnershipIdentifiersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88342,7 +92265,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88436,7 +92359,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88449,7 +92372,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88469,11 +92392,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Lists ownership identifiers for domain associated with web app. + /// List the functions for a web site, or a deployment slot. /// /// - /// Description for Lists ownership identifiers for domain associated with web - /// app. + /// Description for List the functions for a web site, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -88499,7 +92421,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDomainOwnershipIdentifiersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceFunctionsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88514,7 +92436,178 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceFunctionsSlotNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 404) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get hostname bindings for an app or a deployment slot. + /// + /// + /// Description for Get hostname bindings for an app or a deployment slot. + /// + /// + /// 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>> ListHostNameBindingsSlotNextWithHttpMessagesAsync(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, "ListHostNameBindingsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88608,7 +92701,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88621,7 +92714,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88641,10 +92734,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the functions for a web site, or a deployment slot. + /// Gets all scale-out instances of an app. /// /// - /// Description for List the functions for a web site, or a deployment slot. + /// Description for Gets all scale-out instances of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -88670,7 +92763,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceFunctionsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceIdentifiersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88685,7 +92778,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceFunctionsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88749,7 +92842,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -88779,7 +92872,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88792,7 +92885,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88812,10 +92905,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get hostname bindings for an app or a deployment slot. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Get hostname bindings for an app or a deployment slot. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -88841,7 +92936,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListHostNameBindingsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88856,7 +92951,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88920,7 +93015,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -88950,7 +93045,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88963,7 +93058,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88983,183 +93078,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Gets all scale-out instances of an app. - /// - /// - /// 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>> ListInstanceIdentifiersSlotNextWithHttpMessagesAsync(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, "ListInstanceIdentifiersSlotNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get list of processes for a web site, or a deployment slot, or for a + /// Description for List module information for a process by its ID for a /// specific scaled-out instance in a web site. - /// - /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -89185,7 +93109,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessModulesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89200,7 +93124,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89294,7 +93218,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89307,7 +93231,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89327,12 +93251,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -89358,7 +93282,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessModulesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessThreadsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89373,7 +93297,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89467,7 +93391,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89480,7 +93404,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89500,12 +93424,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets existing backups of an app. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets existing backups of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -89531,7 +93453,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessThreadsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteBackupsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89546,7 +93468,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89559,7 +93481,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -89610,7 +93532,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -89640,7 +93562,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89653,7 +93575,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89673,10 +93595,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Gets perfmon counters for web app. /// /// - /// Description for Gets existing backups of an app. + /// Description for Gets perfmon counters for web app. /// /// /// The NextLink from the previous successful call to List operation. @@ -89702,7 +93624,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteBackupsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPerfMonCountersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89717,7 +93639,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89730,7 +93652,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -89811,7 +93733,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89824,7 +93746,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89844,10 +93766,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets perfmon counters for web app. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Gets perfmon counters for web app. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// The NextLink from the previous successful call to List operation. @@ -89873,7 +93796,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPerfMonCountersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetPrivateEndpointConnectionListSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89888,7 +93811,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionListSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89982,7 +93905,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89995,7 +93918,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperationsExtensions.cs index b268e898aef2..088e49f47ee1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperationsExtensions.cs @@ -1603,6 +1603,200 @@ public static BackupRequest GetBackupConfiguration(this IWebAppsOperations opera } } + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + public static IPage GetAppSettingsKeyVaultReferences(this IWebAppsOperations operations, string resourceGroupName, string name) + { + return operations.GetAppSettingsKeyVaultReferencesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// The cancellation token. + /// + public static async Task> GetAppSettingsKeyVaultReferencesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAppSettingsKeyVaultReferencesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// App Setting key name. + /// + public static ApiKVReference GetAppSettingKeyVaultReference(this IWebAppsOperations operations, string resourceGroupName, string name, string appSettingKey) + { + return operations.GetAppSettingKeyVaultReferenceAsync(resourceGroupName, name, appSettingKey).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// App Setting key name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAppSettingKeyVaultReferenceAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string appSettingKey, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAppSettingKeyVaultReferenceWithHttpMessagesAsync(resourceGroupName, name, appSettingKey, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + public static IPage GetSiteConnectionStringKeyVaultReferences(this IWebAppsOperations operations, string resourceGroupName, string name) + { + return operations.GetSiteConnectionStringKeyVaultReferencesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// The cancellation token. + /// + public static async Task> GetSiteConnectionStringKeyVaultReferencesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSiteConnectionStringKeyVaultReferencesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + public static ApiKVReference GetSiteConnectionStringKeyVaultReference(this IWebAppsOperations operations, string resourceGroupName, string name, string connectionStringKey) + { + return operations.GetSiteConnectionStringKeyVaultReferenceAsync(resourceGroupName, name, connectionStringKey).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetSiteConnectionStringKeyVaultReferenceAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string connectionStringKey, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSiteConnectionStringKeyVaultReferenceWithHttpMessagesAsync(resourceGroupName, name, connectionStringKey, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Replaces the connection strings of an app. /// @@ -6105,72 +6299,6 @@ public static SwiftVirtualNetwork GetSwiftVirtualNetworkConnection(this IWebApps } } - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - public static SwiftVirtualNetwork CreateOrUpdateSwiftVirtualNetworkConnection(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope) - { - return operations.CreateOrUpdateSwiftVirtualNetworkConnectionAsync(resourceGroupName, name, connectionEnvelope).GetAwaiter().GetResult(); - } - - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateSwiftVirtualNetworkConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Deletes a Swift Virtual Network connection from an app (or deployment /// slot). @@ -6218,72 +6346,6 @@ public static void DeleteSwiftVirtualNetwork(this IWebAppsOperations operations, (await operations.DeleteSwiftVirtualNetworkWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - public static SwiftVirtualNetwork UpdateSwiftVirtualNetworkConnection(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope) - { - return operations.UpdateSwiftVirtualNetworkConnectionAsync(resourceGroupName, name, connectionEnvelope).GetAwaiter().GetResult(); - } - - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateSwiftVirtualNetworkConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all network features used by the app (or deployment slot, if /// specified). @@ -6302,7 +6364,7 @@ public static SwiftVirtualNetwork UpdateSwiftVirtualNetworkConnection(this IWebA /// Name of the app. /// /// - /// The type of view. This can either be "summary" or "detailed". + /// The type of view. Only "summary" is supported at this time. /// public static NetworkFeatures ListNetworkFeatures(this IWebAppsOperations operations, string resourceGroupName, string name, string view) { @@ -6327,7 +6389,7 @@ public static NetworkFeatures ListNetworkFeatures(this IWebAppsOperations operat /// Name of the app. /// /// - /// The type of view. This can either be "summary" or "detailed". + /// The type of view. Only "summary" is supported at this time. /// /// /// The cancellation token. @@ -7258,12 +7320,11 @@ public static PrivateAccess PutPrivateAccessVnet(this IWebAppsOperations operati } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// The operations group for this extension method. @@ -7272,20 +7333,271 @@ public static PrivateAccess PutPrivateAccessVnet(this IWebAppsOperations operati /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. /// - public static IPage ListProcesses(this IWebAppsOperations operations, string resourceGroupName, string name) + public static IPage GetPrivateEndpointConnectionList(this IWebAppsOperations operations, string resourceGroupName, string name) { - return operations.ListProcessesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.GetPrivateEndpointConnectionListAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Gets the list of private endpoint connections associated + /// with a site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// Name of the private endpoint connection. + /// + public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + return operations.ApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApproveOrRejectPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + public static object DeletePrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task DeletePrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IWebAppsOperations operations, string resourceGroupName, string name) + { + return operations.GetPrivateLinkResourcesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateLinkResourcesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. + /// + /// + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + public static IPage ListProcesses(this IWebAppsOperations operations, string resourceGroupName, string name) + { + return operations.ListProcessesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. + /// + /// + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// The operations group for this extension method. @@ -8374,11 +8686,10 @@ public static void DeleteSiteExtension(this IWebAppsOperations operations, strin } /// - /// Copies a deployment slot to another deployment slot of an app. + /// Gets an app's deployment slots. /// /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. + /// Description for Gets an app's deployment slots. /// /// /// The operations group for this extension method. @@ -8389,21 +8700,16 @@ public static void DeleteSiteExtension(this IWebAppsOperations operations, strin /// /// Name of the app. /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - public static void CopyProductionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity) + public static IPage ListSlots(this IWebAppsOperations operations, string resourceGroupName, string name) { - operations.CopyProductionSlotAsync(resourceGroupName, name, copySlotEntity).GetAwaiter().GetResult(); + return operations.ListSlotsAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// - /// Copies a deployment slot to another deployment slot of an app. + /// Gets an app's deployment slots. /// /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. + /// Description for Gets an app's deployment slots. /// /// /// The operations group for this extension method. @@ -8414,57 +8720,10 @@ public static void CopyProductionSlot(this IWebAppsOperations operations, string /// /// Name of the app. /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// /// /// The cancellation token. /// - public static async Task CopyProductionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CopyProductionSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets an app's deployment slots. - /// - /// - /// Description for Gets an app's deployment slots. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - public static IPage ListSlots(this IWebAppsOperations operations, string resourceGroupName, string name) - { - return operations.ListSlotsAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Gets an app's deployment slots. - /// - /// - /// Description for Gets an app's deployment slots. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// The cancellation token. - /// - public static async Task> ListSlotsAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListSlotsAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListSlotsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) { @@ -8616,9 +8875,8 @@ public static Site CreateOrUpdateSlot(this IWebAppsOperations operations, string /// If true, web app metrics are also deleted. /// /// - /// Specify true if the App Service plan will be empty after app deletion and - /// you want to delete the empty App Service plan. By default, the empty App - /// Service plan is not deleted. + /// Specify false if you want to keep empty App Service plan. By default, empty + /// App Service plan is deleted. /// public static void DeleteSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, bool? deleteMetrics = default(bool?), bool? deleteEmptyServerFarm = default(bool?)) { @@ -8649,9 +8907,8 @@ public static Site CreateOrUpdateSlot(this IWebAppsOperations operations, string /// If true, web app metrics are also deleted. /// /// - /// Specify true if the App Service plan will be empty after app deletion and - /// you want to delete the empty App Service plan. By default, the empty App - /// Service plan is not deleted. + /// Specify false if you want to keep empty App Service plan. By default, empty + /// App Service plan is deleted. /// /// /// The cancellation token. @@ -9227,10 +9484,12 @@ public static void RestoreSlot(this IWebAppsOperations operations, string resour } /// - /// List the configurations of an app + /// Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + /// given site. /// /// - /// Description for List the configurations of an app + /// Description for Returns whether Scm basic auth is allowed and whether Ftp + /// is allowed for a given site. /// /// /// The operations group for this extension method. @@ -9242,19 +9501,19 @@ public static void RestoreSlot(this IWebAppsOperations operations, string resour /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. /// - public static IPage ListConfigurationsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static CsmPublishingCredentialsPoliciesCollection GetBasicPublishingCredentialsPoliciesSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.ListConfigurationsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.GetBasicPublishingCredentialsPoliciesSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// List the configurations of an app + /// Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + /// given site. /// /// - /// Description for List the configurations of an app + /// Description for Returns whether Scm basic auth is allowed and whether Ftp + /// is allowed for a given site. /// /// /// The operations group for this extension method. @@ -9266,25 +9525,23 @@ public static IPage ListConfigurationsSlot(this IWebAppsOper /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task> ListConfigurationsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetBasicPublishingCredentialsPoliciesSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListConfigurationsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetBasicPublishingCredentialsPoliciesSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Replaces the application settings of an app. + /// Returns whether FTP is allowed on the site or not. /// /// - /// Description for Replaces the application settings of an app. + /// Description for Returns whether FTP is allowed on the site or not. /// /// /// The operations group for this extension method. @@ -9295,23 +9552,18 @@ public static IPage ListConfigurationsSlot(this IWebAppsOper /// /// Name of the app. /// - /// - /// Application settings of the app. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the application settings for the production slot. /// - public static StringDictionary UpdateApplicationSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, StringDictionary appSettings, string slot) + public static CsmPublishingCredentialsPoliciesEntity GetFtpAllowedSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.UpdateApplicationSettingsSlotAsync(resourceGroupName, name, appSettings, slot).GetAwaiter().GetResult(); + return operations.GetFtpAllowedSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Replaces the application settings of an app. + /// Returns whether FTP is allowed on the site or not. /// /// - /// Description for Replaces the application settings of an app. + /// Description for Returns whether FTP is allowed on the site or not. /// /// /// The operations group for this extension method. @@ -9322,29 +9574,24 @@ public static StringDictionary UpdateApplicationSettingsSlot(this IWebAppsOperat /// /// Name of the app. /// - /// - /// Application settings of the app. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the application settings for the production slot. /// /// /// The cancellation token. /// - public static async Task UpdateApplicationSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, StringDictionary appSettings, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetFtpAllowedSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateApplicationSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, appSettings, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetFtpAllowedSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the application settings of an app. + /// Updates whether FTP is allowed on the site or not. /// /// - /// Description for Gets the application settings of an app. + /// Description for Updates whether FTP is allowed on the site or not. /// /// /// The operations group for this extension method. @@ -9355,20 +9602,20 @@ public static StringDictionary UpdateApplicationSettingsSlot(this IWebAppsOperat /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the application settings for the production slot. /// - public static StringDictionary ListApplicationSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static CsmPublishingCredentialsPoliciesEntity UpdateFtpAllowedSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot) { - return operations.ListApplicationSettingsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.UpdateFtpAllowedSlotAsync(resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot).GetAwaiter().GetResult(); } /// - /// Gets the application settings of an app. + /// Updates whether FTP is allowed on the site or not. /// /// - /// Description for Gets the application settings of an app. + /// Description for Updates whether FTP is allowed on the site or not. /// /// /// The operations group for this extension method. @@ -9379,28 +9626,27 @@ public static StringDictionary ListApplicationSettingsSlot(this IWebAppsOperatio /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the application settings for the production slot. /// /// /// The cancellation token. /// - public static async Task ListApplicationSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateFtpAllowedSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListApplicationSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateFtpAllowedSlotWithHttpMessagesAsync(resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Updates the Authentication / Authorization settings associated with web - /// app. + /// Returns whether Scm basic auth is allowed on the site or not. /// /// - /// Description for Updates the Authentication / Authorization settings - /// associated with web app. + /// Description for Returns whether Scm basic auth is allowed on the site or + /// not. /// /// /// The operations group for this extension method. @@ -9409,27 +9655,21 @@ public static StringDictionary ListApplicationSettingsSlot(this IWebAppsOperatio /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Auth settings associated with web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. /// - public static SiteAuthSettings UpdateAuthSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot) + public static CsmPublishingCredentialsPoliciesEntity GetScmAllowedSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.UpdateAuthSettingsSlotAsync(resourceGroupName, name, siteAuthSettings, slot).GetAwaiter().GetResult(); + return operations.GetScmAllowedSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Updates the Authentication / Authorization settings associated with web - /// app. + /// Returns whether Scm basic auth is allowed on the site or not. /// /// - /// Description for Updates the Authentication / Authorization settings - /// associated with web app. + /// Description for Returns whether Scm basic auth is allowed on the site or + /// not. /// /// /// The operations group for this extension method. @@ -9438,31 +9678,27 @@ public static SiteAuthSettings UpdateAuthSettingsSlot(this IWebAppsOperations op /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Auth settings associated with web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. /// /// /// The cancellation token. /// - public static async Task UpdateAuthSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetScmAllowedSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateAuthSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, siteAuthSettings, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetScmAllowedSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the Authentication/Authorization settings of an app. + /// Updates whether user publishing credentials are allowed on the site or not. /// /// - /// Description for Gets the Authentication/Authorization settings of an app. + /// Description for Updates whether user publishing credentials are allowed on + /// the site or not. /// /// /// The operations group for this extension method. @@ -9473,20 +9709,21 @@ public static SiteAuthSettings UpdateAuthSettingsSlot(this IWebAppsOperations op /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. /// - public static SiteAuthSettings GetAuthSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static CsmPublishingCredentialsPoliciesEntity UpdateScmAllowedSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot) { - return operations.GetAuthSettingsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.UpdateScmAllowedSlotAsync(resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot).GetAwaiter().GetResult(); } /// - /// Gets the Authentication/Authorization settings of an app. + /// Updates whether user publishing credentials are allowed on the site or not. /// /// - /// Description for Gets the Authentication/Authorization settings of an app. + /// Description for Updates whether user publishing credentials are allowed on + /// the site or not. /// /// /// The operations group for this extension method. @@ -9497,28 +9734,26 @@ public static SiteAuthSettings GetAuthSettingsSlot(this IWebAppsOperations opera /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. /// /// /// The cancellation token. /// - public static async Task GetAuthSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateScmAllowedSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetAuthSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateScmAllowedSlotWithHttpMessagesAsync(resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Updates site's Authentication / Authorization settings for apps via the V2 - /// format + /// List the configurations of an app /// /// - /// Description for Updates site's Authentication / Authorization settings for - /// apps via the V2 format + /// Description for List the configurations of an app /// /// /// The operations group for this extension method. @@ -9527,27 +9762,22 @@ public static SiteAuthSettings GetAuthSettingsSlot(this IWebAppsOperations opera /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Auth settings associated with web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// return configuration for the production slot. /// - public static SiteAuthSettingsV2 UpdateAuthSettingsV2Slot(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot) + public static IPage ListConfigurationsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.UpdateAuthSettingsV2SlotAsync(resourceGroupName, name, siteAuthSettingsV2, slot).GetAwaiter().GetResult(); + return operations.ListConfigurationsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Updates site's Authentication / Authorization settings for apps via the V2 - /// format + /// List the configurations of an app /// /// - /// Description for Updates site's Authentication / Authorization settings for - /// apps via the V2 format + /// Description for List the configurations of an app /// /// /// The operations group for this extension method. @@ -9556,33 +9786,28 @@ public static SiteAuthSettingsV2 UpdateAuthSettingsV2Slot(this IWebAppsOperation /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Auth settings associated with web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// return configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task UpdateAuthSettingsV2SlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListConfigurationsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateAuthSettingsV2SlotWithHttpMessagesAsync(resourceGroupName, name, siteAuthSettingsV2, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListConfigurationsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets site's Authentication / Authorization settings for apps via the V2 - /// format + /// Replaces the application settings of an app. /// /// - /// Description for Gets site's Authentication / Authorization settings for - /// apps via the V2 format + /// Description for Replaces the application settings of an app. /// /// /// The operations group for this extension method. @@ -9593,22 +9818,23 @@ public static SiteAuthSettingsV2 UpdateAuthSettingsV2Slot(this IWebAppsOperation /// /// Name of the app. /// + /// + /// Application settings of the app. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the application settings for the production slot. /// - public static SiteAuthSettingsV2 GetAuthSettingsV2Slot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static StringDictionary UpdateApplicationSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, StringDictionary appSettings, string slot) { - return operations.GetAuthSettingsV2SlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.UpdateApplicationSettingsSlotAsync(resourceGroupName, name, appSettings, slot).GetAwaiter().GetResult(); } /// - /// Gets site's Authentication / Authorization settings for apps via the V2 - /// format + /// Replaces the application settings of an app. /// /// - /// Description for Gets site's Authentication / Authorization settings for - /// apps via the V2 format + /// Description for Replaces the application settings of an app. /// /// /// The operations group for this extension method. @@ -9619,26 +9845,548 @@ public static SiteAuthSettingsV2 GetAuthSettingsV2Slot(this IWebAppsOperations o /// /// Name of the app. /// + /// + /// Application settings of the app. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the application settings for the production slot. /// /// /// The cancellation token. /// - public static async Task GetAuthSettingsV2SlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateApplicationSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, StringDictionary appSettings, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateApplicationSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, appSettings, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the application settings of an app. + /// + /// + /// Description for Gets the application settings of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the application settings for the production slot. + /// + public static StringDictionary ListApplicationSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + { + return operations.ListApplicationSettingsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Gets the application settings of an app. + /// + /// + /// Description for Gets the application settings of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the application settings for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task ListApplicationSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListApplicationSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates the Authentication / Authorization settings associated with web + /// app. + /// + /// + /// Description for Updates the Authentication / Authorization settings + /// associated with web app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Auth settings associated with web app. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + public static SiteAuthSettings UpdateAuthSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot) + { + return operations.UpdateAuthSettingsSlotAsync(resourceGroupName, name, siteAuthSettings, slot).GetAwaiter().GetResult(); + } + + /// + /// Updates the Authentication / Authorization settings associated with web + /// app. + /// + /// + /// Description for Updates the Authentication / Authorization settings + /// associated with web app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Auth settings associated with web app. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAuthSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateAuthSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, siteAuthSettings, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the Authentication/Authorization settings of an app. + /// + /// + /// Description for Gets the Authentication/Authorization settings of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the settings for the production slot. + /// + public static SiteAuthSettings GetAuthSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + { + return operations.GetAuthSettingsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Gets the Authentication/Authorization settings of an app. + /// + /// + /// Description for Gets the Authentication/Authorization settings of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the settings for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task GetAuthSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAuthSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates site's Authentication / Authorization settings for apps via the V2 + /// format + /// + /// + /// Description for Updates site's Authentication / Authorization settings for + /// apps via the V2 format + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Auth settings associated with web app. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + public static SiteAuthSettingsV2 UpdateAuthSettingsV2Slot(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot) + { + return operations.UpdateAuthSettingsV2SlotAsync(resourceGroupName, name, siteAuthSettingsV2, slot).GetAwaiter().GetResult(); + } + + /// + /// Updates site's Authentication / Authorization settings for apps via the V2 + /// format + /// + /// + /// Description for Updates site's Authentication / Authorization settings for + /// apps via the V2 format + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Auth settings associated with web app. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAuthSettingsV2SlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateAuthSettingsV2SlotWithHttpMessagesAsync(resourceGroupName, name, siteAuthSettingsV2, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets site's Authentication / Authorization settings for apps via the V2 + /// format + /// + /// + /// Description for Gets site's Authentication / Authorization settings for + /// apps via the V2 format + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the settings for the production slot. + /// + public static SiteAuthSettingsV2 GetAuthSettingsV2Slot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + { + return operations.GetAuthSettingsV2SlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Gets site's Authentication / Authorization settings for apps via the V2 + /// format + /// + /// + /// Description for Gets site's Authentication / Authorization settings for + /// apps via the V2 format + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the settings for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task GetAuthSettingsV2SlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAuthSettingsV2SlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates the Azure storage account configurations of an app. + /// + /// + /// Description for Updates the Azure storage account configurations of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Azure storage accounts of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. + /// + public static AzureStoragePropertyDictionaryResource UpdateAzureStorageAccountsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot) + { + return operations.UpdateAzureStorageAccountsSlotAsync(resourceGroupName, name, azureStorageAccounts, slot).GetAwaiter().GetResult(); + } + + /// + /// Updates the Azure storage account configurations of an app. + /// + /// + /// Description for Updates the Azure storage account configurations of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Azure storage accounts of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAzureStorageAccountsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateAzureStorageAccountsSlotWithHttpMessagesAsync(resourceGroupName, name, azureStorageAccounts, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the Azure storage account configurations of an app. + /// + /// + /// Description for Gets the Azure storage account configurations of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. + /// + public static AzureStoragePropertyDictionaryResource ListAzureStorageAccountsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + { + return operations.ListAzureStorageAccountsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Gets the Azure storage account configurations of an app. + /// + /// + /// Description for Gets the Azure storage account configurations of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task ListAzureStorageAccountsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAzureStorageAccountsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates the backup configuration of an app. + /// + /// + /// Description for Updates the backup configuration of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Edited backup configuration. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the backup configuration for the production slot. + /// + public static BackupRequest UpdateBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, BackupRequest request, string slot) + { + return operations.UpdateBackupConfigurationSlotAsync(resourceGroupName, name, request, slot).GetAwaiter().GetResult(); + } + + /// + /// Updates the backup configuration of an app. + /// + /// + /// Description for Updates the backup configuration of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Edited backup configuration. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the backup configuration for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, BackupRequest request, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, request, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the backup configuration of an app. + /// + /// + /// Description for Deletes the backup configuration of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the backup configuration for the production slot. + /// + public static void DeleteBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + { + operations.DeleteBackupConfigurationSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Deletes the backup configuration of an app. + /// + /// + /// Description for Deletes the backup configuration of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the backup configuration for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetAuthSettingsV2SlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Updates the Azure storage account configurations of an app. + /// Gets the backup configuration of an app. /// /// - /// Description for Updates the Azure storage account configurations of an app. + /// Description for Gets the backup configuration of an app. /// /// /// The operations group for this extension method. @@ -9649,23 +10397,20 @@ public static SiteAuthSettingsV2 GetAuthSettingsV2Slot(this IWebAppsOperations o /// /// Name of the app. /// - /// - /// Azure storage accounts of the app. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the backup configuration for the production slot. /// - public static AzureStoragePropertyDictionaryResource UpdateAzureStorageAccountsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot) + public static BackupRequest GetBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.UpdateAzureStorageAccountsSlotAsync(resourceGroupName, name, azureStorageAccounts, slot).GetAwaiter().GetResult(); + return operations.GetBackupConfigurationSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Updates the Azure storage account configurations of an app. + /// Gets the backup configuration of an app. /// /// - /// Description for Updates the Azure storage account configurations of an app. + /// Description for Gets the backup configuration of an app. /// /// /// The operations group for this extension method. @@ -9676,29 +10421,26 @@ public static AzureStoragePropertyDictionaryResource UpdateAzureStorageAccountsS /// /// Name of the app. /// - /// - /// Azure storage accounts of the app. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the backup configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task UpdateAzureStorageAccountsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateAzureStorageAccountsSlotWithHttpMessagesAsync(resourceGroupName, name, azureStorageAccounts, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the Azure storage account configurations of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Gets the Azure storage account configurations of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// The operations group for this extension method. @@ -9710,19 +10452,17 @@ public static AzureStoragePropertyDictionaryResource UpdateAzureStorageAccountsS /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. /// - public static AzureStoragePropertyDictionaryResource ListAzureStorageAccountsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static IPage GetAppSettingsKeyVaultReferencesSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.ListAzureStorageAccountsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.GetAppSettingsKeyVaultReferencesSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Gets the Azure storage account configurations of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Gets the Azure storage account configurations of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// The operations group for this extension method. @@ -9734,25 +10474,23 @@ public static AzureStoragePropertyDictionaryResource ListAzureStorageAccountsSlo /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. /// /// /// The cancellation token. /// - public static async Task ListAzureStorageAccountsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetAppSettingsKeyVaultReferencesSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAzureStorageAccountsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetAppSettingsKeyVaultReferencesSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Updates the backup configuration of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Updates the backup configuration of an app. + /// Description for Gets the config reference and status of an app /// /// /// The operations group for this extension method. @@ -9763,23 +10501,21 @@ public static AzureStoragePropertyDictionaryResource ListAzureStorageAccountsSlo /// /// Name of the app. /// - /// - /// Edited backup configuration. + /// + /// App Setting key name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the backup configuration for the production slot. /// - public static BackupRequest UpdateBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, BackupRequest request, string slot) + public static ApiKVReference GetAppSettingKeyVaultReferenceSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string appSettingKey, string slot) { - return operations.UpdateBackupConfigurationSlotAsync(resourceGroupName, name, request, slot).GetAwaiter().GetResult(); + return operations.GetAppSettingKeyVaultReferenceSlotAsync(resourceGroupName, name, appSettingKey, slot).GetAwaiter().GetResult(); } /// - /// Updates the backup configuration of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Updates the backup configuration of an app. + /// Description for Gets the config reference and status of an app /// /// /// The operations group for this extension method. @@ -9790,29 +10526,27 @@ public static BackupRequest UpdateBackupConfigurationSlot(this IWebAppsOperation /// /// Name of the app. /// - /// - /// Edited backup configuration. + /// + /// App Setting key name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the backup configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task UpdateBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, BackupRequest request, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAppSettingKeyVaultReferenceSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string appSettingKey, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, request, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetAppSettingKeyVaultReferenceSlotWithHttpMessagesAsync(resourceGroupName, name, appSettingKey, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes the backup configuration of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Deletes the backup configuration of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// The operations group for this extension method. @@ -9824,19 +10558,17 @@ public static BackupRequest UpdateBackupConfigurationSlot(this IWebAppsOperation /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the backup configuration for the production slot. /// - public static void DeleteBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static IPage GetSiteConnectionStringKeyVaultReferencesSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - operations.DeleteBackupConfigurationSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.GetSiteConnectionStringKeyVaultReferencesSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Deletes the backup configuration of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Deletes the backup configuration of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// The operations group for this extension method. @@ -9848,22 +10580,23 @@ public static void DeleteBackupConfigurationSlot(this IWebAppsOperations operati /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the backup configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task DeleteBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetSiteConnectionStringKeyVaultReferencesSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.GetSiteConnectionStringKeyVaultReferencesSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets the backup configuration of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Gets the backup configuration of an app. + /// Description for Gets the config reference and status of an app /// /// /// The operations group for this extension method. @@ -9874,20 +10607,20 @@ public static void DeleteBackupConfigurationSlot(this IWebAppsOperations operati /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the backup configuration for the production slot. /// - public static BackupRequest GetBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static ApiKVReference GetSiteConnectionStringKeyVaultReferenceSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string connectionStringKey, string slot) { - return operations.GetBackupConfigurationSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.GetSiteConnectionStringKeyVaultReferenceSlotAsync(resourceGroupName, name, connectionStringKey, slot).GetAwaiter().GetResult(); } /// - /// Gets the backup configuration of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Gets the backup configuration of an app. + /// Description for Gets the config reference and status of an app /// /// /// The operations group for this extension method. @@ -9898,16 +10631,16 @@ public static BackupRequest GetBackupConfigurationSlot(this IWebAppsOperations o /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the backup configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task GetBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetSiteConnectionStringKeyVaultReferenceSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string connectionStringKey, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetSiteConnectionStringKeyVaultReferenceSlotWithHttpMessagesAsync(resourceGroupName, name, connectionStringKey, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -14805,80 +15538,6 @@ public static SwiftVirtualNetwork GetSwiftVirtualNetworkConnectionSlot(this IWeb } } - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. - /// - public static SwiftVirtualNetwork CreateOrUpdateSwiftVirtualNetworkConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot) - { - return operations.CreateOrUpdateSwiftVirtualNetworkConnectionSlotAsync(resourceGroupName, name, connectionEnvelope, slot).GetAwaiter().GetResult(); - } - - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateSwiftVirtualNetworkConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Deletes a Swift Virtual Network connection from an app (or deployment /// slot). @@ -14934,80 +15593,6 @@ public static void DeleteSwiftVirtualNetworkSlot(this IWebAppsOperations operati (await operations.DeleteSwiftVirtualNetworkSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. - /// - public static SwiftVirtualNetwork UpdateSwiftVirtualNetworkConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot) - { - return operations.UpdateSwiftVirtualNetworkConnectionSlotAsync(resourceGroupName, name, connectionEnvelope, slot).GetAwaiter().GetResult(); - } - - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateSwiftVirtualNetworkConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all network features used by the app (or deployment slot, if /// specified). @@ -15026,7 +15611,7 @@ public static SwiftVirtualNetwork UpdateSwiftVirtualNetworkConnectionSlot(this I /// Name of the app. /// /// - /// The type of view. This can either be "summary" or "detailed". + /// The type of view. Only "summary" is supported at this time. /// /// /// Name of the deployment slot. If a slot is not specified, the API will get @@ -15055,7 +15640,7 @@ public static NetworkFeatures ListNetworkFeaturesSlot(this IWebAppsOperations op /// Name of the app. /// /// - /// The type of view. This can either be "summary" or "detailed". + /// The type of view. Only "summary" is supported at this time. /// /// /// Name of the deployment slot. If a slot is not specified, the API will get @@ -16027,7 +16612,66 @@ public static PrivateAccess GetPrivateAccessSlot(this IWebAppsOperations operati /// Networks that can access the site. /// /// - /// Description for Gets data around private site access enablement and + /// Description for Gets data around private site access enablement and + /// authorized Virtual Networks that can access the site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. + /// + /// + /// The name of the slot for the web app. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateAccessSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateAccessSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Sets data around private site access enablement and authorized Virtual + /// Networks that can access the site. + /// + /// + /// Description for Sets data around private site access enablement and + /// authorized Virtual Networks that can access the site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. + /// + /// + /// The information for the private access + /// + /// + /// The name of the slot for the web app. + /// + public static PrivateAccess PutPrivateAccessVnetSlot(this IWebAppsOperations operations, string resourceGroupName, string name, PrivateAccess access, string slot) + { + return operations.PutPrivateAccessVnetSlotAsync(resourceGroupName, name, access, slot).GetAwaiter().GetResult(); + } + + /// + /// Sets data around private site access enablement and authorized Virtual + /// Networks that can access the site. + /// + /// + /// Description for Sets data around private site access enablement and /// authorized Virtual Networks that can access the site. /// /// @@ -16039,27 +16683,29 @@ public static PrivateAccess GetPrivateAccessSlot(this IWebAppsOperations operati /// /// The name of the web app. /// + /// + /// The information for the private access + /// /// /// The name of the slot for the web app. /// /// /// The cancellation token. /// - public static async Task GetPrivateAccessSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task PutPrivateAccessVnetSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, PrivateAccess access, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPrivateAccessSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.PutPrivateAccessVnetSlotWithHttpMessagesAsync(resourceGroupName, name, access, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Sets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Sets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// The operations group for this extension method. @@ -16068,26 +16714,22 @@ public static PrivateAccess GetPrivateAccessSlot(this IWebAppsOperations operati /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The information for the private access + /// Name of the site. /// /// - /// The name of the slot for the web app. + /// Name of the site deployment slot. /// - public static PrivateAccess PutPrivateAccessVnetSlot(this IWebAppsOperations operations, string resourceGroupName, string name, PrivateAccess access, string slot) + public static IPage GetPrivateEndpointConnectionListSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.PutPrivateAccessVnetSlotAsync(resourceGroupName, name, access, slot).GetAwaiter().GetResult(); + return operations.GetPrivateEndpointConnectionListSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Sets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Sets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// The operations group for this extension method. @@ -16096,20 +16738,17 @@ public static PrivateAccess PutPrivateAccessVnetSlot(this IWebAppsOperations ope /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The information for the private access + /// Name of the site. /// /// - /// The name of the slot for the web app. + /// Name of the site deployment slot. /// /// /// The cancellation token. /// - public static async Task PutPrivateAccessVnetSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, PrivateAccess access, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetPrivateEndpointConnectionListSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.PutPrivateAccessVnetSlotWithHttpMessagesAsync(resourceGroupName, name, access, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPrivateEndpointConnectionListSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -16131,10 +16770,14 @@ public static PrivateAccess PutPrivateAccessVnetSlot(this IWebAppsOperations ope /// Name of the site. /// /// + /// Name of the private endpoint connection. + /// + /// + /// Name of the site deployment slot. /// - public static PrivateEndpointConnectionResource GetPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot) { - return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + return operations.GetPrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, slot).GetAwaiter().GetResult(); } /// @@ -16153,13 +16796,17 @@ public static PrivateEndpointConnectionResource GetPrivateEndpointConnection(thi /// Name of the site. /// /// + /// Name of the private endpoint connection. + /// + /// + /// Name of the site deployment slot. /// /// /// The cancellation token. /// - public static async Task GetPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetPrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -16184,9 +16831,11 @@ public static PrivateEndpointConnectionResource GetPrivateEndpointConnection(thi /// /// /// - public static PrivateEndpointConnectionResource ApproveOrRejectPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + /// + /// + public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot) { - return operations.ApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + return operations.ApproveOrRejectPrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot).GetAwaiter().GetResult(); } /// @@ -16208,12 +16857,14 @@ public static PrivateEndpointConnectionResource ApproveOrRejectPrivateEndpointCo /// /// /// + /// + /// /// /// The cancellation token. /// - public static async Task ApproveOrRejectPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ApproveOrRejectPrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -16236,9 +16887,11 @@ public static PrivateEndpointConnectionResource ApproveOrRejectPrivateEndpointCo /// /// /// - public static object DeletePrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + /// + /// + public static object DeletePrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot) { - return operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + return operations.DeletePrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, slot).GetAwaiter().GetResult(); } /// @@ -16258,12 +16911,14 @@ public static object DeletePrivateEndpointConnection(this IWebAppsOperations ope /// /// /// + /// + /// /// /// The cancellation token. /// - public static async Task DeletePrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeletePrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -16284,9 +16939,11 @@ public static object DeletePrivateEndpointConnection(this IWebAppsOperations ope /// /// Name of the site. /// - public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IWebAppsOperations operations, string resourceGroupName, string name) + /// + /// + public static PrivateLinkResourcesWrapper GetPrivateLinkResourcesSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.GetPrivateLinkResourcesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.GetPrivateLinkResourcesSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// @@ -16304,12 +16961,14 @@ public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IWebAppsO /// /// Name of the site. /// + /// + /// /// /// The cancellation token. /// - public static async Task GetPrivateLinkResourcesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetPrivateLinkResourcesSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPrivateLinkResourcesSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -17599,67 +18258,6 @@ public static void DeleteSiteExtensionSlot(this IWebAppsOperations operations, s (await operations.DeleteSiteExtensionSlotWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - public static void CopySlotSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot) - { - operations.CopySlotSlotAsync(resourceGroupName, name, copySlotEntity, slot).GetAwaiter().GetResult(); - } - - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - /// - /// The cancellation token. - /// - public static async Task CopySlotSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CopySlotSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// Get the difference in configuration settings between two web app slots. /// @@ -18018,9 +18616,11 @@ public static SiteSourceControl CreateOrUpdateSourceControlSlot(this IWebAppsOpe /// Name of the deployment slot. If a slot is not specified, the API will /// delete the source control configuration for the production slot. /// - public static void DeleteSourceControlSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + /// + /// + public static void DeleteSourceControlSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, string additionalFlags = default(string)) { - operations.DeleteSourceControlSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + operations.DeleteSourceControlSlotAsync(resourceGroupName, name, slot, additionalFlags).GetAwaiter().GetResult(); } /// @@ -18042,12 +18642,14 @@ public static void DeleteSourceControlSlot(this IWebAppsOperations operations, s /// Name of the deployment slot. If a slot is not specified, the API will /// delete the source control configuration for the production slot. /// + /// + /// /// /// The cancellation token. /// - public static async Task DeleteSourceControlSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteSourceControlSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, string additionalFlags = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteSourceControlSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteSourceControlSlotWithHttpMessagesAsync(resourceGroupName, name, slot, additionalFlags, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -19824,9 +20426,11 @@ public static SiteSourceControl CreateOrUpdateSourceControl(this IWebAppsOperati /// /// Name of the app. /// - public static void DeleteSourceControl(this IWebAppsOperations operations, string resourceGroupName, string name) + /// + /// + public static void DeleteSourceControl(this IWebAppsOperations operations, string resourceGroupName, string name, string additionalFlags = default(string)) { - operations.DeleteSourceControlAsync(resourceGroupName, name).GetAwaiter().GetResult(); + operations.DeleteSourceControlAsync(resourceGroupName, name, additionalFlags).GetAwaiter().GetResult(); } /// @@ -19844,12 +20448,14 @@ public static void DeleteSourceControl(this IWebAppsOperations operations, strin /// /// Name of the app. /// + /// + /// /// /// The cancellation token. /// - public static async Task DeleteSourceControlAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteSourceControlAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string additionalFlags = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteSourceControlWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteSourceControlWithHttpMessagesAsync(resourceGroupName, name, additionalFlags, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -21637,6 +22243,110 @@ public static Operation BeginMigrateMySql(this IWebAppsOperations operations, st } } + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + return operations.BeginApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginApproveOrRejectPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + public static object BeginDeletePrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeletePrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Restores an app from a backup blob in Azure Storage. /// @@ -21833,62 +22543,9 @@ public static SiteExtensionInfo BeginInstallSiteExtension(this IWebAppsOperation public static async Task BeginInstallSiteExtensionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginInstallSiteExtensionWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - public static void BeginCopyProductionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity) - { - operations.BeginCopyProductionSlotAsync(resourceGroupName, name, copySlotEntity).GetAwaiter().GetResult(); - } - - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCopyProductionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginCopyProductionSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, null, cancellationToken).ConfigureAwait(false)).Dispose(); + { + return _result.Body; + } } /// @@ -22357,9 +23014,11 @@ public static MSDeployStatus BeginCreateInstanceMSDeployOperationSlot(this IWebA /// /// /// - public static PrivateEndpointConnectionResource BeginApproveOrRejectPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + /// + /// + public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot) { - return operations.BeginApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + return operations.BeginApproveOrRejectPrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot).GetAwaiter().GetResult(); } /// @@ -22381,12 +23040,14 @@ public static PrivateEndpointConnectionResource BeginApproveOrRejectPrivateEndpo /// /// /// + /// + /// /// /// The cancellation token. /// - public static async Task BeginApproveOrRejectPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginApproveOrRejectPrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -22409,9 +23070,11 @@ public static PrivateEndpointConnectionResource BeginApproveOrRejectPrivateEndpo /// /// /// - public static object BeginDeletePrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + /// + /// + public static object BeginDeletePrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot) { - return operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + return operations.BeginDeletePrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, slot).GetAwaiter().GetResult(); } /// @@ -22431,12 +23094,14 @@ public static object BeginDeletePrivateEndpointConnection(this IWebAppsOperation /// /// /// + /// + /// /// /// The cancellation token. /// - public static async Task BeginDeletePrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeletePrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -22675,67 +23340,6 @@ public static SiteExtensionInfo BeginInstallSiteExtensionSlot(this IWebAppsOpera } } - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - public static void BeginCopySlotSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot) - { - operations.BeginCopySlotSlotAsync(resourceGroupName, name, copySlotEntity, slot).GetAwaiter().GetResult(); - } - - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCopySlotSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginCopySlotSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// Swaps two deployment slots of an app. /// @@ -23250,6 +23854,86 @@ public static IPage ListConfigurationsNext(this IWebAppsOper } } + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetAppSettingsKeyVaultReferencesNext(this IWebAppsOperations operations, string nextPageLink) + { + return operations.GetAppSettingsKeyVaultReferencesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetAppSettingsKeyVaultReferencesNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAppSettingsKeyVaultReferencesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetSiteConnectionStringKeyVaultReferencesNext(this IWebAppsOperations operations, string nextPageLink) + { + return operations.GetSiteConnectionStringKeyVaultReferencesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetSiteConnectionStringKeyVaultReferencesNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSiteConnectionStringKeyVaultReferencesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a list of web app configuration snapshots identifiers. Each element of /// the list contains a timestamp and the ID of the snapshot. @@ -23748,6 +24432,48 @@ public static IPage ListPerfMonCountersNext(this IWebAppsOperat } } + /// + /// Gets the list of private endpoint connections associated with a site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetPrivateEndpointConnectionListNext(this IWebAppsOperations operations, string nextPageLink) + { + return operations.GetPrivateEndpointConnectionListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of private endpoint connections associated with a site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get list of processes for a web site, or a deployment slot, or for a /// specific scaled-out instance in a web site. @@ -24082,6 +24808,86 @@ public static IPage ListConfigurationsSlotNext(this IWebApps } } + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetAppSettingsKeyVaultReferencesSlotNext(this IWebAppsOperations operations, string nextPageLink) + { + return operations.GetAppSettingsKeyVaultReferencesSlotNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetAppSettingsKeyVaultReferencesSlotNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAppSettingsKeyVaultReferencesSlotNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetSiteConnectionStringKeyVaultReferencesSlotNext(this IWebAppsOperations operations, string nextPageLink) + { + return operations.GetSiteConnectionStringKeyVaultReferencesSlotNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetSiteConnectionStringKeyVaultReferencesSlotNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSiteConnectionStringKeyVaultReferencesSlotNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a list of web app configuration snapshots identifiers. Each element of /// the list contains a timestamp and the ID of the snapshot. @@ -24580,6 +25386,48 @@ public static IPage ListPerfMonCountersSlotNext(this IWebAppsOp } } + /// + /// Gets the list of private endpoint connections associated with a site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetPrivateEndpointConnectionListSlotNext(this IWebAppsOperations operations, string nextPageLink) + { + return operations.GetPrivateEndpointConnectionListSlotNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of private endpoint connections associated with a site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListSlotNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListSlotNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get list of processes for a web site, or a deployment slot, or for a /// specific scaled-out instance in a web site. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs index e13c1b883b34..0ccd5a99dd44 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs @@ -82,6 +82,11 @@ public partial class WebSiteManagementClient : ServiceClient public virtual IAppServiceCertificateOrdersOperations AppServiceCertificateOrders { get; private set; } + /// + /// Gets the ICertificateOrdersDiagnosticsOperations. + /// + public virtual ICertificateOrdersDiagnosticsOperations CertificateOrdersDiagnostics { get; private set; } + /// /// Gets the ICertificateRegistrationProviderOperations. /// @@ -117,6 +122,11 @@ public partial class WebSiteManagementClient : ServiceClient public virtual IDiagnosticsOperations Diagnostics { get; private set; } + /// + /// Gets the IGlobalModelOperations. + /// + public virtual IGlobalModelOperations GlobalModel { get; private set; } + /// /// Gets the IProviderOperations. /// @@ -394,6 +404,7 @@ public WebSiteManagementClient(System.Uri baseUri, ServiceClientCredentials cred private void Initialize() { AppServiceCertificateOrders = new AppServiceCertificateOrdersOperations(this); + CertificateOrdersDiagnostics = new CertificateOrdersDiagnosticsOperations(this); CertificateRegistrationProvider = new CertificateRegistrationProviderOperations(this); Domains = new DomainsOperations(this); TopLevelDomains = new TopLevelDomainsOperations(this); @@ -401,6 +412,7 @@ private void Initialize() Certificates = new CertificatesOperations(this); DeletedWebApps = new DeletedWebAppsOperations(this); Diagnostics = new DiagnosticsOperations(this); + GlobalModel = new GlobalModelOperations(this); Provider = new ProviderOperations(this); Recommendations = new RecommendationsOperations(this); WebApps = new WebAppsOperations(this); @@ -409,7 +421,7 @@ private void Initialize() AppServicePlans = new AppServicePlansOperations(this); ResourceHealthMetadata = new ResourceHealthMetadataOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-06-01"; + ApiVersion = "2020-12-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -443,6 +455,204 @@ private void Initialize() DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } + /// + /// Exchange code for GitHub access token for AppService CLI + /// + /// + /// Description for Exchange code for GitHub access token for AppService CLI + /// + /// + /// Code string to exchange for Github Access token + /// + /// + /// State string used for verification. + /// + /// + /// 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> GenerateGithubAccessTokenForAppserviceCLIAsyncWithHttpMessagesAsync(string code, string state, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (code == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "code"); + } + if (state == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "state"); + } + AppserviceGithubTokenRequest request = new AppserviceGithubTokenRequest(); + if (code != null || state != null) + { + request.Code = code; + request.State = state; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GenerateGithubAccessTokenForAppserviceCLIAsync", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/generateGithubAccessTokenForAppserviceCLI").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("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(request != null) + { + _requestContent = SafeJsonConvert.SerializeObject(request, 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _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 publishing user /// @@ -1935,7 +2145,8 @@ private void Initialize() /// /// Name of SKU used to filter the regions. Possible values include: 'Free', /// 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', - /// 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' + /// 'IsolatedV2', 'PremiumV2', 'PremiumV3', 'PremiumContainer', + /// 'ElasticPremium', 'ElasticIsolated' /// /// /// Specify <code>true</code> if you want to filter to only regions diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClientExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClientExtensions.cs index ef734c7a7f7b..653d2cddfeee 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClientExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClientExtensions.cs @@ -21,6 +21,52 @@ namespace Microsoft.Azure.Management.WebSites /// public static partial class WebSiteManagementClientExtensions { + /// + /// Exchange code for GitHub access token for AppService CLI + /// + /// + /// Description for Exchange code for GitHub access token for AppService CLI + /// + /// + /// The operations group for this extension method. + /// + /// + /// Code string to exchange for Github Access token + /// + /// + /// State string used for verification. + /// + public static AppserviceGithubToken GenerateGithubAccessTokenForAppserviceCLIAsync(this IWebSiteManagementClient operations, string code, string state) + { + return operations.GenerateGithubAccessTokenForAppserviceCLIAsyncAsync(code, state).GetAwaiter().GetResult(); + } + + /// + /// Exchange code for GitHub access token for AppService CLI + /// + /// + /// Description for Exchange code for GitHub access token for AppService CLI + /// + /// + /// The operations group for this extension method. + /// + /// + /// Code string to exchange for Github Access token + /// + /// + /// State string used for verification. + /// + /// + /// The cancellation token. + /// + public static async Task GenerateGithubAccessTokenForAppserviceCLIAsyncAsync(this IWebSiteManagementClient operations, string code, string state, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GenerateGithubAccessTokenForAppserviceCLIAsyncWithHttpMessagesAsync(code, state, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets publishing user /// @@ -365,7 +411,8 @@ public static DeploymentLocations GetSubscriptionDeploymentLocations(this IWebSi /// /// Name of SKU used to filter the regions. Possible values include: 'Free', /// 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', - /// 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' + /// 'IsolatedV2', 'PremiumV2', 'PremiumV3', 'PremiumContainer', + /// 'ElasticPremium', 'ElasticIsolated' /// /// /// Specify <code>true</code> if you want to filter to only regions @@ -396,7 +443,8 @@ public static DeploymentLocations GetSubscriptionDeploymentLocations(this IWebSi /// /// Name of SKU used to filter the regions. Possible values include: 'Free', /// 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', - /// 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' + /// 'IsolatedV2', 'PremiumV2', 'PremiumV3', 'PremiumContainer', + /// 'ElasticPremium', 'ElasticIsolated' /// /// /// Specify <code>true</code> if you want to filter to only regions diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj index 6746aec79a70..53eb2ced0ee6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj @@ -7,9 +7,9 @@ Microsoft.Azure.Management.Websites Provides website management capabilities for Microsoft Azure. Microsoft.Azure.Management.Websites - 3.1.0 + 3.1.1 Microsoft Azure website management;website management; - + $(SdkTargetFx) diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Properties/AssemblyInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Properties/AssemblyInfo.cs index e9afa0cf38a9..b846d2da1a76 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Properties/AssemblyInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Properties/AssemblyInfo.cs @@ -8,8 +8,8 @@ [assembly: AssemblyTitle("Microsoft Azure Web Sites Management Library")] [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Web Sites.")] -[assembly: AssemblyVersion("3.1.0")] -[assembly: AssemblyFileVersion("3.1.0")] +[assembly: AssemblyVersion("3.1.1")] +[assembly: AssemblyFileVersion("3.1.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Azure .NET SDK")] From 89bcf4bf7af2521254022df358918e92c27481ea Mon Sep 17 00:00:00 2001 From: Kota Sudhakar Reddy <60102891+Kotasudhakarreddy@users.noreply.github.com> Date: Thu, 15 Apr 2021 15:11:45 +0530 Subject: [PATCH 2/7] Addressed Code review comments. --- .../src/Generated/CertificatesOperations.cs | 4 +- .../CertificatesOperationsExtensions.cs | 2 +- .../src/Generated/ICertificatesOperations.cs | 2 +- .../src/Generated/Models/AutoHealTriggers.cs | 24 +++---- .../src/Generated/Models/SkuCapacity.cs | 24 +++---- .../Models/SlowRequestsBasedTrigger.cs | 18 ++--- .../src/Generated/Models/StackMajorVersion.cs | 66 +++++++++---------- .../Generated/Models/StaticSiteARMResource.cs | 22 +++---- .../Models/StaticSitePatchResource.cs | 26 ++++---- 9 files changed, 94 insertions(+), 94 deletions(-) diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs index 2c7fe52ec5d0..fe277ea35069 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.WebSites using System.Threading; using System.Threading.Tasks; - /// + /// ListWithHttpMessagesAsync /// CertificatesOperations operations. /// internal partial class CertificatesOperations : IServiceOperations, ICertificatesOperations @@ -81,7 +81,7 @@ internal CertificatesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken), string filter = default(string)) { if (Client.SubscriptionId == null) { diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs index 0b12b9a8b490..7b6a61d04351 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs @@ -57,7 +57,7 @@ public static partial class CertificatesOperationsExtensions /// public static async Task> ListAsync(this ICertificatesOperations operations, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken, filter).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs index 86f6dcfa701d..e2d42e2bd289 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs @@ -48,7 +48,7 @@ public partial interface ICertificatesOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken), string filter = default(string)); /// /// Get all certificates in a resource group. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs index 0b7fe084b988..f660ab69959a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs @@ -34,20 +34,20 @@ public AutoHealTriggers() /// A rule based on total requests. /// A rule based on private /// bytes. - /// A rule based on status codes. - /// A rule based on status codes - /// ranges. + /// A rule based on status codes. /// A rule based on request execution /// time. + /// A rule based on status codes + /// ranges. /// A rule based on multiple Slow /// Requests Rule with path - public AutoHealTriggers(RequestsBasedTrigger requests = default(RequestsBasedTrigger), int? privateBytesInKB = default(int?), IList statusCodes = default(IList), IList statusCodesRange = default(IList), SlowRequestsBasedTrigger slowRequests = default(SlowRequestsBasedTrigger), IList slowRequestsWithPath = default(IList)) + public AutoHealTriggers(RequestsBasedTrigger requests = default(RequestsBasedTrigger), int? privateBytesInKB = default(int?), IList statusCodes = default(IList), SlowRequestsBasedTrigger slowRequests = default(SlowRequestsBasedTrigger), IList statusCodesRange = default(IList), IList slowRequestsWithPath = default(IList)) { Requests = requests; PrivateBytesInKB = privateBytesInKB; - StatusCodes = statusCodes; - StatusCodesRange = statusCodesRange; + StatusCodes = statusCodes; SlowRequests = slowRequests; + StatusCodesRange = statusCodesRange; SlowRequestsWithPath = slowRequestsWithPath; CustomInit(); } @@ -75,18 +75,18 @@ public AutoHealTriggers() [JsonProperty(PropertyName = "statusCodes")] public IList StatusCodes { get; set; } - /// - /// Gets or sets a rule based on status codes ranges. - /// - [JsonProperty(PropertyName = "statusCodesRange")] - public IList StatusCodesRange { get; set; } - /// /// Gets or sets a rule based on request execution time. /// [JsonProperty(PropertyName = "slowRequests")] public SlowRequestsBasedTrigger SlowRequests { get; set; } + /// + /// Gets or sets a rule based on status codes ranges. + /// + [JsonProperty(PropertyName = "statusCodesRange")] + public IList StatusCodesRange { get; set; } + /// /// Gets or sets a rule based on multiple Slow Requests Rule with path /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs index dfa25b2e6273..47052f28752b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs @@ -32,20 +32,20 @@ public SkuCapacity() /// Minimum number of workers for this App /// Service plan SKU. /// Maximum number of workers for this App - /// Service plan SKU. - /// Maximum number of Elastic workers for - /// this App Service plan SKU. + /// Service plan SKU. /// Default number of workers for this /// App Service plan SKU. /// Available scale configurations for an App /// Service plan. - public SkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? elasticMaximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string)) + /// Maximum number of Elastic workers for + /// this App Service plan SKU. + public SkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string), int? elasticMaximum = default(int?)) { Minimum = minimum; Maximum = maximum; - ElasticMaximum = elasticMaximum; DefaultProperty = defaultProperty; ScaleType = scaleType; + ElasticMaximum = elasticMaximum; CustomInit(); } @@ -68,13 +68,6 @@ public SkuCapacity() [JsonProperty(PropertyName = "maximum")] public int? Maximum { get; set; } - /// - /// Gets or sets maximum number of Elastic workers for this App Service - /// plan SKU. - /// - [JsonProperty(PropertyName = "elasticMaximum")] - public int? ElasticMaximum { get; set; } - /// /// Gets or sets default number of workers for this App Service plan /// SKU. @@ -89,5 +82,12 @@ public SkuCapacity() [JsonProperty(PropertyName = "scaleType")] public string ScaleType { get; set; } + /// + /// Gets or sets maximum number of Elastic workers for this App Service + /// plan SKU. + /// + [JsonProperty(PropertyName = "elasticMaximum")] + public int? ElasticMaximum { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs index 8eb176a65999..88631d932caf 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs @@ -30,15 +30,15 @@ public SlowRequestsBasedTrigger() /// Initializes a new instance of the SlowRequestsBasedTrigger class. /// /// Time taken. - /// Request Path. /// Request Count. /// Time interval. - public SlowRequestsBasedTrigger(string timeTaken = default(string), string path = default(string), int? count = default(int?), string timeInterval = default(string)) + /// Request Path. + public SlowRequestsBasedTrigger(string timeTaken = default(string), int? count = default(int?), string timeInterval = default(string), string path = default(string)) { TimeTaken = timeTaken; - Path = path; Count = count; TimeInterval = timeInterval; + Path = path; CustomInit(); } @@ -53,12 +53,6 @@ public SlowRequestsBasedTrigger() [JsonProperty(PropertyName = "timeTaken")] public string TimeTaken { get; set; } - /// - /// Gets or sets request Path. - /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } - /// /// Gets or sets request Count. /// @@ -71,5 +65,11 @@ public SlowRequestsBasedTrigger() [JsonProperty(PropertyName = "timeInterval")] public string TimeInterval { get; set; } + /// + /// Gets or sets request Path. + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs index eb43178a5279..29cbddbf0be6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs @@ -43,6 +43,14 @@ public StackMajorVersion() /// <code>true</code> if /// this supports Application Insights; otherwise, /// <code>false</code>. + /// <code>true</code> if this stack + /// is in Preview, otherwise <code>false</code>. + /// <code>true</code> if this + /// stack has been deprecated, otherwise + /// <code>false</code>. + /// <code>true</code> if this stack + /// should be hidden for new customers on portal, otherwise + /// <code>false</code>. /// <appSettings> /// <appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" /> /// </appSettings> @@ -55,26 +63,18 @@ public StackMajorVersion() /// </siteConfigProperties> /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be /// set to 0 - /// <code>true</code> if this stack - /// is in Preview, otherwise <code>false</code>. - /// <code>true</code> if this - /// stack has been deprecated, otherwise - /// <code>false</code>. - /// <code>true</code> if this stack - /// should be hidden for new customers on portal, otherwise - /// <code>false</code>. - public StackMajorVersion(string displayVersion = default(string), string runtimeVersion = default(string), bool? isDefault = default(bool?), IList minorVersions = default(IList), bool? applicationInsights = default(bool?), IDictionary appSettingsDictionary = default(IDictionary), IDictionary siteConfigPropertiesDictionary = default(IDictionary), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?)) + public StackMajorVersion(string displayVersion = default(string), string runtimeVersion = default(string), bool? isDefault = default(bool?), IList minorVersions = default(IList), bool? applicationInsights = default(bool?), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), IDictionary appSettingsDictionary = default(IDictionary), IDictionary siteConfigPropertiesDictionary = default(IDictionary)) { DisplayVersion = displayVersion; RuntimeVersion = runtimeVersion; IsDefault = isDefault; MinorVersions = minorVersions; ApplicationInsights = applicationInsights; - AppSettingsDictionary = appSettingsDictionary; - SiteConfigPropertiesDictionary = siteConfigPropertiesDictionary; IsPreview = isPreview; IsDeprecated = isDeprecated; IsHidden = isHidden; + AppSettingsDictionary = appSettingsDictionary; + SiteConfigPropertiesDictionary = siteConfigPropertiesDictionary; CustomInit(); } @@ -117,28 +117,6 @@ public StackMajorVersion() [JsonProperty(PropertyName = "applicationInsights")] public bool? ApplicationInsights { get; set; } - /// - /// Gets or sets &lt;appSettings&gt; - /// &lt;appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" - /// /&gt; - /// &lt;/appSettings&gt; - /// Example: All the function apps need AppSetting: - /// "FUNCTIONS_WORKER_RUNTIME" to be set stack name - /// - [JsonProperty(PropertyName = "appSettingsDictionary")] - public IDictionary AppSettingsDictionary { get; set; } - - /// - /// Gets or sets &lt;siteConfigProperties&gt; - /// &lt;siteConfigProperty name="Use32BitWorkerProcess" - /// value="false" /&gt; - /// &lt;/siteConfigProperties&gt; - /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be - /// set to 0 - /// - [JsonProperty(PropertyName = "siteConfigPropertiesDictionary")] - public IDictionary SiteConfigPropertiesDictionary { get; set; } - /// /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this /// stack is in Preview, otherwise @@ -163,5 +141,27 @@ public StackMajorVersion() [JsonProperty(PropertyName = "isHidden")] public bool? IsHidden { get; set; } + /// + /// Gets or sets &lt;appSettings&gt; + /// &lt;appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" + /// /&gt; + /// &lt;/appSettings&gt; + /// Example: All the function apps need AppSetting: + /// "FUNCTIONS_WORKER_RUNTIME" to be set stack name + /// + [JsonProperty(PropertyName = "appSettingsDictionary")] + public IDictionary AppSettingsDictionary { get; set; } + + /// + /// Gets or sets &lt;siteConfigProperties&gt; + /// &lt;siteConfigProperty name="Use32BitWorkerProcess" + /// value="false" /&gt; + /// &lt;/siteConfigProperties&gt; + /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be + /// set to 0 + /// + [JsonProperty(PropertyName = "siteConfigPropertiesDictionary")] + public IDictionary SiteConfigPropertiesDictionary { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs index 524500cd9567..f5a08ce52e1c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs @@ -45,8 +45,6 @@ public StaticSiteARMResource() /// URL for the repository of the static /// site. /// The target branch in the repository. - /// The provider that submitted the last - /// deployment to the primary environment of the static site. /// The custom domains associated with this /// static site. /// A user's github repository token. @@ -54,6 +52,8 @@ public StaticSiteARMResource() /// secrets. /// Build properties to configure on the /// repository. + /// The provider that submitted the last + /// deployment to the primary environment of the static site. /// Template options for generating a /// new repository. /// The content distribution @@ -62,16 +62,16 @@ public StaticSiteARMResource() /// Vault Reference authentication. /// User provided function apps /// registered with the static site - public StaticSiteARMResource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), string provider = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), StaticSiteTemplateOptions templateProperties = default(StaticSiteTemplateOptions), string contentDistributionEndpoint = default(string), string keyVaultReferenceIdentity = default(string), IList userProvidedFunctionApps = default(IList), SkuDescription sku = default(SkuDescription), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + public StaticSiteARMResource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), string provider = default(string), StaticSiteTemplateOptions templateProperties = default(StaticSiteTemplateOptions), string contentDistributionEndpoint = default(string), string keyVaultReferenceIdentity = default(string), IList userProvidedFunctionApps = default(IList), SkuDescription sku = default(SkuDescription), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) : base(location, id, name, kind, type, tags) { DefaultHostname = defaultHostname; RepositoryUrl = repositoryUrl; Branch = branch; - Provider = provider; CustomDomains = customDomains; RepositoryToken = repositoryToken; BuildProperties = buildProperties; + Provider = provider; TemplateProperties = templateProperties; ContentDistributionEndpoint = contentDistributionEndpoint; KeyVaultReferenceIdentity = keyVaultReferenceIdentity; @@ -104,13 +104,6 @@ public StaticSiteARMResource() [JsonProperty(PropertyName = "properties.branch")] public string Branch { get; set; } - /// - /// Gets the provider that submitted the last deployment to the primary - /// environment of the static site. - /// - [JsonProperty(PropertyName = "properties.provider")] - public string Provider { get; private set; } - /// /// Gets the custom domains associated with this static site. /// @@ -130,6 +123,13 @@ public StaticSiteARMResource() [JsonProperty(PropertyName = "properties.buildProperties")] public StaticSiteBuildProperties BuildProperties { get; set; } + /// + /// Gets the provider that submitted the last deployment to the primary + /// environment of the static site. + /// + [JsonProperty(PropertyName = "properties.provider")] + public string Provider { get; private set; } + /// /// Gets or sets template options for generating a new repository. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs index eba8b1721766..b6bb48fc0ddb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs @@ -42,16 +42,16 @@ public StaticSitePatchResource() /// for the static site. /// URL for the repository of the static /// site. - /// The target branch in the repository. - /// The provider that submitted the last - /// deployment to the primary environment of the static site. + /// The target branch in the repository. /// The custom domains associated with this /// static site. /// A user's github repository token. /// This is used to setup the Github Actions workflow file and API - /// secrets. + /// secrets. /// Build properties to configure on the /// repository. + /// The provider that submitted the last + /// deployment to the primary environment of the static site. /// Template options for generating a /// new repository. /// The content distribution @@ -60,16 +60,16 @@ public StaticSitePatchResource() /// Vault Reference authentication. /// User provided function apps /// registered with the static site - public StaticSitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), string provider = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), StaticSiteTemplateOptions templateProperties = default(StaticSiteTemplateOptions), string contentDistributionEndpoint = default(string), string keyVaultReferenceIdentity = default(string), IList userProvidedFunctionApps = default(IList)) + public StaticSitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), string provider = default(string), StaticSiteTemplateOptions templateProperties = default(StaticSiteTemplateOptions), string contentDistributionEndpoint = default(string), string keyVaultReferenceIdentity = default(string), IList userProvidedFunctionApps = default(IList)) : base(id, name, kind, type) { DefaultHostname = defaultHostname; RepositoryUrl = repositoryUrl; Branch = branch; - Provider = provider; CustomDomains = customDomains; RepositoryToken = repositoryToken; BuildProperties = buildProperties; + Provider = provider; TemplateProperties = templateProperties; ContentDistributionEndpoint = contentDistributionEndpoint; KeyVaultReferenceIdentity = keyVaultReferenceIdentity; @@ -100,13 +100,6 @@ public StaticSitePatchResource() [JsonProperty(PropertyName = "properties.branch")] public string Branch { get; set; } - /// - /// Gets the provider that submitted the last deployment to the primary - /// environment of the static site. - /// - [JsonProperty(PropertyName = "properties.provider")] - public string Provider { get; private set; } - /// /// Gets the custom domains associated with this static site. /// @@ -126,6 +119,13 @@ public StaticSitePatchResource() [JsonProperty(PropertyName = "properties.buildProperties")] public StaticSiteBuildProperties BuildProperties { get; set; } + /// + /// Gets the provider that submitted the last deployment to the primary + /// environment of the static site. + /// + [JsonProperty(PropertyName = "properties.provider")] + public string Provider { get; private set; } + /// /// Gets or sets template options for generating a new repository. /// From 49a9ba46ae6249e7cfbc90439f70ced033149b43 Mon Sep 17 00:00:00 2001 From: Kota Sudhakar Reddy <60102891+Kotasudhakarreddy@users.noreply.github.com> Date: Thu, 22 Apr 2021 13:32:48 +0530 Subject: [PATCH 3/7] 2020-12 version is reverted/ --- .../mgmtmetadata/web_resource-manager.txt | 7 +- .../AzSdk.RP.props | 2 +- .../AppServiceEnvironmentsOperations.cs | 2940 +- ...ServiceEnvironmentsOperationsExtensions.cs | 494 - .../CertificateOrdersDiagnosticsOperations.cs | 687 - ...teOrdersDiagnosticsOperationsExtensions.cs | 189 - .../src/Generated/CertificatesOperations.cs | 13 +- .../CertificatesOperationsExtensions.cs | 16 +- .../src/Generated/DomainsOperations.cs | 8 +- .../Generated/DomainsOperationsExtensions.cs | 16 +- .../src/Generated/GlobalModelOperations.cs | 597 - .../GlobalModelOperationsExtensions.cs | 150 - .../IAppServiceEnvironmentsOperations.cs | 300 - ...ICertificateOrdersDiagnosticsOperations.cs | 126 - .../src/Generated/ICertificatesOperations.cs | 6 +- .../src/Generated/IDomainsOperations.cs | 8 +- .../src/Generated/IGlobalModelOperations.cs | 103 - .../src/Generated/IProviderOperations.cs | 218 +- .../src/Generated/IStaticSitesOperations.cs | 1450 +- .../src/Generated/IWebAppsOperations.cs | 1180 +- .../src/Generated/IWebSiteManagementClient.cs | 34 +- .../Models/AccessControlEntryAction.cs | 60 + .../src/Generated/Models/ApiKVReference.cs | 117 - .../Models/AppInsightsWebAppStackSettings.cs | 69 - .../Models/AppServiceCertificateOrder.cs | 24 +- ...AppServiceCertificateOrderPatchResource.cs | 24 +- .../Generated/Models/AppServiceEnvironment.cs | 278 +- .../AppServiceEnvironmentPatchResource.cs | 279 +- .../Models/AppServiceEnvironmentResource.cs | 279 +- .../src/Generated/Models/AppServicePlan.cs | 20 +- .../Models/AppServicePlanPatchResource.cs | 35 +- .../src/Generated/Models/Apple.cs | 66 - .../src/Generated/Models/AppleRegistration.cs | 60 - .../src/Generated/Models/ApplicationStack.cs | 14 +- .../Models/ApplicationStackResource.cs | 14 +- .../Generated/Models/AppserviceGithubToken.cs | 87 - .../Models/AppserviceGithubTokenRequest.cs | 80 - .../Models/AseV3NetworkingConfiguration.cs | 77 - .../src/Generated/Models/AutoHealTriggers.cs | 24 +- .../Generated/Models/AzureStaticWebApps.cs | 60 - .../Models/AzureStaticWebAppsRegistration.cs | 56 - .../Generated/Models/AzureStorageInfoValue.cs | 5 +- .../src/Generated/Models/AzureStorageState.cs | 8 +- .../src/Generated/Models/BillingMeter.cs | 10 +- .../src/Generated/Models/Certificate.cs | 17 +- .../Models/CertificateOrderContact.cs | 64 - .../Models/CertificatePatchResource.cs | 22 +- .../src/Generated/Models/ClientCertMode.cs | 8 +- .../Generated/Models/ConfigReferenceSource.cs | 54 - .../src/Generated/Models/CsmCopySlotEntity.cs | 93 + .../Generated/Models/CustomDomainStatus.cs | 26 - .../Generated/Models/DataProviderMetadata.cs | 59 - .../src/Generated/Models/DetectorInfo.cs | 80 +- .../src/Generated/Models/DetectorResponse.cs | 31 +- .../src/Generated/Models/DetectorType.cs | 66 - .../Models/FunctionAppMajorVersion.cs | 71 - .../Models/FunctionAppMinorVersion.cs | 69 - .../Models/FunctionAppRuntimeSettings.cs | 193 - .../Generated/Models/FunctionAppRuntimes.cs | 61 - .../src/Generated/Models/FunctionAppStack.cs | 97 - .../Models/GitHubActionCodeConfiguration.cs | 65 - .../Models/GitHubActionConfiguration.cs | 82 - .../GitHubActionContainerConfiguration.cs | 83 - .../Models/GitHubActionWebAppStackSettings.cs | 66 - .../src/Generated/Models/IdentityProviders.cs | 20 +- .../src/Generated/Models/InsightStatus.cs | 78 - .../Models/KeyValuePairStringObject.cs | 52 - .../Models/KubeEnvironmentProfile.cs | 68 - .../Models/LegacyMicrosoftAccount.cs | 72 - .../Models/LinuxJavaContainerSettings.cs | 127 - .../src/Generated/Models/LoadBalancingMode.cs | 2 +- .../Models/NetworkAccessControlEntry.cs | 78 + ...s => PrivateEndpointConnectionResource.cs} | 28 +- .../Generated/Models/QueryUtterancesResult.cs | 59 - .../Models/QueryUtterancesResults.cs | 62 - .../src/Generated/Models/Rendering.cs | 14 +- .../src/Generated/Models/RenderingType.cs | 128 +- .../src/Generated/Models/ResolveStatus.cs | 114 - .../src/Generated/Models/SampleUtterance.cs | 71 - .../src/Generated/Models/Site.cs | 26 +- .../src/Generated/Models/SiteAuthSettings.cs | 16 +- .../src/Generated/Models/SiteConfig.cs | 139 +- .../Models/SiteConfigPropertiesDictionary.cs | 84 - .../Generated/Models/SiteConfigResource.cs | 139 +- .../src/Generated/Models/SiteLoadBalancing.cs | 8 +- .../src/Generated/Models/SitePatchResource.cs | 26 +- .../src/Generated/Models/SiteSourceControl.cs | 12 +- .../src/Generated/Models/SkuCapacity.cs | 14 +- .../src/Generated/Models/SkuName.cs | 3 - .../Models/SlowRequestsBasedTrigger.cs | 10 +- .../src/Generated/Models/StackMajorVersion.cs | 40 +- .../src/Generated/Models/StackPreferredOs.cs | 60 - .../src/Generated/Models/StampCapacity.cs | 9 +- .../Generated/Models/StaticSiteARMResource.cs | 54 +- .../Models/StaticSiteBuildARMResource.cs | 14 +- .../Models/StaticSiteBuildProperties.cs | 57 +- ...aticSiteCustomDomainOverviewARMResource.cs | 29 +- ...ustomDomainRequestPropertiesARMResource.cs | 62 - .../Models/StaticSitePatchResource.cs | 52 +- .../Models/StaticSiteTemplateOptions.cs | 91 - .../StaticSiteUserProvidedFunctionApp.cs | 83 - ...cSiteUserProvidedFunctionAppARMResource.cs | 83 - .../StaticSiteZipDeploymentARMResource.cs | 96 - .../Models/StaticSitesWorkflowPreview.cs | 69 - .../StaticSitesWorkflowPreviewRequest.cs | 79 - .../src/Generated/Models/Status.cs | 64 - .../Models/StatusCodesBasedTrigger.cs | 10 +- .../Models/StatusCodesRangeBasedTrigger.cs | 75 - .../src/Generated/Models/StringList.cs | 58 - .../src/Generated/Models/SupportTopic.cs | 59 - .../src/Generated/Models/ValidateRequest.cs | 20 +- .../Generated/Models/ValidateResourceTypes.cs | 1 - .../Generated/Models/VirtualNetworkProfile.cs | 16 +- .../src/Generated/Models/VnetParameters.cs | 11 +- .../Models/VnetValidationFailureDetails.cs | 20 +- .../Generated/Models/WebAppMajorVersion.cs | 71 - .../Generated/Models/WebAppMinorVersion.cs | 69 - .../Generated/Models/WebAppRuntimeSettings.cs | 152 - .../src/Generated/Models/WebAppRuntimes.cs | 81 - .../src/Generated/Models/WebAppStack.cs | 96 - .../Models/WindowsJavaContainerSettings.cs | 130 - .../src/Generated/Models/WorkerPool.cs | 91 + .../src/Generated/Models/WorkerSizeOptions.cs | 24 - .../src/Generated/ProviderOperations.cs | 1520 +- .../Generated/ProviderOperationsExtensions.cs | 348 +- .../SdkInfo_WebSiteManagementClient.cs | 76 +- .../src/Generated/StaticSitesOperations.cs | 7187 +---- .../StaticSitesOperationsExtensions.cs | 2425 +- .../src/Generated/WebAppsOperations.cs | 24735 +++++++--------- .../Generated/WebAppsOperationsExtensions.cs | 2424 +- .../src/Generated/WebSiteManagementClient.cs | 215 +- .../WebSiteManagementClientExtensions.cs | 52 +- ...Microsoft.Azure.Management.Websites.csproj | 4 +- .../src/Properties/AssemblyInfo.cs | 4 +- 134 files changed, 14462 insertions(+), 39501 deletions(-) delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperations.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperationsExtensions.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperations.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperationsExtensions.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificateOrdersDiagnosticsOperations.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IGlobalModelOperations.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AccessControlEntryAction.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConfigReferenceSource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmCopySlotEntity.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkAccessControlEntry.cs rename sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/{RemotePrivateEndpointConnectionARMResource.cs => PrivateEndpointConnectionResource.cs} (62%) delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPool.cs diff --git a/eng/mgmt/mgmtmetadata/web_resource-manager.txt b/eng/mgmt/mgmtmetadata/web_resource-manager.txt index 1cf3b1b74b7c..f3ded863f84d 100644 --- a/eng/mgmt/mgmtmetadata/web_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/web_resource-manager.txt @@ -3,11 +3,12 @@ AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-12 --csharp-sdks-folder=K:\DotNet-SDK\Apr-2021\azure-sdk-for-net\sdk -2021-04-12 16:08:50 UTC +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-06 --csharp-sdks-folder=K:\DotNet-SDK\Sep-2020\azure-sdk-for-net\sdk +2020-09-18 04:29:17 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: 73d51f188ceba91939355c8e1d4d74dd38173c13 +Commit: 1b04f5fce19cd330dcc0eec11a98e499c0cda50d AutoRest information Requested version: v2 +Bootstrapper version: autorest@2.0.4413 diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/AzSdk.RP.props b/sdk/websites/Microsoft.Azure.Management.WebSites/AzSdk.RP.props index 5e8eb9669936..a6ad5fd5e9ac 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/AzSdk.RP.props +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/AzSdk.RP.props @@ -1,7 +1,7 @@ - CertificateRegistration_2020-12-01;DomainRegistration_2020-12-01;Web_2020-12-01;Web_2020-12-01;WebSiteManagementClient_2020-12-01; + CertificateRegistration_2020-06-01;DomainRegistration_2020-06-01;Web_2020-06-01;Web_2020-06-01;WebSiteManagementClient_2020-06-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperations.cs index 25f1619436c4..dd3bef96890c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperations.cs @@ -1401,10 +1401,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get networking configuration of an App Service Environment + /// Get diagnostic information for an App Service Environment. /// /// - /// Description for Get networking configuration of an App Service Environment + /// Description for Get diagnostic information for an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -1433,7 +1433,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAseV3NetworkingConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDiagnosticsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1476,11 +1476,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAseV3NetworkingConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDiagnostics", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -1577,7 +1577,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1590,7 +1590,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1610,11 +1610,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Update networking configuration of an App Service Environment + /// Get a diagnostics item for an App Service Environment. /// /// - /// Description for Update networking configuration of an App Service - /// Environment + /// Description for Get a diagnostics item for an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -1622,7 +1621,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// + /// + /// Name of the diagnostics item. /// /// /// Headers that will be added to request. @@ -1645,7 +1645,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAseNetworkingConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDiagnosticsItemWithHttpMessagesAsync(string resourceGroupName, string name, string diagnosticsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1670,9 +1670,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (aseNetworkingConfiguration == null) + if (diagnosticsName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "aseNetworkingConfiguration"); + throw new ValidationException(ValidationRules.CannotBeNull, "diagnosticsName"); } if (Client.SubscriptionId == null) { @@ -1691,15 +1691,16 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("aseNetworkingConfiguration", aseNetworkingConfiguration); + tracingParameters.Add("diagnosticsName", diagnosticsName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAseNetworkingConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticsItem", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{diagnosticsName}", System.Uri.EscapeDataString(diagnosticsName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1713,7 +1714,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1744,12 +1745,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(aseNetworkingConfiguration != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(aseNetworkingConfiguration, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1800,7 +1795,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1813,7 +1808,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1833,10 +1828,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get diagnostic information for an App Service Environment. + /// Get the network endpoints of all inbound dependencies of an App Service + /// Environment. /// /// - /// Description for Get diagnostic information for an App Service Environment. + /// Description for Get the network endpoints of all inbound dependencies of an + /// App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -1865,7 +1862,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDiagnosticsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetInboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1908,11 +1905,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDiagnostics", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInboundNetworkDependenciesEndpoints", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -2009,7 +2006,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2022,7 +2019,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2042,10 +2039,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get a diagnostics item for an App Service Environment. + /// Get all multi-role pools. /// /// - /// Description for Get a diagnostics item for an App Service Environment. + /// Description for Get all multi-role pools. /// /// /// Name of the resource group to which the resource belongs. @@ -2053,9 +2050,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the diagnostics item. - /// /// /// Headers that will be added to request. /// @@ -2077,7 +2071,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDiagnosticsItemWithHttpMessagesAsync(string resourceGroupName, string name, string diagnosticsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRolePoolsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2102,10 +2096,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (diagnosticsName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "diagnosticsName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2123,16 +2113,14 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("diagnosticsName", diagnosticsName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticsItem", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePools", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{diagnosticsName}", System.Uri.EscapeDataString(diagnosticsName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2227,7 +2215,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2240,7 +2228,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2260,12 +2248,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get the network endpoints of all inbound dependencies of an App Service - /// Environment. + /// Get properties of a multi-role pool. /// /// - /// Description for Get the network endpoints of all inbound dependencies of an - /// App Service Environment. + /// Description for Get properties of a multi-role pool. /// /// /// Name of the resource group to which the resource belongs. @@ -2294,7 +2280,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetInboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2337,11 +2323,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInboundNetworkDependenciesEndpoints", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMultiRolePool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -2438,7 +2424,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2451,7 +2437,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2471,10 +2457,38 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get all multi-role pools. + /// Create or update a multi-role pool. /// /// - /// Description for Get all multi-role pools. + /// Description for Create or update a multi-role pool. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Properties of the multi-role pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(resourceGroupName, name, multiRolePoolEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a multi-role pool. + /// + /// + /// Description for Create or update a multi-role pool. /// /// /// Name of the resource group to which the resource belongs. @@ -2482,6 +2496,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Properties of the multi-role pool. + /// /// /// Headers that will be added to request. /// @@ -2503,7 +2520,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRolePoolsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2528,6 +2545,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (multiRolePoolEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "multiRolePoolEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2545,12 +2566,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("multiRolePoolEnvelope", multiRolePoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePools", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateMultiRolePool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -2566,7 +2588,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2597,6 +2619,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(multiRolePoolEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(multiRolePoolEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -2617,7 +2645,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2647,7 +2675,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2660,7 +2688,25 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2680,10 +2726,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get properties of a multi-role pool. + /// Get metric definitions for a specific instance of a multi-role pool of an + /// App Service Environment. /// /// - /// Description for Get properties of a multi-role pool. + /// Description for Get metric definitions for a specific instance of a + /// multi-role pool of an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -2691,6 +2739,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Name of the instance in the multi-role pool. + /// /// /// Headers that will be added to request. /// @@ -2712,7 +2763,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRolePoolInstanceMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string instance, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2737,6 +2788,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (instance == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instance"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2754,14 +2809,16 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("instance", instance); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMultiRolePool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePoolInstanceMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{instance}", System.Uri.EscapeDataString(instance)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2856,7 +2913,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2869,7 +2926,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2889,38 +2946,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Create or update a multi-role pool. - /// - /// - /// Description for Create or update a multi-role pool. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Properties of the multi-role pool. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(resourceGroupName, name, multiRolePoolEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Create or update a multi-role pool. + /// Get metric definitions for a multi-role pool of an App Service Environment. /// /// - /// Description for Create or update a multi-role pool. + /// Description for Get metric definitions for a multi-role pool of an App + /// Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -2928,9 +2958,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Properties of the multi-role pool. - /// /// /// Headers that will be added to request. /// @@ -2952,7 +2979,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRoleMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2977,10 +3004,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (multiRolePoolEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "multiRolePoolEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2998,13 +3021,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("multiRolePoolEnvelope", multiRolePoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateMultiRolePool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRoleMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -3020,7 +3042,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3051,12 +3073,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(multiRolePoolEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(multiRolePoolEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -3077,7 +3093,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3107,7 +3123,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3120,7 +3136,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3132,25 +3148,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) + if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } @@ -3158,12 +3156,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get metric definitions for a specific instance of a multi-role pool of an - /// App Service Environment. + /// Get available SKUs for scaling a multi-role pool. /// /// - /// Description for Get metric definitions for a specific instance of a - /// multi-role pool of an App Service Environment. + /// Description for Get available SKUs for scaling a multi-role pool. /// /// /// Name of the resource group to which the resource belongs. @@ -3171,9 +3167,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the instance in the multi-role pool. - /// /// /// Headers that will be added to request. /// @@ -3195,7 +3188,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRolePoolInstanceMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string instance, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRolePoolSkusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3220,10 +3213,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instance == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instance"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -3241,16 +3230,14 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instance", instance); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePoolInstanceMetricDefinitions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePoolSkus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instance}", System.Uri.EscapeDataString(instance)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3345,7 +3332,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3358,7 +3345,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3378,11 +3365,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get metric definitions for a multi-role pool of an App Service Environment. + /// Get usage metrics for a multi-role pool of an App Service Environment. /// /// - /// Description for Get metric definitions for a multi-role pool of an App - /// Service Environment. + /// Description for Get usage metrics for a multi-role pool of an App Service + /// Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -3411,7 +3398,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRoleMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRoleUsagesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3454,11 +3441,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRoleMetricDefinitions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRoleUsages", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -3555,7 +3542,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3568,7 +3555,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3588,10 +3575,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get available SKUs for scaling a multi-role pool. + /// List all currently running operations on the App Service Environment. /// /// - /// Description for Get available SKUs for scaling a multi-role pool. + /// Description for List all currently running operations on the App Service + /// Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -3620,7 +3608,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRolePoolSkusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListOperationsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3663,11 +3651,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePoolSkus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -3764,7 +3752,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3777,7 +3765,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3797,11 +3785,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get usage metrics for a multi-role pool of an App Service Environment. + /// Get the network endpoints of all outbound dependencies of an App Service + /// Environment. /// /// - /// Description for Get usage metrics for a multi-role pool of an App Service - /// Environment. + /// Description for Get the network endpoints of all outbound dependencies of + /// an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -3830,7 +3819,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRoleUsagesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3873,11 +3862,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRoleUsages", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetOutboundNetworkDependenciesEndpoints", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -3974,7 +3963,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3987,7 +3976,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4007,11 +3996,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// List all currently running operations on the App Service Environment. + /// Reboot all machines in an App Service Environment. /// /// - /// Description for List all currently running operations on the App Service - /// Environment. + /// Description for Reboot all machines in an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -4028,9 +4016,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -4040,7 +4025,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListOperationsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RebootWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4083,11 +4068,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Reboot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -4103,7 +4088,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -4154,7 +4139,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4184,31 +4169,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4217,12 +4184,35 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get the network endpoints of all outbound dependencies of an App Service - /// Environment. + /// Resume an App Service Environment. /// /// - /// Description for Get the network endpoints of all outbound dependencies of - /// an App Service Environment. + /// Description for Resume an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> ResumeWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginResumeWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get all App Service plans in an App Service Environment. + /// + /// + /// Description for Get all App Service plans in an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -4251,7 +4241,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAppServicePlansWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4294,11 +4284,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetOutboundNetworkDependenciesEndpoints", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAppServicePlans", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -4395,7 +4385,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4408,7 +4398,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4428,11 +4418,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Gets the list of private endpoints associated with a hosting environment + /// Get all apps in an App Service Environment. /// /// - /// Description for Gets the list of private endpoints associated with a - /// hosting environment + /// Description for Get all apps in an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -4440,6 +4429,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Comma separated list of app properties to include. + /// /// /// Headers that will be added to request. /// @@ -4461,7 +4453,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebAppsWithHttpMessagesAsync(string resourceGroupName, string name, string propertiesToInclude = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4503,16 +4495,21 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("propertiesToInclude", propertiesToInclude); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionList", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebApps", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (propertiesToInclude != null) + { + _queryParameters.Add(string.Format("propertiesToInclude={0}", System.Uri.EscapeDataString(propertiesToInclude))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -4605,7 +4602,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4618,7 +4615,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4638,10 +4635,35 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Gets a private endpoint connection + /// Suspend an App Service Environment. + /// + /// + /// Description for Suspend an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> SuspendWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginSuspendWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get global usage metrics of an App Service Environment. /// /// - /// Description for Gets a private endpoint connection + /// Description for Get global usage metrics of an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -4649,8 +4671,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the private endpoint connection. + /// + /// Return only usages/metrics specified in the filter. Filter conforms to + /// odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq + /// 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq + /// 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. /// /// /// Headers that will be added to request. @@ -4673,7 +4698,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4698,10 +4723,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -4719,18 +4740,21 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -4823,7 +4847,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4836,7 +4860,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4856,10 +4880,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Approves or rejects a private endpoint connection + /// Get all worker pools of an App Service Environment. /// /// - /// Description for Approves or rejects a private endpoint connection + /// Description for Get all worker pools of an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -4867,84 +4891,28 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// - /// - /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// 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> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// 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>> ListWorkerPoolsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4987,11 +4955,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPools", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateLinkResources").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -5088,7 +5056,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5101,7 +5069,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5121,10 +5089,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Reboot all machines in an App Service Environment. + /// Get properties of a worker pool. /// /// - /// Description for Reboot all machines in an App Service Environment. + /// Description for Get properties of a worker pool. /// /// /// Name of the resource group to which the resource belongs. @@ -5132,6 +5100,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Name of the worker pool. + /// /// /// Headers that will be added to request. /// @@ -5141,6 +5112,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -5150,7 +5124,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RebootWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5175,6 +5149,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (workerPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5192,14 +5170,16 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("workerPoolName", workerPoolName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Reboot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWorkerPool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -5213,7 +5193,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5264,7 +5244,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -5294,13 +5274,31 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -5309,10 +5307,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Resume an App Service Environment. + /// Create or update a worker pool. /// /// - /// Description for Resume an App Service Environment. + /// Description for Create or update a worker pool. /// /// /// Name of the resource group to which the resource belongs. @@ -5320,24 +5318,30 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Name of the worker pool. + /// + /// + /// Properties of the worker pool. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task>> ResumeWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - // Send request - AzureOperationResponse> _response = await BeginResumeWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWorkerPoolWithHttpMessagesAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Get all App Service plans in an App Service Environment. + /// Create or update a worker pool. /// /// - /// Description for Get all App Service plans in an App Service Environment. + /// Description for Create or update a worker pool. /// /// /// Name of the resource group to which the resource belongs. @@ -5345,6 +5349,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Name of the worker pool. + /// + /// + /// Properties of the worker pool. + /// /// /// Headers that will be added to request. /// @@ -5366,7 +5376,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAppServicePlansWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5391,6 +5401,14 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (workerPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); + } + if (workerPoolEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5408,14 +5426,17 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("workerPoolName", workerPoolName); + tracingParameters.Add("workerPoolEnvelope", workerPoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAppServicePlans", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateWorkerPool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -5429,7 +5450,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5460,6 +5481,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(workerPoolEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workerPoolEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -5480,7 +5507,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -5510,7 +5537,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5523,7 +5550,25 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5543,10 +5588,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get all apps in an App Service Environment. + /// Get metric definitions for a specific instance of a worker pool of an App + /// Service Environment. /// /// - /// Description for Get all apps in an App Service Environment. + /// Description for Get metric definitions for a specific instance of a worker + /// pool of an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -5554,8 +5601,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Comma separated list of app properties to include. + /// + /// Name of the worker pool. + /// + /// + /// Name of the instance in the worker pool. /// /// /// Headers that will be added to request. @@ -5578,7 +5628,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebAppsWithHttpMessagesAsync(string resourceGroupName, string name, string propertiesToInclude = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWorkerPoolInstanceMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, string instance, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5603,6 +5653,14 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (workerPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); + } + if (instance == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instance"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5620,21 +5678,20 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("propertiesToInclude", propertiesToInclude); + tracingParameters.Add("workerPoolName", workerPoolName); + tracingParameters.Add("instance", instance); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebApps", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPoolInstanceMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); + _url = _url.Replace("{instance}", System.Uri.EscapeDataString(instance)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (propertiesToInclude != null) - { - _queryParameters.Add(string.Format("propertiesToInclude={0}", System.Uri.EscapeDataString(propertiesToInclude))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -5727,7 +5784,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5740,7 +5797,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5760,35 +5817,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Suspend an App Service Environment. - /// - /// - /// Description for Suspend an App Service Environment. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> SuspendWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginSuspendWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get global usage metrics of an App Service Environment. + /// Get metric definitions for a worker pool of an App Service Environment. /// /// - /// Description for Get global usage metrics of an App Service Environment. + /// Description for Get metric definitions for a worker pool of an App Service + /// Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -5796,11 +5829,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Return only usages/metrics specified in the filter. Filter conforms to - /// odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq - /// 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - /// 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// + /// Name of the worker pool. /// /// /// Headers that will be added to request. @@ -5823,7 +5853,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebWorkerMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5848,6 +5878,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (workerPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5865,21 +5899,18 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("filter", filter); + tracingParameters.Add("workerPoolName", workerPoolName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebWorkerMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -5972,7 +6003,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5985,7 +6016,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6005,10 +6036,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get all worker pools of an App Service Environment. + /// Get available SKUs for scaling a worker pool. /// /// - /// Description for Get all worker pools of an App Service Environment. + /// Description for Get available SKUs for scaling a worker pool. /// /// /// Name of the resource group to which the resource belongs. @@ -6016,6 +6047,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Name of the worker pool. + /// /// /// Headers that will be added to request. /// @@ -6037,7 +6071,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWorkerPoolsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWorkerPoolSkusWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6062,6 +6096,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (workerPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -6079,14 +6117,16 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("workerPoolName", workerPoolName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPools", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPoolSkus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -6181,7 +6221,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6194,7 +6234,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6214,10 +6254,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get properties of a worker pool. + /// Get usage metrics for a worker pool of an App Service Environment. /// /// - /// Description for Get properties of a worker pool. + /// Description for Get usage metrics for a worker pool of an App Service + /// Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -6249,7 +6290,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebWorkerUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6297,11 +6338,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("workerPoolName", workerPoolName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWorkerPool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebWorkerUsages", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); @@ -6399,7 +6440,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6412,7 +6453,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6432,41 +6473,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Create or update a worker pool. - /// - /// - /// Description for Create or update a worker pool. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Name of the worker pool. - /// - /// - /// Properties of the worker pool. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWorkerPoolWithHttpMessagesAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Create or update a worker pool. + /// Create or update an App Service Environment. /// /// - /// Description for Create or update a worker pool. + /// Description for Create or update an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -6474,11 +6484,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the worker pool. - /// - /// - /// Properties of the worker pool. + /// + /// Configuration details of the App Service Environment. /// /// /// Headers that will be added to request. @@ -6501,7 +6508,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, AppServiceEnvironmentResource hostingEnvironmentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6526,13 +6533,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (workerPoolName == null) + if (hostingEnvironmentEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostingEnvironmentEnvelope"); } - if (workerPoolEnvelope == null) + if (hostingEnvironmentEnvelope != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolEnvelope"); + hostingEnvironmentEnvelope.Validate(); } if (Client.SubscriptionId == null) { @@ -6551,17 +6558,15 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("workerPoolName", workerPoolName); - tracingParameters.Add("workerPoolEnvelope", workerPoolEnvelope); + tracingParameters.Add("hostingEnvironmentEnvelope", hostingEnvironmentEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateWorkerPool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -6575,7 +6580,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6606,9 +6611,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(workerPoolEnvelope != null) + if(hostingEnvironmentEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workerPoolEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostingEnvironmentEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -6632,7 +6637,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6662,7 +6667,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6675,7 +6680,25 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6693,7 +6716,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6713,12 +6736,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get metric definitions for a specific instance of a worker pool of an App - /// Service Environment. + /// Delete an App Service Environment. /// /// - /// Description for Get metric definitions for a specific instance of a worker - /// pool of an App Service Environment. + /// Description for Delete an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -6726,11 +6747,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the worker pool. - /// - /// - /// Name of the instance in the worker pool. + /// + /// Specify <code>true</code> to force the deletion even if the App + /// Service Environment contains resources. The default is + /// <code>false</code>. /// /// /// Headers that will be added to request. @@ -6741,9 +6761,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -6753,7 +6770,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWorkerPoolInstanceMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, string instance, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string name, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6778,14 +6795,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (workerPoolName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); - } - if (instance == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instance"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -6803,20 +6812,21 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("workerPoolName", workerPoolName); - tracingParameters.Add("instance", instance); + tracingParameters.Add("forceDelete", forceDelete); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPoolInstanceMetricDefinitions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); - _url = _url.Replace("{instance}", System.Uri.EscapeDataString(instance)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (forceDelete != null) + { + _queryParameters.Add(string.Format("forceDelete={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDelete, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -6828,7 +6838,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6879,7 +6889,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6891,1651 +6901,30 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) 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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get metric definitions for a worker pool of an App Service Environment. - /// - /// - /// Description for Get metric definitions for a worker pool of an App Service - /// Environment. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Name of the worker pool. - /// - /// - /// 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>> ListWebWorkerMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (workerPoolName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("workerPoolName", workerPoolName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebWorkerMetricDefinitions", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get available SKUs for scaling a worker pool. - /// - /// - /// Description for Get available SKUs for scaling a worker pool. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Name of the worker pool. - /// - /// - /// 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>> ListWorkerPoolSkusWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (workerPoolName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("workerPoolName", workerPoolName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPoolSkus", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get usage metrics for a worker pool of an App Service Environment. - /// - /// - /// Description for Get usage metrics for a worker pool of an App Service - /// Environment. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Name of the worker pool. - /// - /// - /// 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>> ListWebWorkerUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (workerPoolName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("workerPoolName", workerPoolName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebWorkerUsages", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Create or update an App Service Environment. - /// - /// - /// Description for Create or update an App Service Environment. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Configuration details of the App Service Environment. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, AppServiceEnvironmentResource hostingEnvironmentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (hostingEnvironmentEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostingEnvironmentEnvelope"); - } - if (hostingEnvironmentEnvelope != null) - { - hostingEnvironmentEnvelope.Validate(); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("hostingEnvironmentEnvelope", hostingEnvironmentEnvelope); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(hostingEnvironmentEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostingEnvironmentEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Delete an App Service Environment. - /// - /// - /// Description for Delete an App Service Environment. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Specify <code>true</code> to force the deletion even if the App - /// Service Environment contains resources. The default is - /// <code>false</code>. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string name, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("forceDelete", forceDelete); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (forceDelete != null) - { - _queryParameters.Add(string.Format("forceDelete={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDelete, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Move an App Service Environment to a different VNET. - /// - /// - /// Description for Move an App Service Environment to a different VNET. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Details for the new virtual network. - /// - /// - /// 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>> BeginChangeVnetWithHttpMessagesAsync(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (vnetInfo == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetInfo"); - } - if (vnetInfo != null) - { - vnetInfo.Validate(); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("vnetInfo", vnetInfo); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginChangeVnet", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(vnetInfo != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vnetInfo, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Create or update a multi-role pool. - /// - /// - /// Description for Create or update a multi-role pool. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Properties of the multi-role pool. - /// - /// - /// 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> BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (multiRolePoolEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "multiRolePoolEnvelope"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("multiRolePoolEnvelope", multiRolePoolEnvelope); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateMultiRolePool", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(multiRolePoolEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(multiRolePoolEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + catch (JsonException) + { + // Ignore the exception } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ServiceClientTracing.Error(_invocationId, ex); } - catch (JsonException ex) + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _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) { @@ -8545,10 +6934,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Approves or rejects a private endpoint connection + /// Move an App Service Environment to a different VNET. /// /// - /// Description for Approves or rejects a private endpoint connection + /// Description for Move an App Service Environment to a different VNET. /// /// /// Name of the resource group to which the resource belongs. @@ -8556,9 +6945,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// - /// + /// + /// Details for the new virtual network. /// /// /// Headers that will be added to request. @@ -8581,7 +6969,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> BeginChangeVnetWithHttpMessagesAsync(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8606,13 +6994,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); - } - if (privateEndpointWrapper == null) + if (vnetInfo == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetInfo"); } if (Client.SubscriptionId == null) { @@ -8631,17 +7015,15 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); - tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); + tracingParameters.Add("vnetInfo", vnetInfo); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginChangeVnet", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -8655,7 +7037,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8686,9 +7068,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(privateEndpointWrapper != null) + if(vnetInfo != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vnetInfo, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -8742,7 +7124,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8755,7 +7137,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8773,7 +7155,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8793,10 +7175,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Deletes a private endpoint connection + /// Create or update a multi-role pool. /// /// - /// Description for Deletes a private endpoint connection + /// Description for Create or update a multi-role pool. /// /// /// Name of the resource group to which the resource belongs. @@ -8804,7 +7186,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// + /// + /// Properties of the multi-role pool. /// /// /// Headers that will be added to request. @@ -8827,7 +7210,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8852,9 +7235,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) + if (multiRolePoolEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "multiRolePoolEnvelope"); } if (Client.SubscriptionId == null) { @@ -8873,16 +7256,15 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("multiRolePoolEnvelope", multiRolePoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateMultiRolePool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -8896,7 +7278,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8927,6 +7309,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(multiRolePoolEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(multiRolePoolEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -8947,7 +7335,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -8977,7 +7365,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8990,7 +7378,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -9008,25 +7396,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 204) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -11491,178 +9861,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) return _result; } - /// - /// Gets the list of private endpoints associated with a hosting environment - /// - /// - /// Description for Gets the list of private endpoints associated with a - /// hosting environment - /// - /// - /// 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>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(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, "GetPrivateEndpointConnectionListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - /// /// Resume an App Service Environment. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperationsExtensions.cs index b77535a589eb..e4a6d169b17e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperationsExtensions.cs @@ -448,104 +448,6 @@ public static IPage ChangeVnet(this IAppServiceEnvironmentsOperations oper } } - /// - /// Get networking configuration of an App Service Environment - /// - /// - /// Description for Get networking configuration of an App Service Environment - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - public static AseV3NetworkingConfiguration GetAseV3NetworkingConfiguration(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name) - { - return operations.GetAseV3NetworkingConfigurationAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Get networking configuration of an App Service Environment - /// - /// - /// Description for Get networking configuration of an App Service Environment - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// The cancellation token. - /// - public static async Task GetAseV3NetworkingConfigurationAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAseV3NetworkingConfigurationWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update networking configuration of an App Service Environment - /// - /// - /// Description for Update networking configuration of an App Service - /// Environment - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - public static AseV3NetworkingConfiguration UpdateAseNetworkingConfiguration(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration) - { - return operations.UpdateAseNetworkingConfigurationAsync(resourceGroupName, name, aseNetworkingConfiguration).GetAwaiter().GetResult(); - } - - /// - /// Update networking configuration of an App Service Environment - /// - /// - /// Description for Update networking configuration of an App Service - /// Environment - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAseNetworkingConfigurationAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateAseNetworkingConfigurationWithHttpMessagesAsync(resourceGroupName, name, aseNetworkingConfiguration, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Get diagnostic information for an App Service Environment. /// @@ -1186,256 +1088,6 @@ public static IPage GetOutboundNetworkDependenciesE } } - /// - /// Gets the list of private endpoints associated with a hosting environment - /// - /// - /// Description for Gets the list of private endpoints associated with a - /// hosting environment - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - public static IPage GetPrivateEndpointConnectionList(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name) - { - return operations.GetPrivateEndpointConnectionListAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of private endpoints associated with a hosting environment - /// - /// - /// Description for Gets the list of private endpoints associated with a - /// hosting environment - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// The cancellation token. - /// - public static async Task> GetPrivateEndpointConnectionListAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateEndpointConnectionListWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a private endpoint connection - /// - /// - /// Description for Gets a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Name of the private endpoint connection. - /// - public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) - { - return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Gets a private endpoint connection - /// - /// - /// Description for Gets a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetPrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// - public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) - { - return operations.ApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task ApproveOrRejectPrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - public static object DeletePrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) - { - return operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task DeletePrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name) - { - return operations.GetPrivateLinkResourcesAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// The cancellation token. - /// - public static async Task GetPrivateLinkResourcesAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Reboot all machines in an App Service Environment. /// @@ -2372,110 +2024,6 @@ public static WorkerPoolResource BeginCreateOrUpdateMultiRolePool(this IAppServi } } - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// - public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) - { - return operations.BeginApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task BeginApproveOrRejectPrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - public static object BeginDeletePrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) - { - return operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeletePrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Resume an App Service Environment. /// @@ -3086,48 +2634,6 @@ public static IPage GetOutboundNetworkDependenciesE } } - /// - /// Gets the list of private endpoints associated with a hosting environment - /// - /// - /// Description for Gets the list of private endpoints associated with a - /// hosting environment - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetPrivateEndpointConnectionListNext(this IAppServiceEnvironmentsOperations operations, string nextPageLink) - { - return operations.GetPrivateEndpointConnectionListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of private endpoints associated with a hosting environment - /// - /// - /// Description for Gets the list of private endpoints associated with a - /// hosting environment - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetPrivateEndpointConnectionListNextAsync(this IAppServiceEnvironmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Resume an App Service Environment. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperations.cs deleted file mode 100644 index de6c8f12dfda..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperations.cs +++ /dev/null @@ -1,687 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CertificateOrdersDiagnosticsOperations operations. - /// - internal partial class CertificateOrdersDiagnosticsOperations : IServiceOperations, ICertificateOrdersDiagnosticsOperations - { - /// - /// Initializes a new instance of the CertificateOrdersDiagnosticsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal CertificateOrdersDiagnosticsOperations(WebSiteManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the WebSiteManagementClient - /// - public WebSiteManagementClient Client { get; private set; } - - /// - /// Microsoft.CertificateRegistration to get the list of detectors for this RP. - /// - /// - /// Description for Microsoft.CertificateRegistration to get the list of - /// detectors for this RP. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The certificate order name for which the response is needed. - /// - /// - /// 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>> ListAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(string resourceGroupName, string certificateOrderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (certificateOrderName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "certificateOrderName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("certificateOrderName", certificateOrderName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAppServiceCertificateOrderDetectorResponse", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{certificateOrderName}", System.Uri.EscapeDataString(certificateOrderName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Microsoft.CertificateRegistration call to get a detector response from App - /// Lens. - /// - /// - /// Description for Microsoft.CertificateRegistration call to get a detector - /// response from App Lens. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The certificate order name for which the response is needed. - /// - /// - /// The detector name which needs to be run. - /// - /// - /// The start time for detector response. - /// - /// - /// The end time for the detector response. - /// - /// - /// The time grain for the detector response. - /// - /// - /// 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> GetAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(string resourceGroupName, string certificateOrderName, string detectorName, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (certificateOrderName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "certificateOrderName"); - } - if (detectorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "detectorName"); - } - if (timeGrain != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(timeGrain, "PT[1-9][0-9]+[SMH]")) - { - throw new ValidationException(ValidationRules.Pattern, "timeGrain", "PT[1-9][0-9]+[SMH]"); - } - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("certificateOrderName", certificateOrderName); - tracingParameters.Add("detectorName", detectorName); - tracingParameters.Add("startTime", startTime); - tracingParameters.Add("endTime", endTime); - tracingParameters.Add("timeGrain", timeGrain); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAppServiceCertificateOrderDetectorResponse", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors/{detectorName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{certificateOrderName}", System.Uri.EscapeDataString(certificateOrderName)); - _url = _url.Replace("{detectorName}", System.Uri.EscapeDataString(detectorName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (startTime != null) - { - _queryParameters.Add(string.Format("startTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(startTime, Client.SerializationSettings).Trim('"')))); - } - if (endTime != null) - { - _queryParameters.Add(string.Format("endTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(endTime, Client.SerializationSettings).Trim('"')))); - } - if (timeGrain != null) - { - _queryParameters.Add(string.Format("timeGrain={0}", System.Uri.EscapeDataString(timeGrain))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Microsoft.CertificateRegistration to get the list of detectors for this RP. - /// - /// - /// Description for Microsoft.CertificateRegistration to get the list of - /// detectors for this RP. - /// - /// - /// 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>> ListAppServiceCertificateOrderDetectorResponseNextWithHttpMessagesAsync(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, "ListAppServiceCertificateOrderDetectorResponseNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperationsExtensions.cs deleted file mode 100644 index c9696717ab5a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperationsExtensions.cs +++ /dev/null @@ -1,189 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for CertificateOrdersDiagnosticsOperations. - /// - public static partial class CertificateOrdersDiagnosticsOperationsExtensions - { - /// - /// Microsoft.CertificateRegistration to get the list of detectors for this RP. - /// - /// - /// Description for Microsoft.CertificateRegistration to get the list of - /// detectors for this RP. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The certificate order name for which the response is needed. - /// - public static IPage ListAppServiceCertificateOrderDetectorResponse(this ICertificateOrdersDiagnosticsOperations operations, string resourceGroupName, string certificateOrderName) - { - return operations.ListAppServiceCertificateOrderDetectorResponseAsync(resourceGroupName, certificateOrderName).GetAwaiter().GetResult(); - } - - /// - /// Microsoft.CertificateRegistration to get the list of detectors for this RP. - /// - /// - /// Description for Microsoft.CertificateRegistration to get the list of - /// detectors for this RP. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The certificate order name for which the response is needed. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAppServiceCertificateOrderDetectorResponseAsync(this ICertificateOrdersDiagnosticsOperations operations, string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(resourceGroupName, certificateOrderName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Microsoft.CertificateRegistration call to get a detector response from App - /// Lens. - /// - /// - /// Description for Microsoft.CertificateRegistration call to get a detector - /// response from App Lens. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The certificate order name for which the response is needed. - /// - /// - /// The detector name which needs to be run. - /// - /// - /// The start time for detector response. - /// - /// - /// The end time for the detector response. - /// - /// - /// The time grain for the detector response. - /// - public static DetectorResponse GetAppServiceCertificateOrderDetectorResponse(this ICertificateOrdersDiagnosticsOperations operations, string resourceGroupName, string certificateOrderName, string detectorName, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string)) - { - return operations.GetAppServiceCertificateOrderDetectorResponseAsync(resourceGroupName, certificateOrderName, detectorName, startTime, endTime, timeGrain).GetAwaiter().GetResult(); - } - - /// - /// Microsoft.CertificateRegistration call to get a detector response from App - /// Lens. - /// - /// - /// Description for Microsoft.CertificateRegistration call to get a detector - /// response from App Lens. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The certificate order name for which the response is needed. - /// - /// - /// The detector name which needs to be run. - /// - /// - /// The start time for detector response. - /// - /// - /// The end time for the detector response. - /// - /// - /// The time grain for the detector response. - /// - /// - /// The cancellation token. - /// - public static async Task GetAppServiceCertificateOrderDetectorResponseAsync(this ICertificateOrdersDiagnosticsOperations operations, string resourceGroupName, string certificateOrderName, string detectorName, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(resourceGroupName, certificateOrderName, detectorName, startTime, endTime, timeGrain, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Microsoft.CertificateRegistration to get the list of detectors for this RP. - /// - /// - /// Description for Microsoft.CertificateRegistration to get the list of - /// detectors for this RP. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAppServiceCertificateOrderDetectorResponseNext(this ICertificateOrdersDiagnosticsOperations operations, string nextPageLink) - { - return operations.ListAppServiceCertificateOrderDetectorResponseNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Microsoft.CertificateRegistration to get the list of detectors for this RP. - /// - /// - /// Description for Microsoft.CertificateRegistration to get the list of - /// detectors for this RP. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAppServiceCertificateOrderDetectorResponseNextAsync(this ICertificateOrdersDiagnosticsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAppServiceCertificateOrderDetectorResponseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs index fe277ea35069..583856b5039f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.WebSites using System.Threading; using System.Threading.Tasks; - /// ListWithHttpMessagesAsync + /// /// CertificatesOperations operations. /// internal partial class CertificatesOperations : IServiceOperations, ICertificatesOperations @@ -56,10 +56,6 @@ internal CertificatesOperations(WebSiteManagementClient client) /// /// Description for Get all certificates for a subscription. /// - /// - /// Return only information specified in the filter (using OData syntax). For - /// example: $filter=KeyVaultId eq 'KeyVaultId' - /// /// /// Headers that will be added to request. /// @@ -81,7 +77,7 @@ internal CertificatesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken), string filter = default(string)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -98,7 +94,6 @@ internal CertificatesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -107,10 +102,6 @@ internal CertificatesOperations(WebSiteManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs index 7b6a61d04351..2f310ccda8e3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs @@ -30,13 +30,9 @@ public static partial class CertificatesOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// Return only information specified in the filter (using OData syntax). For - /// example: $filter=KeyVaultId eq 'KeyVaultId' - /// - public static IPage List(this ICertificatesOperations operations, string filter = default(string)) + public static IPage List(this ICertificatesOperations operations) { - return operations.ListAsync(filter).GetAwaiter().GetResult(); + return operations.ListAsync().GetAwaiter().GetResult(); } /// @@ -48,16 +44,12 @@ public static partial class CertificatesOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// Return only information specified in the filter (using OData syntax). For - /// example: $filter=KeyVaultId eq 'KeyVaultId' - /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ICertificatesOperations operations, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ICertificatesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken, filter).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperations.cs index 08d58ad3005c..32d276db9b8f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperations.cs @@ -2095,11 +2095,11 @@ internal DomainsOperations(WebSiteManagementClient client) /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifier + /// for an existing identifer /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifier + /// identifier details for an existing identifer /// /// /// Name of the resource group to which the resource belongs. @@ -2526,11 +2526,11 @@ internal DomainsOperations(WebSiteManagementClient client) /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifier + /// for an existing identifer /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifier + /// identifier details for an existing identifer /// /// /// Name of the resource group to which the resource belongs. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperationsExtensions.cs index ea9c034cf240..d6580c16cf14 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperationsExtensions.cs @@ -514,11 +514,11 @@ public static DomainOwnershipIdentifier GetOwnershipIdentifier(this IDomainsOper /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifier + /// for an existing identifer /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifier + /// identifier details for an existing identifer /// /// /// The operations group for this extension method. @@ -542,11 +542,11 @@ public static DomainOwnershipIdentifier CreateOrUpdateOwnershipIdentifier(this I /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifier + /// for an existing identifer /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifier + /// identifier details for an existing identifer /// /// /// The operations group for this extension method. @@ -625,11 +625,11 @@ public static void DeleteOwnershipIdentifier(this IDomainsOperations operations, /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifier + /// for an existing identifer /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifier + /// identifier details for an existing identifer /// /// /// The operations group for this extension method. @@ -653,11 +653,11 @@ public static DomainOwnershipIdentifier UpdateOwnershipIdentifier(this IDomainsO /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifier + /// for an existing identifer /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifier + /// identifier details for an existing identifer /// /// /// The operations group for this extension method. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperations.cs deleted file mode 100644 index 4e9e2829d289..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperations.cs +++ /dev/null @@ -1,597 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// GlobalModelOperations operations. - /// - internal partial class GlobalModelOperations : IServiceOperations, IGlobalModelOperations - { - /// - /// Initializes a new instance of the GlobalModelOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal GlobalModelOperations(WebSiteManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the WebSiteManagementClient - /// - public WebSiteManagementClient Client { get; private set; } - - /// - /// Get deleted app for a subscription. - /// - /// - /// Description for Get deleted app for a subscription. - /// - /// - /// The numeric ID of the deleted app, e.g. 12345 - /// - /// - /// 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> GetDeletedWebAppWithHttpMessagesAsync(string deletedSiteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (deletedSiteId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "deletedSiteId"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("deletedSiteId", deletedSiteId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDeletedWebApp", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}").ToString(); - _url = _url.Replace("{deletedSiteId}", System.Uri.EscapeDataString(deletedSiteId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get all deleted apps for a subscription. - /// - /// - /// Description for Get all deleted apps for a subscription. - /// - /// - /// The numeric ID of the deleted app, e.g. 12345 - /// - /// - /// 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>> GetDeletedWebAppSnapshotsWithHttpMessagesAsync(string deletedSiteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (deletedSiteId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "deletedSiteId"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("deletedSiteId", deletedSiteId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDeletedWebAppSnapshots", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}/snapshots").ToString(); - _url = _url.Replace("{deletedSiteId}", System.Uri.EscapeDataString(deletedSiteId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets an operation in a subscription and given region - /// - /// - /// Description for Gets an operation in a subscription and given region - /// - /// - /// Location name - /// - /// - /// Operation Id - /// - /// - /// 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 GetSubscriptionOperationWithAsyncResponseWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("operationId", operationId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSubscriptionOperationWithAsyncResponse", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/operations/{operationId}").ToString(); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 204) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperationsExtensions.cs deleted file mode 100644 index f9234d348ca7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperationsExtensions.cs +++ /dev/null @@ -1,150 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for GlobalModelOperations. - /// - public static partial class GlobalModelOperationsExtensions - { - /// - /// Get deleted app for a subscription. - /// - /// - /// Description for Get deleted app for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The numeric ID of the deleted app, e.g. 12345 - /// - public static DeletedSite GetDeletedWebApp(this IGlobalModelOperations operations, string deletedSiteId) - { - return operations.GetDeletedWebAppAsync(deletedSiteId).GetAwaiter().GetResult(); - } - - /// - /// Get deleted app for a subscription. - /// - /// - /// Description for Get deleted app for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The numeric ID of the deleted app, e.g. 12345 - /// - /// - /// The cancellation token. - /// - public static async Task GetDeletedWebAppAsync(this IGlobalModelOperations operations, string deletedSiteId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetDeletedWebAppWithHttpMessagesAsync(deletedSiteId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get all deleted apps for a subscription. - /// - /// - /// Description for Get all deleted apps for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The numeric ID of the deleted app, e.g. 12345 - /// - public static IList GetDeletedWebAppSnapshots(this IGlobalModelOperations operations, string deletedSiteId) - { - return operations.GetDeletedWebAppSnapshotsAsync(deletedSiteId).GetAwaiter().GetResult(); - } - - /// - /// Get all deleted apps for a subscription. - /// - /// - /// Description for Get all deleted apps for a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The numeric ID of the deleted app, e.g. 12345 - /// - /// - /// The cancellation token. - /// - public static async Task> GetDeletedWebAppSnapshotsAsync(this IGlobalModelOperations operations, string deletedSiteId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetDeletedWebAppSnapshotsWithHttpMessagesAsync(deletedSiteId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets an operation in a subscription and given region - /// - /// - /// Description for Gets an operation in a subscription and given region - /// - /// - /// The operations group for this extension method. - /// - /// - /// Location name - /// - /// - /// Operation Id - /// - public static void GetSubscriptionOperationWithAsyncResponse(this IGlobalModelOperations operations, string location, string operationId) - { - operations.GetSubscriptionOperationWithAsyncResponseAsync(location, operationId).GetAwaiter().GetResult(); - } - - /// - /// Gets an operation in a subscription and given region - /// - /// - /// Description for Gets an operation in a subscription and given region - /// - /// - /// The operations group for this extension method. - /// - /// - /// Location name - /// - /// - /// Operation Id - /// - /// - /// The cancellation token. - /// - public static async Task GetSubscriptionOperationWithAsyncResponseAsync(this IGlobalModelOperations operations, string location, string operationId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.GetSubscriptionOperationWithAsyncResponseWithHttpMessagesAsync(location, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IAppServiceEnvironmentsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IAppServiceEnvironmentsOperations.cs index 4afcf71a451e..a95032f627c6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IAppServiceEnvironmentsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IAppServiceEnvironmentsOperations.cs @@ -284,66 +284,6 @@ public partial interface IAppServiceEnvironmentsOperations /// Task>> ChangeVnetWithHttpMessagesAsync(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get networking configuration of an App Service Environment - /// - /// - /// Description for Get networking configuration of an App Service - /// Environment - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAseV3NetworkingConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Update networking configuration of an App Service Environment - /// - /// - /// Description for Update networking configuration of an App Service - /// Environment - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateAseNetworkingConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Get diagnostic information for an App Service Environment. /// /// @@ -734,157 +674,6 @@ public partial interface IAppServiceEnvironmentsOperations /// Task>> GetOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the list of private endpoints associated with a hosting - /// environment - /// - /// - /// Description for Gets the list of private endpoints associated with - /// a hosting environment - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a private endpoint connection - /// - /// - /// Description for Gets a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Reboot all machines in an App Service Environment. /// /// @@ -1445,68 +1234,6 @@ public partial interface IAppServiceEnvironmentsOperations /// Task> BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Resume an App Service Environment. /// /// @@ -1887,33 +1614,6 @@ public partial interface IAppServiceEnvironmentsOperations /// Task>> GetOutboundNetworkDependenciesEndpointsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the list of private endpoints associated with a hosting - /// environment - /// - /// - /// Description for Gets the list of private endpoints associated with - /// a hosting environment - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Resume an App Service Environment. /// /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificateOrdersDiagnosticsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificateOrdersDiagnosticsOperations.cs deleted file mode 100644 index 27a71c5b91d6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificateOrdersDiagnosticsOperations.cs +++ /dev/null @@ -1,126 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CertificateOrdersDiagnosticsOperations operations. - /// - public partial interface ICertificateOrdersDiagnosticsOperations - { - /// - /// Microsoft.CertificateRegistration to get the list of detectors for - /// this RP. - /// - /// - /// Description for Microsoft.CertificateRegistration to get the list - /// of detectors for this RP. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The certificate order name for which the response is needed. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(string resourceGroupName, string certificateOrderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Microsoft.CertificateRegistration call to get a detector response - /// from App Lens. - /// - /// - /// Description for Microsoft.CertificateRegistration call to get a - /// detector response from App Lens. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The certificate order name for which the response is needed. - /// - /// - /// The detector name which needs to be run. - /// - /// - /// The start time for detector response. - /// - /// - /// The end time for the detector response. - /// - /// - /// The time grain for the detector response. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(string resourceGroupName, string certificateOrderName, string detectorName, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Microsoft.CertificateRegistration to get the list of detectors for - /// this RP. - /// - /// - /// Description for Microsoft.CertificateRegistration to get the list - /// of detectors for this RP. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListAppServiceCertificateOrderDetectorResponseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs index e2d42e2bd289..949867d9a615 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs @@ -29,10 +29,6 @@ public partial interface ICertificatesOperations /// /// Description for Get all certificates for a subscription. /// - /// - /// Return only information specified in the filter (using OData - /// syntax). For example: $filter=KeyVaultId eq 'KeyVaultId' - /// /// /// The headers that will be added to request. /// @@ -48,7 +44,7 @@ public partial interface ICertificatesOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken), string filter = default(string)); + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all certificates in a resource group. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IDomainsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IDomainsOperations.cs index e1aebe7efb72..26350ec4d859 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IDomainsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IDomainsOperations.cs @@ -324,11 +324,11 @@ public partial interface IDomainsOperations Task> GetOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string domainName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates an ownership identifier for a domain or updates identifier - /// details for an existing identifier + /// details for an existing identifer /// /// /// Description for Creates an ownership identifier for a domain or - /// updates identifier details for an existing identifier + /// updates identifier details for an existing identifer /// /// /// Name of the resource group to which the resource belongs. @@ -388,11 +388,11 @@ public partial interface IDomainsOperations Task DeleteOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string domainName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates an ownership identifier for a domain or updates identifier - /// details for an existing identifier + /// details for an existing identifer /// /// /// Description for Creates an ownership identifier for a domain or - /// updates identifier details for an existing identifier + /// updates identifier details for an existing identifer /// /// /// Name of the resource group to which the resource belongs. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IGlobalModelOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IGlobalModelOperations.cs deleted file mode 100644 index c71309c9de0f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IGlobalModelOperations.cs +++ /dev/null @@ -1,103 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// GlobalModelOperations operations. - /// - public partial interface IGlobalModelOperations - { - /// - /// Get deleted app for a subscription. - /// - /// - /// Description for Get deleted app for a subscription. - /// - /// - /// The numeric ID of the deleted app, e.g. 12345 - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetDeletedWebAppWithHttpMessagesAsync(string deletedSiteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get all deleted apps for a subscription. - /// - /// - /// Description for Get all deleted apps for a subscription. - /// - /// - /// The numeric ID of the deleted app, e.g. 12345 - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetDeletedWebAppSnapshotsWithHttpMessagesAsync(string deletedSiteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets an operation in a subscription and given region - /// - /// - /// Description for Gets an operation in a subscription and given - /// region - /// - /// - /// Location name - /// - /// - /// Operation Id - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task GetSubscriptionOperationWithAsyncResponseWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IProviderOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IProviderOperations.cs index ed6bf7f9bd67..662c53798b81 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IProviderOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IProviderOperations.cs @@ -32,7 +32,7 @@ public partial interface IProviderOperations /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions', 'All' + /// 'LinuxFunctions' /// /// /// The headers that will be added to request. @@ -51,91 +51,6 @@ public partial interface IProviderOperations /// Task>> GetAvailableStacksWithHttpMessagesAsync(string osTypeSelected = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get available Function app frameworks and their versions - /// - /// - /// Description for Get available Function app frameworks and their - /// versions - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetFunctionAppStacksWithHttpMessagesAsync(string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get available Function app frameworks and their versions for - /// location - /// - /// - /// Description for Get available Function app frameworks and their - /// versions for location - /// - /// - /// Function App stack location. - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetFunctionAppStacksForLocationWithHttpMessagesAsync(string location, string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get available Web app frameworks and their versions for location - /// - /// - /// Description for Get available Web app frameworks and their versions - /// for location - /// - /// - /// Web App stack location. - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetWebAppStacksForLocationWithHttpMessagesAsync(string location, string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all available operations for the Microsoft.Web resource /// provider. Also exposes resource metric definitions /// @@ -160,31 +75,6 @@ public partial interface IProviderOperations /// Task>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get available Web app frameworks and their versions - /// - /// - /// Description for Get available Web app frameworks and their versions - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetWebAppStacksWithHttpMessagesAsync(string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Get available application frameworks and their versions /// /// @@ -193,7 +83,7 @@ public partial interface IProviderOperations /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions', 'All' + /// 'LinuxFunctions' /// /// /// The headers that will be added to request. @@ -238,85 +128,6 @@ public partial interface IProviderOperations /// Task>> GetAvailableStacksNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get available Function app frameworks and their versions - /// - /// - /// Description for Get available Function app frameworks and their - /// versions - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetFunctionAppStacksNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get available Function app frameworks and their versions for - /// location - /// - /// - /// Description for Get available Function app frameworks and their - /// versions for location - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetFunctionAppStacksForLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get available Web app frameworks and their versions for location - /// - /// - /// Description for Get available Web app frameworks and their versions - /// for location - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetWebAppStacksForLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all available operations for the Microsoft.Web resource /// provider. Also exposes resource metric definitions /// @@ -344,31 +155,6 @@ public partial interface IProviderOperations /// Task>> ListOperationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get available Web app frameworks and their versions - /// - /// - /// Description for Get available Web app frameworks and their versions - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetWebAppStacksNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Get available application frameworks and their versions /// /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IStaticSitesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IStaticSitesOperations.cs index 27111b69f27c..d417e4d033a4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IStaticSitesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IStaticSitesOperations.cs @@ -23,36 +23,6 @@ namespace Microsoft.Azure.Management.WebSites /// public partial interface IStaticSitesOperations { - /// - /// Generates a preview workflow file for the static site - /// - /// - /// Description for Generates a preview workflow file for the static - /// site - /// - /// - /// Location where you plan to create the static site. - /// - /// - /// A JSON representation of the StaticSitesWorkflowPreviewRequest - /// properties. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> PreviewWorkflowWithHttpMessagesAsync(string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all Static Sites for a subscription. /// @@ -361,7 +331,7 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -379,7 +349,7 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> GetStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a static site build. /// @@ -392,41 +362,9 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// The stage site identifier. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates the app settings of a static site build. - /// - /// - /// Description for Creates or updates the app settings of a static - /// site build. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// + /// /// The stage site identifier. /// - /// - /// The dictionary containing the static site app settings to update. - /// /// /// The headers that will be added to request. /// @@ -436,13 +374,10 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateStaticSiteBuildAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates the function app settings of a static site /// build. @@ -457,12 +392,10 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// - /// The dictionary containing the static site function app settings to - /// update. /// /// /// The headers that will be added to request. @@ -479,7 +412,7 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the functions of a particular static site build. /// @@ -493,7 +426,7 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -511,13 +444,12 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteBuildFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListStaticSiteBuildFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the application settings of a static site build. + /// Gets the application settings of a static site. /// /// - /// Description for Gets the application settings of a static site - /// build. + /// Description for Gets the application settings of a static site. /// /// /// Name of the resource group to which the resource belongs. @@ -525,7 +457,7 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -543,13 +475,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> ListStaticSiteBuildAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the application settings of a static site build. + /// Creates or updates the function app settings of a static site. /// /// - /// Description for Gets the application settings of a static site - /// build. + /// Description for Creates or updates the function app settings of a + /// static site. /// /// /// Name of the resource group to which the resource belongs. @@ -557,8 +489,7 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// The stage site identifier. + /// /// /// /// The headers that will be added to request. @@ -575,14 +506,12 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the details of the user provided function apps registered with - /// a static site build + /// Creates an invitation link for a user with the role /// /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site build + /// Description for Creates an invitation link for a user with the role /// /// /// Name of the resource group to which the resource belongs. @@ -590,8 +519,7 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// The stage site identifier. + /// /// /// /// The headers that will be added to request. @@ -608,26 +536,19 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> GetUserProvidedFunctionAppsForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateUserRolesInvitationLinkWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the details of the user provided function app registered with - /// a static site build + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Gets the details of the user provided function app - /// registered with a static site build + /// Description for Gets all static site custom domains for a + /// particular static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. - /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app registered with the static site build. + /// Name of the static site resource to search in. /// /// /// The headers that will be added to request. @@ -644,13 +565,14 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> GetUserProvidedFunctionAppForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListStaticSiteCustomDomainsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Register a user provided function app with a static site build + /// Creates a new static site custom domain in an existing resource + /// group and static site. /// /// - /// Description for Register a user provided function app with a static - /// site build + /// Description for Creates a new static site custom domain in an + /// existing resource group and static site. /// /// /// Name of the resource group to which the resource belongs. @@ -658,21 +580,8 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app to register with the static site build. - /// - /// - /// A JSON representation of the user provided function app properties. - /// See example. - /// - /// - /// Specify <code>true</code> to force the update of the - /// auth configuration on the function app even if an - /// AzureStaticWebApps provider is already configured on the function - /// app. The default is <code>false</code>. + /// + /// The custom domain to create. /// /// /// The headers that will be added to request. @@ -689,13 +598,12 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> RegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Detach the user provided function app from the static site build + /// Deletes a custom domain. /// /// - /// Description for Detach the user provided function app from the - /// static site build + /// Description for Deletes a custom domain. /// /// /// Name of the resource group to which the resource belongs. @@ -703,11 +611,8 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app registered with the static site build. + /// + /// The custom domain to delete. /// /// /// The headers that will be added to request. @@ -721,13 +626,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task DetachUserProvidedFunctionAppFromStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deploys zipped content to a specific environment of a static site. + /// Validates a particular custom domain can be added to a static site. /// /// - /// Description for Deploys zipped content to a specific environment of - /// a static site. + /// Description for Validates a particular custom domain can be added + /// to a static site. /// /// /// Name of the resource group to which the resource belongs. @@ -735,12 +640,8 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// Name of the environment. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. - /// See example. + /// + /// The custom domain to validate. /// /// /// The headers that will be added to request. @@ -754,22 +655,18 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task CreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates the app settings of a static site. + /// Detaches a static site. /// /// - /// Description for Creates or updates the app settings of a static - /// site. + /// Description for Detaches a static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. - /// - /// - /// The dictionary containing the static site app settings to update. + /// Name of the static site to detach. /// /// /// The headers that will be added to request. @@ -780,19 +677,15 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateStaticSiteAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates the function app settings of a static site. + /// Gets the functions of a static site. /// /// - /// Description for Creates or updates the function app settings of a - /// static site. + /// Description for Gets the functions of a static site. /// /// /// Name of the resource group to which the resource belongs. @@ -800,10 +693,6 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// The dictionary containing the static site function app settings to - /// update. - /// /// /// The headers that will be added to request. /// @@ -819,12 +708,12 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListStaticSiteFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates an invitation link for a user with the role + /// Gets the application settings of a static site. /// /// - /// Description for Creates an invitation link for a user with the role + /// Description for Gets the application settings of a static site. /// /// /// Name of the resource group to which the resource belongs. @@ -832,8 +721,6 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// /// /// The headers that will be added to request. /// @@ -849,19 +736,18 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> CreateUserRolesInvitationLinkWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all static site custom domains for a particular static site. + /// Lists the secrets for an existing static site. /// /// - /// Description for Gets all static site custom domains for a - /// particular static site. + /// Description for Lists the secrets for an existing static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site. /// /// /// The headers that will be added to request. @@ -878,22 +764,20 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteCustomDomainsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListStaticSiteSecretsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets an existing custom domain for a particular static site. + /// Resets the api key for an existing static site. /// /// - /// Description for Gets an existing custom domain for a particular - /// static site. + /// Description for Resets the api key for an existing static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site. /// - /// - /// The custom domain name. + /// /// /// /// The headers that will be added to request. @@ -904,33 +788,18 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> GetStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task ResetStaticSiteApiKeyWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a new static site custom domain in an existing resource - /// group and static site. + /// Get all Static Sites for a subscription. /// /// - /// Description for Creates a new static site custom domain in an - /// existing resource group and static site. + /// Description for Get all Static Sites for a subscription. /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to create. - /// - /// - /// A JSON representation of the static site custom domain request - /// properties. See example. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -947,21 +816,16 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a custom domain. + /// Gets all static sites in the specified resource group. /// /// - /// Description for Deletes a custom domain. + /// Description for Gets all static sites in the specified resource + /// group. /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to delete. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -972,29 +836,21 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetStaticSitesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Validates a particular custom domain can be added to a static site. + /// Gets the list of users of a static site. /// /// - /// Description for Validates a particular custom domain can be added - /// to a static site. + /// Description for Gets the list of users of a static site. /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to validate. - /// - /// - /// A JSON representation of the static site custom domain request - /// properties. See example. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -1005,21 +861,22 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListStaticSiteUsersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Detaches a static site. + /// Gets all static site builds for a particular static site. /// /// - /// Description for Detaches a static site. + /// Description for Gets all static site builds for a particular static + /// site. /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to detach. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -1030,21 +887,22 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetStaticSiteBuildsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the functions of a static site. + /// Gets the functions of a particular static site build. /// /// - /// Description for Gets the functions of a static site. + /// Description for Gets the functions of a particular static site + /// build. /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -1061,18 +919,16 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListStaticSiteBuildFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the application settings of a static site. + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Gets all static site custom domains for a + /// particular static site. /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -1089,1047 +945,15 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> ListStaticSiteAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListStaticSiteCustomDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the roles configured for the static site. + /// Gets the functions of a static site. /// /// - /// Description for Lists the roles configured for the static site. + /// Description for Gets the functions of a static site. /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> ListStaticSiteConfiguredRolesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the application settings of a static site. - /// - /// - /// Description for Gets the application settings of a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists the secrets for an existing static site. - /// - /// - /// Description for Lists the secrets for an existing static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> ListStaticSiteSecretsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the list of private endpoint connections associated with a - /// static site - /// - /// - /// Description for Gets the list of private endpoint connections - /// associated with a static site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a private endpoint connection - /// - /// - /// Description for Gets a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// Request body. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Resets the api key for an existing static site. - /// - /// - /// Description for Resets the api key for an existing static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task ResetStaticSiteApiKeyWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the details of the user provided function apps registered with - /// a static site - /// - /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetUserProvidedFunctionAppsForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the details of the user provided function app registered with - /// a static site - /// - /// - /// Description for Gets the details of the user provided function app - /// registered with a static site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app registered with the static site. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetUserProvidedFunctionAppForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Register a user provided function app with a static site - /// - /// - /// Description for Register a user provided function app with a static - /// site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app to register with the static site. - /// - /// - /// A JSON representation of the user provided function app properties. - /// See example. - /// - /// - /// Specify <code>true</code> to force the update of the - /// auth configuration on the function app even if an - /// AzureStaticWebApps provider is already configured on the function - /// app. The default is <code>false</code>. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> RegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Detach the user provided function app from the static site - /// - /// - /// Description for Detach the user provided function app from the - /// static site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app registered with the static site. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DetachUserProvidedFunctionAppFromStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deploys zipped content to a static site. - /// - /// - /// Description for Deploys zipped content to a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. - /// See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task CreateZipDeploymentForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a new static site in an existing resource group, or updates - /// an existing static site. - /// - /// - /// Description for Creates a new static site in an existing resource - /// group, or updates an existing static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to create or update. - /// - /// - /// A JSON representation of the staticsite properties. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a static site. - /// - /// - /// Description for Deletes a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to delete. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a static site build. - /// - /// - /// Description for Deletes a static site build. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The stage site identifier. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Register a user provided function app with a static site build - /// - /// - /// Description for Register a user provided function app with a static - /// site build - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app to register with the static site build. - /// - /// - /// A JSON representation of the user provided function app properties. - /// See example. - /// - /// - /// Specify <code>true</code> to force the update of the - /// auth configuration on the function app even if an - /// AzureStaticWebApps provider is already configured on the function - /// app. The default is <code>false</code>. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deploys zipped content to a specific environment of a static site. - /// - /// - /// Description for Deploys zipped content to a specific environment of - /// a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the environment. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. - /// See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginCreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a new static site custom domain in an existing resource - /// group and static site. - /// - /// - /// Description for Creates a new static site custom domain in an - /// existing resource group and static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to create. - /// - /// - /// A JSON representation of the static site custom domain request - /// properties. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a custom domain. - /// - /// - /// Description for Deletes a custom domain. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to delete. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Validates a particular custom domain can be added to a static site. - /// - /// - /// Description for Validates a particular custom domain can be added - /// to a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to validate. - /// - /// - /// A JSON representation of the static site custom domain request - /// properties. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Detaches a static site. - /// - /// - /// Description for Detaches a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to detach. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// Request body. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Register a user provided function app with a static site - /// - /// - /// Description for Register a user provided function app with a static - /// site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app to register with the static site. - /// - /// - /// A JSON representation of the user provided function app properties. - /// See example. - /// - /// - /// Specify <code>true</code> to force the update of the - /// auth configuration on the function app even if an - /// AzureStaticWebApps provider is already configured on the function - /// app. The default is <code>false</code>. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginRegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deploys zipped content to a static site. - /// - /// - /// Description for Deploys zipped content to a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. - /// See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginCreateZipDeploymentForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get all Static Sites for a subscription. - /// - /// - /// Description for Get all Static Sites for a subscription. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all static sites in the specified resource group. - /// - /// - /// Description for Gets all static sites in the specified resource - /// group. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetStaticSitesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the list of users of a static site. - /// - /// - /// Description for Gets the list of users of a static site. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListStaticSiteUsersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all static site builds for a particular static site. - /// - /// - /// Description for Gets all static site builds for a particular static - /// site. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetStaticSiteBuildsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the functions of a particular static site build. - /// - /// - /// Description for Gets the functions of a particular static site - /// build. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListStaticSiteBuildFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the details of the user provided function apps registered with - /// a static site build - /// - /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site build - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetUserProvidedFunctionAppsForStaticSiteBuildNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all static site custom domains for a particular static site. - /// - /// - /// Description for Gets all static site custom domains for a - /// particular static site. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListStaticSiteCustomDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the functions of a static site. - /// - /// - /// Description for Gets the functions of a static site. - /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -2147,59 +971,5 @@ public partial interface IStaticSitesOperations /// Thrown when a required parameter is null /// Task>> ListStaticSiteFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the list of private endpoint connections associated with a - /// static site - /// - /// - /// Description for Gets the list of private endpoint connections - /// associated with a static site - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the details of the user provided function apps registered with - /// a static site - /// - /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetUserProvidedFunctionAppsForStaticSiteNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebAppsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebAppsOperations.cs index bb5fc95d1170..4cd486e4521f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebAppsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebAppsOperations.cs @@ -966,125 +966,6 @@ public partial interface IWebAppsOperations /// Task> GetBackupConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status - /// of an app - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetAppSettingsKeyVaultReferencesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the config reference and status of an app - /// - /// - /// Description for Gets the config reference and status of an app - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// App Setting key name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAppSettingKeyVaultReferenceWithHttpMessagesAsync(string resourceGroupName, string name, string appSettingKey, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status - /// of an app - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetSiteConnectionStringKeyVaultReferencesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the config reference and status of an app - /// - /// - /// Description for Gets the config reference and status of an app - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetSiteConnectionStringKeyVaultReferenceWithHttpMessagesAsync(string resourceGroupName, string name, string connectionStringKey, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Replaces the connection strings of an app. /// /// @@ -3777,6 +3658,47 @@ public partial interface IWebAppsOperations /// Task> GetSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Integrates this Web App with a Virtual Network. This requires that + /// 1) "swiftSupported" is true when doing a GET against this resource, + /// and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is + /// in. + /// + /// + /// Description for Integrates this Web App with a Virtual Network. + /// This requires that 1) "swiftSupported" is true when doing a GET + /// against this resource, and 2) that the target Subnet has already + /// been delegated, and is not + /// in use by another App Service Plan other than the one this App is + /// in. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Deletes a Swift Virtual Network connection from an app (or /// deployment slot). /// @@ -3804,6 +3726,47 @@ public partial interface IWebAppsOperations /// Task DeleteSwiftVirtualNetworkWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Integrates this Web App with a Virtual Network. This requires that + /// 1) "swiftSupported" is true when doing a GET against this resource, + /// and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is + /// in. + /// + /// + /// Description for Integrates this Web App with a Virtual Network. + /// This requires that 1) "swiftSupported" is true when doing a GET + /// against this resource, and 2) that the target Subnet has already + /// been delegated, and is not + /// in use by another App Service Plan other than the one this App is + /// in. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets all network features used by the app (or deployment slot, if /// specified). /// @@ -3818,7 +3781,7 @@ public partial interface IWebAppsOperations /// Name of the app. /// /// - /// The type of view. Only "summary" is supported at this time. + /// The type of view. This can either be "summary" or "detailed". /// /// /// The headers that will be added to request. @@ -4377,157 +4340,6 @@ public partial interface IWebAppsOperations /// Task> PutPrivateAccessVnetWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the list of private endpoint connections associated with a - /// site - /// - /// - /// Description for Gets the list of private endpoint connections - /// associated with a site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a private endpoint connection - /// - /// - /// Description for Gets a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Get list of processes for a web site, or a deployment slot, or for /// a specific scaled-out instance in a web site. /// @@ -5187,6 +4999,36 @@ public partial interface IWebAppsOperations /// Task DeleteSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Copies a deployment slot to another deployment slot of an app. + /// + /// + /// Description for Copies a deployment slot to another deployment slot + /// of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name and site config + /// properties to override the source slot config. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task CopyProductionSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets an app's deployment slots. /// /// @@ -5305,8 +5147,9 @@ public partial interface IWebAppsOperations /// If true, web app metrics are also deleted. /// /// - /// Specify false if you want to keep empty App Service plan. By - /// default, empty App Service plan is deleted. + /// Specify true if the App Service plan will be empty after app + /// deletion and you want to delete the empty App Service plan. By + /// default, the empty App Service plan is not deleted. /// /// /// The headers that will be added to request. @@ -5607,175 +5450,13 @@ public partial interface IWebAppsOperations /// Thrown when a required parameter is null /// Task> ListBackupStatusSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Restores a specific backup to another app (or deployment slot, if - /// specified). - /// - /// - /// Description for Restores a specific backup to another app (or - /// deployment slot, if specified). - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// ID of the backup. - /// - /// - /// Information on restore request . - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API - /// will restore a backup of the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task RestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Returns whether Scm basic auth is allowed and whether Ftp is - /// allowed for a given site. - /// - /// - /// Description for Returns whether Scm basic auth is allowed and - /// whether Ftp is allowed for a given site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetBasicPublishingCredentialsPoliciesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Returns whether FTP is allowed on the site or not. - /// - /// - /// Description for Returns whether FTP is allowed on the site or not. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetFtpAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates whether FTP is allowed on the site or not. - /// - /// - /// Description for Updates whether FTP is allowed on the site or not. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateFtpAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Returns whether Scm basic auth is allowed on the site or not. - /// - /// - /// Description for Returns whether Scm basic auth is allowed on the - /// site or not. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetScmAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates whether user publishing credentials are allowed on the site - /// or not. + /// + /// Restores a specific backup to another app (or deployment slot, if + /// specified). /// /// - /// Description for Updates whether user publishing credentials are - /// allowed on the site or not. + /// Description for Restores a specific backup to another app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -5783,9 +5464,15 @@ public partial interface IWebAppsOperations /// /// Name of the app. /// - /// + /// + /// ID of the backup. + /// + /// + /// Information on restore request . /// /// + /// Name of the deployment slot. If a slot is not specified, the API + /// will restore a backup of the production slot. /// /// /// The headers that will be added to request. @@ -5796,13 +5483,10 @@ public partial interface IWebAppsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> UpdateScmAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task RestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List the configurations of an app /// @@ -6211,133 +5895,6 @@ public partial interface IWebAppsOperations /// Task> GetBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status - /// of an app - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetAppSettingsKeyVaultReferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the config reference and status of an app - /// - /// - /// Description for Gets the config reference and status of an app - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// App Setting key name. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetAppSettingKeyVaultReferenceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string appSettingKey, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status - /// of an app - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetSiteConnectionStringKeyVaultReferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the config reference and status of an app - /// - /// - /// Description for Gets the config reference and status of an app - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetSiteConnectionStringKeyVaultReferenceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string connectionStringKey, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Replaces the connection strings of an app. /// /// @@ -9204,6 +8761,51 @@ public partial interface IWebAppsOperations /// Task> GetSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Integrates this Web App with a Virtual Network. This requires that + /// 1) "swiftSupported" is true when doing a GET against this resource, + /// and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is + /// in. + /// + /// + /// Description for Integrates this Web App with a Virtual Network. + /// This requires that 1) "swiftSupported" is true when doing a GET + /// against this resource, and 2) that the target Subnet has already + /// been delegated, and is not + /// in use by another App Service Plan other than the one this App is + /// in. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API + /// will add or update connections for the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Deletes a Swift Virtual Network connection from an app (or /// deployment slot). /// @@ -9235,6 +8837,51 @@ public partial interface IWebAppsOperations /// Task DeleteSwiftVirtualNetworkSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Integrates this Web App with a Virtual Network. This requires that + /// 1) "swiftSupported" is true when doing a GET against this resource, + /// and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is + /// in. + /// + /// + /// Description for Integrates this Web App with a Virtual Network. + /// This requires that 1) "swiftSupported" is true when doing a GET + /// against this resource, and 2) that the target Subnet has already + /// been delegated, and is not + /// in use by another App Service Plan other than the one this App is + /// in. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API + /// will add or update connections for the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets all network features used by the app (or deployment slot, if /// specified). /// @@ -9249,7 +8896,7 @@ public partial interface IWebAppsOperations /// Name of the app. /// /// - /// The type of view. Only "summary" is supported at this time. + /// The type of view. This can either be "summary" or "detailed". /// /// /// Name of the deployment slot. If a slot is not specified, the API @@ -9875,39 +9522,6 @@ public partial interface IWebAppsOperations /// Task> PutPrivateAccessVnetSlotWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the list of private endpoint connections associated with a - /// site - /// - /// - /// Description for Gets the list of private endpoint connections - /// associated with a site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// Name of the site deployment slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetPrivateEndpointConnectionListSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets a private endpoint connection /// /// @@ -9920,10 +9534,6 @@ public partial interface IWebAppsOperations /// Name of the site. /// /// - /// Name of the private endpoint connection. - /// - /// - /// Name of the site deployment slot. /// /// /// The headers that will be added to request. @@ -9940,7 +9550,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> GetPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Approves or rejects a private endpoint connection /// @@ -9957,8 +9567,6 @@ public partial interface IWebAppsOperations /// /// /// - /// - /// /// /// The headers that will be added to request. /// @@ -9974,7 +9582,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> ApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a private endpoint connection /// @@ -9989,8 +9597,6 @@ public partial interface IWebAppsOperations /// /// /// - /// - /// /// /// The headers that will be added to request. /// @@ -10006,7 +9612,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> DeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the private link resources /// @@ -10019,8 +9625,6 @@ public partial interface IWebAppsOperations /// /// Name of the site. /// - /// - /// /// /// The headers that will be added to request. /// @@ -10036,7 +9640,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> GetPrivateLinkResourcesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get list of processes for a web site, or a deployment slot, or for /// a specific scaled-out instance in a web site. @@ -10779,7 +10383,41 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task DeleteSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Copies a deployment slot to another deployment slot of an app. + /// + /// + /// Description for Copies a deployment slot to another deployment slot + /// of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name and site config + /// properties to override the source slot config. See example. + /// + /// + /// Name of the source slot. If a slot is not specified, the production + /// slot is used as the source slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task CopySlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the difference in configuration settings between two web app /// slots. @@ -10997,8 +10635,6 @@ public partial interface IWebAppsOperations /// will delete the source control configuration for the production /// slot. /// - /// - /// /// /// The headers that will be added to request. /// @@ -11011,7 +10647,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task DeleteSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string additionalFlags = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the source control configuration of an app. /// @@ -12059,8 +11695,6 @@ public partial interface IWebAppsOperations /// /// Name of the app. /// - /// - /// /// /// The headers that will be added to request. /// @@ -12073,7 +11707,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task DeleteSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, string additionalFlags = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the source control configuration of an app. /// @@ -13135,68 +12769,6 @@ public partial interface IWebAppsOperations /// Task>> BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Restores an app from a backup blob in Azure Storage. /// /// @@ -13315,6 +12887,36 @@ public partial interface IWebAppsOperations /// Task> BeginInstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Copies a deployment slot to another deployment slot of an app. + /// + /// + /// Description for Copies a deployment slot to another deployment slot + /// of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name and site config + /// properties to override the source slot config. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginCopyProductionSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Creates a new web, mobile, or API app in an existing resource /// group, or updates an existing app. /// @@ -13587,8 +13189,6 @@ public partial interface IWebAppsOperations /// /// /// - /// - /// /// /// The headers that will be added to request. /// @@ -13604,7 +13204,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> BeginApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a private endpoint connection /// @@ -13619,8 +13219,6 @@ public partial interface IWebAppsOperations /// /// /// - /// - /// /// /// The headers that will be added to request. /// @@ -13636,7 +13234,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> BeginDeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Restores an app from a backup blob in Azure Storage. /// @@ -13772,6 +13370,40 @@ public partial interface IWebAppsOperations /// Task> BeginInstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Copies a deployment slot to another deployment slot of an app. + /// + /// + /// Description for Copies a deployment slot to another deployment slot + /// of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name and site config + /// properties to override the source slot config. See example. + /// + /// + /// Name of the source slot. If a slot is not specified, the production + /// slot is used as the source slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginCopySlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Swaps two deployment slots of an app. /// /// @@ -14077,58 +13709,6 @@ public partial interface IWebAppsOperations /// Task>> ListConfigurationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status - /// of an app - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetAppSettingsKeyVaultReferencesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status - /// of an app - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetSiteConnectionStringKeyVaultReferencesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets a list of web app configuration snapshots identifiers. Each /// element of the list contains a timestamp and the ID of the /// snapshot. @@ -14444,33 +14024,6 @@ public partial interface IWebAppsOperations /// Task>> ListPerfMonCountersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the list of private endpoint connections associated with a - /// site - /// - /// - /// Description for Gets the list of private endpoint connections - /// associated with a site - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Get list of processes for a web site, or a deployment slot, or for /// a specific scaled-out instance in a web site. /// @@ -14680,58 +14233,6 @@ public partial interface IWebAppsOperations /// Task>> ListConfigurationsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status - /// of an app - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetAppSettingsKeyVaultReferencesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status - /// of an app - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetSiteConnectionStringKeyVaultReferencesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets a list of web app configuration snapshots identifiers. Each /// element of the list contains a timestamp and the ID of the /// snapshot. @@ -15047,33 +14548,6 @@ public partial interface IWebAppsOperations /// Task>> ListPerfMonCountersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the list of private endpoint connections associated with a - /// site - /// - /// - /// Description for Gets the list of private endpoint connections - /// associated with a site - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> GetPrivateEndpointConnectionListSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Get list of processes for a web site, or a deployment slot, or for /// a specific scaled-out instance in a web site. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs index 2c6b10eea2a4..3481e85ddd9b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs @@ -79,11 +79,6 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// IAppServiceCertificateOrdersOperations AppServiceCertificateOrders { get; } - /// - /// Gets the ICertificateOrdersDiagnosticsOperations. - /// - ICertificateOrdersDiagnosticsOperations CertificateOrdersDiagnostics { get; } - /// /// Gets the ICertificateRegistrationProviderOperations. /// @@ -119,11 +114,6 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// IDiagnosticsOperations Diagnostics { get; } - /// - /// Gets the IGlobalModelOperations. - /// - IGlobalModelOperations GlobalModel { get; } - /// /// Gets the IProviderOperations. /// @@ -159,27 +149,6 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// IResourceHealthMetadataOperations ResourceHealthMetadata { get; } - /// - /// Exchange code for GitHub access token for AppService CLI - /// - /// - /// Description for Exchange code for GitHub access token for - /// AppService CLI - /// - /// - /// Code string to exchange for Github Access token - /// - /// - /// State string used for verification. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task> GenerateGithubAccessTokenForAppserviceCLIAsyncWithHttpMessagesAsync(string code, string state, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets publishing user /// @@ -333,8 +302,7 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// /// Name of SKU used to filter the regions. Possible values include: /// 'Free', 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', - /// 'Isolated', 'IsolatedV2', 'PremiumV2', 'PremiumV3', - /// 'PremiumContainer', 'ElasticPremium', 'ElasticIsolated' + /// 'Isolated', 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' /// /// /// Specify <code>true</code> if you want to filter to only diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AccessControlEntryAction.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AccessControlEntryAction.cs new file mode 100644 index 000000000000..d9b41f1ca064 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AccessControlEntryAction.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AccessControlEntryAction. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum AccessControlEntryAction + { + [EnumMember(Value = "Permit")] + Permit, + [EnumMember(Value = "Deny")] + Deny + } + internal static class AccessControlEntryActionEnumExtension + { + internal static string ToSerializedValue(this AccessControlEntryAction? value) + { + return value == null ? null : ((AccessControlEntryAction)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AccessControlEntryAction value) + { + switch( value ) + { + case AccessControlEntryAction.Permit: + return "Permit"; + case AccessControlEntryAction.Deny: + return "Deny"; + } + return null; + } + + internal static AccessControlEntryAction? ParseAccessControlEntryAction(this string value) + { + switch( value ) + { + case "Permit": + return AccessControlEntryAction.Permit; + case "Deny": + return AccessControlEntryAction.Deny; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs deleted file mode 100644 index bfd067ed6a02..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs +++ /dev/null @@ -1,117 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Description of site key vault references. - /// - [Rest.Serialization.JsonTransformation] - public partial class ApiKVReference : ProxyOnlyResource - { - /// - /// Initializes a new instance of the ApiKVReference class. - /// - public ApiKVReference() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ApiKVReference class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Possible values include: 'Initialized', - /// 'Resolved', 'InvalidSyntax', 'MSINotEnabled', 'VaultNotFound', - /// 'SecretNotFound', 'SecretVersionNotFound', - /// 'AccessToKeyVaultDenied', 'OtherReasons', 'FetchTimedOut', - /// 'UnauthorizedClient' - /// Possible values include: 'KeyVault' - public ApiKVReference(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string reference = default(string), ResolveStatus? status = default(ResolveStatus?), string vaultName = default(string), string secretName = default(string), string secretVersion = default(string), ManagedServiceIdentity identityType = default(ManagedServiceIdentity), string details = default(string), ConfigReferenceSource? source = default(ConfigReferenceSource?), string activeVersion = default(string)) - : base(id, name, kind, type) - { - Reference = reference; - Status = status; - VaultName = vaultName; - SecretName = secretName; - SecretVersion = secretVersion; - IdentityType = identityType; - Details = details; - Source = source; - ActiveVersion = activeVersion; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.reference")] - public string Reference { get; set; } - - /// - /// Gets or sets possible values include: 'Initialized', 'Resolved', - /// 'InvalidSyntax', 'MSINotEnabled', 'VaultNotFound', - /// 'SecretNotFound', 'SecretVersionNotFound', - /// 'AccessToKeyVaultDenied', 'OtherReasons', 'FetchTimedOut', - /// 'UnauthorizedClient' - /// - [JsonProperty(PropertyName = "properties.status")] - public ResolveStatus? Status { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.vaultName")] - public string VaultName { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.secretName")] - public string SecretName { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.secretVersion")] - public string SecretVersion { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.identityType")] - public ManagedServiceIdentity IdentityType { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.details")] - public string Details { get; set; } - - /// - /// Gets or sets possible values include: 'KeyVault' - /// - [JsonProperty(PropertyName = "properties.source")] - public ConfigReferenceSource? Source { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.activeVersion")] - public string ActiveVersion { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs deleted file mode 100644 index ba4ae64ca04e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// App Insights Web App stack settings. - /// - public partial class AppInsightsWebAppStackSettings - { - /// - /// Initializes a new instance of the AppInsightsWebAppStackSettings - /// class. - /// - public AppInsightsWebAppStackSettings() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AppInsightsWebAppStackSettings - /// class. - /// - /// <code>true</code> if remote - /// Application Insights is supported for the stack; otherwise, - /// <code>false</code>. - /// <code>true</code> if - /// Application Insights is disabled by default for the stack; - /// otherwise, <code>false</code>. - public AppInsightsWebAppStackSettings(bool? isSupported = default(bool?), bool? isDefaultOff = default(bool?)) - { - IsSupported = isSupported; - IsDefaultOff = isDefaultOff; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if remote - /// Application Insights is supported for the stack; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isSupported")] - public bool? IsSupported { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if Application - /// Insights is disabled by default for the stack; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isDefaultOff")] - public bool? IsDefaultOff { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs index aee5531d6910..fba67b6ee17a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs @@ -48,8 +48,8 @@ public AppServiceCertificateOrder() /// name. /// Domain verification /// token. - /// Duration in years (must be - /// 1). + /// Duration in years (must be between 1 + /// and 3). /// Certificate key size. /// <code>true</code> if the /// certificate should be automatically renewed when it expires; @@ -78,8 +78,7 @@ public AppServiceCertificateOrder() /// moment. /// Time stamp when the /// certificate would be auto renewed next - /// Contact info - public AppServiceCertificateOrder(string location, CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?), CertificateOrderContact contact = default(CertificateOrderContact)) + public AppServiceCertificateOrder(string location, CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?)) : base(location, id, name, kind, type, tags) { Certificates = certificates; @@ -101,7 +100,6 @@ public AppServiceCertificateOrder() IsPrivateKeyExternal = isPrivateKeyExternal; AppServiceCertificateNotRenewableReasons = appServiceCertificateNotRenewableReasons; NextAutoRenewalTimeStamp = nextAutoRenewalTimeStamp; - Contact = contact; CustomInit(); } @@ -129,7 +127,7 @@ public AppServiceCertificateOrder() public string DomainVerificationToken { get; private set; } /// - /// Gets or sets duration in years (must be 1). + /// Gets or sets duration in years (must be between 1 and 3). /// [JsonProperty(PropertyName = "properties.validityInYears")] public int? ValidityInYears { get; set; } @@ -234,12 +232,6 @@ public AppServiceCertificateOrder() [JsonProperty(PropertyName = "properties.nextAutoRenewalTimeStamp")] public System.DateTime? NextAutoRenewalTimeStamp { get; private set; } - /// - /// Gets contact info - /// - [JsonProperty(PropertyName = "properties.contact")] - public CertificateOrderContact Contact { get; private set; } - /// /// Validate the object. /// @@ -249,6 +241,14 @@ public AppServiceCertificateOrder() public override void Validate() { base.Validate(); + if (ValidityInYears > 3) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ValidityInYears", 3); + } + if (ValidityInYears < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ValidityInYears", 1); + } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs index 0badb4580486..a9284452f4d4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs @@ -48,8 +48,8 @@ public AppServiceCertificateOrderPatchResource() /// name. /// Domain verification /// token. - /// Duration in years (must be - /// 1). + /// Duration in years (must be between 1 + /// and 3). /// Certificate key size. /// <code>true</code> if the /// certificate should be automatically renewed when it expires; @@ -78,8 +78,7 @@ public AppServiceCertificateOrderPatchResource() /// moment. /// Time stamp when the /// certificate would be auto renewed next - /// Contact info - public AppServiceCertificateOrderPatchResource(CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?), CertificateOrderContact contact = default(CertificateOrderContact)) + public AppServiceCertificateOrderPatchResource(CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?)) : base(id, name, kind, type) { Certificates = certificates; @@ -101,7 +100,6 @@ public AppServiceCertificateOrderPatchResource() IsPrivateKeyExternal = isPrivateKeyExternal; AppServiceCertificateNotRenewableReasons = appServiceCertificateNotRenewableReasons; NextAutoRenewalTimeStamp = nextAutoRenewalTimeStamp; - Contact = contact; CustomInit(); } @@ -129,7 +127,7 @@ public AppServiceCertificateOrderPatchResource() public string DomainVerificationToken { get; private set; } /// - /// Gets or sets duration in years (must be 1). + /// Gets or sets duration in years (must be between 1 and 3). /// [JsonProperty(PropertyName = "properties.validityInYears")] public int? ValidityInYears { get; set; } @@ -234,12 +232,6 @@ public AppServiceCertificateOrderPatchResource() [JsonProperty(PropertyName = "properties.nextAutoRenewalTimeStamp")] public System.DateTime? NextAutoRenewalTimeStamp { get; private set; } - /// - /// Gets contact info - /// - [JsonProperty(PropertyName = "properties.contact")] - public CertificateOrderContact Contact { get; private set; } - /// /// Validate the object. /// @@ -248,6 +240,14 @@ public AppServiceCertificateOrderPatchResource() /// public virtual void Validate() { + if (ValidityInYears > 3) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ValidityInYears", 3); + } + if (ValidityInYears < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ValidityInYears", 1); + } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs index 312d9255fffd..d7562b769f24 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs @@ -32,58 +32,132 @@ public AppServiceEnvironment() /// /// Initializes a new instance of the AppServiceEnvironment class. /// + /// Name of the App Service Environment. + /// Location of the App Service Environment, + /// e.g. "West US". /// Description of the Virtual /// Network. + /// Description of worker pools with worker + /// size IDs, VM sizes, and number of workers in each pool. /// Provisioning state of the App /// Service Environment. Possible values include: 'Succeeded', /// 'Failed', 'Canceled', 'InProgress', 'Deleting' /// Current status of the App Service Environment. /// Possible values include: 'Preparing', 'Ready', 'Scaling', /// 'Deleting' + /// Name of the Virtual Network for the App + /// Service Environment. + /// Resource group of the Virtual + /// Network. + /// Subnet of the Virtual Network. /// Specifies which endpoints /// to serve internally in the Virtual Network for the App Service /// Environment. Possible values include: 'None', 'Web', 'Publishing', - /// 'Web, Publishing' + /// 'Web,Publishing' /// Front-end VM size, e.g. "Medium", /// "Large". /// Number of front-end instances. /// Number of IP SSL addresses reserved /// for the App Service Environment. + /// Edition of the metadata database for + /// the App Service Environment, e.g. "Standard". + /// Service objective of the + /// metadata database for the App Service Environment, e.g. + /// "S0". + /// Number of upgrade domains of the App + /// Service Environment. + /// Subscription of the App Service + /// Environment. /// DNS suffix of the App Service /// Environment. + /// Last deployment action on the App Service + /// Environment. + /// Result of the last deployment action + /// on the App Service Environment. + /// List of comma separated strings + /// describing which VM sizes are allowed for front-ends. + /// List of comma separated strings + /// describing which VM sizes are allowed for workers. /// Maximum number of VMs in the /// App Service Environment. + /// Description of IP SSL mapping for the App + /// Service Environment. + /// Current total, used, and + /// available worker capacities. + /// Access control list for + /// controlling traffic to the App Service Environment. + /// True/false indicating whether + /// the App Service Environment is healthy. + /// Detailed message about with results + /// of the last check of the App Service Environment. + /// Resource group of the App Service + /// Environment. /// Scale factor for /// front-ends. + /// Default Scale Factor for + /// FrontEnds. + /// API Management Account + /// associated with the App Service Environment. /// <code>true</code> if the App /// Service Environment is suspended; otherwise, /// <code>false</code>. The environment can be suspended, /// e.g. when the management endpoint is no longer available /// (most likely because NSG blocked the incoming traffic). + /// True/false indicating whether the + /// App Service Environment is suspended. The environment can be + /// suspended e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). /// Custom settings for changing the /// behavior of the App Service Environment. /// User added ip ranges to /// whitelist on ASE db /// Flag that displays whether an ASE has /// linux workers or not - /// Dedicated Host Count - public AppServiceEnvironment(VirtualNetworkProfile virtualNetwork, ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string dnsSuffix = default(string), int? maximumNumberOfMachines = default(int?), int? frontEndScaleFactor = default(int?), bool? suspended = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), int? dedicatedHostCount = default(int?)) + /// Key Vault ID for ILB App Service + /// Environment default SSL certificate + /// Key Vault Secret Name for + /// ILB App Service Environment default SSL certificate + public AppServiceEnvironment(string name, string location, VirtualNetworkProfile virtualNetwork, IList workerPools, ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) { + Name = name; + Location = location; ProvisioningState = provisioningState; Status = status; + VnetName = vnetName; + VnetResourceGroupName = vnetResourceGroupName; + VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; + WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; + DatabaseEdition = databaseEdition; + DatabaseServiceObjective = databaseServiceObjective; + UpgradeDomains = upgradeDomains; + SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; + LastAction = lastAction; + LastActionResult = lastActionResult; + AllowedMultiSizes = allowedMultiSizes; + AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; + VipMappings = vipMappings; + EnvironmentCapacities = environmentCapacities; + NetworkAccessControlList = networkAccessControlList; + EnvironmentIsHealthy = environmentIsHealthy; + EnvironmentStatus = environmentStatus; + ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; + DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; + ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; + DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - DedicatedHostCount = dedicatedHostCount; + SslCertKeyVaultId = sslCertKeyVaultId; + SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; CustomInit(); } @@ -92,6 +166,19 @@ public AppServiceEnvironment() /// partial void CustomInit(); + /// + /// Gets or sets name of the App Service Environment. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets location of the App Service Environment, e.g. "West + /// US". + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + /// /// Gets provisioning state of the App Service Environment. Possible /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', @@ -107,6 +194,25 @@ public AppServiceEnvironment() [JsonProperty(PropertyName = "status")] public HostingEnvironmentStatus? Status { get; private set; } + /// + /// Gets or sets name of the Virtual Network for the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "vnetName")] + public string VnetName { get; set; } + + /// + /// Gets or sets resource group of the Virtual Network. + /// + [JsonProperty(PropertyName = "vnetResourceGroupName")] + public string VnetResourceGroupName { get; set; } + + /// + /// Gets or sets subnet of the Virtual Network. + /// + [JsonProperty(PropertyName = "vnetSubnetName")] + public string VnetSubnetName { get; set; } + /// /// Gets or sets description of the Virtual Network. /// @@ -116,7 +222,7 @@ public AppServiceEnvironment() /// /// Gets or sets specifies which endpoints to serve internally in the /// Virtual Network for the App Service Environment. Possible values - /// include: 'None', 'Web', 'Publishing', 'Web, Publishing' + /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' /// [JsonProperty(PropertyName = "internalLoadBalancingMode")] public string InternalLoadBalancingMode { get; set; } @@ -128,10 +234,17 @@ public AppServiceEnvironment() public string MultiSize { get; set; } /// - /// Gets number of front-end instances. + /// Gets or sets number of front-end instances. /// [JsonProperty(PropertyName = "multiRoleCount")] - public int? MultiRoleCount { get; private set; } + public int? MultiRoleCount { get; set; } + + /// + /// Gets or sets description of worker pools with worker size IDs, VM + /// sizes, and number of workers in each pool. + /// + [JsonProperty(PropertyName = "workerPools")] + public IList WorkerPools { get; set; } /// /// Gets or sets number of IP SSL addresses reserved for the App @@ -140,18 +253,110 @@ public AppServiceEnvironment() [JsonProperty(PropertyName = "ipsslAddressCount")] public int? IpsslAddressCount { get; set; } + /// + /// Gets edition of the metadata database for the App Service + /// Environment, e.g. "Standard". + /// + [JsonProperty(PropertyName = "databaseEdition")] + public string DatabaseEdition { get; private set; } + + /// + /// Gets service objective of the metadata database for the App Service + /// Environment, e.g. "S0". + /// + [JsonProperty(PropertyName = "databaseServiceObjective")] + public string DatabaseServiceObjective { get; private set; } + + /// + /// Gets number of upgrade domains of the App Service Environment. + /// + [JsonProperty(PropertyName = "upgradeDomains")] + public int? UpgradeDomains { get; private set; } + + /// + /// Gets subscription of the App Service Environment. + /// + [JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId { get; private set; } + /// /// Gets or sets DNS suffix of the App Service Environment. /// [JsonProperty(PropertyName = "dnsSuffix")] public string DnsSuffix { get; set; } + /// + /// Gets last deployment action on the App Service Environment. + /// + [JsonProperty(PropertyName = "lastAction")] + public string LastAction { get; private set; } + + /// + /// Gets result of the last deployment action on the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "lastActionResult")] + public string LastActionResult { get; private set; } + + /// + /// Gets list of comma separated strings describing which VM sizes are + /// allowed for front-ends. + /// + [JsonProperty(PropertyName = "allowedMultiSizes")] + public string AllowedMultiSizes { get; private set; } + + /// + /// Gets list of comma separated strings describing which VM sizes are + /// allowed for workers. + /// + [JsonProperty(PropertyName = "allowedWorkerSizes")] + public string AllowedWorkerSizes { get; private set; } + /// /// Gets maximum number of VMs in the App Service Environment. /// [JsonProperty(PropertyName = "maximumNumberOfMachines")] public int? MaximumNumberOfMachines { get; private set; } + /// + /// Gets description of IP SSL mapping for the App Service Environment. + /// + [JsonProperty(PropertyName = "vipMappings")] + public IList VipMappings { get; private set; } + + /// + /// Gets current total, used, and available worker capacities. + /// + [JsonProperty(PropertyName = "environmentCapacities")] + public IList EnvironmentCapacities { get; private set; } + + /// + /// Gets or sets access control list for controlling traffic to the App + /// Service Environment. + /// + [JsonProperty(PropertyName = "networkAccessControlList")] + public IList NetworkAccessControlList { get; set; } + + /// + /// Gets true/false indicating whether the App Service Environment is + /// healthy. + /// + [JsonProperty(PropertyName = "environmentIsHealthy")] + public bool? EnvironmentIsHealthy { get; private set; } + + /// + /// Gets detailed message about with results of the last check of the + /// App Service Environment. + /// + [JsonProperty(PropertyName = "environmentStatus")] + public string EnvironmentStatus { get; private set; } + + /// + /// Gets resource group of the App Service Environment. + /// + [JsonProperty(PropertyName = "resourceGroup")] + public string ResourceGroup { get; private set; } + /// /// Gets or sets scale factor for front-ends. /// @@ -159,15 +364,37 @@ public AppServiceEnvironment() public int? FrontEndScaleFactor { get; set; } /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the App - /// Service Environment is suspended; otherwise, + /// Gets default Scale Factor for FrontEnds. + /// + [JsonProperty(PropertyName = "defaultFrontEndScaleFactor")] + public int? DefaultFrontEndScaleFactor { get; private set; } + + /// + /// Gets or sets API Management Account associated with the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "apiManagementAccountId")] + public string ApiManagementAccountId { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// App Service Environment is suspended; otherwise, /// &lt;code&gt;false&lt;/code&gt;. The environment can /// be suspended, e.g. when the management endpoint is no longer /// available /// (most likely because NSG blocked the incoming traffic). /// [JsonProperty(PropertyName = "suspended")] - public bool? Suspended { get; private set; } + public bool? Suspended { get; set; } + + /// + /// Gets or sets true/false indicating whether the App Service + /// Environment is suspended. The environment can be suspended e.g. + /// when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// + [JsonProperty(PropertyName = "dynamicCacheEnabled")] + public bool? DynamicCacheEnabled { get; set; } /// /// Gets or sets custom settings for changing the behavior of the App @@ -183,16 +410,25 @@ public AppServiceEnvironment() public IList UserWhitelistedIpRanges { get; set; } /// - /// Gets flag that displays whether an ASE has linux workers or not + /// Gets or sets flag that displays whether an ASE has linux workers or + /// not /// [JsonProperty(PropertyName = "hasLinuxWorkers")] - public bool? HasLinuxWorkers { get; private set; } + public bool? HasLinuxWorkers { get; set; } + + /// + /// Gets or sets key Vault ID for ILB App Service Environment default + /// SSL certificate + /// + [JsonProperty(PropertyName = "sslCertKeyVaultId")] + public string SslCertKeyVaultId { get; set; } /// - /// Gets dedicated Host Count + /// Gets or sets key Vault Secret Name for ILB App Service Environment + /// default SSL certificate /// - [JsonProperty(PropertyName = "dedicatedHostCount")] - public int? DedicatedHostCount { get; private set; } + [JsonProperty(PropertyName = "sslCertKeyVaultSecretName")] + public string SslCertKeyVaultSecretName { get; set; } /// /// Validate the object. @@ -202,13 +438,21 @@ public AppServiceEnvironment() /// public virtual void Validate() { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } if (VirtualNetwork == null) { throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); } - if (VirtualNetwork != null) + if (WorkerPools == null) { - VirtualNetwork.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs index 724562c731b2..bf9e55680b03 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs @@ -36,8 +36,14 @@ public AppServiceEnvironmentPatchResource() /// Initializes a new instance of the /// AppServiceEnvironmentPatchResource class. /// + /// Name of the + /// App Service Environment. + /// Location of the App Service Environment, + /// e.g. "West US". /// Description of the Virtual /// Network. + /// Description of worker pools with worker + /// size IDs, VM sizes, and number of workers in each pool. /// Resource Id. /// Resource Name. /// Kind of resource. @@ -48,51 +54,120 @@ public AppServiceEnvironmentPatchResource() /// Current status of the App Service Environment. /// Possible values include: 'Preparing', 'Ready', 'Scaling', /// 'Deleting' + /// Name of the Virtual Network for the App + /// Service Environment. + /// Resource group of the Virtual + /// Network. + /// Subnet of the Virtual Network. /// Specifies which endpoints /// to serve internally in the Virtual Network for the App Service /// Environment. Possible values include: 'None', 'Web', 'Publishing', - /// 'Web, Publishing' + /// 'Web,Publishing' /// Front-end VM size, e.g. "Medium", /// "Large". /// Number of front-end instances. /// Number of IP SSL addresses reserved /// for the App Service Environment. + /// Edition of the metadata database for + /// the App Service Environment, e.g. "Standard". + /// Service objective of the + /// metadata database for the App Service Environment, e.g. + /// "S0". + /// Number of upgrade domains of the App + /// Service Environment. + /// Subscription of the App Service + /// Environment. /// DNS suffix of the App Service /// Environment. + /// Last deployment action on the App Service + /// Environment. + /// Result of the last deployment action + /// on the App Service Environment. + /// List of comma separated strings + /// describing which VM sizes are allowed for front-ends. + /// List of comma separated strings + /// describing which VM sizes are allowed for workers. /// Maximum number of VMs in the /// App Service Environment. + /// Description of IP SSL mapping for the App + /// Service Environment. + /// Current total, used, and + /// available worker capacities. + /// Access control list for + /// controlling traffic to the App Service Environment. + /// True/false indicating whether + /// the App Service Environment is healthy. + /// Detailed message about with results + /// of the last check of the App Service Environment. + /// Resource group of the App Service + /// Environment. /// Scale factor for /// front-ends. + /// Default Scale Factor for + /// FrontEnds. + /// API Management Account + /// associated with the App Service Environment. /// <code>true</code> if the App /// Service Environment is suspended; otherwise, /// <code>false</code>. The environment can be suspended, /// e.g. when the management endpoint is no longer available /// (most likely because NSG blocked the incoming traffic). + /// True/false indicating whether the + /// App Service Environment is suspended. The environment can be + /// suspended e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). /// Custom settings for changing the /// behavior of the App Service Environment. /// User added ip ranges to /// whitelist on ASE db /// Flag that displays whether an ASE has /// linux workers or not - /// Dedicated Host Count - public AppServiceEnvironmentPatchResource(VirtualNetworkProfile virtualNetwork, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string dnsSuffix = default(string), int? maximumNumberOfMachines = default(int?), int? frontEndScaleFactor = default(int?), bool? suspended = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), int? dedicatedHostCount = default(int?)) + /// Key Vault ID for ILB App Service + /// Environment default SSL certificate + /// Key Vault Secret Name for + /// ILB App Service Environment default SSL certificate + public AppServiceEnvironmentPatchResource(string appServiceEnvironmentPatchResourceName, string location, VirtualNetworkProfile virtualNetwork, IList workerPools, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) : base(id, name, kind, type) { + AppServiceEnvironmentPatchResourceName = appServiceEnvironmentPatchResourceName; + Location = location; ProvisioningState = provisioningState; Status = status; + VnetName = vnetName; + VnetResourceGroupName = vnetResourceGroupName; + VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; + WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; + DatabaseEdition = databaseEdition; + DatabaseServiceObjective = databaseServiceObjective; + UpgradeDomains = upgradeDomains; + SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; + LastAction = lastAction; + LastActionResult = lastActionResult; + AllowedMultiSizes = allowedMultiSizes; + AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; + VipMappings = vipMappings; + EnvironmentCapacities = environmentCapacities; + NetworkAccessControlList = networkAccessControlList; + EnvironmentIsHealthy = environmentIsHealthy; + EnvironmentStatus = environmentStatus; + ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; + DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; + ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; + DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - DedicatedHostCount = dedicatedHostCount; + SslCertKeyVaultId = sslCertKeyVaultId; + SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; CustomInit(); } @@ -101,6 +176,19 @@ public AppServiceEnvironmentPatchResource() /// partial void CustomInit(); + /// + /// Gets or sets name of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.name")] + public string AppServiceEnvironmentPatchResourceName { get; set; } + + /// + /// Gets or sets location of the App Service Environment, e.g. "West + /// US". + /// + [JsonProperty(PropertyName = "properties.location")] + public string Location { get; set; } + /// /// Gets provisioning state of the App Service Environment. Possible /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', @@ -116,6 +204,25 @@ public AppServiceEnvironmentPatchResource() [JsonProperty(PropertyName = "properties.status")] public HostingEnvironmentStatus? Status { get; private set; } + /// + /// Gets or sets name of the Virtual Network for the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "properties.vnetName")] + public string VnetName { get; set; } + + /// + /// Gets or sets resource group of the Virtual Network. + /// + [JsonProperty(PropertyName = "properties.vnetResourceGroupName")] + public string VnetResourceGroupName { get; set; } + + /// + /// Gets or sets subnet of the Virtual Network. + /// + [JsonProperty(PropertyName = "properties.vnetSubnetName")] + public string VnetSubnetName { get; set; } + /// /// Gets or sets description of the Virtual Network. /// @@ -125,7 +232,7 @@ public AppServiceEnvironmentPatchResource() /// /// Gets or sets specifies which endpoints to serve internally in the /// Virtual Network for the App Service Environment. Possible values - /// include: 'None', 'Web', 'Publishing', 'Web, Publishing' + /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' /// [JsonProperty(PropertyName = "properties.internalLoadBalancingMode")] public string InternalLoadBalancingMode { get; set; } @@ -137,10 +244,17 @@ public AppServiceEnvironmentPatchResource() public string MultiSize { get; set; } /// - /// Gets number of front-end instances. + /// Gets or sets number of front-end instances. /// [JsonProperty(PropertyName = "properties.multiRoleCount")] - public int? MultiRoleCount { get; private set; } + public int? MultiRoleCount { get; set; } + + /// + /// Gets or sets description of worker pools with worker size IDs, VM + /// sizes, and number of workers in each pool. + /// + [JsonProperty(PropertyName = "properties.workerPools")] + public IList WorkerPools { get; set; } /// /// Gets or sets number of IP SSL addresses reserved for the App @@ -149,18 +263,110 @@ public AppServiceEnvironmentPatchResource() [JsonProperty(PropertyName = "properties.ipsslAddressCount")] public int? IpsslAddressCount { get; set; } + /// + /// Gets edition of the metadata database for the App Service + /// Environment, e.g. "Standard". + /// + [JsonProperty(PropertyName = "properties.databaseEdition")] + public string DatabaseEdition { get; private set; } + + /// + /// Gets service objective of the metadata database for the App Service + /// Environment, e.g. "S0". + /// + [JsonProperty(PropertyName = "properties.databaseServiceObjective")] + public string DatabaseServiceObjective { get; private set; } + + /// + /// Gets number of upgrade domains of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.upgradeDomains")] + public int? UpgradeDomains { get; private set; } + + /// + /// Gets subscription of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.subscriptionId")] + public string SubscriptionId { get; private set; } + /// /// Gets or sets DNS suffix of the App Service Environment. /// [JsonProperty(PropertyName = "properties.dnsSuffix")] public string DnsSuffix { get; set; } + /// + /// Gets last deployment action on the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.lastAction")] + public string LastAction { get; private set; } + + /// + /// Gets result of the last deployment action on the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "properties.lastActionResult")] + public string LastActionResult { get; private set; } + + /// + /// Gets list of comma separated strings describing which VM sizes are + /// allowed for front-ends. + /// + [JsonProperty(PropertyName = "properties.allowedMultiSizes")] + public string AllowedMultiSizes { get; private set; } + + /// + /// Gets list of comma separated strings describing which VM sizes are + /// allowed for workers. + /// + [JsonProperty(PropertyName = "properties.allowedWorkerSizes")] + public string AllowedWorkerSizes { get; private set; } + /// /// Gets maximum number of VMs in the App Service Environment. /// [JsonProperty(PropertyName = "properties.maximumNumberOfMachines")] public int? MaximumNumberOfMachines { get; private set; } + /// + /// Gets description of IP SSL mapping for the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.vipMappings")] + public IList VipMappings { get; private set; } + + /// + /// Gets current total, used, and available worker capacities. + /// + [JsonProperty(PropertyName = "properties.environmentCapacities")] + public IList EnvironmentCapacities { get; private set; } + + /// + /// Gets or sets access control list for controlling traffic to the App + /// Service Environment. + /// + [JsonProperty(PropertyName = "properties.networkAccessControlList")] + public IList NetworkAccessControlList { get; set; } + + /// + /// Gets true/false indicating whether the App Service Environment is + /// healthy. + /// + [JsonProperty(PropertyName = "properties.environmentIsHealthy")] + public bool? EnvironmentIsHealthy { get; private set; } + + /// + /// Gets detailed message about with results of the last check of the + /// App Service Environment. + /// + [JsonProperty(PropertyName = "properties.environmentStatus")] + public string EnvironmentStatus { get; private set; } + + /// + /// Gets resource group of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.resourceGroup")] + public string ResourceGroup { get; private set; } + /// /// Gets or sets scale factor for front-ends. /// @@ -168,15 +374,37 @@ public AppServiceEnvironmentPatchResource() public int? FrontEndScaleFactor { get; set; } /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the App - /// Service Environment is suspended; otherwise, + /// Gets default Scale Factor for FrontEnds. + /// + [JsonProperty(PropertyName = "properties.defaultFrontEndScaleFactor")] + public int? DefaultFrontEndScaleFactor { get; private set; } + + /// + /// Gets or sets API Management Account associated with the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "properties.apiManagementAccountId")] + public string ApiManagementAccountId { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// App Service Environment is suspended; otherwise, /// &lt;code&gt;false&lt;/code&gt;. The environment can /// be suspended, e.g. when the management endpoint is no longer /// available /// (most likely because NSG blocked the incoming traffic). /// [JsonProperty(PropertyName = "properties.suspended")] - public bool? Suspended { get; private set; } + public bool? Suspended { get; set; } + + /// + /// Gets or sets true/false indicating whether the App Service + /// Environment is suspended. The environment can be suspended e.g. + /// when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// + [JsonProperty(PropertyName = "properties.dynamicCacheEnabled")] + public bool? DynamicCacheEnabled { get; set; } /// /// Gets or sets custom settings for changing the behavior of the App @@ -192,16 +420,25 @@ public AppServiceEnvironmentPatchResource() public IList UserWhitelistedIpRanges { get; set; } /// - /// Gets flag that displays whether an ASE has linux workers or not + /// Gets or sets flag that displays whether an ASE has linux workers or + /// not /// [JsonProperty(PropertyName = "properties.hasLinuxWorkers")] - public bool? HasLinuxWorkers { get; private set; } + public bool? HasLinuxWorkers { get; set; } + + /// + /// Gets or sets key Vault ID for ILB App Service Environment default + /// SSL certificate + /// + [JsonProperty(PropertyName = "properties.sslCertKeyVaultId")] + public string SslCertKeyVaultId { get; set; } /// - /// Gets dedicated Host Count + /// Gets or sets key Vault Secret Name for ILB App Service Environment + /// default SSL certificate /// - [JsonProperty(PropertyName = "properties.dedicatedHostCount")] - public int? DedicatedHostCount { get; private set; } + [JsonProperty(PropertyName = "properties.sslCertKeyVaultSecretName")] + public string SslCertKeyVaultSecretName { get; set; } /// /// Validate the object. @@ -211,13 +448,21 @@ public AppServiceEnvironmentPatchResource() /// public virtual void Validate() { + if (AppServiceEnvironmentPatchResourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentPatchResourceName"); + } + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } if (VirtualNetwork == null) { throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); } - if (VirtualNetwork != null) + if (WorkerPools == null) { - VirtualNetwork.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs index 25cb6fbebdb6..910c484a40d3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs @@ -37,8 +37,14 @@ public AppServiceEnvironmentResource() /// class. /// /// Resource Location. + /// Name of the App + /// Service Environment. + /// Location of the + /// App Service Environment, e.g. "West US". /// Description of the Virtual /// Network. + /// Description of worker pools with worker + /// size IDs, VM sizes, and number of workers in each pool. /// Resource Id. /// Resource Name. /// Kind of resource. @@ -50,51 +56,120 @@ public AppServiceEnvironmentResource() /// Current status of the App Service Environment. /// Possible values include: 'Preparing', 'Ready', 'Scaling', /// 'Deleting' + /// Name of the Virtual Network for the App + /// Service Environment. + /// Resource group of the Virtual + /// Network. + /// Subnet of the Virtual Network. /// Specifies which endpoints /// to serve internally in the Virtual Network for the App Service /// Environment. Possible values include: 'None', 'Web', 'Publishing', - /// 'Web, Publishing' + /// 'Web,Publishing' /// Front-end VM size, e.g. "Medium", /// "Large". /// Number of front-end instances. /// Number of IP SSL addresses reserved /// for the App Service Environment. + /// Edition of the metadata database for + /// the App Service Environment, e.g. "Standard". + /// Service objective of the + /// metadata database for the App Service Environment, e.g. + /// "S0". + /// Number of upgrade domains of the App + /// Service Environment. + /// Subscription of the App Service + /// Environment. /// DNS suffix of the App Service /// Environment. + /// Last deployment action on the App Service + /// Environment. + /// Result of the last deployment action + /// on the App Service Environment. + /// List of comma separated strings + /// describing which VM sizes are allowed for front-ends. + /// List of comma separated strings + /// describing which VM sizes are allowed for workers. /// Maximum number of VMs in the /// App Service Environment. + /// Description of IP SSL mapping for the App + /// Service Environment. + /// Current total, used, and + /// available worker capacities. + /// Access control list for + /// controlling traffic to the App Service Environment. + /// True/false indicating whether + /// the App Service Environment is healthy. + /// Detailed message about with results + /// of the last check of the App Service Environment. + /// Resource group of the App Service + /// Environment. /// Scale factor for /// front-ends. + /// Default Scale Factor for + /// FrontEnds. + /// API Management Account + /// associated with the App Service Environment. /// <code>true</code> if the App /// Service Environment is suspended; otherwise, /// <code>false</code>. The environment can be suspended, /// e.g. when the management endpoint is no longer available /// (most likely because NSG blocked the incoming traffic). + /// True/false indicating whether the + /// App Service Environment is suspended. The environment can be + /// suspended e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). /// Custom settings for changing the /// behavior of the App Service Environment. /// User added ip ranges to /// whitelist on ASE db /// Flag that displays whether an ASE has /// linux workers or not - /// Dedicated Host Count - public AppServiceEnvironmentResource(string location, VirtualNetworkProfile virtualNetwork, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string dnsSuffix = default(string), int? maximumNumberOfMachines = default(int?), int? frontEndScaleFactor = default(int?), bool? suspended = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), int? dedicatedHostCount = default(int?)) + /// Key Vault ID for ILB App Service + /// Environment default SSL certificate + /// Key Vault Secret Name for + /// ILB App Service Environment default SSL certificate + public AppServiceEnvironmentResource(string location, string appServiceEnvironmentResourceName, string appServiceEnvironmentResourceLocation, VirtualNetworkProfile virtualNetwork, IList workerPools, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) : base(location, id, name, kind, type, tags) { + AppServiceEnvironmentResourceName = appServiceEnvironmentResourceName; + AppServiceEnvironmentResourceLocation = appServiceEnvironmentResourceLocation; ProvisioningState = provisioningState; Status = status; + VnetName = vnetName; + VnetResourceGroupName = vnetResourceGroupName; + VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; + WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; + DatabaseEdition = databaseEdition; + DatabaseServiceObjective = databaseServiceObjective; + UpgradeDomains = upgradeDomains; + SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; + LastAction = lastAction; + LastActionResult = lastActionResult; + AllowedMultiSizes = allowedMultiSizes; + AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; + VipMappings = vipMappings; + EnvironmentCapacities = environmentCapacities; + NetworkAccessControlList = networkAccessControlList; + EnvironmentIsHealthy = environmentIsHealthy; + EnvironmentStatus = environmentStatus; + ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; + DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; + ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; + DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - DedicatedHostCount = dedicatedHostCount; + SslCertKeyVaultId = sslCertKeyVaultId; + SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; CustomInit(); } @@ -103,6 +178,19 @@ public AppServiceEnvironmentResource() /// partial void CustomInit(); + /// + /// Gets or sets name of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.name")] + public string AppServiceEnvironmentResourceName { get; set; } + + /// + /// Gets or sets location of the App Service Environment, e.g. "West + /// US". + /// + [JsonProperty(PropertyName = "properties.location")] + public string AppServiceEnvironmentResourceLocation { get; set; } + /// /// Gets provisioning state of the App Service Environment. Possible /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', @@ -118,6 +206,25 @@ public AppServiceEnvironmentResource() [JsonProperty(PropertyName = "properties.status")] public HostingEnvironmentStatus? Status { get; private set; } + /// + /// Gets or sets name of the Virtual Network for the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "properties.vnetName")] + public string VnetName { get; set; } + + /// + /// Gets or sets resource group of the Virtual Network. + /// + [JsonProperty(PropertyName = "properties.vnetResourceGroupName")] + public string VnetResourceGroupName { get; set; } + + /// + /// Gets or sets subnet of the Virtual Network. + /// + [JsonProperty(PropertyName = "properties.vnetSubnetName")] + public string VnetSubnetName { get; set; } + /// /// Gets or sets description of the Virtual Network. /// @@ -127,7 +234,7 @@ public AppServiceEnvironmentResource() /// /// Gets or sets specifies which endpoints to serve internally in the /// Virtual Network for the App Service Environment. Possible values - /// include: 'None', 'Web', 'Publishing', 'Web, Publishing' + /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' /// [JsonProperty(PropertyName = "properties.internalLoadBalancingMode")] public string InternalLoadBalancingMode { get; set; } @@ -139,10 +246,17 @@ public AppServiceEnvironmentResource() public string MultiSize { get; set; } /// - /// Gets number of front-end instances. + /// Gets or sets number of front-end instances. /// [JsonProperty(PropertyName = "properties.multiRoleCount")] - public int? MultiRoleCount { get; private set; } + public int? MultiRoleCount { get; set; } + + /// + /// Gets or sets description of worker pools with worker size IDs, VM + /// sizes, and number of workers in each pool. + /// + [JsonProperty(PropertyName = "properties.workerPools")] + public IList WorkerPools { get; set; } /// /// Gets or sets number of IP SSL addresses reserved for the App @@ -151,18 +265,110 @@ public AppServiceEnvironmentResource() [JsonProperty(PropertyName = "properties.ipsslAddressCount")] public int? IpsslAddressCount { get; set; } + /// + /// Gets edition of the metadata database for the App Service + /// Environment, e.g. "Standard". + /// + [JsonProperty(PropertyName = "properties.databaseEdition")] + public string DatabaseEdition { get; private set; } + + /// + /// Gets service objective of the metadata database for the App Service + /// Environment, e.g. "S0". + /// + [JsonProperty(PropertyName = "properties.databaseServiceObjective")] + public string DatabaseServiceObjective { get; private set; } + + /// + /// Gets number of upgrade domains of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.upgradeDomains")] + public int? UpgradeDomains { get; private set; } + + /// + /// Gets subscription of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.subscriptionId")] + public string SubscriptionId { get; private set; } + /// /// Gets or sets DNS suffix of the App Service Environment. /// [JsonProperty(PropertyName = "properties.dnsSuffix")] public string DnsSuffix { get; set; } + /// + /// Gets last deployment action on the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.lastAction")] + public string LastAction { get; private set; } + + /// + /// Gets result of the last deployment action on the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "properties.lastActionResult")] + public string LastActionResult { get; private set; } + + /// + /// Gets list of comma separated strings describing which VM sizes are + /// allowed for front-ends. + /// + [JsonProperty(PropertyName = "properties.allowedMultiSizes")] + public string AllowedMultiSizes { get; private set; } + + /// + /// Gets list of comma separated strings describing which VM sizes are + /// allowed for workers. + /// + [JsonProperty(PropertyName = "properties.allowedWorkerSizes")] + public string AllowedWorkerSizes { get; private set; } + /// /// Gets maximum number of VMs in the App Service Environment. /// [JsonProperty(PropertyName = "properties.maximumNumberOfMachines")] public int? MaximumNumberOfMachines { get; private set; } + /// + /// Gets description of IP SSL mapping for the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.vipMappings")] + public IList VipMappings { get; private set; } + + /// + /// Gets current total, used, and available worker capacities. + /// + [JsonProperty(PropertyName = "properties.environmentCapacities")] + public IList EnvironmentCapacities { get; private set; } + + /// + /// Gets or sets access control list for controlling traffic to the App + /// Service Environment. + /// + [JsonProperty(PropertyName = "properties.networkAccessControlList")] + public IList NetworkAccessControlList { get; set; } + + /// + /// Gets true/false indicating whether the App Service Environment is + /// healthy. + /// + [JsonProperty(PropertyName = "properties.environmentIsHealthy")] + public bool? EnvironmentIsHealthy { get; private set; } + + /// + /// Gets detailed message about with results of the last check of the + /// App Service Environment. + /// + [JsonProperty(PropertyName = "properties.environmentStatus")] + public string EnvironmentStatus { get; private set; } + + /// + /// Gets resource group of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.resourceGroup")] + public string ResourceGroup { get; private set; } + /// /// Gets or sets scale factor for front-ends. /// @@ -170,15 +376,37 @@ public AppServiceEnvironmentResource() public int? FrontEndScaleFactor { get; set; } /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the App - /// Service Environment is suspended; otherwise, + /// Gets default Scale Factor for FrontEnds. + /// + [JsonProperty(PropertyName = "properties.defaultFrontEndScaleFactor")] + public int? DefaultFrontEndScaleFactor { get; private set; } + + /// + /// Gets or sets API Management Account associated with the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "properties.apiManagementAccountId")] + public string ApiManagementAccountId { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// App Service Environment is suspended; otherwise, /// &lt;code&gt;false&lt;/code&gt;. The environment can /// be suspended, e.g. when the management endpoint is no longer /// available /// (most likely because NSG blocked the incoming traffic). /// [JsonProperty(PropertyName = "properties.suspended")] - public bool? Suspended { get; private set; } + public bool? Suspended { get; set; } + + /// + /// Gets or sets true/false indicating whether the App Service + /// Environment is suspended. The environment can be suspended e.g. + /// when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// + [JsonProperty(PropertyName = "properties.dynamicCacheEnabled")] + public bool? DynamicCacheEnabled { get; set; } /// /// Gets or sets custom settings for changing the behavior of the App @@ -194,16 +422,25 @@ public AppServiceEnvironmentResource() public IList UserWhitelistedIpRanges { get; set; } /// - /// Gets flag that displays whether an ASE has linux workers or not + /// Gets or sets flag that displays whether an ASE has linux workers or + /// not /// [JsonProperty(PropertyName = "properties.hasLinuxWorkers")] - public bool? HasLinuxWorkers { get; private set; } + public bool? HasLinuxWorkers { get; set; } + + /// + /// Gets or sets key Vault ID for ILB App Service Environment default + /// SSL certificate + /// + [JsonProperty(PropertyName = "properties.sslCertKeyVaultId")] + public string SslCertKeyVaultId { get; set; } /// - /// Gets dedicated Host Count + /// Gets or sets key Vault Secret Name for ILB App Service Environment + /// default SSL certificate /// - [JsonProperty(PropertyName = "properties.dedicatedHostCount")] - public int? DedicatedHostCount { get; private set; } + [JsonProperty(PropertyName = "properties.sslCertKeyVaultSecretName")] + public string SslCertKeyVaultSecretName { get; set; } /// /// Validate the object. @@ -214,13 +451,21 @@ public AppServiceEnvironmentResource() public override void Validate() { base.Validate(); + if (AppServiceEnvironmentResourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentResourceName"); + } + if (AppServiceEnvironmentResourceLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentResourceLocation"); + } if (VirtualNetwork == null) { throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); } - if (VirtualNetwork != null) + if (WorkerPools == null) { - VirtualNetwork.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs index b77592992597..6f5f763da3eb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs @@ -80,11 +80,9 @@ public AppServicePlan() /// Scaling worker count. /// Scaling worker size ID. /// Provisioning state of the App - /// Service Plan. Possible values include: 'Succeeded', 'Failed', - /// 'Canceled', 'InProgress', 'Deleting' - /// Specification for the - /// Kubernetes Environment to use for the App Service plan. - public AppServicePlan(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), KubeEnvironmentProfile kubeEnvironmentProfile = default(KubeEnvironmentProfile), SkuDescription sku = default(SkuDescription)) + /// Service Environment. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'InProgress', 'Deleting' + public AppServicePlan(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), SkuDescription sku = default(SkuDescription)) : base(location, id, name, kind, type, tags) { WorkerTierName = workerTierName; @@ -106,7 +104,6 @@ public AppServicePlan() TargetWorkerCount = targetWorkerCount; TargetWorkerSizeId = targetWorkerSizeId; ProvisioningState = provisioningState; - KubeEnvironmentProfile = kubeEnvironmentProfile; Sku = sku; CustomInit(); } @@ -240,20 +237,13 @@ public AppServicePlan() public int? TargetWorkerSizeId { get; set; } /// - /// Gets provisioning state of the App Service Plan. Possible values - /// include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// Gets provisioning state of the App Service Environment. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', /// 'Deleting' /// [JsonProperty(PropertyName = "properties.provisioningState")] public ProvisioningState? ProvisioningState { get; private set; } - /// - /// Gets or sets specification for the Kubernetes Environment to use - /// for the App Service plan. - /// - [JsonProperty(PropertyName = "properties.kubeEnvironmentProfile")] - public KubeEnvironmentProfile KubeEnvironmentProfile { get; set; } - /// /// [JsonProperty(PropertyName = "sku")] diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs index 87b7050495c3..55716222a405 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs @@ -66,9 +66,11 @@ public AppServicePlanPatchResource() /// free offer expires. /// Resource group of the App Service /// plan. - /// If Linux app service plan - /// <code>true</code>, <code>false</code> - /// otherwise. + /// This needs to set to + /// <code>true</code> when creating a Linux App Service + /// Plan, along with <code>kind</code> set to + /// <code>Linux</code>. It should be + /// <code>false</code> otherwise. /// Obsolete: If Hyper-V container app service /// plan <code>true</code>, <code>false</code> /// otherwise. @@ -78,11 +80,9 @@ public AppServicePlanPatchResource() /// Scaling worker count. /// Scaling worker size ID. /// Provisioning state of the App - /// Service Plan. Possible values include: 'Succeeded', 'Failed', - /// 'Canceled', 'InProgress', 'Deleting' - /// Specification for the - /// Kubernetes Environment to use for the App Service plan. - public AppServicePlanPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), KubeEnvironmentProfile kubeEnvironmentProfile = default(KubeEnvironmentProfile)) + /// Service Environment. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'InProgress', 'Deleting' + public AppServicePlanPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?)) : base(id, name, kind, type) { WorkerTierName = workerTierName; @@ -104,7 +104,6 @@ public AppServicePlanPatchResource() TargetWorkerCount = targetWorkerCount; TargetWorkerSizeId = targetWorkerSizeId; ProvisioningState = provisioningState; - KubeEnvironmentProfile = kubeEnvironmentProfile; CustomInit(); } @@ -201,8 +200,11 @@ public AppServicePlanPatchResource() public string ResourceGroup { get; private set; } /// - /// Gets or sets if Linux app service plan - /// &lt;code&gt;true&lt;/code&gt;, + /// Gets or sets this needs to set to + /// &lt;code&gt;true&lt;/code&gt; when creating a Linux + /// App Service Plan, along with + /// &lt;code&gt;kind&lt;/code&gt; set to + /// &lt;code&gt;Linux&lt;/code&gt;. It should be /// &lt;code&gt;false&lt;/code&gt; otherwise. /// [JsonProperty(PropertyName = "properties.reserved")] @@ -237,19 +239,12 @@ public AppServicePlanPatchResource() public int? TargetWorkerSizeId { get; set; } /// - /// Gets provisioning state of the App Service Plan. Possible values - /// include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// Gets provisioning state of the App Service Environment. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', /// 'Deleting' /// [JsonProperty(PropertyName = "properties.provisioningState")] public ProvisioningState? ProvisioningState { get; private set; } - /// - /// Gets or sets specification for the Kubernetes Environment to use - /// for the App Service plan. - /// - [JsonProperty(PropertyName = "properties.kubeEnvironmentProfile")] - public KubeEnvironmentProfile KubeEnvironmentProfile { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs deleted file mode 100644 index 1659b09e76e0..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] - public partial class Apple : ProxyOnlyResource - { - /// - /// Initializes a new instance of the Apple class. - /// - public Apple() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Apple class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public Apple(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), AppleRegistration registration = default(AppleRegistration), LoginScopes login = default(LoginScopes)) - : base(id, name, kind, type) - { - Enabled = enabled; - Registration = registration; - Login = login; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.registration")] - public AppleRegistration Registration { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.login")] - public LoginScopes Login { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs deleted file mode 100644 index 09b837ad93e8..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] - public partial class AppleRegistration : ProxyOnlyResource - { - /// - /// Initializes a new instance of the AppleRegistration class. - /// - public AppleRegistration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AppleRegistration class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public AppleRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string clientId = default(string), string clientSecretSettingName = default(string)) - : base(id, name, kind, type) - { - ClientId = clientId; - ClientSecretSettingName = clientSecretSettingName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.clientId")] - public string ClientId { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.clientSecretSettingName")] - public string ClientSecretSettingName { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs index 581290a604fe..1eb2589b59e0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs @@ -38,17 +38,13 @@ public ApplicationStack() /// available. /// List of frameworks associated with /// application stack. - /// <code>true</code> if this is - /// the stack is deprecated; otherwise, - /// <code>false</code>. - public ApplicationStack(string name = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList), IList isDeprecated = default(IList)) + public ApplicationStack(string name = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList)) { Name = name; Display = display; Dependency = dependency; MajorVersions = majorVersions; Frameworks = frameworks; - IsDeprecated = isDeprecated; CustomInit(); } @@ -87,13 +83,5 @@ public ApplicationStack() [JsonProperty(PropertyName = "frameworks")] public IList Frameworks { get; set; } - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this - /// is the stack is deprecated; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isDeprecated")] - public IList IsDeprecated { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs index ace998a07c8a..ac8153b7ec12 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs @@ -46,10 +46,7 @@ public ApplicationStackResource() /// available. /// List of frameworks associated with /// application stack. - /// <code>true</code> if this is - /// the stack is deprecated; otherwise, - /// <code>false</code>. - public ApplicationStackResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string applicationStackResourceName = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList), IList isDeprecated = default(IList)) + public ApplicationStackResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string applicationStackResourceName = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList)) : base(id, name, kind, type) { ApplicationStackResourceName = applicationStackResourceName; @@ -57,7 +54,6 @@ public ApplicationStackResource() Dependency = dependency; MajorVersions = majorVersions; Frameworks = frameworks; - IsDeprecated = isDeprecated; CustomInit(); } @@ -96,13 +92,5 @@ public ApplicationStackResource() [JsonProperty(PropertyName = "properties.frameworks")] public IList Frameworks { get; set; } - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this - /// is the stack is deprecated; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.isDeprecated")] - public IList IsDeprecated { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs deleted file mode 100644 index a4a1226ce6af..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Github access token for Appservice CLI github integration. - /// - public partial class AppserviceGithubToken - { - /// - /// Initializes a new instance of the AppserviceGithubToken class. - /// - public AppserviceGithubToken() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AppserviceGithubToken class. - /// - /// Github access token for Appservice CLI - /// github integration - /// Scope of the github access token - /// token type - /// True if valid github token received, False - /// otherwise - /// Error message if unable to get - /// token - public AppserviceGithubToken(string accessToken = default(string), string scope = default(string), string tokenType = default(string), bool? gotToken = default(bool?), string errorMessage = default(string)) - { - AccessToken = accessToken; - Scope = scope; - TokenType = tokenType; - GotToken = gotToken; - ErrorMessage = errorMessage; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets github access token for Appservice CLI github - /// integration - /// - [JsonProperty(PropertyName = "accessToken")] - public string AccessToken { get; set; } - - /// - /// Gets or sets scope of the github access token - /// - [JsonProperty(PropertyName = "scope")] - public string Scope { get; set; } - - /// - /// Gets or sets token type - /// - [JsonProperty(PropertyName = "tokenType")] - public string TokenType { get; set; } - - /// - /// Gets or sets true if valid github token received, False otherwise - /// - [JsonProperty(PropertyName = "gotToken")] - public bool? GotToken { get; set; } - - /// - /// Gets or sets error message if unable to get token - /// - [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs deleted file mode 100644 index e99bcc39cb0f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs +++ /dev/null @@ -1,80 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Appservice Github token request content. - /// - public partial class AppserviceGithubTokenRequest - { - /// - /// Initializes a new instance of the AppserviceGithubTokenRequest - /// class. - /// - public AppserviceGithubTokenRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AppserviceGithubTokenRequest - /// class. - /// - /// Code string to exchange for Github Access - /// token - /// State string used for verification. - public AppserviceGithubTokenRequest(string code, string state) - { - Code = code; - State = state; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets code string to exchange for Github Access token - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets state string used for verification. - /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Code == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Code"); - } - if (State == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "State"); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs deleted file mode 100644 index 57dca6849502..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Full view of networking configuration for an ASE. - /// - [Rest.Serialization.JsonTransformation] - public partial class AseV3NetworkingConfiguration : ProxyOnlyResource - { - /// - /// Initializes a new instance of the AseV3NetworkingConfiguration - /// class. - /// - public AseV3NetworkingConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AseV3NetworkingConfiguration - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Property to enable - /// and disable new private endpoint connection creation on ASE - public AseV3NetworkingConfiguration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList windowsOutboundIpAddresses = default(IList), IList linuxOutboundIpAddresses = default(IList), bool? allowNewPrivateEndpointConnections = default(bool?)) - : base(id, name, kind, type) - { - WindowsOutboundIpAddresses = windowsOutboundIpAddresses; - LinuxOutboundIpAddresses = linuxOutboundIpAddresses; - AllowNewPrivateEndpointConnections = allowNewPrivateEndpointConnections; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.windowsOutboundIpAddresses")] - public IList WindowsOutboundIpAddresses { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "properties.linuxOutboundIpAddresses")] - public IList LinuxOutboundIpAddresses { get; private set; } - - /// - /// Gets or sets property to enable and disable new private endpoint - /// connection creation on ASE - /// - [JsonProperty(PropertyName = "properties.allowNewPrivateEndpointConnections")] - public bool? AllowNewPrivateEndpointConnections { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs index f660ab69959a..1249271bac0a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs @@ -34,21 +34,15 @@ public AutoHealTriggers() /// A rule based on total requests. /// A rule based on private /// bytes. - /// A rule based on status codes. + /// A rule based on status codes. /// A rule based on request execution /// time. - /// A rule based on status codes - /// ranges. - /// A rule based on multiple Slow - /// Requests Rule with path - public AutoHealTriggers(RequestsBasedTrigger requests = default(RequestsBasedTrigger), int? privateBytesInKB = default(int?), IList statusCodes = default(IList), SlowRequestsBasedTrigger slowRequests = default(SlowRequestsBasedTrigger), IList statusCodesRange = default(IList), IList slowRequestsWithPath = default(IList)) + public AutoHealTriggers(RequestsBasedTrigger requests = default(RequestsBasedTrigger), int? privateBytesInKB = default(int?), IList statusCodes = default(IList), SlowRequestsBasedTrigger slowRequests = default(SlowRequestsBasedTrigger)) { Requests = requests; PrivateBytesInKB = privateBytesInKB; - StatusCodes = statusCodes; + StatusCodes = statusCodes; SlowRequests = slowRequests; - StatusCodesRange = statusCodesRange; - SlowRequestsWithPath = slowRequestsWithPath; CustomInit(); } @@ -81,17 +75,5 @@ public AutoHealTriggers() [JsonProperty(PropertyName = "slowRequests")] public SlowRequestsBasedTrigger SlowRequests { get; set; } - /// - /// Gets or sets a rule based on status codes ranges. - /// - [JsonProperty(PropertyName = "statusCodesRange")] - public IList StatusCodesRange { get; set; } - - /// - /// Gets or sets a rule based on multiple Slow Requests Rule with path - /// - [JsonProperty(PropertyName = "slowRequestsWithPath")] - public IList SlowRequestsWithPath { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs deleted file mode 100644 index b268f017941e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] - public partial class AzureStaticWebApps : ProxyOnlyResource - { - /// - /// Initializes a new instance of the AzureStaticWebApps class. - /// - public AzureStaticWebApps() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AzureStaticWebApps class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public AzureStaticWebApps(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), AzureStaticWebAppsRegistration registration = default(AzureStaticWebAppsRegistration)) - : base(id, name, kind, type) - { - Enabled = enabled; - Registration = registration; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.registration")] - public AzureStaticWebAppsRegistration Registration { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs deleted file mode 100644 index 07828db6047c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] - public partial class AzureStaticWebAppsRegistration : ProxyOnlyResource - { - /// - /// Initializes a new instance of the AzureStaticWebAppsRegistration - /// class. - /// - public AzureStaticWebAppsRegistration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AzureStaticWebAppsRegistration - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public AzureStaticWebAppsRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string clientId = default(string)) - : base(id, name, kind, type) - { - ClientId = clientId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.clientId")] - public string ClientId { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs index 58973e11d2a7..a0dec36fc138 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs @@ -39,8 +39,7 @@ public AzureStorageInfoValue() /// Path to mount the storage within the site's /// runtime environment. /// State of the storage account. Possible values - /// include: 'Ok', 'InvalidCredentials', 'InvalidShare', - /// 'NotValidated' + /// include: 'Ok', 'InvalidCredentials', 'InvalidShare' public AzureStorageInfoValue(AzureStorageType? type = default(AzureStorageType?), string accountName = default(string), string shareName = default(string), string accessKey = default(string), string mountPath = default(string), AzureStorageState? state = default(AzureStorageState?)) { Type = type; @@ -92,7 +91,7 @@ public AzureStorageInfoValue() /// /// Gets state of the storage account. Possible values include: 'Ok', - /// 'InvalidCredentials', 'InvalidShare', 'NotValidated' + /// 'InvalidCredentials', 'InvalidShare' /// [JsonProperty(PropertyName = "state")] public AzureStorageState? State { get; private set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs index dd8e18dc45a5..49d68d686c25 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs @@ -26,9 +26,7 @@ public enum AzureStorageState [EnumMember(Value = "InvalidCredentials")] InvalidCredentials, [EnumMember(Value = "InvalidShare")] - InvalidShare, - [EnumMember(Value = "NotValidated")] - NotValidated + InvalidShare } internal static class AzureStorageStateEnumExtension { @@ -47,8 +45,6 @@ internal static string ToSerializedValue(this AzureStorageState value) return "InvalidCredentials"; case AzureStorageState.InvalidShare: return "InvalidShare"; - case AzureStorageState.NotValidated: - return "NotValidated"; } return null; } @@ -63,8 +59,6 @@ internal static string ToSerializedValue(this AzureStorageState value) return AzureStorageState.InvalidCredentials; case "InvalidShare": return AzureStorageState.InvalidShare; - case "NotValidated": - return AzureStorageState.NotValidated; } return null; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs index 592906a09b62..2e6698cad5cd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs @@ -46,8 +46,7 @@ public BillingMeter() /// App Service ResourceType meter used /// for /// App Service OS type meter used for - /// Meter Multiplier - public BillingMeter(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string meterId = default(string), string billingLocation = default(string), string shortName = default(string), string friendlyName = default(string), string resourceType = default(string), string osType = default(string), double? multiplier = default(double?)) + public BillingMeter(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string meterId = default(string), string billingLocation = default(string), string shortName = default(string), string friendlyName = default(string), string resourceType = default(string), string osType = default(string)) : base(id, name, kind, type) { MeterId = meterId; @@ -56,7 +55,6 @@ public BillingMeter() FriendlyName = friendlyName; ResourceType = resourceType; OsType = osType; - Multiplier = multiplier; CustomInit(); } @@ -101,11 +99,5 @@ public BillingMeter() [JsonProperty(PropertyName = "properties.osType")] public string OsType { get; set; } - /// - /// Gets or sets meter Multiplier - /// - [JsonProperty(PropertyName = "properties.multiplier")] - public double? Multiplier { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs index 0bc4b11e4ac3..d46eb9c0661c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs @@ -35,6 +35,7 @@ public Certificate() /// Initializes a new instance of the Certificate class. /// /// Resource Location. + /// Certificate password. /// Resource Id. /// Resource Name. /// Kind of resource. @@ -51,7 +52,6 @@ public Certificate() /// Certificate issuer. /// Certificate issue Date. /// Certificate expiration date. - /// Certificate password. /// Certificate thumbprint. /// Is the certificate valid?. /// Raw bytes of .cer file @@ -72,9 +72,7 @@ public Certificate() /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". /// CNAME of the certificate to be issued /// via free certificate - /// Method of domain validation - /// for free cert - public Certificate(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string password = default(string), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string), string domainValidationMethod = default(string)) + public Certificate(string location, string password, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string)) : base(location, id, name, kind, type, tags) { FriendlyName = friendlyName; @@ -97,7 +95,6 @@ public Certificate() KeyVaultSecretStatus = keyVaultSecretStatus; ServerFarmId = serverFarmId; CanonicalName = canonicalName; - DomainValidationMethod = domainValidationMethod; CustomInit(); } @@ -235,12 +232,6 @@ public Certificate() [JsonProperty(PropertyName = "properties.canonicalName")] public string CanonicalName { get; set; } - /// - /// Gets or sets method of domain validation for free cert - /// - [JsonProperty(PropertyName = "properties.domainValidationMethod")] - public string DomainValidationMethod { get; set; } - /// /// Validate the object. /// @@ -250,6 +241,10 @@ public Certificate() public override void Validate() { base.Validate(); + if (Password == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Password"); + } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs deleted file mode 100644 index e5e1e23fea6c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class CertificateOrderContact - { - /// - /// Initializes a new instance of the CertificateOrderContact class. - /// - public CertificateOrderContact() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CertificateOrderContact class. - /// - public CertificateOrderContact(string email = default(string), string nameFirst = default(string), string nameLast = default(string), string phone = default(string)) - { - Email = email; - NameFirst = nameFirst; - NameLast = nameLast; - Phone = phone; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "email")] - public string Email { get; set; } - - /// - /// - [JsonProperty(PropertyName = "nameFirst")] - public string NameFirst { get; set; } - - /// - /// - [JsonProperty(PropertyName = "nameLast")] - public string NameLast { get; set; } - - /// - /// - [JsonProperty(PropertyName = "phone")] - public string Phone { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs index 9f323bb4996d..f2579bd985bc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs @@ -34,6 +34,7 @@ public CertificatePatchResource() /// /// Initializes a new instance of the CertificatePatchResource class. /// + /// Certificate password. /// Resource Id. /// Resource Name. /// Kind of resource. @@ -49,7 +50,6 @@ public CertificatePatchResource() /// Certificate issuer. /// Certificate issue Date. /// Certificate expiration date. - /// Certificate password. /// Certificate thumbprint. /// Is the certificate valid?. /// Raw bytes of .cer file @@ -70,9 +70,7 @@ public CertificatePatchResource() /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". /// CNAME of the certificate to be issued /// via free certificate - /// Method of domain validation - /// for free cert - public CertificatePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string password = default(string), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string), string domainValidationMethod = default(string)) + public CertificatePatchResource(string password, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string)) : base(id, name, kind, type) { FriendlyName = friendlyName; @@ -95,7 +93,6 @@ public CertificatePatchResource() KeyVaultSecretStatus = keyVaultSecretStatus; ServerFarmId = serverFarmId; CanonicalName = canonicalName; - DomainValidationMethod = domainValidationMethod; CustomInit(); } @@ -234,10 +231,17 @@ public CertificatePatchResource() public string CanonicalName { get; set; } /// - /// Gets or sets method of domain validation for free cert + /// Validate the object. /// - [JsonProperty(PropertyName = "properties.domainValidationMethod")] - public string DomainValidationMethod { get; set; } - + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Password == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Password"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs index 5c9bd29f7e2d..422855315598 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs @@ -24,9 +24,7 @@ public enum ClientCertMode [EnumMember(Value = "Required")] Required, [EnumMember(Value = "Optional")] - Optional, - [EnumMember(Value = "OptionalInteractiveUser")] - OptionalInteractiveUser + Optional } internal static class ClientCertModeEnumExtension { @@ -43,8 +41,6 @@ internal static string ToSerializedValue(this ClientCertMode value) return "Required"; case ClientCertMode.Optional: return "Optional"; - case ClientCertMode.OptionalInteractiveUser: - return "OptionalInteractiveUser"; } return null; } @@ -57,8 +53,6 @@ internal static string ToSerializedValue(this ClientCertMode value) return ClientCertMode.Required; case "Optional": return ClientCertMode.Optional; - case "OptionalInteractiveUser": - return ClientCertMode.OptionalInteractiveUser; } return null; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConfigReferenceSource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConfigReferenceSource.cs deleted file mode 100644 index 621c4362c717..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConfigReferenceSource.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ConfigReferenceSource. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum ConfigReferenceSource - { - [EnumMember(Value = "KeyVault")] - KeyVault - } - internal static class ConfigReferenceSourceEnumExtension - { - internal static string ToSerializedValue(this ConfigReferenceSource? value) - { - return value == null ? null : ((ConfigReferenceSource)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ConfigReferenceSource value) - { - switch( value ) - { - case ConfigReferenceSource.KeyVault: - return "KeyVault"; - } - return null; - } - - internal static ConfigReferenceSource? ParseConfigReferenceSource(this string value) - { - switch( value ) - { - case "KeyVault": - return ConfigReferenceSource.KeyVault; - } - return null; - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmCopySlotEntity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmCopySlotEntity.cs new file mode 100644 index 000000000000..0c117e09339b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmCopySlotEntity.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.WebSites.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Copy deployment slot parameters. + /// + public partial class CsmCopySlotEntity + { + /// + /// Initializes a new instance of the CsmCopySlotEntity class. + /// + public CsmCopySlotEntity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CsmCopySlotEntity class. + /// + /// Destination deployment slot during copy + /// operation. + /// The site object which will be merged with + /// the source slot site + /// to produce new destination slot site object. + /// <code>null</code> to just copy source slot content. + /// Otherwise a <code>Site</code> + /// object with properties to override source slot site. + public CsmCopySlotEntity(string targetSlot, SiteConfig siteConfig) + { + TargetSlot = targetSlot; + SiteConfig = siteConfig; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets destination deployment slot during copy operation. + /// + [JsonProperty(PropertyName = "targetSlot")] + public string TargetSlot { get; set; } + + /// + /// Gets or sets the site object which will be merged with the source + /// slot site + /// to produce new destination slot site object. + /// &lt;code&gt;null&lt;/code&gt; to just copy source + /// slot content. Otherwise a + /// &lt;code&gt;Site&lt;/code&gt; + /// object with properties to override source slot site. + /// + [JsonProperty(PropertyName = "siteConfig")] + public SiteConfig SiteConfig { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TargetSlot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetSlot"); + } + if (SiteConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SiteConfig"); + } + if (SiteConfig != null) + { + SiteConfig.Validate(); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs deleted file mode 100644 index 7a18aa9698bf..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - - /// - /// Defines values for CustomDomainStatus. - /// - public static class CustomDomainStatus - { - public const string RetrievingValidationToken = "RetrievingValidationToken"; - public const string Validating = "Validating"; - public const string Adding = "Adding"; - public const string Ready = "Ready"; - public const string Failed = "Failed"; - public const string Deleting = "Deleting"; - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs deleted file mode 100644 index 74f97c70231f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Additional configuration for a data providers - /// - public partial class DataProviderMetadata - { - /// - /// Initializes a new instance of the DataProviderMetadata class. - /// - public DataProviderMetadata() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataProviderMetadata class. - /// - /// Settings for the data provider - public DataProviderMetadata(string providerName = default(string), IList propertyBag = default(IList)) - { - ProviderName = providerName; - PropertyBag = propertyBag; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "providerName")] - public string ProviderName { get; set; } - - /// - /// Gets settings for the data provider - /// - [JsonProperty(PropertyName = "propertyBag")] - public IList PropertyBag { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs index 6bef8197eb83..78af46d0f5c1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs @@ -11,8 +11,6 @@ namespace Microsoft.Azure.Management.WebSites.Models { using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,33 +29,17 @@ public DetectorInfo() /// /// Initializes a new instance of the DetectorInfo class. /// - /// Id of detector - /// Name of detector /// Short description of the detector and its - /// purpose. - /// Author of the detector. - /// Problem category. This serves for organizing - /// group for detectors. - /// List of Support Topics for which - /// this detector is enabled. - /// Analysis Types for which this detector - /// should apply to. - /// Whether this detector is an Analysis Detector or - /// not. Possible values include: 'Detector', 'Analysis', - /// 'CategoryOverview' - /// Defines score of a detector to power ML based - /// matching. - public DetectorInfo(string id = default(string), string name = default(string), string description = default(string), string author = default(string), string category = default(string), IList supportTopicList = default(IList), IList analysisType = default(IList), DetectorType? type = default(DetectorType?), double? score = default(double?)) + /// purpose + /// Support Category + /// Support Sub Category + /// Support Topic Id + public DetectorInfo(string description = default(string), string category = default(string), string subCategory = default(string), string supportTopicId = default(string)) { - Id = id; - Name = name; Description = description; - Author = author; Category = category; - SupportTopicList = supportTopicList; - AnalysisType = analysisType; - Type = type; - Score = score; + SubCategory = subCategory; + SupportTopicId = supportTopicId; CustomInit(); } @@ -67,60 +49,28 @@ public DetectorInfo() partial void CustomInit(); /// - /// Gets id of detector - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets name of detector - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets short description of the detector and its purpose. + /// Gets short description of the detector and its purpose /// [JsonProperty(PropertyName = "description")] public string Description { get; private set; } /// - /// Gets author of the detector. - /// - [JsonProperty(PropertyName = "author")] - public string Author { get; private set; } - - /// - /// Gets problem category. This serves for organizing group for - /// detectors. + /// Gets support Category /// [JsonProperty(PropertyName = "category")] public string Category { get; private set; } /// - /// Gets list of Support Topics for which this detector is enabled. - /// - [JsonProperty(PropertyName = "supportTopicList")] - public IList SupportTopicList { get; private set; } - - /// - /// Gets analysis Types for which this detector should apply to. - /// - [JsonProperty(PropertyName = "analysisType")] - public IList AnalysisType { get; private set; } - - /// - /// Gets whether this detector is an Analysis Detector or not. Possible - /// values include: 'Detector', 'Analysis', 'CategoryOverview' + /// Gets support Sub Category /// - [JsonProperty(PropertyName = "type")] - public DetectorType? Type { get; private set; } + [JsonProperty(PropertyName = "subCategory")] + public string SubCategory { get; private set; } /// - /// Gets defines score of a detector to power ML based matching. + /// Gets support Topic Id /// - [JsonProperty(PropertyName = "score")] - public double? Score { get; private set; } + [JsonProperty(PropertyName = "supportTopicId")] + public string SupportTopicId { get; private set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs index 79366fbad0af..853860a84c5c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs @@ -40,20 +40,11 @@ public DetectorResponse() /// Resource type. /// metadata for the detector /// Data Set - /// Indicates status of the most severe - /// insight. - /// Additional configuration for - /// different data providers to be used by the UI - /// Suggested utterances where the - /// detector can be applicable. - public DetectorResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), DetectorInfo metadata = default(DetectorInfo), IList dataset = default(IList), Status status = default(Status), IList dataProvidersMetadata = default(IList), QueryUtterancesResults suggestedUtterances = default(QueryUtterancesResults)) + public DetectorResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), DetectorInfo metadata = default(DetectorInfo), IList dataset = default(IList)) : base(id, name, kind, type) { Metadata = metadata; Dataset = dataset; - Status = status; - DataProvidersMetadata = dataProvidersMetadata; - SuggestedUtterances = suggestedUtterances; CustomInit(); } @@ -74,25 +65,5 @@ public DetectorResponse() [JsonProperty(PropertyName = "properties.dataset")] public IList Dataset { get; set; } - /// - /// Gets or sets indicates status of the most severe insight. - /// - [JsonProperty(PropertyName = "properties.status")] - public Status Status { get; set; } - - /// - /// Gets or sets additional configuration for different data providers - /// to be used by the UI - /// - [JsonProperty(PropertyName = "properties.dataProvidersMetadata")] - public IList DataProvidersMetadata { get; set; } - - /// - /// Gets or sets suggested utterances where the detector can be - /// applicable. - /// - [JsonProperty(PropertyName = "properties.suggestedUtterances")] - public QueryUtterancesResults SuggestedUtterances { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs deleted file mode 100644 index 23370a2c5fec..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for DetectorType. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum DetectorType - { - [EnumMember(Value = "Detector")] - Detector, - [EnumMember(Value = "Analysis")] - Analysis, - [EnumMember(Value = "CategoryOverview")] - CategoryOverview - } - internal static class DetectorTypeEnumExtension - { - internal static string ToSerializedValue(this DetectorType? value) - { - return value == null ? null : ((DetectorType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this DetectorType value) - { - switch( value ) - { - case DetectorType.Detector: - return "Detector"; - case DetectorType.Analysis: - return "Analysis"; - case DetectorType.CategoryOverview: - return "CategoryOverview"; - } - return null; - } - - internal static DetectorType? ParseDetectorType(this string value) - { - switch( value ) - { - case "Detector": - return DetectorType.Detector; - case "Analysis": - return DetectorType.Analysis; - case "CategoryOverview": - return DetectorType.CategoryOverview; - } - return null; - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs deleted file mode 100644 index 8dee701ca524..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Function App stack major version. - /// - public partial class FunctionAppMajorVersion - { - /// - /// Initializes a new instance of the FunctionAppMajorVersion class. - /// - public FunctionAppMajorVersion() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FunctionAppMajorVersion class. - /// - /// Function App stack major version (display - /// only). - /// Function App stack major version name. - /// Minor versions associated with the - /// major version. - public FunctionAppMajorVersion(string displayText = default(string), string value = default(string), IList minorVersions = default(IList)) - { - DisplayText = displayText; - Value = value; - MinorVersions = minorVersions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets function App stack major version (display only). - /// - [JsonProperty(PropertyName = "displayText")] - public string DisplayText { get; private set; } - - /// - /// Gets function App stack major version name. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; private set; } - - /// - /// Gets minor versions associated with the major version. - /// - [JsonProperty(PropertyName = "minorVersions")] - public IList MinorVersions { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs deleted file mode 100644 index bf288f1db6fc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Function App stack minor version. - /// - public partial class FunctionAppMinorVersion - { - /// - /// Initializes a new instance of the FunctionAppMinorVersion class. - /// - public FunctionAppMinorVersion() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FunctionAppMinorVersion class. - /// - /// Function App stack (display - /// only). - /// Function App stack name. - /// Settings associated with the minor - /// version. - public FunctionAppMinorVersion(string displayText = default(string), string value = default(string), FunctionAppRuntimes stackSettings = default(FunctionAppRuntimes)) - { - DisplayText = displayText; - Value = value; - StackSettings = stackSettings; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets function App stack (display only). - /// - [JsonProperty(PropertyName = "displayText")] - public string DisplayText { get; private set; } - - /// - /// Gets function App stack name. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; private set; } - - /// - /// Gets settings associated with the minor version. - /// - [JsonProperty(PropertyName = "stackSettings")] - public FunctionAppRuntimes StackSettings { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs deleted file mode 100644 index 9077c3cdc7bc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs +++ /dev/null @@ -1,193 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Function App runtime settings. - /// - public partial class FunctionAppRuntimeSettings - { - /// - /// Initializes a new instance of the FunctionAppRuntimeSettings class. - /// - public FunctionAppRuntimeSettings() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FunctionAppRuntimeSettings class. - /// - /// Function App stack minor version - /// (runtime only). - /// <code>true</code> if - /// remote debugging is supported for the stack; otherwise, - /// <code>false</code>. - /// Application Insights settings - /// associated with the minor version. - /// GitHub Actions settings - /// associated with the minor version. - /// Application settings associated - /// with the minor version. - /// Configuration settings - /// associated with the minor version. - /// List of supported - /// Functions extension versions. - /// <code>true</code> if the stack - /// is in preview; otherwise, <code>false</code>. - /// <code>true</code> if the - /// stack is deprecated; otherwise, - /// <code>false</code>. - /// <code>true</code> if the stack - /// should be hidden; otherwise, - /// <code>false</code>. - /// End-of-life date for the minor - /// version. - /// <code>true</code> if the - /// stack version is auto-updated; otherwise, - /// <code>false</code>. - /// <code>true</code> if the - /// minor version is early-access; otherwise, - /// <code>false</code>. - /// <code>true</code> if the minor - /// version the default; otherwise, - /// <code>false</code>. - public FunctionAppRuntimeSettings(string runtimeVersion = default(string), bool? remoteDebuggingSupported = default(bool?), AppInsightsWebAppStackSettings appInsightsSettings = default(AppInsightsWebAppStackSettings), GitHubActionWebAppStackSettings gitHubActionSettings = default(GitHubActionWebAppStackSettings), IDictionary appSettingsDictionary = default(IDictionary), SiteConfigPropertiesDictionary siteConfigPropertiesDictionary = default(SiteConfigPropertiesDictionary), IList supportedFunctionsExtensionVersions = default(IList), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?), bool? isDefault = default(bool?)) - { - RuntimeVersion = runtimeVersion; - RemoteDebuggingSupported = remoteDebuggingSupported; - AppInsightsSettings = appInsightsSettings; - GitHubActionSettings = gitHubActionSettings; - AppSettingsDictionary = appSettingsDictionary; - SiteConfigPropertiesDictionary = siteConfigPropertiesDictionary; - SupportedFunctionsExtensionVersions = supportedFunctionsExtensionVersions; - IsPreview = isPreview; - IsDeprecated = isDeprecated; - IsHidden = isHidden; - EndOfLifeDate = endOfLifeDate; - IsAutoUpdate = isAutoUpdate; - IsEarlyAccess = isEarlyAccess; - IsDefault = isDefault; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets function App stack minor version (runtime only). - /// - [JsonProperty(PropertyName = "runtimeVersion")] - public string RuntimeVersion { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if remote - /// debugging is supported for the stack; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "remoteDebuggingSupported")] - public bool? RemoteDebuggingSupported { get; private set; } - - /// - /// Gets application Insights settings associated with the minor - /// version. - /// - [JsonProperty(PropertyName = "appInsightsSettings")] - public AppInsightsWebAppStackSettings AppInsightsSettings { get; private set; } - - /// - /// Gets gitHub Actions settings associated with the minor version. - /// - [JsonProperty(PropertyName = "gitHubActionSettings")] - public GitHubActionWebAppStackSettings GitHubActionSettings { get; private set; } - - /// - /// Gets application settings associated with the minor version. - /// - [JsonProperty(PropertyName = "appSettingsDictionary")] - public IDictionary AppSettingsDictionary { get; private set; } - - /// - /// Gets configuration settings associated with the minor version. - /// - [JsonProperty(PropertyName = "siteConfigPropertiesDictionary")] - public SiteConfigPropertiesDictionary SiteConfigPropertiesDictionary { get; private set; } - - /// - /// Gets list of supported Functions extension versions. - /// - [JsonProperty(PropertyName = "supportedFunctionsExtensionVersions")] - public IList SupportedFunctionsExtensionVersions { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is - /// in preview; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isPreview")] - public bool? IsPreview { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is - /// deprecated; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isDeprecated")] - public bool? IsDeprecated { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack - /// should be hidden; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isHidden")] - public bool? IsHidden { get; private set; } - - /// - /// Gets end-of-life date for the minor version. - /// - [JsonProperty(PropertyName = "endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack - /// version is auto-updated; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isAutoUpdate")] - public bool? IsAutoUpdate { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the minor - /// version is early-access; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isEarlyAccess")] - public bool? IsEarlyAccess { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the minor - /// version the default; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isDefault")] - public bool? IsDefault { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs deleted file mode 100644 index eab82eef40de..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Function App stack runtimes. - /// - public partial class FunctionAppRuntimes - { - /// - /// Initializes a new instance of the FunctionAppRuntimes class. - /// - public FunctionAppRuntimes() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FunctionAppRuntimes class. - /// - /// Linux-specific settings - /// associated with the minor version. - /// Windows-specific settings - /// associated with the minor version. - public FunctionAppRuntimes(FunctionAppRuntimeSettings linuxRuntimeSettings = default(FunctionAppRuntimeSettings), FunctionAppRuntimeSettings windowsRuntimeSettings = default(FunctionAppRuntimeSettings)) - { - LinuxRuntimeSettings = linuxRuntimeSettings; - WindowsRuntimeSettings = windowsRuntimeSettings; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets linux-specific settings associated with the minor version. - /// - [JsonProperty(PropertyName = "linuxRuntimeSettings")] - public FunctionAppRuntimeSettings LinuxRuntimeSettings { get; private set; } - - /// - /// Gets windows-specific settings associated with the minor version. - /// - [JsonProperty(PropertyName = "windowsRuntimeSettings")] - public FunctionAppRuntimeSettings WindowsRuntimeSettings { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs deleted file mode 100644 index 542801585fbf..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs +++ /dev/null @@ -1,97 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Function App Stack. - /// - [Rest.Serialization.JsonTransformation] - public partial class FunctionAppStack : ProxyOnlyResource - { - /// - /// Initializes a new instance of the FunctionAppStack class. - /// - public FunctionAppStack() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FunctionAppStack class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Function App stack location. - /// Function App stack (display - /// only). - /// Function App stack name. - /// List of major versions - /// available. - /// Function App stack preferred OS. Possible - /// values include: 'Windows', 'Linux' - public FunctionAppStack(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string location = default(string), string displayText = default(string), string value = default(string), IList majorVersions = default(IList), StackPreferredOs? preferredOs = default(StackPreferredOs?)) - : base(id, name, kind, type) - { - Location = location; - DisplayText = displayText; - Value = value; - MajorVersions = majorVersions; - PreferredOs = preferredOs; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets function App stack location. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; private set; } - - /// - /// Gets function App stack (display only). - /// - [JsonProperty(PropertyName = "properties.displayText")] - public string DisplayText { get; private set; } - - /// - /// Gets function App stack name. - /// - [JsonProperty(PropertyName = "properties.value")] - public string Value { get; private set; } - - /// - /// Gets list of major versions available. - /// - [JsonProperty(PropertyName = "properties.majorVersions")] - public IList MajorVersions { get; private set; } - - /// - /// Gets function App stack preferred OS. Possible values include: - /// 'Windows', 'Linux' - /// - [JsonProperty(PropertyName = "properties.preferredOs")] - public StackPreferredOs? PreferredOs { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs deleted file mode 100644 index 6db239e1d461..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The GitHub action code configuration. - /// - public partial class GitHubActionCodeConfiguration - { - /// - /// Initializes a new instance of the GitHubActionCodeConfiguration - /// class. - /// - public GitHubActionCodeConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GitHubActionCodeConfiguration - /// class. - /// - /// Runtime stack is used to determine the - /// workflow file content for code base apps. - /// Runtime version is used to determine - /// what build version to set in the workflow file. - public GitHubActionCodeConfiguration(string runtimeStack = default(string), string runtimeVersion = default(string)) - { - RuntimeStack = runtimeStack; - RuntimeVersion = runtimeVersion; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets runtime stack is used to determine the workflow file - /// content for code base apps. - /// - [JsonProperty(PropertyName = "runtimeStack")] - public string RuntimeStack { get; set; } - - /// - /// Gets or sets runtime version is used to determine what build - /// version to set in the workflow file. - /// - [JsonProperty(PropertyName = "runtimeVersion")] - public string RuntimeVersion { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs deleted file mode 100644 index 80fbadc40478..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The GitHub action configuration. - /// - public partial class GitHubActionConfiguration - { - /// - /// Initializes a new instance of the GitHubActionConfiguration class. - /// - public GitHubActionConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GitHubActionConfiguration class. - /// - /// GitHub Action code - /// configuration. - /// GitHub Action container - /// configuration. - /// This will help determine the workflow - /// configuration to select. - /// Workflow option to determine - /// whether the workflow file should be generated and written to the - /// repository. - public GitHubActionConfiguration(GitHubActionCodeConfiguration codeConfiguration = default(GitHubActionCodeConfiguration), GitHubActionContainerConfiguration containerConfiguration = default(GitHubActionContainerConfiguration), bool? isLinux = default(bool?), bool? generateWorkflowFile = default(bool?)) - { - CodeConfiguration = codeConfiguration; - ContainerConfiguration = containerConfiguration; - IsLinux = isLinux; - GenerateWorkflowFile = generateWorkflowFile; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets gitHub Action code configuration. - /// - [JsonProperty(PropertyName = "codeConfiguration")] - public GitHubActionCodeConfiguration CodeConfiguration { get; set; } - - /// - /// Gets or sets gitHub Action container configuration. - /// - [JsonProperty(PropertyName = "containerConfiguration")] - public GitHubActionContainerConfiguration ContainerConfiguration { get; set; } - - /// - /// Gets or sets this will help determine the workflow configuration to - /// select. - /// - [JsonProperty(PropertyName = "isLinux")] - public bool? IsLinux { get; set; } - - /// - /// Gets or sets workflow option to determine whether the workflow file - /// should be generated and written to the repository. - /// - [JsonProperty(PropertyName = "generateWorkflowFile")] - public bool? GenerateWorkflowFile { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs deleted file mode 100644 index 07b4058844c6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs +++ /dev/null @@ -1,83 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The GitHub action container configuration. - /// - public partial class GitHubActionContainerConfiguration - { - /// - /// Initializes a new instance of the - /// GitHubActionContainerConfiguration class. - /// - public GitHubActionContainerConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// GitHubActionContainerConfiguration class. - /// - /// The server URL for the container registry - /// where the build will be hosted. - /// The image name for the build. - /// The username used to upload the image to the - /// container registry. - /// The password used to upload the image to the - /// container registry. - public GitHubActionContainerConfiguration(string serverUrl = default(string), string imageName = default(string), string username = default(string), string password = default(string)) - { - ServerUrl = serverUrl; - ImageName = imageName; - Username = username; - Password = password; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the server URL for the container registry where the - /// build will be hosted. - /// - [JsonProperty(PropertyName = "serverUrl")] - public string ServerUrl { get; set; } - - /// - /// Gets or sets the image name for the build. - /// - [JsonProperty(PropertyName = "imageName")] - public string ImageName { get; set; } - - /// - /// Gets or sets the username used to upload the image to the container - /// registry. - /// - [JsonProperty(PropertyName = "username")] - public string Username { get; set; } - - /// - /// Gets or sets the password used to upload the image to the container - /// registry. - /// - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs deleted file mode 100644 index 6a49283cffe7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// GitHub Actions Web App stack settings. - /// - public partial class GitHubActionWebAppStackSettings - { - /// - /// Initializes a new instance of the GitHubActionWebAppStackSettings - /// class. - /// - public GitHubActionWebAppStackSettings() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GitHubActionWebAppStackSettings - /// class. - /// - /// <code>true</code> if GitHub - /// Actions is supported for the stack; otherwise, - /// <code>false</code>. - /// The minor version that is supported - /// for GitHub Actions. - public GitHubActionWebAppStackSettings(bool? isSupported = default(bool?), string supportedVersion = default(string)) - { - IsSupported = isSupported; - SupportedVersion = supportedVersion; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if GitHub - /// Actions is supported for the stack; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isSupported")] - public bool? IsSupported { get; private set; } - - /// - /// Gets the minor version that is supported for GitHub Actions. - /// - [JsonProperty(PropertyName = "supportedVersion")] - public string SupportedVersion { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs index fd01b2c7989c..25b7f98e559f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs @@ -35,17 +35,14 @@ public IdentityProviders() /// Resource Name. /// Kind of resource. /// Resource type. - public IdentityProviders(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), Facebook facebook = default(Facebook), GitHub gitHub = default(GitHub), Google google = default(Google), LegacyMicrosoftAccount legacyMicrosoftAccount = default(LegacyMicrosoftAccount), Twitter twitter = default(Twitter), Apple apple = default(Apple), AzureStaticWebApps azureStaticWebApps = default(AzureStaticWebApps), IDictionary customOpenIdConnectProviders = default(IDictionary)) + public IdentityProviders(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), Facebook facebook = default(Facebook), GitHub gitHub = default(GitHub), Google google = default(Google), Twitter twitter = default(Twitter), IDictionary customOpenIdConnectProviders = default(IDictionary)) : base(id, name, kind, type) { AzureActiveDirectory = azureActiveDirectory; Facebook = facebook; GitHub = gitHub; Google = google; - LegacyMicrosoftAccount = legacyMicrosoftAccount; Twitter = twitter; - Apple = apple; - AzureStaticWebApps = azureStaticWebApps; CustomOpenIdConnectProviders = customOpenIdConnectProviders; CustomInit(); } @@ -75,26 +72,11 @@ public IdentityProviders() [JsonProperty(PropertyName = "properties.google")] public Google Google { get; set; } - /// - /// - [JsonProperty(PropertyName = "properties.legacyMicrosoftAccount")] - public LegacyMicrosoftAccount LegacyMicrosoftAccount { get; set; } - /// /// [JsonProperty(PropertyName = "properties.twitter")] public Twitter Twitter { get; set; } - /// - /// - [JsonProperty(PropertyName = "properties.apple")] - public Apple Apple { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.azureStaticWebApps")] - public AzureStaticWebApps AzureStaticWebApps { get; set; } - /// /// [JsonProperty(PropertyName = "properties.customOpenIdConnectProviders")] diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs deleted file mode 100644 index e625bc5841cd..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for InsightStatus. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum InsightStatus - { - [EnumMember(Value = "Critical")] - Critical, - [EnumMember(Value = "Warning")] - Warning, - [EnumMember(Value = "Info")] - Info, - [EnumMember(Value = "Success")] - Success, - [EnumMember(Value = "None")] - None - } - internal static class InsightStatusEnumExtension - { - internal static string ToSerializedValue(this InsightStatus? value) - { - return value == null ? null : ((InsightStatus)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this InsightStatus value) - { - switch( value ) - { - case InsightStatus.Critical: - return "Critical"; - case InsightStatus.Warning: - return "Warning"; - case InsightStatus.Info: - return "Info"; - case InsightStatus.Success: - return "Success"; - case InsightStatus.None: - return "None"; - } - return null; - } - - internal static InsightStatus? ParseInsightStatus(this string value) - { - switch( value ) - { - case "Critical": - return InsightStatus.Critical; - case "Warning": - return InsightStatus.Warning; - case "Info": - return InsightStatus.Info; - case "Success": - return InsightStatus.Success; - case "None": - return InsightStatus.None; - } - return null; - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs deleted file mode 100644 index bcad1cb1452e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class KeyValuePairStringObject - { - /// - /// Initializes a new instance of the KeyValuePairStringObject class. - /// - public KeyValuePairStringObject() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the KeyValuePairStringObject class. - /// - public KeyValuePairStringObject(string key = default(string), object value = default(object)) - { - Key = key; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "key")] - public string Key { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "value")] - public object Value { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs deleted file mode 100644 index 9153aca339a0..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Specification for a Kubernetes Environment to use for this resource. - /// - public partial class KubeEnvironmentProfile - { - /// - /// Initializes a new instance of the KubeEnvironmentProfile class. - /// - public KubeEnvironmentProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the KubeEnvironmentProfile class. - /// - /// Resource ID of the Kubernetes Environment. - /// Name of the Kubernetes Environment. - /// Resource type of the Kubernetes - /// Environment. - public KubeEnvironmentProfile(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 or sets resource ID of the Kubernetes Environment. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets name of the Kubernetes Environment. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets resource type of the Kubernetes Environment. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs deleted file mode 100644 index 60c4a5747280..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] - public partial class LegacyMicrosoftAccount : ProxyOnlyResource - { - /// - /// Initializes a new instance of the LegacyMicrosoftAccount class. - /// - public LegacyMicrosoftAccount() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LegacyMicrosoftAccount class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public LegacyMicrosoftAccount(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), ClientRegistration registration = default(ClientRegistration), LoginScopes login = default(LoginScopes), AllowedAudiencesValidation validation = default(AllowedAudiencesValidation)) - : base(id, name, kind, type) - { - Enabled = enabled; - Registration = registration; - Login = login; - Validation = validation; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.registration")] - public ClientRegistration Registration { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.login")] - public LoginScopes Login { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.validation")] - public AllowedAudiencesValidation Validation { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs deleted file mode 100644 index 7abd94c002c7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs +++ /dev/null @@ -1,127 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Linux Java Container settings. - /// - public partial class LinuxJavaContainerSettings - { - /// - /// Initializes a new instance of the LinuxJavaContainerSettings class. - /// - public LinuxJavaContainerSettings() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LinuxJavaContainerSettings class. - /// - /// Java 11 version (runtime only). - /// Java 8 version (runtime only). - /// <code>true</code> if the stack - /// is in preview; otherwise, <code>false</code>. - /// <code>true</code> if the - /// stack is deprecated; otherwise, - /// <code>false</code>. - /// <code>true</code> if the stack - /// should be hidden; otherwise, - /// <code>false</code>. - /// End-of-life date for the minor - /// version. - /// <code>true</code> if the - /// stack version is auto-updated; otherwise, - /// <code>false</code>. - /// <code>true</code> if the - /// minor version is early-access; otherwise, - /// <code>false</code>. - public LinuxJavaContainerSettings(string java11Runtime = default(string), string java8Runtime = default(string), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) - { - Java11Runtime = java11Runtime; - Java8Runtime = java8Runtime; - IsPreview = isPreview; - IsDeprecated = isDeprecated; - IsHidden = isHidden; - EndOfLifeDate = endOfLifeDate; - IsAutoUpdate = isAutoUpdate; - IsEarlyAccess = isEarlyAccess; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets java 11 version (runtime only). - /// - [JsonProperty(PropertyName = "java11Runtime")] - public string Java11Runtime { get; private set; } - - /// - /// Gets java 8 version (runtime only). - /// - [JsonProperty(PropertyName = "java8Runtime")] - public string Java8Runtime { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is - /// in preview; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isPreview")] - public bool? IsPreview { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is - /// deprecated; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isDeprecated")] - public bool? IsDeprecated { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack - /// should be hidden; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isHidden")] - public bool? IsHidden { get; private set; } - - /// - /// Gets end-of-life date for the minor version. - /// - [JsonProperty(PropertyName = "endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack - /// version is auto-updated; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isAutoUpdate")] - public bool? IsAutoUpdate { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the minor - /// version is early-access; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isEarlyAccess")] - public bool? IsEarlyAccess { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs index b635569ca214..a4a9f849e4f9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs @@ -19,6 +19,6 @@ public static class LoadBalancingMode public const string None = "None"; public const string Web = "Web"; public const string Publishing = "Publishing"; - public const string WebPublishing = "Web, Publishing"; + public const string WebPublishing = "Web,Publishing"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkAccessControlEntry.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkAccessControlEntry.cs new file mode 100644 index 000000000000..a09d92546938 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkAccessControlEntry.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Network access control entry. + /// + public partial class NetworkAccessControlEntry + { + /// + /// Initializes a new instance of the NetworkAccessControlEntry class. + /// + public NetworkAccessControlEntry() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkAccessControlEntry class. + /// + /// Action object. Possible values include: + /// 'Permit', 'Deny' + /// Description of network access control + /// entry. + /// Order of precedence. + /// Remote subnet. + public NetworkAccessControlEntry(AccessControlEntryAction? action = default(AccessControlEntryAction?), string description = default(string), int? order = default(int?), string remoteSubnet = default(string)) + { + Action = action; + Description = description; + Order = order; + RemoteSubnet = remoteSubnet; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets action object. Possible values include: 'Permit', + /// 'Deny' + /// + [JsonProperty(PropertyName = "action")] + public AccessControlEntryAction? Action { get; set; } + + /// + /// Gets or sets description of network access control entry. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets order of precedence. + /// + [JsonProperty(PropertyName = "order")] + public int? Order { get; set; } + + /// + /// Gets or sets remote subnet. + /// + [JsonProperty(PropertyName = "remoteSubnet")] + public string RemoteSubnet { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionResource.cs similarity index 62% rename from sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs rename to sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionResource.cs index 0d506eacfa07..2785fb08e062 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionResource.cs @@ -13,28 +13,26 @@ namespace Microsoft.Azure.Management.WebSites.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Remote Private Endpoint Connection ARM resource. + /// Private Endpoint Connection ARM resource. /// [Rest.Serialization.JsonTransformation] - public partial class RemotePrivateEndpointConnectionARMResource : ProxyOnlyResource + public partial class PrivateEndpointConnectionResource : ProxyOnlyResource { /// - /// Initializes a new instance of the - /// RemotePrivateEndpointConnectionARMResource class. + /// Initializes a new instance of the PrivateEndpointConnectionResource + /// class. /// - public RemotePrivateEndpointConnectionARMResource() + public PrivateEndpointConnectionResource() { CustomInit(); } /// - /// Initializes a new instance of the - /// RemotePrivateEndpointConnectionARMResource class. + /// Initializes a new instance of the PrivateEndpointConnectionResource + /// class. /// /// Resource Id. /// Resource Name. @@ -42,15 +40,12 @@ public RemotePrivateEndpointConnectionARMResource() /// Resource type. /// PrivateEndpoint of a remote private /// endpoint connection - /// Private IPAddresses mapped to the remote - /// private endpoint - public RemotePrivateEndpointConnectionARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string provisioningState = default(string), ArmIdWrapper privateEndpoint = default(ArmIdWrapper), PrivateLinkConnectionState privateLinkServiceConnectionState = default(PrivateLinkConnectionState), IList ipAddresses = default(IList)) + public PrivateEndpointConnectionResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string provisioningState = default(string), ArmIdWrapper privateEndpoint = default(ArmIdWrapper), PrivateLinkConnectionState privateLinkServiceConnectionState = default(PrivateLinkConnectionState)) : base(id, name, kind, type) { ProvisioningState = provisioningState; PrivateEndpoint = privateEndpoint; PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; - IpAddresses = ipAddresses; CustomInit(); } @@ -76,12 +71,5 @@ public RemotePrivateEndpointConnectionARMResource() [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] public PrivateLinkConnectionState PrivateLinkServiceConnectionState { get; set; } - /// - /// Gets or sets private IPAddresses mapped to the remote private - /// endpoint - /// - [JsonProperty(PropertyName = "properties.ipAddresses")] - public IList IpAddresses { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs deleted file mode 100644 index eeffe769f026..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Result for utterances query. - /// - public partial class QueryUtterancesResult - { - /// - /// Initializes a new instance of the QueryUtterancesResult class. - /// - public QueryUtterancesResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the QueryUtterancesResult class. - /// - /// A sample utterance. - /// Score of a sample utterance. - public QueryUtterancesResult(SampleUtterance sampleUtterance = default(SampleUtterance), double? score = default(double?)) - { - SampleUtterance = sampleUtterance; - Score = score; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a sample utterance. - /// - [JsonProperty(PropertyName = "sampleUtterance")] - public SampleUtterance SampleUtterance { get; set; } - - /// - /// Gets or sets score of a sample utterance. - /// - [JsonProperty(PropertyName = "score")] - public double? Score { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs deleted file mode 100644 index 9d352753d920..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Suggested utterances where the detector can be applicable - /// - public partial class QueryUtterancesResults - { - /// - /// Initializes a new instance of the QueryUtterancesResults class. - /// - public QueryUtterancesResults() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the QueryUtterancesResults class. - /// - /// Search Query. - /// Array of utterance results for search - /// query. - public QueryUtterancesResults(string query = default(string), IList results = default(IList)) - { - Query = query; - Results = results; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets search Query. - /// - [JsonProperty(PropertyName = "query")] - public string Query { get; set; } - - /// - /// Gets or sets array of utterance results for search query. - /// - [JsonProperty(PropertyName = "results")] - public IList Results { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs index b9628aacb6f1..8080fa872330 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs @@ -30,12 +30,7 @@ public Rendering() /// Initializes a new instance of the Rendering class. /// /// Rendering Type. Possible values include: - /// 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance', - /// 'PieChart', 'DataSummary', 'Email', 'Insights', 'DynamicInsight', - /// 'Markdown', 'Detector', 'DropDown', 'Card', 'Solution', 'Guage', - /// 'Form', 'ChangeSets', 'ChangeAnalysisOnboarding', 'ChangesView', - /// 'AppInsight', 'DependencyGraph', 'DownTime', 'SummaryCard', - /// 'SearchComponent', 'AppInsightEnablement' + /// 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' /// Title of data /// Description of the data that will help it /// be interpreted @@ -54,12 +49,7 @@ public Rendering() /// /// Gets or sets rendering Type. Possible values include: 'NoGraph', - /// 'Table', 'TimeSeries', 'TimeSeriesPerInstance', 'PieChart', - /// 'DataSummary', 'Email', 'Insights', 'DynamicInsight', 'Markdown', - /// 'Detector', 'DropDown', 'Card', 'Solution', 'Guage', 'Form', - /// 'ChangeSets', 'ChangeAnalysisOnboarding', 'ChangesView', - /// 'AppInsight', 'DependencyGraph', 'DownTime', 'SummaryCard', - /// 'SearchComponent', 'AppInsightEnablement' + /// 'Table', 'TimeSeries', 'TimeSeriesPerInstance' /// [JsonProperty(PropertyName = "type")] public RenderingType? Type { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs index 727d7df75757..bf0ebdff16f5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs @@ -28,49 +28,7 @@ public enum RenderingType [EnumMember(Value = "TimeSeries")] TimeSeries, [EnumMember(Value = "TimeSeriesPerInstance")] - TimeSeriesPerInstance, - [EnumMember(Value = "PieChart")] - PieChart, - [EnumMember(Value = "DataSummary")] - DataSummary, - [EnumMember(Value = "Email")] - Email, - [EnumMember(Value = "Insights")] - Insights, - [EnumMember(Value = "DynamicInsight")] - DynamicInsight, - [EnumMember(Value = "Markdown")] - Markdown, - [EnumMember(Value = "Detector")] - Detector, - [EnumMember(Value = "DropDown")] - DropDown, - [EnumMember(Value = "Card")] - Card, - [EnumMember(Value = "Solution")] - Solution, - [EnumMember(Value = "Guage")] - Guage, - [EnumMember(Value = "Form")] - Form, - [EnumMember(Value = "ChangeSets")] - ChangeSets, - [EnumMember(Value = "ChangeAnalysisOnboarding")] - ChangeAnalysisOnboarding, - [EnumMember(Value = "ChangesView")] - ChangesView, - [EnumMember(Value = "AppInsight")] - AppInsight, - [EnumMember(Value = "DependencyGraph")] - DependencyGraph, - [EnumMember(Value = "DownTime")] - DownTime, - [EnumMember(Value = "SummaryCard")] - SummaryCard, - [EnumMember(Value = "SearchComponent")] - SearchComponent, - [EnumMember(Value = "AppInsightEnablement")] - AppInsightEnablement + TimeSeriesPerInstance } internal static class RenderingTypeEnumExtension { @@ -91,48 +49,6 @@ internal static string ToSerializedValue(this RenderingType value) return "TimeSeries"; case RenderingType.TimeSeriesPerInstance: return "TimeSeriesPerInstance"; - case RenderingType.PieChart: - return "PieChart"; - case RenderingType.DataSummary: - return "DataSummary"; - case RenderingType.Email: - return "Email"; - case RenderingType.Insights: - return "Insights"; - case RenderingType.DynamicInsight: - return "DynamicInsight"; - case RenderingType.Markdown: - return "Markdown"; - case RenderingType.Detector: - return "Detector"; - case RenderingType.DropDown: - return "DropDown"; - case RenderingType.Card: - return "Card"; - case RenderingType.Solution: - return "Solution"; - case RenderingType.Guage: - return "Guage"; - case RenderingType.Form: - return "Form"; - case RenderingType.ChangeSets: - return "ChangeSets"; - case RenderingType.ChangeAnalysisOnboarding: - return "ChangeAnalysisOnboarding"; - case RenderingType.ChangesView: - return "ChangesView"; - case RenderingType.AppInsight: - return "AppInsight"; - case RenderingType.DependencyGraph: - return "DependencyGraph"; - case RenderingType.DownTime: - return "DownTime"; - case RenderingType.SummaryCard: - return "SummaryCard"; - case RenderingType.SearchComponent: - return "SearchComponent"; - case RenderingType.AppInsightEnablement: - return "AppInsightEnablement"; } return null; } @@ -149,48 +65,6 @@ internal static string ToSerializedValue(this RenderingType value) return RenderingType.TimeSeries; case "TimeSeriesPerInstance": return RenderingType.TimeSeriesPerInstance; - case "PieChart": - return RenderingType.PieChart; - case "DataSummary": - return RenderingType.DataSummary; - case "Email": - return RenderingType.Email; - case "Insights": - return RenderingType.Insights; - case "DynamicInsight": - return RenderingType.DynamicInsight; - case "Markdown": - return RenderingType.Markdown; - case "Detector": - return RenderingType.Detector; - case "DropDown": - return RenderingType.DropDown; - case "Card": - return RenderingType.Card; - case "Solution": - return RenderingType.Solution; - case "Guage": - return RenderingType.Guage; - case "Form": - return RenderingType.Form; - case "ChangeSets": - return RenderingType.ChangeSets; - case "ChangeAnalysisOnboarding": - return RenderingType.ChangeAnalysisOnboarding; - case "ChangesView": - return RenderingType.ChangesView; - case "AppInsight": - return RenderingType.AppInsight; - case "DependencyGraph": - return RenderingType.DependencyGraph; - case "DownTime": - return RenderingType.DownTime; - case "SummaryCard": - return RenderingType.SummaryCard; - case "SearchComponent": - return RenderingType.SearchComponent; - case "AppInsightEnablement": - return RenderingType.AppInsightEnablement; } return null; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs deleted file mode 100644 index a83588884f36..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs +++ /dev/null @@ -1,114 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ResolveStatus. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum ResolveStatus - { - [EnumMember(Value = "Initialized")] - Initialized, - [EnumMember(Value = "Resolved")] - Resolved, - [EnumMember(Value = "InvalidSyntax")] - InvalidSyntax, - [EnumMember(Value = "MSINotEnabled")] - MSINotEnabled, - [EnumMember(Value = "VaultNotFound")] - VaultNotFound, - [EnumMember(Value = "SecretNotFound")] - SecretNotFound, - [EnumMember(Value = "SecretVersionNotFound")] - SecretVersionNotFound, - [EnumMember(Value = "AccessToKeyVaultDenied")] - AccessToKeyVaultDenied, - [EnumMember(Value = "OtherReasons")] - OtherReasons, - [EnumMember(Value = "FetchTimedOut")] - FetchTimedOut, - [EnumMember(Value = "UnauthorizedClient")] - UnauthorizedClient - } - internal static class ResolveStatusEnumExtension - { - internal static string ToSerializedValue(this ResolveStatus? value) - { - return value == null ? null : ((ResolveStatus)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ResolveStatus value) - { - switch( value ) - { - case ResolveStatus.Initialized: - return "Initialized"; - case ResolveStatus.Resolved: - return "Resolved"; - case ResolveStatus.InvalidSyntax: - return "InvalidSyntax"; - case ResolveStatus.MSINotEnabled: - return "MSINotEnabled"; - case ResolveStatus.VaultNotFound: - return "VaultNotFound"; - case ResolveStatus.SecretNotFound: - return "SecretNotFound"; - case ResolveStatus.SecretVersionNotFound: - return "SecretVersionNotFound"; - case ResolveStatus.AccessToKeyVaultDenied: - return "AccessToKeyVaultDenied"; - case ResolveStatus.OtherReasons: - return "OtherReasons"; - case ResolveStatus.FetchTimedOut: - return "FetchTimedOut"; - case ResolveStatus.UnauthorizedClient: - return "UnauthorizedClient"; - } - return null; - } - - internal static ResolveStatus? ParseResolveStatus(this string value) - { - switch( value ) - { - case "Initialized": - return ResolveStatus.Initialized; - case "Resolved": - return ResolveStatus.Resolved; - case "InvalidSyntax": - return ResolveStatus.InvalidSyntax; - case "MSINotEnabled": - return ResolveStatus.MSINotEnabled; - case "VaultNotFound": - return ResolveStatus.VaultNotFound; - case "SecretNotFound": - return ResolveStatus.SecretNotFound; - case "SecretVersionNotFound": - return ResolveStatus.SecretVersionNotFound; - case "AccessToKeyVaultDenied": - return ResolveStatus.AccessToKeyVaultDenied; - case "OtherReasons": - return ResolveStatus.OtherReasons; - case "FetchTimedOut": - return ResolveStatus.FetchTimedOut; - case "UnauthorizedClient": - return ResolveStatus.UnauthorizedClient; - } - return null; - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs deleted file mode 100644 index f649b929bc22..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Sample utterance. - /// - public partial class SampleUtterance - { - /// - /// Initializes a new instance of the SampleUtterance class. - /// - public SampleUtterance() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SampleUtterance class. - /// - /// Text attribute of sample utterance. - /// Links attribute of sample utterance. - /// Question id of sample utterance (for - /// stackoverflow questions titles). - public SampleUtterance(string text = default(string), IList links = default(IList), string qid = default(string)) - { - Text = text; - Links = links; - Qid = qid; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets text attribute of sample utterance. - /// - [JsonProperty(PropertyName = "text")] - public string Text { get; set; } - - /// - /// Gets or sets links attribute of sample utterance. - /// - [JsonProperty(PropertyName = "links")] - public IList Links { get; set; } - - /// - /// Gets or sets question id of sample utterance (for stackoverflow - /// questions titles). - /// - [JsonProperty(PropertyName = "qid")] - public string Qid { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs index 0fb91942b83a..5a5d96d804c3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs @@ -95,7 +95,7 @@ public Site() /// ClientCert is required. /// - ClientCertEnabled: true and ClientCertMode: Optional means /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional', 'OptionalInteractiveUser' + /// 'Required', 'Optional' /// client certificate /// authentication comma-separated exclusion paths /// <code>true</code> to @@ -132,8 +132,6 @@ public Site() /// Read-only. /// Status of the last deployment slot /// swap operation. - /// Identity to use for Key - /// Vault Reference authentication. /// HttpsOnly: configures a web site to accept /// only https requests. Issues redirect for /// http requests @@ -142,9 +140,7 @@ public Site() /// 'GeoRedundant' /// Specifies an operation id if /// this site has a pending operation. - /// Checks if Customer provided - /// storage account is required - public Site(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), string keyVaultReferenceIdentity = default(string), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), bool? storageAccountRequired = default(bool?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + public Site(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) : base(location, id, name, kind, type, tags) { State = state; @@ -182,11 +178,9 @@ public Site() IsDefaultContainer = isDefaultContainer; DefaultHostName = defaultHostName; SlotSwapStatus = slotSwapStatus; - KeyVaultReferenceIdentity = keyVaultReferenceIdentity; HttpsOnly = httpsOnly; RedundancyMode = redundancyMode; InProgressOperationId = inProgressOperationId; - StorageAccountRequired = storageAccountRequired; Identity = identity; CustomInit(); } @@ -350,7 +344,7 @@ public Site() /// ClientCert is required. /// - ClientCertEnabled: true and ClientCertMode: Optional means /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional', 'OptionalInteractiveUser' + /// 'Required', 'Optional' /// [JsonProperty(PropertyName = "properties.clientCertMode")] public ClientCertMode? ClientCertMode { get; set; } @@ -455,13 +449,6 @@ public Site() [JsonProperty(PropertyName = "properties.slotSwapStatus")] public SlotSwapStatus SlotSwapStatus { get; private set; } - /// - /// Gets or sets identity to use for Key Vault Reference - /// authentication. - /// - [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] - public string KeyVaultReferenceIdentity { get; set; } - /// /// Gets or sets httpsOnly: configures a web site to accept only https /// requests. Issues redirect for @@ -484,13 +471,6 @@ public Site() [JsonProperty(PropertyName = "properties.inProgressOperationId")] public System.Guid? InProgressOperationId { get; private set; } - /// - /// Gets or sets checks if Customer provided storage account is - /// required - /// - [JsonProperty(PropertyName = "properties.storageAccountRequired")] - public bool? StorageAccountRequired { get; set; } - /// /// [JsonProperty(PropertyName = "identity")] diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs index 211394661964..a87bf293faac 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs @@ -46,10 +46,6 @@ public SiteAuthSettings() /// Authentication / Authorization feature in use for the current app. /// The setting in this value can control the behavior of certain /// features in the Authentication / Authorization module. - /// The ConfigVersion of the Authentication - /// / Authorization feature in use for the current app. - /// The setting in this value can control the behavior of the control - /// plane for Authentication / Authorization. /// The action to take when /// an unauthenticated client attempts to access the app. Possible /// values include: 'RedirectToLoginPage', 'AllowAnonymous' @@ -209,12 +205,11 @@ public SiteAuthSettings() /// auth settings. /// If the path is relative, base will the site's root /// directory. - public SiteAuthSettings(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), string runtimeVersion = default(string), string configVersion = default(string), UnauthenticatedClientAction? unauthenticatedClientAction = default(UnauthenticatedClientAction?), bool? tokenStoreEnabled = default(bool?), IList allowedExternalRedirectUrls = default(IList), BuiltInAuthenticationProvider? defaultProvider = default(BuiltInAuthenticationProvider?), double? tokenRefreshExtensionHours = default(double?), string clientId = default(string), string clientSecret = default(string), string clientSecretSettingName = default(string), string clientSecretCertificateThumbprint = default(string), string issuer = default(string), bool? validateIssuer = default(bool?), IList allowedAudiences = default(IList), IList additionalLoginParams = default(IList), string aadClaimsAuthorization = default(string), string googleClientId = default(string), string googleClientSecret = default(string), string googleClientSecretSettingName = default(string), IList googleOAuthScopes = default(IList), string facebookAppId = default(string), string facebookAppSecret = default(string), string facebookAppSecretSettingName = default(string), IList facebookOAuthScopes = default(IList), string gitHubClientId = default(string), string gitHubClientSecret = default(string), string gitHubClientSecretSettingName = default(string), IList gitHubOAuthScopes = default(IList), string twitterConsumerKey = default(string), string twitterConsumerSecret = default(string), string twitterConsumerSecretSettingName = default(string), string microsoftAccountClientId = default(string), string microsoftAccountClientSecret = default(string), string microsoftAccountClientSecretSettingName = default(string), IList microsoftAccountOAuthScopes = default(IList), string isAuthFromFile = default(string), string authFilePath = default(string)) + public SiteAuthSettings(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), string runtimeVersion = default(string), UnauthenticatedClientAction? unauthenticatedClientAction = default(UnauthenticatedClientAction?), bool? tokenStoreEnabled = default(bool?), IList allowedExternalRedirectUrls = default(IList), BuiltInAuthenticationProvider? defaultProvider = default(BuiltInAuthenticationProvider?), double? tokenRefreshExtensionHours = default(double?), string clientId = default(string), string clientSecret = default(string), string clientSecretSettingName = default(string), string clientSecretCertificateThumbprint = default(string), string issuer = default(string), bool? validateIssuer = default(bool?), IList allowedAudiences = default(IList), IList additionalLoginParams = default(IList), string aadClaimsAuthorization = default(string), string googleClientId = default(string), string googleClientSecret = default(string), string googleClientSecretSettingName = default(string), IList googleOAuthScopes = default(IList), string facebookAppId = default(string), string facebookAppSecret = default(string), string facebookAppSecretSettingName = default(string), IList facebookOAuthScopes = default(IList), string gitHubClientId = default(string), string gitHubClientSecret = default(string), string gitHubClientSecretSettingName = default(string), IList gitHubOAuthScopes = default(IList), string twitterConsumerKey = default(string), string twitterConsumerSecret = default(string), string twitterConsumerSecretSettingName = default(string), string microsoftAccountClientId = default(string), string microsoftAccountClientSecret = default(string), string microsoftAccountClientSecretSettingName = default(string), IList microsoftAccountOAuthScopes = default(IList), string isAuthFromFile = default(string), string authFilePath = default(string)) : base(id, name, kind, type) { Enabled = enabled; RuntimeVersion = runtimeVersion; - ConfigVersion = configVersion; UnauthenticatedClientAction = unauthenticatedClientAction; TokenStoreEnabled = tokenStoreEnabled; AllowedExternalRedirectUrls = allowedExternalRedirectUrls; @@ -275,15 +270,6 @@ public SiteAuthSettings() [JsonProperty(PropertyName = "properties.runtimeVersion")] public string RuntimeVersion { get; set; } - /// - /// Gets or sets the ConfigVersion of the Authentication / - /// Authorization feature in use for the current app. - /// The setting in this value can control the behavior of the control - /// plane for Authentication / Authorization. - /// - [JsonProperty(PropertyName = "properties.configVersion")] - public string ConfigVersion { get; set; } - /// /// Gets or sets the action to take when an unauthenticated client /// attempts to access the app. Possible values include: diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs index eff84b23c039..09a72225be37 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs @@ -64,8 +64,6 @@ public SiteConfig() /// <code>false</code>. /// Publishing user name. /// Application settings. - /// List of Azure Storage - /// Accounts. /// Connection strings. /// Site MachineKey. /// Handler mappings. @@ -91,8 +89,7 @@ public SiteConfig() /// Virtual applications. /// Site load balancing. Possible values /// include: 'WeightedRoundRobin', 'LeastRequests', - /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash', - /// 'PerSiteRoundRobin' + /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' /// This is work around for polymorphic /// types. /// Site limits. @@ -101,12 +98,6 @@ public SiteConfig() /// Auto Heal rules. /// Tracing options. /// Virtual Network name. - /// Virtual Network Route All - /// enabled. This causes all outbound traffic to have Virtual Network - /// Security Groups and User Defined Routes applied. - /// The number of private ports - /// assigned to this app. These will be assigned dynamically on - /// runtime. /// Cross-Origin Resource Sharing (CORS) /// settings. /// Push endpoint settings. @@ -122,8 +113,6 @@ public SiteConfig() /// Id /// Explicit Managed Service /// Identity Id - /// Identity to use for Key - /// Vault Reference authentication. /// IP security restrictions for /// main. /// IP security restrictions @@ -135,38 +124,13 @@ public SiteConfig() /// MinTlsVersion: configures the minimum /// version of TLS required for SSL requests. Possible values include: /// '1.0', '1.1', '1.2' - /// ScmMinTlsVersion: configures the - /// minimum version of TLS required for SSL requests for SCM site. - /// Possible values include: '1.0', '1.1', '1.2' /// State of FTP / FTPS service. Possible /// values include: 'AllAllowed', 'FtpsOnly', 'Disabled' /// Number of preWarmed instances. /// This setting only applies to the Consumption and Elastic /// Plans - /// Maximum number of workers that - /// a site can scale out to. - /// This setting only applies to the Consumption and Elastic Premium - /// Plans /// Health check path - /// Gets or sets a - /// value indicating whether functions runtime scale monitoring is - /// enabled. When enabled, - /// the ScaleController will not monitor event sources directly, but - /// will instead call to the - /// runtime to get scale status. - /// Sets the time zone a site uses for - /// generating timestamps. Compatible with Linux and Windows App - /// Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence - /// over this config. For Linux, expects tz database values - /// https://www.iana.org/time-zones (for a quick reference see - /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For - /// Windows, expects one of the time zones listed under - /// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows - /// NT\CurrentVersion\Time Zones - /// Number of minimum - /// instance count for a site - /// This setting only applies to the Elastic Plans - public SiteConfig(int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IDictionary azureStorageAccounts = default(IDictionary), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), bool? vnetRouteAllEnabled = default(bool?), int? vnetPrivatePortsCount = default(int?), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), string keyVaultReferenceIdentity = default(string), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string scmMinTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), int? functionAppScaleLimit = default(int?), string healthCheckPath = default(string), bool? functionsRuntimeScaleMonitoringEnabled = default(bool?), string websiteTimeZone = default(string), int? minimumElasticInstanceCount = default(int?)) + public SiteConfig(int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), string healthCheckPath = default(string)) { NumberOfWorkers = numberOfWorkers; DefaultDocuments = defaultDocuments; @@ -186,7 +150,6 @@ public SiteConfig() DetailedErrorLoggingEnabled = detailedErrorLoggingEnabled; PublishingUsername = publishingUsername; AppSettings = appSettings; - AzureStorageAccounts = azureStorageAccounts; ConnectionStrings = connectionStrings; MachineKey = machineKey; HandlerMappings = handlerMappings; @@ -208,8 +171,6 @@ public SiteConfig() AutoHealRules = autoHealRules; TracingOptions = tracingOptions; VnetName = vnetName; - VnetRouteAllEnabled = vnetRouteAllEnabled; - VnetPrivatePortsCount = vnetPrivatePortsCount; Cors = cors; Push = push; ApiDefinition = apiDefinition; @@ -218,20 +179,14 @@ public SiteConfig() LocalMySqlEnabled = localMySqlEnabled; ManagedServiceIdentityId = managedServiceIdentityId; XManagedServiceIdentityId = xManagedServiceIdentityId; - KeyVaultReferenceIdentity = keyVaultReferenceIdentity; IpSecurityRestrictions = ipSecurityRestrictions; ScmIpSecurityRestrictions = scmIpSecurityRestrictions; ScmIpSecurityRestrictionsUseMain = scmIpSecurityRestrictionsUseMain; Http20Enabled = http20Enabled; MinTlsVersion = minTlsVersion; - ScmMinTlsVersion = scmMinTlsVersion; FtpsState = ftpsState; PreWarmedInstanceCount = preWarmedInstanceCount; - FunctionAppScaleLimit = functionAppScaleLimit; HealthCheckPath = healthCheckPath; - FunctionsRuntimeScaleMonitoringEnabled = functionsRuntimeScaleMonitoringEnabled; - WebsiteTimeZone = websiteTimeZone; - MinimumElasticInstanceCount = minimumElasticInstanceCount; CustomInit(); } @@ -356,12 +311,6 @@ public SiteConfig() [JsonProperty(PropertyName = "appSettings")] public IList AppSettings { get; set; } - /// - /// Gets or sets list of Azure Storage Accounts. - /// - [JsonProperty(PropertyName = "azureStorageAccounts")] - public IDictionary AzureStorageAccounts { get; set; } - /// /// Gets or sets connection strings. /// @@ -459,7 +408,7 @@ public SiteConfig() /// /// Gets or sets site load balancing. Possible values include: /// 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - /// 'WeightedTotalTraffic', 'RequestHash', 'PerSiteRoundRobin' + /// 'WeightedTotalTraffic', 'RequestHash' /// [JsonProperty(PropertyName = "loadBalancing")] public SiteLoadBalancing? LoadBalancing { get; set; } @@ -502,21 +451,6 @@ public SiteConfig() [JsonProperty(PropertyName = "vnetName")] public string VnetName { get; set; } - /// - /// Gets or sets virtual Network Route All enabled. This causes all - /// outbound traffic to have Virtual Network Security Groups and User - /// Defined Routes applied. - /// - [JsonProperty(PropertyName = "vnetRouteAllEnabled")] - public bool? VnetRouteAllEnabled { get; set; } - - /// - /// Gets or sets the number of private ports assigned to this app. - /// These will be assigned dynamically on runtime. - /// - [JsonProperty(PropertyName = "vnetPrivatePortsCount")] - public int? VnetPrivatePortsCount { get; set; } - /// /// Gets or sets cross-Origin Resource Sharing (CORS) settings. /// @@ -568,13 +502,6 @@ public SiteConfig() [JsonProperty(PropertyName = "xManagedServiceIdentityId")] public int? XManagedServiceIdentityId { get; set; } - /// - /// Gets or sets identity to use for Key Vault Reference - /// authentication. - /// - [JsonProperty(PropertyName = "keyVaultReferenceIdentity")] - public string KeyVaultReferenceIdentity { get; set; } - /// /// Gets or sets IP security restrictions for main. /// @@ -608,14 +535,6 @@ public SiteConfig() [JsonProperty(PropertyName = "minTlsVersion")] public string MinTlsVersion { get; set; } - /// - /// Gets or sets scmMinTlsVersion: configures the minimum version of - /// TLS required for SSL requests for SCM site. Possible values - /// include: '1.0', '1.1', '1.2' - /// - [JsonProperty(PropertyName = "scmMinTlsVersion")] - public string ScmMinTlsVersion { get; set; } - /// /// Gets or sets state of FTP / FTPS service. Possible values include: /// 'AllAllowed', 'FtpsOnly', 'Disabled' @@ -630,52 +549,12 @@ public SiteConfig() [JsonProperty(PropertyName = "preWarmedInstanceCount")] public int? PreWarmedInstanceCount { get; set; } - /// - /// Gets or sets maximum number of workers that a site can scale out - /// to. - /// This setting only applies to the Consumption and Elastic Premium - /// Plans - /// - [JsonProperty(PropertyName = "functionAppScaleLimit")] - public int? FunctionAppScaleLimit { get; set; } - /// /// Gets or sets health check path /// [JsonProperty(PropertyName = "healthCheckPath")] public string HealthCheckPath { get; set; } - /// - /// Gets or sets a value indicating whether functions runtime scale - /// monitoring is enabled. When enabled, - /// the ScaleController will not monitor event sources directly, but - /// will instead call to the - /// runtime to get scale status. - /// - [JsonProperty(PropertyName = "functionsRuntimeScaleMonitoringEnabled")] - public bool? FunctionsRuntimeScaleMonitoringEnabled { get; set; } - - /// - /// Gets or sets sets the time zone a site uses for generating - /// timestamps. Compatible with Linux and Windows App Service. Setting - /// the WEBSITE_TIME_ZONE app setting takes precedence over this - /// config. For Linux, expects tz database values - /// https://www.iana.org/time-zones (for a quick reference see - /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For - /// Windows, expects one of the time zones listed under - /// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows - /// NT\CurrentVersion\Time Zones - /// - [JsonProperty(PropertyName = "websiteTimeZone")] - public string WebsiteTimeZone { get; set; } - - /// - /// Gets or sets number of minimum instance count for a site - /// This setting only applies to the Elastic Plans - /// - [JsonProperty(PropertyName = "minimumElasticInstanceCount")] - public int? MinimumElasticInstanceCount { get; set; } - /// /// Validate the object. /// @@ -696,18 +575,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "PreWarmedInstanceCount", 0); } - if (FunctionAppScaleLimit < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "FunctionAppScaleLimit", 0); - } - if (MinimumElasticInstanceCount > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MinimumElasticInstanceCount", 20); - } - if (MinimumElasticInstanceCount < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MinimumElasticInstanceCount", 0); - } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs deleted file mode 100644 index d331ddb6de0e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs +++ /dev/null @@ -1,84 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Site config properties dictionary. - /// - public partial class SiteConfigPropertiesDictionary - { - /// - /// Initializes a new instance of the SiteConfigPropertiesDictionary - /// class. - /// - public SiteConfigPropertiesDictionary() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SiteConfigPropertiesDictionary - /// class. - /// - /// <code>true</code> - /// if use32BitWorkerProcess should be set to true for the stack; - /// otherwise, <code>false</code>. - /// LinuxFxVersion configuration - /// setting. - /// JavaVersion configuration - /// setting. - /// PowerShellVersion configuration - /// setting. - public SiteConfigPropertiesDictionary(bool? use32BitWorkerProcess = default(bool?), string linuxFxVersion = default(string), string javaVersion = default(string), string powerShellVersion = default(string)) - { - Use32BitWorkerProcess = use32BitWorkerProcess; - LinuxFxVersion = linuxFxVersion; - JavaVersion = javaVersion; - PowerShellVersion = powerShellVersion; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if - /// use32BitWorkerProcess should be set to true for the stack; - /// otherwise, &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "use32BitWorkerProcess")] - public bool? Use32BitWorkerProcess { get; private set; } - - /// - /// Gets linuxFxVersion configuration setting. - /// - [JsonProperty(PropertyName = "linuxFxVersion")] - public string LinuxFxVersion { get; private set; } - - /// - /// Gets javaVersion configuration setting. - /// - [JsonProperty(PropertyName = "javaVersion")] - public string JavaVersion { get; private set; } - - /// - /// Gets powerShellVersion configuration setting. - /// - [JsonProperty(PropertyName = "powerShellVersion")] - public string PowerShellVersion { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs index 67383d2060fc..c51daa41c62e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs @@ -70,8 +70,6 @@ public SiteConfigResource() /// <code>false</code>. /// Publishing user name. /// Application settings. - /// List of Azure Storage - /// Accounts. /// Connection strings. /// Site MachineKey. /// Handler mappings. @@ -97,8 +95,7 @@ public SiteConfigResource() /// Virtual applications. /// Site load balancing. Possible values /// include: 'WeightedRoundRobin', 'LeastRequests', - /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash', - /// 'PerSiteRoundRobin' + /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' /// This is work around for polymorphic /// types. /// Site limits. @@ -107,12 +104,6 @@ public SiteConfigResource() /// Auto Heal rules. /// Tracing options. /// Virtual Network name. - /// Virtual Network Route All - /// enabled. This causes all outbound traffic to have Virtual Network - /// Security Groups and User Defined Routes applied. - /// The number of private ports - /// assigned to this app. These will be assigned dynamically on - /// runtime. /// Cross-Origin Resource Sharing (CORS) /// settings. /// Push endpoint settings. @@ -128,8 +119,6 @@ public SiteConfigResource() /// Id /// Explicit Managed Service /// Identity Id - /// Identity to use for Key - /// Vault Reference authentication. /// IP security restrictions for /// main. /// IP security restrictions @@ -141,38 +130,13 @@ public SiteConfigResource() /// MinTlsVersion: configures the minimum /// version of TLS required for SSL requests. Possible values include: /// '1.0', '1.1', '1.2' - /// ScmMinTlsVersion: configures the - /// minimum version of TLS required for SSL requests for SCM site. - /// Possible values include: '1.0', '1.1', '1.2' /// State of FTP / FTPS service. Possible /// values include: 'AllAllowed', 'FtpsOnly', 'Disabled' /// Number of preWarmed instances. /// This setting only applies to the Consumption and Elastic /// Plans - /// Maximum number of workers that - /// a site can scale out to. - /// This setting only applies to the Consumption and Elastic Premium - /// Plans /// Health check path - /// Gets or sets a - /// value indicating whether functions runtime scale monitoring is - /// enabled. When enabled, - /// the ScaleController will not monitor event sources directly, but - /// will instead call to the - /// runtime to get scale status. - /// Sets the time zone a site uses for - /// generating timestamps. Compatible with Linux and Windows App - /// Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence - /// over this config. For Linux, expects tz database values - /// https://www.iana.org/time-zones (for a quick reference see - /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For - /// Windows, expects one of the time zones listed under - /// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows - /// NT\CurrentVersion\Time Zones - /// Number of minimum - /// instance count for a site - /// This setting only applies to the Elastic Plans - public SiteConfigResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IDictionary azureStorageAccounts = default(IDictionary), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), bool? vnetRouteAllEnabled = default(bool?), int? vnetPrivatePortsCount = default(int?), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), string keyVaultReferenceIdentity = default(string), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string scmMinTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), int? functionAppScaleLimit = default(int?), string healthCheckPath = default(string), bool? functionsRuntimeScaleMonitoringEnabled = default(bool?), string websiteTimeZone = default(string), int? minimumElasticInstanceCount = default(int?)) + public SiteConfigResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), string healthCheckPath = default(string)) : base(id, name, kind, type) { NumberOfWorkers = numberOfWorkers; @@ -193,7 +157,6 @@ public SiteConfigResource() DetailedErrorLoggingEnabled = detailedErrorLoggingEnabled; PublishingUsername = publishingUsername; AppSettings = appSettings; - AzureStorageAccounts = azureStorageAccounts; ConnectionStrings = connectionStrings; MachineKey = machineKey; HandlerMappings = handlerMappings; @@ -215,8 +178,6 @@ public SiteConfigResource() AutoHealRules = autoHealRules; TracingOptions = tracingOptions; VnetName = vnetName; - VnetRouteAllEnabled = vnetRouteAllEnabled; - VnetPrivatePortsCount = vnetPrivatePortsCount; Cors = cors; Push = push; ApiDefinition = apiDefinition; @@ -225,20 +186,14 @@ public SiteConfigResource() LocalMySqlEnabled = localMySqlEnabled; ManagedServiceIdentityId = managedServiceIdentityId; XManagedServiceIdentityId = xManagedServiceIdentityId; - KeyVaultReferenceIdentity = keyVaultReferenceIdentity; IpSecurityRestrictions = ipSecurityRestrictions; ScmIpSecurityRestrictions = scmIpSecurityRestrictions; ScmIpSecurityRestrictionsUseMain = scmIpSecurityRestrictionsUseMain; Http20Enabled = http20Enabled; MinTlsVersion = minTlsVersion; - ScmMinTlsVersion = scmMinTlsVersion; FtpsState = ftpsState; PreWarmedInstanceCount = preWarmedInstanceCount; - FunctionAppScaleLimit = functionAppScaleLimit; HealthCheckPath = healthCheckPath; - FunctionsRuntimeScaleMonitoringEnabled = functionsRuntimeScaleMonitoringEnabled; - WebsiteTimeZone = websiteTimeZone; - MinimumElasticInstanceCount = minimumElasticInstanceCount; CustomInit(); } @@ -363,12 +318,6 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.appSettings")] public IList AppSettings { get; set; } - /// - /// Gets or sets list of Azure Storage Accounts. - /// - [JsonProperty(PropertyName = "properties.azureStorageAccounts")] - public IDictionary AzureStorageAccounts { get; set; } - /// /// Gets or sets connection strings. /// @@ -466,7 +415,7 @@ public SiteConfigResource() /// /// Gets or sets site load balancing. Possible values include: /// 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - /// 'WeightedTotalTraffic', 'RequestHash', 'PerSiteRoundRobin' + /// 'WeightedTotalTraffic', 'RequestHash' /// [JsonProperty(PropertyName = "properties.loadBalancing")] public SiteLoadBalancing? LoadBalancing { get; set; } @@ -509,21 +458,6 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.vnetName")] public string VnetName { get; set; } - /// - /// Gets or sets virtual Network Route All enabled. This causes all - /// outbound traffic to have Virtual Network Security Groups and User - /// Defined Routes applied. - /// - [JsonProperty(PropertyName = "properties.vnetRouteAllEnabled")] - public bool? VnetRouteAllEnabled { get; set; } - - /// - /// Gets or sets the number of private ports assigned to this app. - /// These will be assigned dynamically on runtime. - /// - [JsonProperty(PropertyName = "properties.vnetPrivatePortsCount")] - public int? VnetPrivatePortsCount { get; set; } - /// /// Gets or sets cross-Origin Resource Sharing (CORS) settings. /// @@ -575,13 +509,6 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.xManagedServiceIdentityId")] public int? XManagedServiceIdentityId { get; set; } - /// - /// Gets or sets identity to use for Key Vault Reference - /// authentication. - /// - [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] - public string KeyVaultReferenceIdentity { get; set; } - /// /// Gets or sets IP security restrictions for main. /// @@ -615,14 +542,6 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.minTlsVersion")] public string MinTlsVersion { get; set; } - /// - /// Gets or sets scmMinTlsVersion: configures the minimum version of - /// TLS required for SSL requests for SCM site. Possible values - /// include: '1.0', '1.1', '1.2' - /// - [JsonProperty(PropertyName = "properties.scmMinTlsVersion")] - public string ScmMinTlsVersion { get; set; } - /// /// Gets or sets state of FTP / FTPS service. Possible values include: /// 'AllAllowed', 'FtpsOnly', 'Disabled' @@ -637,52 +556,12 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.preWarmedInstanceCount")] public int? PreWarmedInstanceCount { get; set; } - /// - /// Gets or sets maximum number of workers that a site can scale out - /// to. - /// This setting only applies to the Consumption and Elastic Premium - /// Plans - /// - [JsonProperty(PropertyName = "properties.functionAppScaleLimit")] - public int? FunctionAppScaleLimit { get; set; } - /// /// Gets or sets health check path /// [JsonProperty(PropertyName = "properties.healthCheckPath")] public string HealthCheckPath { get; set; } - /// - /// Gets or sets a value indicating whether functions runtime scale - /// monitoring is enabled. When enabled, - /// the ScaleController will not monitor event sources directly, but - /// will instead call to the - /// runtime to get scale status. - /// - [JsonProperty(PropertyName = "properties.functionsRuntimeScaleMonitoringEnabled")] - public bool? FunctionsRuntimeScaleMonitoringEnabled { get; set; } - - /// - /// Gets or sets sets the time zone a site uses for generating - /// timestamps. Compatible with Linux and Windows App Service. Setting - /// the WEBSITE_TIME_ZONE app setting takes precedence over this - /// config. For Linux, expects tz database values - /// https://www.iana.org/time-zones (for a quick reference see - /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For - /// Windows, expects one of the time zones listed under - /// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows - /// NT\CurrentVersion\Time Zones - /// - [JsonProperty(PropertyName = "properties.websiteTimeZone")] - public string WebsiteTimeZone { get; set; } - - /// - /// Gets or sets number of minimum instance count for a site - /// This setting only applies to the Elastic Plans - /// - [JsonProperty(PropertyName = "properties.minimumElasticInstanceCount")] - public int? MinimumElasticInstanceCount { get; set; } - /// /// Validate the object. /// @@ -703,18 +582,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "PreWarmedInstanceCount", 0); } - if (FunctionAppScaleLimit < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "FunctionAppScaleLimit", 0); - } - if (MinimumElasticInstanceCount > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MinimumElasticInstanceCount", 20); - } - if (MinimumElasticInstanceCount < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MinimumElasticInstanceCount", 0); - } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs index 8b93ae4f1798..f7bae36f84b6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs @@ -30,9 +30,7 @@ public enum SiteLoadBalancing [EnumMember(Value = "WeightedTotalTraffic")] WeightedTotalTraffic, [EnumMember(Value = "RequestHash")] - RequestHash, - [EnumMember(Value = "PerSiteRoundRobin")] - PerSiteRoundRobin + RequestHash } internal static class SiteLoadBalancingEnumExtension { @@ -55,8 +53,6 @@ internal static string ToSerializedValue(this SiteLoadBalancing value) return "WeightedTotalTraffic"; case SiteLoadBalancing.RequestHash: return "RequestHash"; - case SiteLoadBalancing.PerSiteRoundRobin: - return "PerSiteRoundRobin"; } return null; } @@ -75,8 +71,6 @@ internal static string ToSerializedValue(this SiteLoadBalancing value) return SiteLoadBalancing.WeightedTotalTraffic; case "RequestHash": return SiteLoadBalancing.RequestHash; - case "PerSiteRoundRobin": - return SiteLoadBalancing.PerSiteRoundRobin; } return null; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs index c183d9977fa6..567a5fb54af7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs @@ -93,7 +93,7 @@ public SitePatchResource() /// ClientCert is required. /// - ClientCertEnabled: true and ClientCertMode: Optional means /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional', 'OptionalInteractiveUser' + /// 'Required', 'Optional' /// client certificate /// authentication comma-separated exclusion paths /// <code>true</code> to @@ -130,8 +130,6 @@ public SitePatchResource() /// Read-only. /// Status of the last deployment slot /// swap operation. - /// Identity to use for Key - /// Vault Reference authentication. /// HttpsOnly: configures a web site to accept /// only https requests. Issues redirect for /// http requests @@ -140,9 +138,7 @@ public SitePatchResource() /// 'GeoRedundant' /// Specifies an operation id if /// this site has a pending operation. - /// Checks if Customer provided - /// storage account is required - public SitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), string keyVaultReferenceIdentity = default(string), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), bool? storageAccountRequired = default(bool?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + public SitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) : base(id, name, kind, type) { State = state; @@ -180,11 +176,9 @@ public SitePatchResource() IsDefaultContainer = isDefaultContainer; DefaultHostName = defaultHostName; SlotSwapStatus = slotSwapStatus; - KeyVaultReferenceIdentity = keyVaultReferenceIdentity; HttpsOnly = httpsOnly; RedundancyMode = redundancyMode; InProgressOperationId = inProgressOperationId; - StorageAccountRequired = storageAccountRequired; Identity = identity; CustomInit(); } @@ -348,7 +342,7 @@ public SitePatchResource() /// ClientCert is required. /// - ClientCertEnabled: true and ClientCertMode: Optional means /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional', 'OptionalInteractiveUser' + /// 'Required', 'Optional' /// [JsonProperty(PropertyName = "properties.clientCertMode")] public ClientCertMode? ClientCertMode { get; set; } @@ -453,13 +447,6 @@ public SitePatchResource() [JsonProperty(PropertyName = "properties.slotSwapStatus")] public SlotSwapStatus SlotSwapStatus { get; private set; } - /// - /// Gets or sets identity to use for Key Vault Reference - /// authentication. - /// - [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] - public string KeyVaultReferenceIdentity { get; set; } - /// /// Gets or sets httpsOnly: configures a web site to accept only https /// requests. Issues redirect for @@ -482,13 +469,6 @@ public SitePatchResource() [JsonProperty(PropertyName = "properties.inProgressOperationId")] public System.Guid? InProgressOperationId { get; private set; } - /// - /// Gets or sets checks if Customer provided storage account is - /// required - /// - [JsonProperty(PropertyName = "properties.storageAccountRequired")] - public bool? StorageAccountRequired { get; set; } - /// /// [JsonProperty(PropertyName = "identity")] diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs index 5cd75347d76b..c2544d5f558f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs @@ -51,9 +51,7 @@ public SiteSourceControl() /// <code>true</code> for a /// Mercurial repository; <code>false</code> for a Git /// repository. - /// If GitHub Action is - /// selected, than the associated configuration. - public SiteSourceControl(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repoUrl = default(string), string branch = default(string), bool? isManualIntegration = default(bool?), bool? isGitHubAction = default(bool?), bool? deploymentRollbackEnabled = default(bool?), bool? isMercurial = default(bool?), GitHubActionConfiguration gitHubActionConfiguration = default(GitHubActionConfiguration)) + public SiteSourceControl(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repoUrl = default(string), string branch = default(string), bool? isManualIntegration = default(bool?), bool? isGitHubAction = default(bool?), bool? deploymentRollbackEnabled = default(bool?), bool? isMercurial = default(bool?)) : base(id, name, kind, type) { RepoUrl = repoUrl; @@ -62,7 +60,6 @@ public SiteSourceControl() IsGitHubAction = isGitHubAction; DeploymentRollbackEnabled = deploymentRollbackEnabled; IsMercurial = isMercurial; - GitHubActionConfiguration = gitHubActionConfiguration; CustomInit(); } @@ -117,12 +114,5 @@ public SiteSourceControl() [JsonProperty(PropertyName = "properties.isMercurial")] public bool? IsMercurial { get; set; } - /// - /// Gets or sets if GitHub Action is selected, than the associated - /// configuration. - /// - [JsonProperty(PropertyName = "properties.gitHubActionConfiguration")] - public GitHubActionConfiguration GitHubActionConfiguration { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs index 47052f28752b..87d1de6bc667 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs @@ -32,20 +32,17 @@ public SkuCapacity() /// Minimum number of workers for this App /// Service plan SKU. /// Maximum number of workers for this App - /// Service plan SKU. + /// Service plan SKU. /// Default number of workers for this /// App Service plan SKU. /// Available scale configurations for an App /// Service plan. - /// Maximum number of Elastic workers for - /// this App Service plan SKU. - public SkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string), int? elasticMaximum = default(int?)) + public SkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string)) { Minimum = minimum; Maximum = maximum; DefaultProperty = defaultProperty; ScaleType = scaleType; - ElasticMaximum = elasticMaximum; CustomInit(); } @@ -82,12 +79,5 @@ public SkuCapacity() [JsonProperty(PropertyName = "scaleType")] public string ScaleType { get; set; } - /// - /// Gets or sets maximum number of Elastic workers for this App Service - /// plan SKU. - /// - [JsonProperty(PropertyName = "elasticMaximum")] - public int? ElasticMaximum { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs index a3a68be1409f..a990199a9a26 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs @@ -23,10 +23,7 @@ public static class SkuName public const string Premium = "Premium"; public const string Dynamic = "Dynamic"; public const string Isolated = "Isolated"; - public const string IsolatedV2 = "IsolatedV2"; public const string PremiumV2 = "PremiumV2"; - public const string PremiumV3 = "PremiumV3"; - public const string PremiumContainer = "PremiumContainer"; public const string ElasticPremium = "ElasticPremium"; public const string ElasticIsolated = "ElasticIsolated"; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs index 88631d932caf..72d2b4cc304e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs @@ -32,13 +32,11 @@ public SlowRequestsBasedTrigger() /// Time taken. /// Request Count. /// Time interval. - /// Request Path. - public SlowRequestsBasedTrigger(string timeTaken = default(string), int? count = default(int?), string timeInterval = default(string), string path = default(string)) + public SlowRequestsBasedTrigger(string timeTaken = default(string), int? count = default(int?), string timeInterval = default(string)) { TimeTaken = timeTaken; Count = count; TimeInterval = timeInterval; - Path = path; CustomInit(); } @@ -65,11 +63,5 @@ public SlowRequestsBasedTrigger() [JsonProperty(PropertyName = "timeInterval")] public string TimeInterval { get; set; } - /// - /// Gets or sets request Path. - /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs index 29cbddbf0be6..4bc2716c9e59 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs @@ -50,20 +50,8 @@ public StackMajorVersion() /// <code>false</code>. /// <code>true</code> if this stack /// should be hidden for new customers on portal, otherwise - /// <code>false</code>. - /// <appSettings> - /// <appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" /> - /// </appSettings> - /// Example: All the function apps need AppSetting: - /// "FUNCTIONS_WORKER_RUNTIME" to be set stack name - /// <siteConfigProperties> - /// <siteConfigProperty name="Use32BitWorkerProcess" value="false" - /// /> - /// </siteConfigProperties> - /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be - /// set to 0 - public StackMajorVersion(string displayVersion = default(string), string runtimeVersion = default(string), bool? isDefault = default(bool?), IList minorVersions = default(IList), bool? applicationInsights = default(bool?), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), IDictionary appSettingsDictionary = default(IDictionary), IDictionary siteConfigPropertiesDictionary = default(IDictionary)) + /// <code>false</code>. + public StackMajorVersion(string displayVersion = default(string), string runtimeVersion = default(string), bool? isDefault = default(bool?), IList minorVersions = default(IList), bool? applicationInsights = default(bool?), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?)) { DisplayVersion = displayVersion; RuntimeVersion = runtimeVersion; @@ -73,8 +61,6 @@ public StackMajorVersion() IsPreview = isPreview; IsDeprecated = isDeprecated; IsHidden = isHidden; - AppSettingsDictionary = appSettingsDictionary; - SiteConfigPropertiesDictionary = siteConfigPropertiesDictionary; CustomInit(); } @@ -141,27 +127,5 @@ public StackMajorVersion() [JsonProperty(PropertyName = "isHidden")] public bool? IsHidden { get; set; } - /// - /// Gets or sets &lt;appSettings&gt; - /// &lt;appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" - /// /&gt; - /// &lt;/appSettings&gt; - /// Example: All the function apps need AppSetting: - /// "FUNCTIONS_WORKER_RUNTIME" to be set stack name - /// - [JsonProperty(PropertyName = "appSettingsDictionary")] - public IDictionary AppSettingsDictionary { get; set; } - - /// - /// Gets or sets &lt;siteConfigProperties&gt; - /// &lt;siteConfigProperty name="Use32BitWorkerProcess" - /// value="false" /&gt; - /// &lt;/siteConfigProperties&gt; - /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be - /// set to 0 - /// - [JsonProperty(PropertyName = "siteConfigPropertiesDictionary")] - public IDictionary SiteConfigPropertiesDictionary { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs deleted file mode 100644 index d12283ab5958..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for StackPreferredOs. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum StackPreferredOs - { - [EnumMember(Value = "Windows")] - Windows, - [EnumMember(Value = "Linux")] - Linux - } - internal static class StackPreferredOsEnumExtension - { - internal static string ToSerializedValue(this StackPreferredOs? value) - { - return value == null ? null : ((StackPreferredOs)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this StackPreferredOs value) - { - switch( value ) - { - case StackPreferredOs.Windows: - return "Windows"; - case StackPreferredOs.Linux: - return "Linux"; - } - return null; - } - - internal static StackPreferredOs? ParseStackPreferredOs(this string value) - { - switch( value ) - { - case "Windows": - return StackPreferredOs.Windows; - case "Linux": - return StackPreferredOs.Linux; - } - return null; - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs index 05fb910f6b8d..c775cdc8eb11 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs @@ -38,9 +38,8 @@ public StampCapacity() /// Shared/dedicated workers. Possible values /// include: 'Shared', 'Dedicated', 'Dynamic' /// Size of the machines. Possible values - /// include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'SmallV3', - /// 'MediumV3', 'LargeV3', 'NestedSmall', 'NestedSmallLinux', - /// 'Default' + /// include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', + /// 'NestedSmall', 'Default' /// Size ID of machines: /// 0 - Small /// 1 - Medium @@ -110,8 +109,8 @@ public StampCapacity() /// /// Gets or sets size of the machines. Possible values include: - /// 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'SmallV3', - /// 'MediumV3', 'LargeV3', 'NestedSmall', 'NestedSmallLinux', 'Default' + /// 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'NestedSmall', + /// 'Default' /// [JsonProperty(PropertyName = "workerSize")] public WorkerSizeOptions? WorkerSize { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs index f5a08ce52e1c..656ca9e54a50 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs @@ -52,17 +52,7 @@ public StaticSiteARMResource() /// secrets. /// Build properties to configure on the /// repository. - /// The provider that submitted the last - /// deployment to the primary environment of the static site. - /// Template options for generating a - /// new repository. - /// The content distribution - /// endpoint for the static site. - /// Identity to use for Key - /// Vault Reference authentication. - /// User provided function apps - /// registered with the static site - public StaticSiteARMResource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), string provider = default(string), StaticSiteTemplateOptions templateProperties = default(StaticSiteTemplateOptions), string contentDistributionEndpoint = default(string), string keyVaultReferenceIdentity = default(string), IList userProvidedFunctionApps = default(IList), SkuDescription sku = default(SkuDescription), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + public StaticSiteARMResource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), SkuDescription sku = default(SkuDescription)) : base(location, id, name, kind, type, tags) { DefaultHostname = defaultHostname; @@ -71,13 +61,7 @@ public StaticSiteARMResource() CustomDomains = customDomains; RepositoryToken = repositoryToken; BuildProperties = buildProperties; - Provider = provider; - TemplateProperties = templateProperties; - ContentDistributionEndpoint = contentDistributionEndpoint; - KeyVaultReferenceIdentity = keyVaultReferenceIdentity; - UserProvidedFunctionApps = userProvidedFunctionApps; Sku = sku; - Identity = identity; CustomInit(); } @@ -123,47 +107,11 @@ public StaticSiteARMResource() [JsonProperty(PropertyName = "properties.buildProperties")] public StaticSiteBuildProperties BuildProperties { get; set; } - /// - /// Gets the provider that submitted the last deployment to the primary - /// environment of the static site. - /// - [JsonProperty(PropertyName = "properties.provider")] - public string Provider { get; private set; } - - /// - /// Gets or sets template options for generating a new repository. - /// - [JsonProperty(PropertyName = "properties.templateProperties")] - public StaticSiteTemplateOptions TemplateProperties { get; set; } - - /// - /// Gets the content distribution endpoint for the static site. - /// - [JsonProperty(PropertyName = "properties.contentDistributionEndpoint")] - public string ContentDistributionEndpoint { get; private set; } - - /// - /// Gets identity to use for Key Vault Reference authentication. - /// - [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] - public string KeyVaultReferenceIdentity { get; private set; } - - /// - /// Gets user provided function apps registered with the static site - /// - [JsonProperty(PropertyName = "properties.userProvidedFunctionApps")] - public IList UserProvidedFunctionApps { get; private set; } - /// /// [JsonProperty(PropertyName = "sku")] public SkuDescription Sku { get; set; } - /// - /// - [JsonProperty(PropertyName = "identity")] - public ManagedServiceIdentity Identity { get; set; } - /// /// Validate the object. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs index 12a4c431d1fe..b82f1efcf925 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs @@ -13,8 +13,6 @@ namespace Microsoft.Azure.Management.WebSites.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -50,9 +48,7 @@ public StaticSiteBuildARMResource() /// The status of the static site build. Possible /// values include: 'WaitingForDeployment', 'Uploading', 'Deploying', /// 'Ready', 'Failed', 'Deleting', 'Detached' - /// User provided function apps - /// registered with the static site build - public StaticSiteBuildARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string buildId = default(string), string sourceBranch = default(string), string pullRequestTitle = default(string), string hostname = default(string), System.DateTime? createdTimeUtc = default(System.DateTime?), System.DateTime? lastUpdatedOn = default(System.DateTime?), string status = default(string), IList userProvidedFunctionApps = default(IList)) + public StaticSiteBuildARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string buildId = default(string), string sourceBranch = default(string), string pullRequestTitle = default(string), string hostname = default(string), System.DateTime? createdTimeUtc = default(System.DateTime?), System.DateTime? lastUpdatedOn = default(System.DateTime?), string status = default(string)) : base(id, name, kind, type) { BuildId = buildId; @@ -62,7 +58,6 @@ public StaticSiteBuildARMResource() CreatedTimeUtc = createdTimeUtc; LastUpdatedOn = lastUpdatedOn; Status = status; - UserProvidedFunctionApps = userProvidedFunctionApps; CustomInit(); } @@ -116,12 +111,5 @@ public StaticSiteBuildARMResource() [JsonProperty(PropertyName = "properties.status")] public string Status { get; private set; } - /// - /// Gets user provided function apps registered with the static site - /// build - /// - [JsonProperty(PropertyName = "properties.userProvidedFunctionApps")] - public IList UserProvidedFunctionApps { get; private set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs index 1fb669c33640..be1c6117947d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs @@ -33,29 +33,13 @@ public StaticSiteBuildProperties() /// repository. /// The path to the api code within the /// repository. - /// Deprecated: The path of the app - /// artifacts after building (deprecated in favor of - /// OutputLocation) - /// The output path of the app after - /// building. - /// A custom command to run during - /// deployment of the static content application. - /// A custom command to run during - /// deployment of the Azure Functions API application. - /// Skip Github Action - /// workflow generation. - /// Github Action secret - /// name override. - public StaticSiteBuildProperties(string appLocation = default(string), string apiLocation = default(string), string appArtifactLocation = default(string), string outputLocation = default(string), string appBuildCommand = default(string), string apiBuildCommand = default(string), bool? skipGithubActionWorkflowGeneration = default(bool?), string githubActionSecretNameOverride = default(string)) + /// The path of the app artifacts + /// after building. + public StaticSiteBuildProperties(string appLocation = default(string), string apiLocation = default(string), string appArtifactLocation = default(string)) { AppLocation = appLocation; ApiLocation = apiLocation; AppArtifactLocation = appArtifactLocation; - OutputLocation = outputLocation; - AppBuildCommand = appBuildCommand; - ApiBuildCommand = apiBuildCommand; - SkipGithubActionWorkflowGeneration = skipGithubActionWorkflowGeneration; - GithubActionSecretNameOverride = githubActionSecretNameOverride; CustomInit(); } @@ -77,43 +61,10 @@ public StaticSiteBuildProperties() public string ApiLocation { get; set; } /// - /// Gets or sets deprecated: The path of the app artifacts after - /// building (deprecated in favor of OutputLocation) + /// Gets or sets the path of the app artifacts after building. /// [JsonProperty(PropertyName = "appArtifactLocation")] public string AppArtifactLocation { get; set; } - /// - /// Gets or sets the output path of the app after building. - /// - [JsonProperty(PropertyName = "outputLocation")] - public string OutputLocation { get; set; } - - /// - /// Gets or sets a custom command to run during deployment of the - /// static content application. - /// - [JsonProperty(PropertyName = "appBuildCommand")] - public string AppBuildCommand { get; set; } - - /// - /// Gets or sets a custom command to run during deployment of the Azure - /// Functions API application. - /// - [JsonProperty(PropertyName = "apiBuildCommand")] - public string ApiBuildCommand { get; set; } - - /// - /// Gets or sets skip Github Action workflow generation. - /// - [JsonProperty(PropertyName = "skipGithubActionWorkflowGeneration")] - public bool? SkipGithubActionWorkflowGeneration { get; set; } - - /// - /// Gets or sets github Action secret name override. - /// - [JsonProperty(PropertyName = "githubActionSecretNameOverride")] - public string GithubActionSecretNameOverride { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs index 2a2403117477..b2dca77065cf 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs @@ -42,19 +42,11 @@ public StaticSiteCustomDomainOverviewARMResource() /// domain. /// The date and time on which the custom /// domain was created for the static site. - /// The status of the custom domain. Possible - /// values include: 'RetrievingValidationToken', 'Validating', - /// 'Adding', 'Ready', 'Failed', 'Deleting' - /// The TXT record validation - /// token - public StaticSiteCustomDomainOverviewARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string domainName = default(string), System.DateTime? createdOn = default(System.DateTime?), string status = default(string), string validationToken = default(string), string errorMessage = default(string)) + public StaticSiteCustomDomainOverviewARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string domainName = default(string), System.DateTime? createdOn = default(System.DateTime?)) : base(id, name, kind, type) { DomainName = domainName; CreatedOn = createdOn; - Status = status; - ValidationToken = validationToken; - ErrorMessage = errorMessage; CustomInit(); } @@ -76,24 +68,5 @@ public StaticSiteCustomDomainOverviewARMResource() [JsonProperty(PropertyName = "properties.createdOn")] public System.DateTime? CreatedOn { get; private set; } - /// - /// Gets the status of the custom domain. Possible values include: - /// 'RetrievingValidationToken', 'Validating', 'Adding', 'Ready', - /// 'Failed', 'Deleting' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; private set; } - - /// - /// Gets the TXT record validation token - /// - [JsonProperty(PropertyName = "properties.validationToken")] - public string ValidationToken { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "properties.errorMessage")] - public string ErrorMessage { get; private set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs deleted file mode 100644 index caee85ae6064..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Static Site Custom Domain Request Properties ARM resource. - /// - [Rest.Serialization.JsonTransformation] - public partial class StaticSiteCustomDomainRequestPropertiesARMResource : ProxyOnlyResource - { - /// - /// Initializes a new instance of the - /// StaticSiteCustomDomainRequestPropertiesARMResource class. - /// - public StaticSiteCustomDomainRequestPropertiesARMResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// StaticSiteCustomDomainRequestPropertiesARMResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Validation method for adding a - /// custom domain - public StaticSiteCustomDomainRequestPropertiesARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string validationMethod = default(string)) - : base(id, name, kind, type) - { - ValidationMethod = validationMethod; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets validation method for adding a custom domain - /// - [JsonProperty(PropertyName = "properties.validationMethod")] - public string ValidationMethod { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs index b6bb48fc0ddb..a4de50863546 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs @@ -42,25 +42,15 @@ public StaticSitePatchResource() /// for the static site. /// URL for the repository of the static /// site. - /// The target branch in the repository. + /// The target branch in the repository. /// The custom domains associated with this /// static site. /// A user's github repository token. /// This is used to setup the Github Actions workflow file and API - /// secrets. + /// secrets. /// Build properties to configure on the /// repository. - /// The provider that submitted the last - /// deployment to the primary environment of the static site. - /// Template options for generating a - /// new repository. - /// The content distribution - /// endpoint for the static site. - /// Identity to use for Key - /// Vault Reference authentication. - /// User provided function apps - /// registered with the static site - public StaticSitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), string provider = default(string), StaticSiteTemplateOptions templateProperties = default(StaticSiteTemplateOptions), string contentDistributionEndpoint = default(string), string keyVaultReferenceIdentity = default(string), IList userProvidedFunctionApps = default(IList)) + public StaticSitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties)) : base(id, name, kind, type) { DefaultHostname = defaultHostname; @@ -69,11 +59,6 @@ public StaticSitePatchResource() CustomDomains = customDomains; RepositoryToken = repositoryToken; BuildProperties = buildProperties; - Provider = provider; - TemplateProperties = templateProperties; - ContentDistributionEndpoint = contentDistributionEndpoint; - KeyVaultReferenceIdentity = keyVaultReferenceIdentity; - UserProvidedFunctionApps = userProvidedFunctionApps; CustomInit(); } @@ -119,36 +104,5 @@ public StaticSitePatchResource() [JsonProperty(PropertyName = "properties.buildProperties")] public StaticSiteBuildProperties BuildProperties { get; set; } - /// - /// Gets the provider that submitted the last deployment to the primary - /// environment of the static site. - /// - [JsonProperty(PropertyName = "properties.provider")] - public string Provider { get; private set; } - - /// - /// Gets or sets template options for generating a new repository. - /// - [JsonProperty(PropertyName = "properties.templateProperties")] - public StaticSiteTemplateOptions TemplateProperties { get; set; } - - /// - /// Gets the content distribution endpoint for the static site. - /// - [JsonProperty(PropertyName = "properties.contentDistributionEndpoint")] - public string ContentDistributionEndpoint { get; private set; } - - /// - /// Gets identity to use for Key Vault Reference authentication. - /// - [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] - public string KeyVaultReferenceIdentity { get; private set; } - - /// - /// Gets user provided function apps registered with the static site - /// - [JsonProperty(PropertyName = "properties.userProvidedFunctionApps")] - public IList UserProvidedFunctionApps { get; private set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs deleted file mode 100644 index ad8cb9674adf..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Template Options for the static site. - /// - public partial class StaticSiteTemplateOptions - { - /// - /// Initializes a new instance of the StaticSiteTemplateOptions class. - /// - public StaticSiteTemplateOptions() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the StaticSiteTemplateOptions class. - /// - /// URL of the template repository. - /// The newly generated repository will be based on this one. - /// Owner of the newly generated - /// repository. - /// Name of the newly generated - /// repository. - /// Description of the newly generated - /// repository. - /// Whether or not the newly generated - /// repository is a private repository. Defaults to false (i.e. - /// public). - public StaticSiteTemplateOptions(string templateRepositoryUrl = default(string), string owner = default(string), string repositoryName = default(string), string description = default(string), bool? isPrivate = default(bool?)) - { - TemplateRepositoryUrl = templateRepositoryUrl; - Owner = owner; - RepositoryName = repositoryName; - Description = description; - IsPrivate = isPrivate; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets URL of the template repository. The newly generated - /// repository will be based on this one. - /// - [JsonProperty(PropertyName = "templateRepositoryUrl")] - public string TemplateRepositoryUrl { get; set; } - - /// - /// Gets or sets owner of the newly generated repository. - /// - [JsonProperty(PropertyName = "owner")] - public string Owner { get; set; } - - /// - /// Gets or sets name of the newly generated repository. - /// - [JsonProperty(PropertyName = "repositoryName")] - public string RepositoryName { get; set; } - - /// - /// Gets or sets description of the newly generated repository. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets or sets whether or not the newly generated repository is a - /// private repository. Defaults to false (i.e. public). - /// - [JsonProperty(PropertyName = "isPrivate")] - public bool? IsPrivate { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs deleted file mode 100644 index d21a687e9567..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs +++ /dev/null @@ -1,83 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A static site user provided function. - /// - [Rest.Serialization.JsonTransformation] - public partial class StaticSiteUserProvidedFunctionApp : ProxyOnlyResource - { - /// - /// Initializes a new instance of the StaticSiteUserProvidedFunctionApp - /// class. - /// - public StaticSiteUserProvidedFunctionApp() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the StaticSiteUserProvidedFunctionApp - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The resource id of the function - /// app registered with the static site - /// The region of the function app - /// registered with the static site - /// The date and time on which the function app - /// was registered with the static site. - public StaticSiteUserProvidedFunctionApp(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string functionAppResourceId = default(string), string functionAppRegion = default(string), System.DateTime? createdOn = default(System.DateTime?)) - : base(id, name, kind, type) - { - FunctionAppResourceId = functionAppResourceId; - FunctionAppRegion = functionAppRegion; - CreatedOn = createdOn; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource id of the function app registered with - /// the static site - /// - [JsonProperty(PropertyName = "properties.functionAppResourceId")] - public string FunctionAppResourceId { get; set; } - - /// - /// Gets or sets the region of the function app registered with the - /// static site - /// - [JsonProperty(PropertyName = "properties.functionAppRegion")] - public string FunctionAppRegion { get; set; } - - /// - /// Gets the date and time on which the function app was registered - /// with the static site. - /// - [JsonProperty(PropertyName = "properties.createdOn")] - public System.DateTime? CreatedOn { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs deleted file mode 100644 index b7652412f1c0..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs +++ /dev/null @@ -1,83 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Static Site User Provided Function App ARM resource. - /// - [Rest.Serialization.JsonTransformation] - public partial class StaticSiteUserProvidedFunctionAppARMResource : ProxyOnlyResource - { - /// - /// Initializes a new instance of the - /// StaticSiteUserProvidedFunctionAppARMResource class. - /// - public StaticSiteUserProvidedFunctionAppARMResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// StaticSiteUserProvidedFunctionAppARMResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The resource id of the function - /// app registered with the static site - /// The region of the function app - /// registered with the static site - /// The date and time on which the function app - /// was registered with the static site. - public StaticSiteUserProvidedFunctionAppARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string functionAppResourceId = default(string), string functionAppRegion = default(string), System.DateTime? createdOn = default(System.DateTime?)) - : base(id, name, kind, type) - { - FunctionAppResourceId = functionAppResourceId; - FunctionAppRegion = functionAppRegion; - CreatedOn = createdOn; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource id of the function app registered with - /// the static site - /// - [JsonProperty(PropertyName = "properties.functionAppResourceId")] - public string FunctionAppResourceId { get; set; } - - /// - /// Gets or sets the region of the function app registered with the - /// static site - /// - [JsonProperty(PropertyName = "properties.functionAppRegion")] - public string FunctionAppRegion { get; set; } - - /// - /// Gets the date and time on which the function app was registered - /// with the static site. - /// - [JsonProperty(PropertyName = "properties.createdOn")] - public System.DateTime? CreatedOn { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs deleted file mode 100644 index ec3255096a8f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs +++ /dev/null @@ -1,96 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Static site zip deployment ARM resource. - /// - [Rest.Serialization.JsonTransformation] - public partial class StaticSiteZipDeploymentARMResource : ProxyOnlyResource - { - /// - /// Initializes a new instance of the - /// StaticSiteZipDeploymentARMResource class. - /// - public StaticSiteZipDeploymentARMResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// StaticSiteZipDeploymentARMResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// URL for the zipped app content - /// URL for the zipped api content - /// A title to label the - /// deployment - /// The provider submitting this - /// deployment - /// The language of the api content, if - /// it exists - public StaticSiteZipDeploymentARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string appZipUrl = default(string), string apiZipUrl = default(string), string deploymentTitle = default(string), string provider = default(string), string functionLanguage = default(string)) - : base(id, name, kind, type) - { - AppZipUrl = appZipUrl; - ApiZipUrl = apiZipUrl; - DeploymentTitle = deploymentTitle; - Provider = provider; - FunctionLanguage = functionLanguage; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets URL for the zipped app content - /// - [JsonProperty(PropertyName = "properties.appZipUrl")] - public string AppZipUrl { get; set; } - - /// - /// Gets or sets URL for the zipped api content - /// - [JsonProperty(PropertyName = "properties.apiZipUrl")] - public string ApiZipUrl { get; set; } - - /// - /// Gets or sets a title to label the deployment - /// - [JsonProperty(PropertyName = "properties.deploymentTitle")] - public string DeploymentTitle { get; set; } - - /// - /// Gets or sets the provider submitting this deployment - /// - [JsonProperty(PropertyName = "properties.provider")] - public string Provider { get; set; } - - /// - /// Gets or sets the language of the api content, if it exists - /// - [JsonProperty(PropertyName = "properties.functionLanguage")] - public string FunctionLanguage { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs deleted file mode 100644 index 33b41a8623e2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Preview for the Static Site Workflow to be generated - /// - [Rest.Serialization.JsonTransformation] - public partial class StaticSitesWorkflowPreview : ProxyOnlyResource - { - /// - /// Initializes a new instance of the StaticSitesWorkflowPreview class. - /// - public StaticSitesWorkflowPreview() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the StaticSitesWorkflowPreview class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The path for the workflow file to be - /// generated - /// The contents for the workflow file to be - /// generated - public StaticSitesWorkflowPreview(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string path = default(string), string contents = default(string)) - : base(id, name, kind, type) - { - Path = path; - Contents = contents; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the path for the workflow file to be generated - /// - [JsonProperty(PropertyName = "properties.path")] - public string Path { get; private set; } - - /// - /// Gets the contents for the workflow file to be generated - /// - [JsonProperty(PropertyName = "properties.contents")] - public string Contents { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs deleted file mode 100644 index 98297a655dbd..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Request entity for previewing the Static Site workflow - /// - [Rest.Serialization.JsonTransformation] - public partial class StaticSitesWorkflowPreviewRequest : ProxyOnlyResource - { - /// - /// Initializes a new instance of the StaticSitesWorkflowPreviewRequest - /// class. - /// - public StaticSitesWorkflowPreviewRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the StaticSitesWorkflowPreviewRequest - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// URL for the repository of the static - /// site. - /// The target branch in the repository. - /// Build properties to configure on the - /// repository. - public StaticSitesWorkflowPreviewRequest(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repositoryUrl = default(string), string branch = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties)) - : base(id, name, kind, type) - { - RepositoryUrl = repositoryUrl; - Branch = branch; - BuildProperties = buildProperties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets URL for the repository of the static site. - /// - [JsonProperty(PropertyName = "properties.repositoryUrl")] - public string RepositoryUrl { get; set; } - - /// - /// Gets or sets the target branch in the repository. - /// - [JsonProperty(PropertyName = "properties.branch")] - public string Branch { get; set; } - - /// - /// Gets or sets build properties to configure on the repository. - /// - [JsonProperty(PropertyName = "properties.buildProperties")] - public StaticSiteBuildProperties BuildProperties { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs deleted file mode 100644 index c53ab12d6064..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Identify the status of the most severe insight generated by the - /// detector. - /// - public partial class Status - { - /// - /// Initializes a new instance of the Status class. - /// - public Status() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Status class. - /// - /// Descriptive message. - /// Level of the most severe insight generated - /// by the detector. Possible values include: 'Critical', 'Warning', - /// 'Info', 'Success', 'None' - public Status(string message = default(string), InsightStatus? statusId = default(InsightStatus?)) - { - Message = message; - StatusId = statusId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets descriptive message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - /// - /// Gets or sets level of the most severe insight generated by the - /// detector. Possible values include: 'Critical', 'Warning', 'Info', - /// 'Success', 'None' - /// - [JsonProperty(PropertyName = "statusId")] - public InsightStatus? StatusId { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs index 6727f0e7576e..f5a0016591e9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs @@ -32,15 +32,13 @@ public StatusCodesBasedTrigger() /// HTTP status code. /// Request Sub Status. /// Win32 error code. - /// Request Path /// Request Count. /// Time interval. - public StatusCodesBasedTrigger(int? status = default(int?), int? subStatus = default(int?), int? win32Status = default(int?), string path = default(string), int? count = default(int?), string timeInterval = default(string)) + public StatusCodesBasedTrigger(int? status = default(int?), int? subStatus = default(int?), int? win32Status = default(int?), int? count = default(int?), string timeInterval = default(string)) { Status = status; SubStatus = subStatus; Win32Status = win32Status; - Path = path; Count = count; TimeInterval = timeInterval; CustomInit(); @@ -69,12 +67,6 @@ public StatusCodesBasedTrigger() [JsonProperty(PropertyName = "win32Status")] public int? Win32Status { get; set; } - /// - /// Gets or sets request Path - /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } - /// /// Gets or sets request Count. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs deleted file mode 100644 index e3d3dfe55380..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Trigger based on range of status codes. - /// - public partial class StatusCodesRangeBasedTrigger - { - /// - /// Initializes a new instance of the StatusCodesRangeBasedTrigger - /// class. - /// - public StatusCodesRangeBasedTrigger() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the StatusCodesRangeBasedTrigger - /// class. - /// - /// HTTP status code. - /// Request Count. - /// Time interval. - public StatusCodesRangeBasedTrigger(string statusCodes = default(string), string path = default(string), int? count = default(int?), string timeInterval = default(string)) - { - StatusCodes = statusCodes; - Path = path; - Count = count; - TimeInterval = timeInterval; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets HTTP status code. - /// - [JsonProperty(PropertyName = "statusCodes")] - public string StatusCodes { get; set; } - - /// - /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } - - /// - /// Gets or sets request Count. - /// - [JsonProperty(PropertyName = "count")] - public int? Count { get; set; } - - /// - /// Gets or sets time interval. - /// - [JsonProperty(PropertyName = "timeInterval")] - public string TimeInterval { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs deleted file mode 100644 index cb1f2518c84d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// String list resource. - /// - public partial class StringList : ProxyOnlyResource - { - /// - /// Initializes a new instance of the StringList class. - /// - public StringList() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the StringList class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// List of string resources. - public StringList(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList properties = default(IList)) - : base(id, name, kind, type) - { - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of string resources. - /// - [JsonProperty(PropertyName = "properties")] - public IList Properties { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs deleted file mode 100644 index 46fd238f182d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Defines a unique Support Topic - /// - public partial class SupportTopic - { - /// - /// Initializes a new instance of the SupportTopic class. - /// - public SupportTopic() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SupportTopic class. - /// - /// Support Topic Id - /// Unique resource Id - public SupportTopic(string id = default(string), string pesId = default(string)) - { - Id = id; - PesId = pesId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets support Topic Id - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets unique resource Id - /// - [JsonProperty(PropertyName = "pesId")] - public string PesId { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs index cfab40caac5c..a582a0780b0e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs @@ -34,8 +34,7 @@ public ValidateRequest() /// /// Resource name to verify. /// Resource type used for verification. Possible - /// values include: 'ServerFarm', 'Site', - /// 'Microsoft.Web/hostingEnvironments' + /// values include: 'ServerFarm', 'Site' /// Expected location of the resource. /// ARM resource ID of an App Service plan /// that would host the app. @@ -64,9 +63,7 @@ public ValidateRequest() /// Image tag /// Platform (windows or /// linux) - /// App Service Environment - /// Properties - public ValidateRequest(string name, string type, string location, string serverFarmId = default(string), string skuName = default(string), bool? needLinuxWorkers = default(bool?), bool? isSpot = default(bool?), int? capacity = default(int?), string hostingEnvironment = default(string), bool? isXenon = default(bool?), string containerRegistryBaseUrl = default(string), string containerRegistryUsername = default(string), string containerRegistryPassword = default(string), string containerImageRepository = default(string), string containerImageTag = default(string), string containerImagePlatform = default(string), AppServiceEnvironment appServiceEnvironment = default(AppServiceEnvironment)) + public ValidateRequest(string name, string type, string location, string serverFarmId = default(string), string skuName = default(string), bool? needLinuxWorkers = default(bool?), bool? isSpot = default(bool?), int? capacity = default(int?), string hostingEnvironment = default(string), bool? isXenon = default(bool?), string containerRegistryBaseUrl = default(string), string containerRegistryUsername = default(string), string containerRegistryPassword = default(string), string containerImageRepository = default(string), string containerImageTag = default(string), string containerImagePlatform = default(string)) { Name = name; Type = type; @@ -84,7 +81,6 @@ public ValidateRequest() ContainerImageRepository = containerImageRepository; ContainerImageTag = containerImageTag; ContainerImagePlatform = containerImagePlatform; - AppServiceEnvironment = appServiceEnvironment; CustomInit(); } @@ -101,7 +97,7 @@ public ValidateRequest() /// /// Gets or sets resource type used for verification. Possible values - /// include: 'ServerFarm', 'Site', 'Microsoft.Web/hostingEnvironments' + /// include: 'ServerFarm', 'Site' /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } @@ -198,12 +194,6 @@ public ValidateRequest() [JsonProperty(PropertyName = "properties.containerImagePlatform")] public string ContainerImagePlatform { get; set; } - /// - /// Gets or sets app Service Environment Properties - /// - [JsonProperty(PropertyName = "properties.appServiceEnvironment")] - public AppServiceEnvironment AppServiceEnvironment { get; set; } - /// /// Validate the object. /// @@ -228,10 +218,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "Capacity", 1); } - if (AppServiceEnvironment != null) - { - AppServiceEnvironment.Validate(); - } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs index 1c771a665519..511049be371b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs @@ -18,6 +18,5 @@ public static class ValidateResourceTypes { public const string ServerFarm = "ServerFarm"; public const string Site = "Site"; - public const string MicrosoftWebHostingEnvironments = "Microsoft.Web/hostingEnvironments"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs index 55e03d256121..a9162d3a1626 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -35,7 +34,7 @@ public VirtualNetworkProfile() /// Resource type of the Virtual Network /// (read-only). /// Subnet within the Virtual Network. - public VirtualNetworkProfile(string id, string name = default(string), string type = default(string), string subnet = default(string)) + public VirtualNetworkProfile(string id = default(string), string name = default(string), string type = default(string), string subnet = default(string)) { Id = id; Name = name; @@ -73,18 +72,5 @@ public VirtualNetworkProfile() [JsonProperty(PropertyName = "subnet")] public string Subnet { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Id"); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs index bfd2641e12d9..0afb85613b5f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs @@ -41,15 +41,12 @@ public VnetParameters() /// The name of the VNET to be validated /// The subnet name to be /// validated - /// The ARM Resource ID of the subnet to - /// validate - public VnetParameters(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string vnetResourceGroup = default(string), string vnetName = default(string), string vnetSubnetName = default(string), string subnetResourceId = default(string)) + public VnetParameters(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string vnetResourceGroup = default(string), string vnetName = default(string), string vnetSubnetName = default(string)) : base(id, name, kind, type) { VnetResourceGroup = vnetResourceGroup; VnetName = vnetName; VnetSubnetName = vnetSubnetName; - SubnetResourceId = subnetResourceId; CustomInit(); } @@ -76,11 +73,5 @@ public VnetParameters() [JsonProperty(PropertyName = "properties.vnetSubnetName")] public string VnetSubnetName { get; set; } - /// - /// Gets or sets the ARM Resource ID of the subnet to validate - /// - [JsonProperty(PropertyName = "properties.subnetResourceId")] - public string SubnetResourceId { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs index fc6cb6a7c8e2..f72ab080b2cf 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs @@ -40,21 +40,15 @@ public VnetValidationFailureDetails() /// Resource Name. /// Kind of resource. /// Resource type. - /// Text describing the validation - /// outcome. /// A flag describing whether or not validation /// failed. /// A list of tests that failed in the /// validation. - /// A list of warnings generated during - /// validation. - public VnetValidationFailureDetails(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string message = default(string), bool? failed = default(bool?), IList failedTests = default(IList), IList warnings = default(IList)) + public VnetValidationFailureDetails(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? failed = default(bool?), IList failedTests = default(IList)) : base(id, name, kind, type) { - Message = message; Failed = failed; FailedTests = failedTests; - Warnings = warnings; CustomInit(); } @@ -63,12 +57,6 @@ public VnetValidationFailureDetails() /// partial void CustomInit(); - /// - /// Gets or sets text describing the validation outcome. - /// - [JsonProperty(PropertyName = "properties.message")] - public string Message { get; set; } - /// /// Gets or sets a flag describing whether or not validation failed. /// @@ -81,11 +69,5 @@ public VnetValidationFailureDetails() [JsonProperty(PropertyName = "properties.failedTests")] public IList FailedTests { get; set; } - /// - /// Gets or sets a list of warnings generated during validation. - /// - [JsonProperty(PropertyName = "properties.warnings")] - public IList Warnings { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs deleted file mode 100644 index 1401f5751420..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Web App stack major version. - /// - public partial class WebAppMajorVersion - { - /// - /// Initializes a new instance of the WebAppMajorVersion class. - /// - public WebAppMajorVersion() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WebAppMajorVersion class. - /// - /// Web App stack major version (display - /// only). - /// Web App stack major version name. - /// Minor versions associated with the - /// major version. - public WebAppMajorVersion(string displayText = default(string), string value = default(string), IList minorVersions = default(IList)) - { - DisplayText = displayText; - Value = value; - MinorVersions = minorVersions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets web App stack major version (display only). - /// - [JsonProperty(PropertyName = "displayText")] - public string DisplayText { get; private set; } - - /// - /// Gets web App stack major version name. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; private set; } - - /// - /// Gets minor versions associated with the major version. - /// - [JsonProperty(PropertyName = "minorVersions")] - public IList MinorVersions { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs deleted file mode 100644 index 3b7864390773..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Web App stack minor version. - /// - public partial class WebAppMinorVersion - { - /// - /// Initializes a new instance of the WebAppMinorVersion class. - /// - public WebAppMinorVersion() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WebAppMinorVersion class. - /// - /// Web App stack minor version (display - /// only). - /// Web App stack major version name. - /// Settings associated with the minor - /// version. - public WebAppMinorVersion(string displayText = default(string), string value = default(string), WebAppRuntimes stackSettings = default(WebAppRuntimes)) - { - DisplayText = displayText; - Value = value; - StackSettings = stackSettings; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets web App stack minor version (display only). - /// - [JsonProperty(PropertyName = "displayText")] - public string DisplayText { get; private set; } - - /// - /// Gets web App stack major version name. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; private set; } - - /// - /// Gets settings associated with the minor version. - /// - [JsonProperty(PropertyName = "stackSettings")] - public WebAppRuntimes StackSettings { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs deleted file mode 100644 index 9b2842b0248a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs +++ /dev/null @@ -1,152 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Web App runtime settings. - /// - public partial class WebAppRuntimeSettings - { - /// - /// Initializes a new instance of the WebAppRuntimeSettings class. - /// - public WebAppRuntimeSettings() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WebAppRuntimeSettings class. - /// - /// Web App stack minor version (runtime - /// only). - /// <code>true</code> if - /// remote debugging is supported for the stack; otherwise, - /// <code>false</code>. - /// Application Insights settings - /// associated with the minor version. - /// GitHub Actions settings - /// associated with the minor version. - /// <code>true</code> if the stack - /// is in preview; otherwise, <code>false</code>. - /// <code>true</code> if the - /// stack is deprecated; otherwise, - /// <code>false</code>. - /// <code>true</code> if the stack - /// should be hidden; otherwise, - /// <code>false</code>. - /// End-of-life date for the minor - /// version. - /// <code>true</code> if the - /// stack version is auto-updated; otherwise, - /// <code>false</code>. - /// <code>true</code> if the - /// minor version is early-access; otherwise, - /// <code>false</code>. - public WebAppRuntimeSettings(string runtimeVersion = default(string), bool? remoteDebuggingSupported = default(bool?), AppInsightsWebAppStackSettings appInsightsSettings = default(AppInsightsWebAppStackSettings), GitHubActionWebAppStackSettings gitHubActionSettings = default(GitHubActionWebAppStackSettings), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) - { - RuntimeVersion = runtimeVersion; - RemoteDebuggingSupported = remoteDebuggingSupported; - AppInsightsSettings = appInsightsSettings; - GitHubActionSettings = gitHubActionSettings; - IsPreview = isPreview; - IsDeprecated = isDeprecated; - IsHidden = isHidden; - EndOfLifeDate = endOfLifeDate; - IsAutoUpdate = isAutoUpdate; - IsEarlyAccess = isEarlyAccess; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets web App stack minor version (runtime only). - /// - [JsonProperty(PropertyName = "runtimeVersion")] - public string RuntimeVersion { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if remote - /// debugging is supported for the stack; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "remoteDebuggingSupported")] - public bool? RemoteDebuggingSupported { get; private set; } - - /// - /// Gets application Insights settings associated with the minor - /// version. - /// - [JsonProperty(PropertyName = "appInsightsSettings")] - public AppInsightsWebAppStackSettings AppInsightsSettings { get; private set; } - - /// - /// Gets gitHub Actions settings associated with the minor version. - /// - [JsonProperty(PropertyName = "gitHubActionSettings")] - public GitHubActionWebAppStackSettings GitHubActionSettings { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is - /// in preview; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isPreview")] - public bool? IsPreview { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is - /// deprecated; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isDeprecated")] - public bool? IsDeprecated { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack - /// should be hidden; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isHidden")] - public bool? IsHidden { get; private set; } - - /// - /// Gets end-of-life date for the minor version. - /// - [JsonProperty(PropertyName = "endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack - /// version is auto-updated; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isAutoUpdate")] - public bool? IsAutoUpdate { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the minor - /// version is early-access; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isEarlyAccess")] - public bool? IsEarlyAccess { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs deleted file mode 100644 index 06510ee15e8e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Web App stack runtimes. - /// - public partial class WebAppRuntimes - { - /// - /// Initializes a new instance of the WebAppRuntimes class. - /// - public WebAppRuntimes() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WebAppRuntimes class. - /// - /// Linux-specific settings - /// associated with the minor version. - /// Windows-specific settings - /// associated with the minor version. - /// Linux-specific settings - /// associated with the Java container minor version. - /// Windows-specific settings - /// associated with the Java container minor version. - public WebAppRuntimes(WebAppRuntimeSettings linuxRuntimeSettings = default(WebAppRuntimeSettings), WebAppRuntimeSettings windowsRuntimeSettings = default(WebAppRuntimeSettings), LinuxJavaContainerSettings linuxContainerSettings = default(LinuxJavaContainerSettings), WindowsJavaContainerSettings windowsContainerSettings = default(WindowsJavaContainerSettings)) - { - LinuxRuntimeSettings = linuxRuntimeSettings; - WindowsRuntimeSettings = windowsRuntimeSettings; - LinuxContainerSettings = linuxContainerSettings; - WindowsContainerSettings = windowsContainerSettings; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets linux-specific settings associated with the minor version. - /// - [JsonProperty(PropertyName = "linuxRuntimeSettings")] - public WebAppRuntimeSettings LinuxRuntimeSettings { get; private set; } - - /// - /// Gets windows-specific settings associated with the minor version. - /// - [JsonProperty(PropertyName = "windowsRuntimeSettings")] - public WebAppRuntimeSettings WindowsRuntimeSettings { get; private set; } - - /// - /// Gets linux-specific settings associated with the Java container - /// minor version. - /// - [JsonProperty(PropertyName = "linuxContainerSettings")] - public LinuxJavaContainerSettings LinuxContainerSettings { get; private set; } - - /// - /// Gets windows-specific settings associated with the Java container - /// minor version. - /// - [JsonProperty(PropertyName = "windowsContainerSettings")] - public WindowsJavaContainerSettings WindowsContainerSettings { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs deleted file mode 100644 index 37690ec2fb2d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs +++ /dev/null @@ -1,96 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Web App stack. - /// - [Rest.Serialization.JsonTransformation] - public partial class WebAppStack : ProxyOnlyResource - { - /// - /// Initializes a new instance of the WebAppStack class. - /// - public WebAppStack() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WebAppStack class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Web App stack location. - /// Web App stack (display only). - /// Web App stack name. - /// List of major versions - /// available. - /// Web App stack preferred OS. Possible - /// values include: 'Windows', 'Linux' - public WebAppStack(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string location = default(string), string displayText = default(string), string value = default(string), IList majorVersions = default(IList), StackPreferredOs? preferredOs = default(StackPreferredOs?)) - : base(id, name, kind, type) - { - Location = location; - DisplayText = displayText; - Value = value; - MajorVersions = majorVersions; - PreferredOs = preferredOs; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets web App stack location. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; private set; } - - /// - /// Gets web App stack (display only). - /// - [JsonProperty(PropertyName = "properties.displayText")] - public string DisplayText { get; private set; } - - /// - /// Gets web App stack name. - /// - [JsonProperty(PropertyName = "properties.value")] - public string Value { get; private set; } - - /// - /// Gets list of major versions available. - /// - [JsonProperty(PropertyName = "properties.majorVersions")] - public IList MajorVersions { get; private set; } - - /// - /// Gets web App stack preferred OS. Possible values include: - /// 'Windows', 'Linux' - /// - [JsonProperty(PropertyName = "properties.preferredOs")] - public StackPreferredOs? PreferredOs { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs deleted file mode 100644 index a773a9d589ab..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs +++ /dev/null @@ -1,130 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Windows Java Container settings. - /// - public partial class WindowsJavaContainerSettings - { - /// - /// Initializes a new instance of the WindowsJavaContainerSettings - /// class. - /// - public WindowsJavaContainerSettings() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WindowsJavaContainerSettings - /// class. - /// - /// Java container (runtime only). - /// Java container version (runtime - /// only). - /// <code>true</code> if the stack - /// is in preview; otherwise, <code>false</code>. - /// <code>true</code> if the - /// stack is deprecated; otherwise, - /// <code>false</code>. - /// <code>true</code> if the stack - /// should be hidden; otherwise, - /// <code>false</code>. - /// End-of-life date for the minor - /// version. - /// <code>true</code> if the - /// stack version is auto-updated; otherwise, - /// <code>false</code>. - /// <code>true</code> if the - /// minor version is early-access; otherwise, - /// <code>false</code>. - public WindowsJavaContainerSettings(string javaContainer = default(string), string javaContainerVersion = default(string), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) - { - JavaContainer = javaContainer; - JavaContainerVersion = javaContainerVersion; - IsPreview = isPreview; - IsDeprecated = isDeprecated; - IsHidden = isHidden; - EndOfLifeDate = endOfLifeDate; - IsAutoUpdate = isAutoUpdate; - IsEarlyAccess = isEarlyAccess; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets java container (runtime only). - /// - [JsonProperty(PropertyName = "javaContainer")] - public string JavaContainer { get; private set; } - - /// - /// Gets java container version (runtime only). - /// - [JsonProperty(PropertyName = "javaContainerVersion")] - public string JavaContainerVersion { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is - /// in preview; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isPreview")] - public bool? IsPreview { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is - /// deprecated; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isDeprecated")] - public bool? IsDeprecated { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack - /// should be hidden; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isHidden")] - public bool? IsHidden { get; private set; } - - /// - /// Gets end-of-life date for the minor version. - /// - [JsonProperty(PropertyName = "endOfLifeDate")] - public System.DateTime? EndOfLifeDate { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the stack - /// version is auto-updated; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isAutoUpdate")] - public bool? IsAutoUpdate { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the minor - /// version is early-access; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isEarlyAccess")] - public bool? IsEarlyAccess { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPool.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPool.cs new file mode 100644 index 000000000000..326c9ba160f2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPool.cs @@ -0,0 +1,91 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Worker pool of an App Service Environment. + /// + public partial class WorkerPool + { + /// + /// Initializes a new instance of the WorkerPool class. + /// + public WorkerPool() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkerPool class. + /// + /// Worker size ID for referencing this + /// worker pool. + /// Shared or dedicated app hosting. Possible + /// values include: 'Shared', 'Dedicated', 'Dynamic' + /// VM size of the worker pool + /// instances. + /// Number of instances in the worker + /// pool. + /// Names of all instances in the worker + /// pool (read only). + public WorkerPool(int? workerSizeId = default(int?), ComputeModeOptions? computeMode = default(ComputeModeOptions?), string workerSize = default(string), int? workerCount = default(int?), IList instanceNames = default(IList)) + { + WorkerSizeId = workerSizeId; + ComputeMode = computeMode; + WorkerSize = workerSize; + WorkerCount = workerCount; + InstanceNames = instanceNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets worker size ID for referencing this worker pool. + /// + [JsonProperty(PropertyName = "workerSizeId")] + public int? WorkerSizeId { get; set; } + + /// + /// Gets or sets shared or dedicated app hosting. Possible values + /// include: 'Shared', 'Dedicated', 'Dynamic' + /// + [JsonProperty(PropertyName = "computeMode")] + public ComputeModeOptions? ComputeMode { get; set; } + + /// + /// Gets or sets VM size of the worker pool instances. + /// + [JsonProperty(PropertyName = "workerSize")] + public string WorkerSize { get; set; } + + /// + /// Gets or sets number of instances in the worker pool. + /// + [JsonProperty(PropertyName = "workerCount")] + public int? WorkerCount { get; set; } + + /// + /// Gets names of all instances in the worker pool (read only). + /// + [JsonProperty(PropertyName = "instanceNames")] + public IList InstanceNames { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs index 0d125a3fdfe8..32d869df6f66 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs @@ -33,16 +33,8 @@ public enum WorkerSizeOptions D2, [EnumMember(Value = "D3")] D3, - [EnumMember(Value = "SmallV3")] - SmallV3, - [EnumMember(Value = "MediumV3")] - MediumV3, - [EnumMember(Value = "LargeV3")] - LargeV3, [EnumMember(Value = "NestedSmall")] NestedSmall, - [EnumMember(Value = "NestedSmallLinux")] - NestedSmallLinux, [EnumMember(Value = "Default")] Default } @@ -69,16 +61,8 @@ internal static string ToSerializedValue(this WorkerSizeOptions value) return "D2"; case WorkerSizeOptions.D3: return "D3"; - case WorkerSizeOptions.SmallV3: - return "SmallV3"; - case WorkerSizeOptions.MediumV3: - return "MediumV3"; - case WorkerSizeOptions.LargeV3: - return "LargeV3"; case WorkerSizeOptions.NestedSmall: return "NestedSmall"; - case WorkerSizeOptions.NestedSmallLinux: - return "NestedSmallLinux"; case WorkerSizeOptions.Default: return "Default"; } @@ -101,16 +85,8 @@ internal static string ToSerializedValue(this WorkerSizeOptions value) return WorkerSizeOptions.D2; case "D3": return WorkerSizeOptions.D3; - case "SmallV3": - return WorkerSizeOptions.SmallV3; - case "MediumV3": - return WorkerSizeOptions.MediumV3; - case "LargeV3": - return WorkerSizeOptions.LargeV3; case "NestedSmall": return WorkerSizeOptions.NestedSmall; - case "NestedSmallLinux": - return WorkerSizeOptions.NestedSmallLinux; case "Default": return WorkerSizeOptions.Default; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperations.cs index cb24dc93b4ce..547de71de032 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperations.cs @@ -58,7 +58,7 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions', 'All' + /// 'LinuxFunctions' /// /// /// Headers that will be added to request. @@ -231,14 +231,13 @@ internal ProviderOperations(WebSiteManagementClient client) } /// - /// Get available Function app frameworks and their versions + /// Gets all available operations for the Microsoft.Web resource provider. Also + /// exposes resource metric definitions /// /// - /// Description for Get available Function app frameworks and their versions + /// Description for Gets all available operations for the Microsoft.Web + /// resource provider. Also exposes resource metric definitions /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// /// /// Headers that will be added to request. /// @@ -260,7 +259,7 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetFunctionAppStacksWithHttpMessagesAsync(string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -273,18 +272,13 @@ internal ProviderOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("stackOsType", stackOsType); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetFunctionAppStacks", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/functionAppStacks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/operations").ToString(); List _queryParameters = new List(); - if (stackOsType != null) - { - _queryParameters.Add(string.Format("stackOsType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(stackOsType, Client.SerializationSettings).Trim('"')))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -377,7 +371,7 @@ internal ProviderOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -390,7 +384,7 @@ internal ProviderOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -410,17 +404,14 @@ internal ProviderOperations(WebSiteManagementClient client) } /// - /// Get available Function app frameworks and their versions for location + /// Get available application frameworks and their versions /// /// - /// Description for Get available Function app frameworks and their versions - /// for location + /// Description for Get available application frameworks and their versions /// - /// - /// Function App stack location. - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', + /// 'LinuxFunctions' /// /// /// Headers that will be added to request. @@ -443,11 +434,11 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetFunctionAppStacksForLocationWithHttpMessagesAsync(string location, string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetAvailableStacksOnPremWithHttpMessagesAsync(string osTypeSelected = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (location == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (Client.ApiVersion == null) { @@ -460,19 +451,18 @@ internal ProviderOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("stackOsType", stackOsType); + tracingParameters.Add("osTypeSelected", osTypeSelected); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetFunctionAppStacksForLocation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAvailableStacksOnPrem", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/locations/{location}/functionAppStacks").ToString(); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (stackOsType != null) + if (osTypeSelected != null) { - _queryParameters.Add(string.Format("stackOsType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(stackOsType, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("osTypeSelected={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(osTypeSelected, Client.SerializationSettings).Trim('"')))); } if (Client.ApiVersion != null) { @@ -566,7 +556,7 @@ internal ProviderOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -579,7 +569,7 @@ internal ProviderOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -599,17 +589,13 @@ internal ProviderOperations(WebSiteManagementClient client) } /// - /// Get available Web app frameworks and their versions for location + /// Get available application frameworks and their versions /// /// - /// Description for Get available Web app frameworks and their versions for - /// location + /// Description for Get available application frameworks and their versions /// - /// - /// Web App stack location. - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -632,15 +618,11 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetWebAppStacksForLocationWithHttpMessagesAsync(string location, string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetAvailableStacksNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - if (Client.ApiVersion == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -649,24 +631,14 @@ internal ProviderOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("stackOsType", stackOsType); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebAppStacksForLocation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAvailableStacksNext", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/locations/{location}/webAppStacks").ToString(); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); List _queryParameters = new List(); - if (stackOsType != null) - { - _queryParameters.Add(string.Format("stackOsType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(stackOsType, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -755,7 +727,7 @@ internal ProviderOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -768,7 +740,7 @@ internal ProviderOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -795,6 +767,9 @@ internal ProviderOperations(WebSiteManagementClient client) /// Description for Gets all available operations for the Microsoft.Web /// resource provider. Also exposes resource metric definitions /// + /// + /// The NextLink from the previous successful call to List operation. + /// /// /// Headers that will be added to request. /// @@ -816,11 +791,11 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListOperationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ApiVersion == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -829,17 +804,14 @@ internal ProviderOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListOperationsNext", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/operations").ToString(); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -960,1400 +932,6 @@ internal ProviderOperations(WebSiteManagementClient client) return _result; } - /// - /// Get available Web app frameworks and their versions - /// - /// - /// Description for Get available Web app frameworks and their versions - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - /// - /// 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>> GetWebAppStacksWithHttpMessagesAsync(string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("stackOsType", stackOsType); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebAppStacks", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/webAppStacks").ToString(); - List _queryParameters = new List(); - if (stackOsType != null) - { - _queryParameters.Add(string.Format("stackOsType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(stackOsType, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get available application frameworks and their versions - /// - /// - /// Description for Get available application frameworks and their versions - /// - /// - /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions', 'All' - /// - /// - /// 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>> GetAvailableStacksOnPremWithHttpMessagesAsync(string osTypeSelected = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("osTypeSelected", osTypeSelected); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAvailableStacksOnPrem", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (osTypeSelected != null) - { - _queryParameters.Add(string.Format("osTypeSelected={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(osTypeSelected, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get available application frameworks and their versions - /// - /// - /// Description for Get available application frameworks and their versions - /// - /// - /// 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>> GetAvailableStacksNextWithHttpMessagesAsync(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, "GetAvailableStacksNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get available Function app frameworks and their versions - /// - /// - /// Description for Get available Function app frameworks and their versions - /// - /// - /// 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>> GetFunctionAppStacksNextWithHttpMessagesAsync(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, "GetFunctionAppStacksNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get available Function app frameworks and their versions for location - /// - /// - /// Description for Get available Function app frameworks and their versions - /// for location - /// - /// - /// 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>> GetFunctionAppStacksForLocationNextWithHttpMessagesAsync(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, "GetFunctionAppStacksForLocationNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get available Web app frameworks and their versions for location - /// - /// - /// Description for Get available Web app frameworks and their versions for - /// location - /// - /// - /// 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>> GetWebAppStacksForLocationNextWithHttpMessagesAsync(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, "GetWebAppStacksForLocationNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets all available operations for the Microsoft.Web resource provider. Also - /// exposes resource metric definitions - /// - /// - /// Description for Gets all available operations for the Microsoft.Web - /// resource provider. Also exposes resource metric definitions - /// - /// - /// 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 (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get available Web app frameworks and their versions - /// - /// - /// Description for Get available Web app frameworks and their versions - /// - /// - /// 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>> GetWebAppStacksNextWithHttpMessagesAsync(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, "GetWebAppStacksNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - /// /// Get available application frameworks and their versions /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperationsExtensions.cs index 0ee4f139be05..0e9f90c4e7ac 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperationsExtensions.cs @@ -32,7 +32,7 @@ public static partial class ProviderOperationsExtensions /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions', 'All' + /// 'LinuxFunctions' /// public static IPage GetAvailableStacks(this IProviderOperations operations, string osTypeSelected = default(string)) { @@ -50,7 +50,7 @@ public static partial class ProviderOperationsExtensions /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions', 'All' + /// 'LinuxFunctions' /// /// /// The cancellation token. @@ -63,142 +63,6 @@ public static partial class ProviderOperationsExtensions } } - /// - /// Get available Function app frameworks and their versions - /// - /// - /// Description for Get available Function app frameworks and their versions - /// - /// - /// The operations group for this extension method. - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - public static IPage GetFunctionAppStacks(this IProviderOperations operations, string stackOsType = default(string)) - { - return operations.GetFunctionAppStacksAsync(stackOsType).GetAwaiter().GetResult(); - } - - /// - /// Get available Function app frameworks and their versions - /// - /// - /// Description for Get available Function app frameworks and their versions - /// - /// - /// The operations group for this extension method. - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - /// - /// The cancellation token. - /// - public static async Task> GetFunctionAppStacksAsync(this IProviderOperations operations, string stackOsType = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetFunctionAppStacksWithHttpMessagesAsync(stackOsType, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get available Function app frameworks and their versions for location - /// - /// - /// Description for Get available Function app frameworks and their versions - /// for location - /// - /// - /// The operations group for this extension method. - /// - /// - /// Function App stack location. - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - public static IPage GetFunctionAppStacksForLocation(this IProviderOperations operations, string location, string stackOsType = default(string)) - { - return operations.GetFunctionAppStacksForLocationAsync(location, stackOsType).GetAwaiter().GetResult(); - } - - /// - /// Get available Function app frameworks and their versions for location - /// - /// - /// Description for Get available Function app frameworks and their versions - /// for location - /// - /// - /// The operations group for this extension method. - /// - /// - /// Function App stack location. - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - /// - /// The cancellation token. - /// - public static async Task> GetFunctionAppStacksForLocationAsync(this IProviderOperations operations, string location, string stackOsType = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetFunctionAppStacksForLocationWithHttpMessagesAsync(location, stackOsType, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get available Web app frameworks and their versions for location - /// - /// - /// Description for Get available Web app frameworks and their versions for - /// location - /// - /// - /// The operations group for this extension method. - /// - /// - /// Web App stack location. - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - public static IPage GetWebAppStacksForLocation(this IProviderOperations operations, string location, string stackOsType = default(string)) - { - return operations.GetWebAppStacksForLocationAsync(location, stackOsType).GetAwaiter().GetResult(); - } - - /// - /// Get available Web app frameworks and their versions for location - /// - /// - /// Description for Get available Web app frameworks and their versions for - /// location - /// - /// - /// The operations group for this extension method. - /// - /// - /// Web App stack location. - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - /// - /// The cancellation token. - /// - public static async Task> GetWebAppStacksForLocationAsync(this IProviderOperations operations, string location, string stackOsType = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWebAppStacksForLocationWithHttpMessagesAsync(location, stackOsType, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all available operations for the Microsoft.Web resource provider. Also /// exposes resource metric definitions @@ -237,46 +101,6 @@ public static IPage ListOperations(this IProviderOperat } } - /// - /// Get available Web app frameworks and their versions - /// - /// - /// Description for Get available Web app frameworks and their versions - /// - /// - /// The operations group for this extension method. - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - public static IPage GetWebAppStacks(this IProviderOperations operations, string stackOsType = default(string)) - { - return operations.GetWebAppStacksAsync(stackOsType).GetAwaiter().GetResult(); - } - - /// - /// Get available Web app frameworks and their versions - /// - /// - /// Description for Get available Web app frameworks and their versions - /// - /// - /// The operations group for this extension method. - /// - /// - /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' - /// - /// - /// The cancellation token. - /// - public static async Task> GetWebAppStacksAsync(this IProviderOperations operations, string stackOsType = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWebAppStacksWithHttpMessagesAsync(stackOsType, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Get available application frameworks and their versions /// @@ -288,7 +112,7 @@ public static IPage ListOperations(this IProviderOperat /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions', 'All' + /// 'LinuxFunctions' /// public static IPage GetAvailableStacksOnPrem(this IProviderOperations operations, string osTypeSelected = default(string)) { @@ -306,7 +130,7 @@ public static IPage ListOperations(this IProviderOperat /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions', 'All' + /// 'LinuxFunctions' /// /// /// The cancellation token. @@ -359,130 +183,6 @@ public static IPage GetAvailableStacksNext(this IProvi } } - /// - /// Get available Function app frameworks and their versions - /// - /// - /// Description for Get available Function app frameworks and their versions - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetFunctionAppStacksNext(this IProviderOperations operations, string nextPageLink) - { - return operations.GetFunctionAppStacksNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get available Function app frameworks and their versions - /// - /// - /// Description for Get available Function app frameworks and their versions - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetFunctionAppStacksNextAsync(this IProviderOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetFunctionAppStacksNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get available Function app frameworks and their versions for location - /// - /// - /// Description for Get available Function app frameworks and their versions - /// for location - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetFunctionAppStacksForLocationNext(this IProviderOperations operations, string nextPageLink) - { - return operations.GetFunctionAppStacksForLocationNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get available Function app frameworks and their versions for location - /// - /// - /// Description for Get available Function app frameworks and their versions - /// for location - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetFunctionAppStacksForLocationNextAsync(this IProviderOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetFunctionAppStacksForLocationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get available Web app frameworks and their versions for location - /// - /// - /// Description for Get available Web app frameworks and their versions for - /// location - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetWebAppStacksForLocationNext(this IProviderOperations operations, string nextPageLink) - { - return operations.GetWebAppStacksForLocationNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get available Web app frameworks and their versions for location - /// - /// - /// Description for Get available Web app frameworks and their versions for - /// location - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetWebAppStacksForLocationNextAsync(this IProviderOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWebAppStacksForLocationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all available operations for the Microsoft.Web resource provider. Also /// exposes resource metric definitions @@ -527,46 +227,6 @@ public static IPage ListOperationsNext(this IProviderOp } } - /// - /// Get available Web app frameworks and their versions - /// - /// - /// Description for Get available Web app frameworks and their versions - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetWebAppStacksNext(this IProviderOperations operations, string nextPageLink) - { - return operations.GetWebAppStacksNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get available Web app frameworks and their versions - /// - /// - /// Description for Get available Web app frameworks and their versions - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetWebAppStacksNextAsync(this IProviderOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWebAppStacksNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Get available application frameworks and their versions /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs index 6ff03fcd7313..1c65562c417c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs @@ -19,42 +19,50 @@ public static IEnumerable> ApiInfo_WebSiteManageme { return new Tuple[] { - new Tuple("CertificateRegistration", "AppServiceCertificateOrders", "2020-12-01"), - new Tuple("CertificateRegistration", "CertificateOrdersDiagnostics", "2020-12-01"), - new Tuple("CertificateRegistration", "CertificateRegistrationProvider", "2020-12-01"), - new Tuple("DomainRegistration", "DomainRegistrationProvider", "2020-12-01"), - new Tuple("DomainRegistration", "Domains", "2020-12-01"), - new Tuple("DomainRegistration", "TopLevelDomains", "2020-12-01"), - new Tuple("Web", "AppServiceEnvironments", "2020-12-01"), - new Tuple("Web", "AppServicePlans", "2020-12-01"), - new Tuple("Web", "Certificates", "2020-12-01"), - new Tuple("Web", "CheckNameAvailability", "2020-12-01"), - new Tuple("Web", "DeletedWebApps", "2020-12-01"), - new Tuple("Web", "Diagnostics", "2020-12-01"), - new Tuple("Web", "GenerateGithubAccessTokenForAppserviceCLIAsync", "2020-12-01"), - new Tuple("Web", "GetPublishingUser", "2020-12-01"), - new Tuple("Web", "GetSourceControl", "2020-12-01"), - new Tuple("Web", "GetSubscriptionDeploymentLocations", "2020-12-01"), - new Tuple("Web", "Global", "2020-12-01"), - new Tuple("Web", "ListBillingMeters", "2020-12-01"), - new Tuple("Web", "ListGeoRegions", "2020-12-01"), - new Tuple("Web", "ListPremierAddOnOffers", "2020-12-01"), - new Tuple("Web", "ListSiteIdentifiersAssignedToHostName", "2020-12-01"), - new Tuple("Web", "ListSkus", "2020-12-01"), - new Tuple("Web", "ListSourceControls", "2020-12-01"), - new Tuple("Web", "Provider", "2020-12-01"), - new Tuple("Web", "Recommendations", "2020-12-01"), - new Tuple("Web", "ResourceHealthMetadata", "2020-12-01"), - new Tuple("Web", "StaticSites", "2020-12-01"), - new Tuple("Web", "UpdatePublishingUser", "2020-12-01"), - new Tuple("Web", "UpdateSourceControl", "2020-12-01"), - new Tuple("Web", "Validate", "2020-12-01"), - new Tuple("Web", "VerifyHostingEnvironmentVnet", "2020-12-01"), - new Tuple("Web", "WebApps", "2020-12-01"), - new Tuple("WebSiteManagementClient", "Move", "2020-12-01"), - new Tuple("WebSiteManagementClient", "ValidateMove", "2020-12-01"), + new Tuple("CertificateRegistration", "AppServiceCertificateOrders", "2020-06-01"), + new Tuple("CertificateRegistration", "CertificateRegistrationProvider", "2020-06-01"), + new Tuple("DomainRegistration", "DomainRegistrationProvider", "2020-06-01"), + new Tuple("DomainRegistration", "Domains", "2020-06-01"), + new Tuple("DomainRegistration", "TopLevelDomains", "2020-06-01"), + new Tuple("Web", "AppServiceEnvironments", "2020-06-01"), + new Tuple("Web", "AppServicePlans", "2020-06-01"), + new Tuple("Web", "Certificates", "2020-06-01"), + new Tuple("Web", "CheckNameAvailability", "2020-06-01"), + new Tuple("Web", "DeletedWebApps", "2020-06-01"), + new Tuple("Web", "Diagnostics", "2020-06-01"), + new Tuple("Web", "GetPublishingUser", "2020-06-01"), + new Tuple("Web", "GetSourceControl", "2020-06-01"), + new Tuple("Web", "GetSubscriptionDeploymentLocations", "2020-06-01"), + new Tuple("Web", "ListBillingMeters", "2020-06-01"), + new Tuple("Web", "ListGeoRegions", "2020-06-01"), + new Tuple("Web", "ListPremierAddOnOffers", "2020-06-01"), + new Tuple("Web", "ListSiteIdentifiersAssignedToHostName", "2020-06-01"), + new Tuple("Web", "ListSkus", "2020-06-01"), + new Tuple("Web", "ListSourceControls", "2020-06-01"), + new Tuple("Web", "Provider", "2020-06-01"), + new Tuple("Web", "Recommendations", "2020-06-01"), + new Tuple("Web", "ResourceHealthMetadata", "2020-06-01"), + new Tuple("Web", "StaticSites", "2020-06-01"), + new Tuple("Web", "UpdatePublishingUser", "2020-06-01"), + new Tuple("Web", "UpdateSourceControl", "2020-06-01"), + new Tuple("Web", "Validate", "2020-06-01"), + new Tuple("Web", "VerifyHostingEnvironmentVnet", "2020-06-01"), + new Tuple("Web", "WebApps", "2020-06-01"), + new Tuple("WebSiteManagementClient", "Move", "2020-06-01"), + new Tuple("WebSiteManagementClient", "ValidateMove", "2020-06-01"), }.AsEnumerable(); } } + // BEGIN: Code Generation Metadata Section + public static readonly String AutoRestVersion = "v2"; + public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-06 --csharp-sdks-folder=K:\\DotNet-SDK\\Sep-2020\\azure-sdk-for-net\\sdk"; + public static readonly String GithubForkName = "Azure"; + public static readonly String GithubBranchName = "master"; + public static readonly String GithubCommidId = "1b04f5fce19cd330dcc0eec11a98e499c0cda50d"; + public static readonly String CodeGenerationErrors = ""; + public static readonly String GithubRepoName = "azure-rest-api-specs"; + // END: Code Generation Metadata Section } } + diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperations.cs index 197075937acc..a8a84874472b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperations.cs @@ -51,18 +51,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) public WebSiteManagementClient Client { get; private set; } /// - /// Generates a preview workflow file for the static site + /// Get all Static Sites for a subscription. /// /// - /// Description for Generates a preview workflow file for the static site + /// Description for Get all Static Sites for a subscription. /// - /// - /// Location where you plan to create the static site. - /// - /// - /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. - /// See example. - /// /// /// Headers that will be added to request. /// @@ -84,16 +77,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PreviewWorkflowWithHttpMessagesAsync(string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - if (staticSitesWorkflowPreviewRequest == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSitesWorkflowPreviewRequest"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -109,15 +94,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("staticSitesWorkflowPreviewRequest", staticSitesWorkflowPreviewRequest); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PreviewWorkflow", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/previewStaticSiteWorkflowFile").ToString(); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -131,7 +113,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -162,12 +144,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(staticSitesWorkflowPreviewRequest != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSitesWorkflowPreviewRequest, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -218,7 +194,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -231,7 +207,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -251,11 +227,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Get all Static Sites for a subscription. + /// Gets all static sites in the specified resource group. /// /// - /// Description for Get all Static Sites for a subscription. + /// Description for Gets all static sites in the specified resource group. /// + /// + /// Name of the resource group to which the resource belongs. + /// /// /// Headers that will be added to request. /// @@ -277,8 +256,27 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetStaticSitesByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -294,12 +292,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSitesByResourceGroup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -427,14 +427,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static sites in the specified resource group. + /// Gets the details of a static site. /// /// - /// Description for Gets all static sites in the specified resource group. + /// Description for Gets the details of a static site. /// /// /// Name of the resource group to which the resource belongs. /// + /// + /// Name of the static site. + /// /// /// Headers that will be added to request. /// @@ -456,7 +459,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetStaticSitesByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -477,6 +480,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); } } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -493,13 +500,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSitesByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSite", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -594,7 +603,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -607,7 +616,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -627,16 +636,21 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the details of a static site. + /// Creates a new static site in an existing resource group, or updates an + /// existing static site. /// /// - /// Description for Gets the details of a static site. + /// Description for Creates a new static site in an existing resource group, or + /// updates an existing static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. /// /// /// Headers that will be added to request. @@ -659,7 +673,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -684,6 +698,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (staticSiteEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteEnvelope"); + } + if (staticSiteEnvelope != null) + { + staticSiteEnvelope.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -701,8 +723,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("staticSiteEnvelope", staticSiteEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSite", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -722,7 +745,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -753,6 +776,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(staticSiteEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -773,7 +802,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -828,6 +857,24 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -835,36 +882,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) return _result; } - /// - /// Creates a new static site in an existing resource group, or updates an - /// existing static site. - /// - /// - /// Description for Creates a new static site in an existing resource group, or - /// updates an existing static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to create or update. - /// - /// - /// A JSON representation of the staticsite properties. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Deletes a static site. /// @@ -878,36 +895,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// Name of the static site to delete. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteStaticSiteWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Creates a new static site in an existing resource group, or updates an - /// existing static site. - /// - /// - /// Description for Creates a new static site in an existing resource group, or - /// updates an existing static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to create or update. - /// - /// - /// A JSON representation of the staticsite properties. See example. - /// - /// /// Headers that will be added to request. /// /// @@ -916,9 +903,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -928,7 +912,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSitePatchResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -953,10 +937,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (staticSiteEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -974,9 +954,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("staticSiteEnvelope", staticSiteEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSite", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -996,7 +975,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1027,12 +1006,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(staticSiteEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1083,49 +1056,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1134,19 +1071,21 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the list of users of a static site. + /// Creates a new static site in an existing resource group, or updates an + /// existing static site. /// /// - /// Description for Gets the list of users of a static site. + /// Description for Creates a new static site in an existing resource group, or + /// updates an existing static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. + /// Name of the static site to create or update. /// - /// - /// The auth provider for the users. + /// + /// A JSON representation of the staticsite properties. See example. /// /// /// Headers that will be added to request. @@ -1169,7 +1108,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteUsersWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSitePatchResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1194,9 +1133,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (authprovider == null) + if (staticSiteEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authprovider"); + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteEnvelope"); } if (Client.SubscriptionId == null) { @@ -1215,16 +1154,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("authprovider", authprovider); + tracingParameters.Add("staticSiteEnvelope", staticSiteEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteUsers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateStaticSite", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{authprovider}", System.Uri.EscapeDataString(authprovider)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1238,7 +1176,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1269,6 +1207,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(staticSiteEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -1289,7 +1233,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1319,7 +1263,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1332,7 +1276,25 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1352,22 +1314,19 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Deletes the user entry from the static site. + /// Gets the list of users of a static site. /// /// - /// Description for Deletes the user entry from the static site. + /// Description for Gets the list of users of a static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the staticsite. + /// Name of the static site. /// /// - /// The auth provider for this user. - /// - /// - /// The user id of the user. + /// The auth provider for the users. /// /// /// Headers that will be added to request. @@ -1378,6 +1337,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1387,7 +1349,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteStaticSiteUserWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, string userid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteUsersWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1416,10 +1378,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "authprovider"); } - if (userid == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "userid"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1438,17 +1396,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("authprovider", authprovider); - tracingParameters.Add("userid", userid); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSiteUser", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteUsers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{authprovider}", System.Uri.EscapeDataString(authprovider)); - _url = _url.Replace("{userid}", System.Uri.EscapeDataString(userid)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1462,7 +1418,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1543,13 +1499,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1558,16 +1532,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Updates a user entry with the listed roles + /// Deletes the user entry from the static site. /// /// - /// Description for Updates a user entry with the listed roles + /// Description for Deletes the user entry from the static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. + /// Name of the staticsite. /// /// /// The auth provider for this user. @@ -1575,9 +1549,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// The user id of the user. /// - /// - /// A JSON representation of the StaticSiteUser properties. See example. - /// /// /// Headers that will be added to request. /// @@ -1587,9 +1558,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1599,7 +1567,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateStaticSiteUserWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, string userid, StaticSiteUserARMResource staticSiteUserEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteStaticSiteUserWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, string userid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1632,10 +1600,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "userid"); } - if (staticSiteUserEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1655,9 +1619,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("authprovider", authprovider); tracingParameters.Add("userid", userid); - tracingParameters.Add("staticSiteUserEnvelope", staticSiteUserEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateStaticSiteUser", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSiteUser", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1679,7 +1642,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1710,12 +1673,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(staticSiteUserEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1766,31 +1723,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1799,10 +1738,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static site builds for a particular static site. + /// Updates a user entry with the listed roles /// /// - /// Description for Gets all static site builds for a particular static site. + /// Description for Updates a user entry with the listed roles /// /// /// Name of the resource group to which the resource belongs. @@ -1810,6 +1749,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// + /// + /// The auth provider for this user. + /// + /// + /// The user id of the user. + /// + /// + /// A JSON representation of the StaticSiteUser properties. See example. + /// /// /// Headers that will be added to request. /// @@ -1831,7 +1779,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetStaticSiteBuildsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateStaticSiteUserWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, string userid, StaticSiteUserARMResource staticSiteUserEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1856,6 +1804,18 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (authprovider == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authprovider"); + } + if (userid == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "userid"); + } + if (staticSiteUserEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1873,14 +1833,19 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("authprovider", authprovider); + tracingParameters.Add("userid", userid); + tracingParameters.Add("staticSiteUserEnvelope", staticSiteUserEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuilds", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateStaticSiteUser", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{authprovider}", System.Uri.EscapeDataString(authprovider)); + _url = _url.Replace("{userid}", System.Uri.EscapeDataString(userid)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1894,7 +1859,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1925,6 +1890,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(staticSiteUserEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -1975,7 +1946,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1988,7 +1959,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2008,10 +1979,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the details of a static site build. + /// Gets all static site builds for a particular static site. /// /// - /// Description for Gets the details of a static site build. + /// Description for Gets all static site builds for a particular static site. /// /// /// Name of the resource group to which the resource belongs. @@ -2019,9 +1990,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The stage site identifier. - /// /// /// Headers that will be added to request. /// @@ -2043,7 +2011,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetStaticSiteBuildsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2068,10 +2036,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (environmentName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2089,16 +2053,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("environmentName", environmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuild", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuilds", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2193,7 +2155,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2206,7 +2168,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2226,38 +2188,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Deletes a static site build. - /// - /// - /// Description for Deletes a static site build. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The stage site identifier. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Creates or updates the app settings of a static site build. + /// Gets the details of a static site build. /// /// - /// Description for Creates or updates the app settings of a static site build. + /// Description for Gets the details of a static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -2265,12 +2199,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - /// - /// The dictionary containing the static site app settings to update. - /// /// /// Headers that will be added to request. /// @@ -2292,7 +2223,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateStaticSiteBuildAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2317,13 +2248,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (environmentName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); - } - if (appSettings == null) + if (prId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); + throw new ValidationException(ValidationRules.CannotBeNull, "prId"); } if (Client.SubscriptionId == null) { @@ -2342,17 +2269,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("environmentName", environmentName); - tracingParameters.Add("appSettings", appSettings); + tracingParameters.Add("prId", prId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteBuildAppSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuild", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/appsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2366,7 +2292,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2397,12 +2323,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(appSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -2453,7 +2373,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2466,7 +2386,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2486,11 +2406,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates or updates the function app settings of a static site build. + /// Deletes a static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site build. + /// Description for Deletes a static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -2498,12 +2417,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - /// - /// The dictionary containing the static site function app settings to update. - /// /// /// Headers that will be added to request. /// @@ -2513,9 +2429,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -2525,7 +2438,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2550,15 +2463,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (environmentName == null) + if (prId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + throw new ValidationException(ValidationRules.CannotBeNull, "prId"); } - if (appSettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); - } - if (Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -2575,17 +2484,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("environmentName", environmentName); - tracingParameters.Add("appSettings", appSettings); + tracingParameters.Add("prId", prId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteBuildFunctionAppSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSiteBuild", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/functionappsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2599,7 +2507,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2630,12 +2538,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(appSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -2656,7 +2558,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2686,31 +2588,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -2719,10 +2603,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the functions of a particular static site build. + /// Creates or updates the function app settings of a static site build. /// /// - /// Description for Gets the functions of a particular static site build. + /// Description for Creates or updates the function app settings of a static + /// site build. /// /// /// Name of the resource group to which the resource belongs. @@ -2730,9 +2615,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// + /// + /// /// /// Headers that will be added to request. /// @@ -2754,7 +2641,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteBuildFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2779,9 +2666,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (environmentName == null) + if (prId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "prId"); + } + if (appSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); } if (Client.SubscriptionId == null) { @@ -2800,16 +2691,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("prId", prId); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteBuildFunctionAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/functions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/config/functionappsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2823,7 +2715,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2854,6 +2746,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(appSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -2874,7 +2772,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2904,7 +2802,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2917,7 +2815,25 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2937,10 +2853,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the application settings of a static site build. + /// Gets the functions of a particular static site build. /// /// - /// Description for Gets the application settings of a static site build. + /// Description for Gets the functions of a particular static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -2948,7 +2864,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -2972,7 +2888,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListStaticSiteBuildAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteBuildFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2997,9 +2913,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (environmentName == null) + if (prId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + throw new ValidationException(ValidationRules.CannotBeNull, "prId"); } if (Client.SubscriptionId == null) { @@ -3018,16 +2934,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("prId", prId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildAppSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listAppSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/functions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3041,7 +2957,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3122,7 +3038,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3135,7 +3051,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3155,10 +3071,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the application settings of a static site build. + /// Gets the application settings of a static site. /// /// - /// Description for Gets the application settings of a static site build. + /// Description for Gets the application settings of a static site. /// /// /// Name of the resource group to which the resource belongs. @@ -3166,7 +3082,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -3190,7 +3106,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3215,9 +3131,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (environmentName == null) + if (prId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + throw new ValidationException(ValidationRules.CannotBeNull, "prId"); } if (Client.SubscriptionId == null) { @@ -3236,16 +3152,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("prId", prId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctionAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listFunctionAppSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/listFunctionAppSettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3310,7 +3226,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3365,6 +3281,24 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -3373,12 +3307,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the details of the user provided function apps registered with a - /// static site build + /// Creates or updates the function app settings of a static site. /// /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site build + /// Description for Creates or updates the function app settings of a static + /// site. /// /// /// Name of the resource group to which the resource belongs. @@ -3386,8 +3319,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The stage site identifier. + /// /// /// /// Headers that will be added to request. @@ -3410,7 +3342,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetUserProvidedFunctionAppsForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3435,9 +3367,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (environmentName == null) + if (appSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); } if (Client.SubscriptionId == null) { @@ -3456,16 +3388,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppsForStaticSiteBuild", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteFunctionAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3479,7 +3410,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3510,6 +3441,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(appSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -3530,7 +3467,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3560,7 +3497,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3573,7 +3510,25 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3593,12 +3548,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the details of the user provided function app registered with a static - /// site build + /// Creates an invitation link for a user with the role /// /// - /// Description for Gets the details of the user provided function app - /// registered with a static site build + /// Description for Creates an invitation link for a user with the role /// /// /// Name of the resource group to which the resource belongs. @@ -3606,11 +3559,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app registered with the static site build. + /// /// /// /// Headers that will be added to request. @@ -3633,7 +3582,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetUserProvidedFunctionAppForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateUserRolesInvitationLinkWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3658,13 +3607,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (environmentName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); - } - if (functionAppName == null) + if (staticSiteUserRolesInvitationEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserRolesInvitationEnvelope"); } if (Client.SubscriptionId == null) { @@ -3683,18 +3628,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("environmentName", environmentName); - tracingParameters.Add("functionAppName", functionAppName); + tracingParameters.Add("staticSiteUserRolesInvitationEnvelope", staticSiteUserRolesInvitationEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppForStaticSiteBuild", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateUserRolesInvitationLink", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); - _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3708,7 +3650,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3739,6 +3681,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(staticSiteUserRolesInvitationEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserRolesInvitationEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -3789,7 +3737,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3802,7 +3750,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3822,65 +3770,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Register a user provided function app with a static site build - /// - /// - /// Description for Register a user provided function app with a static site - /// build - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app to register with the static site build. - /// - /// - /// A JSON representation of the user provided function app properties. See - /// example. - /// - /// - /// Specify <code>true</code> to force the update of the auth - /// configuration on the function app even if an AzureStaticWebApps provider is - /// already configured on the function app. The default is - /// <code>false</code>. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> RegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Detach the user provided function app from the static site build + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Detach the user provided function app from the static site - /// build + /// Description for Gets all static site custom domains for a particular static + /// site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. - /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app registered with the static site build. + /// Name of the static site resource to search in. /// /// /// Headers that will be added to request. @@ -3891,6 +3791,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -3900,7 +3803,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DetachUserProvidedFunctionAppFromStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteCustomDomainsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3925,14 +3828,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (environmentName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); - } - if (functionAppName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -3950,18 +3845,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("environmentName", environmentName); - tracingParameters.Add("functionAppName", functionAppName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DetachUserProvidedFunctionAppFromStaticSiteBuild", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteCustomDomains", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); - _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3975,7 +3866,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -4026,7 +3917,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4056,13 +3947,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4071,11 +3980,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Deploys zipped content to a specific environment of a static site. + /// Creates a new static site custom domain in an existing resource group and + /// static site. /// /// - /// Description for Deploys zipped content to a specific environment of a - /// static site. + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. /// /// /// Name of the resource group to which the resource belongs. @@ -4083,43 +3993,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// Name of the environment. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. See - /// example. + /// + /// The custom domain to create. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task CreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginCreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Creates or updates the app settings of a static site. - /// - /// - /// Description for Creates or updates the app settings of a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The dictionary containing the static site app settings to update. - /// - /// - /// Headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. @@ -4139,7 +4017,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateStaticSiteAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4164,9 +4042,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (appSettings == null) + if (domainName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); } if (Client.SubscriptionId == null) { @@ -4185,15 +4063,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("appSettings", appSettings); + tracingParameters.Add("domainName", domainName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteAppSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteCustomDomain", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/appsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4238,12 +4117,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(appSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -4264,7 +4137,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4294,7 +4167,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4307,7 +4180,25 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4327,11 +4218,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates or updates the function app settings of a static site. + /// Deletes a custom domain. /// /// - /// Description for Creates or updates the function app settings of a static - /// site. + /// Description for Deletes a custom domain. /// /// /// Name of the resource group to which the resource belongs. @@ -4339,8 +4229,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The dictionary containing the static site function app settings to update. + /// + /// The custom domain to delete. /// /// /// Headers that will be added to request. @@ -4351,9 +4241,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -4363,7 +4250,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4388,9 +4275,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (appSettings == null) + if (domainName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); } if (Client.SubscriptionId == null) { @@ -4409,15 +4296,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("appSettings", appSettings); + tracingParameters.Add("domainName", domainName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteFunctionAppSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSiteCustomDomain", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4431,7 +4319,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -4462,12 +4350,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(appSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -4488,7 +4370,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4518,31 +4400,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4551,10 +4415,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates an invitation link for a user with the role + /// Validates a particular custom domain can be added to a static site. /// /// - /// Description for Creates an invitation link for a user with the role + /// Description for Validates a particular custom domain can be added to a + /// static site. /// /// /// Name of the resource group to which the resource belongs. @@ -4562,7 +4427,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// + /// The custom domain to validate. /// /// /// Headers that will be added to request. @@ -4573,9 +4439,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -4585,7 +4448,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateUserRolesInvitationLinkWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4610,9 +4473,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (staticSiteUserRolesInvitationEnvelope == null) + if (domainName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserRolesInvitationEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); } if (Client.SubscriptionId == null) { @@ -4631,15 +4494,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("staticSiteUserRolesInvitationEnvelope", staticSiteUserRolesInvitationEnvelope); + tracingParameters.Add("domainName", domainName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateUserRolesInvitationLink", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ValidateCustomDomainCanBeAddedToStaticSite", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4684,12 +4548,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(staticSiteUserRolesInvitationEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserRolesInvitationEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -4710,7 +4568,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4740,31 +4598,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4773,17 +4613,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static site custom domains for a particular static site. + /// Detaches a static site. /// /// - /// Description for Gets all static site custom domains for a particular static - /// site. + /// Description for Detaches a static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site to detach. /// /// /// Headers that will be added to request. @@ -4794,9 +4633,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -4806,7 +4642,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteCustomDomainsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4849,11 +4685,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteCustomDomains", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DetachStaticSite", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -4869,7 +4705,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -4920,7 +4756,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4950,31 +4786,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4983,20 +4801,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets an existing custom domain for a particular static site. + /// Gets the functions of a static site. /// /// - /// Description for Gets an existing custom domain for a particular static - /// site. + /// Description for Gets the functions of a static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. - /// - /// - /// The custom domain name. + /// Name of the static site. /// /// /// Headers that will be added to request. @@ -5019,7 +4833,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5044,10 +4858,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5065,16 +4875,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainName", domainName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteCustomDomain", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -5169,7 +4977,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5182,7 +4990,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5202,12 +5010,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates a new static site custom domain in an existing resource group and - /// static site. + /// Gets the application settings of a static site. /// /// - /// Description for Creates a new static site custom domain in an existing - /// resource group and static site. + /// Description for Gets the application settings of a static site. /// /// /// Name of the resource group to which the resource belongs. @@ -5215,5518 +5021,28 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The custom domain to create. - /// - /// - /// A JSON representation of the static site custom domain request properties. - /// See example. - /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a custom domain. - /// - /// - /// Description for Deletes a custom domain. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to delete. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Validates a particular custom domain can be added to a static site. - /// - /// - /// Description for Validates a particular custom domain can be added to a - /// static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to validate. - /// - /// - /// A JSON representation of the static site custom domain request properties. - /// See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Detaches a static site. - /// - /// - /// Description for Detaches a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to detach. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDetachStaticSiteWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the functions of a static site. - /// - /// - /// Description for Gets the functions of a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// 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>> ListStaticSiteFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctions", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the application settings of a static site. - /// - /// - /// Description for Gets the application settings of a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// 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> ListStaticSiteAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteAppSettings", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listAppSettings").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists the roles configured for the static site. - /// - /// - /// Description for Lists the roles configured for the static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// 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> ListStaticSiteConfiguredRolesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteConfiguredRoles", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listConfiguredRoles").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the application settings of a static site. - /// - /// - /// Description for Gets the application settings of a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// 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> ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctionAppSettings", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists the secrets for an existing static site. - /// - /// - /// Description for Lists the secrets for an existing static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// 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> ListStaticSiteSecretsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteSecrets", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the list of private endpoint connections associated with a static site - /// - /// - /// Description for Gets the list of private endpoint connections associated - /// with a static site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// 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>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionList", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a private endpoint connection - /// - /// - /// Description for Gets a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// 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> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (privateEndpointConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// Request body. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// 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> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateLinkResources").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Resets the api key for an existing static site. - /// - /// - /// Description for Resets the api key for an existing static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// - /// - /// 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 ResetStaticSiteApiKeyWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (resetPropertiesEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resetPropertiesEnvelope"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("resetPropertiesEnvelope", resetPropertiesEnvelope); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ResetStaticSiteApiKey", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(resetPropertiesEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(resetPropertiesEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Gets the details of the user provided function apps registered with a - /// static site - /// - /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// 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>> GetUserProvidedFunctionAppsForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppsForStaticSite", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the details of the user provided function app registered with a static - /// site - /// - /// - /// Description for Gets the details of the user provided function app - /// registered with a static site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app registered with the static site. - /// - /// - /// 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> GetUserProvidedFunctionAppForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (functionAppName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("functionAppName", functionAppName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppForStaticSite", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Register a user provided function app with a static site - /// - /// - /// Description for Register a user provided function app with a static site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app to register with the static site. - /// - /// - /// A JSON representation of the user provided function app properties. See - /// example. - /// - /// - /// Specify <code>true</code> to force the update of the auth - /// configuration on the function app even if an AzureStaticWebApps provider is - /// already configured on the function app. The default is - /// <code>false</code>. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> RegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginRegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Detach the user provided function app from the static site - /// - /// - /// Description for Detach the user provided function app from the static site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app registered with the static site. - /// - /// - /// 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 DetachUserProvidedFunctionAppFromStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (functionAppName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("functionAppName", functionAppName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DetachUserProvidedFunctionAppFromStaticSite", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Deploys zipped content to a static site. - /// - /// - /// Description for Deploys zipped content to a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. See - /// example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task CreateZipDeploymentForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginCreateZipDeploymentForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Creates a new static site in an existing resource group, or updates an - /// existing static site. - /// - /// - /// Description for Creates a new static site in an existing resource group, or - /// updates an existing static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to create or update. - /// - /// - /// A JSON representation of the staticsite properties. See example. - /// - /// - /// 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> BeginCreateOrUpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (staticSiteEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteEnvelope"); - } - if (staticSiteEnvelope != null) - { - staticSiteEnvelope.Validate(); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("staticSiteEnvelope", staticSiteEnvelope); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateStaticSite", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(staticSiteEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a static site. - /// - /// - /// Description for Deletes a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to delete. - /// - /// - /// 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 BeginDeleteStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteStaticSite", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Deletes a static site build. - /// - /// - /// Description for Deletes a static site build. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The stage site identifier. - /// - /// - /// 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 BeginDeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (environmentName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("environmentName", environmentName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteStaticSiteBuild", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Register a user provided function app with a static site build - /// - /// - /// Description for Register a user provided function app with a static site - /// build - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app to register with the static site build. - /// - /// - /// A JSON representation of the user provided function app properties. See - /// example. - /// - /// - /// Specify <code>true</code> to force the update of the auth - /// configuration on the function app even if an AzureStaticWebApps provider is - /// already configured on the function app. The default is - /// <code>false</code>. - /// - /// - /// 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> BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (environmentName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); - } - if (functionAppName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); - } - if (staticSiteUserProvidedFunctionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserProvidedFunctionEnvelope"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("environmentName", environmentName); - tracingParameters.Add("functionAppName", functionAppName); - tracingParameters.Add("staticSiteUserProvidedFunctionEnvelope", staticSiteUserProvidedFunctionEnvelope); - tracingParameters.Add("isForced", isForced); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRegisterUserProvidedFunctionAppWithStaticSiteBuild", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); - _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (isForced != null) - { - _queryParameters.Add(string.Format("isForced={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(isForced, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(staticSiteUserProvidedFunctionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserProvidedFunctionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deploys zipped content to a specific environment of a static site. - /// - /// - /// Description for Deploys zipped content to a specific environment of a - /// static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the environment. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. See - /// example. - /// - /// - /// 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 BeginCreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (environmentName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); - } - if (staticSiteZipDeploymentEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteZipDeploymentEnvelope"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("environmentName", environmentName); - tracingParameters.Add("staticSiteZipDeploymentEnvelope", staticSiteZipDeploymentEnvelope); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateZipDeploymentForStaticSiteBuild", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/zipdeploy").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(staticSiteZipDeploymentEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteZipDeploymentEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Creates a new static site custom domain in an existing resource group and - /// static site. - /// - /// - /// Description for Creates a new static site custom domain in an existing - /// resource group and static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to create. - /// - /// - /// A JSON representation of the static site custom domain request properties. - /// See example. - /// - /// - /// 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> BeginCreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (domainName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); - } - if (staticSiteCustomDomainRequestPropertiesEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteCustomDomainRequestPropertiesEnvelope"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("domainName", domainName); - tracingParameters.Add("staticSiteCustomDomainRequestPropertiesEnvelope", staticSiteCustomDomainRequestPropertiesEnvelope); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateStaticSiteCustomDomain", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(staticSiteCustomDomainRequestPropertiesEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteCustomDomainRequestPropertiesEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a custom domain. - /// - /// - /// Description for Deletes a custom domain. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to delete. - /// - /// - /// 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 BeginDeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (domainName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("domainName", domainName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteStaticSiteCustomDomain", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Validates a particular custom domain can be added to a static site. - /// - /// - /// Description for Validates a particular custom domain can be added to a - /// static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to validate. - /// - /// - /// A JSON representation of the static site custom domain request properties. - /// See example. - /// - /// - /// 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 BeginValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (domainName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); - } - if (staticSiteCustomDomainRequestPropertiesEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteCustomDomainRequestPropertiesEnvelope"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("domainName", domainName); - tracingParameters.Add("staticSiteCustomDomainRequestPropertiesEnvelope", staticSiteCustomDomainRequestPropertiesEnvelope); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginValidateCustomDomainCanBeAddedToStaticSite", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(staticSiteCustomDomainRequestPropertiesEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteCustomDomainRequestPropertiesEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Detaches a static site. - /// - /// - /// Description for Detaches a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to detach. - /// - /// - /// 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 BeginDetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDetachStaticSite", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// 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> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (privateEndpointConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); - } - if (privateEndpointWrapper == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); - tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnection", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(privateEndpointWrapper != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// 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> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (privateEndpointConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 204) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Register a user provided function app with a static site - /// - /// - /// Description for Register a user provided function app with a static site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app to register with the static site. - /// - /// - /// A JSON representation of the user provided function app properties. See - /// example. - /// - /// - /// Specify <code>true</code> to force the update of the auth - /// configuration on the function app even if an AzureStaticWebApps provider is - /// already configured on the function app. The default is - /// <code>false</code>. - /// - /// - /// 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> BeginRegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (functionAppName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); - } - if (staticSiteUserProvidedFunctionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserProvidedFunctionEnvelope"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("functionAppName", functionAppName); - tracingParameters.Add("staticSiteUserProvidedFunctionEnvelope", staticSiteUserProvidedFunctionEnvelope); - tracingParameters.Add("isForced", isForced); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRegisterUserProvidedFunctionAppWithStaticSite", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (isForced != null) - { - _queryParameters.Add(string.Format("isForced={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(isForced, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(staticSiteUserProvidedFunctionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserProvidedFunctionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deploys zipped content to a static site. - /// - /// - /// Description for Deploys zipped content to a static site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. See - /// example. - /// - /// - /// 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 BeginCreateZipDeploymentForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// 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> ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10751,10 +5067,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (staticSiteZipDeploymentEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteZipDeploymentEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -10772,180 +5084,20 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("staticSiteZipDeploymentEnvelope", staticSiteZipDeploymentEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateZipDeploymentForStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctionAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/zipdeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(staticSiteZipDeploymentEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteZipDeploymentEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Get all Static Sites for a subscription. - /// - /// - /// Description for Get all Static Sites for a 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -10953,7 +5105,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -11004,7 +5156,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -11034,7 +5186,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -11047,7 +5199,25 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -11067,13 +5237,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static sites in the specified resource group. + /// Lists the secrets for an existing static site. /// /// - /// Description for Gets all static sites in the specified resource group. + /// Description for Lists the secrets for an existing static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. /// /// /// Headers that will be added to request. @@ -11096,11 +5269,38 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetStaticSitesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListStaticSiteSecretsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -11109,14 +5309,22 @@ internal StaticSitesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSitesByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteSecrets", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -11124,7 +5332,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -11205,7 +5413,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -11218,7 +5426,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -11238,13 +5446,18 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the list of users of a static site. + /// Resets the api key for an existing static site. /// /// - /// Description for Gets the list of users of a static site. + /// Description for Resets the api key for an existing static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// /// /// /// Headers that will be added to request. @@ -11255,9 +5468,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -11267,11 +5477,42 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteUsersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ResetStaticSiteApiKeyWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (resetPropertiesEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resetPropertiesEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -11280,14 +5521,23 @@ internal StaticSitesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("resetPropertiesEnvelope", resetPropertiesEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteUsersNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ResetStaticSiteApiKey", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -11326,6 +5576,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(resetPropertiesEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(resetPropertiesEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -11376,31 +5632,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -11409,10 +5647,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static site builds for a particular static site. + /// Get all Static Sites for a subscription. /// /// - /// Description for Gets all static site builds for a particular static site. + /// Description for Get all Static Sites for a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -11438,7 +5676,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetStaticSiteBuildsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -11453,7 +5691,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuildsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -11547,7 +5785,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -11560,7 +5798,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -11580,10 +5818,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the functions of a particular static site build. + /// Gets all static sites in the specified resource group. /// /// - /// Description for Gets the functions of a particular static site build. + /// Description for Gets all static sites in the specified resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -11609,7 +5847,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteBuildFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetStaticSitesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -11624,7 +5862,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctionsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSitesByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -11718,7 +5956,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -11731,7 +5969,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -11751,12 +5989,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the details of the user provided function apps registered with a - /// static site build + /// Gets the list of users of a static site. /// /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site build + /// Description for Gets the list of users of a static site. /// /// /// The NextLink from the previous successful call to List operation. @@ -11782,7 +6018,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetUserProvidedFunctionAppsForStaticSiteBuildNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteUsersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -11797,7 +6033,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppsForStaticSiteBuildNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteUsersNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -11810,7 +6046,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -11891,7 +6127,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -11904,7 +6140,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -11924,11 +6160,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static site custom domains for a particular static site. + /// Gets all static site builds for a particular static site. /// /// - /// Description for Gets all static site custom domains for a particular static - /// site. + /// Description for Gets all static site builds for a particular static site. /// /// /// The NextLink from the previous successful call to List operation. @@ -11954,7 +6189,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteCustomDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetStaticSiteBuildsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -11969,7 +6204,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteCustomDomainsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuildsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -12063,7 +6298,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -12076,7 +6311,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -12096,10 +6331,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the functions of a static site. + /// Gets the functions of a particular static site build. /// /// - /// Description for Gets the functions of a static site. + /// Description for Gets the functions of a particular static site build. /// /// /// The NextLink from the previous successful call to List operation. @@ -12125,7 +6360,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteBuildFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -12140,7 +6375,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctionsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -12267,11 +6502,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the list of private endpoint connections associated with a static site + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Gets the list of private endpoint connections associated - /// with a static site + /// Description for Gets all static site custom domains for a particular static + /// site. /// /// /// The NextLink from the previous successful call to List operation. @@ -12297,7 +6532,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteCustomDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -12312,7 +6547,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteCustomDomainsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -12406,7 +6641,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -12419,7 +6654,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -12439,12 +6674,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the details of the user provided function apps registered with a - /// static site + /// Gets the functions of a static site. /// /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site + /// Description for Gets the functions of a static site. /// /// /// The NextLink from the previous successful call to List operation. @@ -12470,7 +6703,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetUserProvidedFunctionAppsForStaticSiteNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -12485,7 +6718,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppsForStaticSiteNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -12579,7 +6812,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -12592,7 +6825,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperationsExtensions.cs index 78c4805f4470..4fea3668e831 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperationsExtensions.cs @@ -21,54 +21,6 @@ namespace Microsoft.Azure.Management.WebSites /// public static partial class StaticSitesOperationsExtensions { - /// - /// Generates a preview workflow file for the static site - /// - /// - /// Description for Generates a preview workflow file for the static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Location where you plan to create the static site. - /// - /// - /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. - /// See example. - /// - public static StaticSitesWorkflowPreview PreviewWorkflow(this IStaticSitesOperations operations, string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest) - { - return operations.PreviewWorkflowAsync(location, staticSitesWorkflowPreviewRequest).GetAwaiter().GetResult(); - } - - /// - /// Generates a preview workflow file for the static site - /// - /// - /// Description for Generates a preview workflow file for the static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Location where you plan to create the static site. - /// - /// - /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. - /// See example. - /// - /// - /// The cancellation token. - /// - public static async Task PreviewWorkflowAsync(this IStaticSitesOperations operations, string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.PreviewWorkflowWithHttpMessagesAsync(location, staticSitesWorkflowPreviewRequest, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Get all Static Sites for a subscription. /// @@ -576,12 +528,12 @@ public static IPage GetStaticSiteBuilds(this IStatic /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - public static StaticSiteBuildARMResource GetStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) + public static StaticSiteBuildARMResource GetStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId) { - return operations.GetStaticSiteBuildAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); + return operations.GetStaticSiteBuildAsync(resourceGroupName, name, prId).GetAwaiter().GetResult(); } /// @@ -599,15 +551,15 @@ public static StaticSiteBuildARMResource GetStaticSiteBuild(this IStaticSitesOpe /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task GetStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, prId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -628,12 +580,12 @@ public static StaticSiteBuildARMResource GetStaticSiteBuild(this IStaticSitesOpe /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - public static void DeleteStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) + public static void DeleteStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId) { - operations.DeleteStaticSiteBuildAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); + operations.DeleteStaticSiteBuildAsync(resourceGroupName, name, prId).GetAwaiter().GetResult(); } /// @@ -651,22 +603,23 @@ public static void DeleteStaticSiteBuild(this IStaticSitesOperations operations, /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task DeleteStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, prId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Creates or updates the app settings of a static site build. + /// Creates or updates the function app settings of a static site build. /// /// - /// Description for Creates or updates the app settings of a static site build. + /// Description for Creates or updates the function app settings of a static + /// site build. /// /// /// The operations group for this extension method. @@ -677,22 +630,22 @@ public static void DeleteStaticSiteBuild(this IStaticSitesOperations operations, /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// - /// The dictionary containing the static site app settings to update. /// - public static StringDictionary CreateOrUpdateStaticSiteBuildAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StringDictionary appSettings) + public static StringDictionary CreateOrUpdateStaticSiteBuildFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, StringDictionary appSettings) { - return operations.CreateOrUpdateStaticSiteBuildAppSettingsAsync(resourceGroupName, name, environmentName, appSettings).GetAwaiter().GetResult(); + return operations.CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(resourceGroupName, name, prId, appSettings).GetAwaiter().GetResult(); } /// - /// Creates or updates the app settings of a static site build. + /// Creates or updates the function app settings of a static site build. /// /// - /// Description for Creates or updates the app settings of a static site build. + /// Description for Creates or updates the function app settings of a static + /// site build. /// /// /// The operations group for this extension method. @@ -703,29 +656,27 @@ public static StringDictionary CreateOrUpdateStaticSiteBuildAppSettings(this ISt /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// - /// The dictionary containing the static site app settings to update. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateStaticSiteBuildAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateStaticSiteBuildAppSettingsWithHttpMessagesAsync(resourceGroupName, name, environmentName, appSettings, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, prId, appSettings, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates the function app settings of a static site build. + /// Gets the functions of a particular static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site build. + /// Description for Gets the functions of a particular static site build. /// /// /// The operations group for this extension method. @@ -736,23 +687,19 @@ public static StringDictionary CreateOrUpdateStaticSiteBuildAppSettings(this ISt /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - /// - /// The dictionary containing the static site function app settings to update. - /// - public static StringDictionary CreateOrUpdateStaticSiteBuildFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StringDictionary appSettings) + public static IPage ListStaticSiteBuildFunctions(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId) { - return operations.CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(resourceGroupName, name, environmentName, appSettings).GetAwaiter().GetResult(); + return operations.ListStaticSiteBuildFunctionsAsync(resourceGroupName, name, prId).GetAwaiter().GetResult(); } /// - /// Creates or updates the function app settings of a static site build. + /// Gets the functions of a particular static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site build. + /// Description for Gets the functions of a particular static site build. /// /// /// The operations group for this extension method. @@ -763,28 +710,25 @@ public static StringDictionary CreateOrUpdateStaticSiteBuildFunctionAppSettings( /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - /// - /// The dictionary containing the static site function app settings to update. - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListStaticSiteBuildFunctionsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, environmentName, appSettings, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListStaticSiteBuildFunctionsWithHttpMessagesAsync(resourceGroupName, name, prId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the functions of a particular static site build. + /// Gets the application settings of a static site. /// /// - /// Description for Gets the functions of a particular static site build. + /// Description for Gets the application settings of a static site. /// /// /// The operations group for this extension method. @@ -795,19 +739,19 @@ public static StringDictionary CreateOrUpdateStaticSiteBuildFunctionAppSettings( /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - public static IPage ListStaticSiteBuildFunctions(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) + public static StringDictionary ListStaticSiteBuildFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId) { - return operations.ListStaticSiteBuildFunctionsAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); + return operations.ListStaticSiteBuildFunctionAppSettingsAsync(resourceGroupName, name, prId).GetAwaiter().GetResult(); } /// - /// Gets the functions of a particular static site build. + /// Gets the application settings of a static site. /// /// - /// Description for Gets the functions of a particular static site build. + /// Description for Gets the application settings of a static site. /// /// /// The operations group for this extension method. @@ -818,25 +762,26 @@ public static IPage ListStaticSiteBuildFu /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task> ListStaticSiteBuildFunctionsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListStaticSiteBuildFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteBuildFunctionsWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, prId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the application settings of a static site build. + /// Creates or updates the function app settings of a static site. /// /// - /// Description for Gets the application settings of a static site build. + /// Description for Creates or updates the function app settings of a static + /// site. /// /// /// The operations group for this extension method. @@ -847,19 +792,19 @@ public static IPage ListStaticSiteBuildFu /// /// Name of the static site. /// - /// - /// The stage site identifier. + /// /// - public static StringDictionary ListStaticSiteBuildAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) + public static StringDictionary CreateOrUpdateStaticSiteFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings) { - return operations.ListStaticSiteBuildAppSettingsAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateStaticSiteFunctionAppSettingsAsync(resourceGroupName, name, appSettings).GetAwaiter().GetResult(); } /// - /// Gets the application settings of a static site build. + /// Creates or updates the function app settings of a static site. /// /// - /// Description for Gets the application settings of a static site build. + /// Description for Creates or updates the function app settings of a static + /// site. /// /// /// The operations group for this extension method. @@ -870,25 +815,24 @@ public static StringDictionary ListStaticSiteBuildAppSettings(this IStaticSitesO /// /// Name of the static site. /// - /// - /// The stage site identifier. + /// /// /// /// The cancellation token. /// - public static async Task ListStaticSiteBuildAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateStaticSiteFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteBuildAppSettingsWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, appSettings, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the application settings of a static site build. + /// Creates an invitation link for a user with the role /// /// - /// Description for Gets the application settings of a static site build. + /// Description for Creates an invitation link for a user with the role /// /// /// The operations group for this extension method. @@ -899,19 +843,18 @@ public static StringDictionary ListStaticSiteBuildAppSettings(this IStaticSitesO /// /// Name of the static site. /// - /// - /// The stage site identifier. + /// /// - public static StringDictionary ListStaticSiteBuildFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) + public static StaticSiteUserInvitationResponseResource CreateUserRolesInvitationLink(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope) { - return operations.ListStaticSiteBuildFunctionAppSettingsAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); + return operations.CreateUserRolesInvitationLinkAsync(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope).GetAwaiter().GetResult(); } /// - /// Gets the application settings of a static site build. + /// Creates an invitation link for a user with the role /// /// - /// Description for Gets the application settings of a static site build. + /// Description for Creates an invitation link for a user with the role /// /// /// The operations group for this extension method. @@ -922,27 +865,25 @@ public static StringDictionary ListStaticSiteBuildFunctionAppSettings(this IStat /// /// Name of the static site. /// - /// - /// The stage site identifier. + /// /// /// /// The cancellation token. /// - public static async Task ListStaticSiteBuildFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateUserRolesInvitationLinkAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUserRolesInvitationLinkWithHttpMessagesAsync(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the details of the user provided function apps registered with a - /// static site build + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site build + /// Description for Gets all static site custom domains for a particular static + /// site. /// /// /// The operations group for this extension method. @@ -951,23 +892,19 @@ public static StringDictionary ListStaticSiteBuildFunctionAppSettings(this IStat /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. - /// - /// - /// The stage site identifier. + /// Name of the static site resource to search in. /// - public static IPage GetUserProvidedFunctionAppsForStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) + public static IPage ListStaticSiteCustomDomains(this IStaticSitesOperations operations, string resourceGroupName, string name) { - return operations.GetUserProvidedFunctionAppsForStaticSiteBuildAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); + return operations.ListStaticSiteCustomDomainsAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// - /// Gets the details of the user provided function apps registered with a - /// static site build + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site build + /// Description for Gets all static site custom domains for a particular static + /// site. /// /// /// The operations group for this extension method. @@ -976,29 +913,26 @@ public static IPage GetUserProvide /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. - /// - /// - /// The stage site identifier. + /// Name of the static site resource to search in. /// /// /// The cancellation token. /// - public static async Task> GetUserProvidedFunctionAppsForStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListStaticSiteCustomDomainsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetUserProvidedFunctionAppsForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListStaticSiteCustomDomainsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the details of the user provided function app registered with a static - /// site build + /// Creates a new static site custom domain in an existing resource group and + /// static site. /// /// - /// Description for Gets the details of the user provided function app - /// registered with a static site build + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. /// /// /// The operations group for this extension method. @@ -1009,24 +943,21 @@ public static IPage GetUserProvide /// /// Name of the static site. /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app registered with the static site build. + /// + /// The custom domain to create. /// - public static StaticSiteUserProvidedFunctionAppARMResource GetUserProvidedFunctionAppForStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName) + public static StaticSiteCustomDomainOverviewARMResource CreateOrUpdateStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) { - return operations.GetUserProvidedFunctionAppForStaticSiteBuildAsync(resourceGroupName, name, environmentName, functionAppName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); } /// - /// Gets the details of the user provided function app registered with a static - /// site build + /// Creates a new static site custom domain in an existing resource group and + /// static site. /// /// - /// Description for Gets the details of the user provided function app - /// registered with a static site build + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. /// /// /// The operations group for this extension method. @@ -1037,29 +968,25 @@ public static StaticSiteUserProvidedFunctionAppARMResource GetUserProvidedFuncti /// /// Name of the static site. /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app registered with the static site build. + /// + /// The custom domain to create. /// /// /// The cancellation token. /// - public static async Task GetUserProvidedFunctionAppForStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetUserProvidedFunctionAppForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Register a user provided function app with a static site build + /// Deletes a custom domain. /// /// - /// Description for Register a user provided function app with a static site - /// build + /// Description for Deletes a custom domain. /// /// /// The operations group for this extension method. @@ -1070,33 +997,19 @@ public static StaticSiteUserProvidedFunctionAppARMResource GetUserProvidedFuncti /// /// Name of the static site. /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app to register with the static site build. - /// - /// - /// A JSON representation of the user provided function app properties. See - /// example. - /// - /// - /// Specify <code>true</code> to force the update of the auth - /// configuration on the function app even if an AzureStaticWebApps provider is - /// already configured on the function app. The default is - /// <code>false</code>. + /// + /// The custom domain to delete. /// - public static StaticSiteUserProvidedFunctionAppARMResource RegisterUserProvidedFunctionAppWithStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?)) + public static void DeleteStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) { - return operations.RegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced).GetAwaiter().GetResult(); + operations.DeleteStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); } /// - /// Register a user provided function app with a static site build + /// Deletes a custom domain. /// /// - /// Description for Register a user provided function app with a static site - /// build + /// Description for Deletes a custom domain. /// /// /// The operations group for this extension method. @@ -1107,39 +1020,23 @@ public static StaticSiteUserProvidedFunctionAppARMResource GetUserProvidedFuncti /// /// Name of the static site. /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app to register with the static site build. - /// - /// - /// A JSON representation of the user provided function app properties. See - /// example. - /// - /// - /// Specify <code>true</code> to force the update of the auth - /// configuration on the function app even if an AzureStaticWebApps provider is - /// already configured on the function app. The default is - /// <code>false</code>. + /// + /// The custom domain to delete. /// /// /// The cancellation token. /// - public static async Task RegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.RegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Detach the user provided function app from the static site build + /// Validates a particular custom domain can be added to a static site. /// /// - /// Description for Detach the user provided function app from the static site - /// build + /// Description for Validates a particular custom domain can be added to a + /// static site. /// /// /// The operations group for this extension method. @@ -1150,23 +1047,20 @@ public static StaticSiteUserProvidedFunctionAppARMResource GetUserProvidedFuncti /// /// Name of the static site. /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app registered with the static site build. + /// + /// The custom domain to validate. /// - public static void DetachUserProvidedFunctionAppFromStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName) + public static void ValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) { - operations.DetachUserProvidedFunctionAppFromStaticSiteBuildAsync(resourceGroupName, name, environmentName, functionAppName).GetAwaiter().GetResult(); + operations.ValidateCustomDomainCanBeAddedToStaticSiteAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); } /// - /// Detach the user provided function app from the static site build + /// Validates a particular custom domain can be added to a static site. /// /// - /// Description for Detach the user provided function app from the static site - /// build + /// Description for Validates a particular custom domain can be added to a + /// static site. /// /// /// The operations group for this extension method. @@ -1177,26 +1071,22 @@ public static void DetachUserProvidedFunctionAppFromStaticSiteBuild(this IStatic /// /// Name of the static site. /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app registered with the static site build. + /// + /// The custom domain to validate. /// /// /// The cancellation token. /// - public static async Task DetachUserProvidedFunctionAppFromStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ValidateCustomDomainCanBeAddedToStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DetachUserProvidedFunctionAppFromStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Deploys zipped content to a specific environment of a static site. + /// Detaches a static site. /// /// - /// Description for Deploys zipped content to a specific environment of a - /// static site. + /// Description for Detaches a static site. /// /// /// The operations group for this extension method. @@ -1205,26 +1095,18 @@ public static void DetachUserProvidedFunctionAppFromStaticSiteBuild(this IStatic /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. - /// - /// - /// Name of the environment. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. See - /// example. + /// Name of the static site to detach. /// - public static void CreateZipDeploymentForStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) + public static void DetachStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) { - operations.CreateZipDeploymentForStaticSiteBuildAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope).GetAwaiter().GetResult(); + operations.DetachStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// - /// Deploys zipped content to a specific environment of a static site. + /// Detaches a static site. /// /// - /// Description for Deploys zipped content to a specific environment of a - /// static site. + /// Description for Detaches a static site. /// /// /// The operations group for this extension method. @@ -1233,28 +1115,21 @@ public static void CreateZipDeploymentForStaticSiteBuild(this IStaticSitesOperat /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. - /// - /// - /// Name of the environment. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. See - /// example. + /// Name of the static site to detach. /// /// /// The cancellation token. /// - public static async Task CreateZipDeploymentForStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DetachStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.CreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DetachStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Creates or updates the app settings of a static site. + /// Gets the functions of a static site. /// /// - /// Description for Creates or updates the app settings of a static site. + /// Description for Gets the functions of a static site. /// /// /// The operations group for this extension method. @@ -1265,19 +1140,16 @@ public static void CreateZipDeploymentForStaticSiteBuild(this IStaticSitesOperat /// /// Name of the static site. /// - /// - /// The dictionary containing the static site app settings to update. - /// - public static StringDictionary CreateOrUpdateStaticSiteAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings) + public static IPage ListStaticSiteFunctions(this IStaticSitesOperations operations, string resourceGroupName, string name) { - return operations.CreateOrUpdateStaticSiteAppSettingsAsync(resourceGroupName, name, appSettings).GetAwaiter().GetResult(); + return operations.ListStaticSiteFunctionsAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// - /// Creates or updates the app settings of a static site. + /// Gets the functions of a static site. /// /// - /// Description for Creates or updates the app settings of a static site. + /// Description for Gets the functions of a static site. /// /// /// The operations group for this extension method. @@ -1288,26 +1160,22 @@ public static StringDictionary CreateOrUpdateStaticSiteAppSettings(this IStaticS /// /// Name of the static site. /// - /// - /// The dictionary containing the static site app settings to update. - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateStaticSiteAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListStaticSiteFunctionsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateStaticSiteAppSettingsWithHttpMessagesAsync(resourceGroupName, name, appSettings, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListStaticSiteFunctionsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates the function app settings of a static site. + /// Gets the application settings of a static site. /// /// - /// Description for Creates or updates the function app settings of a static - /// site. + /// Description for Gets the application settings of a static site. /// /// /// The operations group for this extension method. @@ -1318,20 +1186,16 @@ public static StringDictionary CreateOrUpdateStaticSiteAppSettings(this IStaticS /// /// Name of the static site. /// - /// - /// The dictionary containing the static site function app settings to update. - /// - public static StringDictionary CreateOrUpdateStaticSiteFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings) + public static StringDictionary ListStaticSiteFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name) { - return operations.CreateOrUpdateStaticSiteFunctionAppSettingsAsync(resourceGroupName, name, appSettings).GetAwaiter().GetResult(); + return operations.ListStaticSiteFunctionAppSettingsAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// - /// Creates or updates the function app settings of a static site. + /// Gets the application settings of a static site. /// /// - /// Description for Creates or updates the function app settings of a static - /// site. + /// Description for Gets the application settings of a static site. /// /// /// The operations group for this extension method. @@ -1342,25 +1206,22 @@ public static StringDictionary CreateOrUpdateStaticSiteFunctionAppSettings(this /// /// Name of the static site. /// - /// - /// The dictionary containing the static site function app settings to update. - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateStaticSiteFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListStaticSiteFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, appSettings, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates an invitation link for a user with the role + /// Lists the secrets for an existing static site. /// /// - /// Description for Creates an invitation link for a user with the role + /// Description for Lists the secrets for an existing static site. /// /// /// The operations group for this extension method. @@ -1371,18 +1232,16 @@ public static StringDictionary CreateOrUpdateStaticSiteFunctionAppSettings(this /// /// Name of the static site. /// - /// - /// - public static StaticSiteUserInvitationResponseResource CreateUserRolesInvitationLink(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope) + public static StringDictionary ListStaticSiteSecrets(this IStaticSitesOperations operations, string resourceGroupName, string name) { - return operations.CreateUserRolesInvitationLinkAsync(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope).GetAwaiter().GetResult(); + return operations.ListStaticSiteSecretsAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// - /// Creates an invitation link for a user with the role + /// Lists the secrets for an existing static site. /// /// - /// Description for Creates an invitation link for a user with the role + /// Description for Lists the secrets for an existing static site. /// /// /// The operations group for this extension method. @@ -1393,25 +1252,22 @@ public static StaticSiteUserInvitationResponseResource CreateUserRolesInvitation /// /// Name of the static site. /// - /// - /// /// /// The cancellation token. /// - public static async Task CreateUserRolesInvitationLinkAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListStaticSiteSecretsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateUserRolesInvitationLinkWithHttpMessagesAsync(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListStaticSiteSecretsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all static site custom domains for a particular static site. + /// Resets the api key for an existing static site. /// /// - /// Description for Gets all static site custom domains for a particular static - /// site. + /// Description for Resets the api key for an existing static site. /// /// /// The operations group for this extension method. @@ -1420,19 +1276,20 @@ public static StaticSiteUserInvitationResponseResource CreateUserRolesInvitation /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site. /// - public static IPage ListStaticSiteCustomDomains(this IStaticSitesOperations operations, string resourceGroupName, string name) + /// + /// + public static void ResetStaticSiteApiKey(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope) { - return operations.ListStaticSiteCustomDomainsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + operations.ResetStaticSiteApiKeyAsync(resourceGroupName, name, resetPropertiesEnvelope).GetAwaiter().GetResult(); } /// - /// Gets all static site custom domains for a particular static site. + /// Resets the api key for an existing static site. /// /// - /// Description for Gets all static site custom domains for a particular static - /// site. + /// Description for Resets the api key for an existing static site. /// /// /// The operations group for this extension method. @@ -1441,1832 +1298,16 @@ public static IPage ListStaticSiteCus /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site. + /// + /// /// /// /// The cancellation token. /// - public static async Task> ListStaticSiteCustomDomainsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ResetStaticSiteApiKeyAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteCustomDomainsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets an existing custom domain for a particular static site. - /// - /// - /// Description for Gets an existing custom domain for a particular static - /// site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site resource to search in. - /// - /// - /// The custom domain name. - /// - public static StaticSiteCustomDomainOverviewARMResource GetStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) - { - return operations.GetStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); - } - - /// - /// Gets an existing custom domain for a particular static site. - /// - /// - /// Description for Gets an existing custom domain for a particular static - /// site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site resource to search in. - /// - /// - /// The custom domain name. - /// - /// - /// The cancellation token. - /// - public static async Task GetStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a new static site custom domain in an existing resource group and - /// static site. - /// - /// - /// Description for Creates a new static site custom domain in an existing - /// resource group and static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to create. - /// - /// - /// A JSON representation of the static site custom domain request properties. - /// See example. - /// - public static StaticSiteCustomDomainOverviewARMResource CreateOrUpdateStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) - { - return operations.CreateOrUpdateStaticSiteCustomDomainAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope).GetAwaiter().GetResult(); - } - - /// - /// Creates a new static site custom domain in an existing resource group and - /// static site. - /// - /// - /// Description for Creates a new static site custom domain in an existing - /// resource group and static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to create. - /// - /// - /// A JSON representation of the static site custom domain request properties. - /// See example. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a custom domain. - /// - /// - /// Description for Deletes a custom domain. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to delete. - /// - public static void DeleteStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) - { - operations.DeleteStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a custom domain. - /// - /// - /// Description for Deletes a custom domain. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to delete. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Validates a particular custom domain can be added to a static site. - /// - /// - /// Description for Validates a particular custom domain can be added to a - /// static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to validate. - /// - /// - /// A JSON representation of the static site custom domain request properties. - /// See example. - /// - public static void ValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) - { - operations.ValidateCustomDomainCanBeAddedToStaticSiteAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope).GetAwaiter().GetResult(); - } - - /// - /// Validates a particular custom domain can be added to a static site. - /// - /// - /// Description for Validates a particular custom domain can be added to a - /// static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to validate. - /// - /// - /// A JSON representation of the static site custom domain request properties. - /// See example. - /// - /// - /// The cancellation token. - /// - public static async Task ValidateCustomDomainCanBeAddedToStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Detaches a static site. - /// - /// - /// Description for Detaches a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to detach. - /// - public static void DetachStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) - { - operations.DetachStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Detaches a static site. - /// - /// - /// Description for Detaches a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to detach. - /// - /// - /// The cancellation token. - /// - public static async Task DetachStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DetachStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the functions of a static site. - /// - /// - /// Description for Gets the functions of a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - public static IPage ListStaticSiteFunctions(this IStaticSitesOperations operations, string resourceGroupName, string name) - { - return operations.ListStaticSiteFunctionsAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Gets the functions of a static site. - /// - /// - /// Description for Gets the functions of a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The cancellation token. - /// - public static async Task> ListStaticSiteFunctionsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListStaticSiteFunctionsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the application settings of a static site. - /// - /// - /// Description for Gets the application settings of a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - public static StringDictionary ListStaticSiteAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name) - { - return operations.ListStaticSiteAppSettingsAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Gets the application settings of a static site. - /// - /// - /// Description for Gets the application settings of a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The cancellation token. - /// - public static async Task ListStaticSiteAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListStaticSiteAppSettingsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists the roles configured for the static site. - /// - /// - /// Description for Lists the roles configured for the static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - public static StringList ListStaticSiteConfiguredRoles(this IStaticSitesOperations operations, string resourceGroupName, string name) - { - return operations.ListStaticSiteConfiguredRolesAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Lists the roles configured for the static site. - /// - /// - /// Description for Lists the roles configured for the static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The cancellation token. - /// - public static async Task ListStaticSiteConfiguredRolesAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListStaticSiteConfiguredRolesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the application settings of a static site. - /// - /// - /// Description for Gets the application settings of a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - public static StringDictionary ListStaticSiteFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name) - { - return operations.ListStaticSiteFunctionAppSettingsAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Gets the application settings of a static site. - /// - /// - /// Description for Gets the application settings of a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The cancellation token. - /// - public static async Task ListStaticSiteFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists the secrets for an existing static site. - /// - /// - /// Description for Lists the secrets for an existing static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - public static StringDictionary ListStaticSiteSecrets(this IStaticSitesOperations operations, string resourceGroupName, string name) - { - return operations.ListStaticSiteSecretsAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Lists the secrets for an existing static site. - /// - /// - /// Description for Lists the secrets for an existing static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The cancellation token. - /// - public static async Task ListStaticSiteSecretsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListStaticSiteSecretsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the list of private endpoint connections associated with a static site - /// - /// - /// Description for Gets the list of private endpoint connections associated - /// with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - public static IPage GetPrivateEndpointConnectionList(this IStaticSitesOperations operations, string resourceGroupName, string name) - { - return operations.GetPrivateEndpointConnectionListAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of private endpoint connections associated with a static site - /// - /// - /// Description for Gets the list of private endpoint connections associated - /// with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The cancellation token. - /// - public static async Task> GetPrivateEndpointConnectionListAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateEndpointConnectionListWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a private endpoint connection - /// - /// - /// Description for Gets a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) - { - return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Gets a private endpoint connection - /// - /// - /// Description for Gets a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetPrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// Request body. - /// - public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) - { - return operations.ApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// Request body. - /// - /// - /// The cancellation token. - /// - public static async Task ApproveOrRejectPrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - public static object DeletePrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) - { - return operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// The cancellation token. - /// - public static async Task DeletePrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IStaticSitesOperations operations, string resourceGroupName, string name) - { - return operations.GetPrivateLinkResourcesAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// The cancellation token. - /// - public static async Task GetPrivateLinkResourcesAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Resets the api key for an existing static site. - /// - /// - /// Description for Resets the api key for an existing static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// - public static void ResetStaticSiteApiKey(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope) - { - operations.ResetStaticSiteApiKeyAsync(resourceGroupName, name, resetPropertiesEnvelope).GetAwaiter().GetResult(); - } - - /// - /// Resets the api key for an existing static site. - /// - /// - /// Description for Resets the api key for an existing static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task ResetStaticSiteApiKeyAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ResetStaticSiteApiKeyWithHttpMessagesAsync(resourceGroupName, name, resetPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the details of the user provided function apps registered with a - /// static site - /// - /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - public static IPage GetUserProvidedFunctionAppsForStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) - { - return operations.GetUserProvidedFunctionAppsForStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Gets the details of the user provided function apps registered with a - /// static site - /// - /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The cancellation token. - /// - public static async Task> GetUserProvidedFunctionAppsForStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetUserProvidedFunctionAppsForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the details of the user provided function app registered with a static - /// site - /// - /// - /// Description for Gets the details of the user provided function app - /// registered with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app registered with the static site. - /// - public static StaticSiteUserProvidedFunctionAppARMResource GetUserProvidedFunctionAppForStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName) - { - return operations.GetUserProvidedFunctionAppForStaticSiteAsync(resourceGroupName, name, functionAppName).GetAwaiter().GetResult(); - } - - /// - /// Gets the details of the user provided function app registered with a static - /// site - /// - /// - /// Description for Gets the details of the user provided function app - /// registered with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app registered with the static site. - /// - /// - /// The cancellation token. - /// - public static async Task GetUserProvidedFunctionAppForStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetUserProvidedFunctionAppForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Register a user provided function app with a static site - /// - /// - /// Description for Register a user provided function app with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app to register with the static site. - /// - /// - /// A JSON representation of the user provided function app properties. See - /// example. - /// - /// - /// Specify <code>true</code> to force the update of the auth - /// configuration on the function app even if an AzureStaticWebApps provider is - /// already configured on the function app. The default is - /// <code>false</code>. - /// - public static StaticSiteUserProvidedFunctionAppARMResource RegisterUserProvidedFunctionAppWithStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?)) - { - return operations.RegisterUserProvidedFunctionAppWithStaticSiteAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced).GetAwaiter().GetResult(); - } - - /// - /// Register a user provided function app with a static site - /// - /// - /// Description for Register a user provided function app with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app to register with the static site. - /// - /// - /// A JSON representation of the user provided function app properties. See - /// example. - /// - /// - /// Specify <code>true</code> to force the update of the auth - /// configuration on the function app even if an AzureStaticWebApps provider is - /// already configured on the function app. The default is - /// <code>false</code>. - /// - /// - /// The cancellation token. - /// - public static async Task RegisterUserProvidedFunctionAppWithStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.RegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Detach the user provided function app from the static site - /// - /// - /// Description for Detach the user provided function app from the static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app registered with the static site. - /// - public static void DetachUserProvidedFunctionAppFromStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName) - { - operations.DetachUserProvidedFunctionAppFromStaticSiteAsync(resourceGroupName, name, functionAppName).GetAwaiter().GetResult(); - } - - /// - /// Detach the user provided function app from the static site - /// - /// - /// Description for Detach the user provided function app from the static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app registered with the static site. - /// - /// - /// The cancellation token. - /// - public static async Task DetachUserProvidedFunctionAppFromStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DetachUserProvidedFunctionAppFromStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deploys zipped content to a static site. - /// - /// - /// Description for Deploys zipped content to a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. See - /// example. - /// - public static void CreateZipDeploymentForStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) - { - operations.CreateZipDeploymentForStaticSiteAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope).GetAwaiter().GetResult(); - } - - /// - /// Deploys zipped content to a static site. - /// - /// - /// Description for Deploys zipped content to a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. See - /// example. - /// - /// - /// The cancellation token. - /// - public static async Task CreateZipDeploymentForStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CreateZipDeploymentForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates a new static site in an existing resource group, or updates an - /// existing static site. - /// - /// - /// Description for Creates a new static site in an existing resource group, or - /// updates an existing static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to create or update. - /// - /// - /// A JSON representation of the staticsite properties. See example. - /// - public static StaticSiteARMResource BeginCreateOrUpdateStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope) - { - return operations.BeginCreateOrUpdateStaticSiteAsync(resourceGroupName, name, staticSiteEnvelope).GetAwaiter().GetResult(); - } - - /// - /// Creates a new static site in an existing resource group, or updates an - /// existing static site. - /// - /// - /// Description for Creates a new static site in an existing resource group, or - /// updates an existing static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to create or update. - /// - /// - /// A JSON representation of the staticsite properties. See example. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteEnvelope, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a static site. - /// - /// - /// Description for Deletes a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to delete. - /// - public static void BeginDeleteStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) - { - operations.BeginDeleteStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Deletes a static site. - /// - /// - /// Description for Deletes a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to delete. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes a static site build. - /// - /// - /// Description for Deletes a static site build. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The stage site identifier. - /// - public static void BeginDeleteStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) - { - operations.BeginDeleteStaticSiteBuildAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a static site build. - /// - /// - /// Description for Deletes a static site build. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The stage site identifier. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Register a user provided function app with a static site build - /// - /// - /// Description for Register a user provided function app with a static site - /// build - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app to register with the static site build. - /// - /// - /// A JSON representation of the user provided function app properties. See - /// example. - /// - /// - /// Specify <code>true</code> to force the update of the auth - /// configuration on the function app even if an AzureStaticWebApps provider is - /// already configured on the function app. The default is - /// <code>false</code>. - /// - public static StaticSiteUserProvidedFunctionAppARMResource BeginRegisterUserProvidedFunctionAppWithStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?)) - { - return operations.BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced).GetAwaiter().GetResult(); - } - - /// - /// Register a user provided function app with a static site build - /// - /// - /// Description for Register a user provided function app with a static site - /// build - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The stage site identifier. - /// - /// - /// Name of the function app to register with the static site build. - /// - /// - /// A JSON representation of the user provided function app properties. See - /// example. - /// - /// - /// Specify <code>true</code> to force the update of the auth - /// configuration on the function app even if an AzureStaticWebApps provider is - /// already configured on the function app. The default is - /// <code>false</code>. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deploys zipped content to a specific environment of a static site. - /// - /// - /// Description for Deploys zipped content to a specific environment of a - /// static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the environment. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. See - /// example. - /// - public static void BeginCreateZipDeploymentForStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) - { - operations.BeginCreateZipDeploymentForStaticSiteBuildAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope).GetAwaiter().GetResult(); - } - - /// - /// Deploys zipped content to a specific environment of a static site. - /// - /// - /// Description for Deploys zipped content to a specific environment of a - /// static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the environment. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. See - /// example. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateZipDeploymentForStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginCreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates a new static site custom domain in an existing resource group and - /// static site. - /// - /// - /// Description for Creates a new static site custom domain in an existing - /// resource group and static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to create. - /// - /// - /// A JSON representation of the static site custom domain request properties. - /// See example. - /// - public static StaticSiteCustomDomainOverviewARMResource BeginCreateOrUpdateStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) - { - return operations.BeginCreateOrUpdateStaticSiteCustomDomainAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope).GetAwaiter().GetResult(); - } - - /// - /// Creates a new static site custom domain in an existing resource group and - /// static site. - /// - /// - /// Description for Creates a new static site custom domain in an existing - /// resource group and static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to create. - /// - /// - /// A JSON representation of the static site custom domain request properties. - /// See example. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a custom domain. - /// - /// - /// Description for Deletes a custom domain. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to delete. - /// - public static void BeginDeleteStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) - { - operations.BeginDeleteStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a custom domain. - /// - /// - /// Description for Deletes a custom domain. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to delete. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Validates a particular custom domain can be added to a static site. - /// - /// - /// Description for Validates a particular custom domain can be added to a - /// static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to validate. - /// - /// - /// A JSON representation of the static site custom domain request properties. - /// See example. - /// - public static void BeginValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) - { - operations.BeginValidateCustomDomainCanBeAddedToStaticSiteAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope).GetAwaiter().GetResult(); - } - - /// - /// Validates a particular custom domain can be added to a static site. - /// - /// - /// Description for Validates a particular custom domain can be added to a - /// static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// The custom domain to validate. - /// - /// - /// A JSON representation of the static site custom domain request properties. - /// See example. - /// - /// - /// The cancellation token. - /// - public static async Task BeginValidateCustomDomainCanBeAddedToStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Detaches a static site. - /// - /// - /// Description for Detaches a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to detach. - /// - public static void BeginDetachStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) - { - operations.BeginDetachStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Detaches a static site. - /// - /// - /// Description for Detaches a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site to detach. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDetachStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDetachStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// Request body. - /// - public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) - { - return operations.BeginApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// Request body. - /// - /// - /// The cancellation token. - /// - public static async Task BeginApproveOrRejectPrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - public static object BeginDeletePrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) - { - return operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeletePrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Register a user provided function app with a static site - /// - /// - /// Description for Register a user provided function app with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app to register with the static site. - /// - /// - /// A JSON representation of the user provided function app properties. See - /// example. - /// - /// - /// Specify <code>true</code> to force the update of the auth - /// configuration on the function app even if an AzureStaticWebApps provider is - /// already configured on the function app. The default is - /// <code>false</code>. - /// - public static StaticSiteUserProvidedFunctionAppARMResource BeginRegisterUserProvidedFunctionAppWithStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?)) - { - return operations.BeginRegisterUserProvidedFunctionAppWithStaticSiteAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced).GetAwaiter().GetResult(); - } - - /// - /// Register a user provided function app with a static site - /// - /// - /// Description for Register a user provided function app with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// Name of the function app to register with the static site. - /// - /// - /// A JSON representation of the user provided function app properties. See - /// example. - /// - /// - /// Specify <code>true</code> to force the update of the auth - /// configuration on the function app even if an AzureStaticWebApps provider is - /// already configured on the function app. The default is - /// <code>false</code>. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRegisterUserProvidedFunctionAppWithStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginRegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deploys zipped content to a static site. - /// - /// - /// Description for Deploys zipped content to a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. See - /// example. - /// - public static void BeginCreateZipDeploymentForStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) - { - operations.BeginCreateZipDeploymentForStaticSiteAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope).GetAwaiter().GetResult(); - } - - /// - /// Deploys zipped content to a static site. - /// - /// - /// Description for Deploys zipped content to a static site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// - /// A JSON representation of the StaticSiteZipDeployment properties. See - /// example. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateZipDeploymentForStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginCreateZipDeploymentForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.ResetStaticSiteApiKeyWithHttpMessagesAsync(resourceGroupName, name, resetPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -3469,50 +1510,6 @@ public static IPage ListStaticSiteBuildFu } } - /// - /// Gets the details of the user provided function apps registered with a - /// static site build - /// - /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site build - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetUserProvidedFunctionAppsForStaticSiteBuildNext(this IStaticSitesOperations operations, string nextPageLink) - { - return operations.GetUserProvidedFunctionAppsForStaticSiteBuildNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the details of the user provided function apps registered with a - /// static site build - /// - /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site build - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetUserProvidedFunctionAppsForStaticSiteBuildNextAsync(this IStaticSitesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetUserProvidedFunctionAppsForStaticSiteBuildNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all static site custom domains for a particular static site. /// @@ -3595,91 +1592,5 @@ public static IPage ListStaticSiteFunctio } } - /// - /// Gets the list of private endpoint connections associated with a static site - /// - /// - /// Description for Gets the list of private endpoint connections associated - /// with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetPrivateEndpointConnectionListNext(this IStaticSitesOperations operations, string nextPageLink) - { - return operations.GetPrivateEndpointConnectionListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of private endpoint connections associated with a static site - /// - /// - /// Description for Gets the list of private endpoint connections associated - /// with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetPrivateEndpointConnectionListNextAsync(this IStaticSitesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the details of the user provided function apps registered with a - /// static site - /// - /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetUserProvidedFunctionAppsForStaticSiteNext(this IStaticSitesOperations operations, string nextPageLink) - { - return operations.GetUserProvidedFunctionAppsForStaticSiteNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the details of the user provided function apps registered with a - /// static site - /// - /// - /// Description for Gets the details of the user provided function apps - /// registered with a static site - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetUserProvidedFunctionAppsForStaticSiteNextAsync(this IStaticSitesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetUserProvidedFunctionAppsForStaticSiteNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperations.cs index 806555a718ec..4329eceb1edf 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperations.cs @@ -6331,10 +6331,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the config reference app settings and status of an app + /// Replaces the connection strings of an app. /// /// - /// Description for Gets the config reference app settings and status of an app + /// Description for Replaces the connection strings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -6342,6 +6342,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Connection strings of the app or deployment slot. See example. + /// /// /// Headers that will be added to request. /// @@ -6363,7 +6366,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAppSettingsKeyVaultReferencesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6388,6 +6391,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (connectionStrings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionStrings"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -6405,12 +6412,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("connectionStrings", connectionStrings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingsKeyVaultReferences", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateConnectionStrings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -6426,7 +6434,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6457,6 +6465,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionStrings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionStrings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -6507,7 +6521,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6520,7 +6534,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6540,10 +6554,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the config reference and status of an app + /// Gets the connection strings of an app. /// /// - /// Description for Gets the config reference and status of an app + /// Description for Gets the connection strings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -6551,9 +6565,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// App Setting key name. - /// /// /// Headers that will be added to request. /// @@ -6575,7 +6586,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAppSettingKeyVaultReferenceWithHttpMessagesAsync(string resourceGroupName, string name, string appSettingKey, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6600,9 +6611,214 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (appSettingKey == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStrings", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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")) { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettingKey"); + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the logging configuration of an app. + /// + /// + /// Description for Gets the logging configuration of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// 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> GetDiagnosticLogsConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); } if (Client.SubscriptionId == null) { @@ -6621,16 +6837,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("appSettingKey", appSettingKey); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingKeyVaultReference", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticLogsConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings/{appSettingKey}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{appSettingKey}", System.Uri.EscapeDataString(appSettingKey)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -6725,7 +6939,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6738,7 +6952,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6758,10 +6972,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the config reference app settings and status of an app + /// Updates the logging configuration of an app. /// /// - /// Description for Gets the config reference app settings and status of an app + /// Description for Updates the logging configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -6769,6 +6983,10 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// A SiteLogsConfig JSON object that contains the logging configuration to + /// change in the "properties" property. + /// /// /// Headers that will be added to request. /// @@ -6790,7 +7008,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetSiteConnectionStringKeyVaultReferencesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDiagnosticLogsConfigWithHttpMessagesAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6815,6 +7033,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteLogsConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteLogsConfig"); + } + if (siteLogsConfig != null) + { + siteLogsConfig.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -6832,12 +7058,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteLogsConfig", siteLogsConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReferences", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateDiagnosticLogsConfig", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -6853,7 +7080,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6884,6 +7111,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteLogsConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteLogsConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -6934,7 +7167,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6947,7 +7180,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6967,10 +7200,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the config reference and status of an app + /// Replaces the metadata of an app. /// /// - /// Description for Gets the config reference and status of an app + /// Description for Replaces the metadata of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -6978,7 +7211,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// + /// + /// Edited metadata of the app or deployment slot. See example. /// /// /// Headers that will be added to request. @@ -7001,7 +7235,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSiteConnectionStringKeyVaultReferenceWithHttpMessagesAsync(string resourceGroupName, string name, string connectionStringKey, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateMetadataWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary metadata, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7026,9 +7260,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionStringKey == null) + if (metadata == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionStringKey"); + throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); } if (Client.SubscriptionId == null) { @@ -7047,16 +7281,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionStringKey", connectionStringKey); + tracingParameters.Add("metadata", metadata); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReference", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateMetadata", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings/{connectionStringKey}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{connectionStringKey}", System.Uri.EscapeDataString(connectionStringKey)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -7070,7 +7303,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7101,6 +7334,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(metadata != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -7151,7 +7390,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7164,7 +7403,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7184,10 +7423,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the connection strings of an app. + /// Gets the metadata of an app. /// /// - /// Description for Replaces the connection strings of an app. + /// Description for Gets the metadata of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -7195,9 +7434,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Connection strings of the app or deployment slot. See example. - /// /// /// Headers that will be added to request. /// @@ -7219,7 +7455,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListMetadataWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7244,10 +7480,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionStrings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionStrings"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -7265,13 +7497,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionStrings", connectionStrings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateConnectionStrings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMetadata", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -7287,7 +7518,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7318,12 +7549,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionStrings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionStrings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -7374,7 +7599,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7387,7 +7612,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7407,10 +7632,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the connection strings of an app. + /// Gets the Git/FTP publishing credentials of an app. /// /// - /// Description for Gets the connection strings of an app. + /// Description for Gets the Git/FTP publishing credentials of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -7419,213 +7644,32 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Headers that will be added to request. + /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> ListConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPublishingCredentialsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStrings", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; + // Send request + AzureOperationResponse _response = await BeginListPublishingCredentialsWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the logging configuration of an app. + /// Updates the Push settings associated with web app. /// /// - /// Description for Gets the logging configuration of an app. + /// Description for Updates the Push settings associated with web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. + /// + /// + /// Push settings associated with web app. /// /// /// Headers that will be added to request. @@ -7648,7 +7692,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDiagnosticLogsConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSitePushSettingsWithHttpMessagesAsync(string resourceGroupName, string name, PushSettings pushSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7673,6 +7717,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (pushSettings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "pushSettings"); + } + if (pushSettings != null) + { + pushSettings.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -7690,12 +7742,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("pushSettings", pushSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticLogsConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSitePushSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -7711,7 +7764,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7742,6 +7795,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(pushSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pushSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -7792,7 +7851,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7805,7 +7864,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7825,20 +7884,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the logging configuration of an app. + /// Gets the Push settings associated with web app. /// /// - /// Description for Updates the logging configuration of an app. + /// Description for Gets the Push settings associated with web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// A SiteLogsConfig JSON object that contains the logging configuration to - /// change in the "properties" property. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -7861,7 +7916,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateDiagnosticLogsConfigWithHttpMessagesAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSitePushSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7886,14 +7941,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteLogsConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteLogsConfig"); - } - if (siteLogsConfig != null) - { - siteLogsConfig.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -7911,13 +7958,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteLogsConfig", siteLogsConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateDiagnosticLogsConfig", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSitePushSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -7933,7 +7979,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7964,12 +8010,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteLogsConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteLogsConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -8020,7 +8060,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8033,7 +8073,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8053,10 +8093,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the metadata of an app. + /// Gets the names of app settings and connection strings that stick to the + /// slot (not swapped). /// /// - /// Description for Replaces the metadata of an app. + /// Description for Gets the names of app settings and connection strings that + /// stick to the slot (not swapped). /// /// /// Name of the resource group to which the resource belongs. @@ -8064,9 +8106,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Edited metadata of the app or deployment slot. See example. - /// /// /// Headers that will be added to request. /// @@ -8088,7 +8127,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateMetadataWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary metadata, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSlotConfigurationNamesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8113,10 +8152,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (metadata == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -8134,13 +8169,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("metadata", metadata); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateMetadata", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlotConfigurationNames", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -8156,7 +8190,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8187,12 +8221,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(metadata != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -8243,7 +8271,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8256,7 +8284,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8276,10 +8304,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the metadata of an app. + /// Updates the names of application settings and connection string that remain + /// with the slot during swap operation. /// /// - /// Description for Gets the metadata of an app. + /// Description for Updates the names of application settings and connection + /// string that remain with the slot during swap operation. /// /// /// Name of the resource group to which the resource belongs. @@ -8287,6 +8317,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Names of application settings and connection strings. See example. + /// /// /// Headers that will be added to request. /// @@ -8308,7 +8341,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListMetadataWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSlotConfigurationNamesWithHttpMessagesAsync(string resourceGroupName, string name, SlotConfigNamesResource slotConfigNames, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8333,6 +8366,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slotConfigNames == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slotConfigNames"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -8350,12 +8387,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slotConfigNames", slotConfigNames); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMetadata", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSlotConfigurationNames", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -8371,7 +8409,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8402,6 +8440,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotConfigNames != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotConfigNames, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -8452,7 +8496,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8465,7 +8509,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8485,10 +8529,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Git/FTP publishing credentials of an app. + /// Gets the configuration of an app, such as platform version and bitness, + /// default documents, virtual applications, Always On, etc. /// /// - /// Description for Gets the Git/FTP publishing credentials of an app. + /// Description for Gets the configuration of an app, such as platform version + /// and bitness, default documents, virtual applications, Always On, etc. /// /// /// Name of the resource group to which the resource belongs. @@ -8497,34 +8543,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ListPublishingCredentialsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginListPublishingCredentialsWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates the Push settings associated with web app. - /// - /// - /// Description for Updates the Push settings associated with web app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Push settings associated with web app. - /// - /// /// Headers that will be added to request. /// /// @@ -8545,7 +8563,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSitePushSettingsWithHttpMessagesAsync(string resourceGroupName, string name, PushSettings pushSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8570,14 +8588,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (pushSettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "pushSettings"); - } - if (pushSettings != null) - { - pushSettings.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -8595,13 +8605,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("pushSettings", pushSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSitePushSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -8617,7 +8626,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8648,12 +8657,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(pushSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pushSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -8704,7 +8707,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8717,7 +8720,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8737,16 +8740,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Push settings associated with web app. + /// Updates the configuration of an app. /// /// - /// Description for Gets the Push settings associated with web app. + /// Description for Updates the configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// JSON representation of a SiteConfig object. See example. /// /// /// Headers that will be added to request. @@ -8769,7 +8775,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSitePushSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8794,6 +8800,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); + } + if (siteConfig != null) + { + siteConfig.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -8811,12 +8825,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSitePushSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -8832,7 +8847,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8863,6 +8878,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -8913,7 +8934,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8926,7 +8947,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8946,12 +8967,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the names of app settings and connection strings that stick to the - /// slot (not swapped). + /// Updates the configuration of an app. /// /// - /// Description for Gets the names of app settings and connection strings that - /// stick to the slot (not swapped). + /// Description for Updates the configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -8959,6 +8978,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// JSON representation of a SiteConfig object. See example. + /// /// /// Headers that will be added to request. /// @@ -8980,7 +9002,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSlotConfigurationNamesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9005,6 +9027,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -9022,12 +9048,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlotConfigurationNames", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -9043,7 +9070,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -9074,6 +9101,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -9124,7 +9157,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -9137,7 +9170,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -9157,12 +9190,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the names of application settings and connection string that remain - /// with the slot during swap operation. + /// Gets a list of web app configuration snapshots identifiers. Each element of + /// the list contains a timestamp and the ID of the snapshot. /// /// - /// Description for Updates the names of application settings and connection - /// string that remain with the slot during swap operation. + /// Description for Gets a list of web app configuration snapshots identifiers. + /// Each element of the list contains a timestamp and the ID of the snapshot. /// /// /// Name of the resource group to which the resource belongs. @@ -9170,9 +9203,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Names of application settings and connection strings. See example. - /// /// /// Headers that will be added to request. /// @@ -9194,7 +9224,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSlotConfigurationNamesWithHttpMessagesAsync(string resourceGroupName, string name, SlotConfigNamesResource slotConfigNames, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationSnapshotInfoWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9219,10 +9249,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotConfigNames == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotConfigNames"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -9240,13 +9266,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotConfigNames", slotConfigNames); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSlotConfigurationNames", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfo", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -9262,7 +9287,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -9293,12 +9318,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotConfigNames != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotConfigNames, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -9349,7 +9368,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -9362,7 +9381,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -9382,12 +9401,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the configuration of an app, such as platform version and bitness, - /// default documents, virtual applications, Always On, etc. + /// Gets a snapshot of the configuration of an app at a previous point in time. /// /// - /// Description for Gets the configuration of an app, such as platform version - /// and bitness, default documents, virtual applications, Always On, etc. + /// Description for Gets a snapshot of the configuration of an app at a + /// previous point in time. /// /// /// Name of the resource group to which the resource belongs. @@ -9395,6 +9413,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// The ID of the snapshot to read. + /// /// /// Headers that will be added to request. /// @@ -9416,7 +9437,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetConfigurationSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9441,6 +9462,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (snapshotId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -9458,14 +9483,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSnapshot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -9593,10 +9620,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the configuration of an app. + /// Reverts the configuration of an app to a previous snapshot. /// /// - /// Description for Updates the configuration of an app. + /// Description for Reverts the configuration of an app to a previous snapshot. /// /// /// Name of the resource group to which the resource belongs. @@ -9604,8 +9631,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteConfig object. See example. + /// + /// The ID of the snapshot to read. /// /// /// Headers that will be added to request. @@ -9616,9 +9643,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -9628,7 +9652,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RecoverSiteConfigurationSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9653,13 +9677,202 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteConfig == null) + if (snapshotId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); } - if (siteConfig != null) + if (Client.SubscriptionId == null) { - siteConfig.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("snapshotId", snapshotId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "RecoverSiteConfigurationSnapshot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Gets the last lines of docker logs for the given site + /// + /// + /// Description for Gets the last lines of docker logs for the given site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// 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> GetWebSiteContainerLogsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); } if (Client.SubscriptionId == null) { @@ -9678,13 +9891,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebSiteContainerLogs", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -9700,7 +9912,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -9731,12 +9943,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -9749,7 +9955,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -9757,15 +9963,16 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -9775,6 +9982,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -9787,7 +9998,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -9797,20 +10008,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -9820,19 +10018,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the configuration of an app. + /// Gets the ZIP archived docker log files for the given site /// /// - /// Description for Updates the configuration of an app. + /// Description for Gets the ZIP archived docker log files for the given site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON representation of a SiteConfig object. See example. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -9840,7 +10035,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -9855,7 +10050,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContainerLogsZipWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9880,10 +10075,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -9901,13 +10092,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetContainerLogsZip", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -9923,7 +10113,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -9954,12 +10144,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -9972,7 +10156,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -9980,15 +10164,16 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -9998,6 +10183,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -10010,7 +10199,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -10020,20 +10209,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -10043,18 +10219,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a list of web app configuration snapshots identifiers. Each element of - /// the list contains a timestamp and the ID of the snapshot. + /// List continuous web jobs for an app, or a deployment slot. /// /// - /// Description for Gets a list of web app configuration snapshots identifiers. - /// Each element of the list contains a timestamp and the ID of the snapshot. + /// Description for List continuous web jobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// /// /// Headers that will be added to request. @@ -10077,7 +10251,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationSnapshotInfoWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListContinuousWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10120,11 +10294,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfo", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobs", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -10221,7 +10395,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -10234,7 +10408,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -10254,20 +10428,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a snapshot of the configuration of an app at a previous point in time. + /// Gets a continuous web job by its ID for an app, or a deployment slot. /// /// - /// Description for Gets a snapshot of the configuration of an app at a - /// previous point in time. + /// Description for Gets a continuous web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// The ID of the snapshot to read. + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -10290,7 +10464,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetConfigurationSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10315,9 +10489,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (snapshotId == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -10336,16 +10510,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("snapshotId", snapshotId); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSnapshot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetContinuousWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -10410,7 +10584,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -10440,7 +10614,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -10453,7 +10627,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -10473,19 +10647,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Reverts the configuration of an app to a previous snapshot. + /// Delete a continuous web job by its ID for an app, or a deployment slot. /// /// - /// Description for Reverts the configuration of an app to a previous snapshot. + /// Description for Delete a continuous web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// The ID of the snapshot to read. + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -10505,7 +10680,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RecoverSiteConfigurationSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10530,9 +10705,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (snapshotId == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -10551,16 +10726,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("snapshotId", snapshotId); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RecoverSiteConfigurationSnapshot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteContinuousWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -10574,7 +10749,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -10625,7 +10800,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -10670,16 +10845,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the last lines of docker logs for the given site + /// Start a continuous web job for an app, or a deployment slot. /// /// - /// Description for Gets the last lines of docker logs for the given site + /// Description for Start a continuous web job for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. + /// + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -10687,12 +10866,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -10702,7 +10878,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWebSiteContainerLogsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StartContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10727,6 +10903,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -10744,14 +10924,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebSiteContainerLogs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartContinuousWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -10808,7 +10990,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -10816,16 +10998,15 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -10835,10 +11016,6 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -10851,18 +11028,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) - { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -10871,16 +11043,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the ZIP archived docker log files for the given site + /// Stop a continuous web job for an app, or a deployment slot. /// /// - /// Description for Gets the ZIP archived docker log files for the given site + /// Description for Stop a continuous web job for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. + /// + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -10888,12 +11063,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -10903,7 +11075,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContainerLogsZipWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10928,6 +11100,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -10945,14 +11121,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetContainerLogsZip", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopContinuousWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -11009,7 +11187,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -11017,16 +11195,15 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -11036,10 +11213,6 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -11052,18 +11225,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) - { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -11072,16 +11240,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List continuous web jobs for an app, or a deployment slot. + /// List deployments for an app, or a deployment slot. /// /// - /// Description for List continuous web jobs for an app, or a deployment slot. + /// Description for List deployments for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -11104,7 +11272,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListContinuousWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDeploymentsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11147,11 +11315,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeployments", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -11248,7 +11416,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -11261,7 +11429,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -11281,20 +11449,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a continuous web job by its ID for an app, or a deployment slot. + /// Get a deployment by its ID for an app, or a deployment slot. /// /// - /// Description for Gets a continuous web job by its ID for an app, or a - /// deployment slot. + /// Description for Get a deployment by its ID for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// Deployment ID. /// /// /// Headers that will be added to request. @@ -11317,7 +11485,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11342,9 +11510,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (Client.SubscriptionId == null) { @@ -11363,16 +11531,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetContinuousWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDeployment", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -11437,7 +11605,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -11467,7 +11635,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -11480,7 +11648,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -11500,20 +11668,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a continuous web job by its ID for an app, or a deployment slot. + /// Create a deployment for an app, or a deployment slot. /// /// - /// Description for Delete a continuous web job by its ID for an app, or a - /// deployment slot. + /// Description for Create a deployment for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// ID of an existing deployment. + /// + /// + /// Deployment details. /// /// /// Headers that will be added to request. @@ -11524,6 +11694,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -11533,7 +11706,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Deployment deployment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11558,9 +11731,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } + if (deployment == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deployment"); } if (Client.SubscriptionId == null) { @@ -11579,16 +11756,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("id", id); + tracingParameters.Add("deployment", deployment); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteContinuousWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateDeployment", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -11602,7 +11780,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -11633,6 +11811,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(deployment != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deployment, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -11653,7 +11837,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -11683,13 +11867,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -11698,20 +11900,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start a continuous web job for an app, or a deployment slot. + /// Delete a deployment by its ID for an app, or a deployment slot. /// /// - /// Description for Start a continuous web job for an app, or a deployment + /// Description for Delete a deployment by its ID for an app, or a deployment /// slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// Deployment ID. /// /// /// Headers that will be added to request. @@ -11731,7 +11933,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11756,9 +11958,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (Client.SubscriptionId == null) { @@ -11777,16 +11979,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartContinuousWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteDeployment", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -11800,7 +12002,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -11851,7 +12053,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -11896,19 +12098,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Stop a continuous web job for an app, or a deployment slot. + /// List deployment log for specific deployment for an app, or a deployment + /// slot. /// /// - /// Description for Stop a continuous web job for an app, or a deployment slot. + /// Description for List deployment log for specific deployment for an app, or + /// a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// The ID of a specific deployment. This is the value of the name property in + /// the JSON response from "GET /api/sites/{siteName}/deployments". /// /// /// Headers that will be added to request. @@ -11919,6 +12124,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -11928,7 +12136,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListDeploymentLogWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11953,9 +12161,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (Client.SubscriptionId == null) { @@ -11974,16 +12182,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopContinuousWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentLog", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -11997,7 +12205,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -12048,7 +12256,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -12078,13 +12286,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -12093,10 +12319,14 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployments for an app, or a deployment slot. + /// Discovers an existing app backup that can be restored from a blob in Azure + /// storage. Use this to get information about the databases stored in a + /// backup. /// /// - /// Description for List deployments for an app, or a deployment slot. + /// Description for Discovers an existing app backup that can be restored from + /// a blob in Azure storage. Use this to get information about the databases + /// stored in a backup. /// /// /// Name of the resource group to which the resource belongs. @@ -12104,6 +12334,10 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// A RestoreRequest object that includes Azure storage URL and blog name for + /// discovery of backup. + /// /// /// Headers that will be added to request. /// @@ -12125,7 +12359,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDeploymentsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DiscoverBackupWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -12150,6 +12384,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -12167,12 +12409,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("request", request); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeployments", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DiscoverBackup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -12188,7 +12431,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -12219,6 +12462,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -12269,7 +12518,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -12282,7 +12531,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -12302,11 +12551,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a deployment by its ID for an app, or a deployment slot. + /// Lists ownership identifiers for domain associated with web app. /// /// - /// Description for Get a deployment by its ID for an app, or a deployment - /// slot. + /// Description for Lists ownership identifiers for domain associated with web + /// app. /// /// /// Name of the resource group to which the resource belongs. @@ -12314,9 +12563,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Deployment ID. - /// /// /// Headers that will be added to request. /// @@ -12338,7 +12584,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDomainOwnershipIdentifiersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -12363,10 +12609,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -12384,16 +12626,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDeployment", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -12488,7 +12728,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -12501,7 +12741,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -12521,10 +12761,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create a deployment for an app, or a deployment slot. + /// Get domain ownership identifier for web app. /// /// - /// Description for Create a deployment for an app, or a deployment slot. + /// Description for Get domain ownership identifier for web app. /// /// /// Name of the resource group to which the resource belongs. @@ -12532,11 +12772,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// ID of an existing deployment. - /// - /// - /// Deployment details. + /// + /// Name of domain ownership identifier. /// /// /// Headers that will be added to request. @@ -12559,7 +12796,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Deployment deployment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -12584,13 +12821,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); - } - if (deployment == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deployment"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); } if (Client.SubscriptionId == null) { @@ -12609,17 +12842,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); - tracingParameters.Add("deployment", deployment); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateDeployment", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifier", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -12633,7 +12865,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -12664,12 +12896,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(deployment != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deployment, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -12720,7 +12946,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -12733,7 +12959,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -12753,11 +12979,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a deployment by its ID for an app, or a deployment slot. + /// Creates a domain ownership identifier for web app, or updates an existing + /// ownership identifier. /// /// - /// Description for Delete a deployment by its ID for an app, or a deployment - /// slot. + /// Description for Creates a domain ownership identifier for web app, or + /// updates an existing ownership identifier. /// /// /// Name of the resource group to which the resource belongs. @@ -12765,8 +12992,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Deployment ID. + /// + /// Name of domain ownership identifier. + /// + /// + /// A JSON representation of the domain ownership properties. /// /// /// Headers that will be added to request. @@ -12777,6 +13007,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -12786,7 +13019,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -12811,9 +13044,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } + if (domainOwnershipIdentifier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); } if (Client.SubscriptionId == null) { @@ -12832,16 +13069,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteDeployment", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateDomainOwnershipIdentifier", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -12855,7 +13093,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -12886,6 +13124,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(domainOwnershipIdentifier != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -12906,7 +13150,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -12936,13 +13180,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -12951,12 +13213,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployment log for specific deployment for an app, or a deployment - /// slot. + /// Deletes a domain ownership identifier for a web app. /// /// - /// Description for List deployment log for specific deployment for an app, or - /// a deployment slot. + /// Description for Deletes a domain ownership identifier for a web app. /// /// /// Name of the resource group to which the resource belongs. @@ -12964,9 +13224,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of a specific deployment. This is the value of the name property in - /// the JSON response from "GET /api/sites/{siteName}/deployments". + /// + /// Name of domain ownership identifier. /// /// /// Headers that will be added to request. @@ -12977,9 +13236,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -12989,7 +13245,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListDeploymentLogWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13014,9 +13270,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); } if (Client.SubscriptionId == null) { @@ -13035,16 +13291,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentLog", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteDomainOwnershipIdentifier", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -13058,7 +13314,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -13109,7 +13365,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -13139,31 +13395,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -13172,14 +13410,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Discovers an existing app backup that can be restored from a blob in Azure - /// storage. Use this to get information about the databases stored in a - /// backup. + /// Creates a domain ownership identifier for web app, or updates an existing + /// ownership identifier. /// /// - /// Description for Discovers an existing app backup that can be restored from - /// a blob in Azure storage. Use this to get information about the databases - /// stored in a backup. + /// Description for Creates a domain ownership identifier for web app, or + /// updates an existing ownership identifier. /// /// /// Name of the resource group to which the resource belongs. @@ -13187,9 +13423,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// A RestoreRequest object that includes Azure storage URL and blog name for - /// discovery of backup. + /// + /// Name of domain ownership identifier. + /// + /// + /// A JSON representation of the domain ownership properties. /// /// /// Headers that will be added to request. @@ -13212,7 +13450,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DiscoverBackupWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13237,13 +13475,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); } - if (request != null) + if (domainOwnershipIdentifier == null) { - request.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); } if (Client.SubscriptionId == null) { @@ -13262,15 +13500,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DiscoverBackup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateDomainOwnershipIdentifier", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -13284,7 +13524,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -13315,9 +13555,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) + if(domainOwnershipIdentifier != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -13371,7 +13611,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -13384,7 +13624,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -13404,17 +13644,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Lists ownership identifiers for domain associated with web app. + /// Get the status of the last MSDeploy operation. /// /// - /// Description for Lists ownership identifiers for domain associated with web - /// app. + /// Description for Get the status of the last MSDeploy operation. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -13437,7 +13676,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDomainOwnershipIdentifiersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMSDeployStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13480,11 +13719,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployStatus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -13581,7 +13820,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -13594,7 +13833,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -13614,19 +13853,44 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get domain ownership identifier for web app. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Get domain ownership identifier for web app. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// Name of domain ownership identifier. + /// + /// Details of MSDeploy operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateMSDeployOperationWithHttpMessagesAsync(resourceGroupName, name, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. /// /// /// Headers that will be added to request. @@ -13649,7 +13913,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMSDeployLogWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13674,10 +13938,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -13695,16 +13955,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifier", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployLog", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -13769,7 +14027,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -13799,7 +14057,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -13812,7 +14070,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -13832,24 +14090,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a domain ownership identifier for web app, or updates an existing - /// ownership identifier. + /// List the functions for a web site, or a deployment slot. /// /// - /// Description for Creates a domain ownership identifier for web app, or - /// updates an existing ownership identifier. + /// Description for List the functions for a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of domain ownership identifier. - /// - /// - /// A JSON representation of the domain ownership properties. + /// Site name. /// /// /// Headers that will be added to request. @@ -13872,7 +14122,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13897,14 +14147,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } - if (domainOwnershipIdentifier == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -13922,17 +14164,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); - tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateDomainOwnershipIdentifier", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -13946,7 +14185,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -13977,12 +14216,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(domainOwnershipIdentifier != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -14003,7 +14236,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14033,7 +14266,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -14046,7 +14279,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -14066,19 +14299,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a domain ownership identifier for a web app. + /// Fetch a short lived token that can be exchanged for a master key. /// /// - /// Description for Deletes a domain ownership identifier for a web app. + /// Description for Fetch a short lived token that can be exchanged for a + /// master key. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of domain ownership identifier. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -14089,6 +14320,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -14098,7 +14332,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetFunctionsAdminTokenWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -14123,10 +14357,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -14144,16 +14374,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteDomainOwnershipIdentifier", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunctionsAdminToken", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14167,7 +14395,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -14218,7 +14446,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14248,13 +14476,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -14263,24 +14509,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a domain ownership identifier for web app, or updates an existing - /// ownership identifier. + /// Get function information by its ID for web site, or a deployment slot. /// /// - /// Description for Creates a domain ownership identifier for web app, or - /// updates an existing ownership identifier. + /// Description for Get function information by its ID for web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of domain ownership identifier. + /// Site name. /// - /// - /// A JSON representation of the domain ownership properties. + /// + /// Function name. /// /// /// Headers that will be added to request. @@ -14303,7 +14545,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -14328,13 +14570,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } - if (domainOwnershipIdentifier == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (Client.SubscriptionId == null) { @@ -14353,17 +14591,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); - tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateDomainOwnershipIdentifier", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14377,7 +14614,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -14408,12 +14645,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(domainOwnershipIdentifier != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -14434,7 +14665,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14464,7 +14695,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -14477,7 +14708,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -14497,16 +14728,50 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the status of the last MSDeploy operation. + /// Create function for web site, or a deployment slot. /// /// - /// Description for Get the status of the last MSDeploy operation. + /// Description for Create function for web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. + /// + /// + /// Function name. + /// + /// + /// Function details. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateFunctionWithHttpMessagesAsync(resourceGroupName, name, functionName, functionEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a function for web site, or a deployment slot. + /// + /// + /// Description for Delete a function for web site, or a deployment slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Function name. /// /// /// Headers that will be added to request. @@ -14517,9 +14782,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -14529,7 +14791,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMSDeployStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -14554,6 +14816,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -14571,14 +14837,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteFunction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14592,7 +14860,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -14643,7 +14911,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14673,31 +14941,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -14706,44 +14956,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Add or update a function secret. /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Add or update a function secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Details of MSDeploy operation - /// - /// - /// The headers that will be added to request. + /// Site name. /// - /// - /// The cancellation token. + /// + /// The name of the function. /// - public async Task> CreateMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateMSDeployOperationWithHttpMessagesAsync(resourceGroupName, name, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// The name of the key. /// - /// - /// Name of web app. + /// + /// The key to create or update /// /// /// Headers that will be added to request. @@ -14766,7 +14997,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMSDeployLogWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateFunctionSecretWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -14791,6 +15022,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } + if (key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "key"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -14808,14 +15051,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyName", keyName); + tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployLog", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateFunctionSecret", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14829,7 +15077,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -14860,6 +15108,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(key != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -14880,7 +15134,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14910,7 +15164,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -14923,7 +15177,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -14943,10 +15215,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the functions for a web site, or a deployment slot. + /// Delete a function secret. /// /// - /// Description for List the functions for a web site, or a deployment slot. + /// Description for Delete a function secret. /// /// /// Name of the resource group to which the resource belongs. @@ -14954,6 +15226,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// The name of the function. + /// + /// + /// The name of the key. + /// /// /// Headers that will be added to request. /// @@ -14963,9 +15241,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -14975,7 +15250,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteFunctionSecretWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15000,6 +15275,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -15017,14 +15300,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteFunctionSecret", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -15038,7 +15325,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15089,7 +15376,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -15119,31 +15406,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -15152,17 +15421,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Fetch a short lived token that can be exchanged for a master key. + /// Get function keys for a function in a web site, or a deployment slot. /// /// - /// Description for Fetch a short lived token that can be exchanged for a - /// master key. + /// Description for Get function keys for a function in a web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. + /// + /// + /// Function name. /// /// /// Headers that will be added to request. @@ -15185,7 +15457,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetFunctionsAdminTokenWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListFunctionKeysWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15210,6 +15482,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -15227,14 +15503,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetFunctionsAdminToken", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionKeys", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -15248,7 +15526,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15329,7 +15607,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -15342,7 +15620,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -15362,10 +15640,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function information by its ID for web site, or a deployment slot. + /// Get function secrets for a function in a web site, or a deployment slot. /// /// - /// Description for Get function information by its ID for web site, or a + /// Description for Get function secrets for a function in a web site, or a /// deployment slot. /// /// @@ -15398,7 +15676,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListFunctionSecretsWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15446,11 +15724,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetFunction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionSecrets", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); @@ -15467,7 +15745,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15518,7 +15796,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -15548,7 +15826,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -15561,7 +15839,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -15581,41 +15859,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create function for web site, or a deployment slot. - /// - /// - /// Description for Create function for web site, or a deployment slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// - /// - /// Function name. - /// - /// - /// Function details. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateFunctionWithHttpMessagesAsync(resourceGroupName, name, functionName, functionEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Delete a function for web site, or a deployment slot. + /// Get host secrets for a function app. /// /// - /// Description for Delete a function for web site, or a deployment slot. + /// Description for Get host secrets for a function app. /// /// /// Name of the resource group to which the resource belongs. @@ -15623,9 +15870,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Function name. - /// /// /// Headers that will be added to request. /// @@ -15635,6 +15879,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -15644,7 +15891,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListHostKeysWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15669,10 +15916,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -15690,16 +15933,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteFunction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostKeys", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -15713,7 +15954,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15764,7 +16005,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -15794,13 +16035,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -15809,25 +16068,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Add or update a function secret. + /// This is to allow calling via powershell and ARM template. /// /// - /// Description for Add or update a function secret. + /// Description for This is to allow calling via powershell and ARM template. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// The name of the function. - /// - /// - /// The name of the key. - /// - /// - /// The key to create or update + /// Name of the app. /// /// /// Headers that will be added to request. @@ -15838,9 +16088,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -15850,7 +16097,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateFunctionSecretWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ListSyncStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15875,18 +16122,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (keyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); - } - if (key == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "key"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -15904,19 +16139,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("keyName", keyName); - tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateFunctionSecret", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncStatus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -15930,7 +16160,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15961,12 +16191,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(key != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -15987,7 +16211,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16017,49 +16241,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -16068,22 +16256,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a function secret. + /// Syncs function trigger metadata to the management database /// /// - /// Description for Delete a function secret. + /// Description for Syncs function trigger metadata to the management database /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// The name of the function. - /// - /// - /// The name of the key. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -16103,7 +16285,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteFunctionSecretWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16128,14 +16310,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (keyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -16153,18 +16327,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("keyName", keyName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteFunctionSecret", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncFunctions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -16178,7 +16348,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16229,7 +16399,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16274,11 +16444,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function keys for a function in a web site, or a deployment slot. + /// Add or update a host level secret. /// /// - /// Description for Get function keys for a function in a web site, or a - /// deployment slot. + /// Description for Add or update a host level secret. /// /// /// Name of the resource group to which the resource belongs. @@ -16286,8 +16455,14 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Function name. + /// + /// The type of host key. + /// + /// + /// The name of the key. + /// + /// + /// The key to create or update /// /// /// Headers that will be added to request. @@ -16310,7 +16485,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListFunctionKeysWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHostSecretWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16335,9 +16510,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (keyType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } + if (key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "key"); } if (Client.SubscriptionId == null) { @@ -16356,16 +16539,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyType", keyType); + tracingParameters.Add("keyName", keyName); + tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostSecret", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -16379,7 +16565,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16410,6 +16596,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(key != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -16430,7 +16622,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16460,7 +16652,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -16473,7 +16665,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -16493,11 +16703,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function secrets for a function in a web site, or a deployment slot. + /// Delete a host level secret. /// /// - /// Description for Get function secrets for a function in a web site, or a - /// deployment slot. + /// Description for Delete a host level secret. /// /// /// Name of the resource group to which the resource belongs. @@ -16505,8 +16714,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Function name. + /// + /// The type of host key. + /// + /// + /// The name of the key. /// /// /// Headers that will be added to request. @@ -16517,9 +16729,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -16529,7 +16738,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListFunctionSecretsWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHostSecretWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16554,9 +16763,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (keyType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); } if (Client.SubscriptionId == null) { @@ -16575,16 +16788,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyType", keyType); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionSecrets", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHostSecret", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -16598,7 +16813,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16649,7 +16864,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16679,31 +16894,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -16712,16 +16909,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get host secrets for a function app. + /// Get hostname bindings for an app or a deployment slot. /// /// - /// Description for Get host secrets for a function app. + /// Description for Get hostname bindings for an app or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -16744,7 +16941,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListHostKeysWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListHostNameBindingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16787,11 +16984,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -16807,7 +17004,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16888,7 +17085,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -16901,7 +17098,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -16921,10 +17118,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// This is to allow calling via powershell and ARM template. + /// Get the named hostname binding for an app (or deployment slot, if + /// specified). /// /// - /// Description for This is to allow calling via powershell and ARM template. + /// Description for Get the named hostname binding for an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -16932,6 +17131,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Hostname in the hostname binding. + /// /// /// Headers that will be added to request. /// @@ -16941,6 +17143,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -16950,7 +17155,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ListSyncStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16975,6 +17180,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (hostName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -16992,14 +17201,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSyncStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetHostNameBinding", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17013,7 +17224,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17064,7 +17275,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -17094,13 +17305,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -17109,10 +17338,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Syncs function trigger metadata to the management database + /// Creates a hostname binding for an app. /// /// - /// Description for Syncs function trigger metadata to the management database + /// Description for Creates a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. @@ -17120,6 +17349,13 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Hostname in the hostname binding. + /// + /// + /// Binding details. This is the JSON representation of a HostNameBinding + /// object. + /// /// /// Headers that will be added to request. /// @@ -17129,6 +17365,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -17138,7 +17377,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -17163,6 +17402,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (hostName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + } + if (hostNameBinding == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hostNameBinding"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -17180,14 +17427,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("hostName", hostName); + tracingParameters.Add("hostNameBinding", hostNameBinding); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncFunctions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostNameBinding", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17201,7 +17451,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17232,6 +17482,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(hostNameBinding != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostNameBinding, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -17252,7 +17508,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -17282,13 +17538,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -17297,25 +17571,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Add or update a host level secret. + /// Deletes a hostname binding for an app. /// /// - /// Description for Add or update a host level secret. + /// Description for Deletes a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// The type of host key. - /// - /// - /// The name of the key. + /// Name of the app. /// - /// - /// The key to create or update + /// + /// Hostname in the hostname binding. /// /// /// Headers that will be added to request. @@ -17326,9 +17594,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -17338,7 +17603,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHostSecretWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -17363,17 +17628,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (keyType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); - } - if (keyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); - } - if (key == null) + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "key"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); } if (Client.SubscriptionId == null) { @@ -17392,19 +17649,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("keyType", keyType); - tracingParameters.Add("keyName", keyName); - tracingParameters.Add("key", key); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostSecret", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHostNameBinding", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17418,7 +17672,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17449,12 +17703,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(key != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -17475,7 +17723,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -17505,49 +17753,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -17556,22 +17768,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a host level secret. + /// Retrieves a specific Service Bus Hybrid Connection used by this Web App. /// /// - /// Description for Delete a host level secret. + /// Description for Retrieves a specific Service Bus Hybrid Connection used by + /// this Web App. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// The type of host key. + /// + /// The namespace for this hybrid connection. /// - /// - /// The name of the key. + /// + /// The relay name for this hybrid connection. /// /// /// Headers that will be added to request. @@ -17582,6 +17795,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -17591,7 +17807,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHostSecretWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -17616,13 +17832,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (keyType == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (keyName == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } if (Client.SubscriptionId == null) { @@ -17641,18 +17857,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("keyType", keyType); - tracingParameters.Add("keyName", keyName); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHostSecret", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetHybridConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17666,7 +17882,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17717,7 +17933,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -17747,13 +17963,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -17762,16 +17996,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get hostname bindings for an app or a deployment slot. + /// Creates a new Hybrid Connection using a Service Bus relay. /// /// - /// Description for Get hostname bindings for an app or a deployment slot. + /// Description for Creates a new Hybrid Connection using a Service Bus relay. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. + /// + /// + /// The namespace for this hybrid connection. + /// + /// + /// The relay name for this hybrid connection. + /// + /// + /// The details of the hybrid connection. /// /// /// Headers that will be added to request. @@ -17794,7 +18037,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListHostNameBindingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -17819,6 +18062,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (namespaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (relayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -17836,14 +18091,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHybridConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17857,7 +18117,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17888,6 +18148,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -17938,7 +18204,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -17951,7 +18217,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -17971,21 +18237,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the named hostname binding for an app (or deployment slot, if - /// specified). + /// Removes a Hybrid Connection from this site. /// /// - /// Description for Get the named hostname binding for an app (or deployment - /// slot, if specified). + /// Description for Removes a Hybrid Connection from this site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Hostname in the hostname binding. + /// + /// The namespace for this hybrid connection. + /// + /// + /// The relay name for this hybrid connection. /// /// /// Headers that will be added to request. @@ -17996,9 +18263,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -18008,7 +18272,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18033,9 +18297,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostName == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (relayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } if (Client.SubscriptionId == null) { @@ -18054,16 +18322,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostName", hostName); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHostNameBinding", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHybridConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18077,7 +18347,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -18128,7 +18398,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -18158,31 +18428,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -18191,23 +18443,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a hostname binding for an app. + /// Creates a new Hybrid Connection using a Service Bus relay. /// /// - /// Description for Creates a hostname binding for an app. + /// Description for Creates a new Hybrid Connection using a Service Bus relay. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Hostname in the hostname binding. + /// + /// The namespace for this hybrid connection. /// - /// - /// Binding details. This is the JSON representation of a HostNameBinding - /// object. + /// + /// The relay name for this hybrid connection. + /// + /// + /// The details of the hybrid connection. /// /// /// Headers that will be added to request. @@ -18230,7 +18484,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18255,13 +18509,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostName == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (hostNameBinding == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostNameBinding"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -18280,17 +18538,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostName", hostName); - tracingParameters.Add("hostNameBinding", hostNameBinding); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostNameBinding", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateHybridConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18304,7 +18564,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -18335,9 +18595,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(hostNameBinding != null) + if(connectionEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostNameBinding, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -18391,7 +18651,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -18404,7 +18664,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -18424,19 +18684,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a hostname binding for an app. + /// Retrieves all Service Bus Hybrid Connections used by this Web App. /// /// - /// Description for Deletes a hostname binding for an app. + /// Description for Retrieves all Service Bus Hybrid Connections used by this + /// Web App. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Hostname in the hostname binding. + /// The name of the web app. /// /// /// Headers that will be added to request. @@ -18447,6 +18705,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -18456,7 +18717,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListHybridConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18481,10 +18742,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -18502,16 +18759,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHostNameBinding", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHybridConnections", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18525,7 +18780,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -18576,7 +18831,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -18606,13 +18861,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -18621,23 +18894,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Retrieves a specific Service Bus Hybrid Connection used by this Web App. + /// Gets hybrid connections configured for an app (or deployment slot, if + /// specified). /// /// - /// Description for Retrieves a specific Service Bus Hybrid Connection used by - /// this Web App. + /// Description for Gets hybrid connections configured for an app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. - /// - /// - /// The relay name for this hybrid connection. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -18660,7 +18928,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListRelayServiceConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18685,14 +18953,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -18710,18 +18970,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHybridConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListRelayServiceConnections", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18816,7 +19072,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -18829,7 +19085,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -18849,25 +19105,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new Hybrid Connection using a Service Bus relay. + /// Gets a hybrid connection configuration by its name. /// /// - /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Description for Gets a hybrid connection configuration by its name. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. - /// - /// - /// The relay name for this hybrid connection. + /// Name of the app. /// - /// - /// The details of the hybrid connection. + /// + /// Name of the hybrid connection. /// /// /// Headers that will be added to request. @@ -18890,7 +19140,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18915,17 +19165,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); - } - if (connectionEnvelope == null) + if (entityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); } if (Client.SubscriptionId == null) { @@ -18944,19 +19186,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHybridConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetRelayServiceConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18970,7 +19209,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -19001,12 +19240,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -19057,7 +19290,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -19070,7 +19303,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -19090,22 +19323,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Removes a Hybrid Connection from this site. + /// Creates a new hybrid connection configuration (PUT), or updates an existing + /// one (PATCH). /// /// - /// Description for Removes a Hybrid Connection from this site. + /// Description for Creates a new hybrid connection configuration (PUT), or + /// updates an existing one (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. /// - /// - /// The namespace for this hybrid connection. + /// + /// Name of the hybrid connection configuration. /// - /// - /// The relay name for this hybrid connection. + /// + /// Details of the hybrid connection configuration. /// /// /// Headers that will be added to request. @@ -19116,6 +19351,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -19125,7 +19363,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -19150,13 +19388,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) + if (entityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); } - if (relayName == null) + if (connectionEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -19175,18 +19413,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); + tracingParameters.Add("entityName", entityName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHybridConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateRelayServiceConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19200,7 +19437,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -19231,6 +19468,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -19251,7 +19494,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -19281,13 +19524,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -19296,25 +19557,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new Hybrid Connection using a Service Bus relay. + /// Deletes a relay service connection by its name. /// /// - /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Description for Deletes a relay service connection by its name. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. - /// - /// - /// The relay name for this hybrid connection. + /// Name of the app. /// - /// - /// The details of the hybrid connection. + /// + /// Name of the hybrid connection configuration. /// /// /// Headers that will be added to request. @@ -19325,9 +19580,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -19337,7 +19589,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -19362,17 +19614,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); - } - if (connectionEnvelope == null) + if (entityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); } if (Client.SubscriptionId == null) { @@ -19391,19 +19635,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateHybridConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteRelayServiceConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19417,7 +19658,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -19448,12 +19689,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -19474,7 +19709,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -19504,31 +19739,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -19537,17 +19754,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Creates a new hybrid connection configuration (PUT), or updates an existing + /// one (PATCH). /// /// - /// Description for Retrieves all Service Bus Hybrid Connections used by this - /// Web App. + /// Description for Creates a new hybrid connection configuration (PUT), or + /// updates an existing one (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. + /// + /// + /// Name of the hybrid connection configuration. + /// + /// + /// Details of the hybrid connection configuration. /// /// /// Headers that will be added to request. @@ -19570,7 +19794,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListHybridConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -19595,6 +19819,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (entityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -19612,14 +19844,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("entityName", entityName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHybridConnections", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateRelayServiceConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19633,7 +19868,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -19664,6 +19899,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -19714,7 +19955,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -19727,7 +19968,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -19747,12 +19988,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets hybrid connections configured for an app (or deployment slot, if - /// specified). + /// Gets all scale-out instances of an app. /// /// - /// Description for Gets hybrid connections configured for an app (or - /// deployment slot, if specified). + /// Description for Gets all scale-out instances of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -19781,7 +20020,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListRelayServiceConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceIdentifiersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -19824,11 +20063,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRelayServiceConnections", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -19925,7 +20164,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -19938,7 +20177,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -19958,10 +20197,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a hybrid connection configuration by its name. + /// Gets all scale-out instances of an app. /// /// - /// Description for Gets a hybrid connection configuration by its name. + /// Description for Gets all scale-out instances of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -19969,8 +20208,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the hybrid connection. + /// /// /// /// Headers that will be added to request. @@ -19993,7 +20231,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceInfoWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20018,9 +20256,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); } if (Client.SubscriptionId == null) { @@ -20039,16 +20277,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetRelayServiceConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceInfo", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20143,7 +20381,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -20156,7 +20394,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -20176,24 +20414,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new hybrid connection configuration (PUT), or updates an existing - /// one (PATCH). + /// Get the status of the last MSDeploy operation. /// /// - /// Description for Creates a new hybrid connection configuration (PUT), or - /// updates an existing one (PATCH). + /// Description for Get the status of the last MSDeploy operation. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the hybrid connection configuration. + /// Name of web app. /// - /// - /// Details of the hybrid connection configuration. + /// + /// ID of web app instance. /// /// /// Headers that will be added to request. @@ -20216,7 +20449,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceMsDeployStatusWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20241,13 +20474,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } - if (connectionEnvelope == null) + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); } if (Client.SubscriptionId == null) { @@ -20266,17 +20495,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateRelayServiceConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMsDeployStatus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20290,7 +20518,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -20321,12 +20549,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -20377,7 +20599,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -20390,7 +20612,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -20410,19 +20632,50 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a relay service connection by its name. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Deletes a relay service connection by its name. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// Name of the hybrid connection configuration. + /// + /// ID of web app instance. + /// + /// + /// Details of MSDeploy operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateInstanceMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateInstanceMSDeployOperationWithHttpMessagesAsync(resourceGroupName, name, instanceId, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// ID of web app instance. /// /// /// Headers that will be added to request. @@ -20433,6 +20686,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -20442,7 +20698,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceMSDeployLogWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20467,9 +20723,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); } if (Client.SubscriptionId == null) { @@ -20488,16 +20744,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteRelayServiceConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMSDeployLog", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20511,7 +20767,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -20592,13 +20848,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -20607,24 +20881,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new hybrid connection configuration (PUT), or updates an existing - /// one (PATCH). + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Creates a new hybrid connection configuration (PUT), or - /// updates an existing one (PATCH). + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the hybrid connection configuration. + /// Site name. /// - /// - /// Details of the hybrid connection configuration. + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -20647,7 +20919,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessesWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20672,13 +20944,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } - if (connectionEnvelope == null) + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); } if (Client.SubscriptionId == null) { @@ -20697,17 +20965,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateRelayServiceConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcesses", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20721,7 +20988,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -20752,12 +21019,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -20778,7 +21039,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -20808,7 +21069,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -20821,7 +21082,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -20841,16 +21102,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -20873,7 +21143,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceIdentifiersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20898,6 +21168,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -20915,14 +21193,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20987,7 +21269,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -21017,7 +21299,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -21030,7 +21312,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -21050,18 +21332,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Terminate a process by its ID for a web site, or a deployment slot, or + /// specific scaled-out instance in a web site. /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. /// /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -21072,9 +21361,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -21084,7 +21370,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceInfoWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteInstanceProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -21109,6 +21395,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -21130,15 +21420,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceInfo", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceProcess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -21153,7 +21445,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -21204,7 +21496,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -21234,31 +21526,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -21267,19 +21541,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the status of the last MSDeploy operation. + /// Get a memory dump of a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Get the status of the last MSDeploy operation. + /// Description for Get a memory dump of a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. + /// + /// + /// PID. /// /// - /// ID of web app instance. + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -21302,7 +21582,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceMsDeployStatusWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -21327,6 +21607,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -21348,15 +21632,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMsDeployStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessDump", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -21414,7 +21700,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -21422,7 +21708,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -21452,7 +21738,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -21462,20 +21748,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -21485,50 +21758,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// ID of web app instance. - /// - /// - /// Details of MSDeploy operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateInstanceMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateInstanceMSDeployOperationWithHttpMessagesAsync(resourceGroupName, name, instanceId, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Site name. /// - /// - /// Name of web app. + /// + /// PID. /// /// - /// ID of web app instance. + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -21551,7 +21799,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceMSDeployLogWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -21576,6 +21824,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -21597,15 +21849,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMSDeployLog", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModules", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -21701,7 +21955,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -21714,7 +21968,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -21734,12 +21988,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -21747,6 +22001,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// PID. + /// + /// + /// Module base address. + /// /// /// ID of a specific scaled-out instance. This is the value of the name /// property in the JSON response from "GET api/sites/{siteName}/instances". @@ -21772,7 +22032,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessesWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -21797,6 +22057,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (baseAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -21818,15 +22086,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcesses", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessModule", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -21922,7 +22194,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -21935,7 +22207,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -21955,12 +22227,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -21996,7 +22268,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22049,11 +22321,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("processId", processId); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreads", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); @@ -22152,7 +22424,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -22165,7 +22437,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -22185,25 +22457,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Terminate a process by its ID for a web site, or a deployment slot, or - /// specific scaled-out instance in a web site. + /// Shows whether an app can be cloned to another resource group or + /// subscription. /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Shows whether an app can be cloned to another resource + /// group or subscription. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. - /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// Name of the app. /// /// /// Headers that will be added to request. @@ -22214,6 +22479,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -22223,7 +22491,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteInstanceProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> IsCloneableWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22248,14 +22516,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -22273,18 +22533,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceProcess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "IsCloneable", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -22298,7 +22554,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -22349,7 +22605,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -22379,13 +22635,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -22394,25 +22668,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a memory dump of a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets existing backups of an app. /// /// - /// Description for Get a memory dump of a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets existing backups of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. - /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// Name of the app. /// /// /// Headers that will be added to request. @@ -22435,7 +22700,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteBackupsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22460,14 +22725,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -22485,18 +22742,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessDump", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackups", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -22510,7 +22763,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -22553,7 +22806,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -22561,7 +22814,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -22591,7 +22844,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -22601,7 +22854,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -22611,25 +22877,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// This is to allow calling via powershell and ARM template. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for This is to allow calling via powershell and ARM template. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. - /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// Name of the app. /// /// /// Headers that will be added to request. @@ -22652,7 +22909,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSyncFunctionTriggersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22677,14 +22934,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -22702,18 +22951,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModules", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncFunctionTriggers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -22727,7 +22972,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -22778,7 +23023,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -22808,7 +23053,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -22821,7 +23066,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -22841,28 +23086,78 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Restores a web app. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Restores a web app. /// + /// + /// Azure subscription. + /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of web app. /// - /// - /// PID. + /// + /// Migration migrationOptions. /// - /// - /// Module base address. + /// + /// The headers that will be added to request. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// The cancellation token. + /// + public async Task> MigrateStorageWithHttpMessagesAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginMigrateStorageWithHttpMessagesAsync(subscriptionName, resourceGroupName, name, migrationOptions, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Migrates a local (in-app) MySql database to a remote MySql database. + /// + /// + /// Description for Migrates a local (in-app) MySql database to a remote MySql + /// database. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// MySql migration options. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> MigrateMySqlWithHttpMessagesAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginMigrateMySqlWithHttpMessagesAsync(resourceGroupName, name, migrationRequestEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the status of MySql in app migration, if one is active, and whether + /// or not MySql in app is enabled + /// + /// + /// Description for Returns the status of MySql in app migration, if one is + /// active, and whether or not MySql in app is enabled + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. /// /// /// Headers that will be added to request. @@ -22885,7 +23180,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMigrateMySqlStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22910,18 +23205,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (baseAddress == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); - } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -22939,20 +23222,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("baseAddress", baseAddress); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessModule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMigrateMySqlStatus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -23017,7 +23294,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -23047,7 +23324,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -23060,7 +23337,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -23080,25 +23357,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets a Swift Virtual Network connection. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets a Swift Virtual Network connection. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. - /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// Name of the app. /// /// /// Headers that will be added to request. @@ -23121,7 +23389,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -23146,14 +23414,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -23171,18 +23431,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreads", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSwiftVirtualNetworkConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -23247,7 +23503,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -23277,7 +23533,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -23290,7 +23546,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -23310,12 +23566,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Shows whether an app can be cloned to another resource group or - /// subscription. + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. /// /// - /// Description for Shows whether an app can be cloned to another resource - /// group or subscription. + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. /// /// /// Name of the resource group to which the resource belongs. @@ -23323,6 +23584,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Properties of the Virtual Network connection. See example. + /// /// /// Headers that will be added to request. /// @@ -23344,7 +23608,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> IsCloneableWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -23369,6 +23633,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -23386,12 +23654,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "IsCloneable", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateSwiftVirtualNetworkConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -23407,7 +23676,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -23438,6 +23707,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -23488,7 +23763,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -23501,7 +23776,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -23521,10 +23796,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Deletes a Swift Virtual Network connection from an app (or deployment + /// slot). /// /// - /// Description for Gets existing backups of an app. + /// Description for Deletes a Swift Virtual Network connection from an app (or + /// deployment slot). /// /// /// Name of the resource group to which the resource belongs. @@ -23541,9 +23818,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -23553,7 +23827,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteBackupsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSwiftVirtualNetworkWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -23596,11 +23870,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackups", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSwiftVirtualNetwork", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -23616,7 +23890,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -23667,7 +23941,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -23697,31 +23971,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -23730,10 +23986,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// This is to allow calling via powershell and ARM template. + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. /// /// - /// Description for This is to allow calling via powershell and ARM template. + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. /// /// /// Name of the resource group to which the resource belongs. @@ -23741,6 +24004,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Properties of the Virtual Network connection. See example. + /// /// /// Headers that will be added to request. /// @@ -23762,7 +24028,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSyncFunctionTriggersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -23787,6 +24053,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -23804,12 +24074,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSyncFunctionTriggers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSwiftVirtualNetworkConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -23825,7 +24096,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -23856,6 +24127,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -23906,7 +24183,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -23919,7 +24196,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -23939,78 +24216,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a web app. - /// - /// - /// Description for Restores a web app. - /// - /// - /// Azure subscription. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Migration migrationOptions. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> MigrateStorageWithHttpMessagesAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginMigrateStorageWithHttpMessagesAsync(subscriptionName, resourceGroupName, name, migrationOptions, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrates a local (in-app) MySql database to a remote MySql database. + /// Gets all network features used by the app (or deployment slot, if + /// specified). /// /// - /// Description for Migrates a local (in-app) MySql database to a remote MySql - /// database. + /// Description for Gets all network features used by the app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// MySql migration options. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> MigrateMySqlWithHttpMessagesAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginMigrateMySqlWithHttpMessagesAsync(resourceGroupName, name, migrationRequestEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns the status of MySql in app migration, if one is active, and whether - /// or not MySql in app is enabled - /// - /// - /// Description for Returns the status of MySql in app migration, if one is - /// active, and whether or not MySql in app is enabled - /// - /// - /// Name of the resource group to which the resource belongs. + /// Name of the app. /// - /// - /// Name of web app. + /// + /// The type of view. This can either be "summary" or "detailed". /// /// /// Headers that will be added to request. @@ -24033,7 +24253,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMigrateMySqlStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListNetworkFeaturesWithHttpMessagesAsync(string resourceGroupName, string name, string view, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24058,6 +24278,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (view == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "view"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -24075,14 +24299,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("view", view); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMigrateMySqlStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNetworkFeatures", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{view}", System.Uri.EscapeDataString(view)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -24147,7 +24373,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -24177,7 +24403,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -24190,7 +24416,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -24210,10 +24436,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a Swift Virtual Network connection. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Gets a Swift Virtual Network connection. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -24221,6 +24449,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// GUID of the operation. + /// /// /// Headers that will be added to request. /// @@ -24242,7 +24473,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24267,6 +24498,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -24284,14 +24519,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSwiftVirtualNetworkConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -24356,7 +24593,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -24386,7 +24623,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -24399,7 +24636,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -24419,18 +24674,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a Swift Virtual Network connection from an app (or deployment - /// slot). + /// Start capturing network packets for the site (To be deprecated). /// /// - /// Description for Deletes a Swift Virtual Network connection from an app (or - /// deployment slot). + /// Description for Start capturing network packets for the site (To be + /// deprecated). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. /// /// /// Headers that will be added to request. @@ -24441,6 +24704,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -24450,7 +24716,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSwiftVirtualNetworkWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> StartWebSiteNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24492,16 +24758,31 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSwiftVirtualNetwork", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartWebSiteNetworkTrace", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -24513,7 +24794,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -24564,7 +24845,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -24594,13 +24875,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -24609,21 +24908,50 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all network features used by the app (or deployment slot, if - /// specified). + /// Start capturing network packets for the site. /// /// - /// Description for Gets all network features used by the app (or deployment - /// slot, if specified). + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// The type of view. Only "summary" is supported at this time. + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> StartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stop ongoing capturing network packets for the site. + /// + /// + /// Description for Stop ongoing capturing network packets for the site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. /// /// /// Headers that will be added to request. @@ -24634,9 +24962,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -24646,7 +24971,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListNetworkFeaturesWithHttpMessagesAsync(string resourceGroupName, string name, string view, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopWebSiteNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24671,10 +24996,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (view == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "view"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -24692,16 +25013,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("view", view); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNetworkFeatures", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopWebSiteNetworkTrace", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{view}", System.Uri.EscapeDataString(view)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -24715,7 +25034,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -24766,7 +25085,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -24796,31 +25115,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -24866,7 +25167,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTracesWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24914,11 +25215,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraces", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); @@ -24986,7 +25287,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25041,24 +25342,6 @@ internal WebAppsOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -25067,26 +25350,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site (To be deprecated). + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Start capturing network packets for the site (To be - /// deprecated). + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). + /// Name of the app. /// - /// - /// The Blob URL to store capture file. + /// + /// GUID of the operation. /// /// /// Headers that will be added to request. @@ -25109,7 +25387,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> StartWebSiteNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTraceOperationV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -25134,6 +25412,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -25151,31 +25433,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartWebSiteNetworkTrace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationV2", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -25187,7 +25456,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -25238,7 +25507,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25268,7 +25537,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -25281,7 +25550,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -25301,50 +25588,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Start capturing network packets for the site. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> StartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stop ongoing capturing network packets for the site. - /// - /// - /// Description for Stop ongoing capturing network packets for the site. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Name of the app. /// - /// - /// The name of the web app. + /// + /// GUID of the operation. /// /// /// Headers that will be added to request. @@ -25355,6 +25613,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -25364,7 +25625,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopWebSiteNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTracesV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -25389,6 +25650,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -25406,14 +25671,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopWebSiteNetworkTrace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesV2", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -25427,7 +25694,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -25478,7 +25745,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25508,13 +25775,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -25523,11 +25808,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Generates a new publishing password for an app (or deployment slot, if + /// specified). /// /// - /// Description for Gets a named operation for a network trace capturing (or + /// Description for Generates a new publishing password for an app (or /// deployment slot, if specified). /// /// @@ -25536,9 +25821,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// GUID of the operation. - /// /// /// Headers that will be added to request. /// @@ -25548,9 +25830,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -25560,7 +25839,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTracesWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task GenerateNewSitePublishingPasswordWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -25585,10 +25864,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -25606,16 +25881,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraces", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GenerateNewSitePublishingPassword", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -25629,7 +25902,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -25680,7 +25953,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25710,31 +25983,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -25743,21 +25998,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Gets perfmon counters for web app. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Gets perfmon counters for web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// GUID of the operation. + /// + /// Return only usages/metrics specified in the filter. Filter conforms to + /// odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and + /// endTime eq 2014-12-31T23:59:59Z and timeGrain eq + /// duration'[Hour|Minute|Day]'. /// /// /// Headers that will be added to request. @@ -25780,7 +26036,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTraceOperationV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPerfMonCountersWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -25805,10 +26061,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -25826,18 +26078,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationV2", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCounters", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -25900,7 +26155,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25930,7 +26185,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -25943,25 +26198,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -25981,21 +26218,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Gets web app's event logs. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Gets web app's event logs. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// GUID of the operation. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -26018,7 +26250,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTracesV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSitePhpErrorLogFlagWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26043,10 +26275,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -26064,16 +26292,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesV2", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSitePhpErrorLogFlag", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -26168,7 +26394,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -26181,7 +26407,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -26201,12 +26427,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Generates a new publishing password for an app (or deployment slot, if - /// specified). + /// Gets the premier add-ons of an app. /// /// - /// Description for Generates a new publishing password for an app (or - /// deployment slot, if specified). + /// Description for Gets the premier add-ons of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -26223,6 +26447,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -26232,7 +26459,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task GenerateNewSitePublishingPasswordWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPremierAddOnsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26275,11 +26502,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GenerateNewSitePublishingPassword", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPremierAddOns", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -26295,7 +26522,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -26346,7 +26573,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -26376,13 +26603,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -26391,22 +26636,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets perfmon counters for web app. + /// Gets a named add-on of an app. /// /// - /// Description for Gets perfmon counters for web app. + /// Description for Gets a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Return only usages/metrics specified in the filter. Filter conforms to - /// odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and - /// endTime eq 2014-12-31T23:59:59Z and timeGrain eq - /// duration'[Hour|Minute|Day]'. + /// + /// Add-on name. /// /// /// Headers that will be added to request. @@ -26429,7 +26671,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPerfMonCountersWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26454,6 +26696,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (premierAddOnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -26471,21 +26717,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("filter", filter); + tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCounters", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPremierAddOn", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -26578,7 +26821,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -26591,7 +26834,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -26611,16 +26854,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets web app's event logs. + /// Updates a named add-on of an app. /// /// - /// Description for Gets web app's event logs. + /// Description for Updates a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Add-on name. + /// + /// + /// A JSON representation of the edited premier add-on. /// /// /// Headers that will be added to request. @@ -26643,7 +26892,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSitePhpErrorLogFlagWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AddPremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26668,6 +26917,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (premierAddOnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } + if (premierAddOn == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); + } + if (premierAddOn != null) + { + premierAddOn.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -26685,14 +26946,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSitePhpErrorLogFlag", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddPremierAddOn", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -26706,7 +26970,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -26737,6 +27001,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(premierAddOn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -26787,7 +27057,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -26800,7 +27070,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -26820,10 +27090,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the premier add-ons of an app. + /// Delete a premier add-on from an app. /// /// - /// Description for Gets the premier add-ons of an app. + /// Description for Delete a premier add-on from an app. /// /// /// Name of the resource group to which the resource belongs. @@ -26831,6 +27101,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Add-on name. + /// /// /// Headers that will be added to request. /// @@ -26840,9 +27113,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -26852,7 +27122,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListPremierAddOnsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeletePremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26877,6 +27147,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (premierAddOnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -26894,14 +27168,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPremierAddOns", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeletePremierAddOn", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -26915,7 +27191,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -26996,31 +27272,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -27029,10 +27287,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named add-on of an app. + /// Updates a named add-on of an app. /// /// - /// Description for Gets a named add-on of an app. + /// Description for Updates a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -27043,6 +27301,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Add-on name. /// + /// + /// A JSON representation of the edited premier add-on. + /// /// /// Headers that will be added to request. /// @@ -27064,7 +27325,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdatePremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27093,6 +27354,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); } + if (premierAddOn == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -27111,8 +27376,9 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPremierAddOn", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdatePremierAddOn", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -27133,7 +27399,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27164,6 +27430,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(premierAddOn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -27247,22 +27519,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates a named add-on of an app. + /// Gets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Updates a named add-on of an app. + /// Description for Gets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Add-on name. - /// - /// - /// A JSON representation of the edited premier add-on. + /// The name of the web app. /// /// /// Headers that will be added to request. @@ -27285,7 +27553,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddPremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateAccessWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27310,18 +27578,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } - if (premierAddOn == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); - } - if (premierAddOn != null) - { - premierAddOn.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -27339,17 +27595,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); - tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddPremierAddOn", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateAccess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -27363,7 +27616,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27394,12 +27647,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(premierAddOn != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -27450,7 +27697,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -27463,7 +27710,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -27483,19 +27730,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a premier add-on from an app. + /// Sets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Delete a premier add-on from an app. + /// Description for Sets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Add-on name. + /// + /// The information for the private access /// /// /// Headers that will be added to request. @@ -27506,6 +27755,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -27515,7 +27767,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeletePremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PutPrivateAccessVnetWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27540,9 +27792,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) + if (access == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + throw new ValidationException(ValidationRules.CannotBeNull, "access"); } if (Client.SubscriptionId == null) { @@ -27561,16 +27813,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("access", access); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeletePremierAddOn", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "PutPrivateAccessVnet", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -27584,7 +27835,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27615,6 +27866,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(access != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(access, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -27665,13 +27922,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -27680,22 +27955,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates a named add-on of an app. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Updates a named add-on of an app. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Add-on name. - /// - /// - /// A JSON representation of the edited premier add-on. + /// Site name. /// /// /// Headers that will be added to request. @@ -27718,7 +27989,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdatePremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27743,14 +28014,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } - if (premierAddOn == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -27768,17 +28031,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); - tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdatePremierAddOn", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcesses", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -27792,7 +28052,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27823,12 +28083,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(premierAddOn != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -27849,7 +28103,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -27879,7 +28133,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -27892,7 +28146,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -27912,18 +28166,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Gets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Site name. + /// + /// + /// PID. /// /// /// Headers that will be added to request. @@ -27946,7 +28203,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateAccessWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27971,6 +28228,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -27988,14 +28249,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateAccess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28060,7 +28323,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28090,7 +28353,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -28103,7 +28366,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -28123,21 +28386,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Sets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Terminate a process by its ID for a web site, or a deployment slot, or + /// specific scaled-out instance in a web site. /// /// - /// Description for Sets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Site name. /// - /// - /// The information for the private access + /// + /// PID. /// /// /// Headers that will be added to request. @@ -28148,9 +28411,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -28160,7 +28420,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PutPrivateAccessVnetWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28185,9 +28445,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (access == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "access"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (Client.SubscriptionId == null) { @@ -28206,15 +28466,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("access", access); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PutPrivateAccessVnet", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteProcess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28228,7 +28489,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -28259,12 +28520,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(access != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(access, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -28285,7 +28540,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28315,31 +28570,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -28348,17 +28585,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the list of private endpoint connections associated with a site + /// Get a memory dump of a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets the list of private endpoint connections associated - /// with a site + /// Description for Get a memory dump of a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// Site name. + /// + /// + /// PID. /// /// /// Headers that will be added to request. @@ -28381,7 +28622,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28406,6 +28647,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -28423,14 +28668,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionList", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessDump", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28487,7 +28734,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -28495,7 +28742,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28525,7 +28772,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -28535,20 +28782,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -28558,19 +28792,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a private endpoint connection + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Gets a private endpoint connection + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// Site name. /// - /// - /// Name of the private endpoint connection. + /// + /// PID. /// /// /// Headers that will be added to request. @@ -28593,7 +28829,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28618,9 +28854,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (Client.SubscriptionId == null) { @@ -28639,16 +28875,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessModules", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28713,7 +28949,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28743,7 +28979,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -28756,7 +28992,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -28776,72 +29012,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a private endpoint connection + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Deletes a private endpoint connection + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// Site name. /// - public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// PID. /// - /// - /// Name of the site. + /// + /// Module base address. /// /// /// Headers that will be added to request. @@ -28864,7 +29052,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28889,6 +29077,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (baseAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -28906,14 +29102,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessModule", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28978,7 +29178,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -29008,7 +29208,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -29021,7 +29221,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -29041,12 +29241,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -29054,6 +29254,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// PID. + /// /// /// Headers that will be added to request. /// @@ -29075,7 +29278,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29100,6 +29303,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -29117,14 +29324,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcesses", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreads", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -29219,7 +29428,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -29232,7 +29441,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -29252,21 +29461,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Get public certificates for an app or a deployment slot. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Get public certificates for an app or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -29289,7 +29493,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPublicCertificatesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29314,10 +29518,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -29335,16 +29535,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificates", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -29409,7 +29607,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -29439,7 +29637,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -29452,7 +29650,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -29472,21 +29670,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Terminate a process by its ID for a web site, or a deployment slot, or - /// specific scaled-out instance in a web site. + /// Get the named public certificate for an app (or deployment slot, if + /// specified). /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Get the named public certificate for an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// Public certificate name. /// /// /// Headers that will be added to request. @@ -29497,6 +29695,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -29506,7 +29707,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29531,9 +29732,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (publicCertificateName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); } if (Client.SubscriptionId == null) { @@ -29552,16 +29753,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteProcess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPublicCertificate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -29575,7 +29776,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -29626,7 +29827,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -29656,13 +29857,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -29671,21 +29890,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a memory dump of a process by its ID for a specific scaled-out instance - /// in a web site. + /// Creates a hostname binding for an app. /// /// - /// Description for Get a memory dump of a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Creates a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// Public certificate name. + /// + /// + /// Public certificate details. This is the JSON representation of a + /// PublicCertificate object. /// /// /// Headers that will be added to request. @@ -29708,7 +29929,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdatePublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29733,9 +29954,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (publicCertificateName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } + if (publicCertificate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificate"); } if (Client.SubscriptionId == null) { @@ -29754,16 +29979,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("publicCertificateName", publicCertificateName); + tracingParameters.Add("publicCertificate", publicCertificate); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessDump", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdatePublicCertificate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -29777,7 +30003,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -29808,6 +30034,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(publicCertificate != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publicCertificate, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -29820,7 +30052,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -29828,7 +30060,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -29858,7 +30090,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -29868,7 +30100,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -29878,21 +30123,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Deletes a hostname binding for an app. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Deletes a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// Public certificate name. /// /// /// Headers that will be added to request. @@ -29903,9 +30146,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -29915,7 +30155,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeletePublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29940,9 +30180,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (publicCertificateName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); } if (Client.SubscriptionId == null) { @@ -29961,16 +30201,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessModules", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeletePublicCertificate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -29984,7 +30224,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30035,7 +30275,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30065,31 +30305,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -30098,24 +30320,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Gets the publishing profile for an app (or deployment slot, if specified). /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Gets the publishing profile for an app (or deployment slot, + /// if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// - /// - /// Module base address. + /// + /// Specifies publishingProfileOptions for publishing profile. For example, use + /// {"format": "FileZilla3"} to get a FileZilla publishing profile. /// /// /// Headers that will be added to request. @@ -30138,7 +30357,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPublishingProfileXmlWithSecretsWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -30163,13 +30382,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (baseAddress == null) + if (publishingProfileOptions == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + throw new ValidationException(ValidationRules.CannotBeNull, "publishingProfileOptions"); } if (Client.SubscriptionId == null) { @@ -30188,18 +30403,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("baseAddress", baseAddress); + tracingParameters.Add("publishingProfileOptions", publishingProfileOptions); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessModule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublishingProfileXmlWithSecrets", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -30213,7 +30425,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30244,6 +30456,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(publishingProfileOptions != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publishingProfileOptions, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -30256,7 +30474,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -30264,7 +30482,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30294,7 +30512,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -30304,20 +30522,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -30327,21 +30532,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Resets the configuration settings of the current slot if they were + /// previously modified by calling the API with POST. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Resets the configuration settings of the current slot if + /// they were previously modified by calling the API with POST. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -30352,9 +30554,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -30364,7 +30563,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ResetProductionSlotConfigWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -30389,10 +30588,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -30410,16 +30605,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreads", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ResetProductionSlotConfig", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -30433,7 +30626,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30484,7 +30677,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30514,31 +30707,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -30547,10 +30722,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get public certificates for an app or a deployment slot. + /// Restarts an app (or deployment slot, if specified). /// /// - /// Description for Get public certificates for an app or a deployment slot. + /// Description for Restarts an app (or deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -30558,6 +30733,14 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Specify true to apply the configuration settings and restarts the app only + /// if necessary. By default, the API always restarts and reprovisions the app. + /// + /// + /// Specify true to block until the app is restarted. By default, it is set to + /// false, and the API responds immediately (asynchronous). + /// /// /// Headers that will be added to request. /// @@ -30567,9 +30750,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -30579,7 +30759,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublicCertificatesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string name, bool? softRestart = default(bool?), bool? synchronous = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -30621,16 +30801,26 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("softRestart", softRestart); + tracingParameters.Add("synchronous", synchronous); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificates", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Restart", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (softRestart != null) + { + _queryParameters.Add(string.Format("softRestart={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softRestart, Client.SerializationSettings).Trim('"')))); + } + if (synchronous != null) + { + _queryParameters.Add(string.Format("synchronous={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(synchronous, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -30642,7 +30832,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30723,31 +30913,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -30756,12 +30928,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the named public certificate for an app (or deployment slot, if - /// specified). + /// Restores an app from a backup blob in Azure Storage. /// /// - /// Description for Get the named public certificate for an app (or deployment - /// slot, if specified). + /// Description for Restores an app from a backup blob in Azure Storage. /// /// /// Name of the resource group to which the resource belongs. @@ -30769,8 +30939,91 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Public certificate name. + /// + /// Information on restore request . + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFromBackupBlobWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFromBackupBlobWithHttpMessagesAsync(resourceGroupName, name, request, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores a deleted web app to this web app. + /// + /// + /// Description for Restores a deleted web app to this web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Deleted web app restore information. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFromDeletedAppWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFromDeletedAppWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores a web app from a snapshot. + /// + /// + /// Description for Restores a web app from a snapshot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Snapshot restore settings. Snapshot information can be obtained by calling + /// GetDeletedSites or GetSiteSnapshots API. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreSnapshotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get list of siteextensions for a web site, or a deployment slot. + /// + /// + /// Description for Get list of siteextensions for a web site, or a deployment + /// slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. /// /// /// Headers that will be added to request. @@ -30793,7 +31046,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteExtensionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -30818,10 +31071,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publicCertificateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -30839,16 +31088,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPublicCertificate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -30913,7 +31160,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30943,7 +31190,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -30956,7 +31203,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -30976,23 +31223,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a hostname binding for an app. + /// Get site extension information by its ID for a web site, or a deployment + /// slot. /// /// - /// Description for Creates a hostname binding for an app. + /// Description for Get site extension information by its ID for a web site, or + /// a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Public certificate name. + /// Site name. /// - /// - /// Public certificate details. This is the JSON representation of a - /// PublicCertificate object. + /// + /// Site extension name. /// /// /// Headers that will be added to request. @@ -31015,7 +31260,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdatePublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31040,13 +31285,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publicCertificateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); - } - if (publicCertificate == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificate"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (Client.SubscriptionId == null) { @@ -31065,17 +31306,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publicCertificateName", publicCertificateName); - tracingParameters.Add("publicCertificate", publicCertificate); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdatePublicCertificate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteExtension", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -31089,7 +31329,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -31120,12 +31360,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(publicCertificate != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publicCertificate, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -31146,7 +31380,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -31176,7 +31410,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -31189,7 +31423,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -31209,19 +31443,48 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a hostname binding for an app. + /// Install site extension on a web site, or a deployment slot. /// /// - /// Description for Deletes a hostname binding for an app. + /// Description for Install site extension on a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Public certificate name. + /// + /// Site extension name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> InstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginInstallSiteExtensionWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Remove a site extension from a web site, or a deployment slot. + /// + /// + /// Description for Remove a site extension from a web site, or a deployment + /// slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Site extension name. /// /// /// Headers that will be added to request. @@ -31241,7 +31504,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeletePublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31266,9 +31529,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publicCertificateName == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (Client.SubscriptionId == null) { @@ -31287,16 +31550,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publicCertificateName", publicCertificateName); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeletePublicCertificate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSiteExtension", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -31361,7 +31624,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -31406,11 +31669,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the publishing profile for an app (or deployment slot, if specified). + /// Copies a deployment slot to another deployment slot of an app. /// /// - /// Description for Gets the publishing profile for an app (or deployment slot, - /// if specified). + /// Description for Copies a deployment slot to another deployment slot of an + /// app. /// /// /// Name of the resource group to which the resource belongs. @@ -31418,9 +31681,34 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Specifies publishingProfileOptions for publishing profile. For example, use - /// {"format": "FileZilla3"} to get a FileZilla publishing profile. + /// + /// JSON object that contains the target slot name and site config properties + /// to override the source slot config. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task CopyProductionSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginCopyProductionSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an app's deployment slots. + /// + /// + /// Description for Gets an app's deployment slots. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. /// /// /// Headers that will be added to request. @@ -31443,7 +31731,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListPublishingProfileXmlWithSecretsWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSlotsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31468,10 +31756,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publishingProfileOptions == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publishingProfileOptions"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -31489,13 +31773,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publishingProfileOptions", publishingProfileOptions); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublishingProfileXmlWithSecrets", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlots", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -31511,7 +31794,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -31542,12 +31825,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(publishingProfileOptions != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publishingProfileOptions, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -31560,7 +31837,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -31598,7 +31875,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -31608,7 +31885,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -31618,12 +31908,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Resets the configuration settings of the current slot if they were - /// previously modified by calling the API with POST. + /// Gets the details of a web, mobile, or API app. /// /// - /// Description for Resets the configuration settings of the current slot if - /// they were previously modified by calling the API with POST. + /// Description for Gets the details of a web, mobile, or API app. /// /// /// Name of the resource group to which the resource belongs. @@ -31631,6 +31919,10 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the deployment slot. By default, this API returns the production + /// slot. + /// /// /// Headers that will be added to request. /// @@ -31640,6 +31932,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -31649,7 +31944,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ResetProductionSlotConfigWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31674,6 +31969,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -31691,14 +31990,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ResetProductionSlotConfig", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -31712,7 +32013,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -31763,7 +32064,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -31793,13 +32094,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -31808,24 +32127,64 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restarts an app (or deployment slot, if specified). + /// Creates a new web, mobile, or API app in an existing resource group, or + /// updates an existing app. /// /// - /// Description for Restarts an app (or deployment slot, if specified). + /// Description for Creates a new web, mobile, or API app in an existing + /// resource group, or updates an existing app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Unique name of the app to create or update. To create or update a + /// deployment slot, use the {slot} parameter. /// - /// - /// Specify true to apply the configuration settings and restarts the app only - /// if necessary. By default, the API always restarts and reprovisions the app. + /// + /// A JSON representation of the app properties. See example. /// - /// - /// Specify true to block until the app is restarted. By default, it is set to - /// false, and the API responds immediately (asynchronous). + /// + /// Name of the deployment slot to create or update. By default, this API + /// attempts to create or modify the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateSlotWithHttpMessagesAsync(resourceGroupName, name, siteEnvelope, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a web, mobile, or API app, or one of the deployment slots. + /// + /// + /// Description for Deletes a web, mobile, or API app, or one of the deployment + /// slots. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app to delete. + /// + /// + /// Name of the deployment slot to delete. By default, the API deletes the + /// production slot. + /// + /// + /// If true, web app metrics are also deleted. + /// + /// + /// Specify true if the App Service plan will be empty after app deletion and + /// you want to delete the empty App Service plan. By default, the empty App + /// Service plan is not deleted. /// /// /// Headers that will be added to request. @@ -31845,7 +32204,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string name, bool? softRestart = default(bool?), bool? synchronous = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, bool? deleteMetrics = default(bool?), bool? deleteEmptyServerFarm = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31870,6 +32229,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -31887,25 +32250,27 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("softRestart", softRestart); - tracingParameters.Add("synchronous", synchronous); + tracingParameters.Add("slot", slot); + tracingParameters.Add("deleteMetrics", deleteMetrics); + tracingParameters.Add("deleteEmptyServerFarm", deleteEmptyServerFarm); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Restart", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (softRestart != null) + if (deleteMetrics != null) { - _queryParameters.Add(string.Format("softRestart={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softRestart, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("deleteMetrics={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteMetrics, Client.SerializationSettings).Trim('"')))); } - if (synchronous != null) + if (deleteEmptyServerFarm != null) { - _queryParameters.Add(string.Format("synchronous={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(synchronous, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("deleteEmptyServerFarm={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteEmptyServerFarm, Client.SerializationSettings).Trim('"')))); } if (Client.ApiVersion != null) { @@ -31918,7 +32283,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -31969,7 +32334,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -32014,102 +32379,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores an app from a backup blob in Azure Storage. - /// - /// - /// Description for Restores an app from a backup blob in Azure Storage. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Information on restore request . - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreFromBackupBlobWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreFromBackupBlobWithHttpMessagesAsync(resourceGroupName, name, request, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Restores a deleted web app to this web app. - /// - /// - /// Description for Restores a deleted web app to this web app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Deleted web app restore information. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreFromDeletedAppWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreFromDeletedAppWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Restores a web app from a snapshot. + /// Creates a new web, mobile, or API app in an existing resource group, or + /// updates an existing app. /// /// - /// Description for Restores a web app from a snapshot. + /// Description for Creates a new web, mobile, or API app in an existing + /// resource group, or updates an existing app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Snapshot restore settings. Snapshot information can be obtained by calling - /// GetDeletedSites or GetSiteSnapshots API. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// Unique name of the app to create or update. To create or update a + /// deployment slot, use the {slot} parameter. /// - public async Task RestoreSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreSnapshotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get list of siteextensions for a web site, or a deployment slot. - /// - /// - /// Description for Get list of siteextensions for a web site, or a deployment - /// slot. - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// A JSON representation of the app properties. See example. /// - /// - /// Site name. + /// + /// Name of the deployment slot to create or update. By default, this API + /// attempts to create or modify the production slot. /// /// /// Headers that will be added to request. @@ -32132,7 +32421,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteExtensionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, SitePatchResource siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -32157,6 +32446,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -32174,14 +32471,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteEnvelope", siteEnvelope); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -32195,7 +32495,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -32226,6 +32526,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -32246,7 +32552,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -32276,7 +32582,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -32289,7 +32595,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -32309,21 +32633,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get site extension information by its ID for a web site, or a deployment - /// slot. + /// Analyze a custom hostname. /// /// - /// Description for Get site extension information by its ID for a web site, or - /// a deployment slot. + /// Description for Analyze a custom hostname. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of web app. /// - /// - /// Site extension name. + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// Custom hostname. /// /// /// Headers that will be added to request. @@ -32346,7 +32672,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AnalyzeCustomHostnameSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -32371,9 +32697,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -32392,18 +32718,23 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("slot", slot); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSiteExtension", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AnalyzeCustomHostnameSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (hostName != null) + { + _queryParameters.Add(string.Format("hostName={0}", System.Uri.EscapeDataString(hostName))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -32466,7 +32797,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -32496,7 +32827,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -32509,7 +32840,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -32529,48 +32860,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Install site extension on a web site, or a deployment slot. + /// Applies the configuration settings from the target slot onto the current + /// slot. /// /// - /// Description for Install site extension on a web site, or a deployment slot. + /// Description for Applies the configuration settings from the target slot + /// onto the current slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Site extension name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> InstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginInstallSiteExtensionWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Remove a site extension from a web site, or a deployment slot. - /// - /// - /// Description for Remove a site extension from a web site, or a deployment - /// slot. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Name of the app. /// - /// - /// Site name. + /// + /// JSON object that contains the target slot name. See example. /// - /// - /// Site extension name. + /// + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. /// /// /// Headers that will be added to request. @@ -32590,7 +32898,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ApplySlotConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -32615,9 +32923,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) + if (slotSwapEntity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -32636,16 +32952,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSiteExtension", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ApplySlotConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -32659,7 +32976,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -32690,6 +33007,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -32710,7 +33033,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -32755,10 +33078,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets an app's deployment slots. + /// Creates a backup of an app. /// /// - /// Description for Gets an app's deployment slots. + /// Description for Creates a backup of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -32766,6 +33089,14 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Backup configuration. You can use the JSON response from the POST action as + /// input here. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// create a backup for the production slot. + /// /// /// Headers that will be added to request. /// @@ -32787,7 +33118,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSlotsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -32812,6 +33143,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -32829,14 +33172,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("request", request); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlots", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BackupSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -32850,7 +33196,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -32881,6 +33227,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -32931,7 +33283,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -32944,7 +33296,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -32964,10 +33316,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the details of a web, mobile, or API app. + /// Gets existing backups of an app. /// /// - /// Description for Gets the details of a web, mobile, or API app. + /// Description for Gets existing backups of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -32976,8 +33328,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. By default, this API returns the production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// backups of the production slot. /// /// /// Headers that will be added to request. @@ -33000,7 +33352,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBackupsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33048,11 +33400,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBackupsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -33120,7 +33472,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -33150,7 +33502,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -33163,7 +33515,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -33183,63 +33535,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new web, mobile, or API app in an existing resource group, or - /// updates an existing app. + /// Gets a backup of an app by its ID. /// /// - /// Description for Creates a new web, mobile, or API app in an existing - /// resource group, or updates an existing app. + /// Description for Gets a backup of an app by its ID. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Unique name of the app to create or update. To create or update a - /// deployment slot, use the {slot} parameter. - /// - /// - /// A JSON representation of the app properties. See example. - /// - /// - /// Name of the deployment slot to create or update. By default, this API - /// attempts to create or modify the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateSlotWithHttpMessagesAsync(resourceGroupName, name, siteEnvelope, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a web, mobile, or API app, or one of the deployment slots. - /// - /// - /// Description for Deletes a web, mobile, or API app, or one of the deployment - /// slots. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Name of the app. /// - /// - /// Name of the app to delete. + /// + /// ID of the backup. /// /// - /// Name of the deployment slot to delete. By default, the API deletes the - /// production slot. - /// - /// - /// If true, web app metrics are also deleted. - /// - /// - /// Specify false if you want to keep empty App Service plan. By default, empty - /// App Service plan is deleted. + /// Name of the deployment slot. If a slot is not specified, the API will get a + /// backup of the production slot. /// /// /// Headers that will be added to request. @@ -33250,6 +33562,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -33259,7 +33574,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, bool? deleteMetrics = default(bool?), bool? deleteEmptyServerFarm = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetBackupStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33284,6 +33599,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (backupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -33305,28 +33624,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("backupId", backupId); tracingParameters.Add("slot", slot); - tracingParameters.Add("deleteMetrics", deleteMetrics); - tracingParameters.Add("deleteEmptyServerFarm", deleteEmptyServerFarm); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetBackupStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (deleteMetrics != null) - { - _queryParameters.Add(string.Format("deleteMetrics={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteMetrics, Client.SerializationSettings).Trim('"')))); - } - if (deleteEmptyServerFarm != null) - { - _queryParameters.Add(string.Format("deleteEmptyServerFarm={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteEmptyServerFarm, Client.SerializationSettings).Trim('"')))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -33338,7 +33649,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -33389,7 +33700,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -33419,13 +33730,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -33434,26 +33763,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new web, mobile, or API app in an existing resource group, or - /// updates an existing app. + /// Deletes a backup of an app by its ID. /// /// - /// Description for Creates a new web, mobile, or API app in an existing - /// resource group, or updates an existing app. + /// Description for Deletes a backup of an app by its ID. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Unique name of the app to create or update. To create or update a - /// deployment slot, use the {slot} parameter. + /// Name of the app. /// - /// - /// A JSON representation of the app properties. See example. + /// + /// ID of the backup. /// /// - /// Name of the deployment slot to create or update. By default, this API - /// attempts to create or modify the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete a backup of the production slot. /// /// /// Headers that will be added to request. @@ -33464,9 +33790,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -33476,7 +33799,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, SitePatchResource siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteBackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33501,9 +33824,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteEnvelope == null) + if (backupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); } if (slot == null) { @@ -33526,16 +33849,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteEnvelope", siteEnvelope); + tracingParameters.Add("backupId", backupId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteBackupSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -33550,7 +33874,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -33581,12 +33905,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -33607,7 +33925,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -33637,49 +33955,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -33688,10 +33970,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Analyze a custom hostname. + /// Gets status of a web app backup that may be in progress, including secrets + /// associated with the backup, such as the Azure Storage SAS URL. Also can be + /// used to update the SAS URL for the backup if a new URL is passed in the + /// request body. /// /// - /// Description for Analyze a custom hostname. + /// Description for Gets status of a web app backup that may be in progress, + /// including secrets associated with the backup, such as the Azure Storage SAS + /// URL. Also can be used to update the SAS URL for the backup if a new URL is + /// passed in the request body. /// /// /// Name of the resource group to which the resource belongs. @@ -33699,13 +33987,16 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of web app. /// + /// + /// ID of backup. + /// + /// + /// Information on backup request. + /// /// /// Name of web app slot. If not specified then will default to production /// slot. /// - /// - /// Custom hostname. - /// /// /// Headers that will be added to request. /// @@ -33727,7 +34018,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AnalyzeCustomHostnameSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListBackupStatusSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33752,6 +34043,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (backupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -33773,23 +34076,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("backupId", backupId); + tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); - tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AnalyzeCustomHostnameSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBackupStatusSecretsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (hostName != null) - { - _queryParameters.Add(string.Format("hostName={0}", System.Uri.EscapeDataString(hostName))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -33801,7 +34102,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -33832,6 +34133,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -33882,7 +34189,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -33895,7 +34202,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -33915,12 +34222,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Applies the configuration settings from the target slot onto the current - /// slot. + /// Restores a specific backup to another app (or deployment slot, if + /// specified). /// /// - /// Description for Applies the configuration settings from the target slot - /// onto the current slot. + /// Description for Restores a specific backup to another app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -33928,12 +34235,44 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON object that contains the target slot name. See example. + /// + /// ID of the backup. + /// + /// + /// Information on restore request . /// /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// restore a backup of the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreSlotWithHttpMessagesAsync(resourceGroupName, name, backupId, request, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// List the configurations of an app + /// + /// + /// Description for List the configurations of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -33944,6 +34283,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -33953,7 +34295,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ApplySlotConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33978,14 +34320,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); - } - if (slotSwapEntity != null) - { - slotSwapEntity.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -34007,14 +34341,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ApplySlotConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -34031,7 +34364,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -34062,12 +34395,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -34118,13 +34445,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -34133,10 +34478,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a backup of an app. + /// Replaces the application settings of an app. /// /// - /// Description for Creates a backup of an app. + /// Description for Replaces the application settings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -34144,13 +34489,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Backup configuration. You can use the JSON response from the POST action as - /// input here. + /// + /// Application settings of the app. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// create a backup for the production slot. + /// update the application settings for the production slot. /// /// /// Headers that will be added to request. @@ -34173,7 +34517,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateApplicationSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34198,13 +34542,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) + if (appSettings == null) { - request.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); } if (slot == null) { @@ -34227,14 +34567,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BackupSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateApplicationSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -34251,7 +34591,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -34282,9 +34622,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) + if(appSettings != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -34338,7 +34678,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -34351,7 +34691,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -34371,10 +34711,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Gets the application settings of an app. /// /// - /// Description for Gets existing backups of an app. + /// Description for Gets the application settings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -34384,7 +34724,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// /// Name of the deployment slot. If a slot is not specified, the API will get - /// backups of the production slot. + /// the application settings for the production slot. /// /// /// Headers that will be added to request. @@ -34407,7 +34747,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBackupsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListApplicationSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34455,11 +34795,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBackupsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListApplicationSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -34476,7 +34816,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -34557,7 +34897,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -34570,7 +34910,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -34590,23 +34930,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a backup of an app by its ID. + /// Updates the Authentication / Authorization settings associated with web + /// app. /// /// - /// Description for Gets a backup of an app by its ID. + /// Description for Updates the Authentication / Authorization settings + /// associated with web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// ID of the backup. + /// + /// Auth settings associated with web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get a - /// backup of the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -34629,7 +34971,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetBackupStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34654,9 +34996,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) + if (siteAuthSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteAuthSettings"); } if (slot == null) { @@ -34679,17 +35021,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); + tracingParameters.Add("siteAuthSettings", siteAuthSettings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetBackupStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAuthSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -34704,7 +35045,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -34735,6 +35076,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteAuthSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteAuthSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -34785,7 +35132,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -34798,7 +35145,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -34818,10 +35165,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a backup of an app by its ID. + /// Gets the Authentication/Authorization settings of an app. /// /// - /// Description for Deletes a backup of an app by its ID. + /// Description for Gets the Authentication/Authorization settings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -34829,12 +35176,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// ID of the backup. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete a backup of the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the settings for the production slot. /// /// /// Headers that will be added to request. @@ -34845,6 +35189,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -34854,7 +35201,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteBackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34879,10 +35226,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -34904,17 +35247,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteBackupSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAuthSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -34929,7 +35270,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -34980,7 +35321,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -35010,13 +35351,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -35025,16 +35384,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets status of a web app backup that may be in progress, including secrets - /// associated with the backup, such as the Azure Storage SAS URL. Also can be - /// used to update the SAS URL for the backup if a new URL is passed in the - /// request body. + /// Updates site's Authentication / Authorization settings for apps via the V2 + /// format /// /// - /// Description for Gets status of a web app backup that may be in progress, - /// including secrets associated with the backup, such as the Azure Storage SAS - /// URL. Also can be used to update the SAS URL for the backup if a new URL is - /// passed in the request body. + /// Description for Updates site's Authentication / Authorization settings for + /// apps via the V2 format /// /// /// Name of the resource group to which the resource belongs. @@ -35042,11 +35397,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of web app. /// - /// - /// ID of backup. - /// - /// - /// Information on backup request. + /// + /// Auth settings associated with web app. /// /// /// Name of web app slot. If not specified then will default to production @@ -35073,7 +35425,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListBackupStatusSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -35098,17 +35450,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); - } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) + if (siteAuthSettingsV2 == null) { - request.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "siteAuthSettingsV2"); } if (slot == null) { @@ -35131,18 +35475,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); - tracingParameters.Add("request", request); + tracingParameters.Add("siteAuthSettingsV2", siteAuthSettingsV2); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBackupStatusSecretsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAuthSettingsV2Slot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -35157,7 +35499,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -35188,9 +35530,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) + if(siteAuthSettingsV2 != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteAuthSettingsV2, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -35244,7 +35586,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -35257,7 +35599,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -35277,49 +35619,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a specific backup to another app (or deployment slot, if - /// specified). - /// - /// - /// Description for Restores a specific backup to another app (or deployment - /// slot, if specified). - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// ID of the backup. - /// - /// - /// Information on restore request . - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restore a backup of the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreSlotWithHttpMessagesAsync(resourceGroupName, name, backupId, request, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns whether Scm basic auth is allowed and whether Ftp is allowed for a - /// given site. + /// Gets site's Authentication / Authorization settings for apps via the V2 + /// format /// /// - /// Description for Returns whether Scm basic auth is allowed and whether Ftp - /// is allowed for a given site. + /// Description for Gets site's Authentication / Authorization settings for + /// apps via the V2 format /// /// /// Name of the resource group to which the resource belongs. @@ -35328,6 +35633,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the settings for the production slot. /// /// /// Headers that will be added to request. @@ -35350,7 +35657,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetBasicPublishingCredentialsPoliciesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -35398,11 +35705,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetBasicPublishingCredentialsPoliciesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAuthSettingsV2Slot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -35500,7 +35807,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -35513,7 +35820,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -35533,10 +35840,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Returns whether FTP is allowed on the site or not. + /// Updates the Azure storage account configurations of an app. /// /// - /// Description for Returns whether FTP is allowed on the site or not. + /// Description for Updates the Azure storage account configurations of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -35544,7 +35851,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Azure storage accounts of the app. + /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. /// /// /// Headers that will be added to request. @@ -35567,7 +35879,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetFtpAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -35592,6 +35904,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (azureStorageAccounts == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "azureStorageAccounts"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -35613,13 +35929,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("azureStorageAccounts", azureStorageAccounts); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetFtpAllowedSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAzureStorageAccountsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -35636,7 +35953,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -35667,6 +35984,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(azureStorageAccounts != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(azureStorageAccounts, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -35717,7 +36040,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -35730,7 +36053,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -35750,10 +36073,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates whether FTP is allowed on the site or not. + /// Gets the Azure storage account configurations of an app. /// /// - /// Description for Updates whether FTP is allowed on the site or not. + /// Description for Gets the Azure storage account configurations of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -35761,9 +36084,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. /// /// /// Headers that will be added to request. @@ -35786,7 +36109,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateFtpAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -35811,14 +36134,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (csmPublishingAccessPoliciesEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "csmPublishingAccessPoliciesEntity"); - } - if (csmPublishingAccessPoliciesEntity != null) - { - csmPublishingAccessPoliciesEntity.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -35840,14 +36155,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("csmPublishingAccessPoliciesEntity", csmPublishingAccessPoliciesEntity); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateFtpAllowedSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAzureStorageAccountsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -35864,7 +36178,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -35895,12 +36209,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(csmPublishingAccessPoliciesEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(csmPublishingAccessPoliciesEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -35951,7 +36259,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -35964,7 +36272,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -35984,11 +36292,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Returns whether Scm basic auth is allowed on the site or not. + /// Updates the backup configuration of an app. /// /// - /// Description for Returns whether Scm basic auth is allowed on the site or - /// not. + /// Description for Updates the backup configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -35996,7 +36303,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Edited backup configuration. + /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -36019,7 +36331,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetScmAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36044,6 +36356,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -36065,13 +36385,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetScmAllowedSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateBackupConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -36088,7 +36409,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -36119,6 +36440,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -36169,7 +36496,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -36182,7 +36509,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -36202,11 +36529,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates whether user publishing credentials are allowed on the site or not. + /// Deletes the backup configuration of an app. /// /// - /// Description for Updates whether user publishing credentials are allowed on - /// the site or not. + /// Description for Deletes the backup configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -36214,9 +36540,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -36227,9 +36553,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -36239,7 +36562,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateScmAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36264,14 +36587,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (csmPublishingAccessPoliciesEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "csmPublishingAccessPoliciesEntity"); - } - if (csmPublishingAccessPoliciesEntity != null) - { - csmPublishingAccessPoliciesEntity.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -36293,14 +36608,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("csmPublishingAccessPoliciesEntity", csmPublishingAccessPoliciesEntity); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateScmAllowedSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteBackupConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -36317,7 +36631,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -36348,12 +36662,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(csmPublishingAccessPoliciesEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(csmPublishingAccessPoliciesEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -36404,31 +36712,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -36437,10 +36727,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the configurations of an app + /// Gets the backup configuration of an app. /// /// - /// Description for List the configurations of an app + /// Description for Gets the backup configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -36449,8 +36739,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -36473,7 +36763,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36521,11 +36811,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetBackupConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -36542,7 +36832,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -36623,7 +36913,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -36636,7 +36926,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -36656,10 +36946,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the application settings of an app. + /// Replaces the connection strings of an app. /// /// - /// Description for Replaces the application settings of an app. + /// Description for Replaces the connection strings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -36667,12 +36957,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Application settings of the app. + /// + /// Connection strings of the app or deployment slot. See example. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// update the application settings for the production slot. + /// update the connection settings for the production slot. /// /// /// Headers that will be added to request. @@ -36695,7 +36985,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateApplicationSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateConnectionStringsSlotWithHttpMessagesAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36720,9 +37010,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (appSettings == null) + if (connectionStrings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionStrings"); } if (slot == null) { @@ -36745,14 +37035,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("appSettings", appSettings); + tracingParameters.Add("connectionStrings", connectionStrings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateApplicationSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateConnectionStringsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -36800,9 +37090,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(appSettings != null) + if(connectionStrings != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionStrings, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -36856,7 +37146,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -36869,7 +37159,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -36889,10 +37179,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the application settings of an app. + /// Gets the connection strings of an app. /// /// - /// Description for Gets the application settings of an app. + /// Description for Gets the connection strings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -36902,7 +37192,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// /// Name of the deployment slot. If a slot is not specified, the API will get - /// the application settings for the production slot. + /// the connection settings for the production slot. /// /// /// Headers that will be added to request. @@ -36925,7 +37215,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListApplicationSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListConnectionStringsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36973,11 +37263,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListApplicationSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStringsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37075,7 +37365,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37088,7 +37378,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -37108,25 +37398,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the Authentication / Authorization settings associated with web - /// app. + /// Gets the logging configuration of an app. /// /// - /// Description for Updates the Authentication / Authorization settings - /// associated with web app. + /// Description for Gets the logging configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Auth settings associated with web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the logging configuration for the production slot. /// /// /// Headers that will be added to request. @@ -37149,7 +37434,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDiagnosticLogsConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37174,10 +37459,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteAuthSettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteAuthSettings"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -37199,14 +37480,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteAuthSettings", siteAuthSettings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAuthSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticLogsConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37223,7 +37503,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -37254,12 +37534,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteAuthSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteAuthSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -37310,7 +37584,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37323,7 +37597,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -37343,10 +37617,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Authentication/Authorization settings of an app. + /// Updates the logging configuration of an app. /// /// - /// Description for Gets the Authentication/Authorization settings of an app. + /// Description for Updates the logging configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -37354,9 +37628,13 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// A SiteLogsConfig JSON object that contains the logging configuration to + /// change in the "properties" property. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the logging configuration for the production slot. /// /// /// Headers that will be added to request. @@ -37379,7 +37657,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDiagnosticLogsConfigSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37404,6 +37682,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteLogsConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteLogsConfig"); + } + if (siteLogsConfig != null) + { + siteLogsConfig.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -37425,13 +37711,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteLogsConfig", siteLogsConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAuthSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateDiagnosticLogsConfigSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37448,7 +37735,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -37479,6 +37766,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteLogsConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteLogsConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -37529,7 +37822,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37542,7 +37835,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -37562,25 +37855,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates site's Authentication / Authorization settings for apps via the V2 - /// format + /// Replaces the metadata of an app. /// /// - /// Description for Updates site's Authentication / Authorization settings for - /// apps via the V2 format + /// Description for Replaces the metadata of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Auth settings associated with web app. + /// + /// Edited metadata of the app or deployment slot. See example. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the metadata for the production slot. /// /// /// Headers that will be added to request. @@ -37603,7 +37894,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateMetadataSlotWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary metadata, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37628,9 +37919,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteAuthSettingsV2 == null) + if (metadata == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteAuthSettingsV2"); + throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); } if (slot == null) { @@ -37653,14 +37944,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteAuthSettingsV2", siteAuthSettingsV2); + tracingParameters.Add("metadata", metadata); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAuthSettingsV2Slot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateMetadataSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37708,9 +37999,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteAuthSettingsV2 != null) + if(metadata != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteAuthSettingsV2, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -37764,7 +38055,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37777,7 +38068,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -37797,12 +38088,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets site's Authentication / Authorization settings for apps via the V2 - /// format + /// Gets the metadata of an app. /// /// - /// Description for Gets site's Authentication / Authorization settings for - /// apps via the V2 format + /// Description for Gets the metadata of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -37812,7 +38101,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. + /// the metadata for the production slot. /// /// /// Headers that will be added to request. @@ -37835,7 +38124,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListMetadataSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37883,11 +38172,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAuthSettingsV2Slot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMetadataSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37904,7 +38193,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -37985,7 +38274,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37998,7 +38287,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -38018,10 +38307,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the Azure storage account configurations of an app. + /// Gets the Git/FTP publishing credentials of an app. /// /// - /// Description for Updates the Azure storage account configurations of an app. + /// Description for Gets the Git/FTP publishing credentials of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -38029,12 +38318,41 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Azure storage accounts of the app. + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the publishing credentials for the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListPublishingCredentialsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListPublishingCredentialsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the Push settings associated with web app. + /// + /// + /// Description for Updates the Push settings associated with web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Push settings associated with web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -38057,7 +38375,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSitePushSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, PushSettings pushSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38082,9 +38400,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (azureStorageAccounts == null) + if (pushSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "azureStorageAccounts"); + throw new ValidationException(ValidationRules.CannotBeNull, "pushSettings"); + } + if (pushSettings != null) + { + pushSettings.Validate(); } if (slot == null) { @@ -38107,14 +38429,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("azureStorageAccounts", azureStorageAccounts); + tracingParameters.Add("pushSettings", pushSettings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAzureStorageAccountsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSitePushSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -38162,9 +38484,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(azureStorageAccounts != null) + if(pushSettings != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(azureStorageAccounts, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pushSettings, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -38218,7 +38540,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38231,7 +38553,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -38251,20 +38573,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Azure storage account configurations of an app. + /// Gets the Push settings associated with web app. /// /// - /// Description for Gets the Azure storage account configurations of an app. + /// Description for Gets the Push settings associated with web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -38287,7 +38609,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSitePushSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38335,11 +38657,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAzureStorageAccountsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSitePushSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -38437,7 +38759,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38450,7 +38772,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -38470,10 +38792,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the backup configuration of an app. + /// Gets the configuration of an app, such as platform version and bitness, + /// default documents, virtual applications, Always On, etc. /// /// - /// Description for Updates the backup configuration of an app. + /// Description for Gets the configuration of an app, such as platform version + /// and bitness, default documents, virtual applications, Always On, etc. /// /// /// Name of the resource group to which the resource belongs. @@ -38481,12 +38805,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Edited backup configuration. - /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// update the backup configuration for the production slot. + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -38509,7 +38830,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38534,14 +38855,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -38563,14 +38876,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateBackupConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -38587,7 +38899,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -38618,12 +38930,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -38674,7 +38980,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38687,7 +38993,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -38707,10 +39013,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes the backup configuration of an app. + /// Updates the configuration of an app. /// /// - /// Description for Deletes the backup configuration of an app. + /// Description for Updates the configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -38718,9 +39024,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// JSON representation of a SiteConfig object. See example. + /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the backup configuration for the production slot. + /// update configuration for the production slot. /// /// /// Headers that will be added to request. @@ -38731,6 +39040,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -38740,7 +39052,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38765,6 +39077,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); + } + if (siteConfig != null) + { + siteConfig.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -38786,13 +39106,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteBackupConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -38809,7 +39130,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -38840,6 +39161,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -38890,13 +39217,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -38905,10 +39250,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the backup configuration of an app. + /// Updates the configuration of an app. /// /// - /// Description for Gets the backup configuration of an app. + /// Description for Updates the configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -38916,9 +39261,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// JSON representation of a SiteConfig object. See example. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the backup configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update configuration for the production slot. /// /// /// Headers that will be added to request. @@ -38941,7 +39289,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38966,6 +39314,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -38987,13 +39339,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetBackupConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -39010,7 +39363,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -39041,6 +39394,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -39091,7 +39450,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -39104,7 +39463,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -39124,10 +39483,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the config reference app settings and status of an app + /// Gets a list of web app configuration snapshots identifiers. Each element of + /// the list contains a timestamp and the ID of the snapshot. /// /// - /// Description for Gets the config reference app settings and status of an app + /// Description for Gets a list of web app configuration snapshots identifiers. + /// Each element of the list contains a timestamp and the ID of the snapshot. /// /// /// Name of the resource group to which the resource belongs. @@ -39136,6 +39497,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -39158,7 +39521,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAppSettingsKeyVaultReferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationSnapshotInfoSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39206,11 +39569,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingsKeyVaultReferencesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -39308,7 +39671,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -39321,7 +39684,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -39341,10 +39704,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the config reference and status of an app + /// Gets a snapshot of the configuration of an app at a previous point in time. /// /// - /// Description for Gets the config reference and status of an app + /// Description for Gets a snapshot of the configuration of an app at a + /// previous point in time. /// /// /// Name of the resource group to which the resource belongs. @@ -39352,10 +39716,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// App Setting key name. + /// + /// The ID of the snapshot to read. /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -39378,7 +39744,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAppSettingKeyVaultReferenceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string appSettingKey, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetConfigurationSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39403,9 +39769,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (appSettingKey == null) + if (snapshotId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettingKey"); + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); } if (slot == null) { @@ -39428,17 +39794,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("appSettingKey", appSettingKey); + tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingKeyVaultReferenceSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSnapshotSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings/{appSettingKey}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{appSettingKey}", System.Uri.EscapeDataString(appSettingKey)); + _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -39534,7 +39900,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -39547,7 +39913,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -39567,10 +39933,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the config reference app settings and status of an app + /// Reverts the configuration of an app to a previous snapshot. /// /// - /// Description for Gets the config reference app settings and status of an app + /// Description for Reverts the configuration of an app to a previous snapshot. /// /// /// Name of the resource group to which the resource belongs. @@ -39578,7 +39944,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// The ID of the snapshot to read. + /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -39589,9 +39960,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -39601,7 +39969,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetSiteConnectionStringKeyVaultReferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RecoverSiteConfigurationSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39626,6 +39994,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (snapshotId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -39647,15 +40019,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReferencesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RecoverSiteConfigurationSnapshotSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -39670,7 +40044,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -39721,7 +40095,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -39751,31 +40125,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -39784,20 +40140,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the config reference and status of an app + /// Gets the last lines of docker logs for the given site /// /// - /// Description for Gets the config reference and status of an app + /// Description for Gets the last lines of docker logs for the given site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// + /// Name of web app. /// /// + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -39805,7 +40161,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -39820,7 +40176,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSiteConnectionStringKeyVaultReferenceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string connectionStringKey, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWebSiteContainerLogsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39845,10 +40201,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionStringKey == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionStringKey"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -39870,17 +40222,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionStringKey", connectionStringKey); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReferenceSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebSiteContainerLogsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings/{connectionStringKey}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{connectionStringKey}", System.Uri.EscapeDataString(connectionStringKey)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -39895,7 +40245,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -39938,7 +40288,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -39946,15 +40296,16 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -39964,6 +40315,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -39976,7 +40331,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -39986,20 +40341,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -40009,23 +40351,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the connection strings of an app. + /// Gets the ZIP archived docker log files for the given site /// /// - /// Description for Replaces the connection strings of an app. + /// Description for Gets the ZIP archived docker log files for the given site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Connection strings of the app or deployment slot. See example. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the connection settings for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -40033,7 +40372,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -40048,7 +40387,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateConnectionStringsSlotWithHttpMessagesAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContainerLogsZipSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40073,10 +40412,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionStrings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionStrings"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -40098,14 +40433,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionStrings", connectionStrings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateConnectionStringsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetContainerLogsZipSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -40122,7 +40456,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -40153,12 +40487,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionStrings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionStrings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -40171,7 +40499,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -40179,15 +40507,16 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -40197,6 +40526,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -40209,7 +40542,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -40219,20 +40552,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -40242,20 +40562,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the connection strings of an app. + /// List continuous web jobs for an app, or a deployment slot. /// /// - /// Description for Gets the connection strings of an app. + /// Description for List continuous web jobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the connection settings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -40278,7 +40598,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListConnectionStringsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListContinuousWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40326,11 +40646,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStringsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -40347,7 +40667,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -40428,7 +40748,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -40441,7 +40761,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -40461,20 +40781,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the logging configuration of an app. + /// Gets a continuous web job by its ID for an app, or a deployment slot. /// /// - /// Description for Gets the logging configuration of an app. + /// Description for Gets a continuous web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// Name of Web Job. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the logging configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -40497,7 +40821,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDiagnosticLogsConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40522,6 +40846,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -40543,15 +40871,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticLogsConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetContinuousWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -40617,7 +40947,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -40647,7 +40977,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -40660,7 +40990,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -40680,24 +41010,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the logging configuration of an app. + /// Delete a continuous web job by its ID for an app, or a deployment slot. /// /// - /// Description for Updates the logging configuration of an app. + /// Description for Delete a continuous web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// A SiteLogsConfig JSON object that contains the logging configuration to - /// change in the "properties" property. + /// + /// Name of Web Job. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the logging configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -40708,9 +41038,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -40720,7 +41047,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateDiagnosticLogsConfigSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40745,13 +41072,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteLogsConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteLogsConfig"); - } - if (siteLogsConfig != null) + if (webJobName == null) { - siteLogsConfig.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (slot == null) { @@ -40774,16 +41097,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteLogsConfig", siteLogsConfig); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateDiagnosticLogsConfigSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteContinuousWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -40798,7 +41122,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -40829,12 +41153,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteLogsConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteLogsConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -40855,7 +41173,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -40885,31 +41203,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -40918,23 +41218,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the metadata of an app. + /// Start a continuous web job for an app, or a deployment slot. /// /// - /// Description for Replaces the metadata of an app. + /// Description for Start a continuous web job for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Edited metadata of the app or deployment slot. See example. + /// + /// Name of Web Job. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the metadata for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -40945,9 +41246,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -40957,7 +41255,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateMetadataSlotWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary metadata, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StartContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40982,9 +41280,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (metadata == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (slot == null) { @@ -41007,16 +41305,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("metadata", metadata); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateMetadataSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartContinuousWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -41031,7 +41330,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -41062,12 +41361,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(metadata != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -41088,7 +41381,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -41118,31 +41411,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -41151,20 +41426,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the metadata of an app. + /// Stop a continuous web job for an app, or a deployment slot. /// /// - /// Description for Gets the metadata of an app. + /// Description for Stop a continuous web job for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// Name of Web Job. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the metadata for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -41175,9 +41453,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -41187,7 +41462,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListMetadataSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41212,6 +41487,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -41233,15 +41512,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMetadataSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopContinuousWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -41307,7 +41588,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -41337,31 +41618,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -41370,10 +41633,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Git/FTP publishing credentials of an app. + /// List deployments for an app, or a deployment slot. /// /// - /// Description for Gets the Git/FTP publishing credentials of an app. + /// Description for List deployments for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -41382,40 +41645,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the publishing credentials for the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ListPublishingCredentialsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginListPublishingCredentialsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates the Push settings associated with web app. - /// - /// - /// Description for Updates the Push settings associated with web app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Push settings associated with web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -41438,7 +41669,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSitePushSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, PushSettings pushSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDeploymentsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41463,14 +41694,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (pushSettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "pushSettings"); - } - if (pushSettings != null) - { - pushSettings.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -41492,14 +41715,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("pushSettings", pushSettings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSitePushSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -41516,7 +41738,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -41547,12 +41769,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(pushSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pushSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -41603,7 +41819,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -41616,7 +41832,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -41636,20 +41852,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Push settings associated with web app. + /// Get a deployment by its ID for an app, or a deployment slot. /// /// - /// Description for Gets the Push settings associated with web app. + /// Description for Get a deployment by its ID for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Deployment ID. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API gets a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -41672,7 +41892,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSitePushSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41697,6 +41917,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -41718,15 +41942,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSitePushSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDeploymentSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -41741,7 +41967,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -41822,7 +42048,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -41835,7 +42061,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -41855,12 +42081,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the configuration of an app, such as platform version and bitness, - /// default documents, virtual applications, Always On, etc. + /// Create a deployment for an app, or a deployment slot. /// /// - /// Description for Gets the configuration of an app, such as platform version - /// and bitness, default documents, virtual applications, Always On, etc. + /// Description for Create a deployment for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -41868,9 +42092,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// ID of an existing deployment. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API creates a + /// deployment for the production slot. + /// + /// + /// Deployment details. /// /// /// Headers that will be added to request. @@ -41893,7 +42123,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Deployment deployment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41918,10 +42148,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (deployment == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deployment"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -41939,15 +42177,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); + tracingParameters.Add("deployment", deployment); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateDeploymentSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -41962,7 +42203,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -41993,6 +42234,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(deployment != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deployment, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -42043,7 +42290,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -42056,7 +42303,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -42076,10 +42323,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the configuration of an app. + /// Delete a deployment by its ID for an app, or a deployment slot. /// /// - /// Description for Updates the configuration of an app. + /// Description for Delete a deployment by its ID for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. @@ -42087,12 +42335,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteConfig object. See example. + /// + /// Deployment ID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -42103,9 +42351,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -42115,7 +42360,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -42140,13 +42385,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); - } - if (siteConfig != null) + if (id == null) { - siteConfig.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (slot == null) { @@ -42169,16 +42410,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteConfig", siteConfig); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteDeploymentSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -42193,7 +42435,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -42224,12 +42466,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -42250,7 +42486,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -42280,31 +42516,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -42313,10 +42531,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the configuration of an app. + /// List deployment log for specific deployment for an app, or a deployment + /// slot. /// /// - /// Description for Updates the configuration of an app. + /// Description for List deployment log for specific deployment for an app, or + /// a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -42324,12 +42544,13 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteConfig object. See example. + /// + /// The ID of a specific deployment. This is the value of the name property in + /// the JSON response from "GET /api/sites/{siteName}/deployments". /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -42352,7 +42573,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListDeploymentLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -42377,9 +42598,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteConfig == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (slot == null) { @@ -42402,16 +42623,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteConfig", siteConfig); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentLogSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -42426,7 +42648,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -42457,12 +42679,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -42513,7 +42729,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -42526,7 +42742,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -42546,12 +42762,14 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a list of web app configuration snapshots identifiers. Each element of - /// the list contains a timestamp and the ID of the snapshot. + /// Discovers an existing app backup that can be restored from a blob in Azure + /// storage. Use this to get information about the databases stored in a + /// backup. /// /// - /// Description for Gets a list of web app configuration snapshots identifiers. - /// Each element of the list contains a timestamp and the ID of the snapshot. + /// Description for Discovers an existing app backup that can be restored from + /// a blob in Azure storage. Use this to get information about the databases + /// stored in a backup. /// /// /// Name of the resource group to which the resource belongs. @@ -42559,9 +42777,13 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// A RestoreRequest object that includes Azure storage URL and blog name for + /// discovery of backup. + /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// perform discovery for the production slot. /// /// /// Headers that will be added to request. @@ -42584,7 +42806,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationSnapshotInfoSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DiscoverBackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -42609,6 +42831,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -42630,13 +42860,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DiscoverBackupSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -42653,7 +42884,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -42684,6 +42915,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -42734,7 +42971,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -42747,7 +42984,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -42767,11 +43004,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a snapshot of the configuration of an app at a previous point in time. + /// Lists ownership identifiers for domain associated with web app. /// /// - /// Description for Gets a snapshot of the configuration of an app at a - /// previous point in time. + /// Description for Lists ownership identifiers for domain associated with web + /// app. /// /// /// Name of the resource group to which the resource belongs. @@ -42779,12 +43016,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of the snapshot to read. - /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -42807,7 +43041,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetConfigurationSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDomainOwnershipIdentifiersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -42832,10 +43066,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (snapshotId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -42857,17 +43087,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSnapshotSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -42963,7 +43191,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -42976,7 +43204,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -42996,10 +43224,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Reverts the configuration of an app to a previous snapshot. + /// Get domain ownership identifier for web app. /// /// - /// Description for Reverts the configuration of an app to a previous snapshot. + /// Description for Get domain ownership identifier for web app. /// /// /// Name of the resource group to which the resource belongs. @@ -43007,12 +43235,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of the snapshot to read. + /// + /// Name of domain ownership identifier. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -43023,6 +43251,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -43032,7 +43263,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RecoverSiteConfigurationSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43057,9 +43288,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (snapshotId == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); } if (slot == null) { @@ -43082,17 +43313,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("snapshotId", snapshotId); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RecoverSiteConfigurationSnapshotSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifierSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -43107,7 +43338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -43158,7 +43389,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -43188,13 +43419,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -43203,20 +43452,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the last lines of docker logs for the given site + /// Creates a domain ownership identifier for web app, or updates an existing + /// ownership identifier. /// /// - /// Description for Gets the last lines of docker logs for the given site + /// Description for Creates a domain ownership identifier for web app, or + /// updates an existing ownership identifier. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Name of domain ownership identifier. + /// + /// + /// A JSON representation of the domain ownership properties. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -43224,7 +43481,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -43239,7 +43496,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWebSiteContainerLogsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43264,6 +43521,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainOwnershipIdentifierName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } + if (domainOwnershipIdentifier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -43285,15 +43550,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebSiteContainerLogsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateDomainOwnershipIdentifierSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -43308,7 +43576,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -43339,6 +43607,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(domainOwnershipIdentifier != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -43351,7 +43625,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -43359,16 +43633,15 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -43378,10 +43651,6 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -43394,7 +43663,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -43404,7 +43673,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -43414,20 +43696,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the ZIP archived docker log files for the given site + /// Deletes a domain ownership identifier for a web app. /// /// - /// Description for Gets the ZIP archived docker log files for the given site + /// Description for Deletes a domain ownership identifier for a web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Name of domain ownership identifier. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -43435,12 +43720,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -43450,7 +43732,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContainerLogsZipSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43475,6 +43757,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainOwnershipIdentifierName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -43496,15 +43782,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetContainerLogsZipSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteDomainOwnershipIdentifierSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -43519,7 +43807,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -43562,7 +43850,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -43572,14 +43860,13 @@ internal WebAppsOperations(WebSiteManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -43589,10 +43876,6 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -43605,18 +43888,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) - { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -43625,20 +43903,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List continuous web jobs for an app, or a deployment slot. + /// Creates a domain ownership identifier for web app, or updates an existing + /// ownership identifier. /// /// - /// Description for List continuous web jobs for an app, or a deployment slot. + /// Description for Creates a domain ownership identifier for web app, or + /// updates an existing ownership identifier. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// + /// Name of domain ownership identifier. + /// + /// + /// A JSON representation of the domain ownership properties. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -43661,7 +43947,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListContinuousWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43686,6 +43972,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainOwnershipIdentifierName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } + if (domainOwnershipIdentifier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -43707,15 +44001,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateDomainOwnershipIdentifierSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -43730,7 +44027,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -43761,6 +44058,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(domainOwnershipIdentifier != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -43811,7 +44114,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -43824,7 +44127,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -43844,24 +44147,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a continuous web job by its ID for an app, or a deployment slot. + /// Get the status of the last MSDeploy operation. /// /// - /// Description for Gets a continuous web job by its ID for an app, or a - /// deployment slot. + /// Description for Get the status of the last MSDeploy operation. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -43884,7 +44183,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMSDeployStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43909,10 +44208,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -43934,17 +44229,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetContinuousWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44010,7 +44303,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -44040,7 +44333,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -44053,7 +44346,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -44073,24 +44366,52 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a continuous web job by its ID for an app, or a deployment slot. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Delete a continuous web job by its ID for an app, or a - /// deployment slot. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of web app. /// - /// - /// Name of Web Job. + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// Details of MSDeploy operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateMSDeployOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -44101,6 +44422,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -44110,7 +44434,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMSDeployLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44135,10 +44459,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -44160,17 +44480,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteContinuousWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployLogSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44185,7 +44503,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -44236,7 +44554,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -44266,13 +44584,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -44281,11 +44617,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start a continuous web job for an app, or a deployment slot. + /// List the functions for a web site, or a deployment slot. /// /// - /// Description for Start a continuous web job for an app, or a deployment - /// slot. + /// Description for List the functions for a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -44293,12 +44628,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Name of Web Job. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -44309,6 +44640,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -44318,7 +44652,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceFunctionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44343,10 +44677,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -44368,17 +44698,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartContinuousWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceFunctionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44393,7 +44721,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -44474,13 +44802,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -44489,23 +44835,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Stop a continuous web job for an app, or a deployment slot. + /// Fetch a short lived token that can be exchanged for a master key. /// /// - /// Description for Stop a continuous web job for an app, or a deployment slot. + /// Description for Fetch a short lived token that can be exchanged for a + /// master key. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -44516,6 +44860,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -44525,7 +44872,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetFunctionsAdminTokenSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44550,10 +44897,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -44575,17 +44918,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopContinuousWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunctionsAdminTokenSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44600,7 +44941,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -44651,7 +44992,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -44681,13 +45022,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -44696,20 +45055,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployments for an app, or a deployment slot. + /// Get function information by its ID for web site, or a deployment slot. /// /// - /// Description for List deployments for an app, or a deployment slot. + /// Description for Get function information by its ID for web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// Function name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -44732,7 +45094,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDeploymentsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44757,6 +45119,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -44778,15 +45144,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceFunctionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44852,7 +45220,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -44882,7 +45250,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -44895,7 +45263,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -44915,24 +45283,56 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a deployment by its ID for an app, or a deployment slot. + /// Create function for web site, or a deployment slot. /// /// - /// Description for Get a deployment by its ID for an app, or a deployment - /// slot. + /// Description for Create function for web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Deployment ID. + /// + /// Function name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets a - /// deployment for the production slot. + /// Name of the deployment slot. + /// + /// + /// Function details. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateInstanceFunctionSlotWithHttpMessagesAsync(resourceGroupName, name, functionName, slot, functionEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a function for web site, or a deployment slot. + /// + /// + /// Description for Delete a function for web site, or a deployment slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Function name. + /// + /// + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -44943,9 +45343,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -44955,7 +45352,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44980,9 +45377,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (slot == null) { @@ -45005,17 +45402,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDeploymentSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceFunctionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45030,7 +45427,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -45081,7 +45478,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -45111,31 +45508,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -45144,26 +45523,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create a deployment for an app, or a deployment slot. + /// Add or update a function secret. /// /// - /// Description for Create a deployment for an app, or a deployment slot. + /// Description for Add or update a function secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// ID of an existing deployment. + /// + /// The name of the function. + /// + /// + /// The name of the key. /// /// - /// Name of the deployment slot. If a slot is not specified, the API creates a - /// deployment for the production slot. + /// Name of the deployment slot. /// - /// - /// Deployment details. + /// + /// The key to create or update /// /// /// Headers that will be added to request. @@ -45186,7 +45567,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Deployment deployment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateFunctionSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -45211,17 +45592,21 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (deployment == null) + if (key == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deployment"); + throw new ValidationException(ValidationRules.CannotBeNull, "key"); } if (Client.SubscriptionId == null) { @@ -45240,18 +45625,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); - tracingParameters.Add("deployment", deployment); + tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateDeploymentSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateFunctionSecretSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45297,9 +45684,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(deployment != null) + if(key != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deployment, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -45323,7 +45710,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -45353,7 +45740,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -45366,7 +45753,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -45386,24 +45791,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a deployment by its ID for an app, or a deployment slot. + /// Delete a function secret. /// /// - /// Description for Delete a deployment by its ID for an app, or a deployment - /// slot. + /// Description for Delete a function secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Deployment ID. + /// + /// The name of the function. + /// + /// + /// The name of the key. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -45423,7 +45829,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteFunctionSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -45448,9 +45854,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); } if (slot == null) { @@ -45473,17 +45883,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteDeploymentSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteFunctionSecretSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45549,7 +45961,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -45594,26 +46006,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployment log for specific deployment for an app, or a deployment - /// slot. + /// Get function keys for a function in a web site, or a deployment slot. /// /// - /// Description for List deployment log for specific deployment for an app, or - /// a deployment slot. + /// Description for Get function keys for a function in a web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// The ID of a specific deployment. This is the value of the name property in - /// the JSON response from "GET /api/sites/{siteName}/deployments". + /// + /// Function name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -45636,7 +46045,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListDeploymentLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListFunctionKeysSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -45661,9 +46070,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (slot == null) { @@ -45686,17 +46095,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentLogSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionKeysSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45711,7 +46120,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -45792,7 +46201,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -45805,7 +46214,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -45825,28 +46234,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Discovers an existing app backup that can be restored from a blob in Azure - /// storage. Use this to get information about the databases stored in a - /// backup. + /// Get function secrets for a function in a web site, or a deployment slot. /// /// - /// Description for Discovers an existing app backup that can be restored from - /// a blob in Azure storage. Use this to get information about the databases - /// stored in a backup. + /// Description for Get function secrets for a function in a web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// A RestoreRequest object that includes Azure storage URL and blog name for - /// discovery of backup. + /// + /// Function name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// perform discovery for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -45869,7 +46273,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DiscoverBackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListFunctionSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -45894,13 +46298,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) + if (functionName == null) { - request.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (slot == null) { @@ -45923,16 +46323,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DiscoverBackupSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionSecretsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45978,12 +46379,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -46034,7 +46429,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -46047,7 +46442,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -46067,21 +46462,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Lists ownership identifiers for domain associated with web app. + /// Get host secrets for a function app. /// /// - /// Description for Lists ownership identifiers for domain associated with web - /// app. + /// Description for Get host secrets for a function app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -46104,7 +46497,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDomainOwnershipIdentifiersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListHostKeysSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46152,11 +46545,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostKeysSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -46173,7 +46566,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -46254,7 +46647,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -46267,7 +46660,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -46287,10 +46680,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get domain ownership identifier for web app. + /// This is to allow calling via powershell and ARM template. /// /// - /// Description for Get domain ownership identifier for web app. + /// Description for This is to allow calling via powershell and ARM template. /// /// /// Name of the resource group to which the resource belongs. @@ -46298,12 +46691,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -46314,9 +46703,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -46326,7 +46712,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ListSyncStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46351,9 +46737,202 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncStatusSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Syncs function trigger metadata to the management database + /// + /// + /// Description for Syncs function trigger metadata to the management database + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. + /// + /// + /// 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 SyncFunctionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); } if (slot == null) { @@ -46376,17 +46955,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifierSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -46401,7 +46978,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -46452,7 +47029,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -46482,31 +47059,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -46515,28 +47074,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a domain ownership identifier for web app, or updates an existing - /// ownership identifier. + /// Add or update a host level secret. /// /// - /// Description for Creates a domain ownership identifier for web app, or - /// updates an existing ownership identifier. + /// Description for Add or update a host level secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Name of domain ownership identifier. + /// + /// The type of host key. /// - /// - /// A JSON representation of the domain ownership properties. + /// + /// The name of the key. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// Name of the deployment slot. + /// + /// + /// The key to create or update /// /// /// Headers that will be added to request. @@ -46559,7 +47118,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHostSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46584,18 +47143,22 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) + if (keyType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); } - if (domainOwnershipIdentifier == null) + if (keyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "key"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -46613,18 +47176,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); - tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); + tracingParameters.Add("keyType", keyType); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); + tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateDomainOwnershipIdentifierSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostSecretSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); + _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -46670,9 +47235,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(domainOwnershipIdentifier != null) + if(key != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -46696,7 +47261,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -46726,7 +47291,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -46739,7 +47304,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -46759,23 +47342,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a domain ownership identifier for a web app. + /// Delete a host level secret. /// /// - /// Description for Deletes a domain ownership identifier for a web app. + /// Description for Delete a host level secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Name of domain ownership identifier. + /// + /// The type of host key. + /// + /// + /// The name of the key. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -46795,7 +47380,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHostSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46820,9 +47405,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) + if (keyType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); } if (slot == null) { @@ -46845,17 +47434,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("keyType", keyType); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteDomainOwnershipIdentifierSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHostSecretSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); + _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -46921,7 +47512,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -46966,12 +47557,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a domain ownership identifier for web app, or updates an existing - /// ownership identifier. + /// Get hostname bindings for an app or a deployment slot. /// /// - /// Description for Creates a domain ownership identifier for web app, or - /// updates an existing ownership identifier. + /// Description for Get hostname bindings for an app or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -46979,15 +47568,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. - /// - /// - /// A JSON representation of the domain ownership properties. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API gets + /// hostname bindings for the production slot. /// /// /// Headers that will be added to request. @@ -47010,7 +47593,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListHostNameBindingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47035,14 +47618,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } - if (domainOwnershipIdentifier == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -47064,18 +47639,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); - tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateDomainOwnershipIdentifierSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -47090,7 +47662,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -47121,12 +47693,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(domainOwnershipIdentifier != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -47177,7 +47743,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -47190,7 +47756,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -47210,20 +47776,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the status of the last MSDeploy operation. + /// Get the named hostname binding for an app (or deployment slot, if + /// specified). /// /// - /// Description for Get the status of the last MSDeploy operation. + /// Description for Get the named hostname binding for an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API the named + /// binding for the production slot. + /// + /// + /// Hostname in the hostname binding. /// /// /// Headers that will be added to request. @@ -47246,7 +47817,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMSDeployStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47275,6 +47846,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (hostName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -47293,15 +47868,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetHostNameBindingSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -47396,7 +47973,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -47409,7 +47986,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -47429,52 +48006,27 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Creates a hostname binding for an app. /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Creates a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// Details of MSDeploy operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// Name of the app. /// - public async Task> CreateMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateMSDeployOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Hostname in the hostname binding. /// - /// - /// Name of web app. + /// + /// Binding details. This is the JSON representation of a HostNameBinding + /// object. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// create a binding for the production slot. /// /// /// Headers that will be added to request. @@ -47497,7 +48049,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMSDeployLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47522,6 +48074,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (hostName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + } + if (hostNameBinding == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hostNameBinding"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -47543,15 +48103,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("hostName", hostName); + tracingParameters.Add("hostNameBinding", hostNameBinding); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployLogSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostNameBindingSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -47566,7 +48129,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -47597,6 +48160,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(hostNameBinding != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostNameBinding, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -47617,7 +48186,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -47647,7 +48216,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -47660,7 +48229,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -47680,19 +48249,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the functions for a web site, or a deployment slot. + /// Deletes a hostname binding for an app. /// /// - /// Description for List the functions for a web site, or a deployment slot. + /// Description for Deletes a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. + /// + /// + /// Hostname in the hostname binding. /// /// /// Headers that will be added to request. @@ -47703,9 +48276,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -47715,7 +48285,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceFunctionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47744,6 +48314,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (hostName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -47762,15 +48336,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceFunctionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHostNameBindingSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -47784,7 +48360,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -47835,7 +48411,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -47865,31 +48441,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -47898,21 +48456,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Fetch a short lived token that can be exchanged for a master key. + /// Retrieves a specific Service Bus Hybrid Connection used by this Web App. /// /// - /// Description for Fetch a short lived token that can be exchanged for a - /// master key. + /// Description for Retrieves a specific Service Bus Hybrid Connection used by + /// this Web App. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// The name of the web app. + /// + /// + /// The namespace for this hybrid connection. + /// + /// + /// The relay name for this hybrid connection. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -47935,7 +48498,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetFunctionsAdminTokenSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47960,6 +48523,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (namespaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (relayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -47981,15 +48552,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetFunctionsAdminTokenSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetHybridConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -48085,7 +48660,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -48098,7 +48673,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -48118,23 +48693,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function information by its ID for web site, or a deployment slot. + /// Creates a new Hybrid Connection using a Service Bus relay. /// /// - /// Description for Get function information by its ID for web site, or a - /// deployment slot. + /// Description for Creates a new Hybrid Connection using a Service Bus relay. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// Function name. + /// + /// The namespace for this hybrid connection. + /// + /// + /// The relay name for this hybrid connection. + /// + /// + /// The details of the hybrid connection. /// /// - /// Name of the deployment slot. + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -48157,7 +48737,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -48182,9 +48762,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (relayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (slot == null) { @@ -48207,17 +48795,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceFunctionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHybridConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -48232,7 +48823,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -48263,6 +48854,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -48283,7 +48880,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -48313,7 +48910,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -48326,7 +48923,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -48346,56 +48943,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create function for web site, or a deployment slot. + /// Removes a Hybrid Connection from this site. /// /// - /// Description for Create function for web site, or a deployment slot. + /// Description for Removes a Hybrid Connection from this site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Function name. - /// - /// - /// Name of the deployment slot. - /// - /// - /// Function details. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateInstanceFunctionSlotWithHttpMessagesAsync(resourceGroupName, name, functionName, slot, functionEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Delete a function for web site, or a deployment slot. - /// - /// - /// Description for Delete a function for web site, or a deployment slot. - /// - /// - /// Name of the resource group to which the resource belongs. + /// The name of the web app. /// - /// - /// Site name. + /// + /// The namespace for this hybrid connection. /// - /// - /// Function name. + /// + /// The relay name for this hybrid connection. /// /// - /// Name of the deployment slot. + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -48415,7 +48981,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -48440,9 +49006,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (relayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } if (slot == null) { @@ -48465,17 +49035,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceFunctionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHybridConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -48541,7 +49113,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -48586,28 +49158,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Add or update a function secret. + /// Creates a new Hybrid Connection using a Service Bus relay. /// /// - /// Description for Add or update a function secret. + /// Description for Creates a new Hybrid Connection using a Service Bus relay. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// The name of the function. + /// + /// The namespace for this hybrid connection. /// - /// - /// The name of the key. + /// + /// The relay name for this hybrid connection. /// - /// - /// Name of the deployment slot. + /// + /// The details of the hybrid connection. /// - /// - /// The key to create or update + /// + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -48630,7 +49202,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateFunctionSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -48655,21 +49227,21 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (keyName == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } - if (slot == null) + if (connectionEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } - if (key == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "key"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -48688,20 +49260,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("keyName", keyName); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); - tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateFunctionSecretSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateHybridConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -48716,7 +49288,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -48747,9 +49319,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(key != null) + if(connectionEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -48773,7 +49345,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -48803,7 +49375,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -48816,25 +49388,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -48854,25 +49408,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a function secret. + /// Retrieves all Service Bus Hybrid Connections used by this Web App. /// /// - /// Description for Delete a function secret. + /// Description for Retrieves all Service Bus Hybrid Connections used by this + /// Web App. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// The name of the function. - /// - /// - /// The name of the key. + /// The name of the web app. /// /// - /// Name of the deployment slot. + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -48883,6 +49432,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -48892,7 +49444,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteFunctionSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListHybridConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -48917,14 +49469,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (keyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -48946,19 +49490,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteFunctionSecretSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHybridConnectionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -48973,7 +49513,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -49024,7 +49564,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -49054,13 +49594,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -49069,23 +49627,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function keys for a function in a web site, or a deployment slot. + /// Gets hybrid connections configured for an app (or deployment slot, if + /// specified). /// /// - /// Description for Get function keys for a function in a web site, or a - /// deployment slot. + /// Description for Gets hybrid connections configured for an app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Function name. + /// Name of the app. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// hybrid connections for the production slot. /// /// /// Headers that will be added to request. @@ -49108,7 +49665,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListFunctionKeysSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListRelayServiceConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49133,10 +49690,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -49158,17 +49711,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionKeysSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListRelayServiceConnectionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49183,7 +49734,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -49264,7 +49815,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -49277,7 +49828,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -49297,23 +49848,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function secrets for a function in a web site, or a deployment slot. + /// Gets a hybrid connection configuration by its name. /// /// - /// Description for Get function secrets for a function in a web site, or a - /// deployment slot. + /// Description for Gets a hybrid connection configuration by its name. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Function name. + /// + /// Name of the hybrid connection. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will get a + /// hybrid connection for the production slot. /// /// /// Headers that will be added to request. @@ -49336,7 +49887,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListFunctionSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49361,9 +49912,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (entityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); } if (slot == null) { @@ -49386,17 +49937,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionSecretsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetRelayServiceConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49411,7 +49962,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -49492,7 +50043,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -49505,7 +50056,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -49525,19 +50076,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get host secrets for a function app. + /// Creates a new hybrid connection configuration (PUT), or updates an existing + /// one (PATCH). /// /// - /// Description for Get host secrets for a function app. + /// Description for Creates a new hybrid connection configuration (PUT), or + /// updates an existing one (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// + /// Name of the hybrid connection configuration. + /// + /// + /// Details of the hybrid connection configuration. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// create or update a hybrid connection for the production slot. /// /// /// Headers that will be added to request. @@ -49560,7 +50120,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListHostKeysSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49585,6 +50145,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (entityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -49606,15 +50174,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("entityName", entityName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostKeysSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateRelayServiceConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49629,7 +50200,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -49660,6 +50231,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -49710,7 +50287,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -49723,7 +50300,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -49743,10 +50320,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// This is to allow calling via powershell and ARM template. + /// Deletes a relay service connection by its name. /// /// - /// Description for This is to allow calling via powershell and ARM template. + /// Description for Deletes a relay service connection by its name. /// /// /// Name of the resource group to which the resource belongs. @@ -49754,8 +50331,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the hybrid connection configuration. + /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete a hybrid connection for the production slot. /// /// /// Headers that will be added to request. @@ -49775,7 +50356,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ListSyncStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49800,6 +50381,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (entityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -49821,15 +50406,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSyncStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteRelayServiceConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49844,7 +50431,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -49895,7 +50482,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -49940,10 +50527,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Syncs function trigger metadata to the management database + /// Creates a new hybrid connection configuration (PUT), or updates an existing + /// one (PATCH). /// /// - /// Description for Syncs function trigger metadata to the management database + /// Description for Creates a new hybrid connection configuration (PUT), or + /// updates an existing one (PATCH). /// /// /// Name of the resource group to which the resource belongs. @@ -49951,8 +50540,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the hybrid connection configuration. + /// + /// + /// Details of the hybrid connection configuration. + /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// create or update a hybrid connection for the production slot. /// /// /// Headers that will be added to request. @@ -49963,6 +50559,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -49972,7 +50571,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncFunctionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49997,6 +50596,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (entityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -50018,15 +50625,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("entityName", entityName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateRelayServiceConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -50041,7 +50651,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50072,6 +50682,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -50092,7 +50708,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -50122,13 +50738,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -50137,28 +50771,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Add or update a host level secret. + /// Gets all scale-out instances of an app. /// /// - /// Description for Add or update a host level secret. + /// Description for Gets all scale-out instances of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// The type of host key. - /// - /// - /// The name of the key. + /// Name of the app. /// /// - /// Name of the deployment slot. - /// - /// - /// The key to create or update + /// Name of the deployment slot. If a slot is not specified, the API gets the + /// production slot instances. /// /// /// Headers that will be added to request. @@ -50181,7 +50807,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHostSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceIdentifiersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -50206,22 +50832,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (keyType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); - } - if (keyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (key == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "key"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -50239,20 +50853,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("keyType", keyType); - tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); - tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostSecretSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -50267,7 +50876,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50298,12 +50907,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(key != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -50324,7 +50927,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -50354,7 +50957,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -50367,25 +50970,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -50405,25 +50990,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a host level secret. + /// Gets all scale-out instances of an app. /// /// - /// Description for Delete a host level secret. + /// Description for Gets all scale-out instances of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// The type of host key. + /// Name of the app. /// - /// - /// The name of the key. + /// /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API gets the + /// production slot instances. /// /// /// Headers that will be added to request. @@ -50434,6 +51016,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -50443,7 +51028,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHostSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceInfoSlotWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -50468,13 +51053,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (keyType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); - } - if (keyName == null) + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); } if (slot == null) { @@ -50497,19 +51078,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("keyType", keyType); - tracingParameters.Add("keyName", keyName); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHostSecretSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceInfoSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -50524,7 +51103,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50575,7 +51154,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -50605,13 +51184,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -50620,20 +51217,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get hostname bindings for an app or a deployment slot. + /// Get the status of the last MSDeploy operation. /// /// - /// Description for Get hostname bindings for an app or a deployment slot. + /// Description for Get the status of the last MSDeploy operation. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets - /// hostname bindings for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// ID of web app instance. /// /// /// Headers that will be added to request. @@ -50656,7 +51256,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListHostNameBindingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceMsDeployStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -50685,6 +51285,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -50703,15 +51307,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMsDeployStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -50806,7 +51412,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -50819,7 +51425,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -50839,25 +51445,58 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the named hostname binding for an app (or deployment slot, if - /// specified). + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Get the named hostname binding for an app (or deployment - /// slot, if specified). + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API the named - /// binding for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// - /// - /// Hostname in the hostname binding. + /// + /// ID of web app instance. + /// + /// + /// Details of MSDeploy operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, instanceId, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// ID of web app instance. /// /// /// Headers that will be added to request. @@ -50880,7 +51519,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceMSDeployLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -50909,9 +51548,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (hostName == null) + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); } if (Client.SubscriptionId == null) { @@ -50931,17 +51570,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("hostName", hostName); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHostNameBindingSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMSDeployLogSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -51006,7 +51645,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -51036,7 +51675,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -51049,7 +51688,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -51069,27 +51708,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a hostname binding for an app. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Creates a hostname binding for an app. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Hostname in the hostname binding. - /// - /// - /// Binding details. This is the JSON representation of a HostNameBinding - /// object. + /// Site name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// create a binding for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -51112,7 +51750,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -51137,18 +51775,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } - if (hostNameBinding == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostNameBinding"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -51166,19 +51800,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostName", hostName); - tracingParameters.Add("hostNameBinding", hostNameBinding); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostNameBindingSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -51192,7 +51825,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -51223,12 +51856,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(hostNameBinding != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostNameBinding, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -51249,7 +51876,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -51279,7 +51906,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -51292,7 +51919,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -51312,23 +51939,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a hostname binding for an app. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Deletes a hostname binding for an app. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// - /// - /// Hostname in the hostname binding. + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -51339,6 +51972,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -51348,7 +51984,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -51373,13 +52009,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (hostName == null) + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); } if (Client.SubscriptionId == null) { @@ -51398,18 +52038,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); - tracingParameters.Add("hostName", hostName); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHostNameBindingSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -51423,7 +52065,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -51474,7 +52116,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -51504,13 +52146,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -51519,26 +52179,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Retrieves a specific Service Bus Hybrid Connection used by this Web App. + /// Terminate a process by its ID for a web site, or a deployment slot, or + /// specific scaled-out instance in a web site. /// /// - /// Description for Retrieves a specific Service Bus Hybrid Connection used by - /// this Web App. + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. + /// Site name. /// - /// - /// The relay name for this hybrid connection. + /// + /// PID. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -51549,9 +52212,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -51561,7 +52221,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteInstanceProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -51586,18 +52246,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -51615,20 +52275,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHybridConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceProcessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -51642,7 +52302,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -51693,7 +52353,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -51723,31 +52383,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -51756,28 +52398,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new Hybrid Connection using a Service Bus relay. + /// Get a memory dump of a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Description for Get a memory dump of a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. - /// - /// - /// The relay name for this hybrid connection. + /// Site name. /// - /// - /// The details of the hybrid connection. + /// + /// PID. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -51800,7 +52443,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessDumpSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -51825,22 +52468,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); - } - if (connectionEnvelope == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -51858,21 +52497,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHybridConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessDumpSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -51886,7 +52524,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -51917,12 +52555,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -51935,7 +52567,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -51943,7 +52575,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -51973,7 +52605,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -51983,20 +52615,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -52006,25 +52625,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Removes a Hybrid Connection from this site. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Removes a Hybrid Connection from this site. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. + /// Site name. /// - /// - /// The relay name for this hybrid connection. + /// + /// PID. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -52035,6 +52658,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -52044,7 +52670,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessModulesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52069,18 +52695,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -52098,20 +52724,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHybridConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -52125,7 +52751,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -52206,13 +52832,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -52221,28 +52865,32 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new Hybrid Connection using a Service Bus relay. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. + /// Site name. /// - /// - /// The relay name for this hybrid connection. + /// + /// PID. /// - /// - /// The details of the hybrid connection. + /// + /// Module base address. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -52265,7 +52913,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessModuleSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52290,22 +52938,22 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } - if (connectionEnvelope == null) + if (baseAddress == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -52323,21 +52971,22 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("processId", processId); + tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateHybridConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessModuleSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -52351,7 +53000,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -52382,12 +53031,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -52408,7 +53051,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -52438,7 +53081,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -52451,7 +53094,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -52471,20 +53114,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Retrieves all Service Bus Hybrid Connections used by this Web App. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Retrieves all Service Bus Hybrid Connections used by this - /// Web App. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Site name. + /// + /// + /// PID. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -52507,7 +53159,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListHybridConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessThreadsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52532,10 +53184,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -52553,16 +53213,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHybridConnectionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -52627,7 +53291,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -52657,7 +53321,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -52670,7 +53334,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -52690,12 +53354,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets hybrid connections configured for an app (or deployment slot, if - /// specified). + /// Shows whether an app can be cloned to another resource group or + /// subscription. /// /// - /// Description for Gets hybrid connections configured for an app (or - /// deployment slot, if specified). + /// Description for Shows whether an app can be cloned to another resource + /// group or subscription. /// /// /// Name of the resource group to which the resource belongs. @@ -52704,8 +53368,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// hybrid connections for the production slot. + /// Name of the deployment slot. By default, this API returns information on + /// the production slot. /// /// /// Headers that will be added to request. @@ -52728,7 +53392,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListRelayServiceConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> IsCloneableSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52776,11 +53440,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRelayServiceConnectionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "IsCloneableSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -52797,7 +53461,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -52878,7 +53542,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -52891,7 +53555,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -52911,10 +53575,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a hybrid connection configuration by its name. + /// Gets existing backups of an app. /// /// - /// Description for Gets a hybrid connection configuration by its name. + /// Description for Gets existing backups of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -52922,12 +53586,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the hybrid connection. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get a - /// hybrid connection for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// backups of the production slot. /// /// /// Headers that will be added to request. @@ -52950,7 +53611,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteBackupsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52975,10 +53636,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -53000,17 +53657,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetRelayServiceConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -53025,7 +53680,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53106,7 +53761,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -53119,7 +53774,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -53139,12 +53794,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new hybrid connection configuration (PUT), or updates an existing - /// one (PATCH). + /// This is to allow calling via powershell and ARM template. /// /// - /// Description for Creates a new hybrid connection configuration (PUT), or - /// updates an existing one (PATCH). + /// Description for This is to allow calling via powershell and ARM template. /// /// /// Name of the resource group to which the resource belongs. @@ -53152,15 +53805,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the hybrid connection configuration. - /// - /// - /// Details of the hybrid connection configuration. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// create or update a hybrid connection for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -53183,7 +53829,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSyncFunctionTriggersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -53208,14 +53854,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -53237,18 +53875,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateRelayServiceConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncFunctionTriggersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -53263,7 +53898,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53294,12 +53929,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -53350,7 +53979,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -53363,7 +53992,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -53383,23 +54012,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a relay service connection by its name. + /// Returns the status of MySql in app migration, if one is active, and whether + /// or not MySql in app is enabled /// /// - /// Description for Deletes a relay service connection by its name. + /// Description for Returns the status of MySql in app migration, if one is + /// active, and whether or not MySql in app is enabled /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the hybrid connection configuration. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete a hybrid connection for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -53410,6 +54037,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -53419,7 +54049,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMigrateMySqlStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -53444,10 +54074,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -53469,17 +54095,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteRelayServiceConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMigrateMySqlStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -53494,7 +54118,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53545,7 +54169,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -53575,13 +54199,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -53590,12 +54232,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new hybrid connection configuration (PUT), or updates an existing - /// one (PATCH). + /// Gets a Swift Virtual Network connection. /// /// - /// Description for Creates a new hybrid connection configuration (PUT), or - /// updates an existing one (PATCH). + /// Description for Gets a Swift Virtual Network connection. /// /// /// Name of the resource group to which the resource belongs. @@ -53603,15 +54243,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the hybrid connection configuration. - /// - /// - /// Details of the hybrid connection configuration. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// create or update a hybrid connection for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get a + /// gateway for the production slot's Virtual Network. /// /// /// Headers that will be added to request. @@ -53634,7 +54268,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -53659,14 +54293,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -53688,18 +54314,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateRelayServiceConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSwiftVirtualNetworkConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -53714,7 +54337,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53745,12 +54368,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -53801,7 +54418,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -53814,7 +54431,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -53834,10 +54451,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. /// /// /// Name of the resource group to which the resource belongs. @@ -53845,9 +54469,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Properties of the Virtual Network connection. See example. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets the - /// production slot instances. + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update connections for the production slot. /// /// /// Headers that will be added to request. @@ -53870,7 +54497,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceIdentifiersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -53895,6 +54522,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -53916,13 +54547,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateSwiftVirtualNetworkConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -53939,7 +54571,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53970,6 +54602,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -54020,7 +54658,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -54033,7 +54671,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -54053,10 +54691,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Deletes a Swift Virtual Network connection from an app (or deployment + /// slot). /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Deletes a Swift Virtual Network connection from an app (or + /// deployment slot). /// /// /// Name of the resource group to which the resource belongs. @@ -54064,11 +54704,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets the - /// production slot instances. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the connection for the production slot. /// /// /// Headers that will be added to request. @@ -54079,9 +54717,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -54091,7 +54726,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceInfoSlotWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSwiftVirtualNetworkSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54116,10 +54751,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -54141,17 +54772,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceInfoSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSwiftVirtualNetworkSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -54166,7 +54795,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -54217,7 +54846,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -54247,31 +54876,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -54280,23 +54891,30 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the status of the last MSDeploy operation. + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. /// /// - /// Description for Get the status of the last MSDeploy operation. + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// + /// Properties of the Virtual Network connection. See example. /// - /// - /// ID of web app instance. + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update connections for the production slot. /// /// /// Headers that will be added to request. @@ -54319,7 +54937,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceMsDeployStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54344,13 +54962,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (connectionEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } - if (instanceId == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -54369,18 +54987,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMsDeployStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSwiftVirtualNetworkConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -54394,7 +55011,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -54425,6 +55042,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -54475,7 +55098,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -54488,7 +55111,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -54508,58 +55131,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Gets all network features used by the app (or deployment slot, if + /// specified). /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Gets all network features used by the app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// ID of web app instance. - /// - /// - /// Details of MSDeploy operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, instanceId, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Name of the app. /// - /// - /// Name of web app. + /// + /// The type of view. This can either be "summary" or "detailed". /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// ID of web app instance. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// network features for the production slot. /// /// /// Headers that will be added to request. @@ -54582,7 +55172,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceMSDeployLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListNetworkFeaturesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string view, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54607,13 +55197,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (view == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "view"); } - if (instanceId == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -54632,18 +55222,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("view", view); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMSDeployLogSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNetworkFeaturesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{view}", System.Uri.EscapeDataString(view)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -54738,7 +55328,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -54751,7 +55341,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -54771,26 +55361,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// + /// GUID of the operation. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// an operation for the production slot. /// /// /// Headers that will be added to request. @@ -54813,7 +55402,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54838,13 +55427,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - if (instanceId == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -54863,18 +55452,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -54939,7 +55528,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -54969,7 +55558,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -54982,7 +55571,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -55002,29 +55609,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Start capturing network packets for the site (To be deprecated). /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Start capturing network packets for the site (To be + /// deprecated). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// The name of the web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// The name of the slot for this web app. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. /// /// /// Headers that will be added to request. @@ -55047,7 +55654,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> StartWebSiteNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -55072,18 +55679,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -55101,22 +55700,33 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("durationInSeconds", durationInSeconds); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartWebSiteNetworkTraceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -55128,7 +55738,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -55179,7 +55789,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -55209,7 +55819,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -55222,7 +55832,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -55242,29 +55852,56 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Terminate a process by its ID for a web site, or a deployment slot, or - /// specific scaled-out instance in a web site. + /// Start capturing network packets for the site. /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// The name of the web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// The name of the slot for this web app. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> StartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginStartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stop ongoing capturing network packets for the site. + /// + /// + /// Description for Stop ongoing capturing network packets for the site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. + /// + /// + /// The name of the slot for this web app. /// /// /// Headers that will be added to request. @@ -55284,7 +55921,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteInstanceProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopWebSiteNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -55309,18 +55946,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -55338,20 +55967,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceProcessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopWebSiteNetworkTraceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -55365,7 +55990,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -55416,7 +56041,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -55461,29 +56086,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a memory dump of a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Get a memory dump of a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// GUID of the operation. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. - /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// Name of the deployment slot. If a slot is not specified, the API will get + /// an operation for the production slot. /// /// /// Headers that will be added to request. @@ -55506,7 +56127,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessDumpSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTracesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -55531,18 +56152,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -55560,20 +56177,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessDumpSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -55630,7 +56245,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -55638,7 +56253,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -55668,7 +56283,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -55678,7 +56293,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -55688,29 +56316,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// GUID of the operation. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. - /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// Name of the deployment slot. If a slot is not specified, the API will get + /// an operation for the production slot. /// /// /// Headers that will be added to request. @@ -55733,7 +56357,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessModulesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTraceOperationSlotV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -55758,18 +56382,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -55787,20 +56407,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationSlotV2", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -55865,7 +56483,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -55895,7 +56513,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -55908,7 +56526,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -55928,32 +56564,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// - /// - /// Module base address. + /// + /// GUID of the operation. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. - /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// Name of the deployment slot. If a slot is not specified, the API will get + /// an operation for the production slot. /// /// /// Headers that will be added to request. @@ -55976,7 +56605,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessModuleSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTracesSlotV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -56001,22 +56630,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (baseAddress == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -56034,22 +56655,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("baseAddress", baseAddress); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessModuleSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesSlotV2", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -56114,7 +56731,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -56144,7 +56761,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -56157,7 +56774,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -56177,29 +56794,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Generates a new publishing password for an app (or deployment slot, if + /// specified). /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Generates a new publishing password for an app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. - /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// Name of the deployment slot. If a slot is not specified, the API generate a + /// new publishing password for the production slot. /// /// /// Headers that will be added to request. @@ -56210,9 +56820,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -56222,7 +56829,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessThreadsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task GenerateNewSitePublishingPasswordSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -56247,18 +56854,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -56276,20 +56875,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GenerateNewSitePublishingPasswordSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -56303,7 +56898,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -56354,7 +56949,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -56384,31 +56979,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -56417,22 +56994,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Shows whether an app can be cloned to another resource group or - /// subscription. + /// Gets perfmon counters for web app. /// /// - /// Description for Shows whether an app can be cloned to another resource - /// group or subscription. + /// Description for Gets perfmon counters for web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// /// - /// Name of the deployment slot. By default, this API returns information on - /// the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// Return only usages/metrics specified in the filter. Filter conforms to + /// odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and + /// endTime eq 2014-12-31T23:59:59Z and timeGrain eq + /// duration'[Hour|Minute|Day]'. /// /// /// Headers that will be added to request. @@ -56455,7 +57036,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> IsCloneableSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPerfMonCountersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -56502,236 +57083,22 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "IsCloneableSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets existing backups of an app. - /// - /// - /// Description for Gets existing backups of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// backups of the production slot. - /// - /// - /// 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>> ListSiteBackupsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) + if (filter != null) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsSlot", tracingParameters); + _queryParameters.Add(string.Format("$filter={0}", filter)); } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -56743,7 +57110,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -56824,7 +57191,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -56837,7 +57204,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -56857,19 +57224,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// This is to allow calling via powershell and ARM template. + /// Gets web app's event logs. /// /// - /// Description for This is to allow calling via powershell and ARM template. + /// Description for Gets web app's event logs. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// /// - /// Name of the deployment slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -56892,7 +57260,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSyncFunctionTriggersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSitePhpErrorLogFlagSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -56940,11 +57308,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSyncFunctionTriggersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSitePhpErrorLogFlagSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -56961,7 +57329,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -57042,7 +57410,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -57055,7 +57423,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -57075,21 +57443,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Returns the status of MySql in app migration, if one is active, and whether - /// or not MySql in app is enabled + /// Gets the premier add-ons of an app. /// /// - /// Description for Returns the status of MySql in app migration, if one is - /// active, and whether or not MySql in app is enabled + /// Description for Gets the premier add-ons of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the premier add-ons for the production slot. /// /// /// Headers that will be added to request. @@ -57112,7 +57479,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMigrateMySqlStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPremierAddOnsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57160,11 +57527,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMigrateMySqlStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPremierAddOnsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -57262,7 +57629,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -57275,7 +57642,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -57295,10 +57662,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a Swift Virtual Network connection. + /// Gets a named add-on of an app. /// /// - /// Description for Gets a Swift Virtual Network connection. + /// Description for Gets a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -57306,9 +57673,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Add-on name. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get a - /// gateway for the production slot's Virtual Network. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the named add-on for the production slot. /// /// /// Headers that will be added to request. @@ -57331,7 +57701,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57356,6 +57726,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (premierAddOnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -57377,15 +57751,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSwiftVirtualNetworkConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPremierAddOnSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -57481,7 +57857,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -57494,7 +57870,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -57514,12 +57890,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a Swift Virtual Network connection from an app (or deployment - /// slot). + /// Updates a named add-on of an app. /// /// - /// Description for Deletes a Swift Virtual Network connection from an app (or - /// deployment slot). + /// Description for Updates a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -57527,9 +57901,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Add-on name. + /// + /// + /// A JSON representation of the edited premier add-on. + /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the connection for the production slot. + /// update the named add-on for the production slot. /// /// /// Headers that will be added to request. @@ -57540,6 +57920,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -57549,7 +57932,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSwiftVirtualNetworkSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AddPremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57574,6 +57957,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (premierAddOnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } + if (premierAddOn == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); + } + if (premierAddOn != null) + { + premierAddOn.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -57595,15 +57990,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSwiftVirtualNetworkSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddPremierAddOnSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -57618,7 +58016,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -57649,6 +58047,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(premierAddOn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -57669,7 +58073,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -57699,13 +58103,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -57714,12 +58136,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all network features used by the app (or deployment slot, if - /// specified). + /// Delete a premier add-on from an app. /// /// - /// Description for Gets all network features used by the app (or deployment - /// slot, if specified). + /// Description for Delete a premier add-on from an app. /// /// /// Name of the resource group to which the resource belongs. @@ -57727,12 +58147,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The type of view. Only "summary" is supported at this time. + /// + /// Add-on name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// network features for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the named add-on for the production slot. /// /// /// Headers that will be added to request. @@ -57743,9 +58163,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -57755,7 +58172,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListNetworkFeaturesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string view, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeletePremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57780,9 +58197,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (view == null) + if (premierAddOnName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "view"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); } if (slot == null) { @@ -57805,17 +58222,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("view", view); + tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNetworkFeaturesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeletePremierAddOnSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{view}", System.Uri.EscapeDataString(view)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -57830,7 +58247,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -57881,7 +58298,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -57911,31 +58328,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -57944,12 +58343,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Updates a named add-on of an app. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Updates a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -57957,12 +58354,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// GUID of the operation. + /// + /// Add-on name. + /// + /// + /// A JSON representation of the edited premier add-on. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// an operation for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the named add-on for the production slot. /// /// /// Headers that will be added to request. @@ -57985,7 +58385,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdatePremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58010,9 +58410,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) + if (premierAddOnName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } + if (premierAddOn == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); } if (slot == null) { @@ -58035,17 +58439,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); + tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdatePremierAddOnSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -58060,7 +58465,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -58091,6 +58496,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(premierAddOn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -58111,7 +58522,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -58141,7 +58552,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -58154,25 +58565,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -58192,11 +58585,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site (To be deprecated). + /// Gets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Start capturing network packets for the site (To be - /// deprecated). + /// Description for Gets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// Name of the resource group to which the resource belongs. @@ -58205,16 +58599,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// The name of the web app. /// /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -58237,7 +58622,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> StartWebSiteNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateAccessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58283,33 +58668,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); tracingParameters.Add("slot", slot); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartWebSiteNetworkTraceSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateAccessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -58321,7 +58691,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -58402,7 +58772,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -58415,7 +58785,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -58435,10 +58805,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Sets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Start capturing network packets for the site. + /// Description for Sets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// Name of the resource group to which the resource belongs. @@ -58446,45 +58818,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The name of the web app. /// - /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> StartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginStartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stop ongoing capturing network packets for the site. - /// - /// - /// Description for Stop ongoing capturing network packets for the site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The name of the web app. + /// + /// The information for the private access /// /// - /// The name of the slot for this web app. + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -58495,6 +58833,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -58504,7 +58845,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopWebSiteNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PutPrivateAccessVnetSlotWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58529,6 +58870,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (access == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "access"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -58550,13 +58895,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("access", access); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopWebSiteNetworkTraceSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "PutPrivateAccessVnetSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -58573,7 +58919,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -58604,6 +58950,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(access != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(access, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -58624,7 +58976,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -58654,13 +59006,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -58669,25 +59039,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Gets a private endpoint connection /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Gets a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// GUID of the operation. + /// Name of the site. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// an operation for the production slot. + /// /// /// /// Headers that will be added to request. @@ -58710,7 +59073,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTracesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58735,13 +59098,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } - if (slot == null) + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } if (Client.SubscriptionId == null) { @@ -58760,18 +59119,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); - tracingParameters.Add("slot", slot); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -58866,7 +59223,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -58879,7 +59236,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -58899,25 +59256,72 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Approves or rejects a private endpoint connection /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of the site. /// - /// - /// GUID of the operation. + /// /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// an operation for the production slot. + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. /// /// /// Headers that will be added to request. @@ -58940,7 +59344,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTraceOperationSlotV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58965,14 +59369,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -58990,18 +59386,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationSlotV2", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -59066,7 +59458,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59096,7 +59488,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -59109,25 +59501,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -59147,25 +59521,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// GUID of the operation. + /// Site name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// an operation for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -59188,7 +59559,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTracesSlotV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -59213,10 +59584,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -59238,17 +59605,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesSlotV2", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -59314,7 +59679,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59344,7 +59709,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -59357,7 +59722,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -59377,22 +59742,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Generates a new publishing password for an app (or deployment slot, if - /// specified). + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Generates a new publishing password for an app (or - /// deployment slot, if specified). + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API generate a - /// new publishing password for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -59403,6 +59771,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -59412,7 +59783,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task GenerateNewSitePublishingPasswordSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -59437,6 +59808,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -59458,15 +59833,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GenerateNewSitePublishingPasswordSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -59481,7 +59858,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -59532,7 +59909,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59562,13 +59939,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -59577,26 +59972,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets perfmon counters for web app. + /// Terminate a process by its ID for a web site, or a deployment slot, or + /// specific scaled-out instance in a web site. /// /// - /// Description for Gets perfmon counters for web app. + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// + /// PID. /// - /// - /// Return only usages/metrics specified in the filter. Filter conforms to - /// odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and - /// endTime eq 2014-12-31T23:59:59Z and timeGrain eq - /// duration'[Hour|Minute|Day]'. + /// + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -59607,9 +60001,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -59619,7 +60010,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPerfMonCountersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -59644,6 +60035,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -59665,23 +60060,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); - tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteProcessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -59693,7 +60085,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -59744,7 +60136,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59774,31 +60166,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -59807,20 +60181,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets web app's event logs. + /// Get a memory dump of a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets web app's event logs. + /// Description for Get a memory dump of a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. + /// + /// + /// PID. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -59843,7 +60222,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSitePhpErrorLogFlagSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessDumpSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -59868,6 +60247,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -59889,15 +60272,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSitePhpErrorLogFlagSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessDumpSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -59955,7 +60340,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -59963,7 +60348,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59993,7 +60378,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -60003,20 +60388,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -60026,20 +60398,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the premier add-ons of an app. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Gets the premier add-ons of an app. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the premier add-ons for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -60062,7 +60439,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListPremierAddOnsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessModulesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60087,6 +60464,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -60108,15 +60489,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPremierAddOnsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessModulesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -60182,7 +60565,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -60212,7 +60595,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -60225,7 +60608,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -60245,23 +60628,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named add-on of an app. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Gets a named add-on of an app. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Add-on name. + /// + /// PID. + /// + /// + /// Module base address. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the named add-on for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -60284,7 +60672,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessModuleSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60309,9 +60697,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (baseAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); } if (slot == null) { @@ -60334,17 +60726,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("processId", processId); + tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPremierAddOnSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessModuleSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -60410,7 +60804,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -60440,7 +60834,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -60453,7 +60847,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -60473,26 +60867,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates a named add-on of an app. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Updates a named add-on of an app. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Add-on name. + /// Site name. /// - /// - /// A JSON representation of the edited premier add-on. + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the named add-on for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -60515,7 +60908,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddPremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessThreadsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60540,17 +60933,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } - if (premierAddOn == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); - } - if (premierAddOn != null) + if (processId == null) { - premierAddOn.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { @@ -60573,18 +60958,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); - tracingParameters.Add("premierAddOn", premierAddOn); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddPremierAddOnSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreadsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -60599,7 +60983,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -60630,12 +61014,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(premierAddOn != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -60656,7 +61034,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -60686,7 +61064,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -60699,7 +61077,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -60719,10 +61097,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a premier add-on from an app. + /// Get public certificates for an app or a deployment slot. /// /// - /// Description for Delete a premier add-on from an app. + /// Description for Get public certificates for an app or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -60730,12 +61108,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Add-on name. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the named add-on for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API gets + /// hostname bindings for the production slot. /// /// /// Headers that will be added to request. @@ -60746,6 +61121,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -60755,7 +61133,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeletePremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPublicCertificatesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60780,10 +61158,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -60805,17 +61179,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeletePremierAddOnSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificatesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -60830,7 +61202,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -60911,13 +61283,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -60926,10 +61316,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates a named add-on of an app. + /// Get the named public certificate for an app (or deployment slot, if + /// specified). /// /// - /// Description for Updates a named add-on of an app. + /// Description for Get the named public certificate for an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -60937,15 +61329,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Add-on name. - /// - /// - /// A JSON representation of the edited premier add-on. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the named add-on for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API the named + /// binding for the production slot. + /// + /// + /// Public certificate name. /// /// /// Headers that will be added to request. @@ -60968,7 +61357,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdatePremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60993,18 +61382,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } - if (premierAddOn == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (publicCertificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -61022,19 +61407,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); - tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("slot", slot); + tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdatePremierAddOnSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPublicCertificateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -61048,7 +61432,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -61079,12 +61463,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(premierAddOn != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -61135,7 +61513,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -61148,7 +61526,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -61168,21 +61546,27 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Creates a hostname binding for an app. /// /// - /// Description for Gets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Creates a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. + /// + /// + /// Public certificate name. + /// + /// + /// Public certificate details. This is the JSON representation of a + /// PublicCertificate object. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. If a slot is not specified, the API will + /// create a binding for the production slot. /// /// /// Headers that will be added to request. @@ -61205,7 +61589,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateAccessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdatePublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -61230,6 +61614,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (publicCertificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } + if (publicCertificate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificate"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -61251,15 +61643,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("publicCertificateName", publicCertificateName); + tracingParameters.Add("publicCertificate", publicCertificate); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateAccessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdatePublicCertificateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -61274,7 +61669,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -61305,6 +61700,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(publicCertificate != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publicCertificate, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -61355,7 +61756,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -61368,7 +61769,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -61388,24 +61789,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Sets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Deletes a hostname binding for an app. /// /// - /// Description for Sets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Deletes a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The information for the private access + /// Name of the app. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. + /// + /// + /// Public certificate name. /// /// /// Headers that will be added to request. @@ -61416,9 +61816,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -61428,7 +61825,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PutPrivateAccessVnetSlotWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeletePublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -61453,14 +61850,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (access == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "access"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (publicCertificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -61478,17 +61875,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("access", access); tracingParameters.Add("slot", slot); + tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PutPrivateAccessVnetSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeletePublicCertificateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -61502,7 +61900,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -61533,12 +61931,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(access != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(access, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -61559,7 +61951,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -61589,31 +61981,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -61622,20 +61996,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the list of private endpoint connections associated with a site + /// Gets the publishing profile for an app (or deployment slot, if specified). /// /// - /// Description for Gets the list of private endpoint connections associated - /// with a site + /// Description for Gets the publishing profile for an app (or deployment slot, + /// if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// Name of the app. + /// + /// + /// Specifies publishingProfileOptions for publishing profile. For example, use + /// {"format": "FileZilla3"} to get a FileZilla publishing profile. /// /// - /// Name of the site deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the publishing profile for the production slot. /// /// /// Headers that will be added to request. @@ -61658,7 +62037,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetPrivateEndpointConnectionListSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPublishingProfileXmlWithSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -61683,6 +62062,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (publishingProfileOptions == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publishingProfileOptions"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -61704,13 +62087,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("publishingProfileOptions", publishingProfileOptions); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionListSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublishingProfileXmlWithSecretsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -61727,7 +62111,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -61758,6 +62142,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(publishingProfileOptions != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publishingProfileOptions, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -61770,7 +62160,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -61808,7 +62198,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -61818,20 +62208,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -61841,22 +62218,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a private endpoint connection + /// Resets the configuration settings of the current slot if they were + /// previously modified by calling the API with POST. /// /// - /// Description for Gets a private endpoint connection + /// Description for Resets the configuration settings of the current slot if + /// they were previously modified by calling the API with POST. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. - /// - /// - /// Name of the private endpoint connection. + /// Name of the app. /// /// - /// Name of the site deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API resets + /// configuration settings for the production slot. /// /// /// Headers that will be added to request. @@ -61867,9 +62244,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -61879,7 +62253,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ResetSlotConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -61904,10 +62278,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -61929,17 +62299,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ResetSlotConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -61954,7 +62322,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -62035,31 +62403,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -62068,78 +62418,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a private endpoint connection + /// Restarts an app (or deployment slot, if specified). /// /// - /// Description for Deletes a private endpoint connection + /// Description for Restarts an app (or deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. - /// - /// + /// Name of the app. /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// restart the production slot. /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> DeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. + /// + /// Specify true to apply the configuration settings and restarts the app only + /// if necessary. By default, the API always restarts and reprovisions the app. /// - /// + /// + /// Specify true to block until the app is restarted. By default, it is set to + /// false, and the API responds immediately (asynchronous). /// /// /// Headers that will be added to request. @@ -62150,9 +62450,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -62162,7 +62459,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateLinkResourcesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RestartSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, bool? softRestart = default(bool?), bool? synchronous = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -62209,17 +62506,27 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); + tracingParameters.Add("softRestart", softRestart); + tracingParameters.Add("synchronous", synchronous); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResourcesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RestartSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateLinkResources").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (softRestart != null) + { + _queryParameters.Add(string.Format("softRestart={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softRestart, Client.SerializationSettings).Trim('"')))); + } + if (synchronous != null) + { + _queryParameters.Add(string.Format("synchronous={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(synchronous, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -62231,7 +62538,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -62312,31 +62619,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -62345,12 +62634,108 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Restores an app from a backup blob in Azure Storage. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Restores an app from a backup blob in Azure Storage. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Information on restore request . + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// restore a backup of the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFromBackupBlobSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFromBackupBlobSlotWithHttpMessagesAsync(resourceGroupName, name, request, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores a deleted web app to this web app. + /// + /// + /// Description for Restores a deleted web app to this web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Deleted web app restore information. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFromDeletedAppSlotWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFromDeletedAppSlotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores a web app from a snapshot. + /// + /// + /// Description for Restores a web app from a snapshot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Snapshot restore settings. Snapshot information can be obtained by calling + /// GetDeletedSites or GetSiteSnapshots API. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreSnapshotSlotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get list of siteextensions for a web site, or a deployment slot. + /// + /// + /// Description for Get list of siteextensions for a web site, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. @@ -62359,8 +62744,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Site name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -62383,7 +62768,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteExtensionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -62431,11 +62816,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -62533,7 +62918,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -62546,7 +62931,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -62566,12 +62951,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Get site extension information by its ID for a web site, or a deployment + /// slot. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Get site extension information by its ID for a web site, or + /// a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -62579,12 +62964,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// PID. + /// + /// Site extension name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -62607,7 +62992,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -62632,9 +63017,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (slot == null) { @@ -62657,17 +63042,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteExtensionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -62763,7 +63148,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -62776,7 +63161,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -62796,12 +63181,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Terminate a process by its ID for a web site, or a deployment slot, or - /// specific scaled-out instance in a web site. + /// Install site extension on a web site, or a deployment slot. /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Install site extension on a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -62809,208 +63192,32 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// PID. + /// + /// Site extension name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// - /// Headers that will be added to request. + /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task DeleteProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> InstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteProcessSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + AzureOperationResponse _response = await BeginInstallSiteExtensionSlotWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Get a memory dump of a process by its ID for a specific scaled-out instance - /// in a web site. + /// Remove a site extension from a web site, or a deployment slot. /// /// - /// Description for Get a memory dump of a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Remove a site extension from a web site, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. @@ -63018,12 +63225,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// PID. + /// + /// Site extension name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -63034,9 +63241,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -63046,7 +63250,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessDumpSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -63071,9 +63275,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (slot == null) { @@ -63096,17 +63300,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessDumpSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSiteExtensionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -63121,7 +63325,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -63164,7 +63368,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -63172,7 +63376,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -63202,18 +63406,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) - { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -63222,25 +63421,58 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Copies a deployment slot to another deployment slot of an app. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Copies a deployment slot to another deployment slot of an + /// app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// JSON object that contains the target slot name and site config properties + /// to override the source slot config. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task CopySlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginCopySlotSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the difference in configuration settings between two web app slots. + /// + /// + /// Description for Get the difference in configuration settings between two + /// web app slots. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name. See example. + /// + /// + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. /// /// /// Headers that will be added to request. @@ -63263,7 +63495,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessModulesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSlotDifferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -63288,9 +63520,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (slotSwapEntity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); } if (slot == null) { @@ -63313,17 +63549,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessModulesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlotDifferencesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -63338,7 +63573,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -63369,6 +63604,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -63389,7 +63630,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -63419,7 +63660,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -63432,7 +63673,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -63452,28 +63693,51 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Swaps two deployment slots of an app. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Swaps two deployment slots of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// JSON object that contains the target slot name. See example. /// - /// - /// Module base address. + /// + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task SwapSlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginSwapSlotSlotWithHttpMessagesAsync(resourceGroupName, name, slotSwapEntity, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns all Snapshots to the user. + /// + /// + /// Description for Returns all Snapshots to the user. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Website Name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Website Slot. /// /// /// Headers that will be added to request. @@ -63496,7 +63760,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessModuleSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSnapshotsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -63521,14 +63785,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (baseAddress == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -63550,19 +63806,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessModuleSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -63628,7 +63880,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -63658,7 +63910,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -63671,7 +63923,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -63691,25 +63943,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Returns all Snapshots to the user from DRSecondary endpoint. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Returns all Snapshots to the user from DRSecondary + /// endpoint. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Website Name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Website Slot. /// /// /// Headers that will be added to request. @@ -63732,7 +63979,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessThreadsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSnapshotsFromDRSecondarySlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -63757,10 +64004,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -63782,17 +64025,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreadsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsFromDRSecondarySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -63858,7 +64099,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -63888,7 +64129,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -63901,7 +64142,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -63921,10 +64162,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get public certificates for an app or a deployment slot. + /// Gets the source control configuration of an app. /// /// - /// Description for Get public certificates for an app or a deployment slot. + /// Description for Gets the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -63933,8 +64174,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets - /// hostname bindings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the source control configuration for the production slot. /// /// /// Headers that will be added to request. @@ -63957,7 +64198,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublicCertificatesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64005,11 +64246,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificatesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSourceControlSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -64077,7 +64318,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -64107,7 +64348,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -64120,7 +64361,43 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -64140,12 +64417,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the named public certificate for an app (or deployment slot, if - /// specified). + /// Updates the source control configuration of an app. /// /// - /// Description for Get the named public certificate for an app (or deployment - /// slot, if specified). + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -64153,12 +64428,41 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// JSON representation of a SiteSourceControl object. See example. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API the named - /// binding for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the source control configuration for the production slot. /// - /// - /// Public certificate name. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateSourceControlSlotWithHttpMessagesAsync(resourceGroupName, name, siteSourceControl, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the source control configuration of an app. + /// + /// + /// Description for Deletes the source control configuration of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the source control configuration for the production slot. /// /// /// Headers that will be added to request. @@ -64169,9 +64473,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -64181,7 +64482,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64210,10 +64511,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (publicCertificateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -64232,17 +64529,15 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPublicCertificateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSourceControlSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -64256,7 +64551,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -64307,7 +64602,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -64337,31 +64632,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -64370,10 +64647,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a hostname binding for an app. + /// Updates the source control configuration of an app. /// /// - /// Description for Creates a hostname binding for an app. + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -64381,16 +64658,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Public certificate name. - /// - /// - /// Public certificate details. This is the JSON representation of a - /// PublicCertificate object. + /// + /// JSON representation of a SiteSourceControl object. See example. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// create a binding for the production slot. + /// update the source control configuration for the production slot. /// /// /// Headers that will be added to request. @@ -64413,7 +64686,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdatePublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64438,13 +64711,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publicCertificateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); - } - if (publicCertificate == null) + if (siteSourceControl == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificate"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); } if (slot == null) { @@ -64467,18 +64736,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publicCertificateName", publicCertificateName); - tracingParameters.Add("publicCertificate", publicCertificate); + tracingParameters.Add("siteSourceControl", siteSourceControl); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdatePublicCertificateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSourceControlSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -64493,7 +64760,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -64524,9 +64791,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(publicCertificate != null) + if(siteSourceControl != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publicCertificate, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -64550,7 +64817,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -64580,7 +64847,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -64593,7 +64860,43 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -64613,10 +64916,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a hostname binding for an app. + /// Starts an app (or deployment slot, if specified). /// /// - /// Description for Deletes a hostname binding for an app. + /// Description for Starts an app (or deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -64625,11 +64928,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. - /// - /// - /// Public certificate name. + /// Name of the deployment slot. If a slot is not specified, the API will start + /// the production slot. /// /// /// Headers that will be added to request. @@ -64649,7 +64949,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeletePublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StartSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64678,10 +64978,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (publicCertificateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -64700,17 +64996,15 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeletePublicCertificateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -64724,7 +65018,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -64775,7 +65069,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -64820,25 +65114,57 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the publishing profile for an app (or deployment slot, if specified). + /// Start capturing network packets for the site. /// /// - /// Description for Gets the publishing profile for an app (or deployment slot, - /// if specified). + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Specifies publishingProfileOptions for publishing profile. For example, use - /// {"format": "FileZilla3"} to get a FileZilla publishing profile. + /// + /// The name of the slot for this web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> StartNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginStartNetworkTraceSlotWithHttpMessagesAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stops an app (or deployment slot, if specified). + /// + /// + /// Description for Stops an app (or deployment slot, if specified). + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the publishing profile for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will stop + /// the production slot. /// /// /// Headers that will be added to request. @@ -64849,9 +65175,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -64861,7 +65184,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListPublishingProfileXmlWithSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64886,10 +65209,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publishingProfileOptions == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publishingProfileOptions"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -64911,14 +65230,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publishingProfileOptions", publishingProfileOptions); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublishingProfileXmlWithSecretsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -64966,12 +65284,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(publishingProfileOptions != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publishingProfileOptions, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -64984,7 +65296,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -65022,18 +65334,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) - { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -65042,22 +65349,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Resets the configuration settings of the current slot if they were - /// previously modified by calling the API with POST. + /// Stop ongoing capturing network packets for the site. /// /// - /// Description for Resets the configuration settings of the current slot if - /// they were previously modified by calling the API with POST. + /// Description for Stop ongoing capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API resets - /// configuration settings for the production slot. + /// The name of the slot for this web app. /// /// /// Headers that will be added to request. @@ -65077,7 +65381,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ResetSlotConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -65125,11 +65429,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ResetSlotConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopNetworkTraceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -65197,7 +65501,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -65242,28 +65546,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restarts an app (or deployment slot, if specified). + /// Sync web app repository. /// /// - /// Description for Restarts an app (or deployment slot, if specified). + /// Description for Sync web app repository. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restart the production slot. - /// - /// - /// Specify true to apply the configuration settings and restarts the app only - /// if necessary. By default, the API always restarts and reprovisions the app. - /// - /// - /// Specify true to block until the app is restarted. By default, it is set to - /// false, and the API responds immediately (asynchronous). + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -65283,7 +65579,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RestartSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, bool? softRestart = default(bool?), bool? synchronous = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncRepositorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -65330,27 +65626,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("softRestart", softRestart); - tracingParameters.Add("synchronous", synchronous); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RestartSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncRepositorySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (softRestart != null) - { - _queryParameters.Add(string.Format("softRestart={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softRestart, Client.SerializationSettings).Trim('"')))); - } - if (synchronous != null) - { - _queryParameters.Add(string.Format("synchronous={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(synchronous, Client.SerializationSettings).Trim('"')))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -65458,10 +65744,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores an app from a backup blob in Azure Storage. + /// Syncs function trigger metadata to the management database /// /// - /// Description for Restores an app from a backup blob in Azure Storage. + /// Description for Syncs function trigger metadata to the management database /// /// /// Name of the resource group to which the resource belongs. @@ -65469,107 +65755,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Information on restore request . - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restore a backup of the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreFromBackupBlobSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreFromBackupBlobSlotWithHttpMessagesAsync(resourceGroupName, name, request, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Restores a deleted web app to this web app. - /// - /// - /// Description for Restores a deleted web app to this web app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Deleted web app restore information. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreFromDeletedAppSlotWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreFromDeletedAppSlotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Restores a web app from a snapshot. - /// - /// - /// Description for Restores a web app from a snapshot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Snapshot restore settings. Snapshot information can be obtained by calling - /// GetDeletedSites or GetSiteSnapshots API. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreSnapshotSlotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get list of siteextensions for a web site, or a deployment slot. - /// - /// - /// Description for Get list of siteextensions for a web site, or a deployment - /// slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -65580,9 +65767,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -65592,7 +65776,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteExtensionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncFunctionTriggersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -65640,11 +65824,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionTriggersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -65661,7 +65845,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -65712,7 +65896,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -65742,31 +65926,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -65775,12 +65941,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get site extension information by its ID for a web site, or a deployment - /// slot. + /// List triggered web jobs for an app, or a deployment slot. /// /// - /// Description for Get site extension information by its ID for a web site, or - /// a deployment slot. + /// Description for List triggered web jobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -65788,12 +65952,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Site extension name. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -65816,7 +65977,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListTriggeredWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -65841,10 +66002,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -65866,17 +66023,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSiteExtensionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -65942,7 +66097,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -65972,7 +66127,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -65985,7 +66140,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -66005,10 +66160,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Install site extension on a web site, or a deployment slot. + /// Gets a triggered web job by its ID for an app, or a deployment slot. /// /// - /// Description for Install site extension on a web site, or a deployment slot. + /// Description for Gets a triggered web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -66016,47 +66172,14 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Site extension name. + /// + /// Name of Web Job. /// /// /// Name of the deployment slot. If a slot is not specified, the API uses the /// production slot. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> InstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginInstallSiteExtensionSlotWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Remove a site extension from a web site, or a deployment slot. - /// - /// - /// Description for Remove a site extension from a web site, or a deployment - /// slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// - /// - /// Site extension name. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. - /// - /// /// Headers that will be added to request. /// /// @@ -66065,6 +66188,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -66074,7 +66200,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66099,9 +66225,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (slot == null) { @@ -66124,17 +66250,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSiteExtensionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -66149,7 +66275,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -66200,7 +66326,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -66230,13 +66356,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -66245,24 +66389,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the difference in configuration settings between two web app slots. + /// Delete a triggered web job by its ID for an app, or a deployment slot. /// /// - /// Description for Get the difference in configuration settings between two - /// web app slots. + /// Description for Delete a triggered web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// JSON object that contains the target slot name. See example. + /// + /// Name of Web Job. /// /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes + /// web job for the production slot. /// /// /// Headers that will be added to request. @@ -66273,9 +66417,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -66285,7 +66426,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSlotDifferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66310,13 +66451,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); - } - if (slotSwapEntity != null) + if (webJobName == null) { - slotSwapEntity.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (slot == null) { @@ -66339,16 +66476,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlotDifferencesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteTriggeredWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -66363,7 +66501,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -66394,12 +66532,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -66420,7 +66552,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -66450,31 +66582,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -66483,51 +66597,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Swaps two deployment slots of an app. + /// List a triggered web job's history for an app, or a deployment slot. /// /// - /// Description for Swaps two deployment slots of an app. + /// Description for List a triggered web job's history for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task SwapSlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginSwapSlotSlotWithHttpMessagesAsync(resourceGroupName, name, slotSwapEntity, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns all Snapshots to the user. - /// - /// - /// Description for Returns all Snapshots to the user. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Site name. /// - /// - /// Website Name. + /// + /// Name of Web Job. /// /// - /// Website Slot. + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -66550,7 +66637,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSnapshotsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListTriggeredWebJobHistorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66575,6 +66662,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -66596,15 +66687,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobHistorySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -66670,7 +66763,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -66700,7 +66793,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -66713,7 +66806,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -66733,20 +66826,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Returns all Snapshots to the user from DRSecondary endpoint. + /// Gets a triggered web job's history by its ID for an app, , or a deployment + /// slot. /// /// - /// Description for Returns all Snapshots to the user from DRSecondary - /// endpoint. + /// Description for Gets a triggered web job's history by its ID for an app, , + /// or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Website Name. + /// Site name. + /// + /// + /// Name of Web Job. + /// + /// + /// History ID. /// /// - /// Website Slot. + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -66769,7 +66870,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSnapshotsFromDRSecondarySlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetTriggeredWebJobHistorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66794,6 +66895,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -66815,15 +66924,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsFromDRSecondarySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobHistorySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -66889,7 +67002,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -66919,7 +67032,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -66932,7 +67045,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -66952,20 +67065,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the source control configuration of an app. + /// Run a triggered web job for an app, or a deployment slot. /// /// - /// Description for Gets the source control configuration of an app. + /// Description for Run a triggered web job for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// Name of Web Job. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the source control configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -66976,9 +67092,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -66988,7 +67101,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RunTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -67013,6 +67126,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -67034,15 +67151,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSourceControlSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RunTriggeredWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -67057,7 +67176,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -67108,7 +67227,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -67138,67 +67257,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -67207,42 +67272,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. - /// - /// - /// Description for Updates the source control configuration of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON representation of a SiteSourceControl object. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the source control configuration for the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateSourceControlSlotWithHttpMessagesAsync(resourceGroupName, name, siteSourceControl, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes the source control configuration of an app. + /// Gets the quota usage information of an app (or deployment slot, if + /// specified). /// /// - /// Description for Deletes the source control configuration of an app. + /// Description for Gets the quota usage information of an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -67251,10 +67286,14 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the source control configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// quota information of the production slot. /// - /// + /// + /// Return only information specified in the filter (using OData syntax). For + /// example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and + /// startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and + /// timeGrain eq duration'[Hour|Minute|Day]'. /// /// /// Headers that will be added to request. @@ -67265,6 +67304,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -67274,7 +67316,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string additionalFlags = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListUsagesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -67321,21 +67363,21 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("additionalFlags", additionalFlags); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSourceControlSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListUsagesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (additionalFlags != null) + if (filter != null) { - _queryParameters.Add(string.Format("additionalFlags={0}", System.Uri.EscapeDataString(additionalFlags))); + _queryParameters.Add(string.Format("$filter={0}", filter)); } if (Client.ApiVersion != null) { @@ -67348,7 +67390,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -67399,7 +67441,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -67429,13 +67471,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -67444,10 +67504,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Gets the virtual networks the app (or deployment slot) is connected to. /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Gets the virtual networks the app (or deployment slot) is + /// connected to. /// /// /// Name of the resource group to which the resource belongs. @@ -67455,12 +67516,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteSourceControl object. See example. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the source control configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// virtual network connections for the production slot. /// /// /// Headers that will be added to request. @@ -67483,7 +67541,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVnetConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -67508,10 +67566,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteSourceControl == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -67533,14 +67587,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteSourceControl", siteSourceControl); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSourceControlSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVnetConnectionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -67557,7 +67610,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -67588,12 +67641,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteSourceControl != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -67614,7 +67661,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -67644,7 +67691,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -67657,43 +67704,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -67713,10 +67724,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Starts an app (or deployment slot, if specified). + /// Gets a virtual network the app (or deployment slot) is connected to by + /// name. /// /// - /// Description for Starts an app (or deployment slot, if specified). + /// Description for Gets a virtual network the app (or deployment slot) is + /// connected to by name. /// /// /// Name of the resource group to which the resource belongs. @@ -67724,9 +67737,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the virtual network. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will start - /// the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the named virtual network for the production slot. /// /// /// Headers that will be added to request. @@ -67737,6 +67753,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -67746,7 +67765,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -67771,6 +67790,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -67792,15 +67815,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -67815,7 +67840,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -67896,13 +67921,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -67911,57 +67954,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Adds a Virtual Network connection to an app or slot (PUT) or updates the + /// connection properties (PATCH). /// /// - /// Description for Start capturing network packets for the site. + /// Description for Adds a Virtual Network connection to an app or slot (PUT) + /// or updates the connection properties (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// Name of the app. /// - public async Task>> StartNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginStartNetworkTraceSlotWithHttpMessagesAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stops an app (or deployment slot, if specified). - /// - /// - /// Description for Stops an app (or deployment slot, if specified). - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Name of an existing Virtual Network. /// - /// - /// Name of the app. + /// + /// Properties of the Virtual Network connection. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will stop - /// the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update connections for the production slot. /// /// /// Headers that will be added to request. @@ -67972,6 +67986,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -67981,7 +67998,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68006,6 +68023,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68027,15 +68052,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -68050,7 +68078,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68081,6 +68109,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -68131,13 +68165,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -68146,19 +68198,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Stop ongoing capturing network packets for the site. + /// Deletes a connection from an app (or deployment slot to a named virtual + /// network. /// /// - /// Description for Stop ongoing capturing network packets for the site. + /// Description for Deletes a connection from an app (or deployment slot to a + /// named virtual network. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. + /// + /// + /// Name of the virtual network. /// /// - /// The name of the slot for this web app. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the connection for the production slot. /// /// /// Headers that will be added to request. @@ -68178,7 +68236,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68203,6 +68261,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68224,15 +68286,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopNetworkTraceSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteVnetConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -68247,7 +68311,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68298,7 +68362,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -68343,20 +68407,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Sync web app repository. + /// Adds a Virtual Network connection to an app or slot (PUT) or updates the + /// connection properties (PATCH). /// /// - /// Description for Sync web app repository. + /// Description for Adds a Virtual Network connection to an app or slot (PUT) + /// or updates the connection properties (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Name of an existing Virtual Network. + /// + /// + /// Properties of the Virtual Network connection. See example. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update connections for the production slot. /// /// /// Headers that will be added to request. @@ -68367,6 +68439,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -68376,7 +68451,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncRepositorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68401,6 +68476,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68422,15 +68505,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncRepositorySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -68445,7 +68531,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68476,6 +68562,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -68526,13 +68618,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -68541,10 +68651,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Syncs function trigger metadata to the management database + /// Gets an app's Virtual Network gateway. /// /// - /// Description for Syncs function trigger metadata to the management database + /// Description for Gets an app's Virtual Network gateway. /// /// /// Name of the resource group to which the resource belongs. @@ -68552,8 +68662,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will get a + /// gateway for the production slot's Virtual Network. /// /// /// Headers that will be added to request. @@ -68564,6 +68681,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -68573,7 +68693,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncFunctionTriggersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68598,6 +68718,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68619,15 +68747,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionTriggersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionGatewaySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -68642,7 +68774,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68693,7 +68825,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -68723,13 +68855,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -68738,20 +68888,30 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List triggered web jobs for an app, or a deployment slot. + /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). /// /// - /// Description for List triggered web jobs for an app, or a deployment slot. + /// Description for Adds a gateway to a connected Virtual Network (PUT) or + /// updates it (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// The properties to update this gateway with. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update a gateway for the production slot's Virtual Network. /// /// /// Headers that will be added to request. @@ -68774,7 +68934,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTriggeredWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68799,6 +68959,22 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (connectionEnvelope != null) + { + connectionEnvelope.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68820,15 +68996,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionGatewaySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -68843,7 +69024,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68874,6 +69055,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -68924,7 +69111,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -68937,7 +69124,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -68957,24 +69144,30 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a triggered web job by its ID for an app, or a deployment slot. + /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). /// /// - /// Description for Gets a triggered web job by its ID for an app, or a - /// deployment slot. + /// Description for Adds a gateway to a connected Virtual Network (PUT) or + /// updates it (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// The properties to update this gateway with. /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update a gateway for the production slot's Virtual Network. /// /// /// Headers that will be added to request. @@ -68997,7 +69190,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69022,9 +69215,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (slot == null) { @@ -69047,17 +69248,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionGatewaySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -69072,7 +69276,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -69103,6 +69307,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -69123,7 +69333,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -69153,7 +69363,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -69166,7 +69376,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -69186,11 +69396,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a triggered web job by its ID for an app, or a deployment slot. + /// List webjobs for an app, or a deployment slot. /// /// - /// Description for Delete a triggered web job by its ID for an app, or a - /// deployment slot. + /// Description for List webjobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -69198,12 +69407,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Name of Web Job. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes - /// web job for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -69214,6 +69420,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -69223,7 +69432,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69248,10 +69457,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -69273,17 +69478,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteTriggeredWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebJobsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -69298,7 +69501,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -69349,7 +69552,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -69379,13 +69582,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -69394,11 +69615,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List a triggered web job's history for an app, or a deployment slot. + /// Get webjob information for an app, or a deployment slot. /// /// - /// Description for List a triggered web job's history for an app, or a - /// deployment slot. + /// Description for Get webjob information for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -69407,11 +69627,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Site name. /// /// - /// Name of Web Job. + /// Name of the web job. /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -69434,7 +69654,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTriggeredWebJobHistorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69487,11 +69707,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobHistorySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); @@ -69560,7 +69780,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -69590,7 +69810,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -69603,7 +69823,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -69623,28 +69843,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a triggered web job's history by its ID for an app, , or a deployment - /// slot. + /// Get the difference in configuration settings between two web app slots. /// /// - /// Description for Gets a triggered web job's history by its ID for an app, , - /// or a deployment slot. + /// Description for Get the difference in configuration settings between two + /// web app slots. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. - /// - /// - /// History ID. + /// Name of the app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// + /// JSON object that contains the target slot name. See example. /// /// /// Headers that will be added to request. @@ -69667,7 +69879,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTriggeredWebJobHistorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSlotDifferencesFromProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69692,17 +69904,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } - if (id == null) + if (slotSwapEntity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); } - if (slot == null) + if (slotSwapEntity != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + slotSwapEntity.Validate(); } if (Client.SubscriptionId == null) { @@ -69721,20 +69929,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); - tracingParameters.Add("id", id); - tracingParameters.Add("slot", slot); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobHistorySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlotDifferencesFromProduction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -69748,7 +69951,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -69779,6 +69982,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -69799,7 +70008,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -69829,7 +70038,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -69842,7 +70051,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -69862,23 +70071,44 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Run a triggered web job for an app, or a deployment slot. + /// Swaps two deployment slots of an app. /// /// - /// Description for Run a triggered web job for an app, or a deployment slot. + /// Description for Swaps two deployment slots of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// JSON object that contains the target slot name. See example. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task SwapSlotWithProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginSwapSlotWithProductionWithHttpMessagesAsync(resourceGroupName, name, slotSwapEntity, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns all Snapshots to the user. + /// + /// + /// Description for Returns all Snapshots to the user. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Website Name. /// /// /// Headers that will be added to request. @@ -69889,6 +70119,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -69898,7 +70131,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RunTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSnapshotsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69923,14 +70156,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -69948,18 +70173,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RunTriggeredWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSnapshots", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -69973,7 +70194,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -70024,7 +70245,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70054,13 +70275,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -70069,28 +70308,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the quota usage information of an app (or deployment slot, if - /// specified). + /// Returns all Snapshots to the user from DRSecondary endpoint. /// /// - /// Description for Gets the quota usage information of an app (or deployment - /// slot, if specified). + /// Description for Returns all Snapshots to the user from DRSecondary + /// endpoint. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// quota information of the production slot. - /// - /// - /// Return only information specified in the filter (using OData syntax). For - /// example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and - /// startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and - /// timeGrain eq duration'[Hour|Minute|Day]'. + /// Website Name. /// /// /// Headers that will be added to request. @@ -70113,7 +70341,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListUsagesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSnapshotsFromDRSecondaryWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -70138,10 +70366,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -70159,23 +70383,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsagesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsFromDRSecondary", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -70268,7 +70485,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -70281,7 +70498,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -70301,11 +70518,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the virtual networks the app (or deployment slot) is connected to. + /// Gets the source control configuration of an app. /// /// - /// Description for Gets the virtual networks the app (or deployment slot) is - /// connected to. + /// Description for Gets the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -70313,10 +70529,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// virtual network connections for the production slot. - /// /// /// Headers that will be added to request. /// @@ -70338,7 +70550,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVnetConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -70363,10 +70575,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -70384,16 +70592,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVnetConnectionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSourceControl", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -70458,7 +70664,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70488,7 +70694,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -70501,7 +70707,43 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -70521,12 +70763,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a virtual network the app (or deployment slot) is connected to by - /// name. + /// Updates the source control configuration of an app. /// /// - /// Description for Gets a virtual network the app (or deployment slot) is - /// connected to by name. + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -70534,12 +70774,33 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the virtual network. + /// + /// JSON representation of a SiteSourceControl object. See example. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the named virtual network for the production slot. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateSourceControlWithHttpMessagesAsync(resourceGroupName, name, siteSourceControl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the source control configuration of an app. + /// + /// + /// Description for Deletes the source control configuration of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. /// /// /// Headers that will be added to request. @@ -70550,9 +70811,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -70562,7 +70820,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -70587,14 +70845,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -70612,18 +70862,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSourceControl", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -70637,7 +70883,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -70688,7 +70934,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70718,31 +70964,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -70751,12 +70979,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a Virtual Network connection to an app or slot (PUT) or updates the - /// connection properties (PATCH). + /// Updates the source control configuration of an app. /// /// - /// Description for Adds a Virtual Network connection to an app or slot (PUT) - /// or updates the connection properties (PATCH). + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -70764,15 +70990,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of an existing Virtual Network. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. + /// + /// JSON representation of a SiteSourceControl object. See example. /// /// /// Headers that will be added to request. @@ -70795,7 +71014,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -70820,17 +71039,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } - if (slot == null) + if (siteSourceControl == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); } if (Client.SubscriptionId == null) { @@ -70849,19 +71060,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); - tracingParameters.Add("slot", slot); + tracingParameters.Add("siteSourceControl", siteSourceControl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSourceControl", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -70875,7 +71082,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -70906,9 +71113,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) + if(siteSourceControl != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -70932,7 +71139,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70962,7 +71169,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -70975,7 +71182,43 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -70995,12 +71238,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a connection from an app (or deployment slot to a named virtual - /// network. + /// Starts an app (or deployment slot, if specified). /// /// - /// Description for Deletes a connection from an app (or deployment slot to a - /// named virtual network. + /// Description for Starts an app (or deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -71008,13 +71249,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the virtual network. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the connection for the production slot. - /// /// /// Headers that will be added to request. /// @@ -71033,7 +71267,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StartWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71058,14 +71292,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -71083,18 +71309,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteVnetConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Start", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71108,7 +71330,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71159,7 +71381,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -71204,28 +71426,50 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a Virtual Network connection to an app or slot (PUT) or updates the - /// connection properties (PATCH). + /// Start capturing network packets for the site. /// /// - /// Description for Adds a Virtual Network connection to an app or slot (PUT) - /// or updates the connection properties (PATCH). + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of an existing Virtual Network. + /// + /// The duration to keep capturing in seconds. /// - /// - /// Properties of the Virtual Network connection. See example. + /// + /// The maximum frame length in bytes (Optional). /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. + /// + /// The Blob URL to store capture file. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> StartNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginStartNetworkTraceWithHttpMessagesAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stops an app (or deployment slot, if specified). + /// + /// + /// Description for Stops an app (or deployment slot, if specified). + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. /// /// /// Headers that will be added to request. @@ -71236,9 +71480,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -71248,7 +71489,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71273,18 +71514,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -71302,19 +71531,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Stop", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71328,7 +71552,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71359,12 +71583,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -71415,31 +71633,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -71448,26 +71648,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets an app's Virtual Network gateway. + /// Stop ongoing capturing network packets for the site. /// /// - /// Description for Gets an app's Virtual Network gateway. + /// Description for Stop ongoing capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get a - /// gateway for the production slot's Virtual Network. + /// The name of the web app. /// /// /// Headers that will be added to request. @@ -71478,9 +71668,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -71490,7 +71677,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71515,18 +71702,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -71544,20 +71719,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionGatewaySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopNetworkTrace", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71571,7 +71740,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71622,7 +71791,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -71652,31 +71821,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -71685,30 +71836,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Sync web app repository. /// /// - /// Description for Adds a gateway to a connected Virtual Network (PUT) or - /// updates it (PATCH). + /// Description for Sync web app repository. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". - /// - /// - /// The properties to update this gateway with. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update a gateway for the production slot's Virtual Network. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -71719,9 +71856,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -71731,7 +71865,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncRepositoryWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71756,26 +71890,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } - if (connectionEnvelope != null) - { - connectionEnvelope.Validate(); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -71793,21 +71907,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionGatewaySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncRepository", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71821,7 +71928,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71852,12 +71959,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -71908,31 +72009,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -71941,11 +72024,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Syncs function trigger metadata to the management database /// /// - /// Description for Adds a gateway to a connected Virtual Network (PUT) or - /// updates it (PATCH). + /// Description for Syncs function trigger metadata to the management database /// /// /// Name of the resource group to which the resource belongs. @@ -71953,19 +72035,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". - /// - /// - /// The properties to update this gateway with. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update a gateway for the production slot's Virtual Network. - /// /// /// Headers that will be added to request. /// @@ -71975,9 +72044,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -71987,7 +72053,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncFunctionTriggersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72012,22 +72078,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -72045,21 +72095,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionGatewaySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionTriggers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72073,7 +72116,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -72104,12 +72147,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -72130,7 +72167,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -72160,31 +72197,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -72193,10 +72212,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List webjobs for an app, or a deployment slot. + /// List triggered web jobs for an app, or a deployment slot. /// /// - /// Description for List webjobs for an app, or a deployment slot. + /// Description for List triggered web jobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -72204,10 +72223,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. - /// /// /// Headers that will be added to request. /// @@ -72229,7 +72244,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListTriggeredWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72254,10 +72269,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -72275,16 +72286,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebJobsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobs", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72379,7 +72388,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -72392,7 +72401,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -72412,10 +72421,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get webjob information for an app, or a deployment slot. + /// Gets a triggered web job by its ID for an app, or a deployment slot. /// /// - /// Description for Get webjob information for an app, or a deployment slot. + /// Description for Gets a triggered web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -72424,11 +72434,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Site name. /// /// - /// Name of the web job. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -72451,7 +72457,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72480,10 +72486,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -72502,17 +72504,15 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("webJobName", webJobName); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72577,7 +72577,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -72607,7 +72607,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -72620,7 +72620,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -72640,20 +72640,218 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the difference in configuration settings between two web app slots. + /// Delete a triggered web job by its ID for an app, or a deployment slot. /// /// - /// Description for Get the difference in configuration settings between two - /// web app slots. + /// Description for Delete a triggered web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// JSON object that contains the target slot name. See example. + /// + /// Name of Web Job. + /// + /// + /// 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 DeleteTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "DeleteTriggeredWebJob", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// List a triggered web job's history for an app, or a deployment slot. + /// + /// + /// Description for List a triggered web job's history for an app, or a + /// deployment slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -72676,7 +72874,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSlotDifferencesFromProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListTriggeredWebJobHistoryWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72701,13 +72899,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); - } - if (slotSwapEntity != null) + if (webJobName == null) { - slotSwapEntity.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -72726,15 +72920,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlotDifferencesFromProduction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobHistory", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72748,7 +72943,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -72779,12 +72974,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -72805,7 +72994,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -72835,7 +73024,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -72848,7 +73037,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -72868,44 +73057,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Swaps two deployment slots of an app. + /// Gets a triggered web job's history by its ID for an app, , or a deployment + /// slot. /// /// - /// Description for Swaps two deployment slots of an app. + /// Description for Gets a triggered web job's history by its ID for an app, , + /// or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// Site name. /// - public async Task SwapSlotWithProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginSwapSlotWithProductionWithHttpMessagesAsync(resourceGroupName, name, slotSwapEntity, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns all Snapshots to the user. - /// - /// - /// Description for Returns all Snapshots to the user. - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Name of Web Job. /// - /// - /// Website Name. + /// + /// History ID. /// /// /// Headers that will be added to request. @@ -72928,7 +73097,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSnapshotsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetTriggeredWebJobHistoryWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72953,6 +73122,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -72970,14 +73147,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSnapshots", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobHistory", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -73042,7 +73223,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73072,7 +73253,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -73085,7 +73266,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -73105,17 +73286,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Returns all Snapshots to the user from DRSecondary endpoint. + /// Run a triggered web job for an app, or a deployment slot. /// /// - /// Description for Returns all Snapshots to the user from DRSecondary - /// endpoint. + /// Description for Run a triggered web job for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Website Name. + /// Site name. + /// + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -73126,9 +73309,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -73138,7 +73318,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSnapshotsFromDRSecondaryWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RunTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73163,6 +73343,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -73180,14 +73364,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsFromDRSecondary", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RunTriggeredWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -73201,7 +73387,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -73252,7 +73438,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73282,31 +73468,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -73315,10 +73483,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the source control configuration of an app. + /// Gets the quota usage information of an app (or deployment slot, if + /// specified). /// /// - /// Description for Gets the source control configuration of an app. + /// Description for Gets the quota usage information of an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -73326,6 +73496,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Return only information specified in the filter (using OData syntax). For + /// example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and + /// startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and + /// timeGrain eq duration'[Hour|Minute|Day]'. + /// /// /// Headers that will be added to request. /// @@ -73347,7 +73523,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73389,16 +73565,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSourceControl", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -73461,7 +73642,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73491,7 +73672,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -73504,43 +73685,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -73560,38 +73705,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. - /// - /// - /// Description for Updates the source control configuration of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON representation of a SiteSourceControl object. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateSourceControlWithHttpMessagesAsync(resourceGroupName, name, siteSourceControl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes the source control configuration of an app. + /// Gets the virtual networks the app (or deployment slot) is connected to. /// /// - /// Description for Deletes the source control configuration of an app. + /// Description for Gets the virtual networks the app (or deployment slot) is + /// connected to. /// /// /// Name of the resource group to which the resource belongs. @@ -73599,8 +73717,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// /// /// Headers that will be added to request. /// @@ -73610,6 +73726,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -73619,7 +73738,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, string additionalFlags = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVnetConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73661,21 +73780,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("additionalFlags", additionalFlags); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSourceControl", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVnetConnections", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (additionalFlags != null) - { - _queryParameters.Add(string.Format("additionalFlags={0}", System.Uri.EscapeDataString(additionalFlags))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -73687,7 +73801,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -73738,7 +73852,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73768,13 +73882,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -73783,10 +73915,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Gets a virtual network the app (or deployment slot) is connected to by + /// name. /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Gets a virtual network the app (or deployment slot) is + /// connected to by name. /// /// /// Name of the resource group to which the resource belongs. @@ -73794,8 +73928,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteSourceControl object. See example. + /// + /// Name of the virtual network. /// /// /// Headers that will be added to request. @@ -73818,7 +73952,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73843,9 +73977,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteSourceControl == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); } if (Client.SubscriptionId == null) { @@ -73864,15 +73998,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteSourceControl", siteSourceControl); + tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSourceControl", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -73886,7 +74021,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -73917,12 +74052,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteSourceControl != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -73943,7 +74072,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73973,7 +74102,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -73986,43 +74115,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -74042,10 +74135,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Starts an app (or deployment slot, if specified). + /// Adds a Virtual Network connection to an app or slot (PUT) or updates the + /// connection properties (PATCH). /// /// - /// Description for Starts an app (or deployment slot, if specified). + /// Description for Adds a Virtual Network connection to an app or slot (PUT) + /// or updates the connection properties (PATCH). /// /// /// Name of the resource group to which the resource belongs. @@ -74053,6 +74148,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of an existing Virtual Network. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// /// /// Headers that will be added to request. /// @@ -74062,6 +74163,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -74071,7 +74175,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74096,6 +74200,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -74113,14 +74225,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Start", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74134,7 +74249,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74165,6 +74280,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -74215,13 +74336,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -74230,44 +74369,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. - /// - /// - /// Description for Start capturing network packets for the site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> StartNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginStartNetworkTraceWithHttpMessagesAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stops an app (or deployment slot, if specified). + /// Deletes a connection from an app (or deployment slot to a named virtual + /// network. /// /// - /// Description for Stops an app (or deployment slot, if specified). + /// Description for Deletes a connection from an app (or deployment slot to a + /// named virtual network. /// /// /// Name of the resource group to which the resource belongs. @@ -74275,6 +74382,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the virtual network. + /// /// /// Headers that will be added to request. /// @@ -74293,7 +74403,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74318,6 +74428,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -74335,14 +74449,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Stop", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteVnetConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74356,7 +74472,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74407,7 +74523,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -74452,16 +74568,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Stop ongoing capturing network packets for the site. + /// Adds a Virtual Network connection to an app or slot (PUT) or updates the + /// connection properties (PATCH). /// /// - /// Description for Stop ongoing capturing network packets for the site. + /// Description for Adds a Virtual Network connection to an app or slot (PUT) + /// or updates the connection properties (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. + /// + /// + /// Name of an existing Virtual Network. + /// + /// + /// Properties of the Virtual Network connection. See example. /// /// /// Headers that will be added to request. @@ -74472,6 +74596,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -74481,7 +74608,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74506,6 +74633,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -74523,14 +74658,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopNetworkTrace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74544,7 +74682,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74575,6 +74713,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -74595,7 +74739,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -74625,13 +74769,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -74640,16 +74802,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Sync web app repository. + /// Gets an app's Virtual Network gateway. /// /// - /// Description for Sync web app repository. + /// Description for Gets an app's Virtual Network gateway. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". /// /// /// Headers that will be added to request. @@ -74660,6 +74828,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -74669,7 +74840,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncRepositoryWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74694,6 +74865,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -74711,14 +74890,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncRepository", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionGateway", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74732,7 +74915,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74783,7 +74966,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -74813,13 +74996,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -74828,10 +75029,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Syncs function trigger metadata to the management database + /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). /// /// - /// Description for Syncs function trigger metadata to the management database + /// Description for Adds a gateway to a connected Virtual Network (PUT) or + /// updates it (PATCH). /// /// /// Name of the resource group to which the resource belongs. @@ -74839,6 +75041,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// The properties to update this gateway with. + /// /// /// Headers that will be added to request. /// @@ -74848,6 +75059,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -74857,7 +75071,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncFunctionTriggersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74882,6 +75096,22 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (connectionEnvelope != null) + { + connectionEnvelope.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -74899,14 +75129,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionTriggers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionGateway", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74920,7 +75155,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74951,6 +75186,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -74971,7 +75212,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -75001,13 +75242,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -75016,16 +75275,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List triggered web jobs for an app, or a deployment slot. + /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). /// /// - /// Description for List triggered web jobs for an app, or a deployment slot. + /// Description for Adds a gateway to a connected Virtual Network (PUT) or + /// updates it (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// The properties to update this gateway with. /// /// /// Headers that will be added to request. @@ -75048,7 +75317,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTriggeredWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75073,6 +75342,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -75090,14 +75371,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionGateway", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -75111,7 +75397,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -75142,6 +75428,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -75192,7 +75484,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -75205,7 +75497,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -75225,11 +75517,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a triggered web job by its ID for an app, or a deployment slot. + /// List webjobs for an app, or a deployment slot. /// /// - /// Description for Gets a triggered web job by its ID for an app, or a - /// deployment slot. + /// Description for List webjobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -75237,9 +75528,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Name of Web Job. - /// /// /// Headers that will be added to request. /// @@ -75261,7 +75549,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75286,10 +75574,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -75307,16 +75591,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebJobs", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -75381,7 +75663,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -75411,7 +75693,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -75424,7 +75706,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -75444,11 +75726,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a triggered web job by its ID for an app, or a deployment slot. + /// Get webjob information for an app, or a deployment slot. /// /// - /// Description for Delete a triggered web job by its ID for an app, or a - /// deployment slot. + /// Description for Get webjob information for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -75457,7 +75738,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Site name. /// /// - /// Name of Web Job. + /// Name of the web job. /// /// /// Headers that will be added to request. @@ -75468,6 +75749,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -75477,7 +75761,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75525,11 +75809,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteTriggeredWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); @@ -75546,7 +75830,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -75597,7 +75881,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -75627,13 +75911,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -75642,20 +75944,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List a triggered web job's history for an app, or a deployment slot. + /// Creates a new web, mobile, or API app in an existing resource group, or + /// updates an existing app. /// /// - /// Description for List a triggered web job's history for an app, or a - /// deployment slot. + /// Description for Creates a new web, mobile, or API app in an existing + /// resource group, or updates an existing app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Unique name of the app to create or update. To create or update a + /// deployment slot, use the {slot} parameter. /// - /// - /// Name of Web Job. + /// + /// A JSON representation of the app properties. See example. /// /// /// Headers that will be added to request. @@ -75678,7 +75982,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTriggeredWebJobHistoryWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75703,9 +76007,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (siteEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); + } + if (siteEnvelope != null) + { + siteEnvelope.Validate(); } if (Client.SubscriptionId == null) { @@ -75724,16 +76032,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("siteEnvelope", siteEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobHistory", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -75747,7 +76054,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -75778,6 +76085,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -75798,7 +76111,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -75828,7 +76141,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -75841,7 +76154,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -75861,24 +76192,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a triggered web job's history by its ID for an app, , or a deployment - /// slot. + /// Restores a specific backup to another app (or deployment slot, if + /// specified). /// /// - /// Description for Gets a triggered web job's history by its ID for an app, , - /// or a deployment slot. + /// Description for Restores a specific backup to another app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// ID of the backup. /// - /// - /// History ID. + /// + /// Information on restore request . /// /// /// Headers that will be added to request. @@ -75889,9 +76220,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -75901,7 +76229,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTriggeredWebJobHistoryWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75926,13 +76254,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (backupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); } - if (id == null) + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); } if (Client.SubscriptionId == null) { @@ -75951,18 +76283,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); - tracingParameters.Add("id", id); + tracingParameters.Add("backupId", backupId); + tracingParameters.Add("request", request); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobHistory", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestore", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -75976,7 +76307,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76007,6 +76338,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -76027,7 +76364,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76057,31 +76394,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -76090,19 +76409,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Run a triggered web job for an app, or a deployment slot. + /// Gets the Git/FTP publishing credentials of an app. /// /// - /// Description for Run a triggered web job for an app, or a deployment slot. + /// Description for Gets the Git/FTP publishing credentials of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -76113,6 +76429,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -76122,7 +76441,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RunTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginListPublishingCredentialsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76147,10 +76466,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -76168,16 +76483,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RunTriggeredWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginListPublishingCredentials", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -76242,7 +76555,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76272,13 +76585,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -76287,24 +76618,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the quota usage information of an app (or deployment slot, if - /// specified). + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Gets the quota usage information of an app (or deployment - /// slot, if specified). + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// Return only information specified in the filter (using OData syntax). For - /// example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and - /// startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and - /// timeGrain eq duration'[Hour|Minute|Day]'. + /// + /// Details of MSDeploy operation /// /// /// Headers that will be added to request. @@ -76327,7 +76653,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76352,6 +76678,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (mSDeploy == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -76369,21 +76699,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("filter", filter); + tracingParameters.Add("mSDeploy", mSDeploy); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateMSDeployOperation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -76395,7 +76721,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76426,6 +76752,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(mSDeploy != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -76446,7 +76778,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 409) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76476,7 +76808,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -76484,12 +76816,12 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 200) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -76509,17 +76841,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the virtual networks the app (or deployment slot) is connected to. + /// Create function for web site, or a deployment slot. /// /// - /// Description for Gets the virtual networks the app (or deployment slot) is - /// connected to. + /// Description for Create function for web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// Function name. + /// + /// + /// Function details. /// /// /// Headers that will be added to request. @@ -76542,7 +76879,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVnetConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76567,6 +76904,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (functionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -76584,14 +76929,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("functionEnvelope", functionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVnetConnections", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateFunction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -76605,7 +76953,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76636,6 +76984,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(functionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(functionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -76656,7 +77010,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76686,7 +77040,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -76694,12 +77048,12 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 200) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -76719,21 +77073,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a virtual network the app (or deployment slot) is connected to by - /// name. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Gets a virtual network the app (or deployment slot) is - /// connected to by name. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// Name of the virtual network. + /// + /// ID of web app instance. + /// + /// + /// Details of MSDeploy operation /// /// /// Headers that will be added to request. @@ -76756,7 +77111,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateInstanceMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76781,9 +77136,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } + if (mSDeploy == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); } if (Client.SubscriptionId == null) { @@ -76802,16 +77161,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("mSDeploy", mSDeploy); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceMSDeployOperation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -76825,7 +77185,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76856,6 +77216,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(mSDeploy != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -76876,7 +77242,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 409) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76906,7 +77272,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -76914,12 +77280,12 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 200) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -76939,24 +77305,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a Virtual Network connection to an app or slot (PUT) or updates the - /// connection properties (PATCH). + /// Restores a web app. /// /// - /// Description for Adds a Virtual Network connection to an app or slot (PUT) - /// or updates the connection properties (PATCH). + /// Description for Restores a web app. /// + /// + /// Azure subscription. + /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of an existing Virtual Network. + /// Name of web app. /// - /// - /// Properties of the Virtual Network connection. See example. + /// + /// Migration migrationOptions. /// /// /// Headers that will be added to request. @@ -76979,8 +77343,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginMigrateStorageWithHttpMessagesAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (subscriptionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionName"); + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -77004,13 +77372,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) + if (migrationOptions == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + throw new ValidationException(ValidationRules.CannotBeNull, "migrationOptions"); } - if (connectionEnvelope == null) + if (migrationOptions != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + migrationOptions.Validate(); } if (Client.SubscriptionId == null) { @@ -77027,21 +77395,24 @@ internal WebAppsOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("subscriptionName", subscriptionName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("migrationOptions", migrationOptions); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateStorage", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (subscriptionName != null) + { + _queryParameters.Add(string.Format("subscriptionName={0}", System.Uri.EscapeDataString(subscriptionName))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -77084,9 +77455,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) + if(migrationOptions != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(migrationOptions, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -77140,7 +77511,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -77153,7 +77524,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -77173,21 +77544,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a connection from an app (or deployment slot to a named virtual - /// network. + /// Migrates a local (in-app) MySql database to a remote MySql database. /// /// - /// Description for Deletes a connection from an app (or deployment slot to a - /// named virtual network. + /// Description for Migrates a local (in-app) MySql database to a remote MySql + /// database. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// Name of the virtual network. + /// + /// MySql migration options. /// /// /// Headers that will be added to request. @@ -77198,6 +77568,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -77207,7 +77580,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginMigrateMySqlWithHttpMessagesAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -77232,9 +77605,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) + if (migrationRequestEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + throw new ValidationException(ValidationRules.CannotBeNull, "migrationRequestEnvelope"); + } + if (migrationRequestEnvelope != null) + { + migrationRequestEnvelope.Validate(); } if (Client.SubscriptionId == null) { @@ -77253,16 +77630,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("migrationRequestEnvelope", migrationRequestEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteVnetConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMySql", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -77276,7 +77652,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -77307,6 +77683,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(migrationRequestEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(migrationRequestEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -77327,7 +77709,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -77357,13 +77739,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -77372,24 +77772,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a Virtual Network connection to an app or slot (PUT) or updates the - /// connection properties (PATCH). + /// Start capturing network packets for the site. /// /// - /// Description for Adds a Virtual Network connection to an app or slot (PUT) - /// or updates the connection properties (PATCH). + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of an existing Virtual Network. + /// + /// The duration to keep capturing in seconds. /// - /// - /// Properties of the Virtual Network connection. See example. + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. /// /// /// Headers that will be added to request. @@ -77412,7 +77813,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -77437,14 +77838,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -77462,19 +77855,31 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginStartWebSiteNetworkTraceOperation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -77486,7 +77891,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -77517,12 +77922,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -77543,7 +77942,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -77573,7 +77972,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -77586,7 +77985,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -77606,10 +78023,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets an app's Virtual Network gateway. + /// Restores an app from a backup blob in Azure Storage. /// /// - /// Description for Gets an app's Virtual Network gateway. + /// Description for Restores an app from a backup blob in Azure Storage. /// /// /// Name of the resource group to which the resource belongs. @@ -77617,11 +78034,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// Information on restore request . /// /// /// Headers that will be added to request. @@ -77632,9 +78046,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -77644,7 +78055,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreFromBackupBlobWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -77669,13 +78080,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - if (gatewayName == null) + if (request != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + request.Validate(); } if (Client.SubscriptionId == null) { @@ -77694,18 +78105,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("request", request); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionGateway", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromBackupBlob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -77719,7 +78127,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -77750,6 +78158,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -77770,7 +78184,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -77800,31 +78214,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -77833,26 +78229,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Restores a deleted web app to this web app. /// /// - /// Description for Adds a gateway to a connected Virtual Network (PUT) or - /// updates it (PATCH). + /// Description for Restores a deleted web app to this web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". + /// Name of web app. /// - /// - /// The properties to update this gateway with. + /// + /// Deleted web app restore information. /// /// /// Headers that will be added to request. @@ -77863,9 +78252,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -77875,7 +78261,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreFromDeletedAppWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -77900,21 +78286,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } - if (connectionEnvelope != null) + if (restoreRequest == null) { - connectionEnvelope.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); } if (Client.SubscriptionId == null) { @@ -77933,19 +78307,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("restoreRequest", restoreRequest); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionGateway", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromDeletedApp", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -77959,7 +78329,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -77990,9 +78360,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) + if(restoreRequest != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -78016,7 +78386,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -78046,31 +78416,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -78079,26 +78431,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Restores a web app from a snapshot. /// /// - /// Description for Adds a gateway to a connected Virtual Network (PUT) or - /// updates it (PATCH). + /// Description for Restores a web app from a snapshot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". + /// Name of web app. /// - /// - /// The properties to update this gateway with. + /// + /// Snapshot restore settings. Snapshot information can be obtained by calling + /// GetDeletedSites or GetSiteSnapshots API. /// /// /// Headers that will be added to request. @@ -78109,9 +78455,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -78121,7 +78464,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78146,17 +78489,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) + if (restoreRequest == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); } - if (connectionEnvelope == null) + if (restoreRequest != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + restoreRequest.Validate(); } if (Client.SubscriptionId == null) { @@ -78175,19 +78514,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("restoreRequest", restoreRequest); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionGateway", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSnapshot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78201,7 +78536,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -78232,9 +78567,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) + if(restoreRequest != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -78258,7 +78593,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -78288,31 +78623,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -78321,10 +78638,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List webjobs for an app, or a deployment slot. + /// Install site extension on a web site, or a deployment slot. /// /// - /// Description for List webjobs for an app, or a deployment slot. + /// Description for Install site extension on a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -78332,6 +78649,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// Site extension name. + /// /// /// Headers that will be added to request. /// @@ -78353,7 +78673,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginInstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78378,6 +78698,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteExtensionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -78395,14 +78719,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebJobs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginInstallSiteExtension", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78416,7 +78742,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -78467,7 +78793,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 429) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -78497,7 +78823,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -78510,7 +78836,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -78530,19 +78874,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get webjob information for an app, or a deployment slot. + /// Copies a deployment slot to another deployment slot of an app. /// /// - /// Description for Get webjob information for an app, or a deployment slot. + /// Description for Copies a deployment slot to another deployment slot of an + /// app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of the web job. + /// + /// JSON object that contains the target slot name and site config properties + /// to override the source slot config. See example. /// /// /// Headers that will be added to request. @@ -78553,9 +78899,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -78565,7 +78908,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginCopyProductionSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78590,9 +78933,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (copySlotEntity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "copySlotEntity"); + } + if (copySlotEntity != null) + { + copySlotEntity.Validate(); } if (Client.SubscriptionId == null) { @@ -78611,16 +78958,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("copySlotEntity", copySlotEntity); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCopyProductionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78634,7 +78980,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -78665,6 +79011,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(copySlotEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(copySlotEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -78685,7 +79037,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -78715,31 +79067,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -78765,6 +79099,10 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A JSON representation of the app properties. See example. /// + /// + /// Name of the deployment slot to create or update. By default, this API + /// attempts to create or modify the production slot. + /// /// /// Headers that will be added to request. /// @@ -78786,7 +79124,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78819,6 +79157,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { siteEnvelope.Validate(); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -78837,14 +79179,16 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("siteEnvelope", siteEnvelope); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -79015,6 +79359,10 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Information on restore request . /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// restore a backup of the production slot. + /// /// /// Headers that will be added to request. /// @@ -79033,7 +79381,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79070,6 +79418,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { request.Validate(); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -79089,15 +79441,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("backupId", backupId); tracingParameters.Add("request", request); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestore", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -79224,6 +79578,10 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the publishing credentials for the production slot. + /// /// /// Headers that will be added to request. /// @@ -79245,7 +79603,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListPublishingCredentialsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginListPublishingCredentialsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79270,6 +79628,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -79287,14 +79649,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListPublishingCredentials", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginListPublishingCredentialsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -79433,6 +79797,10 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of web app. /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// /// /// Details of MSDeploy operation /// @@ -79457,7 +79825,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79482,6 +79850,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (mSDeploy == null) { throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); @@ -79503,15 +79875,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); tracingParameters.Add("mSDeploy", mSDeploy); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateMSDeployOperation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateMSDeployOperationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -79659,6 +80033,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Function name. /// + /// + /// Name of the deployment slot. + /// /// /// Function details. /// @@ -79683,7 +80060,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79712,6 +80089,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (functionEnvelope == null) { throw new ValidationException(ValidationRules.CannotBeNull, "functionEnvelope"); @@ -79734,16 +80115,18 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("functionName", functionName); + tracingParameters.Add("slot", slot); tracingParameters.Add("functionEnvelope", functionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateFunction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceFunctionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -79888,6 +80271,10 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of web app. /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// /// /// ID of web app instance. /// @@ -79915,7 +80302,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateInstanceMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79940,6 +80327,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -79965,16 +80356,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("mSDeploy", mSDeploy); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceMSDeployOperation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceMSDeployOperationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -80109,22 +80502,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a web app. + /// Start capturing network packets for the site. /// /// - /// Description for Restores a web app. + /// Description for Start capturing network packets for the site. /// - /// - /// Azure subscription. - /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// The name of the web app. /// - /// - /// Migration migrationOptions. + /// + /// The name of the slot for this web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. /// /// /// Headers that will be added to request. @@ -80147,12 +80546,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginMigrateStorageWithHttpMessagesAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> BeginStartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (subscriptionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionName"); - } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -80176,13 +80571,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (migrationOptions == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "migrationOptions"); - } - if (migrationOptions != null) + if (slot == null) { - migrationOptions.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -80199,23 +80590,34 @@ internal WebAppsOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("subscriptionName", subscriptionName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("migrationOptions", migrationOptions); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("slot", slot); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateStorage", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginStartWebSiteNetworkTraceOperationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (subscriptionName != null) + if (durationInSeconds != null) { - _queryParameters.Add(string.Format("subscriptionName={0}", System.Uri.EscapeDataString(subscriptionName))); + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); } if (Client.ApiVersion != null) { @@ -80228,7 +80630,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -80259,12 +80661,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(migrationOptions != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(migrationOptions, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -80285,7 +80681,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -80315,7 +80711,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -80328,7 +80724,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -80348,20 +80762,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Migrates a local (in-app) MySql database to a remote MySql database. + /// Approves or rejects a private endpoint connection /// /// - /// Description for Migrates a local (in-app) MySql database to a remote MySql - /// database. + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the site. /// - /// - /// MySql migration options. + /// + /// + /// /// /// /// Headers that will be added to request. @@ -80384,7 +80798,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginMigrateMySqlWithHttpMessagesAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -80409,13 +80823,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (migrationRequestEnvelope == null) + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "migrationRequestEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - if (migrationRequestEnvelope != null) + if (privateEndpointWrapper == null) { - migrationRequestEnvelope.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); } if (Client.SubscriptionId == null) { @@ -80434,15 +80848,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("migrationRequestEnvelope", migrationRequestEnvelope); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMySql", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -80456,7 +80872,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -80487,9 +80903,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(migrationRequestEnvelope != null) + if(privateEndpointWrapper != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(migrationRequestEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -80513,7 +80929,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -80543,7 +80959,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -80556,7 +80972,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -80576,25 +81010,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Deletes a private endpoint connection /// /// - /// Description for Start capturing network packets for the site. + /// Description for Deletes a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). + /// Name of the site. /// - /// - /// The Blob URL to store capture file. + /// /// /// /// Headers that will be added to request. @@ -80617,7 +81044,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -80642,6 +81069,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -80659,31 +81090,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartWebSiteNetworkTraceOperation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -80695,7 +81113,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -80746,7 +81164,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -80776,7 +81194,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -80789,7 +81207,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -80807,7 +81225,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 204) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -80827,20 +81263,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Approves or rejects a private endpoint connection + /// Restores an app from a backup blob in Azure Storage. /// /// - /// Description for Approves or rejects a private endpoint connection + /// Description for Restores an app from a backup blob in Azure Storage. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// Name of the app. /// - /// + /// + /// Information on restore request . /// - /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// restore a backup of the production slot. /// /// /// Headers that will be added to request. @@ -80851,9 +81290,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -80863,7 +81299,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreFromBackupBlobSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -80888,13 +81324,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - if (privateEndpointWrapper == null) + if (request != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); + request.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -80913,17 +81353,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); - tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); + tracingParameters.Add("request", request); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromBackupBlobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -80937,7 +81377,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -80968,9 +81408,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(privateEndpointWrapper != null) + if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -81024,49 +81464,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -81075,18 +81479,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a private endpoint connection + /// Restores a deleted web app to this web app. /// /// - /// Description for Deletes a private endpoint connection + /// Description for Restores a deleted web app to this web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// Name of web app. /// - /// + /// + /// Deleted web app restore information. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -81097,9 +81506,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -81109,7 +81515,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreFromDeletedAppSlotWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81134,9 +81540,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) + if (restoreRequest == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -81155,16 +81565,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("restoreRequest", restoreRequest); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromDeletedAppSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -81178,7 +81589,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -81209,6 +81620,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(restoreRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -81229,7 +81646,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -81259,67 +81676,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 204) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -81328,19 +81691,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores an app from a backup blob in Azure Storage. + /// Restores a web app from a snapshot. /// /// - /// Description for Restores an app from a backup blob in Azure Storage. + /// Description for Restores a web app from a snapshot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// Information on restore request . + /// + /// Snapshot restore settings. Snapshot information can be obtained by calling + /// GetDeletedSites or GetSiteSnapshots API. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -81360,7 +81728,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreFromBackupBlobWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81385,13 +81753,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) + if (restoreRequest == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); + throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); } - if (request != null) + if (restoreRequest != null) { - request.Validate(); + restoreRequest.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -81410,15 +81782,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); + tracingParameters.Add("restoreRequest", restoreRequest); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromBackupBlob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSnapshotSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -81463,9 +81837,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) + if(restoreRequest != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -81534,19 +81908,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a deleted web app to this web app. + /// Install site extension on a web site, or a deployment slot. /// /// - /// Description for Restores a deleted web app to this web app. + /// Description for Install site extension on a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. /// - /// - /// Deleted web app restore information. + /// + /// Site extension name. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -81557,6 +81935,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -81566,7 +81947,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreFromDeletedAppWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginInstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81591,9 +81972,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (restoreRequest == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -81612,15 +81997,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("restoreRequest", restoreRequest); + tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromDeletedApp", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginInstallSiteExtensionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -81634,7 +82022,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -81665,12 +82053,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(restoreRequest != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -81691,7 +82073,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 429) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -81721,13 +82103,49 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -81736,20 +82154,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a web app from a snapshot. + /// Copies a deployment slot to another deployment slot of an app. /// /// - /// Description for Restores a web app from a snapshot. + /// Description for Copies a deployment slot to another deployment slot of an + /// app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Snapshot restore settings. Snapshot information can be obtained by calling - /// GetDeletedSites or GetSiteSnapshots API. + /// + /// JSON object that contains the target slot name and site config properties + /// to override the source slot config. See example. + /// + /// + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. /// /// /// Headers that will be added to request. @@ -81769,7 +82192,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginCopySlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81794,13 +82217,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (restoreRequest == null) + if (copySlotEntity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); + throw new ValidationException(ValidationRules.CannotBeNull, "copySlotEntity"); } - if (restoreRequest != null) + if (copySlotEntity != null) { - restoreRequest.Validate(); + copySlotEntity.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -81819,15 +82246,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("restoreRequest", restoreRequest); + tracingParameters.Add("copySlotEntity", copySlotEntity); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSnapshot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCopySlotSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotcopy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -81872,9 +82301,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(restoreRequest != null) + if(copySlotEntity != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(copySlotEntity, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -81943,19 +82372,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Install site extension on a web site, or a deployment slot. + /// Swaps two deployment slots of an app. /// /// - /// Description for Install site extension on a web site, or a deployment slot. + /// Description for Swaps two deployment slots of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Site extension name. + /// + /// JSON object that contains the target slot name. See example. + /// + /// + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. /// /// /// Headers that will be added to request. @@ -81966,9 +82399,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -81978,7 +82408,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginInstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginSwapSlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -82003,9 +82433,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) + if (slotSwapEntity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -82024,16 +82462,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginInstallSiteExtension", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginSwapSlotSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -82047,7 +82486,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -82078,6 +82517,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -82098,7 +82543,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 429) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -82128,49 +82573,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -82179,26 +82588,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new web, mobile, or API app in an existing resource group, or - /// updates an existing app. + /// Updates the source control configuration of an app. /// /// - /// Description for Creates a new web, mobile, or API app in an existing - /// resource group, or updates an existing app. + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Unique name of the app to create or update. To create or update a - /// deployment slot, use the {slot} parameter. + /// Name of the app. /// - /// - /// A JSON representation of the app properties. See example. + /// + /// JSON representation of a SiteSourceControl object. See example. /// /// - /// Name of the deployment slot to create or update. By default, this API - /// attempts to create or modify the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the source control configuration for the production slot. /// /// /// Headers that will be added to request. @@ -82221,7 +82627,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -82246,13 +82652,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); - } - if (siteEnvelope != null) + if (siteSourceControl == null) { - siteEnvelope.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); } if (slot == null) { @@ -82275,14 +82677,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteEnvelope", siteEnvelope); + tracingParameters.Add("siteSourceControl", siteSourceControl); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSourceControlSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -82330,9 +82732,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteEnvelope != null) + if(siteSourceControl != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -82356,7 +82758,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -82386,7 +82788,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -82399,7 +82801,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -82417,7 +82837,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -82437,28 +82857,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a specific backup to another app (or deployment slot, if - /// specified). + /// Start capturing network packets for the site. /// /// - /// Description for Restores a specific backup to another app (or deployment - /// slot, if specified). + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// ID of the backup. + /// + /// The name of the slot for this web app. /// - /// - /// Information on restore request . + /// + /// The duration to keep capturing in seconds. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restore a backup of the production slot. + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. /// /// /// Headers that will be added to request. @@ -82469,6 +82889,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -82478,7 +82901,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> BeginStartNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -82503,18 +82926,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); - } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -82536,21 +82947,33 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); - tracingParameters.Add("request", request); + tracingParameters.Add("durationInSeconds", durationInSeconds); tracingParameters.Add("slot", slot); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginStartNetworkTraceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -82593,12 +83016,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -82649,221 +83066,38 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the Git/FTP publishing credentials of an app. - /// - /// - /// Description for Gets the Git/FTP publishing credentials of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the publishing credentials for the production slot. - /// - /// - /// 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> BeginListPublishingCredentialsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListPublishingCredentialsSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) + // Deserialize Response + if ((int)_statusCode == 200) { - foreach(var _header in customHeaders) + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try + catch (JsonException ex) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex.Body = _errorBody; + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } - 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) + if ((int)_statusCode == 202) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -82883,23 +83117,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Swaps two deployment slots of an app. /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Swaps two deployment slots of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the app. /// - /// - /// Details of MSDeploy operation + /// + /// JSON object that contains the target slot name. See example. /// /// /// Headers that will be added to request. @@ -82910,9 +83140,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -82922,7 +83149,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginSwapSlotWithProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -82947,13 +83174,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (slotSwapEntity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); } - if (mSDeploy == null) + if (slotSwapEntity != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); + slotSwapEntity.Validate(); } if (Client.SubscriptionId == null) { @@ -82972,17 +83199,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("mSDeploy", mSDeploy); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateMSDeployOperationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginSwapSlotWithProduction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -82996,7 +83221,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -83027,9 +83252,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(mSDeploy != null) + if(slotSwapEntity != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -83053,7 +83278,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 409) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -83083,31 +83308,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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 == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -83116,25 +83323,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create function for web site, or a deployment slot. + /// Updates the source control configuration of an app. /// /// - /// Description for Create function for web site, or a deployment slot. + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Function name. - /// - /// - /// Name of the deployment slot. + /// Name of the app. /// - /// - /// Function details. + /// + /// JSON representation of a SiteSourceControl object. See example. /// /// /// Headers that will be added to request. @@ -83157,7 +83358,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -83182,17 +83383,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (functionEnvelope == null) + if (siteSourceControl == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); } if (Client.SubscriptionId == null) { @@ -83211,19 +83404,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("slot", slot); - tracingParameters.Add("functionEnvelope", functionEnvelope); + tracingParameters.Add("siteSourceControl", siteSourceControl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceFunctionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSourceControl", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -83268,9 +83457,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(functionEnvelope != null) + if(siteSourceControl != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(functionEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -83294,7 +83483,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -83324,7 +83513,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -83332,12 +83521,48 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -83357,267 +83582,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Start capturing network packets for the site. /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// ID of web app instance. - /// - /// - /// Details of MSDeploy operation + /// The name of the web app. /// - /// - /// Headers that will be added to request. + /// + /// The duration to keep capturing in seconds. /// - /// - /// 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> BeginCreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } - if (mSDeploy == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); - tracingParameters.Add("mSDeploy", mSDeploy); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceMSDeployOperationSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(mSDeploy != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 409) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Start capturing network packets for the site. - /// - /// - /// Description for Start capturing network packets for the site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). + /// + /// The maximum frame length in bytes (Optional). /// /// /// The Blob URL to store capture file. @@ -83643,3810 +83623,38 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginStartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("slot", slot); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartWebSiteNetworkTraceOperationSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// - /// - /// - /// - /// 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> BeginApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (privateEndpointConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); - } - if (privateEndpointWrapper == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); - tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnectionSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(privateEndpointWrapper != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// - /// - /// 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> BeginDeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (privateEndpointConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnectionSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 204) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Restores an app from a backup blob in Azure Storage. - /// - /// - /// Description for Restores an app from a backup blob in Azure Storage. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Information on restore request . - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restore a backup of the production slot. - /// - /// - /// 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 BeginRestoreFromBackupBlobSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("request", request); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromBackupBlobSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Restores a deleted web app to this web app. - /// - /// - /// Description for Restores a deleted web app to this web app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Deleted web app restore information. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// 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 BeginRestoreFromDeletedAppSlotWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (restoreRequest == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("restoreRequest", restoreRequest); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromDeletedAppSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(restoreRequest != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Restores a web app from a snapshot. - /// - /// - /// Description for Restores a web app from a snapshot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Snapshot restore settings. Snapshot information can be obtained by calling - /// GetDeletedSites or GetSiteSnapshots API. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// 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 BeginRestoreSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (restoreRequest == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); - } - if (restoreRequest != null) - { - restoreRequest.Validate(); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("restoreRequest", restoreRequest); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSnapshotSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(restoreRequest != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Install site extension on a web site, or a deployment slot. - /// - /// - /// Description for Install site extension on a web site, or a deployment slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// - /// - /// Site extension name. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. - /// - /// - /// 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> BeginInstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (siteExtensionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginInstallSiteExtensionSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 429) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Swaps two deployment slots of an app. - /// - /// - /// Description for Swaps two deployment slots of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - /// - /// 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 BeginSwapSlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (slotSwapEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); - } - if (slotSwapEntity != null) - { - slotSwapEntity.Validate(); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSwapSlotSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(slotSwapEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 source control configuration of an app. - /// - /// - /// Description for Updates the source control configuration of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON representation of a SiteSourceControl object. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the source control configuration for the production slot. - /// - /// - /// 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> BeginCreateOrUpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (siteSourceControl == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("siteSourceControl", siteSourceControl); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSourceControlSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(siteSourceControl != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Start capturing network packets for the site. - /// - /// - /// Description for Start capturing network packets for the site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// 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>> BeginStartNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("slot", slot); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartNetworkTraceSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Swaps two deployment slots of an app. - /// - /// - /// Description for Swaps two deployment slots of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name. See example. - /// - /// - /// 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 BeginSwapSlotWithProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (slotSwapEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); - } - if (slotSwapEntity != null) - { - slotSwapEntity.Validate(); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSwapSlotWithProduction", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(slotSwapEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 source control configuration of an app. - /// - /// - /// Description for Updates the source control configuration of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON representation of a SiteSourceControl object. See example. - /// - /// - /// 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> BeginCreateOrUpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (siteSourceControl == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("siteSourceControl", siteSourceControl); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSourceControl", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(siteSourceControl != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Start capturing network packets for the site. - /// - /// - /// Description for Start capturing network packets for the site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// 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>> BeginStartNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartNetworkTrace", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get all apps for a subscription. - /// - /// - /// Description for Get all apps for a 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets all web, mobile, and API apps in the specified resource group. - /// - /// - /// Description for Gets all web, mobile, and API apps in the specified - /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets existing backups of an app. - /// - /// - /// Description for Gets existing backups of an app. - /// - /// - /// 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>> ListBackupsNextWithHttpMessagesAsync(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, "ListBackupsNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// List the configurations of an app - /// - /// - /// Description for List the configurations of an app - /// - /// - /// 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("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// 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>> GetAppSettingsKeyVaultReferencesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> BeginStartNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -87455,14 +83663,37 @@ internal WebAppsOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingsKeyVaultReferencesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginStartNetworkTrace", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -87470,7 +83701,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -87521,7 +83752,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -87551,7 +83782,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87564,7 +83795,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87576,166 +83807,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// 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>> GetSiteConnectionStringKeyVaultReferencesNextWithHttpMessagesAsync(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, "GetSiteConnectionStringKeyVaultReferencesNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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) + if ((int)_statusCode == 202) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87755,12 +83833,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a list of web app configuration snapshots identifiers. Each element of - /// the list contains a timestamp and the ID of the snapshot. + /// Get all apps for a subscription. /// /// - /// Description for Gets a list of web app configuration snapshots identifiers. - /// Each element of the list contains a timestamp and the ID of the snapshot. + /// Description for Get all apps for a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -87786,7 +83862,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationSnapshotInfoNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -87801,7 +83877,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87895,7 +83971,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87908,7 +83984,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87928,10 +84004,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List continuous web jobs for an app, or a deployment slot. + /// Gets all web, mobile, and API apps in the specified resource group. /// /// - /// Description for List continuous web jobs for an app, or a deployment slot. + /// Description for Gets all web, mobile, and API apps in the specified + /// resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -87957,7 +84034,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListContinuousWebJobsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -87972,7 +84049,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88066,7 +84143,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88079,7 +84156,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88099,10 +84176,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployments for an app, or a deployment slot. + /// Gets existing backups of an app. /// /// - /// Description for List deployments for an app, or a deployment slot. + /// Description for Gets existing backups of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -88128,7 +84205,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDeploymentsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBackupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88143,7 +84220,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBackupsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88237,7 +84314,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88250,7 +84327,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88270,11 +84347,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Lists ownership identifiers for domain associated with web app. + /// List the configurations of an app /// /// - /// Description for Lists ownership identifiers for domain associated with web - /// app. + /// Description for List the configurations of an app /// /// /// The NextLink from the previous successful call to List operation. @@ -88300,7 +84376,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDomainOwnershipIdentifiersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88315,7 +84391,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88409,7 +84485,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88422,7 +84498,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88442,10 +84518,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the functions for a web site, or a deployment slot. + /// Gets a list of web app configuration snapshots identifiers. Each element of + /// the list contains a timestamp and the ID of the snapshot. /// /// - /// Description for List the functions for a web site, or a deployment slot. + /// Description for Gets a list of web app configuration snapshots identifiers. + /// Each element of the list contains a timestamp and the ID of the snapshot. /// /// /// The NextLink from the previous successful call to List operation. @@ -88471,7 +84549,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationSnapshotInfoNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88486,7 +84564,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88550,7 +84628,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -88580,7 +84658,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88593,7 +84671,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88613,10 +84691,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get hostname bindings for an app or a deployment slot. + /// List continuous web jobs for an app, or a deployment slot. /// /// - /// Description for Get hostname bindings for an app or a deployment slot. + /// Description for List continuous web jobs for an app, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -88642,7 +84720,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListHostNameBindingsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListContinuousWebJobsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88657,7 +84735,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88751,7 +84829,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88764,7 +84842,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88784,10 +84862,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// List deployments for an app, or a deployment slot. /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for List deployments for an app, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -88813,7 +84891,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceIdentifiersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDeploymentsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88828,7 +84906,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88922,7 +85000,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88935,7 +85013,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88955,12 +85033,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Lists ownership identifiers for domain associated with web app. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Lists ownership identifiers for domain associated with web + /// app. /// /// /// The NextLink from the previous successful call to List operation. @@ -88986,7 +85063,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDomainOwnershipIdentifiersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89001,7 +85078,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89065,7 +85142,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -89095,7 +85172,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89108,7 +85185,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89128,12 +85205,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// List the functions for a web site, or a deployment slot. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for List the functions for a web site, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -89159,7 +85234,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessModulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89174,7 +85249,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89268,7 +85343,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89281,7 +85356,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89301,12 +85376,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Get hostname bindings for an app or a deployment slot. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Get hostname bindings for an app or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -89332,7 +85405,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessThreadsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListHostNameBindingsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89347,7 +85420,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89411,7 +85484,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -89441,7 +85514,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89454,7 +85527,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89474,10 +85547,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Gets all scale-out instances of an app. /// /// - /// Description for Gets existing backups of an app. + /// Description for Gets all scale-out instances of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -89503,7 +85576,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteBackupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceIdentifiersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89518,7 +85591,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89531,7 +85604,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -89612,7 +85685,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89625,7 +85698,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89645,10 +85718,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets perfmon counters for web app. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Gets perfmon counters for web app. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -89674,7 +85749,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPerfMonCountersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89689,7 +85764,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89753,7 +85828,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -89783,7 +85858,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89796,7 +85871,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89816,11 +85891,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the list of private endpoint connections associated with a site + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Gets the list of private endpoint connections associated - /// with a site + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -89846,7 +85922,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessModulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89861,7 +85937,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89925,7 +86001,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -89955,7 +86031,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89968,7 +86044,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89988,12 +86064,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -90019,7 +86095,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessThreadsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -90034,7 +86110,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -90128,7 +86204,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -90141,7 +86217,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -90161,12 +86237,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Gets existing backups of an app. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Gets existing backups of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -90192,7 +86266,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessModulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteBackupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -90207,7 +86281,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessModulesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -90220,7 +86294,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -90271,7 +86345,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -90301,7 +86375,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -90314,7 +86388,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -90334,12 +86408,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets perfmon counters for web app. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets perfmon counters for web app. /// /// /// The NextLink from the previous successful call to List operation. @@ -90365,7 +86437,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessThreadsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPerfMonCountersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -90380,7 +86452,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreadsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -90444,7 +86516,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -90474,7 +86546,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -90487,7 +86559,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -90507,10 +86579,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get public certificates for an app or a deployment slot. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Get public certificates for an app or a deployment slot. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -90536,7 +86610,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublicCertificatesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -90551,7 +86625,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificatesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -90615,7 +86689,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -90645,7 +86719,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -90658,7 +86732,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -90678,11 +86752,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of siteextensions for a web site, or a deployment slot. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Get list of siteextensions for a web site, or a deployment - /// slot. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -90708,7 +86783,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteExtensionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessModulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -90723,7 +86798,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensionsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessModulesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -90817,7 +86892,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -90830,7 +86905,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -90850,10 +86925,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets an app's deployment slots. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets an app's deployment slots. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -90879,7 +86956,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSlotsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessThreadsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -90894,7 +86971,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlotsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreadsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -90958,7 +87035,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -90988,7 +87065,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -91001,7 +87078,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -91021,10 +87098,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Get public certificates for an app or a deployment slot. /// /// - /// Description for Gets existing backups of an app. + /// Description for Get public certificates for an app or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -91050,7 +87127,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBackupsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPublicCertificatesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -91065,7 +87142,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBackupsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificatesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -91159,7 +87236,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -91172,7 +87249,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -91192,10 +87269,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the configurations of an app + /// Get list of siteextensions for a web site, or a deployment slot. /// /// - /// Description for List the configurations of an app + /// Description for Get list of siteextensions for a web site, or a deployment + /// slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -91221,7 +87299,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteExtensionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -91236,7 +87314,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -91300,7 +87378,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -91330,7 +87408,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -91343,7 +87421,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -91363,10 +87441,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the config reference app settings and status of an app + /// Gets an app's deployment slots. /// /// - /// Description for Gets the config reference app settings and status of an app + /// Description for Gets an app's deployment slots. /// /// /// The NextLink from the previous successful call to List operation. @@ -91392,7 +87470,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAppSettingsKeyVaultReferencesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSlotsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -91407,7 +87485,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingsKeyVaultReferencesSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlotsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -91501,7 +87579,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -91514,7 +87592,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -91534,10 +87612,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the config reference app settings and status of an app + /// Gets existing backups of an app. /// /// - /// Description for Gets the config reference app settings and status of an app + /// Description for Gets existing backups of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -91563,7 +87641,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetSiteConnectionStringKeyVaultReferencesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBackupsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -91578,7 +87656,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReferencesSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBackupsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -91672,7 +87750,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -91685,7 +87763,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -91705,12 +87783,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a list of web app configuration snapshots identifiers. Each element of - /// the list contains a timestamp and the ID of the snapshot. + /// List the configurations of an app /// /// - /// Description for Gets a list of web app configuration snapshots identifiers. - /// Each element of the list contains a timestamp and the ID of the snapshot. + /// Description for List the configurations of an app /// /// /// The NextLink from the previous successful call to List operation. @@ -91736,7 +87812,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationSnapshotInfoSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -91751,7 +87827,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -91845,7 +87921,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -91858,7 +87934,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -91878,10 +87954,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List continuous web jobs for an app, or a deployment slot. + /// Gets a list of web app configuration snapshots identifiers. Each element of + /// the list contains a timestamp and the ID of the snapshot. /// /// - /// Description for List continuous web jobs for an app, or a deployment slot. + /// Description for Gets a list of web app configuration snapshots identifiers. + /// Each element of the list contains a timestamp and the ID of the snapshot. /// /// /// The NextLink from the previous successful call to List operation. @@ -91907,7 +87985,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListContinuousWebJobsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationSnapshotInfoSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -91922,7 +88000,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -92016,7 +88094,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -92029,7 +88107,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -92049,10 +88127,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployments for an app, or a deployment slot. + /// List continuous web jobs for an app, or a deployment slot. /// /// - /// Description for List deployments for an app, or a deployment slot. + /// Description for List continuous web jobs for an app, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -92078,7 +88156,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDeploymentsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListContinuousWebJobsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -92093,7 +88171,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -92187,7 +88265,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -92200,7 +88278,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -92220,11 +88298,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Lists ownership identifiers for domain associated with web app. + /// List deployments for an app, or a deployment slot. /// /// - /// Description for Lists ownership identifiers for domain associated with web - /// app. + /// Description for List deployments for an app, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -92250,7 +88327,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDomainOwnershipIdentifiersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDeploymentsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -92265,7 +88342,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -92359,178 +88436,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// List the functions for a web site, or a deployment slot. - /// - /// - /// Description for List the functions for a web site, or a deployment slot. - /// - /// - /// 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>> ListInstanceFunctionsSlotNextWithHttpMessagesAsync(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, "ListInstanceFunctionsSlotNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -92543,7 +88449,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -92563,10 +88469,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get hostname bindings for an app or a deployment slot. + /// Lists ownership identifiers for domain associated with web app. /// /// - /// Description for Get hostname bindings for an app or a deployment slot. + /// Description for Lists ownership identifiers for domain associated with web + /// app. /// /// /// The NextLink from the previous successful call to List operation. @@ -92592,7 +88499,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListHostNameBindingsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDomainOwnershipIdentifiersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -92607,7 +88514,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -92701,7 +88608,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -92714,7 +88621,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -92734,10 +88641,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// List the functions for a web site, or a deployment slot. /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for List the functions for a web site, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -92763,7 +88670,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceIdentifiersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceFunctionsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -92778,7 +88685,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceFunctionsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -92842,7 +88749,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -92872,7 +88779,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -92885,7 +88792,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -92905,12 +88812,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Get hostname bindings for an app or a deployment slot. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Get hostname bindings for an app or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -92936,7 +88841,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListHostNameBindingsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -92951,7 +88856,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -93015,7 +88920,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -93045,7 +88950,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -93058,7 +88963,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -93078,12 +88983,183 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Gets all scale-out instances of an app. /// /// - /// Description for List module information for a process by its ID for a + /// Description for Gets all scale-out instances of an app. + /// + /// + /// 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>> ListInstanceIdentifiersSlotNextWithHttpMessagesAsync(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, "ListInstanceIdentifiersSlotNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get list of processes for a web site, or a deployment slot, or for a /// specific scaled-out instance in a web site. + /// + /// + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -93109,7 +89185,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessModulesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -93124,7 +89200,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -93218,7 +89294,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -93231,7 +89307,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -93251,12 +89327,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -93282,7 +89358,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessThreadsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessModulesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -93297,7 +89373,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -93391,7 +89467,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -93404,7 +89480,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -93424,10 +89500,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets existing backups of an app. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -93453,7 +89531,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteBackupsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessThreadsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -93468,7 +89546,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -93481,7 +89559,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -93532,7 +89610,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -93562,7 +89640,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -93575,7 +89653,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -93595,10 +89673,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets perfmon counters for web app. + /// Gets existing backups of an app. /// /// - /// Description for Gets perfmon counters for web app. + /// Description for Gets existing backups of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -93624,7 +89702,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPerfMonCountersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteBackupsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -93639,7 +89717,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -93652,7 +89730,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -93733,7 +89811,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -93746,7 +89824,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -93766,11 +89844,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the list of private endpoint connections associated with a site + /// Gets perfmon counters for web app. /// /// - /// Description for Gets the list of private endpoint connections associated - /// with a site + /// Description for Gets perfmon counters for web app. /// /// /// The NextLink from the previous successful call to List operation. @@ -93796,7 +89873,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetPrivateEndpointConnectionListSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPerfMonCountersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -93811,7 +89888,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionListSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -93905,7 +89982,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -93918,7 +89995,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperationsExtensions.cs index 088e49f47ee1..b268e898aef2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperationsExtensions.cs @@ -1603,200 +1603,6 @@ public static BackupRequest GetBackupConfiguration(this IWebAppsOperations opera } } - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - public static IPage GetAppSettingsKeyVaultReferences(this IWebAppsOperations operations, string resourceGroupName, string name) - { - return operations.GetAppSettingsKeyVaultReferencesAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// The cancellation token. - /// - public static async Task> GetAppSettingsKeyVaultReferencesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAppSettingsKeyVaultReferencesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the config reference and status of an app - /// - /// - /// Description for Gets the config reference and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// App Setting key name. - /// - public static ApiKVReference GetAppSettingKeyVaultReference(this IWebAppsOperations operations, string resourceGroupName, string name, string appSettingKey) - { - return operations.GetAppSettingKeyVaultReferenceAsync(resourceGroupName, name, appSettingKey).GetAwaiter().GetResult(); - } - - /// - /// Gets the config reference and status of an app - /// - /// - /// Description for Gets the config reference and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// App Setting key name. - /// - /// - /// The cancellation token. - /// - public static async Task GetAppSettingKeyVaultReferenceAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string appSettingKey, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAppSettingKeyVaultReferenceWithHttpMessagesAsync(resourceGroupName, name, appSettingKey, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - public static IPage GetSiteConnectionStringKeyVaultReferences(this IWebAppsOperations operations, string resourceGroupName, string name) - { - return operations.GetSiteConnectionStringKeyVaultReferencesAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// The cancellation token. - /// - public static async Task> GetSiteConnectionStringKeyVaultReferencesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetSiteConnectionStringKeyVaultReferencesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the config reference and status of an app - /// - /// - /// Description for Gets the config reference and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// - public static ApiKVReference GetSiteConnectionStringKeyVaultReference(this IWebAppsOperations operations, string resourceGroupName, string name, string connectionStringKey) - { - return operations.GetSiteConnectionStringKeyVaultReferenceAsync(resourceGroupName, name, connectionStringKey).GetAwaiter().GetResult(); - } - - /// - /// Gets the config reference and status of an app - /// - /// - /// Description for Gets the config reference and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetSiteConnectionStringKeyVaultReferenceAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string connectionStringKey, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetSiteConnectionStringKeyVaultReferenceWithHttpMessagesAsync(resourceGroupName, name, connectionStringKey, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Replaces the connection strings of an app. /// @@ -6299,6 +6105,72 @@ public static SwiftVirtualNetwork GetSwiftVirtualNetworkConnection(this IWebApps } } + /// + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + public static SwiftVirtualNetwork CreateOrUpdateSwiftVirtualNetworkConnection(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope) + { + return operations.CreateOrUpdateSwiftVirtualNetworkConnectionAsync(resourceGroupName, name, connectionEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateSwiftVirtualNetworkConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Deletes a Swift Virtual Network connection from an app (or deployment /// slot). @@ -6346,6 +6218,72 @@ public static void DeleteSwiftVirtualNetwork(this IWebAppsOperations operations, (await operations.DeleteSwiftVirtualNetworkWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + public static SwiftVirtualNetwork UpdateSwiftVirtualNetworkConnection(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope) + { + return operations.UpdateSwiftVirtualNetworkConnectionAsync(resourceGroupName, name, connectionEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateSwiftVirtualNetworkConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets all network features used by the app (or deployment slot, if /// specified). @@ -6364,7 +6302,7 @@ public static void DeleteSwiftVirtualNetwork(this IWebAppsOperations operations, /// Name of the app. /// /// - /// The type of view. Only "summary" is supported at this time. + /// The type of view. This can either be "summary" or "detailed". /// public static NetworkFeatures ListNetworkFeatures(this IWebAppsOperations operations, string resourceGroupName, string name, string view) { @@ -6389,7 +6327,7 @@ public static NetworkFeatures ListNetworkFeatures(this IWebAppsOperations operat /// Name of the app. /// /// - /// The type of view. Only "summary" is supported at this time. + /// The type of view. This can either be "summary" or "detailed". /// /// /// The cancellation token. @@ -7320,11 +7258,12 @@ public static PrivateAccess PutPrivateAccessVnet(this IWebAppsOperations operati } /// - /// Gets the list of private endpoint connections associated with a site + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Gets the list of private endpoint connections associated - /// with a site + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// The operations group for this extension method. @@ -7333,271 +7272,20 @@ public static PrivateAccess PutPrivateAccessVnet(this IWebAppsOperations operati /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// Site name. /// - public static IPage GetPrivateEndpointConnectionList(this IWebAppsOperations operations, string resourceGroupName, string name) + public static IPage ListProcesses(this IWebAppsOperations operations, string resourceGroupName, string name) { - return operations.GetPrivateEndpointConnectionListAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.ListProcessesAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// - /// Gets the list of private endpoint connections associated with a site + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Gets the list of private endpoint connections associated - /// with a site - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// The cancellation token. - /// - public static async Task> GetPrivateEndpointConnectionListAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateEndpointConnectionListWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a private endpoint connection - /// - /// - /// Description for Gets a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// Name of the private endpoint connection. - /// - public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) - { - return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Gets a private endpoint connection - /// - /// - /// Description for Gets a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// Name of the private endpoint connection. - /// - /// - /// The cancellation token. - /// - public static async Task GetPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// - public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) - { - return operations.ApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task ApproveOrRejectPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - public static object DeletePrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) - { - return operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task DeletePrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IWebAppsOperations operations, string resourceGroupName, string name) - { - return operations.GetPrivateLinkResourcesAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Gets the private link resources - /// - /// - /// Description for Gets the private link resources - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// The cancellation token. - /// - public static async Task GetPrivateLinkResourcesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. - /// - /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// - public static IPage ListProcesses(this IWebAppsOperations operations, string resourceGroupName, string name) - { - return operations.ListProcessesAsync(resourceGroupName, name).GetAwaiter().GetResult(); - } - - /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. - /// - /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// The operations group for this extension method. @@ -8686,10 +8374,11 @@ public static void DeleteSiteExtension(this IWebAppsOperations operations, strin } /// - /// Gets an app's deployment slots. + /// Copies a deployment slot to another deployment slot of an app. /// /// - /// Description for Gets an app's deployment slots. + /// Description for Copies a deployment slot to another deployment slot of an + /// app. /// /// /// The operations group for this extension method. @@ -8700,16 +8389,21 @@ public static void DeleteSiteExtension(this IWebAppsOperations operations, strin /// /// Name of the app. /// - public static IPage ListSlots(this IWebAppsOperations operations, string resourceGroupName, string name) + /// + /// JSON object that contains the target slot name and site config properties + /// to override the source slot config. See example. + /// + public static void CopyProductionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity) { - return operations.ListSlotsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + operations.CopyProductionSlotAsync(resourceGroupName, name, copySlotEntity).GetAwaiter().GetResult(); } /// - /// Gets an app's deployment slots. + /// Copies a deployment slot to another deployment slot of an app. /// /// - /// Description for Gets an app's deployment slots. + /// Description for Copies a deployment slot to another deployment slot of an + /// app. /// /// /// The operations group for this extension method. @@ -8720,12 +8414,59 @@ public static IPage ListSlots(this IWebAppsOperations operations, string r /// /// Name of the app. /// + /// + /// JSON object that contains the target slot name and site config properties + /// to override the source slot config. See example. + /// /// /// The cancellation token. /// - public static async Task> ListSlotsAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CopyProductionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListSlotsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + (await operations.CopyProductionSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets an app's deployment slots. + /// + /// + /// Description for Gets an app's deployment slots. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + public static IPage ListSlots(this IWebAppsOperations operations, string resourceGroupName, string name) + { + return operations.ListSlotsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets an app's deployment slots. + /// + /// + /// Description for Gets an app's deployment slots. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// The cancellation token. + /// + public static async Task> ListSlotsAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSlotsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -8875,8 +8616,9 @@ public static Site CreateOrUpdateSlot(this IWebAppsOperations operations, string /// If true, web app metrics are also deleted. /// /// - /// Specify false if you want to keep empty App Service plan. By default, empty - /// App Service plan is deleted. + /// Specify true if the App Service plan will be empty after app deletion and + /// you want to delete the empty App Service plan. By default, the empty App + /// Service plan is not deleted. /// public static void DeleteSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, bool? deleteMetrics = default(bool?), bool? deleteEmptyServerFarm = default(bool?)) { @@ -8907,8 +8649,9 @@ public static Site CreateOrUpdateSlot(this IWebAppsOperations operations, string /// If true, web app metrics are also deleted. /// /// - /// Specify false if you want to keep empty App Service plan. By default, empty - /// App Service plan is deleted. + /// Specify true if the App Service plan will be empty after app deletion and + /// you want to delete the empty App Service plan. By default, the empty App + /// Service plan is not deleted. /// /// /// The cancellation token. @@ -9484,12 +9227,10 @@ public static void RestoreSlot(this IWebAppsOperations operations, string resour } /// - /// Returns whether Scm basic auth is allowed and whether Ftp is allowed for a - /// given site. + /// List the configurations of an app /// /// - /// Description for Returns whether Scm basic auth is allowed and whether Ftp - /// is allowed for a given site. + /// Description for List the configurations of an app /// /// /// The operations group for this extension method. @@ -9501,19 +9242,19 @@ public static void RestoreSlot(this IWebAppsOperations operations, string resour /// Name of the app. /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// return configuration for the production slot. /// - public static CsmPublishingCredentialsPoliciesCollection GetBasicPublishingCredentialsPoliciesSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static IPage ListConfigurationsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.GetBasicPublishingCredentialsPoliciesSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.ListConfigurationsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Returns whether Scm basic auth is allowed and whether Ftp is allowed for a - /// given site. + /// List the configurations of an app /// /// - /// Description for Returns whether Scm basic auth is allowed and whether Ftp - /// is allowed for a given site. + /// Description for List the configurations of an app /// /// /// The operations group for this extension method. @@ -9525,23 +9266,25 @@ public static CsmPublishingCredentialsPoliciesCollection GetBasicPublishingCrede /// Name of the app. /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// return configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task GetBasicPublishingCredentialsPoliciesSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListConfigurationsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetBasicPublishingCredentialsPoliciesSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListConfigurationsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Returns whether FTP is allowed on the site or not. + /// Replaces the application settings of an app. /// /// - /// Description for Returns whether FTP is allowed on the site or not. + /// Description for Replaces the application settings of an app. /// /// /// The operations group for this extension method. @@ -9552,18 +9295,23 @@ public static CsmPublishingCredentialsPoliciesCollection GetBasicPublishingCrede /// /// Name of the app. /// + /// + /// Application settings of the app. + /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the application settings for the production slot. /// - public static CsmPublishingCredentialsPoliciesEntity GetFtpAllowedSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static StringDictionary UpdateApplicationSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, StringDictionary appSettings, string slot) { - return operations.GetFtpAllowedSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.UpdateApplicationSettingsSlotAsync(resourceGroupName, name, appSettings, slot).GetAwaiter().GetResult(); } /// - /// Returns whether FTP is allowed on the site or not. + /// Replaces the application settings of an app. /// /// - /// Description for Returns whether FTP is allowed on the site or not. + /// Description for Replaces the application settings of an app. /// /// /// The operations group for this extension method. @@ -9574,24 +9322,29 @@ public static CsmPublishingCredentialsPoliciesEntity GetFtpAllowedSlot(this IWeb /// /// Name of the app. /// + /// + /// Application settings of the app. + /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the application settings for the production slot. /// /// /// The cancellation token. /// - public static async Task GetFtpAllowedSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateApplicationSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, StringDictionary appSettings, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetFtpAllowedSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateApplicationSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, appSettings, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Updates whether FTP is allowed on the site or not. + /// Gets the application settings of an app. /// /// - /// Description for Updates whether FTP is allowed on the site or not. + /// Description for Gets the application settings of an app. /// /// /// The operations group for this extension method. @@ -9602,20 +9355,20 @@ public static CsmPublishingCredentialsPoliciesEntity GetFtpAllowedSlot(this IWeb /// /// Name of the app. /// - /// - /// /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the application settings for the production slot. /// - public static CsmPublishingCredentialsPoliciesEntity UpdateFtpAllowedSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot) + public static StringDictionary ListApplicationSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.UpdateFtpAllowedSlotAsync(resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot).GetAwaiter().GetResult(); + return operations.ListApplicationSettingsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Updates whether FTP is allowed on the site or not. + /// Gets the application settings of an app. /// /// - /// Description for Updates whether FTP is allowed on the site or not. + /// Description for Gets the application settings of an app. /// /// /// The operations group for this extension method. @@ -9626,27 +9379,28 @@ public static CsmPublishingCredentialsPoliciesEntity UpdateFtpAllowedSlot(this I /// /// Name of the app. /// - /// - /// /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the application settings for the production slot. /// /// /// The cancellation token. /// - public static async Task UpdateFtpAllowedSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListApplicationSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateFtpAllowedSlotWithHttpMessagesAsync(resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListApplicationSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Returns whether Scm basic auth is allowed on the site or not. + /// Updates the Authentication / Authorization settings associated with web + /// app. /// /// - /// Description for Returns whether Scm basic auth is allowed on the site or - /// not. + /// Description for Updates the Authentication / Authorization settings + /// associated with web app. /// /// /// The operations group for this extension method. @@ -9655,21 +9409,27 @@ public static CsmPublishingCredentialsPoliciesEntity UpdateFtpAllowedSlot(this I /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. + /// + /// + /// Auth settings associated with web app. /// /// + /// Name of web app slot. If not specified then will default to production + /// slot. /// - public static CsmPublishingCredentialsPoliciesEntity GetScmAllowedSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static SiteAuthSettings UpdateAuthSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot) { - return operations.GetScmAllowedSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.UpdateAuthSettingsSlotAsync(resourceGroupName, name, siteAuthSettings, slot).GetAwaiter().GetResult(); } /// - /// Returns whether Scm basic auth is allowed on the site or not. + /// Updates the Authentication / Authorization settings associated with web + /// app. /// /// - /// Description for Returns whether Scm basic auth is allowed on the site or - /// not. + /// Description for Updates the Authentication / Authorization settings + /// associated with web app. /// /// /// The operations group for this extension method. @@ -9678,27 +9438,31 @@ public static CsmPublishingCredentialsPoliciesEntity GetScmAllowedSlot(this IWeb /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. + /// + /// + /// Auth settings associated with web app. /// /// + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// The cancellation token. /// - public static async Task GetScmAllowedSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAuthSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetScmAllowedSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateAuthSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, siteAuthSettings, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Updates whether user publishing credentials are allowed on the site or not. + /// Gets the Authentication/Authorization settings of an app. /// /// - /// Description for Updates whether user publishing credentials are allowed on - /// the site or not. + /// Description for Gets the Authentication/Authorization settings of an app. /// /// /// The operations group for this extension method. @@ -9709,21 +9473,20 @@ public static CsmPublishingCredentialsPoliciesEntity GetScmAllowedSlot(this IWeb /// /// Name of the app. /// - /// - /// /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the settings for the production slot. /// - public static CsmPublishingCredentialsPoliciesEntity UpdateScmAllowedSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot) + public static SiteAuthSettings GetAuthSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.UpdateScmAllowedSlotAsync(resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot).GetAwaiter().GetResult(); + return operations.GetAuthSettingsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Updates whether user publishing credentials are allowed on the site or not. + /// Gets the Authentication/Authorization settings of an app. /// /// - /// Description for Updates whether user publishing credentials are allowed on - /// the site or not. + /// Description for Gets the Authentication/Authorization settings of an app. /// /// /// The operations group for this extension method. @@ -9734,26 +9497,28 @@ public static CsmPublishingCredentialsPoliciesEntity UpdateScmAllowedSlot(this I /// /// Name of the app. /// - /// - /// /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the settings for the production slot. /// /// /// The cancellation token. /// - public static async Task UpdateScmAllowedSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAuthSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateScmAllowedSlotWithHttpMessagesAsync(resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetAuthSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List the configurations of an app + /// Updates site's Authentication / Authorization settings for apps via the V2 + /// format /// /// - /// Description for List the configurations of an app + /// Description for Updates site's Authentication / Authorization settings for + /// apps via the V2 format /// /// /// The operations group for this extension method. @@ -9762,22 +9527,27 @@ public static CsmPublishingCredentialsPoliciesEntity UpdateScmAllowedSlot(this I /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. + /// + /// + /// Auth settings associated with web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// - public static IPage ListConfigurationsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static SiteAuthSettingsV2 UpdateAuthSettingsV2Slot(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot) { - return operations.ListConfigurationsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.UpdateAuthSettingsV2SlotAsync(resourceGroupName, name, siteAuthSettingsV2, slot).GetAwaiter().GetResult(); } /// - /// List the configurations of an app + /// Updates site's Authentication / Authorization settings for apps via the V2 + /// format /// /// - /// Description for List the configurations of an app + /// Description for Updates site's Authentication / Authorization settings for + /// apps via the V2 format /// /// /// The operations group for this extension method. @@ -9786,28 +9556,33 @@ public static IPage ListConfigurationsSlot(this IWebAppsOper /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. + /// + /// + /// Auth settings associated with web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// The cancellation token. /// - public static async Task> ListConfigurationsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAuthSettingsV2SlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListConfigurationsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateAuthSettingsV2SlotWithHttpMessagesAsync(resourceGroupName, name, siteAuthSettingsV2, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Replaces the application settings of an app. + /// Gets site's Authentication / Authorization settings for apps via the V2 + /// format /// /// - /// Description for Replaces the application settings of an app. + /// Description for Gets site's Authentication / Authorization settings for + /// apps via the V2 format /// /// /// The operations group for this extension method. @@ -9818,23 +9593,22 @@ public static IPage ListConfigurationsSlot(this IWebAppsOper /// /// Name of the app. /// - /// - /// Application settings of the app. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the application settings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the settings for the production slot. /// - public static StringDictionary UpdateApplicationSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, StringDictionary appSettings, string slot) + public static SiteAuthSettingsV2 GetAuthSettingsV2Slot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.UpdateApplicationSettingsSlotAsync(resourceGroupName, name, appSettings, slot).GetAwaiter().GetResult(); + return operations.GetAuthSettingsV2SlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Replaces the application settings of an app. + /// Gets site's Authentication / Authorization settings for apps via the V2 + /// format /// /// - /// Description for Replaces the application settings of an app. + /// Description for Gets site's Authentication / Authorization settings for + /// apps via the V2 format /// /// /// The operations group for this extension method. @@ -9845,548 +9619,26 @@ public static StringDictionary UpdateApplicationSettingsSlot(this IWebAppsOperat /// /// Name of the app. /// - /// - /// Application settings of the app. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the application settings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the settings for the production slot. /// /// /// The cancellation token. /// - public static async Task UpdateApplicationSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, StringDictionary appSettings, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateApplicationSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, appSettings, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the application settings of an app. - /// - /// - /// Description for Gets the application settings of an app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the application settings for the production slot. - /// - public static StringDictionary ListApplicationSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) - { - return operations.ListApplicationSettingsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); - } - - /// - /// Gets the application settings of an app. - /// - /// - /// Description for Gets the application settings of an app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the application settings for the production slot. - /// - /// - /// The cancellation token. - /// - public static async Task ListApplicationSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListApplicationSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates the Authentication / Authorization settings associated with web - /// app. - /// - /// - /// Description for Updates the Authentication / Authorization settings - /// associated with web app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Auth settings associated with web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - public static SiteAuthSettings UpdateAuthSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot) - { - return operations.UpdateAuthSettingsSlotAsync(resourceGroupName, name, siteAuthSettings, slot).GetAwaiter().GetResult(); - } - - /// - /// Updates the Authentication / Authorization settings associated with web - /// app. - /// - /// - /// Description for Updates the Authentication / Authorization settings - /// associated with web app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Auth settings associated with web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAuthSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateAuthSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, siteAuthSettings, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the Authentication/Authorization settings of an app. - /// - /// - /// Description for Gets the Authentication/Authorization settings of an app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. - /// - public static SiteAuthSettings GetAuthSettingsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) - { - return operations.GetAuthSettingsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); - } - - /// - /// Gets the Authentication/Authorization settings of an app. - /// - /// - /// Description for Gets the Authentication/Authorization settings of an app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. - /// - /// - /// The cancellation token. - /// - public static async Task GetAuthSettingsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAuthSettingsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates site's Authentication / Authorization settings for apps via the V2 - /// format - /// - /// - /// Description for Updates site's Authentication / Authorization settings for - /// apps via the V2 format - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Auth settings associated with web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - public static SiteAuthSettingsV2 UpdateAuthSettingsV2Slot(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot) - { - return operations.UpdateAuthSettingsV2SlotAsync(resourceGroupName, name, siteAuthSettingsV2, slot).GetAwaiter().GetResult(); - } - - /// - /// Updates site's Authentication / Authorization settings for apps via the V2 - /// format - /// - /// - /// Description for Updates site's Authentication / Authorization settings for - /// apps via the V2 format - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Auth settings associated with web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAuthSettingsV2SlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateAuthSettingsV2SlotWithHttpMessagesAsync(resourceGroupName, name, siteAuthSettingsV2, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets site's Authentication / Authorization settings for apps via the V2 - /// format - /// - /// - /// Description for Gets site's Authentication / Authorization settings for - /// apps via the V2 format - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. - /// - public static SiteAuthSettingsV2 GetAuthSettingsV2Slot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) - { - return operations.GetAuthSettingsV2SlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); - } - - /// - /// Gets site's Authentication / Authorization settings for apps via the V2 - /// format - /// - /// - /// Description for Gets site's Authentication / Authorization settings for - /// apps via the V2 format - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. - /// - /// - /// The cancellation token. - /// - public static async Task GetAuthSettingsV2SlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAuthSettingsV2SlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates the Azure storage account configurations of an app. - /// - /// - /// Description for Updates the Azure storage account configurations of an app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Azure storage accounts of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. - /// - public static AzureStoragePropertyDictionaryResource UpdateAzureStorageAccountsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot) - { - return operations.UpdateAzureStorageAccountsSlotAsync(resourceGroupName, name, azureStorageAccounts, slot).GetAwaiter().GetResult(); - } - - /// - /// Updates the Azure storage account configurations of an app. - /// - /// - /// Description for Updates the Azure storage account configurations of an app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Azure storage accounts of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAzureStorageAccountsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateAzureStorageAccountsSlotWithHttpMessagesAsync(resourceGroupName, name, azureStorageAccounts, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the Azure storage account configurations of an app. - /// - /// - /// Description for Gets the Azure storage account configurations of an app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. - /// - public static AzureStoragePropertyDictionaryResource ListAzureStorageAccountsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) - { - return operations.ListAzureStorageAccountsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); - } - - /// - /// Gets the Azure storage account configurations of an app. - /// - /// - /// Description for Gets the Azure storage account configurations of an app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. - /// - /// - /// The cancellation token. - /// - public static async Task ListAzureStorageAccountsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAzureStorageAccountsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates the backup configuration of an app. - /// - /// - /// Description for Updates the backup configuration of an app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Edited backup configuration. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the backup configuration for the production slot. - /// - public static BackupRequest UpdateBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, BackupRequest request, string slot) - { - return operations.UpdateBackupConfigurationSlotAsync(resourceGroupName, name, request, slot).GetAwaiter().GetResult(); - } - - /// - /// Updates the backup configuration of an app. - /// - /// - /// Description for Updates the backup configuration of an app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Edited backup configuration. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the backup configuration for the production slot. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, BackupRequest request, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, request, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the backup configuration of an app. - /// - /// - /// Description for Deletes the backup configuration of an app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the backup configuration for the production slot. - /// - public static void DeleteBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) - { - operations.DeleteBackupConfigurationSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); - } - - /// - /// Deletes the backup configuration of an app. - /// - /// - /// Description for Deletes the backup configuration of an app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the backup configuration for the production slot. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAuthSettingsV2SlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.GetAuthSettingsV2SlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets the backup configuration of an app. + /// Updates the Azure storage account configurations of an app. /// /// - /// Description for Gets the backup configuration of an app. + /// Description for Updates the Azure storage account configurations of an app. /// /// /// The operations group for this extension method. @@ -10397,20 +9649,23 @@ public static void DeleteBackupConfigurationSlot(this IWebAppsOperations operati /// /// Name of the app. /// + /// + /// Azure storage accounts of the app. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the backup configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. /// - public static BackupRequest GetBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static AzureStoragePropertyDictionaryResource UpdateAzureStorageAccountsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot) { - return operations.GetBackupConfigurationSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.UpdateAzureStorageAccountsSlotAsync(resourceGroupName, name, azureStorageAccounts, slot).GetAwaiter().GetResult(); } /// - /// Gets the backup configuration of an app. + /// Updates the Azure storage account configurations of an app. /// /// - /// Description for Gets the backup configuration of an app. + /// Description for Updates the Azure storage account configurations of an app. /// /// /// The operations group for this extension method. @@ -10421,26 +9676,29 @@ public static BackupRequest GetBackupConfigurationSlot(this IWebAppsOperations o /// /// Name of the app. /// + /// + /// Azure storage accounts of the app. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the backup configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. /// /// /// The cancellation token. /// - public static async Task GetBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAzureStorageAccountsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateAzureStorageAccountsSlotWithHttpMessagesAsync(resourceGroupName, name, azureStorageAccounts, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the config reference app settings and status of an app + /// Gets the Azure storage account configurations of an app. /// /// - /// Description for Gets the config reference app settings and status of an app + /// Description for Gets the Azure storage account configurations of an app. /// /// /// The operations group for this extension method. @@ -10452,17 +9710,19 @@ public static BackupRequest GetBackupConfigurationSlot(this IWebAppsOperations o /// Name of the app. /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. /// - public static IPage GetAppSettingsKeyVaultReferencesSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static AzureStoragePropertyDictionaryResource ListAzureStorageAccountsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.GetAppSettingsKeyVaultReferencesSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.ListAzureStorageAccountsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Gets the config reference app settings and status of an app + /// Gets the Azure storage account configurations of an app. /// /// - /// Description for Gets the config reference app settings and status of an app + /// Description for Gets the Azure storage account configurations of an app. /// /// /// The operations group for this extension method. @@ -10474,23 +9734,25 @@ public static IPage GetAppSettingsKeyVaultReferencesSlot(this IW /// Name of the app. /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. /// /// /// The cancellation token. /// - public static async Task> GetAppSettingsKeyVaultReferencesSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListAzureStorageAccountsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetAppSettingsKeyVaultReferencesSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAzureStorageAccountsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the config reference and status of an app + /// Updates the backup configuration of an app. /// /// - /// Description for Gets the config reference and status of an app + /// Description for Updates the backup configuration of an app. /// /// /// The operations group for this extension method. @@ -10501,21 +9763,23 @@ public static IPage GetAppSettingsKeyVaultReferencesSlot(this IW /// /// Name of the app. /// - /// - /// App Setting key name. + /// + /// Edited backup configuration. /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the backup configuration for the production slot. /// - public static ApiKVReference GetAppSettingKeyVaultReferenceSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string appSettingKey, string slot) + public static BackupRequest UpdateBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, BackupRequest request, string slot) { - return operations.GetAppSettingKeyVaultReferenceSlotAsync(resourceGroupName, name, appSettingKey, slot).GetAwaiter().GetResult(); + return operations.UpdateBackupConfigurationSlotAsync(resourceGroupName, name, request, slot).GetAwaiter().GetResult(); } /// - /// Gets the config reference and status of an app + /// Updates the backup configuration of an app. /// /// - /// Description for Gets the config reference and status of an app + /// Description for Updates the backup configuration of an app. /// /// /// The operations group for this extension method. @@ -10526,27 +9790,29 @@ public static ApiKVReference GetAppSettingKeyVaultReferenceSlot(this IWebAppsOpe /// /// Name of the app. /// - /// - /// App Setting key name. + /// + /// Edited backup configuration. /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the backup configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task GetAppSettingKeyVaultReferenceSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string appSettingKey, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, BackupRequest request, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetAppSettingKeyVaultReferenceSlotWithHttpMessagesAsync(resourceGroupName, name, appSettingKey, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, request, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the config reference app settings and status of an app + /// Deletes the backup configuration of an app. /// /// - /// Description for Gets the config reference app settings and status of an app + /// Description for Deletes the backup configuration of an app. /// /// /// The operations group for this extension method. @@ -10558,17 +9824,19 @@ public static ApiKVReference GetAppSettingKeyVaultReferenceSlot(this IWebAppsOpe /// Name of the app. /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the backup configuration for the production slot. /// - public static IPage GetSiteConnectionStringKeyVaultReferencesSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static void DeleteBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.GetSiteConnectionStringKeyVaultReferencesSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + operations.DeleteBackupConfigurationSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Gets the config reference app settings and status of an app + /// Deletes the backup configuration of an app. /// /// - /// Description for Gets the config reference app settings and status of an app + /// Description for Deletes the backup configuration of an app. /// /// /// The operations group for this extension method. @@ -10580,23 +9848,22 @@ public static IPage GetSiteConnectionStringKeyVaultReferencesSlo /// Name of the app. /// /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the backup configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task> GetSiteConnectionStringKeyVaultReferencesSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetSiteConnectionStringKeyVaultReferencesSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Gets the config reference and status of an app + /// Gets the backup configuration of an app. /// /// - /// Description for Gets the config reference and status of an app + /// Description for Gets the backup configuration of an app. /// /// /// The operations group for this extension method. @@ -10607,20 +9874,20 @@ public static IPage GetSiteConnectionStringKeyVaultReferencesSlo /// /// Name of the app. /// - /// - /// /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the backup configuration for the production slot. /// - public static ApiKVReference GetSiteConnectionStringKeyVaultReferenceSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string connectionStringKey, string slot) + public static BackupRequest GetBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.GetSiteConnectionStringKeyVaultReferenceSlotAsync(resourceGroupName, name, connectionStringKey, slot).GetAwaiter().GetResult(); + return operations.GetBackupConfigurationSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Gets the config reference and status of an app + /// Gets the backup configuration of an app. /// /// - /// Description for Gets the config reference and status of an app + /// Description for Gets the backup configuration of an app. /// /// /// The operations group for this extension method. @@ -10631,16 +9898,16 @@ public static ApiKVReference GetSiteConnectionStringKeyVaultReferenceSlot(this I /// /// Name of the app. /// - /// - /// /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the backup configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task GetSiteConnectionStringKeyVaultReferenceSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string connectionStringKey, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetSiteConnectionStringKeyVaultReferenceSlotWithHttpMessagesAsync(resourceGroupName, name, connectionStringKey, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -15538,6 +14805,80 @@ public static SwiftVirtualNetwork GetSwiftVirtualNetworkConnectionSlot(this IWeb } } + /// + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update connections for the production slot. + /// + public static SwiftVirtualNetwork CreateOrUpdateSwiftVirtualNetworkConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot) + { + return operations.CreateOrUpdateSwiftVirtualNetworkConnectionSlotAsync(resourceGroupName, name, connectionEnvelope, slot).GetAwaiter().GetResult(); + } + + /// + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update connections for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateSwiftVirtualNetworkConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Deletes a Swift Virtual Network connection from an app (or deployment /// slot). @@ -15593,6 +14934,80 @@ public static void DeleteSwiftVirtualNetworkSlot(this IWebAppsOperations operati (await operations.DeleteSwiftVirtualNetworkSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update connections for the production slot. + /// + public static SwiftVirtualNetwork UpdateSwiftVirtualNetworkConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot) + { + return operations.UpdateSwiftVirtualNetworkConnectionSlotAsync(resourceGroupName, name, connectionEnvelope, slot).GetAwaiter().GetResult(); + } + + /// + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update connections for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateSwiftVirtualNetworkConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets all network features used by the app (or deployment slot, if /// specified). @@ -15611,7 +15026,7 @@ public static void DeleteSwiftVirtualNetworkSlot(this IWebAppsOperations operati /// Name of the app. /// /// - /// The type of view. Only "summary" is supported at this time. + /// The type of view. This can either be "summary" or "detailed". /// /// /// Name of the deployment slot. If a slot is not specified, the API will get @@ -15640,7 +15055,7 @@ public static NetworkFeatures ListNetworkFeaturesSlot(this IWebAppsOperations op /// Name of the app. /// /// - /// The type of view. Only "summary" is supported at this time. + /// The type of view. This can either be "summary" or "detailed". /// /// /// Name of the deployment slot. If a slot is not specified, the API will get @@ -16602,76 +16017,17 @@ public static PremierAddOn UpdatePremierAddOnSlot(this IWebAppsOperations operat /// /// The name of the slot for the web app. /// - public static PrivateAccess GetPrivateAccessSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) - { - return operations.GetPrivateAccessSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); - } - - /// - /// Gets data around private site access enablement and authorized Virtual - /// Networks that can access the site. - /// - /// - /// Description for Gets data around private site access enablement and - /// authorized Virtual Networks that can access the site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The name of the web app. - /// - /// - /// The name of the slot for the web app. - /// - /// - /// The cancellation token. - /// - public static async Task GetPrivateAccessSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateAccessSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Sets data around private site access enablement and authorized Virtual - /// Networks that can access the site. - /// - /// - /// Description for Sets data around private site access enablement and - /// authorized Virtual Networks that can access the site. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The name of the web app. - /// - /// - /// The information for the private access - /// - /// - /// The name of the slot for the web app. - /// - public static PrivateAccess PutPrivateAccessVnetSlot(this IWebAppsOperations operations, string resourceGroupName, string name, PrivateAccess access, string slot) + public static PrivateAccess GetPrivateAccessSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.PutPrivateAccessVnetSlotAsync(resourceGroupName, name, access, slot).GetAwaiter().GetResult(); + return operations.GetPrivateAccessSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Sets data around private site access enablement and authorized Virtual + /// Gets data around private site access enablement and authorized Virtual /// Networks that can access the site. /// /// - /// Description for Sets data around private site access enablement and + /// Description for Gets data around private site access enablement and /// authorized Virtual Networks that can access the site. /// /// @@ -16683,29 +16039,27 @@ public static PrivateAccess PutPrivateAccessVnetSlot(this IWebAppsOperations ope /// /// The name of the web app. /// - /// - /// The information for the private access - /// /// /// The name of the slot for the web app. /// /// /// The cancellation token. /// - public static async Task PutPrivateAccessVnetSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, PrivateAccess access, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetPrivateAccessSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.PutPrivateAccessVnetSlotWithHttpMessagesAsync(resourceGroupName, name, access, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPrivateAccessSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the list of private endpoint connections associated with a site + /// Sets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Gets the list of private endpoint connections associated - /// with a site + /// Description for Sets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// The operations group for this extension method. @@ -16714,22 +16068,26 @@ public static PrivateAccess PutPrivateAccessVnetSlot(this IWebAppsOperations ope /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// The name of the web app. + /// + /// + /// The information for the private access /// /// - /// Name of the site deployment slot. + /// The name of the slot for the web app. /// - public static IPage GetPrivateEndpointConnectionListSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static PrivateAccess PutPrivateAccessVnetSlot(this IWebAppsOperations operations, string resourceGroupName, string name, PrivateAccess access, string slot) { - return operations.GetPrivateEndpointConnectionListSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.PutPrivateAccessVnetSlotAsync(resourceGroupName, name, access, slot).GetAwaiter().GetResult(); } /// - /// Gets the list of private endpoint connections associated with a site + /// Sets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Gets the list of private endpoint connections associated - /// with a site + /// Description for Sets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// The operations group for this extension method. @@ -16738,17 +16096,20 @@ public static IPage GetPrivateEndpoi /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// The name of the web app. + /// + /// + /// The information for the private access /// /// - /// Name of the site deployment slot. + /// The name of the slot for the web app. /// /// /// The cancellation token. /// - public static async Task> GetPrivateEndpointConnectionListSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task PutPrivateAccessVnetSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, PrivateAccess access, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPrivateEndpointConnectionListSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.PutPrivateAccessVnetSlotWithHttpMessagesAsync(resourceGroupName, name, access, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -16770,14 +16131,10 @@ public static IPage GetPrivateEndpoi /// Name of the site. /// /// - /// Name of the private endpoint connection. - /// - /// - /// Name of the site deployment slot. /// - public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot) + public static PrivateEndpointConnectionResource GetPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) { - return operations.GetPrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, slot).GetAwaiter().GetResult(); + return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); } /// @@ -16796,17 +16153,13 @@ public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConne /// Name of the site. /// /// - /// Name of the private endpoint connection. - /// - /// - /// Name of the site deployment slot. /// /// /// The cancellation token. /// - public static async Task GetPrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -16831,11 +16184,9 @@ public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConne /// /// /// - /// - /// - public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot) + public static PrivateEndpointConnectionResource ApproveOrRejectPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) { - return operations.ApproveOrRejectPrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot).GetAwaiter().GetResult(); + return operations.ApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); } /// @@ -16857,14 +16208,12 @@ public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateE /// /// /// - /// - /// /// /// The cancellation token. /// - public static async Task ApproveOrRejectPrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ApproveOrRejectPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -16887,11 +16236,9 @@ public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateE /// /// /// - /// - /// - public static object DeletePrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot) + public static object DeletePrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) { - return operations.DeletePrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, slot).GetAwaiter().GetResult(); + return operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); } /// @@ -16911,14 +16258,12 @@ public static object DeletePrivateEndpointConnectionSlot(this IWebAppsOperations /// /// /// - /// - /// /// /// The cancellation token. /// - public static async Task DeletePrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeletePrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -16939,11 +16284,9 @@ public static object DeletePrivateEndpointConnectionSlot(this IWebAppsOperations /// /// Name of the site. /// - /// - /// - public static PrivateLinkResourcesWrapper GetPrivateLinkResourcesSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IWebAppsOperations operations, string resourceGroupName, string name) { - return operations.GetPrivateLinkResourcesSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.GetPrivateLinkResourcesAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// @@ -16961,14 +16304,12 @@ public static PrivateLinkResourcesWrapper GetPrivateLinkResourcesSlot(this IWebA /// /// Name of the site. /// - /// - /// /// /// The cancellation token. /// - public static async Task GetPrivateLinkResourcesSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetPrivateLinkResourcesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPrivateLinkResourcesSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -18258,6 +17599,67 @@ public static void DeleteSiteExtensionSlot(this IWebAppsOperations operations, s (await operations.DeleteSiteExtensionSlotWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Copies a deployment slot to another deployment slot of an app. + /// + /// + /// Description for Copies a deployment slot to another deployment slot of an + /// app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name and site config properties + /// to override the source slot config. See example. + /// + /// + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. + /// + public static void CopySlotSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot) + { + operations.CopySlotSlotAsync(resourceGroupName, name, copySlotEntity, slot).GetAwaiter().GetResult(); + } + + /// + /// Copies a deployment slot to another deployment slot of an app. + /// + /// + /// Description for Copies a deployment slot to another deployment slot of an + /// app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name and site config properties + /// to override the source slot config. See example. + /// + /// + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. + /// + /// + /// The cancellation token. + /// + public static async Task CopySlotSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.CopySlotSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Get the difference in configuration settings between two web app slots. /// @@ -18616,11 +18018,9 @@ public static SiteSourceControl CreateOrUpdateSourceControlSlot(this IWebAppsOpe /// Name of the deployment slot. If a slot is not specified, the API will /// delete the source control configuration for the production slot. /// - /// - /// - public static void DeleteSourceControlSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, string additionalFlags = default(string)) + public static void DeleteSourceControlSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - operations.DeleteSourceControlSlotAsync(resourceGroupName, name, slot, additionalFlags).GetAwaiter().GetResult(); + operations.DeleteSourceControlSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// @@ -18642,14 +18042,12 @@ public static SiteSourceControl CreateOrUpdateSourceControlSlot(this IWebAppsOpe /// Name of the deployment slot. If a slot is not specified, the API will /// delete the source control configuration for the production slot. /// - /// - /// /// /// The cancellation token. /// - public static async Task DeleteSourceControlSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, string additionalFlags = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteSourceControlSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteSourceControlSlotWithHttpMessagesAsync(resourceGroupName, name, slot, additionalFlags, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteSourceControlSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -20426,11 +19824,9 @@ public static SiteSourceControl CreateOrUpdateSourceControl(this IWebAppsOperati /// /// Name of the app. /// - /// - /// - public static void DeleteSourceControl(this IWebAppsOperations operations, string resourceGroupName, string name, string additionalFlags = default(string)) + public static void DeleteSourceControl(this IWebAppsOperations operations, string resourceGroupName, string name) { - operations.DeleteSourceControlAsync(resourceGroupName, name, additionalFlags).GetAwaiter().GetResult(); + operations.DeleteSourceControlAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// @@ -20448,14 +19844,12 @@ public static SiteSourceControl CreateOrUpdateSourceControl(this IWebAppsOperati /// /// Name of the app. /// - /// - /// /// /// The cancellation token. /// - public static async Task DeleteSourceControlAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string additionalFlags = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteSourceControlAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteSourceControlWithHttpMessagesAsync(resourceGroupName, name, additionalFlags, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteSourceControlWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -22243,110 +21637,6 @@ public static Operation BeginMigrateMySql(this IWebAppsOperations operations, st } } - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// - public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) - { - return operations.BeginApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); - } - - /// - /// Approves or rejects a private endpoint connection - /// - /// - /// Description for Approves or rejects a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task BeginApproveOrRejectPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - public static object BeginDeletePrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) - { - return operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the site. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeletePrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Restores an app from a backup blob in Azure Storage. /// @@ -22548,6 +21838,59 @@ public static SiteExtensionInfo BeginInstallSiteExtension(this IWebAppsOperation } } + /// + /// Copies a deployment slot to another deployment slot of an app. + /// + /// + /// Description for Copies a deployment slot to another deployment slot of an + /// app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name and site config properties + /// to override the source slot config. See example. + /// + public static void BeginCopyProductionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity) + { + operations.BeginCopyProductionSlotAsync(resourceGroupName, name, copySlotEntity).GetAwaiter().GetResult(); + } + + /// + /// Copies a deployment slot to another deployment slot of an app. + /// + /// + /// Description for Copies a deployment slot to another deployment slot of an + /// app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name and site config properties + /// to override the source slot config. See example. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCopyProductionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginCopyProductionSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Creates a new web, mobile, or API app in an existing resource group, or /// updates an existing app. @@ -23014,11 +22357,9 @@ public static MSDeployStatus BeginCreateInstanceMSDeployOperationSlot(this IWebA /// /// /// - /// - /// - public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot) + public static PrivateEndpointConnectionResource BeginApproveOrRejectPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) { - return operations.BeginApproveOrRejectPrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot).GetAwaiter().GetResult(); + return operations.BeginApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); } /// @@ -23040,14 +22381,12 @@ public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPri /// /// /// - /// - /// /// /// The cancellation token. /// - public static async Task BeginApproveOrRejectPrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginApproveOrRejectPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -23070,11 +22409,9 @@ public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPri /// /// /// - /// - /// - public static object BeginDeletePrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot) + public static object BeginDeletePrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) { - return operations.BeginDeletePrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, slot).GetAwaiter().GetResult(); + return operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); } /// @@ -23094,14 +22431,12 @@ public static object BeginDeletePrivateEndpointConnectionSlot(this IWebAppsOpera /// /// /// - /// - /// /// /// The cancellation token. /// - public static async Task BeginDeletePrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeletePrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginDeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -23340,6 +22675,67 @@ public static SiteExtensionInfo BeginInstallSiteExtensionSlot(this IWebAppsOpera } } + /// + /// Copies a deployment slot to another deployment slot of an app. + /// + /// + /// Description for Copies a deployment slot to another deployment slot of an + /// app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name and site config properties + /// to override the source slot config. See example. + /// + /// + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. + /// + public static void BeginCopySlotSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot) + { + operations.BeginCopySlotSlotAsync(resourceGroupName, name, copySlotEntity, slot).GetAwaiter().GetResult(); + } + + /// + /// Copies a deployment slot to another deployment slot of an app. + /// + /// + /// Description for Copies a deployment slot to another deployment slot of an + /// app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name and site config properties + /// to override the source slot config. See example. + /// + /// + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCopySlotSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginCopySlotSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Swaps two deployment slots of an app. /// @@ -23854,86 +23250,6 @@ public static IPage ListConfigurationsNext(this IWebAppsOper } } - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetAppSettingsKeyVaultReferencesNext(this IWebAppsOperations operations, string nextPageLink) - { - return operations.GetAppSettingsKeyVaultReferencesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetAppSettingsKeyVaultReferencesNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAppSettingsKeyVaultReferencesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetSiteConnectionStringKeyVaultReferencesNext(this IWebAppsOperations operations, string nextPageLink) - { - return operations.GetSiteConnectionStringKeyVaultReferencesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetSiteConnectionStringKeyVaultReferencesNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetSiteConnectionStringKeyVaultReferencesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets a list of web app configuration snapshots identifiers. Each element of /// the list contains a timestamp and the ID of the snapshot. @@ -24432,48 +23748,6 @@ public static IPage ListPerfMonCountersNext(this IWebAppsOperat } } - /// - /// Gets the list of private endpoint connections associated with a site - /// - /// - /// Description for Gets the list of private endpoint connections associated - /// with a site - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetPrivateEndpointConnectionListNext(this IWebAppsOperations operations, string nextPageLink) - { - return operations.GetPrivateEndpointConnectionListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of private endpoint connections associated with a site - /// - /// - /// Description for Gets the list of private endpoint connections associated - /// with a site - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetPrivateEndpointConnectionListNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Get list of processes for a web site, or a deployment slot, or for a /// specific scaled-out instance in a web site. @@ -24808,86 +24082,6 @@ public static IPage ListConfigurationsSlotNext(this IWebApps } } - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetAppSettingsKeyVaultReferencesSlotNext(this IWebAppsOperations operations, string nextPageLink) - { - return operations.GetAppSettingsKeyVaultReferencesSlotNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetAppSettingsKeyVaultReferencesSlotNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAppSettingsKeyVaultReferencesSlotNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetSiteConnectionStringKeyVaultReferencesSlotNext(this IWebAppsOperations operations, string nextPageLink) - { - return operations.GetSiteConnectionStringKeyVaultReferencesSlotNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the config reference app settings and status of an app - /// - /// - /// Description for Gets the config reference app settings and status of an app - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetSiteConnectionStringKeyVaultReferencesSlotNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetSiteConnectionStringKeyVaultReferencesSlotNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets a list of web app configuration snapshots identifiers. Each element of /// the list contains a timestamp and the ID of the snapshot. @@ -25386,48 +24580,6 @@ public static IPage ListPerfMonCountersSlotNext(this IWebAppsOp } } - /// - /// Gets the list of private endpoint connections associated with a site - /// - /// - /// Description for Gets the list of private endpoint connections associated - /// with a site - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetPrivateEndpointConnectionListSlotNext(this IWebAppsOperations operations, string nextPageLink) - { - return operations.GetPrivateEndpointConnectionListSlotNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of private endpoint connections associated with a site - /// - /// - /// Description for Gets the list of private endpoint connections associated - /// with a site - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetPrivateEndpointConnectionListSlotNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPrivateEndpointConnectionListSlotNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Get list of processes for a web site, or a deployment slot, or for a /// specific scaled-out instance in a web site. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs index 0ccd5a99dd44..e13c1b883b34 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs @@ -82,11 +82,6 @@ public partial class WebSiteManagementClient : ServiceClient public virtual IAppServiceCertificateOrdersOperations AppServiceCertificateOrders { get; private set; } - /// - /// Gets the ICertificateOrdersDiagnosticsOperations. - /// - public virtual ICertificateOrdersDiagnosticsOperations CertificateOrdersDiagnostics { get; private set; } - /// /// Gets the ICertificateRegistrationProviderOperations. /// @@ -122,11 +117,6 @@ public partial class WebSiteManagementClient : ServiceClient public virtual IDiagnosticsOperations Diagnostics { get; private set; } - /// - /// Gets the IGlobalModelOperations. - /// - public virtual IGlobalModelOperations GlobalModel { get; private set; } - /// /// Gets the IProviderOperations. /// @@ -404,7 +394,6 @@ public WebSiteManagementClient(System.Uri baseUri, ServiceClientCredentials cred private void Initialize() { AppServiceCertificateOrders = new AppServiceCertificateOrdersOperations(this); - CertificateOrdersDiagnostics = new CertificateOrdersDiagnosticsOperations(this); CertificateRegistrationProvider = new CertificateRegistrationProviderOperations(this); Domains = new DomainsOperations(this); TopLevelDomains = new TopLevelDomainsOperations(this); @@ -412,7 +401,6 @@ private void Initialize() Certificates = new CertificatesOperations(this); DeletedWebApps = new DeletedWebAppsOperations(this); Diagnostics = new DiagnosticsOperations(this); - GlobalModel = new GlobalModelOperations(this); Provider = new ProviderOperations(this); Recommendations = new RecommendationsOperations(this); WebApps = new WebAppsOperations(this); @@ -421,7 +409,7 @@ private void Initialize() AppServicePlans = new AppServicePlansOperations(this); ResourceHealthMetadata = new ResourceHealthMetadataOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-12-01"; + ApiVersion = "2020-06-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -455,204 +443,6 @@ private void Initialize() DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } - /// - /// Exchange code for GitHub access token for AppService CLI - /// - /// - /// Description for Exchange code for GitHub access token for AppService CLI - /// - /// - /// Code string to exchange for Github Access token - /// - /// - /// State string used for verification. - /// - /// - /// 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> GenerateGithubAccessTokenForAppserviceCLIAsyncWithHttpMessagesAsync(string code, string state, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); - } - if (code == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "code"); - } - if (state == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "state"); - } - AppserviceGithubTokenRequest request = new AppserviceGithubTokenRequest(); - if (code != null || state != null) - { - request.Code = code; - request.State = state; - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("request", request); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GenerateGithubAccessTokenForAppserviceCLIAsync", tracingParameters); - } - // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/generateGithubAccessTokenForAppserviceCLI").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("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(request != null) - { - _requestContent = SafeJsonConvert.SerializeObject(request, 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _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 publishing user /// @@ -2145,8 +1935,7 @@ private void Initialize() /// /// Name of SKU used to filter the regions. Possible values include: 'Free', /// 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', - /// 'IsolatedV2', 'PremiumV2', 'PremiumV3', 'PremiumContainer', - /// 'ElasticPremium', 'ElasticIsolated' + /// 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' /// /// /// Specify <code>true</code> if you want to filter to only regions diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClientExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClientExtensions.cs index 653d2cddfeee..ef734c7a7f7b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClientExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClientExtensions.cs @@ -21,52 +21,6 @@ namespace Microsoft.Azure.Management.WebSites /// public static partial class WebSiteManagementClientExtensions { - /// - /// Exchange code for GitHub access token for AppService CLI - /// - /// - /// Description for Exchange code for GitHub access token for AppService CLI - /// - /// - /// The operations group for this extension method. - /// - /// - /// Code string to exchange for Github Access token - /// - /// - /// State string used for verification. - /// - public static AppserviceGithubToken GenerateGithubAccessTokenForAppserviceCLIAsync(this IWebSiteManagementClient operations, string code, string state) - { - return operations.GenerateGithubAccessTokenForAppserviceCLIAsyncAsync(code, state).GetAwaiter().GetResult(); - } - - /// - /// Exchange code for GitHub access token for AppService CLI - /// - /// - /// Description for Exchange code for GitHub access token for AppService CLI - /// - /// - /// The operations group for this extension method. - /// - /// - /// Code string to exchange for Github Access token - /// - /// - /// State string used for verification. - /// - /// - /// The cancellation token. - /// - public static async Task GenerateGithubAccessTokenForAppserviceCLIAsyncAsync(this IWebSiteManagementClient operations, string code, string state, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GenerateGithubAccessTokenForAppserviceCLIAsyncWithHttpMessagesAsync(code, state, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets publishing user /// @@ -411,8 +365,7 @@ public static DeploymentLocations GetSubscriptionDeploymentLocations(this IWebSi /// /// Name of SKU used to filter the regions. Possible values include: 'Free', /// 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', - /// 'IsolatedV2', 'PremiumV2', 'PremiumV3', 'PremiumContainer', - /// 'ElasticPremium', 'ElasticIsolated' + /// 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' /// /// /// Specify <code>true</code> if you want to filter to only regions @@ -443,8 +396,7 @@ public static DeploymentLocations GetSubscriptionDeploymentLocations(this IWebSi /// /// Name of SKU used to filter the regions. Possible values include: 'Free', /// 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', - /// 'IsolatedV2', 'PremiumV2', 'PremiumV3', 'PremiumContainer', - /// 'ElasticPremium', 'ElasticIsolated' + /// 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' /// /// /// Specify <code>true</code> if you want to filter to only regions diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj index 53eb2ced0ee6..6746aec79a70 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj @@ -7,9 +7,9 @@ Microsoft.Azure.Management.Websites Provides website management capabilities for Microsoft Azure. Microsoft.Azure.Management.Websites - 3.1.1 + 3.1.0 Microsoft Azure website management;website management; - + $(SdkTargetFx) diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Properties/AssemblyInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Properties/AssemblyInfo.cs index b846d2da1a76..e9afa0cf38a9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Properties/AssemblyInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Properties/AssemblyInfo.cs @@ -8,8 +8,8 @@ [assembly: AssemblyTitle("Microsoft Azure Web Sites Management Library")] [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Web Sites.")] -[assembly: AssemblyVersion("3.1.1")] -[assembly: AssemblyFileVersion("3.1.1")] +[assembly: AssemblyVersion("3.1.0")] +[assembly: AssemblyFileVersion("3.1.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Azure .NET SDK")] From a915c0da80bcecf2d1aecc02d715108b1e0160c9 Mon Sep 17 00:00:00 2001 From: Kota Sudhakar Reddy <60102891+Kotasudhakarreddy@users.noreply.github.com> Date: Thu, 6 May 2021 23:09:34 +0530 Subject: [PATCH 4/7] Generated with 2020-12 version --- .../AppServiceCertificateOrdersRestClient.cs | 1999 + .../AppServiceEnvironmentsRestClient.cs | 5793 ++ .../Generated/AppServicePlansRestClient.cs | 3199 ++ .../CertificateOrdersDiagnosticsRestClient.cs | 337 + ...rtificateRegistrationProviderRestClient.cs | 167 + .../src/Generated/CertificatesRestClient.cs | 685 + .../src/Generated/DeletedWebAppsRestClient.cs | 408 + .../src/Generated/DiagnosticsRestClient.cs | 3301 ++ .../DomainRegistrationProviderRestClient.cs | 167 + .../src/Generated/DomainsRestClient.cs | 1607 + .../src/Generated/GlobalRestClient.cs | 280 + .../AbnormalTimePeriod.Serialization.cs | 115 + .../Generated/Models/AbnormalTimePeriod.cs | 85 +- .../Generated/Models/Address.Serialization.cs | 80 + .../src/Generated/Models/Address.cs | 152 +- .../Models/AddressResponse.Serialization.cs | 148 + .../src/Generated/Models/AddressResponse.cs | 96 +- ...llowedAudiencesValidation.Serialization.cs | 100 + .../Models/AllowedAudiencesValidation.cs | 59 +- .../Models/AnalysisData.Serialization.cs | 135 + .../src/Generated/Models/AnalysisData.cs | 88 +- .../AnalysisDefinition.Serialization.cs | 79 + .../Generated/Models/AnalysisDefinition.cs | 59 +- .../Models/ApiDefinitionInfo.Serialization.cs | 40 + .../src/Generated/Models/ApiDefinitionInfo.cs | 45 +- .../Models/ApiKVReference.Serialization.cs | 182 + .../src/Generated/Models/ApiKVReference.cs | 57 + .../ApiKVReferenceCollection.Serialization.cs | 41 + .../Models/ApiKVReferenceCollection.cs | 44 + .../ApiManagementConfig.Serialization.cs | 40 + .../Generated/Models/ApiManagementConfig.cs | 45 +- ...sightsWebAppStackSettings.Serialization.cs | 45 + .../Models/AppInsightsWebAppStackSettings.cs | 32 + .../Models/AppRegistration.Serialization.cs | 95 + .../src/Generated/Models/AppRegistration.cs | 58 +- .../AppServiceCertificate.Serialization.cs | 62 + .../Generated/Models/AppServiceCertificate.cs | 74 +- ...viceCertificateCollection.Serialization.cs | 41 + .../Models/AppServiceCertificateCollection.cs | 44 + ...ppServiceCertificateOrder.Serialization.cs | 361 + .../Models/AppServiceCertificateOrder.cs | 301 +- ...ertificateOrderCollection.Serialization.cs | 41 + .../AppServiceCertificateOrderCollection.cs | 44 + ...ificateOrderPatchResource.Serialization.cs | 326 + ...AppServiceCertificateOrderPatchResource.cs | 289 +- ...rviceCertificateNotRenewableReasonsItem.cs | 54 + ...rviceCertificateNotRenewableReasonsItem.cs | 54 + ...eCertificatePatchResource.Serialization.cs | 106 + .../AppServiceCertificatePatchResource.cs | 89 +- ...erviceCertificateResource.Serialization.cs | 142 + .../Models/AppServiceCertificateResource.cs | 116 +- .../AppServiceEnvironment.Serialization.cs | 237 + .../Generated/Models/AppServiceEnvironment.cs | 495 +- ...viceEnvironmentCollection.Serialization.cs | 41 + .../Models/AppServiceEnvironmentCollection.cs | 44 + ...eEnvironmentPatchResource.Serialization.cs | 289 + .../AppServiceEnvironmentPatchResource.cs | 498 +- ...erviceEnvironmentResource.Serialization.cs | 324 + .../Models/AppServiceEnvironmentResource.cs | 513 +- .../Models/AppServicePlan.Serialization.cs | 391 + .../src/Generated/Models/AppServicePlan.cs | 302 +- .../AppServicePlanCollection.Serialization.cs | 41 + .../Models/AppServicePlanCollection.cs | 44 + ...pServicePlanPatchResource.Serialization.cs | 339 + .../Models/AppServicePlanPatchResource.cs | 274 +- ...ppServicePlanRestrictions.Serialization.cs | 36 + .../Models/AppServicePlanRestrictions.cs | 82 +- .../Generated/Models/Apple.Serialization.cs | 121 + .../src/Generated/Models/Apple.cs | 40 + .../Models/AppleRegistration.Serialization.cs | 95 + .../src/Generated/Models/AppleRegistration.cs | 36 + .../ApplicationLogsConfig.Serialization.cs | 77 + .../Generated/Models/ApplicationLogsConfig.cs | 77 +- .../Models/ApplicationStack.Serialization.cs | 141 + .../src/Generated/Models/ApplicationStack.cs | 95 +- ...pplicationStackCollection.Serialization.cs | 41 + .../Models/ApplicationStackCollection.cs | 44 + .../ApplicationStackResource.Serialization.cs | 185 + .../Models/ApplicationStackResource.cs | 112 +- .../AppserviceGithubToken.Serialization.cs | 58 + .../Generated/Models/AppserviceGithubToken.cs | 44 + ...serviceGithubTokenRequest.Serialization.cs | 25 + .../Models/AppserviceGithubTokenRequest.cs | 39 + .../Models/ArmIdWrapper.Serialization.cs | 35 + .../src/Generated/Models/ArmIdWrapper.cs | 44 +- .../Generated/Models/ArmPlan.Serialization.cs | 53 + .../src/Generated/Models/ArmPlan.cs | 44 + ...V3NetworkingConfiguration.Serialization.cs | 122 + .../Models/AseV3NetworkingConfiguration.cs | 43 + .../Models/AuthPlatform.Serialization.cs | 111 + .../src/Generated/Models/AuthPlatform.cs | 68 +- .../AutoHealActionType.Serialization.cs | 30 + .../Generated/Models/AutoHealActionType.cs | 64 +- .../Models/AutoHealActions.Serialization.cs | 72 + .../src/Generated/Models/AutoHealActions.cs | 68 +- .../AutoHealCustomAction.Serialization.cs | 51 + .../Generated/Models/AutoHealCustomAction.cs | 49 +- .../Models/AutoHealRules.Serialization.cs | 61 + .../src/Generated/Models/AutoHealRules.cs | 56 +- .../Models/AutoHealTriggers.Serialization.cs | 156 + .../src/Generated/Models/AutoHealTriggers.cs | 89 +- .../AzureActiveDirectory.Serialization.cs | 153 + .../Generated/Models/AzureActiveDirectory.cs | 80 +- ...AzureActiveDirectoryLogin.Serialization.cs | 116 + .../Models/AzureActiveDirectoryLogin.cs | 67 +- ...tiveDirectoryRegistration.Serialization.cs | 117 + .../AzureActiveDirectoryRegistration.cs | 86 +- ...ActiveDirectoryValidation.Serialization.cs | 116 + .../Models/AzureActiveDirectoryValidation.cs | 68 +- ...rageApplicationLogsConfig.Serialization.cs | 72 + .../AzureBlobStorageApplicationLogsConfig.cs | 69 +- ...BlobStorageHttpLogsConfig.Serialization.cs | 72 + .../Models/AzureBlobStorageHttpLogsConfig.cs | 69 +- .../Models/AzureResourceType.Serialization.cs | 28 + .../src/Generated/Models/AzureResourceType.cs | 58 +- .../AzureStaticWebApps.Serialization.cs | 105 + .../Generated/Models/AzureStaticWebApps.cs | 36 + ...StaticWebAppsRegistration.Serialization.cs | 84 + .../Models/AzureStaticWebAppsRegistration.cs | 32 + .../AzureStorageInfoValue.Serialization.cs | 100 + .../Generated/Models/AzureStorageInfoValue.cs | 96 +- ...ropertyDictionaryResource.Serialization.cs | 86 + .../AzureStoragePropertyDictionaryResource.cs | 64 +- .../Models/AzureStorageState.Serialization.cs | 32 + .../src/Generated/Models/AzureStorageState.cs | 68 +- .../Models/AzureStorageType.Serialization.cs | 28 + .../src/Generated/Models/AzureStorageType.cs | 58 +- ...rageApplicationLogsConfig.Serialization.cs | 53 + .../AzureTableStorageApplicationLogsConfig.cs | 85 +- .../Models/BackupItem.Serialization.cs | 209 + .../src/Generated/Models/BackupItem.cs | 216 +- .../BackupItemCollection.Serialization.cs | 41 + .../Generated/Models/BackupItemCollection.cs | 44 + .../Models/BackupItemStatus.Serialization.cs | 44 + .../src/Generated/Models/BackupItemStatus.cs | 106 +- .../Models/BackupRequest.Serialization.cs | 154 + .../src/Generated/Models/BackupRequest.cs | 130 +- ...ackupRestoreOperationType.Serialization.cs | 34 + .../Models/BackupRestoreOperationType.cs | 76 +- .../Models/BackupSchedule.Serialization.cs | 89 + .../src/Generated/Models/BackupSchedule.cs | 128 +- .../Models/BillingMeter.Serialization.cs | 155 + .../src/Generated/Models/BillingMeter.cs | 105 +- .../BillingMeterCollection.Serialization.cs | 41 + .../Models/BillingMeterCollection.cs | 44 + .../BlobStorageTokenStore.Serialization.cs | 84 + .../Generated/Models/BlobStorageTokenStore.cs | 52 +- .../src/Generated/Models/BuildStatus.cs | 79 +- ...tInAuthenticationProvider.Serialization.cs | 36 + .../Models/BuiltInAuthenticationProvider.cs | 82 +- .../Models/Capability.Serialization.cs | 62 + .../src/Generated/Models/Capability.cs | 61 +- .../Models/Certificate.Serialization.cs | 326 + .../src/Generated/Models/Certificate.cs | 300 +- .../CertificateCollection.Serialization.cs | 41 + .../Generated/Models/CertificateCollection.cs | 44 + .../CertificateDetails.Serialization.cs | 93 + .../Generated/Models/CertificateDetails.cs | 132 +- .../Models/CertificateEmail.Serialization.cs | 101 + .../src/Generated/Models/CertificateEmail.cs | 69 +- .../CertificateOrderAction.Serialization.cs | 96 + .../Models/CertificateOrderAction.cs | 84 +- ...ertificateOrderActionType.Serialization.cs | 52 + .../Models/CertificateOrderActionType.cs | 130 +- .../CertificateOrderContact.Serialization.cs | 47 + .../Models/CertificateOrderContact.cs | 36 + .../CertificateOrderStatus.Serialization.cs | 44 + .../Models/CertificateOrderStatus.cs | 106 +- .../CertificatePatchResource.Serialization.cs | 291 + .../Models/CertificatePatchResource.cs | 286 +- .../CertificateProductType.Serialization.cs | 28 + .../Models/CertificateProductType.cs | 58 +- .../Models/Channels.Serialization.cs | 34 + .../src/Generated/Models/Channels.cs | 76 +- .../Models/CheckNameResourceTypes.cs | 83 +- .../Models/ClientCertMode.Serialization.cs | 30 + .../src/Generated/Models/ClientCertMode.cs | 63 +- .../ClientRegistration.Serialization.cs | 95 + .../Generated/Models/ClientRegistration.cs | 58 +- .../CloneAbilityResult.Serialization.cs | 30 + .../Generated/Models/CloneAbilityResult.cs | 64 +- .../Models/CloningInfo.Serialization.cs | 190 + .../src/Generated/Models/CloningInfo.cs | 213 +- ...itiesAdditionalproperties.Serialization.cs | 41 + ...rassignedidentitiesAdditionalproperties.cs | 32 + .../ComputeModeOptions.Serialization.cs | 30 + .../Generated/Models/ComputeModeOptions.cs | 64 +- .../Models/ConnStringInfo.Serialization.cs | 67 + .../src/Generated/Models/ConnStringInfo.cs | 66 +- .../ConnStringValueTypePair.Serialization.cs | 45 + .../Models/ConnStringValueTypePair.cs | 81 +- ...onnectionStringDictionary.Serialization.cs | 86 + .../Models/ConnectionStringDictionary.cs | 62 +- .../ConnectionStringType.Serialization.cs | 46 + .../Generated/Models/ConnectionStringType.cs | 112 +- .../Generated/Models/Contact.Serialization.cs | 121 + .../src/Generated/Models/Contact.cs | 169 +- .../ContainerCpuStatistics.Serialization.cs | 93 + .../Models/ContainerCpuStatistics.cs | 54 +- .../Models/ContainerCpuUsage.Serialization.cs | 104 + .../src/Generated/Models/ContainerCpuUsage.cs | 62 +- .../Models/ContainerInfo.Serialization.cs | 148 + .../src/Generated/Models/ContainerInfo.cs | 80 +- ...ContainerMemoryStatistics.Serialization.cs | 77 + .../Models/ContainerMemoryStatistics.cs | 49 +- ...etworkInterfaceStatistics.Serialization.cs | 157 + .../ContainerNetworkInterfaceStatistics.cs | 76 +- .../ContainerThrottlingData.Serialization.cs | 77 + .../Models/ContainerThrottlingData.cs | 49 +- .../Models/ContinuousWebJob.Serialization.cs | 215 + .../src/Generated/Models/ContinuousWebJob.cs | 142 +- ...ontinuousWebJobCollection.Serialization.cs | 41 + .../Models/ContinuousWebJobCollection.cs | 44 + .../ContinuousWebJobStatus.Serialization.cs | 34 + .../Models/ContinuousWebJobStatus.cs | 76 +- .../Models/CookieExpiration.Serialization.cs | 100 + .../src/Generated/Models/CookieExpiration.cs | 62 +- ...ookieExpirationConvention.Serialization.cs | 28 + .../Models/CookieExpirationConvention.cs | 58 +- .../Models/CorsSettings.Serialization.cs | 72 + .../src/Generated/Models/CorsSettings.cs | 73 +- .../CsmMoveResourceEnvelope.Serialization.cs | 36 + .../Models/CsmMoveResourceEnvelope.cs | 82 +- .../CsmOperationCollection.Serialization.cs | 41 + .../Models/CsmOperationCollection.cs | 44 + .../CsmOperationDescription.Serialization.cs | 57 + .../Models/CsmOperationDescription.cs | 70 +- ...tionDescriptionProperties.Serialization.cs | 34 + .../CsmOperationDescriptionProperties.cs | 49 +- .../CsmOperationDisplay.Serialization.cs | 47 + .../Generated/Models/CsmOperationDisplay.cs | 67 +- ...entialsPoliciesCollection.Serialization.cs | 105 + ...PublishingCredentialsPoliciesCollection.cs | 92 +- ...CredentialsPoliciesEntity.Serialization.cs | 89 + .../CsmPublishingCredentialsPoliciesEntity.cs | 75 +- ...mPublishingProfileOptions.Serialization.cs | 31 + .../Models/CsmPublishingProfileOptions.cs | 63 +- .../Models/CsmSlotEntity.Serialization.cs | 25 + .../src/Generated/Models/CsmSlotEntity.cs | 85 +- .../Models/CsmUsageQuota.Serialization.cs | 74 + .../src/Generated/Models/CsmUsageQuota.cs | 94 +- .../CsmUsageQuotaCollection.Serialization.cs | 41 + .../Models/CsmUsageQuotaCollection.cs | 44 + .../Generated/Models/CustomDomainStatus.cs | 63 + ...stomHostNameDnsRecordType.Serialization.cs | 28 + .../Models/CustomHostNameDnsRecordType.cs | 58 +- ...tomHostnameAnalysisResult.Serialization.cs | 265 + .../Models/CustomHostnameAnalysisResult.cs | 198 +- ...stomOpenIdConnectProvider.Serialization.cs | 121 + .../Models/CustomOpenIdConnectProvider.cs | 66 +- .../DataProviderMetadata.Serialization.cs | 57 + .../Generated/Models/DataProviderMetadata.cs | 35 + .../Models/DataSource.Serialization.cs | 82 + .../src/Generated/Models/DataSource.cs | 65 +- .../DataTableResponseColumn.Serialization.cs | 62 + .../Models/DataTableResponseColumn.cs | 62 +- .../DataTableResponseObject.Serialization.cs | 103 + .../Models/DataTableResponseObject.cs | 72 +- .../DatabaseBackupSetting.Serialization.cs | 70 + .../Generated/Models/DatabaseBackupSetting.cs | 102 +- .../src/Generated/Models/DatabaseType.cs | 67 +- .../DefaultErrorResponse.Serialization.cs | 45 + .../Generated/Models/DefaultErrorResponse.cs | 51 +- ...DefaultErrorResponseError.Serialization.cs | 97 + .../Models/DefaultErrorResponseError.cs | 97 +- ...rResponseErrorDetailsItem.Serialization.cs | 62 + .../DefaultErrorResponseErrorDetailsItem.cs | 76 +- .../DeletedAppRestoreRequest.Serialization.cs | 127 + .../Models/DeletedAppRestoreRequest.cs | 95 +- .../Models/DeletedSite.Serialization.cs | 126 + .../src/Generated/Models/DeletedSite.cs | 134 +- .../DeletedWebAppCollection.Serialization.cs | 41 + .../Models/DeletedWebAppCollection.cs | 44 + .../Models/Deployment.Serialization.cs | 193 + .../src/Generated/Models/Deployment.cs | 129 +- .../DeploymentCollection.Serialization.cs | 41 + .../Generated/Models/DeploymentCollection.cs | 44 + .../DeploymentLocations.Serialization.cs | 72 + .../Generated/Models/DeploymentLocations.cs | 77 +- ...etectorAbnormalTimePeriod.Serialization.cs | 179 + .../Models/DetectorAbnormalTimePeriod.cs | 123 +- .../DetectorDefinition.Serialization.cs | 107 + .../Generated/Models/DetectorDefinition.cs | 90 +- .../Models/DetectorInfo.Serialization.cs | 114 + .../src/Generated/Models/DetectorInfo.cs | 107 +- .../Models/DetectorResponse.Serialization.cs | 174 + .../src/Generated/Models/DetectorResponse.cs | 86 +- ...etectorResponseCollection.Serialization.cs | 41 + .../Models/DetectorResponseCollection.cs | 44 + .../Models/DetectorType.Serialization.cs | 30 + .../src/Generated/Models/DetectorType.cs | 20 + .../DiagnosticAnalysis.Serialization.cs | 185 + .../Generated/Models/DiagnosticAnalysis.cs | 110 +- ...gnosticAnalysisCollection.Serialization.cs | 41 + .../Models/DiagnosticAnalysisCollection.cs | 44 + .../DiagnosticCategory.Serialization.cs | 79 + .../Generated/Models/DiagnosticCategory.cs | 60 +- ...gnosticCategoryCollection.Serialization.cs | 41 + .../Models/DiagnosticCategoryCollection.cs | 44 + .../Models/DiagnosticData.Serialization.cs | 61 + .../src/Generated/Models/DiagnosticData.cs | 55 +- ...gnosticDetectorCollection.Serialization.cs | 41 + .../Models/DiagnosticDetectorCollection.cs | 44 + ...iagnosticDetectorResponse.Serialization.cs | 243 + .../Models/DiagnosticDetectorResponse.cs | 135 +- .../DiagnosticMetricSample.Serialization.cs | 121 + .../Models/DiagnosticMetricSample.cs | 109 +- .../DiagnosticMetricSet.Serialization.cs | 122 + .../Generated/Models/DiagnosticMetricSet.cs | 104 +- .../Models/Dimension.Serialization.cs | 52 + .../src/Generated/Models/Dimension.cs | 68 +- .../Generated/Models/DnsType.Serialization.cs | 28 + .../src/Generated/Models/DnsType.cs | 58 +- ...DnsVerificationTestResult.Serialization.cs | 30 + .../Models/DnsVerificationTestResult.cs | 64 +- .../Generated/Models/Domain.Serialization.cs | 390 + .../src/Generated/Models/Domain.cs | 335 +- ...inAvailabilityCheckResult.Serialization.cs | 51 + .../Models/DomainAvailabilityCheckResult.cs | 82 +- .../Models/DomainCollection.Serialization.cs | 41 + .../src/Generated/Models/DomainCollection.cs | 44 + ...inControlCenterSsoRequest.Serialization.cs | 41 + .../Models/DomainControlCenterSsoRequest.cs | 75 +- ...DomainOwnershipIdentifier.Serialization.cs | 84 + .../Models/DomainOwnershipIdentifier.cs | 57 +- ...rshipIdentifierCollection.Serialization.cs | 41 + .../DomainOwnershipIdentifierCollection.cs | 44 + .../DomainPatchResource.Serialization.cs | 355 + .../Generated/Models/DomainPatchResource.cs | 321 +- ...PropertiesDomainNotRenewableReasonsItem.cs | 54 + ...PropertiesDomainNotRenewableReasonsItem.cs | 54 + .../DomainPurchaseConsent.Serialization.cs | 84 + .../Generated/Models/DomainPurchaseConsent.cs | 78 +- ...mendationSearchParameters.Serialization.cs | 31 + .../DomainRecommendationSearchParameters.cs | 59 +- .../Models/DomainStatus.Serialization.cs | 66 + .../src/Generated/Models/DomainStatus.cs | 172 +- .../Models/DomainType.Serialization.cs | 28 + .../src/Generated/Models/DomainType.cs | 58 +- .../Models/EnabledConfig.Serialization.cs | 45 + .../src/Generated/Models/EnabledConfig.cs | 47 +- .../EndpointDependency.Serialization.cs | 46 + .../Generated/Models/EndpointDependency.cs | 68 +- .../Models/EndpointDetail.Serialization.cs | 62 + .../src/Generated/Models/EndpointDetail.cs | 88 +- .../src/Generated/Models/Enum4.cs | 60 + .../src/Generated/Models/Enum5.cs | 54 + .../src/Generated/Models/Enum6.cs | 54 + .../src/Generated/Models/Enum7.cs | 54 + .../src/Generated/Models/Enum8.cs | 54 + .../src/Generated/Models/Enum9.cs | 60 + .../Models/ErrorEntity.Serialization.cs | 80 + .../src/Generated/Models/ErrorEntity.cs | 106 +- .../Models/Experiments.Serialization.cs | 56 + .../src/Generated/Models/Experiments.cs | 53 +- .../Models/Facebook.Serialization.cs | 132 + .../src/Generated/Models/Facebook.cs | 70 +- ...stemApplicationLogsConfig.Serialization.cs | 45 + .../Models/FileSystemApplicationLogsConfig.cs | 49 +- .../FileSystemHttpLogsConfig.Serialization.cs | 77 + .../Models/FileSystemHttpLogsConfig.cs | 92 +- .../FileSystemTokenStore.Serialization.cs | 84 + .../Generated/Models/FileSystemTokenStore.cs | 52 +- .../Models/ForwardProxy.Serialization.cs | 111 + .../src/Generated/Models/ForwardProxy.cs | 68 +- .../ForwardProxyConvention.Serialization.cs | 30 + .../Models/ForwardProxyConvention.cs | 64 +- .../Models/FrequencyUnit.Serialization.cs | 28 + .../src/Generated/Models/FrequencyUnit.cs | 58 +- .../src/Generated/Models/FtpsState.cs | 63 +- .../FunctionAppMajorVersion.Serialization.cs | 52 + .../Models/FunctionAppMajorVersion.cs | 40 + .../FunctionAppMinorVersion.Serialization.cs | 46 + .../Models/FunctionAppMinorVersion.cs | 36 + ...unctionAppRuntimeSettings.Serialization.cs | 184 + .../Models/FunctionAppRuntimeSettings.cs | 86 + .../FunctionAppRuntimes.Serialization.cs | 45 + .../Generated/Models/FunctionAppRuntimes.cs | 32 + .../Models/FunctionAppStack.Serialization.cs | 119 + .../src/Generated/Models/FunctionAppStack.cs | 52 + ...unctionAppStackCollection.Serialization.cs | 41 + .../Models/FunctionAppStackCollection.cs | 44 + .../Models/FunctionEnvelope.Serialization.cs | 243 + .../src/Generated/Models/FunctionEnvelope.cs | 163 +- ...unctionEnvelopeCollection.Serialization.cs | 41 + .../Models/FunctionEnvelopeCollection.cs | 44 + .../Models/FunctionSecrets.Serialization.cs | 35 + .../src/Generated/Models/FunctionSecrets.cs | 59 +- .../Models/GeoRegion.Serialization.cs | 91 + .../src/Generated/Models/GeoRegion.cs | 79 +- .../GeoRegionCollection.Serialization.cs | 41 + .../Generated/Models/GeoRegionCollection.cs | 44 + .../Generated/Models/GitHub.Serialization.cs | 121 + .../src/Generated/Models/GitHub.cs | 64 +- ...ubActionCodeConfiguration.Serialization.cs | 51 + .../Models/GitHubActionCodeConfiguration.cs | 32 + ...GitHubActionConfiguration.Serialization.cs | 93 + .../Models/GitHubActionConfiguration.cs | 40 + ...ionContainerConfiguration.Serialization.cs | 73 + .../GitHubActionContainerConfiguration.cs | 40 + ...ActionWebAppStackSettings.Serialization.cs | 40 + .../Models/GitHubActionWebAppStackSettings.cs | 32 + .../GlobalCsmSkuDescription.Serialization.cs | 91 + .../Models/GlobalCsmSkuDescription.cs | 119 +- .../Models/GlobalValidation.Serialization.cs | 143 + .../src/Generated/Models/GlobalValidation.cs | 87 +- .../Generated/Models/Google.Serialization.cs | 137 + .../src/Generated/Models/Google.cs | 70 +- .../Models/HandlerMapping.Serialization.cs | 62 + .../src/Generated/Models/HandlerMapping.cs | 68 +- .../Models/HostKeys.Serialization.cs | 62 + .../src/Generated/Models/HostKeys.cs | 76 +- .../Models/HostName.Serialization.cs | 85 + .../src/Generated/Models/HostName.cs | 121 +- .../Models/HostNameBinding.Serialization.cs | 187 + .../src/Generated/Models/HostNameBinding.cs | 134 +- ...HostNameBindingCollection.Serialization.cs | 41 + .../Models/HostNameBindingCollection.cs | 44 + .../Models/HostNameSslState.Serialization.cs | 110 + .../src/Generated/Models/HostNameSslState.cs | 95 +- .../Models/HostNameType.Serialization.cs | 28 + .../src/Generated/Models/HostNameType.cs | 58 +- .../Models/HostType.Serialization.cs | 28 + .../src/Generated/Models/HostType.cs | 58 +- ...EnvironmentDeploymentInfo.Serialization.cs | 35 + .../HostingEnvironmentDeploymentInfo.cs | 62 +- ...ingEnvironmentDiagnostics.Serialization.cs | 35 + .../Models/HostingEnvironmentDiagnostics.cs | 61 +- ...HostingEnvironmentProfile.Serialization.cs | 52 + .../Models/HostingEnvironmentProfile.cs | 67 +- .../HostingEnvironmentStatus.Serialization.cs | 32 + .../Models/HostingEnvironmentStatus.cs | 70 +- .../Models/HttpLogsConfig.Serialization.cs | 61 + .../src/Generated/Models/HttpLogsConfig.cs | 68 +- .../Models/HttpSettings.Serialization.cs | 121 + .../src/Generated/Models/HttpSettings.cs | 64 +- .../HttpSettingsRoutes.Serialization.cs | 84 + .../Generated/Models/HttpSettingsRoutes.cs | 52 +- .../Models/HybridConnection.Serialization.cs | 166 + .../src/Generated/Models/HybridConnection.cs | 126 +- ...ybridConnectionCollection.Serialization.cs | 41 + .../Models/HybridConnectionCollection.cs | 44 + .../HybridConnectionKey.Serialization.cs | 85 + .../Generated/Models/HybridConnectionKey.cs | 70 +- .../HybridConnectionLimits.Serialization.cs | 95 + .../Models/HybridConnectionLimits.cs | 72 +- .../Models/Identifier.Serialization.cs | 84 + .../src/Generated/Models/Identifier.cs | 57 +- .../IdentifierCollection.Serialization.cs | 41 + .../Generated/Models/IdentifierCollection.cs | 44 + .../Models/IdentityProviders.Serialization.cs | 229 + .../src/Generated/Models/IdentityProviders.cs | 104 +- .../Models/InAvailabilityReasonType.cs | 59 +- ...nboundEnvironmentEndpoint.Serialization.cs | 62 + .../Models/InboundEnvironmentEndpoint.cs | 83 +- ...ronmentEndpointCollection.Serialization.cs | 41 + .../InboundEnvironmentEndpointCollection.cs | 44 + .../Models/InsightStatus.Serialization.cs | 34 + .../src/Generated/Models/InsightStatus.cs | 24 + .../src/Generated/Models/IpFilterTag.cs | 63 +- .../IpSecurityRestriction.Serialization.cs | 197 + .../Generated/Models/IpSecurityRestriction.cs | 219 +- .../Models/IssueType.Serialization.cs | 40 + .../src/Generated/Models/IssueType.cs | 94 +- .../Models/JwtClaimChecks.Serialization.cs | 126 + .../src/Generated/Models/JwtClaimChecks.cs | 69 +- .../Generated/Models/KeyInfo.Serialization.cs | 51 + .../src/Generated/Models/KeyInfo.cs | 53 +- .../KeyValuePairStringObject.Serialization.cs | 40 + .../Models/KeyValuePairStringObject.cs | 31 + .../KeyVaultSecretStatus.Serialization.cs | 46 + .../Generated/Models/KeyVaultSecretStatus.cs | 112 +- .../KubeEnvironmentProfile.Serialization.cs | 52 + .../Models/KubeEnvironmentProfile.cs | 36 + .../LegacyMicrosoftAccount.Serialization.cs | 137 + .../Models/LegacyMicrosoftAccount.cs | 44 + ...inuxJavaContainerSettings.Serialization.cs | 102 + .../Models/LinuxJavaContainerSettings.cs | 58 + .../src/Generated/Models/LoadBalancingMode.cs | 67 +- .../Models/LocalizableString.Serialization.cs | 35 + .../src/Generated/Models/LocalizableString.cs | 59 +- .../Models/LogLevel.Serialization.cs | 34 + .../src/Generated/Models/LogLevel.cs | 76 +- .../Models/LogSpecification.Serialization.cs | 47 + .../src/Generated/Models/LogSpecification.cs | 67 +- .../Generated/Models/Login.Serialization.cs | 180 + .../src/Generated/Models/Login.cs | 94 +- .../Models/LoginRoutes.Serialization.cs | 84 + .../src/Generated/Models/LoginRoutes.cs | 52 +- .../Models/LoginScopes.Serialization.cs | 100 + .../src/Generated/Models/LoginScopes.cs | 60 +- .../Models/MSDeploy.Serialization.cs | 177 + .../src/Generated/Models/MSDeploy.cs | 143 +- .../Models/MSDeployLog.Serialization.cs | 90 + .../src/Generated/Models/MSDeployLog.cs | 65 +- .../Models/MSDeployLogEntry.Serialization.cs | 52 + .../src/Generated/Models/MSDeployLogEntry.cs | 73 +- .../MSDeployLogEntryType.Serialization.cs | 30 + .../Generated/Models/MSDeployLogEntryType.cs | 64 +- ...MSDeployProvisioningState.Serialization.cs | 34 + .../Models/MSDeployProvisioningState.cs | 76 +- .../Models/MSDeployStatus.Serialization.cs | 124 + .../src/Generated/Models/MSDeployStatus.cs | 105 +- .../ManagedPipelineMode.Serialization.cs | 28 + .../Generated/Models/ManagedPipelineMode.cs | 58 +- .../ManagedServiceIdentity.Serialization.cs | 85 + .../Models/ManagedServiceIdentity.cs | 92 +- ...anagedServiceIdentityType.Serialization.cs | 32 + .../Models/ManagedServiceIdentityType.cs | 70 +- .../MetricAvailability.Serialization.cs | 35 + .../Generated/Models/MetricAvailability.cs | 53 +- .../MetricSpecification.Serialization.cs | 186 + .../Generated/Models/MetricSpecification.cs | 167 +- .../MigrateMySqlRequest.Serialization.cs | 100 + .../Generated/Models/MigrateMySqlRequest.cs | 84 +- .../MigrateMySqlStatus.Serialization.cs | 101 + .../Generated/Models/MigrateMySqlStatus.cs | 84 +- .../MySqlMigrationType.Serialization.cs | 28 + .../Generated/Models/MySqlMigrationType.cs | 58 +- .../Models/NameIdentifier.Serialization.cs | 40 + .../src/Generated/Models/NameIdentifier.cs | 45 +- .../NameIdentifierCollection.Serialization.cs | 41 + .../Models/NameIdentifierCollection.cs | 44 + .../Models/NameValuePair.Serialization.cs | 51 + .../src/Generated/Models/NameValuePair.cs | 53 +- .../Models/NetworkFeatures.Serialization.cs | 123 + .../src/Generated/Models/NetworkFeatures.cs | 100 +- .../Models/NetworkTrace.Serialization.cs | 41 + .../src/Generated/Models/NetworkTrace.cs | 74 +- .../Generated/Models/Nonce.Serialization.cs | 100 + .../src/Generated/Models/Nonce.cs | 58 +- .../Models/NotificationLevel.Serialization.cs | 32 + .../src/Generated/Models/NotificationLevel.cs | 70 +- ...IdConnectClientCredential.Serialization.cs | 95 + .../Models/OpenIdConnectClientCredential.cs | 66 +- .../OpenIdConnectConfig.Serialization.cs | 128 + .../Generated/Models/OpenIdConnectConfig.cs | 76 +- .../OpenIdConnectLogin.Serialization.cs | 111 + .../Generated/Models/OpenIdConnectLogin.cs | 66 +- ...OpenIdConnectRegistration.Serialization.cs | 116 + .../Models/OpenIdConnectRegistration.cs | 64 +- .../Models/Operation.Serialization.cs | 108 + .../src/Generated/Models/Operation.cs | 133 +- .../Models/OperationStatus.Serialization.cs | 34 + .../src/Generated/Models/OperationStatus.cs | 76 +- ...tboundEnvironmentEndpoint.Serialization.cs | 46 + .../Models/OutboundEnvironmentEndpoint.cs | 74 +- ...ronmentEndpointCollection.Serialization.cs | 41 + .../OutboundEnvironmentEndpointCollection.cs | 44 + .../PerfMonCounterCollection.Serialization.cs | 41 + .../Models/PerfMonCounterCollection.cs | 44 + .../Models/PerfMonResponse.Serialization.cs | 46 + .../src/Generated/Models/PerfMonResponse.cs | 69 +- .../Models/PerfMonSample.Serialization.cs | 52 + .../src/Generated/Models/PerfMonSample.cs | 73 +- .../Models/PerfMonSet.Serialization.cs | 75 + .../src/Generated/Models/PerfMonSet.cs | 98 +- .../Models/PremierAddOn.Serialization.cs | 164 + .../src/Generated/Models/PremierAddOn.cs | 118 +- .../Models/PremierAddOnOffer.Serialization.cs | 198 + .../src/Generated/Models/PremierAddOnOffer.cs | 137 +- ...emierAddOnOfferCollection.Serialization.cs | 41 + .../Models/PremierAddOnOfferCollection.cs | 44 + ...PremierAddOnPatchResource.Serialization.cs | 128 + .../Models/PremierAddOnPatchResource.cs | 91 +- .../Models/PrivateAccess.Serialization.cs | 116 + .../src/Generated/Models/PrivateAccess.cs | 76 +- .../PrivateAccessSubnet.Serialization.cs | 56 + .../Generated/Models/PrivateAccessSubnet.cs | 54 +- ...ivateAccessVirtualNetwork.Serialization.cs | 94 + .../Models/PrivateAccessVirtualNetwork.cs | 85 +- ...pointConnectionCollection.Serialization.cs | 41 + .../PrivateEndpointConnectionCollection.cs | 44 + ...onApprovalRequestResource.Serialization.cs | 89 + ...teLinkConnectionApprovalRequestResource.cs | 57 +- ...rivateLinkConnectionState.Serialization.cs | 62 + .../Models/PrivateLinkConnectionState.cs | 63 +- .../PrivateLinkResource.Serialization.cs | 47 + .../Generated/Models/PrivateLinkResource.cs | 115 +- ...ateLinkResourceProperties.Serialization.cs | 62 + .../Models/PrivateLinkResourceProperties.cs | 80 +- ...ivateLinkResourcesWrapper.Serialization.cs | 35 + .../Models/PrivateLinkResourcesWrapper.cs | 86 +- .../Models/ProcessInfo.Serialization.cs | 642 + .../src/Generated/Models/ProcessInfo.cs | 367 +- .../ProcessInfoCollection.Serialization.cs | 41 + .../Generated/Models/ProcessInfoCollection.cs | 44 + .../Models/ProcessModuleInfo.Serialization.cs | 204 + .../src/Generated/Models/ProcessModuleInfo.cs | 139 +- ...ocessModuleInfoCollection.Serialization.cs | 41 + .../Models/ProcessModuleInfoCollection.cs | 44 + .../Models/ProcessThreadInfo.Serialization.cs | 221 + .../src/Generated/Models/ProcessThreadInfo.cs | 151 +- ...ocessThreadInfoCollection.Serialization.cs | 41 + .../Models/ProcessThreadInfoCollection.cs | 44 + .../Models/ProvisioningState.Serialization.cs | 34 + .../src/Generated/Models/ProvisioningState.cs | 76 +- .../Models/ProxyOnlyResource.Serialization.cs | 58 + .../src/Generated/Models/ProxyOnlyResource.cs | 80 +- .../Models/PublicCertificate.Serialization.cs | 112 + .../src/Generated/Models/PublicCertificate.cs | 80 +- ...blicCertificateCollection.Serialization.cs | 41 + .../Models/PublicCertificateCollection.cs | 44 + ...PublicCertificateLocation.Serialization.cs | 30 + .../Models/PublicCertificateLocation.cs | 64 +- .../Models/PublishingProfileFormat.cs | 64 +- .../Models/PushSettings.Serialization.cs | 122 + .../src/Generated/Models/PushSettings.cs | 111 +- .../QueryUtterancesResult.Serialization.cs | 61 + .../Generated/Models/QueryUtterancesResult.cs | 32 + .../QueryUtterancesResults.Serialization.cs | 67 + .../Models/QueryUtterancesResults.cs | 36 + .../Models/RampUpRule.Serialization.cs | 142 + .../src/Generated/Models/RampUpRule.cs | 152 +- .../Models/Recommendation.Serialization.cs | 413 + .../src/Generated/Models/Recommendation.cs | 304 +- .../RecommendationCollection.Serialization.cs | 41 + .../Models/RecommendationCollection.cs | 44 + .../RecommendationRule.Serialization.cs | 243 + .../Generated/Models/RecommendationRule.cs | 193 +- .../Models/RedundancyMode.Serialization.cs | 34 + .../src/Generated/Models/RedundancyMode.cs | 76 +- ...ueCertificateOrderRequest.Serialization.cs | 132 + .../Models/ReissueCertificateOrderRequest.cs | 88 +- ...ayServiceConnectionEntity.Serialization.cs | 155 + .../Models/RelayServiceConnectionEntity.cs | 86 +- ...PrivateEndpointConnection.Serialization.cs | 138 + .../Models/RemotePrivateEndpointConnection.cs | 47 + ...ointConnectionARMResource.Serialization.cs | 138 + ...otePrivateEndpointConnectionARMResource.cs | 47 + .../Models/Rendering.Serialization.cs | 67 + .../src/Generated/Models/Rendering.cs | 65 +- .../Models/RenderingType.Serialization.cs | 74 + .../src/Generated/Models/RenderingType.cs | 114 +- ...ewCertificateOrderRequest.Serialization.cs | 116 + .../Models/RenewCertificateOrderRequest.cs | 78 +- .../RequestsBasedTrigger.Serialization.cs | 56 + .../Generated/Models/RequestsBasedTrigger.cs | 53 +- .../Models/ResolveStatus.Serialization.cs | 46 + .../src/Generated/Models/ResolveStatus.cs | 36 + .../Models/Resource.Serialization.cs | 94 + .../src/Generated/Models/Resource.cs | 127 +- .../ResourceCollection.Serialization.cs | 41 + .../Generated/Models/ResourceCollection.cs | 44 + .../ResourceHealthMetadata.Serialization.cs | 100 + .../Models/ResourceHealthMetadata.cs | 68 +- ...eHealthMetadataCollection.Serialization.cs | 41 + .../ResourceHealthMetadataCollection.cs | 44 + ...esourceMetricAvailability.Serialization.cs | 35 + .../Models/ResourceMetricAvailability.cs | 60 +- .../ResourceMetricDefinition.Serialization.cs | 124 + .../Models/ResourceMetricDefinition.cs | 110 +- ...etricDefinitionCollection.Serialization.cs | 41 + .../ResourceMetricDefinitionCollection.cs | 44 + .../ResourceNameAvailability.Serialization.cs | 51 + .../Models/ResourceNameAvailability.cs | 91 +- ...ceNameAvailabilityRequest.Serialization.cs | 30 + .../Models/ResourceNameAvailabilityRequest.cs | 104 +- .../src/Generated/Models/ResourceScopeType.cs | 63 +- ...PrivateEndpointConnection.Serialization.cs | 141 + ...EnvelopeRemotePrivateEndpointConnection.cs | 85 + .../Models/ResponseMetaData.Serialization.cs | 45 + .../src/Generated/Models/ResponseMetaData.cs | 42 +- .../Models/RestoreRequest.Serialization.cs | 235 + .../src/Generated/Models/RestoreRequest.cs | 206 +- .../src/Generated/Models/RouteType.cs | 66 +- .../Models/SampleUtterance.Serialization.cs | 78 + .../src/Generated/Models/SampleUtterance.cs | 40 + .../src/Generated/Models/ScmType.cs | 107 +- .../ServiceSpecification.Serialization.cs | 56 + .../Generated/Models/ServiceSpecification.cs | 61 +- .../Generated/Models/Site.Serialization.cs | 657 + .../src/Generated/Models/Site.cs | 579 +- .../Models/SiteAuthSettings.Serialization.cs | 627 + .../src/Generated/Models/SiteAuthSettings.cs | 682 +- .../SiteAuthSettingsV2.Serialization.cs | 153 + .../Generated/Models/SiteAuthSettingsV2.cs | 76 +- .../SiteAvailabilityState.Serialization.cs | 30 + .../Generated/Models/SiteAvailabilityState.cs | 64 +- .../Models/SiteCloneability.Serialization.cs | 83 + .../src/Generated/Models/SiteCloneability.cs | 97 +- ...SiteCloneabilityCriterion.Serialization.cs | 35 + .../Models/SiteCloneabilityCriterion.cs | 59 +- .../Models/SiteConfig.Serialization.cs | 1042 + .../src/Generated/Models/SiteConfig.cs | 664 +- ...onfigPropertiesDictionary.Serialization.cs | 52 + .../Models/SiteConfigPropertiesDictionary.cs | 40 + .../SiteConfigResource.Serialization.cs | 1086 + .../Generated/Models/SiteConfigResource.cs | 675 +- ...eConfigResourceCollection.Serialization.cs | 41 + .../Models/SiteConfigResourceCollection.cs | 44 + ...ConfigurationSnapshotInfo.Serialization.cs | 96 + .../Models/SiteConfigurationSnapshotInfo.cs | 73 +- ...ionSnapshotInfoCollection.Serialization.cs | 41 + ...SiteConfigurationSnapshotInfoCollection.cs | 44 + .../Models/SiteExtensionInfo.Serialization.cs | 335 + .../src/Generated/Models/SiteExtensionInfo.cs | 226 +- ...teExtensionInfoCollection.Serialization.cs | 41 + .../Models/SiteExtensionInfoCollection.cs | 44 + .../Models/SiteExtensionType.Serialization.cs | 28 + .../src/Generated/Models/SiteExtensionType.cs | 58 +- .../Models/SiteLimits.Serialization.cs | 77 + .../src/Generated/Models/SiteLimits.cs | 64 +- .../Models/SiteLoadBalancing.Serialization.cs | 36 + .../src/Generated/Models/SiteLoadBalancing.cs | 80 +- .../Models/SiteLogsConfig.Serialization.cs | 137 + .../src/Generated/Models/SiteLogsConfig.cs | 101 +- .../Models/SiteMachineKey.Serialization.cs | 47 + .../src/Generated/Models/SiteMachineKey.cs | 79 +- .../Models/SitePatchResource.Serialization.cs | 622 + .../src/Generated/Models/SitePatchResource.cs | 565 +- .../SitePhpErrorLogFlag.Serialization.cs | 117 + .../Generated/Models/SitePhpErrorLogFlag.cs | 83 +- .../Models/SiteRuntimeState.Serialization.cs | 30 + .../src/Generated/Models/SiteRuntimeState.cs | 70 +- .../Models/SiteSeal.Serialization.cs | 29 + .../src/Generated/Models/SiteSeal.cs | 70 +- .../Models/SiteSealRequest.Serialization.cs | 31 + .../src/Generated/Models/SiteSealRequest.cs | 58 +- .../Models/SiteSourceControl.Serialization.cs | 175 + .../src/Generated/Models/SiteSourceControl.cs | 120 +- .../Models/SkuCapacity.Serialization.cs | 104 + .../src/Generated/Models/SkuCapacity.cs | 85 +- .../Models/SkuDescription.Serialization.cs | 158 + .../src/Generated/Models/SkuDescription.cs | 116 +- .../Generated/Models/SkuInfo.Serialization.cs | 51 + .../src/Generated/Models/SkuInfo.cs | 71 +- .../Models/SkuInfoCollection.Serialization.cs | 41 + .../src/Generated/Models/SkuInfoCollection.cs | 44 + .../Models/SkuInfos.Serialization.cs | 46 + .../src/Generated/Models/SkuInfos.cs | 67 +- .../src/Generated/Models/SkuName.cs | 100 +- .../SlotConfigNamesResource.Serialization.cs | 152 + .../Models/SlotConfigNamesResource.cs | 90 +- .../Models/SlotDifference.Serialization.cs | 115 + .../src/Generated/Models/SlotDifference.cs | 127 +- .../SlotDifferenceCollection.Serialization.cs | 41 + .../Models/SlotDifferenceCollection.cs | 44 + .../Models/SlotSwapStatus.Serialization.cs | 47 + .../src/Generated/Models/SlotSwapStatus.cs | 74 +- .../SlowRequestsBasedTrigger.Serialization.cs | 78 + .../Models/SlowRequestsBasedTrigger.cs | 65 +- .../Models/Snapshot.Serialization.cs | 79 + .../src/Generated/Models/Snapshot.cs | 59 +- .../SnapshotCollection.Serialization.cs | 41 + .../Generated/Models/SnapshotCollection.cs | 44 + .../SnapshotRecoverySource.Serialization.cs | 51 + .../Models/SnapshotRecoverySource.cs | 67 +- .../SnapshotRestoreRequest.Serialization.cs | 164 + .../Models/SnapshotRestoreRequest.cs | 130 +- .../Models/Solution.Serialization.cs | 172 + .../src/Generated/Models/Solution.cs | 106 +- .../Models/SolutionType.Serialization.cs | 30 + .../src/Generated/Models/SolutionType.cs | 64 +- .../Models/SourceControl.Serialization.cs | 123 + .../src/Generated/Models/SourceControl.cs | 85 +- .../SourceControlCollection.Serialization.cs | 41 + .../Models/SourceControlCollection.cs | 44 + .../Models/SslState.Serialization.cs | 30 + .../src/Generated/Models/SslState.cs | 64 +- .../Models/StackMajorVersion.Serialization.cs | 212 + .../src/Generated/Models/StackMajorVersion.cs | 157 +- .../Models/StackMinorVersion.Serialization.cs | 83 + .../src/Generated/Models/StackMinorVersion.cs | 80 +- .../Models/StackPreferredOs.Serialization.cs | 28 + .../src/Generated/Models/StackPreferredOs.cs | 18 + .../StagingEnvironmentPolicy.Serialization.cs | 28 + .../Models/StagingEnvironmentPolicy.cs | 18 + .../Models/StampCapacity.Serialization.cs | 129 + .../src/Generated/Models/StampCapacity.cs | 172 +- .../StampCapacityCollection.Serialization.cs | 41 + .../Models/StampCapacityCollection.cs | 44 + .../StaticSiteARMResource.Serialization.cs | 310 + .../Generated/Models/StaticSiteARMResource.cs | 186 +- ...taticSiteBuildARMResource.Serialization.cs | 148 + .../Models/StaticSiteBuildARMResource.cs | 136 +- ...StaticSiteBuildCollection.Serialization.cs | 41 + .../Models/StaticSiteBuildCollection.cs | 44 + ...StaticSiteBuildProperties.Serialization.cs | 122 + .../Models/StaticSiteBuildProperties.cs | 84 +- .../StaticSiteCollection.Serialization.cs | 41 + .../Generated/Models/StaticSiteCollection.cs | 44 + ...DomainOverviewARMResource.Serialization.cs | 114 + ...aticSiteCustomDomainOverviewARMResource.cs | 87 +- ...mDomainOverviewCollection.Serialization.cs | 41 + ...taticSiteCustomDomainOverviewCollection.cs | 44 + ...uestPropertiesARMResource.Serialization.cs | 84 + ...ustomDomainRequestPropertiesARMResource.cs | 32 + ...nctionOverviewARMResource.Serialization.cs | 90 + .../StaticSiteFunctionOverviewARMResource.cs | 73 +- ...unctionOverviewCollection.Serialization.cs | 41 + .../StaticSiteFunctionOverviewCollection.cs | 44 + .../StaticSitePatchResource.Serialization.cs | 243 + .../Models/StaticSitePatchResource.cs | 148 +- ...esetPropertiesARMResource.Serialization.cs | 100 + .../StaticSiteResetPropertiesARMResource.cs | 71 +- ...StaticSiteTemplateOptions.Serialization.cs | 89 + .../Models/StaticSiteTemplateOptions.cs | 44 + ...StaticSiteUserARMResource.Serialization.cs | 102 + .../Models/StaticSiteUserARMResource.cs | 91 +- .../StaticSiteUserCollection.Serialization.cs | 41 + .../Models/StaticSiteUserCollection.cs | 44 + ...InvitationRequestResource.Serialization.cs | 133 + ...StaticSiteUserInvitationRequestResource.cs | 97 +- ...nvitationResponseResource.Serialization.cs | 91 + ...taticSiteUserInvitationResponseResource.cs | 74 +- ...teUserProvidedFunctionApp.Serialization.cs | 107 + .../StaticSiteUserProvidedFunctionApp.cs | 42 + ...dedFunctionAppARMResource.Serialization.cs | 107 + ...cSiteUserProvidedFunctionAppARMResource.cs | 42 + ...dedFunctionAppsCollection.Serialization.cs | 41 + ...cSiteUserProvidedFunctionAppsCollection.cs | 44 + ...eZipDeploymentARMResource.Serialization.cs | 128 + .../StaticSiteZipDeploymentARMResource.cs | 48 + ...taticSitesWorkflowPreview.Serialization.cs | 85 + .../Models/StaticSitesWorkflowPreview.cs | 36 + ...tesWorkflowPreviewRequest.Serialization.cs | 111 + .../StaticSitesWorkflowPreviewRequest.cs | 40 + .../Generated/Models/Status.Serialization.cs | 56 + .../src/Generated/Models/Status.cs | 32 + .../StatusCodesBasedTrigger.Serialization.cs | 115 + .../Models/StatusCodesBasedTrigger.cs | 81 +- ...tusCodesRangeBasedTrigger.Serialization.cs | 78 + .../Models/StatusCodesRangeBasedTrigger.cs | 39 + .../Models/StatusOptions.Serialization.cs | 30 + .../src/Generated/Models/StatusOptions.cs | 64 +- .../StorageMigrationOptions.Serialization.cs | 127 + .../Models/StorageMigrationOptions.cs | 108 +- .../StorageMigrationResponse.Serialization.cs | 79 + .../Models/StorageMigrationResponse.cs | 62 +- .../Models/StringDictionary.Serialization.cs | 86 + .../src/Generated/Models/StringDictionary.cs | 62 +- .../Models/StringList.Serialization.cs | 85 + .../src/Generated/Models/StringList.cs | 36 + .../Models/SupportTopic.Serialization.cs | 35 + .../src/Generated/Models/SupportTopic.cs | 32 + .../Generated/Models/SupportedTlsVersions.cs | 63 +- .../SwiftVirtualNetwork.Serialization.cs | 100 + .../Generated/Models/SwiftVirtualNetwork.cs | 73 +- .../Models/TldLegalAgreement.Serialization.cs | 47 + .../src/Generated/Models/TldLegalAgreement.cs | 125 +- ...dLegalAgreementCollection.Serialization.cs | 41 + .../Models/TldLegalAgreementCollection.cs | 44 + .../Models/TokenStore.Serialization.cs | 137 + .../src/Generated/Models/TokenStore.cs | 74 +- .../Models/TopLevelDomain.Serialization.cs | 89 + .../src/Generated/Models/TopLevelDomain.cs | 61 +- ...evelDomainAgreementOption.Serialization.cs | 31 + .../Models/TopLevelDomainAgreementOption.cs | 64 +- .../TopLevelDomainCollection.Serialization.cs | 41 + .../Models/TopLevelDomainCollection.cs | 44 + .../src/Generated/Models/TriggerTypes.cs | 59 +- .../TriggeredJobHistory.Serialization.cs | 100 + .../Generated/Models/TriggeredJobHistory.cs | 66 +- ...geredJobHistoryCollection.Serialization.cs | 41 + .../Models/TriggeredJobHistoryCollection.cs | 44 + .../Models/TriggeredJobRun.Serialization.cs | 210 + .../src/Generated/Models/TriggeredJobRun.cs | 145 +- .../Models/TriggeredWebJob.Serialization.cs | 215 + .../src/Generated/Models/TriggeredWebJob.cs | 139 +- ...TriggeredWebJobCollection.Serialization.cs | 41 + .../Models/TriggeredWebJobCollection.cs | 44 + .../TriggeredWebJobStatus.Serialization.cs | 30 + .../Generated/Models/TriggeredWebJobStatus.cs | 64 +- .../Generated/Models/Twitter.Serialization.cs | 105 + .../src/Generated/Models/Twitter.cs | 58 +- .../TwitterRegistration.Serialization.cs | 95 + .../Generated/Models/TwitterRegistration.cs | 64 +- ...authenticatedClientAction.Serialization.cs | 28 + .../Models/UnauthenticatedClientAction.cs | 58 +- ...thenticatedClientActionV2.Serialization.cs | 32 + .../Models/UnauthenticatedClientActionV2.cs | 70 +- .../Generated/Models/Usage.Serialization.cs | 142 + .../src/Generated/Models/Usage.cs | 136 +- .../Models/UsageCollection.Serialization.cs | 41 + .../src/Generated/Models/UsageCollection.cs | 44 + .../Models/UsageState.Serialization.cs | 28 + .../src/Generated/Models/UsageState.cs | 58 +- .../Generated/Models/User.Serialization.cs | 128 + .../src/Generated/Models/User.cs | 106 +- .../Models/ValidateRequest.Serialization.cs | 100 + .../src/Generated/Models/ValidateRequest.cs | 238 +- .../Generated/Models/ValidateResourceTypes.cs | 62 +- .../Models/ValidateResponse.Serialization.cs | 40 + .../src/Generated/Models/ValidateResponse.cs | 60 +- .../ValidateResponseError.Serialization.cs | 35 + .../Generated/Models/ValidateResponseError.cs | 59 +- .../VirtualApplication.Serialization.cs | 94 + .../Generated/Models/VirtualApplication.cs | 82 +- .../Models/VirtualDirectory.Serialization.cs | 51 + .../src/Generated/Models/VirtualDirectory.cs | 53 +- .../Models/VirtualIPMapping.Serialization.cs | 99 + .../src/Generated/Models/VirtualIPMapping.cs | 78 +- .../VirtualNetworkProfile.Serialization.cs | 60 + .../Generated/Models/VirtualNetworkProfile.cs | 86 +- .../Models/VnetGateway.Serialization.cs | 95 + .../src/Generated/Models/VnetGateway.cs | 80 +- .../Models/VnetInfo.Serialization.cs | 156 + .../src/Generated/Models/VnetInfo.cs | 132 +- .../Models/VnetParameters.Serialization.cs | 117 + .../src/Generated/Models/VnetParameters.cs | 79 +- .../Models/VnetRoute.Serialization.cs | 111 + .../src/Generated/Models/VnetRoute.cs | 101 +- ...tValidationFailureDetails.Serialization.cs | 153 + .../Models/VnetValidationFailureDetails.cs | 86 +- ...VnetValidationTestFailure.Serialization.cs | 95 + .../Models/VnetValidationTestFailure.cs | 68 +- .../Models/WebAppCollection.Serialization.cs | 41 + .../src/Generated/Models/WebAppCollection.cs | 44 + ...pInstanceStatusCollection.Serialization.cs | 41 + .../Models/WebAppInstanceStatusCollection.cs | 44 + .../WebAppMajorVersion.Serialization.cs | 52 + .../Generated/Models/WebAppMajorVersion.cs | 40 + .../WebAppMinorVersion.Serialization.cs | 46 + .../Generated/Models/WebAppMinorVersion.cs | 36 + .../WebAppRuntimeSettings.Serialization.cs | 129 + .../Generated/Models/WebAppRuntimeSettings.cs | 66 + .../Models/WebAppRuntimes.Serialization.cs | 67 + .../src/Generated/Models/WebAppRuntimes.cs | 40 + .../Models/WebAppStack.Serialization.cs | 119 + .../src/Generated/Models/WebAppStack.cs | 52 + .../WebAppStackCollection.Serialization.cs | 41 + .../Generated/Models/WebAppStackCollection.cs | 44 + .../Generated/Models/WebJob.Serialization.cs | 177 + .../src/Generated/Models/WebJob.cs | 115 +- .../Models/WebJobCollection.Serialization.cs | 41 + .../src/Generated/Models/WebJobCollection.cs | 44 + .../Models/WebJobType.Serialization.cs | 28 + .../src/Generated/Models/WebJobType.cs | 58 +- .../WebSiteInstanceStatus.Serialization.cs | 161 + .../Generated/Models/WebSiteInstanceStatus.cs | 103 +- ...dowsJavaContainerSettings.Serialization.cs | 102 + .../Models/WindowsJavaContainerSettings.cs | 58 + .../WorkerPoolCollection.Serialization.cs | 41 + .../Generated/Models/WorkerPoolCollection.cs | 44 + .../WorkerPoolResource.Serialization.cs | 165 + .../Generated/Models/WorkerPoolResource.cs | 113 +- .../Models/WorkerSizeOptions.Serialization.cs | 48 + .../src/Generated/Models/WorkerSizeOptions.cs | 102 +- .../src/Generated/ProviderRestClient.cs | 1002 + .../Generated/RecommendationsRestClient.cs | 1763 + .../ResourceHealthMetadataRestClient.cs | 869 + .../src/Generated/StaticSitesRestClient.cs | 5359 ++ .../Generated/TopLevelDomainsRestClient.cs | 420 + .../src/Generated/WebAppsRestClient.cs | 44343 ++++++++++++++++ .../Generated/WebSiteManagementRestClient.cs | 1609 + ...Microsoft.Azure.Management.Websites.csproj | 43 +- src/SDKs/_metadata/web_resource-manager.txt | 11 + 948 files changed, 133357 insertions(+), 25970 deletions(-) create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceCertificateOrdersRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServicePlansRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateRegistrationProviderRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DeletedWebAppsRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DiagnosticsRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainRegistrationProviderRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPropertiesDomainNotRenewableReasonsItem.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum4.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum5.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum6.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum7.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum8.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum9.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.Serialization.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/RecommendationsRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ResourceHealthMetadataRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/TopLevelDomainsRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsRestClient.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementRestClient.cs create mode 100644 src/SDKs/_metadata/web_resource-manager.txt diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceCertificateOrdersRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceCertificateOrdersRestClient.cs new file mode 100644 index 000000000000..1c32c7ba3c6f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceCertificateOrdersRestClient.cs @@ -0,0 +1,1999 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class AppServiceCertificateOrdersRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of AppServiceCertificateOrdersRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public AppServiceCertificateOrdersRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all certificate orders in a subscription. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateOrderCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all certificate orders in a subscription. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateOrderCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateValidatePurchaseInformationRequest(AppServiceCertificateOrder appServiceCertificateOrder) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(appServiceCertificateOrder); + request.Content = content; + return message; + } + + /// Description for Validate information for a certificate order. + /// Information for a certificate order. + /// The cancellation token to use. + /// is null. + public async Task ValidatePurchaseInformationAsync(AppServiceCertificateOrder appServiceCertificateOrder, CancellationToken cancellationToken = default) + { + if (appServiceCertificateOrder == null) + { + throw new ArgumentNullException(nameof(appServiceCertificateOrder)); + } + + using var message = CreateValidatePurchaseInformationRequest(appServiceCertificateOrder); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Validate information for a certificate order. + /// Information for a certificate order. + /// The cancellation token to use. + /// is null. + public Response ValidatePurchaseInformation(AppServiceCertificateOrder appServiceCertificateOrder, CancellationToken cancellationToken = default) + { + if (appServiceCertificateOrder == null) + { + throw new ArgumentNullException(nameof(appServiceCertificateOrder)); + } + + using var message = CreateValidatePurchaseInformationRequest(appServiceCertificateOrder); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get certificate orders in a resource group. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateOrderCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get certificate orders in a resource group. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateOrderCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string certificateOrderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order.. + /// The cancellation token to use. + /// or is null. + public async Task> GetAsync(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateGetRequest(resourceGroupName, certificateOrderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateOrder value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceCertificateOrder.DeserializeAppServiceCertificateOrder(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order.. + /// The cancellation token to use. + /// or is null. + public Response Get(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateGetRequest(resourceGroupName, certificateOrderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateOrder value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceCertificateOrder.DeserializeAppServiceCertificateOrder(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string certificateOrderName, AppServiceCertificateOrder certificateDistinguishedName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(certificateDistinguishedName); + request.Content = content; + return message; + } + + /// Description for Create or update a certificate purchase order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Distinguished name to use for the certificate order. + /// The cancellation token to use. + /// , , or is null. + public async Task CreateOrUpdateAsync(string resourceGroupName, string certificateOrderName, AppServiceCertificateOrder certificateDistinguishedName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (certificateDistinguishedName == null) + { + throw new ArgumentNullException(nameof(certificateDistinguishedName)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, certificateOrderName, certificateDistinguishedName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create or update a certificate purchase order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Distinguished name to use for the certificate order. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdate(string resourceGroupName, string certificateOrderName, AppServiceCertificateOrder certificateDistinguishedName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (certificateDistinguishedName == null) + { + throw new ArgumentNullException(nameof(certificateDistinguishedName)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, certificateOrderName, certificateDistinguishedName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string certificateOrderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete an existing certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// or is null. + public async Task DeleteAsync(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, certificateOrderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete an existing certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// or is null. + public Response Delete(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, certificateOrderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string resourceGroupName, string certificateOrderName, AppServiceCertificateOrderPatchResource certificateDistinguishedName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(certificateDistinguishedName); + request.Content = content; + return message; + } + + /// Description for Create or update a certificate purchase order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Distinguished name to use for the certificate order. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateAsync(string resourceGroupName, string certificateOrderName, AppServiceCertificateOrderPatchResource certificateDistinguishedName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (certificateDistinguishedName == null) + { + throw new ArgumentNullException(nameof(certificateDistinguishedName)); + } + + using var message = CreateUpdateRequest(resourceGroupName, certificateOrderName, certificateDistinguishedName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + AppServiceCertificateOrder value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceCertificateOrder.DeserializeAppServiceCertificateOrder(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create or update a certificate purchase order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Distinguished name to use for the certificate order. + /// The cancellation token to use. + /// , , or is null. + public Response Update(string resourceGroupName, string certificateOrderName, AppServiceCertificateOrderPatchResource certificateDistinguishedName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (certificateDistinguishedName == null) + { + throw new ArgumentNullException(nameof(certificateDistinguishedName)); + } + + using var message = CreateUpdateRequest(resourceGroupName, certificateOrderName, certificateDistinguishedName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + AppServiceCertificateOrder value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceCertificateOrder.DeserializeAppServiceCertificateOrder(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListCertificatesRequest(string resourceGroupName, string certificateOrderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/certificates", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all certificates associated with a certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// or is null. + public async Task> ListCertificatesAsync(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateListCertificatesRequest(resourceGroupName, certificateOrderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceCertificateCollection.DeserializeAppServiceCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all certificates associated with a certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// or is null. + public Response ListCertificates(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateListCertificatesRequest(resourceGroupName, certificateOrderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceCertificateCollection.DeserializeAppServiceCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetCertificateRequest(string resourceGroupName, string certificateOrderName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/certificates/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the certificate associated with a certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Name of the certificate. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetCertificateAsync(string resourceGroupName, string certificateOrderName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetCertificateRequest(resourceGroupName, certificateOrderName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceCertificateResource.DeserializeAppServiceCertificateResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the certificate associated with a certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Name of the certificate. + /// The cancellation token to use. + /// , , or is null. + public Response GetCertificate(string resourceGroupName, string certificateOrderName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetCertificateRequest(resourceGroupName, certificateOrderName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceCertificateResource.DeserializeAppServiceCertificateResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateCertificateRequest(string resourceGroupName, string certificateOrderName, string name, AppServiceCertificateResource keyVaultCertificate) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/certificates/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(keyVaultCertificate); + request.Content = content; + return message; + } + + /// Description for Creates or updates a certificate and associates with key vault secret. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Name of the certificate. + /// Key vault certificate resource Id. + /// The cancellation token to use. + /// , , , or is null. + public async Task CreateOrUpdateCertificateAsync(string resourceGroupName, string certificateOrderName, string name, AppServiceCertificateResource keyVaultCertificate, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (keyVaultCertificate == null) + { + throw new ArgumentNullException(nameof(keyVaultCertificate)); + } + + using var message = CreateCreateOrUpdateCertificateRequest(resourceGroupName, certificateOrderName, name, keyVaultCertificate); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates or updates a certificate and associates with key vault secret. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Name of the certificate. + /// Key vault certificate resource Id. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateCertificate(string resourceGroupName, string certificateOrderName, string name, AppServiceCertificateResource keyVaultCertificate, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (keyVaultCertificate == null) + { + throw new ArgumentNullException(nameof(keyVaultCertificate)); + } + + using var message = CreateCreateOrUpdateCertificateRequest(resourceGroupName, certificateOrderName, name, keyVaultCertificate); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteCertificateRequest(string resourceGroupName, string certificateOrderName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/certificates/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete the certificate associated with a certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Name of the certificate. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteCertificateAsync(string resourceGroupName, string certificateOrderName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteCertificateRequest(resourceGroupName, certificateOrderName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete the certificate associated with a certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Name of the certificate. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteCertificate(string resourceGroupName, string certificateOrderName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteCertificateRequest(resourceGroupName, certificateOrderName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateCertificateRequest(string resourceGroupName, string certificateOrderName, string name, AppServiceCertificatePatchResource keyVaultCertificate) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/certificates/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(keyVaultCertificate); + request.Content = content; + return message; + } + + /// Description for Creates or updates a certificate and associates with key vault secret. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Name of the certificate. + /// Key vault certificate resource Id. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateCertificateAsync(string resourceGroupName, string certificateOrderName, string name, AppServiceCertificatePatchResource keyVaultCertificate, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (keyVaultCertificate == null) + { + throw new ArgumentNullException(nameof(keyVaultCertificate)); + } + + using var message = CreateUpdateCertificateRequest(resourceGroupName, certificateOrderName, name, keyVaultCertificate); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + AppServiceCertificateResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceCertificateResource.DeserializeAppServiceCertificateResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates or updates a certificate and associates with key vault secret. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Name of the certificate. + /// Key vault certificate resource Id. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateCertificate(string resourceGroupName, string certificateOrderName, string name, AppServiceCertificatePatchResource keyVaultCertificate, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (keyVaultCertificate == null) + { + throw new ArgumentNullException(nameof(keyVaultCertificate)); + } + + using var message = CreateUpdateCertificateRequest(resourceGroupName, certificateOrderName, name, keyVaultCertificate); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + AppServiceCertificateResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceCertificateResource.DeserializeAppServiceCertificateResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateReissueRequest(string resourceGroupName, string certificateOrderName, ReissueCertificateOrderRequest reissueCertificateOrderRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/reissue", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(reissueCertificateOrderRequest); + request.Content = content; + return message; + } + + /// Description for Reissue an existing certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Parameters for the reissue. + /// The cancellation token to use. + /// , , or is null. + public async Task ReissueAsync(string resourceGroupName, string certificateOrderName, ReissueCertificateOrderRequest reissueCertificateOrderRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (reissueCertificateOrderRequest == null) + { + throw new ArgumentNullException(nameof(reissueCertificateOrderRequest)); + } + + using var message = CreateReissueRequest(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Reissue an existing certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Parameters for the reissue. + /// The cancellation token to use. + /// , , or is null. + public Response Reissue(string resourceGroupName, string certificateOrderName, ReissueCertificateOrderRequest reissueCertificateOrderRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (reissueCertificateOrderRequest == null) + { + throw new ArgumentNullException(nameof(reissueCertificateOrderRequest)); + } + + using var message = CreateReissueRequest(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRenewRequest(string resourceGroupName, string certificateOrderName, RenewCertificateOrderRequest renewCertificateOrderRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/renew", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(renewCertificateOrderRequest); + request.Content = content; + return message; + } + + /// Description for Renew an existing certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Renew parameters. + /// The cancellation token to use. + /// , , or is null. + public async Task RenewAsync(string resourceGroupName, string certificateOrderName, RenewCertificateOrderRequest renewCertificateOrderRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (renewCertificateOrderRequest == null) + { + throw new ArgumentNullException(nameof(renewCertificateOrderRequest)); + } + + using var message = CreateRenewRequest(resourceGroupName, certificateOrderName, renewCertificateOrderRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Renew an existing certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Renew parameters. + /// The cancellation token to use. + /// , , or is null. + public Response Renew(string resourceGroupName, string certificateOrderName, RenewCertificateOrderRequest renewCertificateOrderRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (renewCertificateOrderRequest == null) + { + throw new ArgumentNullException(nameof(renewCertificateOrderRequest)); + } + + using var message = CreateRenewRequest(resourceGroupName, certificateOrderName, renewCertificateOrderRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateResendEmailRequest(string resourceGroupName, string certificateOrderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/resendEmail", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Resend certificate email. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// or is null. + public async Task ResendEmailAsync(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateResendEmailRequest(resourceGroupName, certificateOrderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Resend certificate email. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// or is null. + public Response ResendEmail(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateResendEmailRequest(resourceGroupName, certificateOrderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateResendRequestEmailsRequest(string resourceGroupName, string certificateOrderName, NameIdentifier nameIdentifier) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/resendRequestEmails", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(nameIdentifier); + request.Content = content; + return message; + } + + /// Description for Verify domain ownership for this certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Email address. + /// The cancellation token to use. + /// , , or is null. + public async Task ResendRequestEmailsAsync(string resourceGroupName, string certificateOrderName, NameIdentifier nameIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (nameIdentifier == null) + { + throw new ArgumentNullException(nameof(nameIdentifier)); + } + + using var message = CreateResendRequestEmailsRequest(resourceGroupName, certificateOrderName, nameIdentifier); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Verify domain ownership for this certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Email address. + /// The cancellation token to use. + /// , , or is null. + public Response ResendRequestEmails(string resourceGroupName, string certificateOrderName, NameIdentifier nameIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (nameIdentifier == null) + { + throw new ArgumentNullException(nameof(nameIdentifier)); + } + + using var message = CreateResendRequestEmailsRequest(resourceGroupName, certificateOrderName, nameIdentifier); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRetrieveSiteSealRequest(string resourceGroupName, string certificateOrderName, SiteSealRequest siteSealRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/retrieveSiteSeal", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteSealRequest); + request.Content = content; + return message; + } + + /// Description for Verify domain ownership for this certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Site seal request. + /// The cancellation token to use. + /// , , or is null. + public async Task> RetrieveSiteSealAsync(string resourceGroupName, string certificateOrderName, SiteSealRequest siteSealRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (siteSealRequest == null) + { + throw new ArgumentNullException(nameof(siteSealRequest)); + } + + using var message = CreateRetrieveSiteSealRequest(resourceGroupName, certificateOrderName, siteSealRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteSeal value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteSeal.DeserializeSiteSeal(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Verify domain ownership for this certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// Site seal request. + /// The cancellation token to use. + /// , , or is null. + public Response RetrieveSiteSeal(string resourceGroupName, string certificateOrderName, SiteSealRequest siteSealRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (siteSealRequest == null) + { + throw new ArgumentNullException(nameof(siteSealRequest)); + } + + using var message = CreateRetrieveSiteSealRequest(resourceGroupName, certificateOrderName, siteSealRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteSeal value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteSeal.DeserializeSiteSeal(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateVerifyDomainOwnershipRequest(string resourceGroupName, string certificateOrderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/verifyDomainOwnership", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Verify domain ownership for this certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// or is null. + public async Task VerifyDomainOwnershipAsync(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateVerifyDomainOwnershipRequest(resourceGroupName, certificateOrderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Verify domain ownership for this certificate order. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// or is null. + public Response VerifyDomainOwnership(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateVerifyDomainOwnershipRequest(resourceGroupName, certificateOrderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRetrieveCertificateActionsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(name, true); + uri.AppendPath("/retrieveCertificateActions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Retrieve the list of certificate actions. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// or is null. + public async Task>> RetrieveCertificateActionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateRetrieveCertificateActionsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(CertificateOrderAction.DeserializeCertificateOrderAction(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Retrieve the list of certificate actions. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// or is null. + public Response> RetrieveCertificateActions(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateRetrieveCertificateActionsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(CertificateOrderAction.DeserializeCertificateOrderAction(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRetrieveCertificateEmailHistoryRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(name, true); + uri.AppendPath("/retrieveEmailHistory", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Retrieve email history. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// or is null. + public async Task>> RetrieveCertificateEmailHistoryAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateRetrieveCertificateEmailHistoryRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(CertificateEmail.DeserializeCertificateEmail(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Retrieve email history. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// or is null. + public Response> RetrieveCertificateEmailHistory(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateRetrieveCertificateEmailHistoryRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(CertificateEmail.DeserializeCertificateEmail(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all certificate orders in a subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateOrderCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all certificate orders in a subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateOrderCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get certificate orders in a resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateOrderCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get certificate orders in a resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateOrderCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListCertificatesNextPageRequest(string nextLink, string resourceGroupName, string certificateOrderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all certificates associated with a certificate order. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListCertificatesNextPageAsync(string nextLink, string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateListCertificatesNextPageRequest(nextLink, resourceGroupName, certificateOrderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceCertificateCollection.DeserializeAppServiceCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all certificates associated with a certificate order. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate order. + /// The cancellation token to use. + /// , , or is null. + public Response ListCertificatesNextPage(string nextLink, string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateListCertificatesNextPageRequest(nextLink, resourceGroupName, certificateOrderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceCertificateCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceCertificateCollection.DeserializeAppServiceCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsRestClient.cs new file mode 100644 index 000000000000..4d262cd1dbc3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsRestClient.cs @@ -0,0 +1,5793 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class AppServiceEnvironmentsRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of AppServiceEnvironmentsRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public AppServiceEnvironmentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all App Service Environments for a subscription. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceEnvironmentCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all App Service Environments for a subscription. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceEnvironmentCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all App Service Environments in a resource group. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceEnvironmentCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all App Service Environments in a resource group. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceEnvironmentCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the properties of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> GetAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceEnvironmentResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceEnvironmentResource.DeserializeAppServiceEnvironmentResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the properties of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response Get(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceEnvironmentResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceEnvironmentResource.DeserializeAppServiceEnvironmentResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string name, AppServiceEnvironmentResource hostingEnvironmentEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(hostingEnvironmentEnvelope); + request.Content = content; + return message; + } + + /// Description for Create or update an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Configuration details of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task CreateOrUpdateAsync(string resourceGroupName, string name, AppServiceEnvironmentResource hostingEnvironmentEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostingEnvironmentEnvelope == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentEnvelope)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, hostingEnvironmentEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create or update an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Configuration details of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdate(string resourceGroupName, string name, AppServiceEnvironmentResource hostingEnvironmentEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostingEnvironmentEnvelope == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentEnvelope)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, hostingEnvironmentEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string name, bool? forceDelete) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + if (forceDelete != null) + { + uri.AppendQuery("forceDelete", forceDelete.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Specify <code>true</code> to force the deletion even if the App Service Environment contains resources. The default is <code>false</code>. + /// The cancellation token to use. + /// or is null. + public async Task DeleteAsync(string resourceGroupName, string name, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteRequest(resourceGroupName, name, forceDelete); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Specify <code>true</code> to force the deletion even if the App Service Environment contains resources. The default is <code>false</code>. + /// The cancellation token to use. + /// or is null. + public Response Delete(string resourceGroupName, string name, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteRequest(resourceGroupName, name, forceDelete); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string resourceGroupName, string name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(hostingEnvironmentEnvelope); + request.Content = content; + return message; + } + + /// Description for Create or update an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Configuration details of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateAsync(string resourceGroupName, string name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostingEnvironmentEnvelope == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentEnvelope)); + } + + using var message = CreateUpdateRequest(resourceGroupName, name, hostingEnvironmentEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + { + AppServiceEnvironmentResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceEnvironmentResource.DeserializeAppServiceEnvironmentResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create or update an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Configuration details of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response Update(string resourceGroupName, string name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostingEnvironmentEnvelope == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentEnvelope)); + } + + using var message = CreateUpdateRequest(resourceGroupName, name, hostingEnvironmentEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + { + AppServiceEnvironmentResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceEnvironmentResource.DeserializeAppServiceEnvironmentResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListCapacitiesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/capacities/compute", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the used, available, and total worker capacity an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> ListCapacitiesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListCapacitiesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StampCapacityCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StampCapacityCollection.DeserializeStampCapacityCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the used, available, and total worker capacity an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response ListCapacities(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListCapacitiesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StampCapacityCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StampCapacityCollection.DeserializeStampCapacityCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetVipInfoRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/capacities/virtualip", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get IP addresses assigned to an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> GetVipInfoAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetVipInfoRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AddressResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AddressResponse.DeserializeAddressResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get IP addresses assigned to an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response GetVipInfo(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetVipInfoRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AddressResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AddressResponse.DeserializeAddressResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateChangeVnetRequest(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/changeVirtualNetwork", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(vnetInfo); + request.Content = content; + return message; + } + + /// Description for Move an App Service Environment to a different VNET. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Details for the new virtual network. + /// The cancellation token to use. + /// , , or is null. + public async Task ChangeVnetAsync(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetInfo == null) + { + throw new ArgumentNullException(nameof(vnetInfo)); + } + + using var message = CreateChangeVnetRequest(resourceGroupName, name, vnetInfo); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Move an App Service Environment to a different VNET. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Details for the new virtual network. + /// The cancellation token to use. + /// , , or is null. + public Response ChangeVnet(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetInfo == null) + { + throw new ArgumentNullException(nameof(vnetInfo)); + } + + using var message = CreateChangeVnetRequest(resourceGroupName, name, vnetInfo); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAseV3NetworkingConfigurationRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/configurations/networking", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get networking configuration of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> GetAseV3NetworkingConfigurationAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetAseV3NetworkingConfigurationRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AseV3NetworkingConfiguration value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AseV3NetworkingConfiguration.DeserializeAseV3NetworkingConfiguration(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get networking configuration of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response GetAseV3NetworkingConfiguration(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetAseV3NetworkingConfigurationRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AseV3NetworkingConfiguration value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AseV3NetworkingConfiguration.DeserializeAseV3NetworkingConfiguration(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateAseNetworkingConfigurationRequest(string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/configurations/networking", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(aseNetworkingConfiguration); + request.Content = content; + return message; + } + + /// Description for Update networking configuration of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The AseV3NetworkingConfiguration to use. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateAseNetworkingConfigurationAsync(string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (aseNetworkingConfiguration == null) + { + throw new ArgumentNullException(nameof(aseNetworkingConfiguration)); + } + + using var message = CreateUpdateAseNetworkingConfigurationRequest(resourceGroupName, name, aseNetworkingConfiguration); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AseV3NetworkingConfiguration value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AseV3NetworkingConfiguration.DeserializeAseV3NetworkingConfiguration(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Update networking configuration of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The AseV3NetworkingConfiguration to use. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateAseNetworkingConfiguration(string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (aseNetworkingConfiguration == null) + { + throw new ArgumentNullException(nameof(aseNetworkingConfiguration)); + } + + using var message = CreateUpdateAseNetworkingConfigurationRequest(resourceGroupName, name, aseNetworkingConfiguration); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AseV3NetworkingConfiguration value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AseV3NetworkingConfiguration.DeserializeAseV3NetworkingConfiguration(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListDiagnosticsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/diagnostics", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get diagnostic information for an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task>> ListDiagnosticsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListDiagnosticsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(HostingEnvironmentDiagnostics.DeserializeHostingEnvironmentDiagnostics(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get diagnostic information for an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response> ListDiagnostics(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListDiagnosticsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(HostingEnvironmentDiagnostics.DeserializeHostingEnvironmentDiagnostics(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetDiagnosticsItemRequest(string resourceGroupName, string name, string diagnosticsName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticsName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a diagnostics item for an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the diagnostics item. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetDiagnosticsItemAsync(string resourceGroupName, string name, string diagnosticsName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (diagnosticsName == null) + { + throw new ArgumentNullException(nameof(diagnosticsName)); + } + + using var message = CreateGetDiagnosticsItemRequest(resourceGroupName, name, diagnosticsName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HostingEnvironmentDiagnostics value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HostingEnvironmentDiagnostics.DeserializeHostingEnvironmentDiagnostics(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a diagnostics item for an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the diagnostics item. + /// The cancellation token to use. + /// , , or is null. + public Response GetDiagnosticsItem(string resourceGroupName, string name, string diagnosticsName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (diagnosticsName == null) + { + throw new ArgumentNullException(nameof(diagnosticsName)); + } + + using var message = CreateGetDiagnosticsItemRequest(resourceGroupName, name, diagnosticsName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HostingEnvironmentDiagnostics value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HostingEnvironmentDiagnostics.DeserializeHostingEnvironmentDiagnostics(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInboundNetworkDependenciesEndpointsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/inboundNetworkDependenciesEndpoints", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the network endpoints of all inbound dependencies of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> GetInboundNetworkDependenciesEndpointsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetInboundNetworkDependenciesEndpointsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InboundEnvironmentEndpointCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InboundEnvironmentEndpointCollection.DeserializeInboundEnvironmentEndpointCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the network endpoints of all inbound dependencies of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response GetInboundNetworkDependenciesEndpoints(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetInboundNetworkDependenciesEndpointsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InboundEnvironmentEndpointCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InboundEnvironmentEndpointCollection.DeserializeInboundEnvironmentEndpointCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListMultiRolePoolsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/multiRolePools", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all multi-role pools. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> ListMultiRolePoolsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRolePoolsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkerPoolCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all multi-role pools. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response ListMultiRolePools(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRolePoolsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkerPoolCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetMultiRolePoolRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/multiRolePools/default", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get properties of a multi-role pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> GetMultiRolePoolAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetMultiRolePoolRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkerPoolResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get properties of a multi-role pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response GetMultiRolePool(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetMultiRolePoolRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkerPoolResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateMultiRolePoolRequest(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/multiRolePools/default", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(multiRolePoolEnvelope); + request.Content = content; + return message; + } + + /// Description for Create or update a multi-role pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Properties of the multi-role pool. + /// The cancellation token to use. + /// , , or is null. + public async Task CreateOrUpdateMultiRolePoolAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (multiRolePoolEnvelope == null) + { + throw new ArgumentNullException(nameof(multiRolePoolEnvelope)); + } + + using var message = CreateCreateOrUpdateMultiRolePoolRequest(resourceGroupName, name, multiRolePoolEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create or update a multi-role pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Properties of the multi-role pool. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdateMultiRolePool(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (multiRolePoolEnvelope == null) + { + throw new ArgumentNullException(nameof(multiRolePoolEnvelope)); + } + + using var message = CreateCreateOrUpdateMultiRolePoolRequest(resourceGroupName, name, multiRolePoolEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateMultiRolePoolRequest(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/multiRolePools/default", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(multiRolePoolEnvelope); + request.Content = content; + return message; + } + + /// Description for Create or update a multi-role pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Properties of the multi-role pool. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateMultiRolePoolAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (multiRolePoolEnvelope == null) + { + throw new ArgumentNullException(nameof(multiRolePoolEnvelope)); + } + + using var message = CreateUpdateMultiRolePoolRequest(resourceGroupName, name, multiRolePoolEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + { + WorkerPoolResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create or update a multi-role pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Properties of the multi-role pool. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateMultiRolePool(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (multiRolePoolEnvelope == null) + { + throw new ArgumentNullException(nameof(multiRolePoolEnvelope)); + } + + using var message = CreateUpdateMultiRolePoolRequest(resourceGroupName, name, multiRolePoolEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + { + WorkerPoolResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListMultiRolePoolInstanceMetricDefinitionsRequest(string resourceGroupName, string name, string instance) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/multiRolePools/default/instances/", false); + uri.AppendPath(instance, true); + uri.AppendPath("/metricdefinitions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the instance in the multi-role pool. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListMultiRolePoolInstanceMetricDefinitionsAsync(string resourceGroupName, string name, string instance, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instance == null) + { + throw new ArgumentNullException(nameof(instance)); + } + + using var message = CreateListMultiRolePoolInstanceMetricDefinitionsRequest(resourceGroupName, name, instance); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the instance in the multi-role pool. + /// The cancellation token to use. + /// , , or is null. + public Response ListMultiRolePoolInstanceMetricDefinitions(string resourceGroupName, string name, string instance, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instance == null) + { + throw new ArgumentNullException(nameof(instance)); + } + + using var message = CreateListMultiRolePoolInstanceMetricDefinitionsRequest(resourceGroupName, name, instance); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListMultiRoleMetricDefinitionsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/multiRolePools/default/metricdefinitions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get metric definitions for a multi-role pool of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> ListMultiRoleMetricDefinitionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRoleMetricDefinitionsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get metric definitions for a multi-role pool of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response ListMultiRoleMetricDefinitions(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRoleMetricDefinitionsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListMultiRolePoolSkusRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/multiRolePools/default/skus", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available SKUs for scaling a multi-role pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> ListMultiRolePoolSkusAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRolePoolSkusRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SkuInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available SKUs for scaling a multi-role pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response ListMultiRolePoolSkus(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRolePoolSkusRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SkuInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListMultiRoleUsagesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/multiRolePools/default/usages", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get usage metrics for a multi-role pool of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> ListMultiRoleUsagesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRoleUsagesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UsageCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = UsageCollection.DeserializeUsageCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get usage metrics for a multi-role pool of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response ListMultiRoleUsages(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRoleUsagesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UsageCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = UsageCollection.DeserializeUsageCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListOperationsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/operations", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all currently running operations on the App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task>> ListOperationsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListOperationsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(Models.Operation.DeserializeOperation(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all currently running operations on the App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response> ListOperations(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListOperationsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(Models.Operation.DeserializeOperation(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetOutboundNetworkDependenciesEndpointsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/outboundNetworkDependenciesEndpoints", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the network endpoints of all outbound dependencies of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> GetOutboundNetworkDependenciesEndpointsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetOutboundNetworkDependenciesEndpointsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OutboundEnvironmentEndpointCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OutboundEnvironmentEndpointCollection.DeserializeOutboundEnvironmentEndpointCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the network endpoints of all outbound dependencies of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response GetOutboundNetworkDependenciesEndpoints(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetOutboundNetworkDependenciesEndpointsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OutboundEnvironmentEndpointCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OutboundEnvironmentEndpointCollection.DeserializeOutboundEnvironmentEndpointCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateEndpointConnectionListRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the list of private endpoints associated with a hosting environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> GetPrivateEndpointConnectionListAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateEndpointConnectionListRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the list of private endpoints associated with a hosting environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response GetPrivateEndpointConnectionList(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateEndpointConnectionListRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the private endpoint connection. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetPrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RemotePrivateEndpointConnectionARMResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the private endpoint connection. + /// The cancellation token to use. + /// , , or is null. + public Response GetPrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RemotePrivateEndpointConnectionARMResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateApproveOrRejectPrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(privateEndpointWrapper); + request.Content = content; + return message; + } + + /// Description for Approves or rejects a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The String to use. + /// The PrivateLinkConnectionApprovalRequestResource to use. + /// The cancellation token to use. + /// , , , or is null. + public async Task ApproveOrRejectPrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (privateEndpointWrapper == null) + { + throw new ArgumentNullException(nameof(privateEndpointWrapper)); + } + + using var message = CreateApproveOrRejectPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Approves or rejects a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The String to use. + /// The PrivateLinkConnectionApprovalRequestResource to use. + /// The cancellation token to use. + /// , , , or is null. + public Response ApproveOrRejectPrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (privateEndpointWrapper == null) + { + throw new ArgumentNullException(nameof(privateEndpointWrapper)); + } + + using var message = CreateApproveOrRejectPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeletePrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task DeletePrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response DeletePrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateLinkResourcesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the private link resources. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> GetPrivateLinkResourcesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateLinkResourcesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourcesWrapper value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the private link resources. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response GetPrivateLinkResources(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateLinkResourcesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourcesWrapper value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRebootRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/reboot", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Reboot all machines in an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task RebootAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateRebootRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Reboot all machines in an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response Reboot(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateRebootRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateResumeRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/resume", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Resume an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task ResumeAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateResumeRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Resume an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response Resume(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateResumeRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListAppServicePlansRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/serverfarms", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all App Service plans in an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> ListAppServicePlansAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListAppServicePlansRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServicePlanCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all App Service plans in an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response ListAppServicePlans(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListAppServicePlansRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServicePlanCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebAppsRequest(string resourceGroupName, string name, string propertiesToInclude) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/sites", false); + if (propertiesToInclude != null) + { + uri.AppendQuery("propertiesToInclude", propertiesToInclude, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all apps in an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Comma separated list of app properties to include. + /// The cancellation token to use. + /// or is null. + public async Task> ListWebAppsAsync(string resourceGroupName, string name, string propertiesToInclude = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWebAppsRequest(resourceGroupName, name, propertiesToInclude); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all apps in an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Comma separated list of app properties to include. + /// The cancellation token to use. + /// or is null. + public Response ListWebApps(string resourceGroupName, string name, string propertiesToInclude = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWebAppsRequest(resourceGroupName, name, propertiesToInclude); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateSuspendRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/suspend", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Suspend an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task SuspendAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateSuspendRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Suspend an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response Suspend(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateSuspendRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string name, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/usages", false); + uri.AppendQuery("api-version", apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get global usage metrics of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// or is null. + public async Task> ListUsagesAsync(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListUsagesRequest(resourceGroupName, name, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get global usage metrics of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// or is null. + public Response ListUsages(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListUsagesRequest(resourceGroupName, name, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWorkerPoolsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/workerPools", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all worker pools of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public async Task> ListWorkerPoolsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWorkerPoolsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkerPoolCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all worker pools of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// or is null. + public Response ListWorkerPools(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWorkerPoolsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkerPoolCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetWorkerPoolRequest(string resourceGroupName, string name, string workerPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/workerPools/", false); + uri.AppendPath(workerPoolName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get properties of a worker pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetWorkerPoolAsync(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateGetWorkerPoolRequest(resourceGroupName, name, workerPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkerPoolResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get properties of a worker pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , or is null. + public Response GetWorkerPool(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateGetWorkerPoolRequest(resourceGroupName, name, workerPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkerPoolResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateWorkerPoolRequest(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/workerPools/", false); + uri.AppendPath(workerPoolName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(workerPoolEnvelope); + request.Content = content; + return message; + } + + /// Description for Create or update a worker pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// Properties of the worker pool. + /// The cancellation token to use. + /// , , , or is null. + public async Task CreateOrUpdateWorkerPoolAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + if (workerPoolEnvelope == null) + { + throw new ArgumentNullException(nameof(workerPoolEnvelope)); + } + + using var message = CreateCreateOrUpdateWorkerPoolRequest(resourceGroupName, name, workerPoolName, workerPoolEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create or update a worker pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// Properties of the worker pool. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateWorkerPool(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + if (workerPoolEnvelope == null) + { + throw new ArgumentNullException(nameof(workerPoolEnvelope)); + } + + using var message = CreateCreateOrUpdateWorkerPoolRequest(resourceGroupName, name, workerPoolName, workerPoolEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateWorkerPoolRequest(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/workerPools/", false); + uri.AppendPath(workerPoolName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(workerPoolEnvelope); + request.Content = content; + return message; + } + + /// Description for Create or update a worker pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// Properties of the worker pool. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateWorkerPoolAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + if (workerPoolEnvelope == null) + { + throw new ArgumentNullException(nameof(workerPoolEnvelope)); + } + + using var message = CreateUpdateWorkerPoolRequest(resourceGroupName, name, workerPoolName, workerPoolEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + { + WorkerPoolResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create or update a worker pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// Properties of the worker pool. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateWorkerPool(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + if (workerPoolEnvelope == null) + { + throw new ArgumentNullException(nameof(workerPoolEnvelope)); + } + + using var message = CreateUpdateWorkerPoolRequest(resourceGroupName, name, workerPoolName, workerPoolEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + { + WorkerPoolResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWorkerPoolInstanceMetricDefinitionsRequest(string resourceGroupName, string name, string workerPoolName, string instance) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/workerPools/", false); + uri.AppendPath(workerPoolName, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instance, true); + uri.AppendPath("/metricdefinitions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get metric definitions for a specific instance of a worker pool of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// Name of the instance in the worker pool. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListWorkerPoolInstanceMetricDefinitionsAsync(string resourceGroupName, string name, string workerPoolName, string instance, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + if (instance == null) + { + throw new ArgumentNullException(nameof(instance)); + } + + using var message = CreateListWorkerPoolInstanceMetricDefinitionsRequest(resourceGroupName, name, workerPoolName, instance); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get metric definitions for a specific instance of a worker pool of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// Name of the instance in the worker pool. + /// The cancellation token to use. + /// , , , or is null. + public Response ListWorkerPoolInstanceMetricDefinitions(string resourceGroupName, string name, string workerPoolName, string instance, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + if (instance == null) + { + throw new ArgumentNullException(nameof(instance)); + } + + using var message = CreateListWorkerPoolInstanceMetricDefinitionsRequest(resourceGroupName, name, workerPoolName, instance); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebWorkerMetricDefinitionsRequest(string resourceGroupName, string name, string workerPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/workerPools/", false); + uri.AppendPath(workerPoolName, true); + uri.AppendPath("/metricdefinitions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get metric definitions for a worker pool of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListWebWorkerMetricDefinitionsAsync(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateListWebWorkerMetricDefinitionsRequest(resourceGroupName, name, workerPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get metric definitions for a worker pool of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , or is null. + public Response ListWebWorkerMetricDefinitions(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateListWebWorkerMetricDefinitionsRequest(resourceGroupName, name, workerPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWorkerPoolSkusRequest(string resourceGroupName, string name, string workerPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/workerPools/", false); + uri.AppendPath(workerPoolName, true); + uri.AppendPath("/skus", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available SKUs for scaling a worker pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListWorkerPoolSkusAsync(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateListWorkerPoolSkusRequest(resourceGroupName, name, workerPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SkuInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available SKUs for scaling a worker pool. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , or is null. + public Response ListWorkerPoolSkus(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateListWorkerPoolSkusRequest(resourceGroupName, name, workerPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SkuInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebWorkerUsagesRequest(string resourceGroupName, string name, string workerPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/workerPools/", false); + uri.AppendPath(workerPoolName, true); + uri.AppendPath("/usages", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get usage metrics for a worker pool of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListWebWorkerUsagesAsync(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateListWebWorkerUsagesRequest(resourceGroupName, name, workerPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UsageCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = UsageCollection.DeserializeUsageCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get usage metrics for a worker pool of an App Service Environment. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , or is null. + public Response ListWebWorkerUsages(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateListWebWorkerUsagesRequest(resourceGroupName, name, workerPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UsageCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = UsageCollection.DeserializeUsageCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all App Service Environments for a subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceEnvironmentCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all App Service Environments for a subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceEnvironmentCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all App Service Environments in a resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServiceEnvironmentCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all App Service Environments in a resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServiceEnvironmentCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListCapacitiesNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the used, available, and total worker capacity an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListCapacitiesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListCapacitiesNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StampCapacityCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StampCapacityCollection.DeserializeStampCapacityCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the used, available, and total worker capacity an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response ListCapacitiesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListCapacitiesNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StampCapacityCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StampCapacityCollection.DeserializeStampCapacityCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateChangeVnetNextPageRequest(string nextLink, string resourceGroupName, string name, VirtualNetworkProfile vnetInfo) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Move an App Service Environment to a different VNET. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Details for the new virtual network. + /// The cancellation token to use. + /// , , , or is null. + public async Task ChangeVnetNextPageAsync(string nextLink, string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetInfo == null) + { + throw new ArgumentNullException(nameof(vnetInfo)); + } + + using var message = CreateChangeVnetNextPageRequest(nextLink, resourceGroupName, name, vnetInfo); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Move an App Service Environment to a different VNET. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Details for the new virtual network. + /// The cancellation token to use. + /// , , , or is null. + public Response ChangeVnetNextPage(string nextLink, string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetInfo == null) + { + throw new ArgumentNullException(nameof(vnetInfo)); + } + + using var message = CreateChangeVnetNextPageRequest(nextLink, resourceGroupName, name, vnetInfo); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInboundNetworkDependenciesEndpointsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the network endpoints of all inbound dependencies of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetInboundNetworkDependenciesEndpointsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetInboundNetworkDependenciesEndpointsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + InboundEnvironmentEndpointCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = InboundEnvironmentEndpointCollection.DeserializeInboundEnvironmentEndpointCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the network endpoints of all inbound dependencies of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response GetInboundNetworkDependenciesEndpointsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetInboundNetworkDependenciesEndpointsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + InboundEnvironmentEndpointCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = InboundEnvironmentEndpointCollection.DeserializeInboundEnvironmentEndpointCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListMultiRolePoolsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all multi-role pools. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListMultiRolePoolsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRolePoolsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkerPoolCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all multi-role pools. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response ListMultiRolePoolsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRolePoolsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkerPoolCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListMultiRolePoolInstanceMetricDefinitionsNextPageRequest(string nextLink, string resourceGroupName, string name, string instance) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the instance in the multi-role pool. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListMultiRolePoolInstanceMetricDefinitionsNextPageAsync(string nextLink, string resourceGroupName, string name, string instance, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instance == null) + { + throw new ArgumentNullException(nameof(instance)); + } + + using var message = CreateListMultiRolePoolInstanceMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name, instance); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the instance in the multi-role pool. + /// The cancellation token to use. + /// , , , or is null. + public Response ListMultiRolePoolInstanceMetricDefinitionsNextPage(string nextLink, string resourceGroupName, string name, string instance, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instance == null) + { + throw new ArgumentNullException(nameof(instance)); + } + + using var message = CreateListMultiRolePoolInstanceMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name, instance); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListMultiRoleMetricDefinitionsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get metric definitions for a multi-role pool of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListMultiRoleMetricDefinitionsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRoleMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get metric definitions for a multi-role pool of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response ListMultiRoleMetricDefinitionsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRoleMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListMultiRolePoolSkusNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available SKUs for scaling a multi-role pool. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListMultiRolePoolSkusNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRolePoolSkusNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SkuInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available SKUs for scaling a multi-role pool. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response ListMultiRolePoolSkusNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRolePoolSkusNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SkuInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListMultiRoleUsagesNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get usage metrics for a multi-role pool of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListMultiRoleUsagesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRoleUsagesNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UsageCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = UsageCollection.DeserializeUsageCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get usage metrics for a multi-role pool of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response ListMultiRoleUsagesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMultiRoleUsagesNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UsageCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = UsageCollection.DeserializeUsageCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetOutboundNetworkDependenciesEndpointsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the network endpoints of all outbound dependencies of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetOutboundNetworkDependenciesEndpointsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OutboundEnvironmentEndpointCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OutboundEnvironmentEndpointCollection.DeserializeOutboundEnvironmentEndpointCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the network endpoints of all outbound dependencies of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response GetOutboundNetworkDependenciesEndpointsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OutboundEnvironmentEndpointCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OutboundEnvironmentEndpointCollection.DeserializeOutboundEnvironmentEndpointCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateEndpointConnectionListNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the list of private endpoints associated with a hosting environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetPrivateEndpointConnectionListNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateEndpointConnectionListNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the list of private endpoints associated with a hosting environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response GetPrivateEndpointConnectionListNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateEndpointConnectionListNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateResumeNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Resume an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task ResumeNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateResumeNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Resume an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response ResumeNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateResumeNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListAppServicePlansNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all App Service plans in an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListAppServicePlansNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListAppServicePlansNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServicePlanCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all App Service plans in an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response ListAppServicePlansNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListAppServicePlansNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServicePlanCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebAppsNextPageRequest(string nextLink, string resourceGroupName, string name, string propertiesToInclude) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all apps in an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Comma separated list of app properties to include. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListWebAppsNextPageAsync(string nextLink, string resourceGroupName, string name, string propertiesToInclude = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWebAppsNextPageRequest(nextLink, resourceGroupName, name, propertiesToInclude); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all apps in an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Comma separated list of app properties to include. + /// The cancellation token to use. + /// , , or is null. + public Response ListWebAppsNextPage(string nextLink, string resourceGroupName, string name, string propertiesToInclude = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWebAppsNextPageRequest(nextLink, resourceGroupName, name, propertiesToInclude); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateSuspendNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Suspend an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task SuspendNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateSuspendNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Suspend an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response SuspendNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateSuspendNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListUsagesNextPageRequest(string nextLink, string resourceGroupName, string name, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get global usage metrics of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListUsagesNextPageAsync(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListUsagesNextPageRequest(nextLink, resourceGroupName, name, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get global usage metrics of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , or is null. + public Response ListUsagesNextPage(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListUsagesNextPageRequest(nextLink, resourceGroupName, name, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWorkerPoolsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all worker pools of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListWorkerPoolsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWorkerPoolsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkerPoolCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all worker pools of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// The cancellation token to use. + /// , , or is null. + public Response ListWorkerPoolsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWorkerPoolsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkerPoolCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWorkerPoolInstanceMetricDefinitionsNextPageRequest(string nextLink, string resourceGroupName, string name, string workerPoolName, string instance) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get metric definitions for a specific instance of a worker pool of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// Name of the instance in the worker pool. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListWorkerPoolInstanceMetricDefinitionsNextPageAsync(string nextLink, string resourceGroupName, string name, string workerPoolName, string instance, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + if (instance == null) + { + throw new ArgumentNullException(nameof(instance)); + } + + using var message = CreateListWorkerPoolInstanceMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name, workerPoolName, instance); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get metric definitions for a specific instance of a worker pool of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// Name of the instance in the worker pool. + /// The cancellation token to use. + /// , , , , or is null. + public Response ListWorkerPoolInstanceMetricDefinitionsNextPage(string nextLink, string resourceGroupName, string name, string workerPoolName, string instance, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + if (instance == null) + { + throw new ArgumentNullException(nameof(instance)); + } + + using var message = CreateListWorkerPoolInstanceMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name, workerPoolName, instance); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebWorkerMetricDefinitionsNextPageRequest(string nextLink, string resourceGroupName, string name, string workerPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get metric definitions for a worker pool of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListWebWorkerMetricDefinitionsNextPageAsync(string nextLink, string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateListWebWorkerMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name, workerPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get metric definitions for a worker pool of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , , or is null. + public Response ListWebWorkerMetricDefinitionsNextPage(string nextLink, string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateListWebWorkerMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name, workerPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceMetricDefinitionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWorkerPoolSkusNextPageRequest(string nextLink, string resourceGroupName, string name, string workerPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available SKUs for scaling a worker pool. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListWorkerPoolSkusNextPageAsync(string nextLink, string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateListWorkerPoolSkusNextPageRequest(nextLink, resourceGroupName, name, workerPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SkuInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available SKUs for scaling a worker pool. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , , or is null. + public Response ListWorkerPoolSkusNextPage(string nextLink, string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateListWorkerPoolSkusNextPageRequest(nextLink, resourceGroupName, name, workerPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SkuInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebWorkerUsagesNextPageRequest(string nextLink, string resourceGroupName, string name, string workerPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get usage metrics for a worker pool of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListWebWorkerUsagesNextPageAsync(string nextLink, string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateListWebWorkerUsagesNextPageRequest(nextLink, resourceGroupName, name, workerPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UsageCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = UsageCollection.DeserializeUsageCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get usage metrics for a worker pool of an App Service Environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service Environment. + /// Name of the worker pool. + /// The cancellation token to use. + /// , , , or is null. + public Response ListWebWorkerUsagesNextPage(string nextLink, string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerPoolName == null) + { + throw new ArgumentNullException(nameof(workerPoolName)); + } + + using var message = CreateListWebWorkerUsagesNextPageRequest(nextLink, resourceGroupName, name, workerPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UsageCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = UsageCollection.DeserializeUsageCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServicePlansRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServicePlansRestClient.cs new file mode 100644 index 000000000000..ae6ff7267ffc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServicePlansRestClient.cs @@ -0,0 +1,3199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class AppServicePlansRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of AppServicePlansRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public AppServicePlansRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest(bool? detailed) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms", false); + if (detailed != null) + { + uri.AppendQuery("detailed", detailed.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all App Service plans for a subscription. + /// + /// Specify <code>true</code> to return all App Service plan properties. The default is <code>false</code>, which returns a subset of the properties. + /// Retrieval of all properties may increase the API latency. + /// + /// The cancellation token to use. + public async Task> ListAsync(bool? detailed = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(detailed); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServicePlanCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all App Service plans for a subscription. + /// + /// Specify <code>true</code> to return all App Service plan properties. The default is <code>false</code>, which returns a subset of the properties. + /// Retrieval of all properties may increase the API latency. + /// + /// The cancellation token to use. + public Response List(bool? detailed = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(detailed); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServicePlanCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all App Service plans in a resource group. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServicePlanCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all App Service plans in a resource group. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServicePlanCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// or is null. + public async Task> GetAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServicePlan value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServicePlan.DeserializeAppServicePlan(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AppServicePlan)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// or is null. + public Response Get(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServicePlan value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServicePlan.DeserializeAppServicePlan(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AppServicePlan)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string name, AppServicePlan appServicePlan) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(appServicePlan); + request.Content = content; + return message; + } + + /// Description for Creates or updates an App Service Plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Details of the App Service plan. + /// The cancellation token to use. + /// , , or is null. + public async Task CreateOrUpdateAsync(string resourceGroupName, string name, AppServicePlan appServicePlan, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appServicePlan == null) + { + throw new ArgumentNullException(nameof(appServicePlan)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, appServicePlan); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates or updates an App Service Plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Details of the App Service plan. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdate(string resourceGroupName, string name, AppServicePlan appServicePlan, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appServicePlan == null) + { + throw new ArgumentNullException(nameof(appServicePlan)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, appServicePlan); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// or is null. + public async Task DeleteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// or is null. + public Response Delete(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string resourceGroupName, string name, AppServicePlanPatchResource appServicePlan) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(appServicePlan); + request.Content = content; + return message; + } + + /// Description for Creates or updates an App Service Plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Details of the App Service plan. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateAsync(string resourceGroupName, string name, AppServicePlanPatchResource appServicePlan, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appServicePlan == null) + { + throw new ArgumentNullException(nameof(appServicePlan)); + } + + using var message = CreateUpdateRequest(resourceGroupName, name, appServicePlan); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + { + AppServicePlan value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServicePlan.DeserializeAppServicePlan(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates or updates an App Service Plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Details of the App Service plan. + /// The cancellation token to use. + /// , , or is null. + public Response Update(string resourceGroupName, string name, AppServicePlanPatchResource appServicePlan, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appServicePlan == null) + { + throw new ArgumentNullException(nameof(appServicePlan)); + } + + using var message = CreateUpdateRequest(resourceGroupName, name, appServicePlan); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + { + AppServicePlan value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServicePlan.DeserializeAppServicePlan(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListCapabilitiesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/capabilities", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all capabilities of an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// or is null. + public async Task>> ListCapabilitiesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListCapabilitiesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(Capability.DeserializeCapability(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all capabilities of an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// or is null. + public Response> ListCapabilities(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListCapabilitiesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(Capability.DeserializeCapability(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridConnectionNamespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/relays/", false); + uri.AppendPath(relayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Retrieve a Hybrid Connection in use in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Service Bus namespace. + /// Name of the Service Bus relay. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateGetHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Retrieve a Hybrid Connection in use in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Service Bus namespace. + /// Name of the Service Bus relay. + /// The cancellation token to use. + /// , , , or is null. + public Response GetHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateGetHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridConnectionNamespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/relays/", false); + uri.AppendPath(relayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a Hybrid Connection in use in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Service Bus namespace. + /// Name of the Service Bus relay. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateDeleteHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a Hybrid Connection in use in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Service Bus namespace. + /// Name of the Service Bus relay. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateDeleteHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHybridConnectionKeysRequest(string resourceGroupName, string name, string namespaceName, string relayName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridConnectionNamespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/relays/", false); + uri.AppendPath(relayName, true); + uri.AppendPath("/listKeys", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the send key name and value of a Hybrid Connection. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The name of the Service Bus namespace. + /// The name of the Service Bus relay. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListHybridConnectionKeysAsync(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateListHybridConnectionKeysRequest(resourceGroupName, name, namespaceName, relayName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnectionKey value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnectionKey.DeserializeHybridConnectionKey(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the send key name and value of a Hybrid Connection. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The name of the Service Bus namespace. + /// The name of the Service Bus relay. + /// The cancellation token to use. + /// , , , or is null. + public Response ListHybridConnectionKeys(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateListHybridConnectionKeysRequest(resourceGroupName, name, namespaceName, relayName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnectionKey value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnectionKey.DeserializeHybridConnectionKey(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebAppsByHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridConnectionNamespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/relays/", false); + uri.AppendPath(relayName, true); + uri.AppendPath("/sites", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all apps that use a Hybrid Connection in an App Service Plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Hybrid Connection namespace. + /// Name of the Hybrid Connection relay. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListWebAppsByHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateListWebAppsByHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceCollection.DeserializeResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all apps that use a Hybrid Connection in an App Service Plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Hybrid Connection namespace. + /// Name of the Hybrid Connection relay. + /// The cancellation token to use. + /// , , , or is null. + public Response ListWebAppsByHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateListWebAppsByHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceCollection.DeserializeResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetHybridConnectionPlanLimitRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridConnectionPlanLimits/limit", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the maximum number of Hybrid Connections allowed in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// or is null. + public async Task> GetHybridConnectionPlanLimitAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetHybridConnectionPlanLimitRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnectionLimits value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnectionLimits.DeserializeHybridConnectionLimits(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the maximum number of Hybrid Connections allowed in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// or is null. + public Response GetHybridConnectionPlanLimit(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetHybridConnectionPlanLimitRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnectionLimits value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnectionLimits.DeserializeHybridConnectionLimits(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHybridConnectionsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridConnectionRelays", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Retrieve all Hybrid Connections in use in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// or is null. + public async Task> ListHybridConnectionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHybridConnectionsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnectionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnectionCollection.DeserializeHybridConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Retrieve all Hybrid Connections in use in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// or is null. + public Response ListHybridConnections(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHybridConnectionsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnectionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnectionCollection.DeserializeHybridConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRestartWebAppsRequest(string resourceGroupName, string name, bool? softRestart) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/restartSites", false); + if (softRestart != null) + { + uri.AppendQuery("softRestart", softRestart.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Restart all apps in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Specify <code>true</code> to perform a soft restart, applies the configuration settings and restarts the apps if necessary. The default is <code>false</code>, which always restarts and reprovisions the apps. + /// The cancellation token to use. + /// or is null. + public async Task RestartWebAppsAsync(string resourceGroupName, string name, bool? softRestart = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateRestartWebAppsRequest(resourceGroupName, name, softRestart); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Restart all apps in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Specify <code>true</code> to perform a soft restart, applies the configuration settings and restarts the apps if necessary. The default is <code>false</code>, which always restarts and reprovisions the apps. + /// The cancellation token to use. + /// or is null. + public Response RestartWebApps(string resourceGroupName, string name, bool? softRestart = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateRestartWebAppsRequest(resourceGroupName, name, softRestart); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebAppsRequest(string resourceGroupName, string name, string skipToken, string filter, string top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/sites", false); + uri.AppendQuery("api-version", apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + if (top != null) + { + uri.AppendQuery("$top", top, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all apps associated with an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list. + /// Supported filter: $filter=state eq running. Returns only web apps that are currently running. + /// List page size. If specified, results are paged. + /// The cancellation token to use. + /// or is null. + public async Task> ListWebAppsAsync(string resourceGroupName, string name, string skipToken = null, string filter = null, string top = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWebAppsRequest(resourceGroupName, name, skipToken, filter, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all apps associated with an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list. + /// Supported filter: $filter=state eq running. Returns only web apps that are currently running. + /// List page size. If specified, results are paged. + /// The cancellation token to use. + /// or is null. + public Response ListWebApps(string resourceGroupName, string name, string skipToken = null, string filter = null, string top = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWebAppsRequest(resourceGroupName, name, skipToken, filter, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetServerFarmSkusRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/skus", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all selectable SKUs for a given App Service Plan. + /// Name of the resource group to which the resource belongs. + /// Name of App Service Plan. + /// The cancellation token to use. + /// or is null. + public async Task> GetServerFarmSkusAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetServerFarmSkusRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + object value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = document.RootElement.GetObject(); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all selectable SKUs for a given App Service Plan. + /// Name of the resource group to which the resource belongs. + /// Name of App Service Plan. + /// The cancellation token to use. + /// or is null. + public Response GetServerFarmSkus(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetServerFarmSkusRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + object value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = document.RootElement.GetObject(); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string name, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/usages", false); + uri.AppendQuery("api-version", apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets server farm usage information. + /// Name of the resource group to which the resource belongs. + /// Name of App Service Plan. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). + /// The cancellation token to use. + /// or is null. + public async Task> ListUsagesAsync(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListUsagesRequest(resourceGroupName, name, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets server farm usage information. + /// Name of the resource group to which the resource belongs. + /// Name of App Service Plan. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). + /// The cancellation token to use. + /// or is null. + public Response ListUsages(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListUsagesRequest(resourceGroupName, name, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListVnetsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all Virtual Networks associated with an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// or is null. + public async Task>> ListVnetsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListVnetsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VnetInfo.DeserializeVnetInfo(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all Virtual Networks associated with an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// or is null. + public Response> ListVnets(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListVnetsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VnetInfo.DeserializeVnetInfo(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetVnetFromServerFarmRequest(string resourceGroupName, string name, string vnetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a Virtual Network associated with an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetVnetFromServerFarmAsync(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + + using var message = CreateGetVnetFromServerFarmRequest(resourceGroupName, name, vnetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VnetInfo)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a Virtual Network associated with an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// The cancellation token to use. + /// , , or is null. + public Response GetVnetFromServerFarm(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + + using var message = CreateGetVnetFromServerFarmRequest(resourceGroupName, name, vnetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VnetInfo)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetVnetGatewayRequest(string resourceGroupName, string name, string vnetName, string gatewayName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a Virtual Network gateway. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// Name of the gateway. Only the 'primary' gateway is supported. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetVnetGatewayAsync(string resourceGroupName, string name, string vnetName, string gatewayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + + using var message = CreateGetVnetGatewayRequest(resourceGroupName, name, vnetName, gatewayName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a Virtual Network gateway. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// Name of the gateway. Only the 'primary' gateway is supported. + /// The cancellation token to use. + /// , , , or is null. + public Response GetVnetGateway(string resourceGroupName, string name, string vnetName, string gatewayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + + using var message = CreateGetVnetGatewayRequest(resourceGroupName, name, vnetName, gatewayName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateVnetGatewayRequest(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Update a Virtual Network gateway. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// Name of the gateway. Only the 'primary' gateway is supported. + /// Definition of the gateway. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> UpdateVnetGatewayAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateVnetGatewayRequest(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Update a Virtual Network gateway. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// Name of the gateway. Only the 'primary' gateway is supported. + /// Definition of the gateway. + /// The cancellation token to use. + /// , , , , or is null. + public Response UpdateVnetGateway(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateVnetGatewayRequest(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRoutesForVnetRequest(string resourceGroupName, string name, string vnetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/routes", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all routes that are associated with a Virtual Network in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// The cancellation token to use. + /// , , or is null. + public async Task>> ListRoutesForVnetAsync(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + + using var message = CreateListRoutesForVnetRequest(resourceGroupName, name, vnetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VnetRoute.DeserializeVnetRoute(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all routes that are associated with a Virtual Network in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// The cancellation token to use. + /// , , or is null. + public Response> ListRoutesForVnet(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + + using var message = CreateListRoutesForVnetRequest(resourceGroupName, name, vnetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VnetRoute.DeserializeVnetRoute(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRouteForVnetRequest(string resourceGroupName, string name, string vnetName, string routeName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/routes/", false); + uri.AppendPath(routeName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a Virtual Network route in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// Name of the Virtual Network route. + /// The cancellation token to use. + /// , , , or is null. + public async Task>> GetRouteForVnetAsync(string resourceGroupName, string name, string vnetName, string routeName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (routeName == null) + { + throw new ArgumentNullException(nameof(routeName)); + } + + using var message = CreateGetRouteForVnetRequest(resourceGroupName, name, vnetName, routeName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VnetRoute.DeserializeVnetRoute(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IReadOnlyList)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a Virtual Network route in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// Name of the Virtual Network route. + /// The cancellation token to use. + /// , , , or is null. + public Response> GetRouteForVnet(string resourceGroupName, string name, string vnetName, string routeName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (routeName == null) + { + throw new ArgumentNullException(nameof(routeName)); + } + + using var message = CreateGetRouteForVnetRequest(resourceGroupName, name, vnetName, routeName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VnetRoute.DeserializeVnetRoute(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IReadOnlyList)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateVnetRouteRequest(string resourceGroupName, string name, string vnetName, string routeName, VnetRoute route) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/routes/", false); + uri.AppendPath(routeName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(route); + request.Content = content; + return message; + } + + /// Description for Create or update a Virtual Network route in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// Name of the Virtual Network route. + /// Definition of the Virtual Network route. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> CreateOrUpdateVnetRouteAsync(string resourceGroupName, string name, string vnetName, string routeName, VnetRoute route, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (routeName == null) + { + throw new ArgumentNullException(nameof(routeName)); + } + if (route == null) + { + throw new ArgumentNullException(nameof(route)); + } + + using var message = CreateCreateOrUpdateVnetRouteRequest(resourceGroupName, name, vnetName, routeName, route); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetRoute value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetRoute.DeserializeVnetRoute(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 400: + case 404: + return Response.FromValue((VnetRoute)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create or update a Virtual Network route in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// Name of the Virtual Network route. + /// Definition of the Virtual Network route. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateOrUpdateVnetRoute(string resourceGroupName, string name, string vnetName, string routeName, VnetRoute route, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (routeName == null) + { + throw new ArgumentNullException(nameof(routeName)); + } + if (route == null) + { + throw new ArgumentNullException(nameof(route)); + } + + using var message = CreateCreateOrUpdateVnetRouteRequest(resourceGroupName, name, vnetName, routeName, route); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetRoute value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetRoute.DeserializeVnetRoute(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 400: + case 404: + return Response.FromValue((VnetRoute)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteVnetRouteRequest(string resourceGroupName, string name, string vnetName, string routeName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/routes/", false); + uri.AppendPath(routeName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a Virtual Network route in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// Name of the Virtual Network route. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteVnetRouteAsync(string resourceGroupName, string name, string vnetName, string routeName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (routeName == null) + { + throw new ArgumentNullException(nameof(routeName)); + } + + using var message = CreateDeleteVnetRouteRequest(resourceGroupName, name, vnetName, routeName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a Virtual Network route in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// Name of the Virtual Network route. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteVnetRoute(string resourceGroupName, string name, string vnetName, string routeName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (routeName == null) + { + throw new ArgumentNullException(nameof(routeName)); + } + + using var message = CreateDeleteVnetRouteRequest(resourceGroupName, name, vnetName, routeName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateVnetRouteRequest(string resourceGroupName, string name, string vnetName, string routeName, VnetRoute route) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/routes/", false); + uri.AppendPath(routeName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(route); + request.Content = content; + return message; + } + + /// Description for Create or update a Virtual Network route in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// Name of the Virtual Network route. + /// Definition of the Virtual Network route. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> UpdateVnetRouteAsync(string resourceGroupName, string name, string vnetName, string routeName, VnetRoute route, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (routeName == null) + { + throw new ArgumentNullException(nameof(routeName)); + } + if (route == null) + { + throw new ArgumentNullException(nameof(route)); + } + + using var message = CreateUpdateVnetRouteRequest(resourceGroupName, name, vnetName, routeName, route); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetRoute value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetRoute.DeserializeVnetRoute(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 400: + case 404: + return Response.FromValue((VnetRoute)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create or update a Virtual Network route in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Virtual Network. + /// Name of the Virtual Network route. + /// Definition of the Virtual Network route. + /// The cancellation token to use. + /// , , , , or is null. + public Response UpdateVnetRoute(string resourceGroupName, string name, string vnetName, string routeName, VnetRoute route, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (routeName == null) + { + throw new ArgumentNullException(nameof(routeName)); + } + if (route == null) + { + throw new ArgumentNullException(nameof(route)); + } + + using var message = CreateUpdateVnetRouteRequest(resourceGroupName, name, vnetName, routeName, route); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetRoute value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetRoute.DeserializeVnetRoute(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 400: + case 404: + return Response.FromValue((VnetRoute)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRebootWorkerRequest(string resourceGroupName, string name, string workerName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); + uri.AppendPath(name, true); + uri.AppendPath("/workers/", false); + uri.AppendPath(workerName, true); + uri.AppendPath("/reboot", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Reboot a worker machine in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of worker machine, which typically starts with RD. + /// The cancellation token to use. + /// , , or is null. + public async Task RebootWorkerAsync(string resourceGroupName, string name, string workerName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerName == null) + { + throw new ArgumentNullException(nameof(workerName)); + } + + using var message = CreateRebootWorkerRequest(resourceGroupName, name, workerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Reboot a worker machine in an App Service plan. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of worker machine, which typically starts with RD. + /// The cancellation token to use. + /// , , or is null. + public Response RebootWorker(string resourceGroupName, string name, string workerName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (workerName == null) + { + throw new ArgumentNullException(nameof(workerName)); + } + + using var message = CreateRebootWorkerRequest(resourceGroupName, name, workerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, bool? detailed) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all App Service plans for a subscription. + /// The URL to the next page of results. + /// + /// Specify <code>true</code> to return all App Service plan properties. The default is <code>false</code>, which returns a subset of the properties. + /// Retrieval of all properties may increase the API latency. + /// + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, bool? detailed = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink, detailed); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServicePlanCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all App Service plans for a subscription. + /// The URL to the next page of results. + /// + /// Specify <code>true</code> to return all App Service plan properties. The default is <code>false</code>, which returns a subset of the properties. + /// Retrieval of all properties may increase the API latency. + /// + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, bool? detailed = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink, detailed); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServicePlanCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all App Service plans in a resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppServicePlanCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all App Service plans in a resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppServicePlanCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebAppsByHybridConnectionNextPageRequest(string nextLink, string resourceGroupName, string name, string namespaceName, string relayName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all apps that use a Hybrid Connection in an App Service Plan. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Hybrid Connection namespace. + /// Name of the Hybrid Connection relay. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListWebAppsByHybridConnectionNextPageAsync(string nextLink, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateListWebAppsByHybridConnectionNextPageRequest(nextLink, resourceGroupName, name, namespaceName, relayName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceCollection.DeserializeResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all apps that use a Hybrid Connection in an App Service Plan. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Name of the Hybrid Connection namespace. + /// Name of the Hybrid Connection relay. + /// The cancellation token to use. + /// , , , , or is null. + public Response ListWebAppsByHybridConnectionNextPage(string nextLink, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateListWebAppsByHybridConnectionNextPageRequest(nextLink, resourceGroupName, name, namespaceName, relayName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceCollection.DeserializeResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHybridConnectionsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Retrieve all Hybrid Connections in use in an App Service plan. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListHybridConnectionsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHybridConnectionsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnectionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnectionCollection.DeserializeHybridConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Retrieve all Hybrid Connections in use in an App Service plan. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// The cancellation token to use. + /// , , or is null. + public Response ListHybridConnectionsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHybridConnectionsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnectionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnectionCollection.DeserializeHybridConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebAppsNextPageRequest(string nextLink, string resourceGroupName, string name, string skipToken, string filter, string top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all apps associated with an App Service plan. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list. + /// Supported filter: $filter=state eq running. Returns only web apps that are currently running. + /// List page size. If specified, results are paged. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListWebAppsNextPageAsync(string nextLink, string resourceGroupName, string name, string skipToken = null, string filter = null, string top = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWebAppsNextPageRequest(nextLink, resourceGroupName, name, skipToken, filter, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all apps associated with an App Service plan. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the App Service plan. + /// Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list. + /// Supported filter: $filter=state eq running. Returns only web apps that are currently running. + /// List page size. If specified, results are paged. + /// The cancellation token to use. + /// , , or is null. + public Response ListWebAppsNextPage(string nextLink, string resourceGroupName, string name, string skipToken = null, string filter = null, string top = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWebAppsNextPageRequest(nextLink, resourceGroupName, name, skipToken, filter, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListUsagesNextPageRequest(string nextLink, string resourceGroupName, string name, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets server farm usage information. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of App Service Plan. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). + /// The cancellation token to use. + /// , , or is null. + public async Task> ListUsagesNextPageAsync(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListUsagesNextPageRequest(nextLink, resourceGroupName, name, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets server farm usage information. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of App Service Plan. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). + /// The cancellation token to use. + /// , , or is null. + public Response ListUsagesNextPage(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListUsagesNextPageRequest(nextLink, resourceGroupName, name, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsRestClient.cs new file mode 100644 index 000000000000..f7854c3a36e9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsRestClient.cs @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class CertificateOrdersDiagnosticsRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of CertificateOrdersDiagnosticsRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public CertificateOrdersDiagnosticsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListAppServiceCertificateOrderDetectorResponseRequest(string resourceGroupName, string certificateOrderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/detectors", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// Name of the resource group to which the resource belongs. + /// The certificate order name for which the response is needed. + /// The cancellation token to use. + /// or is null. + public async Task> ListAppServiceCertificateOrderDetectorResponseAsync(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateListAppServiceCertificateOrderDetectorResponseRequest(resourceGroupName, certificateOrderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// Name of the resource group to which the resource belongs. + /// The certificate order name for which the response is needed. + /// The cancellation token to use. + /// or is null. + public Response ListAppServiceCertificateOrderDetectorResponse(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateListAppServiceCertificateOrderDetectorResponseRequest(resourceGroupName, certificateOrderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAppServiceCertificateOrderDetectorResponseRequest(string resourceGroupName, string certificateOrderName, string detectorName, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); + uri.AppendPath(certificateOrderName, true); + uri.AppendPath("/detectors/", false); + uri.AppendPath(detectorName, true); + if (startTime != null) + { + uri.AppendQuery("startTime", startTime.Value, "O", true); + } + if (endTime != null) + { + uri.AppendQuery("endTime", endTime.Value, "O", true); + } + if (timeGrain != null) + { + uri.AppendQuery("timeGrain", timeGrain, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Microsoft.CertificateRegistration call to get a detector response from App Lens. + /// Name of the resource group to which the resource belongs. + /// The certificate order name for which the response is needed. + /// The detector name which needs to be run. + /// The start time for detector response. + /// The end time for the detector response. + /// The time grain for the detector response. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetAppServiceCertificateOrderDetectorResponseAsync(string resourceGroupName, string certificateOrderName, string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + + using var message = CreateGetAppServiceCertificateOrderDetectorResponseRequest(resourceGroupName, certificateOrderName, detectorName, startTime, endTime, timeGrain); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Microsoft.CertificateRegistration call to get a detector response from App Lens. + /// Name of the resource group to which the resource belongs. + /// The certificate order name for which the response is needed. + /// The detector name which needs to be run. + /// The start time for detector response. + /// The end time for the detector response. + /// The time grain for the detector response. + /// The cancellation token to use. + /// , , or is null. + public Response GetAppServiceCertificateOrderDetectorResponse(string resourceGroupName, string certificateOrderName, string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + + using var message = CreateGetAppServiceCertificateOrderDetectorResponseRequest(resourceGroupName, certificateOrderName, detectorName, startTime, endTime, timeGrain); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListAppServiceCertificateOrderDetectorResponseNextPageRequest(string nextLink, string resourceGroupName, string certificateOrderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The certificate order name for which the response is needed. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListAppServiceCertificateOrderDetectorResponseNextPageAsync(string nextLink, string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateListAppServiceCertificateOrderDetectorResponseNextPageRequest(nextLink, resourceGroupName, certificateOrderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The certificate order name for which the response is needed. + /// The cancellation token to use. + /// , , or is null. + public Response ListAppServiceCertificateOrderDetectorResponseNextPage(string nextLink, string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (certificateOrderName == null) + { + throw new ArgumentNullException(nameof(certificateOrderName)); + } + + using var message = CreateListAppServiceCertificateOrderDetectorResponseNextPageRequest(nextLink, resourceGroupName, certificateOrderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateRegistrationProviderRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateRegistrationProviderRestClient.cs new file mode 100644 index 000000000000..23fdf0c0400f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateRegistrationProviderRestClient.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class CertificateRegistrationProviderRestClient + { + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of CertificateRegistrationProviderRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// server parameter. + /// Api Version. + /// is null. + public CertificateRegistrationProviderRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint = null, string apiVersion = "2020-12-01") + { + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListOperationsRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.CertificateRegistration/operations", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + /// The cancellation token to use. + public async Task> ListOperationsAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListOperationsRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmOperationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + /// The cancellation token to use. + public Response ListOperations(CancellationToken cancellationToken = default) + { + using var message = CreateListOperationsRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmOperationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListOperationsNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListOperationsNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListOperationsNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmOperationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListOperationsNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListOperationsNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmOperationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesRestClient.cs new file mode 100644 index 000000000000..5456e15582c3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesRestClient.cs @@ -0,0 +1,685 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class CertificatesRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of CertificatesRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public CertificatesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest(string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/certificates", false); + uri.AppendQuery("api-version", apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all certificates for a subscription. + /// Return only information specified in the filter (using OData syntax). For example: $filter=KeyVaultId eq 'KeyVaultId'. + /// The cancellation token to use. + public async Task> ListAsync(string filter = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CertificateCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all certificates for a subscription. + /// Return only information specified in the filter (using OData syntax). For example: $filter=KeyVaultId eq 'KeyVaultId'. + /// The cancellation token to use. + public Response List(string filter = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CertificateCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/certificates", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all certificates in a resource group. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CertificateCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all certificates in a resource group. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CertificateCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/certificates/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a certificate. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate. + /// The cancellation token to use. + /// or is null. + public async Task> GetAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Certificate value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Certificate.DeserializeCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a certificate. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate. + /// The cancellation token to use. + /// or is null. + public Response Get(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Certificate value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Certificate.DeserializeCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string name, Certificate certificateEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/certificates/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(certificateEnvelope); + request.Content = content; + return message; + } + + /// Description for Create or update a certificate. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate. + /// Details of certificate, if it exists already. + /// The cancellation token to use. + /// , , or is null. + public async Task> CreateOrUpdateAsync(string resourceGroupName, string name, Certificate certificateEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (certificateEnvelope == null) + { + throw new ArgumentNullException(nameof(certificateEnvelope)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, certificateEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Certificate value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Certificate.DeserializeCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create or update a certificate. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate. + /// Details of certificate, if it exists already. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdate(string resourceGroupName, string name, Certificate certificateEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (certificateEnvelope == null) + { + throw new ArgumentNullException(nameof(certificateEnvelope)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, certificateEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Certificate value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Certificate.DeserializeCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/certificates/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a certificate. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate. + /// The cancellation token to use. + /// or is null. + public async Task DeleteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a certificate. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate. + /// The cancellation token to use. + /// or is null. + public Response Delete(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string resourceGroupName, string name, CertificatePatchResource certificateEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/certificates/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(certificateEnvelope); + request.Content = content; + return message; + } + + /// Description for Create or update a certificate. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate. + /// Details of certificate, if it exists already. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateAsync(string resourceGroupName, string name, CertificatePatchResource certificateEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (certificateEnvelope == null) + { + throw new ArgumentNullException(nameof(certificateEnvelope)); + } + + using var message = CreateUpdateRequest(resourceGroupName, name, certificateEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Certificate value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Certificate.DeserializeCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create or update a certificate. + /// Name of the resource group to which the resource belongs. + /// Name of the certificate. + /// Details of certificate, if it exists already. + /// The cancellation token to use. + /// , , or is null. + public Response Update(string resourceGroupName, string name, CertificatePatchResource certificateEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (certificateEnvelope == null) + { + throw new ArgumentNullException(nameof(certificateEnvelope)); + } + + using var message = CreateUpdateRequest(resourceGroupName, name, certificateEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Certificate value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Certificate.DeserializeCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all certificates for a subscription. + /// The URL to the next page of results. + /// Return only information specified in the filter (using OData syntax). For example: $filter=KeyVaultId eq 'KeyVaultId'. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CertificateCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all certificates for a subscription. + /// The URL to the next page of results. + /// Return only information specified in the filter (using OData syntax). For example: $filter=KeyVaultId eq 'KeyVaultId'. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CertificateCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all certificates in a resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CertificateCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all certificates in a resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CertificateCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DeletedWebAppsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DeletedWebAppsRestClient.cs new file mode 100644 index 000000000000..0692eebd419e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DeletedWebAppsRestClient.cs @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class DeletedWebAppsRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of DeletedWebAppsRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public DeletedWebAppsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/deletedSites", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all deleted apps for a subscription. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeletedWebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all deleted apps for a subscription. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeletedWebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByLocationRequest(string location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/deletedSites", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all deleted apps for a subscription at location. + /// The String to use. + /// The cancellation token to use. + /// is null. + public async Task> ListByLocationAsync(string location, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateListByLocationRequest(location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeletedWebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all deleted apps for a subscription at location. + /// The String to use. + /// The cancellation token to use. + /// is null. + public Response ListByLocation(string location, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateListByLocationRequest(location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeletedWebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetDeletedWebAppByLocationRequest(string location, string deletedSiteId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/deletedSites/", false); + uri.AppendPath(deletedSiteId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get deleted app for a subscription at location. + /// The String to use. + /// The numeric ID of the deleted app, e.g. 12345. + /// The cancellation token to use. + /// or is null. + public async Task> GetDeletedWebAppByLocationAsync(string location, string deletedSiteId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (deletedSiteId == null) + { + throw new ArgumentNullException(nameof(deletedSiteId)); + } + + using var message = CreateGetDeletedWebAppByLocationRequest(location, deletedSiteId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeletedSite value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeletedSite.DeserializeDeletedSite(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get deleted app for a subscription at location. + /// The String to use. + /// The numeric ID of the deleted app, e.g. 12345. + /// The cancellation token to use. + /// or is null. + public Response GetDeletedWebAppByLocation(string location, string deletedSiteId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (deletedSiteId == null) + { + throw new ArgumentNullException(nameof(deletedSiteId)); + } + + using var message = CreateGetDeletedWebAppByLocationRequest(location, deletedSiteId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeletedSite value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeletedSite.DeserializeDeletedSite(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all deleted apps for a subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeletedWebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all deleted apps for a subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeletedWebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all deleted apps for a subscription at location. + /// The URL to the next page of results. + /// The String to use. + /// The cancellation token to use. + /// or is null. + public async Task> ListByLocationNextPageAsync(string nextLink, string location, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateListByLocationNextPageRequest(nextLink, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeletedWebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all deleted apps for a subscription at location. + /// The URL to the next page of results. + /// The String to use. + /// The cancellation token to use. + /// or is null. + public Response ListByLocationNextPage(string nextLink, string location, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateListByLocationNextPageRequest(nextLink, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeletedWebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DiagnosticsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DiagnosticsRestClient.cs new file mode 100644 index 000000000000..4c327025eb9e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DiagnosticsRestClient.cs @@ -0,0 +1,3301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class DiagnosticsRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of DiagnosticsRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public DiagnosticsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListHostingEnvironmentDetectorResponsesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/detectors", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List Hosting Environment Detector Responses. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// The cancellation token to use. + /// or is null. + public async Task> ListHostingEnvironmentDetectorResponsesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHostingEnvironmentDetectorResponsesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List Hosting Environment Detector Responses. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// The cancellation token to use. + /// or is null. + public Response ListHostingEnvironmentDetectorResponses(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHostingEnvironmentDetectorResponsesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetHostingEnvironmentDetectorResponseRequest(string resourceGroupName, string name, string detectorName, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(name, true); + uri.AppendPath("/detectors/", false); + uri.AppendPath(detectorName, true); + if (startTime != null) + { + uri.AppendQuery("startTime", startTime.Value, "O", true); + } + if (endTime != null) + { + uri.AppendQuery("endTime", endTime.Value, "O", true); + } + if (timeGrain != null) + { + uri.AppendQuery("timeGrain", timeGrain, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Hosting Environment Detector Response. + /// Name of the resource group to which the resource belongs. + /// App Service Environment Name. + /// Detector Resource Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetHostingEnvironmentDetectorResponseAsync(string resourceGroupName, string name, string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + + using var message = CreateGetHostingEnvironmentDetectorResponseRequest(resourceGroupName, name, detectorName, startTime, endTime, timeGrain); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Hosting Environment Detector Response. + /// Name of the resource group to which the resource belongs. + /// App Service Environment Name. + /// Detector Resource Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , or is null. + public Response GetHostingEnvironmentDetectorResponse(string resourceGroupName, string name, string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + + using var message = CreateGetHostingEnvironmentDetectorResponseRequest(resourceGroupName, name, detectorName, startTime, endTime, timeGrain); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteDetectorResponsesRequest(string resourceGroupName, string siteName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/detectors", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List Site Detector Responses. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// The cancellation token to use. + /// or is null. + public async Task> ListSiteDetectorResponsesAsync(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListSiteDetectorResponsesRequest(resourceGroupName, siteName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List Site Detector Responses. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// The cancellation token to use. + /// or is null. + public Response ListSiteDetectorResponses(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListSiteDetectorResponsesRequest(resourceGroupName, siteName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteDetectorResponseRequest(string resourceGroupName, string siteName, string detectorName, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/detectors/", false); + uri.AppendPath(detectorName, true); + if (startTime != null) + { + uri.AppendQuery("startTime", startTime.Value, "O", true); + } + if (endTime != null) + { + uri.AppendQuery("endTime", endTime.Value, "O", true); + } + if (timeGrain != null) + { + uri.AppendQuery("timeGrain", timeGrain, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get site detector response. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Detector Resource Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetSiteDetectorResponseAsync(string resourceGroupName, string siteName, string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + + using var message = CreateGetSiteDetectorResponseRequest(resourceGroupName, siteName, detectorName, startTime, endTime, timeGrain); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get site detector response. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Detector Resource Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , or is null. + public Response GetSiteDetectorResponse(string resourceGroupName, string siteName, string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + + using var message = CreateGetSiteDetectorResponseRequest(resourceGroupName, siteName, detectorName, startTime, endTime, timeGrain); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteDiagnosticCategoriesRequest(string resourceGroupName, string siteName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/diagnostics", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Diagnostics Categories. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// The cancellation token to use. + /// or is null. + public async Task> ListSiteDiagnosticCategoriesAsync(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListSiteDiagnosticCategoriesRequest(resourceGroupName, siteName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticCategoryCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Diagnostics Categories. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// The cancellation token to use. + /// or is null. + public Response ListSiteDiagnosticCategories(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListSiteDiagnosticCategoriesRequest(resourceGroupName, siteName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticCategoryCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteDiagnosticCategoryRequest(string resourceGroupName, string siteName, string diagnosticCategory) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Diagnostics Category. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetSiteDiagnosticCategoryAsync(string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + + using var message = CreateGetSiteDiagnosticCategoryRequest(resourceGroupName, siteName, diagnosticCategory); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticCategory value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticCategory.DeserializeDiagnosticCategory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Diagnostics Category. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// The cancellation token to use. + /// , , or is null. + public Response GetSiteDiagnosticCategory(string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + + using var message = CreateGetSiteDiagnosticCategoryRequest(resourceGroupName, siteName, diagnosticCategory); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticCategory value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticCategory.DeserializeDiagnosticCategory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteAnalysesRequest(string resourceGroupName, string siteName, string diagnosticCategory) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendPath("/analyses", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Site Analyses. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSiteAnalysesAsync(string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + + using var message = CreateListSiteAnalysesRequest(resourceGroupName, siteName, diagnosticCategory); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticAnalysisCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Site Analyses. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// The cancellation token to use. + /// , , or is null. + public Response ListSiteAnalyses(string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + + using var message = CreateListSiteAnalysesRequest(resourceGroupName, siteName, diagnosticCategory); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticAnalysisCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteAnalysisRequest(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendPath("/analyses/", false); + uri.AppendPath(analysisName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Site Analysis. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Analysis Name. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetSiteAnalysisAsync(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (analysisName == null) + { + throw new ArgumentNullException(nameof(analysisName)); + } + + using var message = CreateGetSiteAnalysisRequest(resourceGroupName, siteName, diagnosticCategory, analysisName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AnalysisDefinition value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AnalysisDefinition.DeserializeAnalysisDefinition(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Site Analysis. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Analysis Name. + /// The cancellation token to use. + /// , , , or is null. + public Response GetSiteAnalysis(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (analysisName == null) + { + throw new ArgumentNullException(nameof(analysisName)); + } + + using var message = CreateGetSiteAnalysisRequest(resourceGroupName, siteName, diagnosticCategory, analysisName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AnalysisDefinition value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AnalysisDefinition.DeserializeAnalysisDefinition(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateExecuteSiteAnalysisRequest(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendPath("/analyses/", false); + uri.AppendPath(analysisName, true); + uri.AppendPath("/execute", false); + if (startTime != null) + { + uri.AppendQuery("startTime", startTime.Value, "O", true); + } + if (endTime != null) + { + uri.AppendQuery("endTime", endTime.Value, "O", true); + } + if (timeGrain != null) + { + uri.AppendQuery("timeGrain", timeGrain, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Execute Analysis. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Category Name. + /// Analysis Resource Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ExecuteSiteAnalysisAsync(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (analysisName == null) + { + throw new ArgumentNullException(nameof(analysisName)); + } + + using var message = CreateExecuteSiteAnalysisRequest(resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticAnalysis value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticAnalysis.DeserializeDiagnosticAnalysis(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Execute Analysis. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Category Name. + /// Analysis Resource Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , , or is null. + public Response ExecuteSiteAnalysis(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (analysisName == null) + { + throw new ArgumentNullException(nameof(analysisName)); + } + + using var message = CreateExecuteSiteAnalysisRequest(resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticAnalysis value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticAnalysis.DeserializeDiagnosticAnalysis(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteDetectorsRequest(string resourceGroupName, string siteName, string diagnosticCategory) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendPath("/detectors", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Detectors. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSiteDetectorsAsync(string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + + using var message = CreateListSiteDetectorsRequest(resourceGroupName, siteName, diagnosticCategory); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticDetectorCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Detectors. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// The cancellation token to use. + /// , , or is null. + public Response ListSiteDetectors(string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + + using var message = CreateListSiteDetectorsRequest(resourceGroupName, siteName, diagnosticCategory); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticDetectorCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteDetectorRequest(string resourceGroupName, string siteName, string diagnosticCategory, string detectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendPath("/detectors/", false); + uri.AppendPath(detectorName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Detector. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Detector Name. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetSiteDetectorAsync(string resourceGroupName, string siteName, string diagnosticCategory, string detectorName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + + using var message = CreateGetSiteDetectorRequest(resourceGroupName, siteName, diagnosticCategory, detectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorDefinition value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorDefinition.DeserializeDetectorDefinition(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Detector. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Detector Name. + /// The cancellation token to use. + /// , , , or is null. + public Response GetSiteDetector(string resourceGroupName, string siteName, string diagnosticCategory, string detectorName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + + using var message = CreateGetSiteDetectorRequest(resourceGroupName, siteName, diagnosticCategory, detectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorDefinition value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorDefinition.DeserializeDetectorDefinition(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateExecuteSiteDetectorRequest(string resourceGroupName, string siteName, string detectorName, string diagnosticCategory, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendPath("/detectors/", false); + uri.AppendPath(detectorName, true); + uri.AppendPath("/execute", false); + if (startTime != null) + { + uri.AppendQuery("startTime", startTime.Value, "O", true); + } + if (endTime != null) + { + uri.AppendQuery("endTime", endTime.Value, "O", true); + } + if (timeGrain != null) + { + uri.AppendQuery("timeGrain", timeGrain, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Execute Detector. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Detector Resource Name. + /// Category Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ExecuteSiteDetectorAsync(string resourceGroupName, string siteName, string detectorName, string diagnosticCategory, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + + using var message = CreateExecuteSiteDetectorRequest(resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticDetectorResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticDetectorResponse.DeserializeDiagnosticDetectorResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Execute Detector. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Detector Resource Name. + /// Category Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , , or is null. + public Response ExecuteSiteDetector(string resourceGroupName, string siteName, string detectorName, string diagnosticCategory, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + + using var message = CreateExecuteSiteDetectorRequest(resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticDetectorResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticDetectorResponse.DeserializeDiagnosticDetectorResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteDetectorResponsesSlotRequest(string resourceGroupName, string siteName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/detectors", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List Site Detector Responses. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Slot Name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSiteDetectorResponsesSlotAsync(string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteDetectorResponsesSlotRequest(resourceGroupName, siteName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List Site Detector Responses. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Slot Name. + /// The cancellation token to use. + /// , , or is null. + public Response ListSiteDetectorResponsesSlot(string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteDetectorResponsesSlotRequest(resourceGroupName, siteName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteDetectorResponseSlotRequest(string resourceGroupName, string siteName, string detectorName, string slot, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/detectors/", false); + uri.AppendPath(detectorName, true); + if (startTime != null) + { + uri.AppendQuery("startTime", startTime.Value, "O", true); + } + if (endTime != null) + { + uri.AppendQuery("endTime", endTime.Value, "O", true); + } + if (timeGrain != null) + { + uri.AppendQuery("timeGrain", timeGrain, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get site detector response. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Detector Resource Name. + /// Slot Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetSiteDetectorResponseSlotAsync(string resourceGroupName, string siteName, string detectorName, string slot, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteDetectorResponseSlotRequest(resourceGroupName, siteName, detectorName, slot, startTime, endTime, timeGrain); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get site detector response. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Detector Resource Name. + /// Slot Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , , or is null. + public Response GetSiteDetectorResponseSlot(string resourceGroupName, string siteName, string detectorName, string slot, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteDetectorResponseSlotRequest(resourceGroupName, siteName, detectorName, slot, startTime, endTime, timeGrain); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteDiagnosticCategoriesSlotRequest(string resourceGroupName, string siteName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/diagnostics", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Diagnostics Categories. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Slot Name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSiteDiagnosticCategoriesSlotAsync(string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteDiagnosticCategoriesSlotRequest(resourceGroupName, siteName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticCategoryCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Diagnostics Categories. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Slot Name. + /// The cancellation token to use. + /// , , or is null. + public Response ListSiteDiagnosticCategoriesSlot(string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteDiagnosticCategoriesSlotRequest(resourceGroupName, siteName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticCategoryCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteDiagnosticCategorySlotRequest(string resourceGroupName, string siteName, string diagnosticCategory, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Diagnostics Category. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Slot Name. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetSiteDiagnosticCategorySlotAsync(string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteDiagnosticCategorySlotRequest(resourceGroupName, siteName, diagnosticCategory, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticCategory value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticCategory.DeserializeDiagnosticCategory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Diagnostics Category. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Slot Name. + /// The cancellation token to use. + /// , , , or is null. + public Response GetSiteDiagnosticCategorySlot(string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteDiagnosticCategorySlotRequest(resourceGroupName, siteName, diagnosticCategory, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticCategory value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticCategory.DeserializeDiagnosticCategory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteAnalysesSlotRequest(string resourceGroupName, string siteName, string diagnosticCategory, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendPath("/analyses", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Site Analyses. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Slot Name. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListSiteAnalysesSlotAsync(string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteAnalysesSlotRequest(resourceGroupName, siteName, diagnosticCategory, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticAnalysisCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Site Analyses. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Slot Name. + /// The cancellation token to use. + /// , , , or is null. + public Response ListSiteAnalysesSlot(string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteAnalysesSlotRequest(resourceGroupName, siteName, diagnosticCategory, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticAnalysisCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteAnalysisSlotRequest(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendPath("/analyses/", false); + uri.AppendPath(analysisName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Site Analysis. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Analysis Name. + /// Slot - optional. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> GetSiteAnalysisSlotAsync(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (analysisName == null) + { + throw new ArgumentNullException(nameof(analysisName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteAnalysisSlotRequest(resourceGroupName, siteName, diagnosticCategory, analysisName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AnalysisDefinition value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AnalysisDefinition.DeserializeAnalysisDefinition(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Site Analysis. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Analysis Name. + /// Slot - optional. + /// The cancellation token to use. + /// , , , , or is null. + public Response GetSiteAnalysisSlot(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (analysisName == null) + { + throw new ArgumentNullException(nameof(analysisName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteAnalysisSlotRequest(resourceGroupName, siteName, diagnosticCategory, analysisName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AnalysisDefinition value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AnalysisDefinition.DeserializeAnalysisDefinition(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateExecuteSiteAnalysisSlotRequest(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, string slot, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendPath("/analyses/", false); + uri.AppendPath(analysisName, true); + uri.AppendPath("/execute", false); + if (startTime != null) + { + uri.AppendQuery("startTime", startTime.Value, "O", true); + } + if (endTime != null) + { + uri.AppendQuery("endTime", endTime.Value, "O", true); + } + if (timeGrain != null) + { + uri.AppendQuery("timeGrain", timeGrain, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Execute Analysis. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Category Name. + /// Analysis Resource Name. + /// Slot Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ExecuteSiteAnalysisSlotAsync(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, string slot, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (analysisName == null) + { + throw new ArgumentNullException(nameof(analysisName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateExecuteSiteAnalysisSlotRequest(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, startTime, endTime, timeGrain); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticAnalysis value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticAnalysis.DeserializeDiagnosticAnalysis(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Execute Analysis. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Category Name. + /// Analysis Resource Name. + /// Slot Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , , , or is null. + public Response ExecuteSiteAnalysisSlot(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, string slot, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (analysisName == null) + { + throw new ArgumentNullException(nameof(analysisName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateExecuteSiteAnalysisSlotRequest(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, startTime, endTime, timeGrain); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticAnalysis value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticAnalysis.DeserializeDiagnosticAnalysis(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteDetectorsSlotRequest(string resourceGroupName, string siteName, string diagnosticCategory, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendPath("/detectors", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Detectors. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Slot Name. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListSiteDetectorsSlotAsync(string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteDetectorsSlotRequest(resourceGroupName, siteName, diagnosticCategory, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticDetectorCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Detectors. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Slot Name. + /// The cancellation token to use. + /// , , , or is null. + public Response ListSiteDetectorsSlot(string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteDetectorsSlotRequest(resourceGroupName, siteName, diagnosticCategory, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticDetectorCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteDetectorSlotRequest(string resourceGroupName, string siteName, string diagnosticCategory, string detectorName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendPath("/detectors/", false); + uri.AppendPath(detectorName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Detector. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Detector Name. + /// Slot Name. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> GetSiteDetectorSlotAsync(string resourceGroupName, string siteName, string diagnosticCategory, string detectorName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteDetectorSlotRequest(resourceGroupName, siteName, diagnosticCategory, detectorName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorDefinition value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorDefinition.DeserializeDetectorDefinition(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Detector. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Detector Name. + /// Slot Name. + /// The cancellation token to use. + /// , , , , or is null. + public Response GetSiteDetectorSlot(string resourceGroupName, string siteName, string diagnosticCategory, string detectorName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteDetectorSlotRequest(resourceGroupName, siteName, diagnosticCategory, detectorName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorDefinition value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorDefinition.DeserializeDetectorDefinition(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateExecuteSiteDetectorSlotRequest(string resourceGroupName, string siteName, string detectorName, string diagnosticCategory, string slot, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/diagnostics/", false); + uri.AppendPath(diagnosticCategory, true); + uri.AppendPath("/detectors/", false); + uri.AppendPath(detectorName, true); + uri.AppendPath("/execute", false); + if (startTime != null) + { + uri.AppendQuery("startTime", startTime.Value, "O", true); + } + if (endTime != null) + { + uri.AppendQuery("endTime", endTime.Value, "O", true); + } + if (timeGrain != null) + { + uri.AppendQuery("timeGrain", timeGrain, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Execute Detector. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Detector Resource Name. + /// Category Name. + /// Slot Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ExecuteSiteDetectorSlotAsync(string resourceGroupName, string siteName, string detectorName, string diagnosticCategory, string slot, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateExecuteSiteDetectorSlotRequest(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, startTime, endTime, timeGrain); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticDetectorResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticDetectorResponse.DeserializeDiagnosticDetectorResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Execute Detector. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Detector Resource Name. + /// Category Name. + /// Slot Name. + /// Start Time. + /// End Time. + /// Time Grain. + /// The cancellation token to use. + /// , , , , or is null. + public Response ExecuteSiteDetectorSlot(string resourceGroupName, string siteName, string detectorName, string diagnosticCategory, string slot, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (detectorName == null) + { + throw new ArgumentNullException(nameof(detectorName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateExecuteSiteDetectorSlotRequest(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, startTime, endTime, timeGrain); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticDetectorResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticDetectorResponse.DeserializeDiagnosticDetectorResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHostingEnvironmentDetectorResponsesNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List Hosting Environment Detector Responses. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListHostingEnvironmentDetectorResponsesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHostingEnvironmentDetectorResponsesNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List Hosting Environment Detector Responses. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// The cancellation token to use. + /// , , or is null. + public Response ListHostingEnvironmentDetectorResponsesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHostingEnvironmentDetectorResponsesNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteDetectorResponsesNextPageRequest(string nextLink, string resourceGroupName, string siteName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List Site Detector Responses. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSiteDetectorResponsesNextPageAsync(string nextLink, string resourceGroupName, string siteName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListSiteDetectorResponsesNextPageRequest(nextLink, resourceGroupName, siteName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List Site Detector Responses. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// The cancellation token to use. + /// , , or is null. + public Response ListSiteDetectorResponsesNextPage(string nextLink, string resourceGroupName, string siteName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListSiteDetectorResponsesNextPageRequest(nextLink, resourceGroupName, siteName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteDiagnosticCategoriesNextPageRequest(string nextLink, string resourceGroupName, string siteName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Diagnostics Categories. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSiteDiagnosticCategoriesNextPageAsync(string nextLink, string resourceGroupName, string siteName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListSiteDiagnosticCategoriesNextPageRequest(nextLink, resourceGroupName, siteName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticCategoryCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Diagnostics Categories. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// The cancellation token to use. + /// , , or is null. + public Response ListSiteDiagnosticCategoriesNextPage(string nextLink, string resourceGroupName, string siteName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListSiteDiagnosticCategoriesNextPageRequest(nextLink, resourceGroupName, siteName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticCategoryCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteAnalysesNextPageRequest(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Site Analyses. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListSiteAnalysesNextPageAsync(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + + using var message = CreateListSiteAnalysesNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticAnalysisCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Site Analyses. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// The cancellation token to use. + /// , , , or is null. + public Response ListSiteAnalysesNextPage(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + + using var message = CreateListSiteAnalysesNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticAnalysisCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteDetectorsNextPageRequest(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Detectors. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListSiteDetectorsNextPageAsync(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + + using var message = CreateListSiteDetectorsNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticDetectorCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Detectors. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// The cancellation token to use. + /// , , , or is null. + public Response ListSiteDetectorsNextPage(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + + using var message = CreateListSiteDetectorsNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticDetectorCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteDetectorResponsesSlotNextPageRequest(string nextLink, string resourceGroupName, string siteName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List Site Detector Responses. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Slot Name. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListSiteDetectorResponsesSlotNextPageAsync(string nextLink, string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteDetectorResponsesSlotNextPageRequest(nextLink, resourceGroupName, siteName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List Site Detector Responses. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Slot Name. + /// The cancellation token to use. + /// , , , or is null. + public Response ListSiteDetectorResponsesSlotNextPage(string nextLink, string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteDetectorResponsesSlotNextPageRequest(nextLink, resourceGroupName, siteName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DetectorResponseCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteDiagnosticCategoriesSlotNextPageRequest(string nextLink, string resourceGroupName, string siteName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Diagnostics Categories. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Slot Name. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListSiteDiagnosticCategoriesSlotNextPageAsync(string nextLink, string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteDiagnosticCategoriesSlotNextPageRequest(nextLink, resourceGroupName, siteName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticCategoryCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Diagnostics Categories. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Slot Name. + /// The cancellation token to use. + /// , , , or is null. + public Response ListSiteDiagnosticCategoriesSlotNextPage(string nextLink, string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteDiagnosticCategoriesSlotNextPageRequest(nextLink, resourceGroupName, siteName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticCategoryCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteAnalysesSlotNextPageRequest(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Site Analyses. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Slot Name. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListSiteAnalysesSlotNextPageAsync(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteAnalysesSlotNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticAnalysisCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Site Analyses. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Slot Name. + /// The cancellation token to use. + /// , , , , or is null. + public Response ListSiteAnalysesSlotNextPage(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteAnalysesSlotNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticAnalysisCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteDetectorsSlotNextPageRequest(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get Detectors. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Slot Name. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListSiteDetectorsSlotNextPageAsync(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteDetectorsSlotNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DiagnosticDetectorCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get Detectors. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site Name. + /// Diagnostic Category. + /// Slot Name. + /// The cancellation token to use. + /// , , , , or is null. + public Response ListSiteDetectorsSlotNextPage(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (diagnosticCategory == null) + { + throw new ArgumentNullException(nameof(diagnosticCategory)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteDetectorsSlotNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DiagnosticDetectorCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainRegistrationProviderRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainRegistrationProviderRestClient.cs new file mode 100644 index 000000000000..2f81172b3f66 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainRegistrationProviderRestClient.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class DomainRegistrationProviderRestClient + { + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of DomainRegistrationProviderRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// server parameter. + /// Api Version. + /// is null. + public DomainRegistrationProviderRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint = null, string apiVersion = "2020-12-01") + { + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListOperationsRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.DomainRegistration/operations", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + /// The cancellation token to use. + public async Task> ListOperationsAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListOperationsRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmOperationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + /// The cancellation token to use. + public Response ListOperations(CancellationToken cancellationToken = default) + { + using var message = CreateListOperationsRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmOperationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListOperationsNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListOperationsNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListOperationsNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmOperationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListOperationsNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListOperationsNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmOperationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsRestClient.cs new file mode 100644 index 000000000000..c42efefded17 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsRestClient.cs @@ -0,0 +1,1607 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class DomainsRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of DomainsRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public DomainsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateCheckAvailabilityRequest(NameIdentifier identifier) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/checkDomainAvailability", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(identifier); + request.Content = content; + return message; + } + + /// Description for Check if a domain is available for registration. + /// Name of the domain. + /// The cancellation token to use. + /// is null. + public async Task> CheckAvailabilityAsync(NameIdentifier identifier, CancellationToken cancellationToken = default) + { + if (identifier == null) + { + throw new ArgumentNullException(nameof(identifier)); + } + + using var message = CreateCheckAvailabilityRequest(identifier); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DomainAvailabilityCheckResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DomainAvailabilityCheckResult.DeserializeDomainAvailabilityCheckResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Check if a domain is available for registration. + /// Name of the domain. + /// The cancellation token to use. + /// is null. + public Response CheckAvailability(NameIdentifier identifier, CancellationToken cancellationToken = default) + { + if (identifier == null) + { + throw new ArgumentNullException(nameof(identifier)); + } + + using var message = CreateCheckAvailabilityRequest(identifier); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DomainAvailabilityCheckResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DomainAvailabilityCheckResult.DeserializeDomainAvailabilityCheckResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/domains", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all domains in a subscription. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DomainCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DomainCollection.DeserializeDomainCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all domains in a subscription. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DomainCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DomainCollection.DeserializeDomainCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetControlCenterSsoRequestRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/generateSsoRequest", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Generate a single sign-on request for the domain management portal. + /// The cancellation token to use. + public async Task> GetControlCenterSsoRequestAsync(CancellationToken cancellationToken = default) + { + using var message = CreateGetControlCenterSsoRequestRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DomainControlCenterSsoRequest value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DomainControlCenterSsoRequest.DeserializeDomainControlCenterSsoRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Generate a single sign-on request for the domain management portal. + /// The cancellation token to use. + public Response GetControlCenterSsoRequest(CancellationToken cancellationToken = default) + { + using var message = CreateGetControlCenterSsoRequestRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DomainControlCenterSsoRequest value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DomainControlCenterSsoRequest.DeserializeDomainControlCenterSsoRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRecommendationsRequest(DomainRecommendationSearchParameters parameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/listDomainRecommendations", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(parameters); + request.Content = content; + return message; + } + + /// Description for Get domain name recommendations based on keywords. + /// Search parameters for domain name recommendations. + /// The cancellation token to use. + /// is null. + public async Task> ListRecommendationsAsync(DomainRecommendationSearchParameters parameters, CancellationToken cancellationToken = default) + { + if (parameters == null) + { + throw new ArgumentNullException(nameof(parameters)); + } + + using var message = CreateListRecommendationsRequest(parameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NameIdentifierCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = NameIdentifierCollection.DeserializeNameIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get domain name recommendations based on keywords. + /// Search parameters for domain name recommendations. + /// The cancellation token to use. + /// is null. + public Response ListRecommendations(DomainRecommendationSearchParameters parameters, CancellationToken cancellationToken = default) + { + if (parameters == null) + { + throw new ArgumentNullException(nameof(parameters)); + } + + using var message = CreateListRecommendationsRequest(parameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NameIdentifierCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = NameIdentifierCollection.DeserializeNameIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/domains", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all domains in a resource group. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DomainCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DomainCollection.DeserializeDomainCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all domains in a resource group. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DomainCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DomainCollection.DeserializeDomainCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string domainName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); + uri.AppendPath(domainName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a domain. + /// Name of the resource group to which the resource belongs. + /// Name of the domain. + /// The cancellation token to use. + /// or is null. + public async Task> GetAsync(string resourceGroupName, string domainName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateGetRequest(resourceGroupName, domainName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Domain value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Domain.DeserializeDomain(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a domain. + /// Name of the resource group to which the resource belongs. + /// Name of the domain. + /// The cancellation token to use. + /// or is null. + public Response Get(string resourceGroupName, string domainName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateGetRequest(resourceGroupName, domainName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Domain value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Domain.DeserializeDomain(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string domainName, Domain domain) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); + uri.AppendPath(domainName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(domain); + request.Content = content; + return message; + } + + /// Description for Creates or updates a domain. + /// Name of the resource group to which the resource belongs. + /// Name of the domain. + /// Domain registration information. + /// The cancellation token to use. + /// , , or is null. + public async Task CreateOrUpdateAsync(string resourceGroupName, string domainName, Domain domain, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (domain == null) + { + throw new ArgumentNullException(nameof(domain)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, domainName, domain); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates or updates a domain. + /// Name of the resource group to which the resource belongs. + /// Name of the domain. + /// Domain registration information. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdate(string resourceGroupName, string domainName, Domain domain, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (domain == null) + { + throw new ArgumentNullException(nameof(domain)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, domainName, domain); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string domainName, bool? forceHardDeleteDomain) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); + uri.AppendPath(domainName, true); + if (forceHardDeleteDomain != null) + { + uri.AppendQuery("forceHardDeleteDomain", forceHardDeleteDomain.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a domain. + /// Name of the resource group to which the resource belongs. + /// Name of the domain. + /// Specify <code>true</code> to delete the domain immediately. The default is <code>false</code> which deletes the domain after 24 hours. + /// The cancellation token to use. + /// or is null. + public async Task DeleteAsync(string resourceGroupName, string domainName, bool? forceHardDeleteDomain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, domainName, forceHardDeleteDomain); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a domain. + /// Name of the resource group to which the resource belongs. + /// Name of the domain. + /// Specify <code>true</code> to delete the domain immediately. The default is <code>false</code> which deletes the domain after 24 hours. + /// The cancellation token to use. + /// or is null. + public Response Delete(string resourceGroupName, string domainName, bool? forceHardDeleteDomain = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, domainName, forceHardDeleteDomain); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string resourceGroupName, string domainName, DomainPatchResource domain) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); + uri.AppendPath(domainName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(domain); + request.Content = content; + return message; + } + + /// Description for Creates or updates a domain. + /// Name of the resource group to which the resource belongs. + /// Name of the domain. + /// Domain registration information. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateAsync(string resourceGroupName, string domainName, DomainPatchResource domain, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (domain == null) + { + throw new ArgumentNullException(nameof(domain)); + } + + using var message = CreateUpdateRequest(resourceGroupName, domainName, domain); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + { + Domain value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Domain.DeserializeDomain(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates or updates a domain. + /// Name of the resource group to which the resource belongs. + /// Name of the domain. + /// Domain registration information. + /// The cancellation token to use. + /// , , or is null. + public Response Update(string resourceGroupName, string domainName, DomainPatchResource domain, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (domain == null) + { + throw new ArgumentNullException(nameof(domain)); + } + + using var message = CreateUpdateRequest(resourceGroupName, domainName, domain); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + { + Domain value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Domain.DeserializeDomain(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListOwnershipIdentifiersRequest(string resourceGroupName, string domainName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); + uri.AppendPath(domainName, true); + uri.AppendPath("/domainOwnershipIdentifiers", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Lists domain ownership identifiers. + /// Name of the resource group to which the resource belongs. + /// Name of domain. + /// The cancellation token to use. + /// or is null. + public async Task> ListOwnershipIdentifiersAsync(string resourceGroupName, string domainName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateListOwnershipIdentifiersRequest(resourceGroupName, domainName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DomainOwnershipIdentifierCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DomainOwnershipIdentifierCollection.DeserializeDomainOwnershipIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Lists domain ownership identifiers. + /// Name of the resource group to which the resource belongs. + /// Name of domain. + /// The cancellation token to use. + /// or is null. + public Response ListOwnershipIdentifiers(string resourceGroupName, string domainName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateListOwnershipIdentifiersRequest(resourceGroupName, domainName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DomainOwnershipIdentifierCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DomainOwnershipIdentifierCollection.DeserializeDomainOwnershipIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetOwnershipIdentifierRequest(string resourceGroupName, string domainName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); + uri.AppendPath(domainName, true); + uri.AppendPath("/domainOwnershipIdentifiers/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get ownership identifier for domain. + /// Name of the resource group to which the resource belongs. + /// Name of domain. + /// Name of identifier. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetOwnershipIdentifierAsync(string resourceGroupName, string domainName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetOwnershipIdentifierRequest(resourceGroupName, domainName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DomainOwnershipIdentifier value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get ownership identifier for domain. + /// Name of the resource group to which the resource belongs. + /// Name of domain. + /// Name of identifier. + /// The cancellation token to use. + /// , , or is null. + public Response GetOwnershipIdentifier(string resourceGroupName, string domainName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetOwnershipIdentifierRequest(resourceGroupName, domainName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DomainOwnershipIdentifier value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateOwnershipIdentifierRequest(string resourceGroupName, string domainName, string name, DomainOwnershipIdentifier domainOwnershipIdentifier) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); + uri.AppendPath(domainName, true); + uri.AppendPath("/domainOwnershipIdentifiers/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(domainOwnershipIdentifier); + request.Content = content; + return message; + } + + /// Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier. + /// Name of the resource group to which the resource belongs. + /// Name of domain. + /// Name of identifier. + /// A JSON representation of the domain ownership properties. + /// The cancellation token to use. + /// , , , or is null. + public async Task> CreateOrUpdateOwnershipIdentifierAsync(string resourceGroupName, string domainName, string name, DomainOwnershipIdentifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifier == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); + } + + using var message = CreateCreateOrUpdateOwnershipIdentifierRequest(resourceGroupName, domainName, name, domainOwnershipIdentifier); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DomainOwnershipIdentifier value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier. + /// Name of the resource group to which the resource belongs. + /// Name of domain. + /// Name of identifier. + /// A JSON representation of the domain ownership properties. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateOwnershipIdentifier(string resourceGroupName, string domainName, string name, DomainOwnershipIdentifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifier == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); + } + + using var message = CreateCreateOrUpdateOwnershipIdentifierRequest(resourceGroupName, domainName, name, domainOwnershipIdentifier); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DomainOwnershipIdentifier value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteOwnershipIdentifierRequest(string resourceGroupName, string domainName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); + uri.AppendPath(domainName, true); + uri.AppendPath("/domainOwnershipIdentifiers/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete ownership identifier for domain. + /// Name of the resource group to which the resource belongs. + /// Name of domain. + /// Name of identifier. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteOwnershipIdentifierAsync(string resourceGroupName, string domainName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteOwnershipIdentifierRequest(resourceGroupName, domainName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete ownership identifier for domain. + /// Name of the resource group to which the resource belongs. + /// Name of domain. + /// Name of identifier. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteOwnershipIdentifier(string resourceGroupName, string domainName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteOwnershipIdentifierRequest(resourceGroupName, domainName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateOwnershipIdentifierRequest(string resourceGroupName, string domainName, string name, DomainOwnershipIdentifier domainOwnershipIdentifier) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); + uri.AppendPath(domainName, true); + uri.AppendPath("/domainOwnershipIdentifiers/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(domainOwnershipIdentifier); + request.Content = content; + return message; + } + + /// Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier. + /// Name of the resource group to which the resource belongs. + /// Name of domain. + /// Name of identifier. + /// A JSON representation of the domain ownership properties. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateOwnershipIdentifierAsync(string resourceGroupName, string domainName, string name, DomainOwnershipIdentifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifier == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); + } + + using var message = CreateUpdateOwnershipIdentifierRequest(resourceGroupName, domainName, name, domainOwnershipIdentifier); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DomainOwnershipIdentifier value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier. + /// Name of the resource group to which the resource belongs. + /// Name of domain. + /// Name of identifier. + /// A JSON representation of the domain ownership properties. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateOwnershipIdentifier(string resourceGroupName, string domainName, string name, DomainOwnershipIdentifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifier == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); + } + + using var message = CreateUpdateOwnershipIdentifierRequest(resourceGroupName, domainName, name, domainOwnershipIdentifier); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DomainOwnershipIdentifier value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRenewRequest(string resourceGroupName, string domainName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); + uri.AppendPath(domainName, true); + uri.AppendPath("/renew", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Renew a domain. + /// Name of the resource group to which the resource belongs. + /// Name of the domain. + /// The cancellation token to use. + /// or is null. + public async Task RenewAsync(string resourceGroupName, string domainName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateRenewRequest(resourceGroupName, domainName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Renew a domain. + /// Name of the resource group to which the resource belongs. + /// Name of the domain. + /// The cancellation token to use. + /// or is null. + public Response Renew(string resourceGroupName, string domainName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateRenewRequest(resourceGroupName, domainName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all domains in a subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DomainCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DomainCollection.DeserializeDomainCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all domains in a subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DomainCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DomainCollection.DeserializeDomainCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRecommendationsNextPageRequest(string nextLink, DomainRecommendationSearchParameters parameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get domain name recommendations based on keywords. + /// The URL to the next page of results. + /// Search parameters for domain name recommendations. + /// The cancellation token to use. + /// or is null. + public async Task> ListRecommendationsNextPageAsync(string nextLink, DomainRecommendationSearchParameters parameters, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (parameters == null) + { + throw new ArgumentNullException(nameof(parameters)); + } + + using var message = CreateListRecommendationsNextPageRequest(nextLink, parameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NameIdentifierCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = NameIdentifierCollection.DeserializeNameIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get domain name recommendations based on keywords. + /// The URL to the next page of results. + /// Search parameters for domain name recommendations. + /// The cancellation token to use. + /// or is null. + public Response ListRecommendationsNextPage(string nextLink, DomainRecommendationSearchParameters parameters, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (parameters == null) + { + throw new ArgumentNullException(nameof(parameters)); + } + + using var message = CreateListRecommendationsNextPageRequest(nextLink, parameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NameIdentifierCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = NameIdentifierCollection.DeserializeNameIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all domains in a resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DomainCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DomainCollection.DeserializeDomainCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all domains in a resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DomainCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DomainCollection.DeserializeDomainCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListOwnershipIdentifiersNextPageRequest(string nextLink, string resourceGroupName, string domainName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Lists domain ownership identifiers. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of domain. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListOwnershipIdentifiersNextPageAsync(string nextLink, string resourceGroupName, string domainName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateListOwnershipIdentifiersNextPageRequest(nextLink, resourceGroupName, domainName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DomainOwnershipIdentifierCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DomainOwnershipIdentifierCollection.DeserializeDomainOwnershipIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Lists domain ownership identifiers. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of domain. + /// The cancellation token to use. + /// , , or is null. + public Response ListOwnershipIdentifiersNextPage(string nextLink, string resourceGroupName, string domainName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateListOwnershipIdentifiersNextPageRequest(nextLink, resourceGroupName, domainName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DomainOwnershipIdentifierCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DomainOwnershipIdentifierCollection.DeserializeDomainOwnershipIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalRestClient.cs new file mode 100644 index 000000000000..e0ba77312f50 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalRestClient.cs @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class GlobalRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of GlobalRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public GlobalRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateGetDeletedWebAppRequest(string deletedSiteId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/deletedSites/", false); + uri.AppendPath(deletedSiteId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get deleted app for a subscription. + /// The numeric ID of the deleted app, e.g. 12345. + /// The cancellation token to use. + /// is null. + public async Task> GetDeletedWebAppAsync(string deletedSiteId, CancellationToken cancellationToken = default) + { + if (deletedSiteId == null) + { + throw new ArgumentNullException(nameof(deletedSiteId)); + } + + using var message = CreateGetDeletedWebAppRequest(deletedSiteId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeletedSite value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeletedSite.DeserializeDeletedSite(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get deleted app for a subscription. + /// The numeric ID of the deleted app, e.g. 12345. + /// The cancellation token to use. + /// is null. + public Response GetDeletedWebApp(string deletedSiteId, CancellationToken cancellationToken = default) + { + if (deletedSiteId == null) + { + throw new ArgumentNullException(nameof(deletedSiteId)); + } + + using var message = CreateGetDeletedWebAppRequest(deletedSiteId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeletedSite value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeletedSite.DeserializeDeletedSite(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetDeletedWebAppSnapshotsRequest(string deletedSiteId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/deletedSites/", false); + uri.AppendPath(deletedSiteId, true); + uri.AppendPath("/snapshots", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all deleted apps for a subscription. + /// The numeric ID of the deleted app, e.g. 12345. + /// The cancellation token to use. + /// is null. + public async Task>> GetDeletedWebAppSnapshotsAsync(string deletedSiteId, CancellationToken cancellationToken = default) + { + if (deletedSiteId == null) + { + throw new ArgumentNullException(nameof(deletedSiteId)); + } + + using var message = CreateGetDeletedWebAppSnapshotsRequest(deletedSiteId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(Snapshot.DeserializeSnapshot(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all deleted apps for a subscription. + /// The numeric ID of the deleted app, e.g. 12345. + /// The cancellation token to use. + /// is null. + public Response> GetDeletedWebAppSnapshots(string deletedSiteId, CancellationToken cancellationToken = default) + { + if (deletedSiteId == null) + { + throw new ArgumentNullException(nameof(deletedSiteId)); + } + + using var message = CreateGetDeletedWebAppSnapshotsRequest(deletedSiteId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(Snapshot.DeserializeSnapshot(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSubscriptionOperationWithAsyncResponseRequest(string location, string operationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/operations/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets an operation in a subscription and given region. + /// Location name. + /// Operation Id. + /// The cancellation token to use. + /// or is null. + public async Task GetSubscriptionOperationWithAsyncResponseAsync(string location, string operationId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + + using var message = CreateGetSubscriptionOperationWithAsyncResponseRequest(location, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets an operation in a subscription and given region. + /// Location name. + /// Operation Id. + /// The cancellation token to use. + /// or is null. + public Response GetSubscriptionOperationWithAsyncResponse(string location, string operationId, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + + using var message = CreateGetSubscriptionOperationWithAsyncResponseRequest(location, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.Serialization.cs new file mode 100644 index 000000000000..185184c847e6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.Serialization.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AbnormalTimePeriod : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("endTime"); + writer.WriteStringValue(EndTime.Value, "O"); + } + if (Optional.IsCollectionDefined(Events)) + { + writer.WritePropertyName("events"); + writer.WriteStartArray(); + foreach (var item in Events) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Solutions)) + { + writer.WritePropertyName("solutions"); + writer.WriteStartArray(); + foreach (var item in Solutions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static AbnormalTimePeriod DeserializeAbnormalTimePeriod(JsonElement element) + { + Optional startTime = default; + Optional endTime = default; + Optional> events = default; + Optional> solutions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("events")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DetectorAbnormalTimePeriod.DeserializeDetectorAbnormalTimePeriod(item)); + } + events = array; + continue; + } + if (property.NameEquals("solutions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Solution.DeserializeSolution(item)); + } + solutions = array; + continue; + } + } + return new AbnormalTimePeriod(Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToList(events), Optional.ToList(solutions)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.cs index 8d3638668527..c7f6656d11fe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.cs @@ -1,77 +1,46 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Class representing Abnormal Time Period identified in diagnosis - /// + /// Class representing Abnormal Time Period identified in diagnosis. public partial class AbnormalTimePeriod { - /// - /// Initializes a new instance of the AbnormalTimePeriod class. - /// + /// Initializes a new instance of AbnormalTimePeriod. public AbnormalTimePeriod() { - CustomInit(); + Events = new ChangeTrackingList(); + Solutions = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the AbnormalTimePeriod class. - /// - /// Start time of the downtime - /// End time of the downtime - /// List of Possible Cause of downtime - /// List of proposed solutions - public AbnormalTimePeriod(System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), IList events = default(IList), IList solutions = default(IList)) + /// Initializes a new instance of AbnormalTimePeriod. + /// Start time of the downtime. + /// End time of the downtime. + /// List of Possible Cause of downtime. + /// List of proposed solutions. + internal AbnormalTimePeriod(DateTimeOffset? startTime, DateTimeOffset? endTime, IList events, IList solutions) { StartTime = startTime; EndTime = endTime; Events = events; Solutions = solutions; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets start time of the downtime - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets end time of the downtime - /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; set; } - - /// - /// Gets or sets list of Possible Cause of downtime - /// - [JsonProperty(PropertyName = "events")] - public IList Events { get; set; } - - /// - /// Gets or sets list of proposed solutions - /// - [JsonProperty(PropertyName = "solutions")] - public IList Solutions { get; set; } - + /// Start time of the downtime. + public DateTimeOffset? StartTime { get; set; } + /// End time of the downtime. + public DateTimeOffset? EndTime { get; set; } + /// List of Possible Cause of downtime. + public IList Events { get; } + /// List of proposed solutions. + public IList Solutions { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.Serialization.cs new file mode 100644 index 000000000000..8356d4e93e6a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.Serialization.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Address : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("address1"); + writer.WriteStringValue(Address1); + if (Optional.IsDefined(Address2)) + { + writer.WritePropertyName("address2"); + writer.WriteStringValue(Address2); + } + writer.WritePropertyName("city"); + writer.WriteStringValue(City); + writer.WritePropertyName("country"); + writer.WriteStringValue(Country); + writer.WritePropertyName("postalCode"); + writer.WriteStringValue(PostalCode); + writer.WritePropertyName("state"); + writer.WriteStringValue(State); + writer.WriteEndObject(); + } + + internal static Address DeserializeAddress(JsonElement element) + { + string address1 = default; + Optional address2 = default; + string city = default; + string country = default; + string postalCode = default; + string state = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("address1")) + { + address1 = property.Value.GetString(); + continue; + } + if (property.NameEquals("address2")) + { + address2 = property.Value.GetString(); + continue; + } + if (property.NameEquals("city")) + { + city = property.Value.GetString(); + continue; + } + if (property.NameEquals("country")) + { + country = property.Value.GetString(); + continue; + } + if (property.NameEquals("postalCode")) + { + postalCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("state")) + { + state = property.Value.GetString(); + continue; + } + } + return new Address(address1, address2.Value, city, country, postalCode, state); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.cs index 93da3addd3ba..056b1bf5400e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.cs @@ -1,43 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Address information for domain registration. - /// + /// Address information for domain registration. public partial class Address { - /// - /// Initializes a new instance of the Address class. - /// - public Address() + /// Initializes a new instance of Address. + /// First line of an Address. + /// The city for the address. + /// The country for the address. + /// The postal code for the address. + /// The state or province for the address. + /// , , , , or is null. + public Address(string address1, string city, string country, string postalCode, string state) { - CustomInit(); + if (address1 == null) + { + throw new ArgumentNullException(nameof(address1)); + } + if (city == null) + { + throw new ArgumentNullException(nameof(city)); + } + if (country == null) + { + throw new ArgumentNullException(nameof(country)); + } + if (postalCode == null) + { + throw new ArgumentNullException(nameof(postalCode)); + } + if (state == null) + { + throw new ArgumentNullException(nameof(state)); + } + + Address1 = address1; + City = city; + Country = country; + PostalCode = postalCode; + State = state; } - /// - /// Initializes a new instance of the Address class. - /// - /// First line of an Address. - /// The city for the address. - /// The country for the address. - /// The postal code for the address. - /// The state or province for the address. - /// The second line of the Address. - /// Optional. - public Address(string address1, string city, string country, string postalCode, string state, string address2 = default(string)) + /// Initializes a new instance of Address. + /// First line of an Address. + /// The second line of the Address. Optional. + /// The city for the address. + /// The country for the address. + /// The postal code for the address. + /// The state or province for the address. + internal Address(string address1, string address2, string city, string country, string postalCode, string state) { Address1 = address1; Address2 = address2; @@ -45,78 +64,19 @@ public Address() Country = country; PostalCode = postalCode; State = state; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets first line of an Address. - /// - [JsonProperty(PropertyName = "address1")] + /// First line of an Address. public string Address1 { get; set; } - - /// - /// Gets or sets the second line of the Address. Optional. - /// - [JsonProperty(PropertyName = "address2")] + /// The second line of the Address. Optional. public string Address2 { get; set; } - - /// - /// Gets or sets the city for the address. - /// - [JsonProperty(PropertyName = "city")] + /// The city for the address. public string City { get; set; } - - /// - /// Gets or sets the country for the address. - /// - [JsonProperty(PropertyName = "country")] + /// The country for the address. public string Country { get; set; } - - /// - /// Gets or sets the postal code for the address. - /// - [JsonProperty(PropertyName = "postalCode")] + /// The postal code for the address. public string PostalCode { get; set; } - - /// - /// Gets or sets the state or province for the address. - /// - [JsonProperty(PropertyName = "state")] + /// The state or province for the address. public string State { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Address1 == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Address1"); - } - if (City == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "City"); - } - if (Country == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Country"); - } - if (PostalCode == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PostalCode"); - } - if (State == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "State"); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.Serialization.cs new file mode 100644 index 000000000000..f11f9b92d06e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AddressResponse : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ServiceIpAddress)) + { + writer.WritePropertyName("serviceIpAddress"); + writer.WriteStringValue(ServiceIpAddress); + } + if (Optional.IsDefined(InternalIpAddress)) + { + writer.WritePropertyName("internalIpAddress"); + writer.WriteStringValue(InternalIpAddress); + } + if (Optional.IsCollectionDefined(OutboundIpAddresses)) + { + writer.WritePropertyName("outboundIpAddresses"); + writer.WriteStartArray(); + foreach (var item in OutboundIpAddresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(VipMappings)) + { + writer.WritePropertyName("vipMappings"); + writer.WriteStartArray(); + foreach (var item in VipMappings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AddressResponse DeserializeAddressResponse(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional serviceIpAddress = default; + Optional internalIpAddress = default; + Optional> outboundIpAddresses = default; + Optional> vipMappings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("serviceIpAddress")) + { + serviceIpAddress = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("internalIpAddress")) + { + internalIpAddress = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("outboundIpAddresses")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + outboundIpAddresses = array; + continue; + } + if (property0.NameEquals("vipMappings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(VirtualIPMapping.DeserializeVirtualIPMapping(item)); + } + vipMappings = array; + continue; + } + } + continue; + } + } + return new AddressResponse(id.Value, name.Value, kind.Value, type.Value, serviceIpAddress.Value, internalIpAddress.Value, Optional.ToList(outboundIpAddresses), Optional.ToList(vipMappings)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.cs index 879dbaad9a28..a17a2524bd9f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.cs @@ -1,89 +1,49 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Describes main public IP address and any extra virtual IPs. - /// - [Rest.Serialization.JsonTransformation] + /// Describes main public IP address and any extra virtual IPs. public partial class AddressResponse : ProxyOnlyResource { - /// - /// Initializes a new instance of the AddressResponse class. - /// + /// Initializes a new instance of AddressResponse. public AddressResponse() { - CustomInit(); + OutboundIpAddresses = new ChangeTrackingList(); + VipMappings = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the AddressResponse class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Main public virtual IP. - /// Virtual Network internal IP address - /// of the App Service Environment if it is in internal load-balancing - /// mode. - /// IP addresses appearing on - /// outbound connections. - /// Additional virtual IPs. - public AddressResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string serviceIpAddress = default(string), string internalIpAddress = default(string), IList outboundIpAddresses = default(IList), IList vipMappings = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of AddressResponse. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Main public virtual IP. + /// Virtual Network internal IP address of the App Service Environment if it is in internal load-balancing mode. + /// IP addresses appearing on outbound connections. + /// Additional virtual IPs. + internal AddressResponse(string id, string name, string kind, string type, string serviceIpAddress, string internalIpAddress, IList outboundIpAddresses, IList vipMappings) : base(id, name, kind, type) { ServiceIpAddress = serviceIpAddress; InternalIpAddress = internalIpAddress; OutboundIpAddresses = outboundIpAddresses; VipMappings = vipMappings; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets main public virtual IP. - /// - [JsonProperty(PropertyName = "properties.serviceIpAddress")] + /// Main public virtual IP. public string ServiceIpAddress { get; set; } - - /// - /// Gets or sets virtual Network internal IP address of the App Service - /// Environment if it is in internal load-balancing mode. - /// - [JsonProperty(PropertyName = "properties.internalIpAddress")] + /// Virtual Network internal IP address of the App Service Environment if it is in internal load-balancing mode. public string InternalIpAddress { get; set; } - - /// - /// Gets or sets IP addresses appearing on outbound connections. - /// - [JsonProperty(PropertyName = "properties.outboundIpAddresses")] - public IList OutboundIpAddresses { get; set; } - - /// - /// Gets or sets additional virtual IPs. - /// - [JsonProperty(PropertyName = "properties.vipMappings")] - public IList VipMappings { get; set; } - + /// IP addresses appearing on outbound connections. + public IList OutboundIpAddresses { get; } + /// Additional virtual IPs. + public IList VipMappings { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs new file mode 100644 index 000000000000..0cff877bdcf7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AllowedAudiencesValidation : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AllowedAudiences)) + { + writer.WritePropertyName("allowedAudiences"); + writer.WriteStartArray(); + foreach (var item in AllowedAudiences) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AllowedAudiencesValidation DeserializeAllowedAudiencesValidation(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional> allowedAudiences = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("allowedAudiences")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedAudiences = array; + continue; + } + } + continue; + } + } + return new AllowedAudiencesValidation(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(allowedAudiences)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.cs index 7af8c086f3f3..da286950f19d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.cs @@ -1,56 +1,35 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The AllowedAudiencesValidation. public partial class AllowedAudiencesValidation : ProxyOnlyResource { - /// - /// Initializes a new instance of the AllowedAudiencesValidation class. - /// + /// Initializes a new instance of AllowedAudiencesValidation. public AllowedAudiencesValidation() { - CustomInit(); + AllowedAudiences = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the AllowedAudiencesValidation class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public AllowedAudiencesValidation(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList allowedAudiences = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of AllowedAudiencesValidation. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// . + internal AllowedAudiencesValidation(string id, string name, string kind, string type, IList allowedAudiences) : base(id, name, kind, type) { AllowedAudiences = allowedAudiences; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.allowedAudiences")] - public IList AllowedAudiences { get; set; } - + public IList AllowedAudiences { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.Serialization.cs new file mode 100644 index 000000000000..3a248e451eff --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AnalysisData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(Source); + } + if (Optional.IsDefined(DetectorDefinition)) + { + writer.WritePropertyName("detectorDefinition"); + writer.WriteObjectValue(DetectorDefinition); + } + if (Optional.IsCollectionDefined(Metrics)) + { + writer.WritePropertyName("metrics"); + writer.WriteStartArray(); + foreach (var item in Metrics) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Data)) + { + writer.WritePropertyName("data"); + writer.WriteStartArray(); + foreach (var item in Data) + { + writer.WriteStartArray(); + foreach (var item0 in item) + { + writer.WriteObjectValue(item0); + } + writer.WriteEndArray(); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DetectorMetaData)) + { + writer.WritePropertyName("detectorMetaData"); + writer.WriteObjectValue(DetectorMetaData); + } + writer.WriteEndObject(); + } + + internal static AnalysisData DeserializeAnalysisData(JsonElement element) + { + Optional source = default; + Optional detectorDefinition = default; + Optional> metrics = default; + Optional>> data = default; + Optional detectorMetaData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source")) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("detectorDefinition")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + detectorDefinition = DetectorDefinition.DeserializeDetectorDefinition(property.Value); + continue; + } + if (property.NameEquals("metrics")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiagnosticMetricSet.DeserializeDiagnosticMetricSet(item)); + } + metrics = array; + continue; + } + if (property.NameEquals("data")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List> array = new List>(); + foreach (var item in property.Value.EnumerateArray()) + { + List array0 = new List(); + foreach (var item0 in item.EnumerateArray()) + { + array0.Add(NameValuePair.DeserializeNameValuePair(item0)); + } + array.Add(array0); + } + data = array; + continue; + } + if (property.NameEquals("detectorMetaData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + detectorMetaData = ResponseMetaData.DeserializeResponseMetaData(property.Value); + continue; + } + } + return new AnalysisData(source.Value, detectorDefinition.Value, Optional.ToList(metrics), Optional.ToList(data), detectorMetaData.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.cs index 2cbb22216f0d..2b051434fdfb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.cs @@ -1,85 +1,49 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Class Representing Detector Evidence used for analysis - /// + /// Class Representing Detector Evidence used for analysis. public partial class AnalysisData { - /// - /// Initializes a new instance of the AnalysisData class. - /// + /// Initializes a new instance of AnalysisData. public AnalysisData() { - CustomInit(); + Metrics = new ChangeTrackingList(); + Data = new ChangeTrackingList>(); } - /// - /// Initializes a new instance of the AnalysisData class. - /// - /// Name of the Detector - /// Detector Definition - /// Source Metrics - /// Additional Source Data - /// Detector Meta Data - public AnalysisData(string source = default(string), DetectorDefinition detectorDefinition = default(DetectorDefinition), IList metrics = default(IList), IList> data = default(IList>), ResponseMetaData detectorMetaData = default(ResponseMetaData)) + /// Initializes a new instance of AnalysisData. + /// Name of the Detector. + /// Detector Definition. + /// Source Metrics. + /// Additional Source Data. + /// Detector Meta Data. + internal AnalysisData(string source, DetectorDefinition detectorDefinition, IList metrics, IList> data, ResponseMetaData detectorMetaData) { Source = source; DetectorDefinition = detectorDefinition; Metrics = metrics; Data = data; DetectorMetaData = detectorMetaData; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the Detector - /// - [JsonProperty(PropertyName = "source")] + /// Name of the Detector. public string Source { get; set; } - - /// - /// Gets or sets detector Definition - /// - [JsonProperty(PropertyName = "detectorDefinition")] + /// Detector Definition. public DetectorDefinition DetectorDefinition { get; set; } - - /// - /// Gets or sets source Metrics - /// - [JsonProperty(PropertyName = "metrics")] - public IList Metrics { get; set; } - - /// - /// Gets or sets additional Source Data - /// - [JsonProperty(PropertyName = "data")] - public IList> Data { get; set; } - - /// - /// Gets or sets detector Meta Data - /// - [JsonProperty(PropertyName = "detectorMetaData")] + /// Source Metrics. + public IList Metrics { get; } + /// Additional Source Data. + public IList> Data { get; } + /// Detector Meta Data. public ResponseMetaData DetectorMetaData { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.Serialization.cs new file mode 100644 index 000000000000..1d9c58ef4f17 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.Serialization.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AnalysisDefinition : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AnalysisDefinition DeserializeAnalysisDefinition(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("description")) + { + description = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new AnalysisDefinition(id.Value, name.Value, kind.Value, type.Value, description.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.cs index 69956364b44c..0c3baed0c5af 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Definition of Analysis - /// - [Rest.Serialization.JsonTransformation] + /// Definition of Analysis. public partial class AnalysisDefinition : ProxyOnlyResource { - /// - /// Initializes a new instance of the AnalysisDefinition class. - /// + /// Initializes a new instance of AnalysisDefinition. public AnalysisDefinition() { - CustomInit(); } - /// - /// Initializes a new instance of the AnalysisDefinition class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Description of the Analysis - public AnalysisDefinition(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string description = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of AnalysisDefinition. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Description of the Analysis. + internal AnalysisDefinition(string id, string name, string kind, string type, string description) : base(id, name, kind, type) { Description = description; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets description of the Analysis - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } - + /// Description of the Analysis. + public string Description { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.Serialization.cs new file mode 100644 index 000000000000..04a52966b937 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ApiDefinitionInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Url)) + { + writer.WritePropertyName("url"); + writer.WriteStringValue(Url); + } + writer.WriteEndObject(); + } + + internal static ApiDefinitionInfo DeserializeApiDefinitionInfo(JsonElement element) + { + Optional url = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url")) + { + url = property.Value.GetString(); + continue; + } + } + return new ApiDefinitionInfo(url.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.cs index 76e5be22e2fb..68254c2b40a2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.cs @@ -1,51 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information about the formal API definition for the app. - /// + /// Information about the formal API definition for the app. public partial class ApiDefinitionInfo { - /// - /// Initializes a new instance of the ApiDefinitionInfo class. - /// + /// Initializes a new instance of ApiDefinitionInfo. public ApiDefinitionInfo() { - CustomInit(); } - /// - /// Initializes a new instance of the ApiDefinitionInfo class. - /// - /// The URL of the API definition. - public ApiDefinitionInfo(string url = default(string)) + /// Initializes a new instance of ApiDefinitionInfo. + /// The URL of the API definition. + internal ApiDefinitionInfo(string url) { Url = url; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the URL of the API definition. - /// - [JsonProperty(PropertyName = "url")] + /// The URL of the API definition. public string Url { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.Serialization.cs new file mode 100644 index 000000000000..b7c03ba9e635 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.Serialization.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ApiKVReference : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Reference)) + { + writer.WritePropertyName("reference"); + writer.WriteStringValue(Reference); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"); + writer.WriteStringValue(Status.Value.ToSerialString()); + } + if (Optional.IsDefined(VaultName)) + { + writer.WritePropertyName("vaultName"); + writer.WriteStringValue(VaultName); + } + if (Optional.IsDefined(SecretName)) + { + writer.WritePropertyName("secretName"); + writer.WriteStringValue(SecretName); + } + if (Optional.IsDefined(SecretVersion)) + { + writer.WritePropertyName("secretVersion"); + writer.WriteStringValue(SecretVersion); + } + if (Optional.IsDefined(IdentityType)) + { + writer.WritePropertyName("identityType"); + writer.WriteObjectValue(IdentityType); + } + if (Optional.IsDefined(Details)) + { + writer.WritePropertyName("details"); + writer.WriteStringValue(Details); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(Source); + } + if (Optional.IsDefined(ActiveVersion)) + { + writer.WritePropertyName("activeVersion"); + writer.WriteStringValue(ActiveVersion); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ApiKVReference DeserializeApiKVReference(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional reference = default; + Optional status = default; + Optional vaultName = default; + Optional secretName = default; + Optional secretVersion = default; + Optional identityType = default; + Optional details = default; + Optional source = default; + Optional activeVersion = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("reference")) + { + reference = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property0.Value.GetString().ToResolveStatus(); + continue; + } + if (property0.NameEquals("vaultName")) + { + vaultName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("secretName")) + { + secretName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("secretVersion")) + { + secretVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("identityType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + identityType = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property0.Value); + continue; + } + if (property0.NameEquals("details")) + { + details = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("source")) + { + source = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("activeVersion")) + { + activeVersion = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new ApiKVReference(id.Value, name.Value, kind.Value, type.Value, reference.Value, Optional.ToNullable(status), vaultName.Value, secretName.Value, secretVersion.Value, identityType.Value, details.Value, source.Value, activeVersion.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs new file mode 100644 index 000000000000..72f1f9aa6466 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Description of site key vault references. + public partial class ApiKVReference : ProxyOnlyResource + { + /// Initializes a new instance of ApiKVReference. + public ApiKVReference() + { + Source = "KeyVault"; + } + + /// Initializes a new instance of ApiKVReference. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// . + /// . + /// . + /// . + /// . + /// Managed service identity. + /// . + /// . + /// . + internal ApiKVReference(string id, string name, string kind, string type, string reference, ResolveStatus? status, string vaultName, string secretName, string secretVersion, ManagedServiceIdentity identityType, string details, string source, string activeVersion) : base(id, name, kind, type) + { + Reference = reference; + Status = status; + VaultName = vaultName; + SecretName = secretName; + SecretVersion = secretVersion; + IdentityType = identityType; + Details = details; + Source = source; + ActiveVersion = activeVersion; + } + + public string Reference { get; set; } + public ResolveStatus? Status { get; set; } + public string VaultName { get; set; } + public string SecretName { get; set; } + public string SecretVersion { get; set; } + /// Managed service identity. + public ManagedServiceIdentity IdentityType { get; set; } + public string Details { get; set; } + public string Source { get; set; } + public string ActiveVersion { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.Serialization.cs new file mode 100644 index 000000000000..f5693159eaba --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class ApiKVReferenceCollection + { + internal static ApiKVReferenceCollection DeserializeApiKVReferenceCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ApiKVReference.DeserializeApiKVReference(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ApiKVReferenceCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.cs new file mode 100644 index 000000000000..8a48f3055be7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The ApiKVReferenceCollection. + internal partial class ApiKVReferenceCollection + { + /// Initializes a new instance of ApiKVReferenceCollection. + /// Collection of resources. + /// is null. + internal ApiKVReferenceCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of ApiKVReferenceCollection. + /// Collection of resources. + /// Link to next page of resources. + internal ApiKVReferenceCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.Serialization.cs new file mode 100644 index 000000000000..8b0cd0e43afc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ApiManagementConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + writer.WriteEndObject(); + } + + internal static ApiManagementConfig DeserializeApiManagementConfig(JsonElement element) + { + Optional id = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + } + return new ApiManagementConfig(id.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.cs index 2b6bf8637dc2..4a0eecd9c4af 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.cs @@ -1,51 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Azure API management (APIM) configuration linked to the app. - /// + /// Azure API management (APIM) configuration linked to the app. public partial class ApiManagementConfig { - /// - /// Initializes a new instance of the ApiManagementConfig class. - /// + /// Initializes a new instance of ApiManagementConfig. public ApiManagementConfig() { - CustomInit(); } - /// - /// Initializes a new instance of the ApiManagementConfig class. - /// - /// APIM-Api Identifier. - public ApiManagementConfig(string id = default(string)) + /// Initializes a new instance of ApiManagementConfig. + /// APIM-Api Identifier. + internal ApiManagementConfig(string id) { Id = id; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets aPIM-Api Identifier. - /// - [JsonProperty(PropertyName = "id")] + /// APIM-Api Identifier. public string Id { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.Serialization.cs new file mode 100644 index 000000000000..9c22e0d7a1a5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppInsightsWebAppStackSettings + { + internal static AppInsightsWebAppStackSettings DeserializeAppInsightsWebAppStackSettings(JsonElement element) + { + Optional isSupported = default; + Optional isDefaultOff = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("isSupported")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isSupported = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isDefaultOff")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isDefaultOff = property.Value.GetBoolean(); + continue; + } + } + return new AppInsightsWebAppStackSettings(Optional.ToNullable(isSupported), Optional.ToNullable(isDefaultOff)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs new file mode 100644 index 000000000000..7fff155378dd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// App Insights Web App stack settings. + public partial class AppInsightsWebAppStackSettings + { + /// Initializes a new instance of AppInsightsWebAppStackSettings. + internal AppInsightsWebAppStackSettings() + { + } + + /// Initializes a new instance of AppInsightsWebAppStackSettings. + /// <code>true</code> if remote Application Insights is supported for the stack; otherwise, <code>false</code>. + /// <code>true</code> if Application Insights is disabled by default for the stack; otherwise, <code>false</code>. + internal AppInsightsWebAppStackSettings(bool? isSupported, bool? isDefaultOff) + { + IsSupported = isSupported; + IsDefaultOff = isDefaultOff; + } + + /// <code>true</code> if remote Application Insights is supported for the stack; otherwise, <code>false</code>. + public bool? IsSupported { get; } + /// <code>true</code> if Application Insights is disabled by default for the stack; otherwise, <code>false</code>. + public bool? IsDefaultOff { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.Serialization.cs new file mode 100644 index 000000000000..378419e8eaba --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.Serialization.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppRegistration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(AppId)) + { + writer.WritePropertyName("appId"); + writer.WriteStringValue(AppId); + } + if (Optional.IsDefined(AppSecretSettingName)) + { + writer.WritePropertyName("appSecretSettingName"); + writer.WriteStringValue(AppSecretSettingName); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AppRegistration DeserializeAppRegistration(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional appId = default; + Optional appSecretSettingName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("appId")) + { + appId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("appSecretSettingName")) + { + appSecretSettingName = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new AppRegistration(id.Value, name.Value, kind.Value, type.Value, appId.Value, appSecretSettingName.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.cs index a1e6ff47661a..365367a13ca1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.cs @@ -1,60 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the app registration for providers that have app ids and app secrets. public partial class AppRegistration : ProxyOnlyResource { - /// - /// Initializes a new instance of the AppRegistration class. - /// + /// Initializes a new instance of AppRegistration. public AppRegistration() { - CustomInit(); } - /// - /// Initializes a new instance of the AppRegistration class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public AppRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string appId = default(string), string appSecretSettingName = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of AppRegistration. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The App ID of the app used for login. + /// The app setting name that contains the app secret. + internal AppRegistration(string id, string name, string kind, string type, string appId, string appSecretSettingName) : base(id, name, kind, type) { AppId = appId; AppSecretSettingName = appSecretSettingName; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.appId")] + /// The App ID of the app used for login. public string AppId { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.appSecretSettingName")] + /// The app setting name that contains the app secret. public string AppSecretSettingName { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.Serialization.cs new file mode 100644 index 000000000000..84e961bda598 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppServiceCertificate : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(KeyVaultId)) + { + writer.WritePropertyName("keyVaultId"); + writer.WriteStringValue(KeyVaultId); + } + if (Optional.IsDefined(KeyVaultSecretName)) + { + writer.WritePropertyName("keyVaultSecretName"); + writer.WriteStringValue(KeyVaultSecretName); + } + writer.WriteEndObject(); + } + + internal static AppServiceCertificate DeserializeAppServiceCertificate(JsonElement element) + { + Optional keyVaultId = default; + Optional keyVaultSecretName = default; + Optional provisioningState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyVaultId")) + { + keyVaultId = property.Value.GetString(); + continue; + } + if (property.NameEquals("keyVaultSecretName")) + { + keyVaultSecretName = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property.Value.GetString().ToKeyVaultSecretStatus(); + continue; + } + } + return new AppServiceCertificate(keyVaultId.Value, keyVaultSecretName.Value, Optional.ToNullable(provisioningState)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.cs index 0f89676c64ac..a52b098afe85 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.cs @@ -1,78 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Key Vault container for a certificate that is purchased through Azure. - /// + /// Key Vault container for a certificate that is purchased through Azure. public partial class AppServiceCertificate { - /// - /// Initializes a new instance of the AppServiceCertificate class. - /// + /// Initializes a new instance of AppServiceCertificate. public AppServiceCertificate() { - CustomInit(); } - /// - /// Initializes a new instance of the AppServiceCertificate class. - /// - /// Key Vault resource Id. - /// Key Vault secret name. - /// Status of the Key Vault secret. - /// Possible values include: 'Initialized', - /// 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', - /// 'OperationNotPermittedOnKeyVault', - /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', - /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', - /// 'Unknown' - public AppServiceCertificate(string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? provisioningState = default(KeyVaultSecretStatus?)) + /// Initializes a new instance of AppServiceCertificate. + /// Key Vault resource Id. + /// Key Vault secret name. + /// Status of the Key Vault secret. + internal AppServiceCertificate(string keyVaultId, string keyVaultSecretName, KeyVaultSecretStatus? provisioningState) { KeyVaultId = keyVaultId; KeyVaultSecretName = keyVaultSecretName; ProvisioningState = provisioningState; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets key Vault resource Id. - /// - [JsonProperty(PropertyName = "keyVaultId")] + /// Key Vault resource Id. public string KeyVaultId { get; set; } - - /// - /// Gets or sets key Vault secret name. - /// - [JsonProperty(PropertyName = "keyVaultSecretName")] + /// Key Vault secret name. public string KeyVaultSecretName { get; set; } - - /// - /// Gets status of the Key Vault secret. Possible values include: - /// 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', - /// 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', - /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', - /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', - /// 'Unknown' - /// - [JsonProperty(PropertyName = "provisioningState")] - public KeyVaultSecretStatus? ProvisioningState { get; private set; } - + /// Status of the Key Vault secret. + public KeyVaultSecretStatus? ProvisioningState { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.Serialization.cs new file mode 100644 index 000000000000..2c371d537f1b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class AppServiceCertificateCollection + { + internal static AppServiceCertificateCollection DeserializeAppServiceCertificateCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AppServiceCertificateResource.DeserializeAppServiceCertificateResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new AppServiceCertificateCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.cs new file mode 100644 index 000000000000..a7492da9212a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of certificate order certificates. + internal partial class AppServiceCertificateCollection + { + /// Initializes a new instance of AppServiceCertificateCollection. + /// Collection of resources. + /// is null. + internal AppServiceCertificateCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of AppServiceCertificateCollection. + /// Collection of resources. + /// Link to next page of resources. + internal AppServiceCertificateCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.Serialization.cs new file mode 100644 index 000000000000..f4c4e8f139cc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.Serialization.cs @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppServiceCertificateOrder : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Certificates)) + { + writer.WritePropertyName("certificates"); + writer.WriteStartObject(); + foreach (var item in Certificates) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(DistinguishedName)) + { + writer.WritePropertyName("distinguishedName"); + writer.WriteStringValue(DistinguishedName); + } + if (Optional.IsDefined(ValidityInYears)) + { + writer.WritePropertyName("validityInYears"); + writer.WriteNumberValue(ValidityInYears.Value); + } + if (Optional.IsDefined(KeySize)) + { + writer.WritePropertyName("keySize"); + writer.WriteNumberValue(KeySize.Value); + } + if (Optional.IsDefined(ProductType)) + { + writer.WritePropertyName("productType"); + writer.WriteStringValue(ProductType.Value.ToSerialString()); + } + if (Optional.IsDefined(AutoRenew)) + { + writer.WritePropertyName("autoRenew"); + writer.WriteBooleanValue(AutoRenew.Value); + } + if (Optional.IsDefined(Csr)) + { + writer.WritePropertyName("csr"); + writer.WriteStringValue(Csr); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AppServiceCertificateOrder DeserializeAppServiceCertificateOrder(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + string location = default; + Optional type = default; + Optional> tags = default; + Optional> certificates = default; + Optional distinguishedName = default; + Optional domainVerificationToken = default; + Optional validityInYears = default; + Optional keySize = default; + Optional productType = default; + Optional autoRenew = default; + Optional provisioningState = default; + Optional status = default; + Optional signedCertificate = default; + Optional csr = default; + Optional intermediate = default; + Optional root = default; + Optional serialNumber = default; + Optional lastCertificateIssuanceTime = default; + Optional expirationTime = default; + Optional isPrivateKeyExternal = default; + Optional> appServiceCertificateNotRenewableReasons = default; + Optional nextAutoRenewalTimeStamp = default; + Optional contact = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("certificates")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, AppServiceCertificate.DeserializeAppServiceCertificate(property1.Value)); + } + certificates = dictionary; + continue; + } + if (property0.NameEquals("distinguishedName")) + { + distinguishedName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("domainVerificationToken")) + { + domainVerificationToken = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("validityInYears")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + validityInYears = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("keySize")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + keySize = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("productType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + productType = property0.Value.GetString().ToCertificateProductType(); + continue; + } + if (property0.NameEquals("autoRenew")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + autoRenew = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property0.Value.GetString().ToProvisioningState(); + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property0.Value.GetString().ToCertificateOrderStatus(); + continue; + } + if (property0.NameEquals("signedCertificate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + signedCertificate = CertificateDetails.DeserializeCertificateDetails(property0.Value); + continue; + } + if (property0.NameEquals("csr")) + { + csr = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("intermediate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + intermediate = CertificateDetails.DeserializeCertificateDetails(property0.Value); + continue; + } + if (property0.NameEquals("root")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + root = CertificateDetails.DeserializeCertificateDetails(property0.Value); + continue; + } + if (property0.NameEquals("serialNumber")) + { + serialNumber = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("lastCertificateIssuanceTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + lastCertificateIssuanceTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("expirationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + expirationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("isPrivateKeyExternal")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isPrivateKeyExternal = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("appServiceCertificateNotRenewableReasons")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(item.GetString())); + } + appServiceCertificateNotRenewableReasons = array; + continue; + } + if (property0.NameEquals("nextAutoRenewalTimeStamp")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + nextAutoRenewalTimeStamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("contact")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + contact = CertificateOrderContact.DeserializeCertificateOrderContact(property0.Value); + continue; + } + } + continue; + } + } + return new AppServiceCertificateOrder(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), Optional.ToDictionary(certificates), distinguishedName.Value, domainVerificationToken.Value, Optional.ToNullable(validityInYears), Optional.ToNullable(keySize), Optional.ToNullable(productType), Optional.ToNullable(autoRenew), Optional.ToNullable(provisioningState), Optional.ToNullable(status), signedCertificate.Value, csr.Value, intermediate.Value, root.Value, serialNumber.Value, Optional.ToNullable(lastCertificateIssuanceTime), Optional.ToNullable(expirationTime), Optional.ToNullable(isPrivateKeyExternal), Optional.ToList(appServiceCertificateNotRenewableReasons), Optional.ToNullable(nextAutoRenewalTimeStamp), contact.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs index fba67b6ee17a..d51690f5fab7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs @@ -1,85 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// SSL certificate purchase order. - /// - [Rest.Serialization.JsonTransformation] + /// SSL certificate purchase order. public partial class AppServiceCertificateOrder : Resource { - /// - /// Initializes a new instance of the AppServiceCertificateOrder class. - /// - public AppServiceCertificateOrder() + /// Initializes a new instance of AppServiceCertificateOrder. + /// Resource Location. + /// is null. + public AppServiceCertificateOrder(string location) : base(location) { - CustomInit(); + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + Certificates = new ChangeTrackingDictionary(); + AppServiceCertificateNotRenewableReasons = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the AppServiceCertificateOrder class. - /// - /// Resource Location. - /// Certificate product type. Possible values - /// include: 'StandardDomainValidatedSsl', - /// 'StandardDomainValidatedWildCardSsl' - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Resource tags. - /// State of the Key Vault secret. - /// Certificate distinguished - /// name. - /// Domain verification - /// token. - /// Duration in years (must be between 1 - /// and 3). - /// Certificate key size. - /// <code>true</code> if the - /// certificate should be automatically renewed when it expires; - /// otherwise, <code>false</code>. - /// Status of certificate order. - /// Possible values include: 'Succeeded', 'Failed', 'Canceled', - /// 'InProgress', 'Deleting' - /// Current order status. Possible values include: - /// 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', - /// 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', - /// 'NotSubmitted' - /// Signed certificate. - /// Last CSR that was created for this order. - /// Intermediate certificate. - /// Root certificate. - /// Current serial number of the - /// certificate. - /// Certificate last issuance - /// time. - /// Certificate expiration time. - /// <code>true</code> if - /// private key is external; otherwise, - /// <code>false</code>. - /// Reasons why - /// App Service Certificate is not renewable at the current - /// moment. - /// Time stamp when the - /// certificate would be auto renewed next - public AppServiceCertificateOrder(string location, CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?)) - : base(location, id, name, kind, type, tags) + /// Initializes a new instance of AppServiceCertificateOrder. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource Location. + /// Resource type. + /// Resource tags. + /// State of the Key Vault secret. + /// Certificate distinguished name. + /// Domain verification token. + /// Duration in years (must be 1). + /// Certificate key size. + /// Certificate product type. + /// <code>true</code> if the certificate should be automatically renewed when it expires; otherwise, <code>false</code>. + /// Status of certificate order. + /// Current order status. + /// Signed certificate. + /// Last CSR that was created for this order. + /// Intermediate certificate. + /// Root certificate. + /// Current serial number of the certificate. + /// Certificate last issuance time. + /// Certificate expiration time. + /// <code>true</code> if private key is external; otherwise, <code>false</code>. + /// Reasons why App Service Certificate is not renewable at the current moment. + /// Time stamp when the certificate would be auto renewed next. + /// Contact info. + internal AppServiceCertificateOrder(string id, string name, string kind, string location, string type, IDictionary tags, IDictionary certificates, string distinguishedName, string domainVerificationToken, int? validityInYears, int? keySize, CertificateProductType? productType, bool? autoRenew, ProvisioningState? provisioningState, CertificateOrderStatus? status, CertificateDetails signedCertificate, string csr, CertificateDetails intermediate, CertificateDetails root, string serialNumber, DateTimeOffset? lastCertificateIssuanceTime, DateTimeOffset? expirationTime, bool? isPrivateKeyExternal, IReadOnlyList appServiceCertificateNotRenewableReasons, DateTimeOffset? nextAutoRenewalTimeStamp, CertificateOrderContact contact) : base(id, name, kind, location, type, tags) { Certificates = certificates; DistinguishedName = distinguishedName; @@ -100,155 +76,48 @@ public AppServiceCertificateOrder() IsPrivateKeyExternal = isPrivateKeyExternal; AppServiceCertificateNotRenewableReasons = appServiceCertificateNotRenewableReasons; NextAutoRenewalTimeStamp = nextAutoRenewalTimeStamp; - CustomInit(); + Contact = contact; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets state of the Key Vault secret. - /// - [JsonProperty(PropertyName = "properties.certificates")] - public IDictionary Certificates { get; set; } - - /// - /// Gets or sets certificate distinguished name. - /// - [JsonProperty(PropertyName = "properties.distinguishedName")] + /// State of the Key Vault secret. + public IDictionary Certificates { get; } + /// Certificate distinguished name. public string DistinguishedName { get; set; } - - /// - /// Gets domain verification token. - /// - [JsonProperty(PropertyName = "properties.domainVerificationToken")] - public string DomainVerificationToken { get; private set; } - - /// - /// Gets or sets duration in years (must be between 1 and 3). - /// - [JsonProperty(PropertyName = "properties.validityInYears")] + /// Domain verification token. + public string DomainVerificationToken { get; } + /// Duration in years (must be 1). public int? ValidityInYears { get; set; } - - /// - /// Gets or sets certificate key size. - /// - [JsonProperty(PropertyName = "properties.keySize")] + /// Certificate key size. public int? KeySize { get; set; } - - /// - /// Gets or sets certificate product type. Possible values include: - /// 'StandardDomainValidatedSsl', 'StandardDomainValidatedWildCardSsl' - /// - [JsonProperty(PropertyName = "properties.productType")] - public CertificateProductType ProductType { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// certificate should be automatically renewed when it expires; - /// otherwise, &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.autoRenew")] + /// Certificate product type. + public CertificateProductType? ProductType { get; set; } + /// <code>true</code> if the certificate should be automatically renewed when it expires; otherwise, <code>false</code>. public bool? AutoRenew { get; set; } - - /// - /// Gets status of certificate order. Possible values include: - /// 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public ProvisioningState? ProvisioningState { get; private set; } - - /// - /// Gets current order status. Possible values include: - /// 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', - /// 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', - /// 'NotSubmitted' - /// - [JsonProperty(PropertyName = "properties.status")] - public CertificateOrderStatus? Status { get; private set; } - - /// - /// Gets signed certificate. - /// - [JsonProperty(PropertyName = "properties.signedCertificate")] - public CertificateDetails SignedCertificate { get; private set; } - - /// - /// Gets or sets last CSR that was created for this order. - /// - [JsonProperty(PropertyName = "properties.csr")] + /// Status of certificate order. + public ProvisioningState? ProvisioningState { get; } + /// Current order status. + public CertificateOrderStatus? Status { get; } + /// Signed certificate. + public CertificateDetails SignedCertificate { get; } + /// Last CSR that was created for this order. public string Csr { get; set; } - - /// - /// Gets intermediate certificate. - /// - [JsonProperty(PropertyName = "properties.intermediate")] - public CertificateDetails Intermediate { get; private set; } - - /// - /// Gets root certificate. - /// - [JsonProperty(PropertyName = "properties.root")] - public CertificateDetails Root { get; private set; } - - /// - /// Gets current serial number of the certificate. - /// - [JsonProperty(PropertyName = "properties.serialNumber")] - public string SerialNumber { get; private set; } - - /// - /// Gets certificate last issuance time. - /// - [JsonProperty(PropertyName = "properties.lastCertificateIssuanceTime")] - public System.DateTime? LastCertificateIssuanceTime { get; private set; } - - /// - /// Gets certificate expiration time. - /// - [JsonProperty(PropertyName = "properties.expirationTime")] - public System.DateTime? ExpirationTime { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if private key - /// is external; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.isPrivateKeyExternal")] - public bool? IsPrivateKeyExternal { get; private set; } - - /// - /// Gets reasons why App Service Certificate is not renewable at the - /// current moment. - /// - [JsonProperty(PropertyName = "properties.appServiceCertificateNotRenewableReasons")] - public IList AppServiceCertificateNotRenewableReasons { get; private set; } - - /// - /// Gets time stamp when the certificate would be auto renewed next - /// - [JsonProperty(PropertyName = "properties.nextAutoRenewalTimeStamp")] - public System.DateTime? NextAutoRenewalTimeStamp { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (ValidityInYears > 3) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ValidityInYears", 3); - } - if (ValidityInYears < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ValidityInYears", 1); - } - } + /// Intermediate certificate. + public CertificateDetails Intermediate { get; } + /// Root certificate. + public CertificateDetails Root { get; } + /// Current serial number of the certificate. + public string SerialNumber { get; } + /// Certificate last issuance time. + public DateTimeOffset? LastCertificateIssuanceTime { get; } + /// Certificate expiration time. + public DateTimeOffset? ExpirationTime { get; } + /// <code>true</code> if private key is external; otherwise, <code>false</code>. + public bool? IsPrivateKeyExternal { get; } + /// Reasons why App Service Certificate is not renewable at the current moment. + public IReadOnlyList AppServiceCertificateNotRenewableReasons { get; } + /// Time stamp when the certificate would be auto renewed next. + public DateTimeOffset? NextAutoRenewalTimeStamp { get; } + /// Contact info. + public CertificateOrderContact Contact { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.Serialization.cs new file mode 100644 index 000000000000..f57a802cda95 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class AppServiceCertificateOrderCollection + { + internal static AppServiceCertificateOrderCollection DeserializeAppServiceCertificateOrderCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AppServiceCertificateOrder.DeserializeAppServiceCertificateOrder(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new AppServiceCertificateOrderCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.cs new file mode 100644 index 000000000000..186689f503b3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of certificate orders. + internal partial class AppServiceCertificateOrderCollection + { + /// Initializes a new instance of AppServiceCertificateOrderCollection. + /// Collection of resources. + /// is null. + internal AppServiceCertificateOrderCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of AppServiceCertificateOrderCollection. + /// Collection of resources. + /// Link to next page of resources. + internal AppServiceCertificateOrderCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.Serialization.cs new file mode 100644 index 000000000000..119176a1c21b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.Serialization.cs @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppServiceCertificateOrderPatchResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Certificates)) + { + writer.WritePropertyName("certificates"); + writer.WriteStartObject(); + foreach (var item in Certificates) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(DistinguishedName)) + { + writer.WritePropertyName("distinguishedName"); + writer.WriteStringValue(DistinguishedName); + } + if (Optional.IsDefined(ValidityInYears)) + { + writer.WritePropertyName("validityInYears"); + writer.WriteNumberValue(ValidityInYears.Value); + } + if (Optional.IsDefined(KeySize)) + { + writer.WritePropertyName("keySize"); + writer.WriteNumberValue(KeySize.Value); + } + if (Optional.IsDefined(ProductType)) + { + writer.WritePropertyName("productType"); + writer.WriteStringValue(ProductType.Value.ToSerialString()); + } + if (Optional.IsDefined(AutoRenew)) + { + writer.WritePropertyName("autoRenew"); + writer.WriteBooleanValue(AutoRenew.Value); + } + if (Optional.IsDefined(Csr)) + { + writer.WritePropertyName("csr"); + writer.WriteStringValue(Csr); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AppServiceCertificateOrderPatchResource DeserializeAppServiceCertificateOrderPatchResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional> certificates = default; + Optional distinguishedName = default; + Optional domainVerificationToken = default; + Optional validityInYears = default; + Optional keySize = default; + Optional productType = default; + Optional autoRenew = default; + Optional provisioningState = default; + Optional status = default; + Optional signedCertificate = default; + Optional csr = default; + Optional intermediate = default; + Optional root = default; + Optional serialNumber = default; + Optional lastCertificateIssuanceTime = default; + Optional expirationTime = default; + Optional isPrivateKeyExternal = default; + Optional> appServiceCertificateNotRenewableReasons = default; + Optional nextAutoRenewalTimeStamp = default; + Optional contact = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("certificates")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, AppServiceCertificate.DeserializeAppServiceCertificate(property1.Value)); + } + certificates = dictionary; + continue; + } + if (property0.NameEquals("distinguishedName")) + { + distinguishedName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("domainVerificationToken")) + { + domainVerificationToken = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("validityInYears")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + validityInYears = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("keySize")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + keySize = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("productType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + productType = property0.Value.GetString().ToCertificateProductType(); + continue; + } + if (property0.NameEquals("autoRenew")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + autoRenew = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property0.Value.GetString().ToProvisioningState(); + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property0.Value.GetString().ToCertificateOrderStatus(); + continue; + } + if (property0.NameEquals("signedCertificate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + signedCertificate = CertificateDetails.DeserializeCertificateDetails(property0.Value); + continue; + } + if (property0.NameEquals("csr")) + { + csr = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("intermediate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + intermediate = CertificateDetails.DeserializeCertificateDetails(property0.Value); + continue; + } + if (property0.NameEquals("root")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + root = CertificateDetails.DeserializeCertificateDetails(property0.Value); + continue; + } + if (property0.NameEquals("serialNumber")) + { + serialNumber = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("lastCertificateIssuanceTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + lastCertificateIssuanceTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("expirationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + expirationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("isPrivateKeyExternal")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isPrivateKeyExternal = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("appServiceCertificateNotRenewableReasons")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(item.GetString())); + } + appServiceCertificateNotRenewableReasons = array; + continue; + } + if (property0.NameEquals("nextAutoRenewalTimeStamp")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + nextAutoRenewalTimeStamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("contact")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + contact = CertificateOrderContact.DeserializeCertificateOrderContact(property0.Value); + continue; + } + } + continue; + } + } + return new AppServiceCertificateOrderPatchResource(id.Value, name.Value, kind.Value, type.Value, Optional.ToDictionary(certificates), distinguishedName.Value, domainVerificationToken.Value, Optional.ToNullable(validityInYears), Optional.ToNullable(keySize), Optional.ToNullable(productType), Optional.ToNullable(autoRenew), Optional.ToNullable(provisioningState), Optional.ToNullable(status), signedCertificate.Value, csr.Value, intermediate.Value, root.Value, serialNumber.Value, Optional.ToNullable(lastCertificateIssuanceTime), Optional.ToNullable(expirationTime), Optional.ToNullable(isPrivateKeyExternal), Optional.ToList(appServiceCertificateNotRenewableReasons), Optional.ToNullable(nextAutoRenewalTimeStamp), contact.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs index a9284452f4d4..b8e0bfcd1b27 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs @@ -1,85 +1,52 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// ARM resource for a certificate order that is purchased through Azure. - /// - [Rest.Serialization.JsonTransformation] + /// ARM resource for a certificate order that is purchased through Azure. public partial class AppServiceCertificateOrderPatchResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the - /// AppServiceCertificateOrderPatchResource class. - /// + /// Initializes a new instance of AppServiceCertificateOrderPatchResource. public AppServiceCertificateOrderPatchResource() { - CustomInit(); + Certificates = new ChangeTrackingDictionary(); + AppServiceCertificateNotRenewableReasons = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the - /// AppServiceCertificateOrderPatchResource class. - /// - /// Certificate product type. Possible values - /// include: 'StandardDomainValidatedSsl', - /// 'StandardDomainValidatedWildCardSsl' - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// State of the Key Vault secret. - /// Certificate distinguished - /// name. - /// Domain verification - /// token. - /// Duration in years (must be between 1 - /// and 3). - /// Certificate key size. - /// <code>true</code> if the - /// certificate should be automatically renewed when it expires; - /// otherwise, <code>false</code>. - /// Status of certificate order. - /// Possible values include: 'Succeeded', 'Failed', 'Canceled', - /// 'InProgress', 'Deleting' - /// Current order status. Possible values include: - /// 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', - /// 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', - /// 'NotSubmitted' - /// Signed certificate. - /// Last CSR that was created for this order. - /// Intermediate certificate. - /// Root certificate. - /// Current serial number of the - /// certificate. - /// Certificate last issuance - /// time. - /// Certificate expiration time. - /// <code>true</code> if - /// private key is external; otherwise, - /// <code>false</code>. - /// Reasons why - /// App Service Certificate is not renewable at the current - /// moment. - /// Time stamp when the - /// certificate would be auto renewed next - public AppServiceCertificateOrderPatchResource(CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?)) - : base(id, name, kind, type) + /// Initializes a new instance of AppServiceCertificateOrderPatchResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// State of the Key Vault secret. + /// Certificate distinguished name. + /// Domain verification token. + /// Duration in years (must be 1). + /// Certificate key size. + /// Certificate product type. + /// <code>true</code> if the certificate should be automatically renewed when it expires; otherwise, <code>false</code>. + /// Status of certificate order. + /// Current order status. + /// Signed certificate. + /// Last CSR that was created for this order. + /// Intermediate certificate. + /// Root certificate. + /// Current serial number of the certificate. + /// Certificate last issuance time. + /// Certificate expiration time. + /// <code>true</code> if private key is external; otherwise, <code>false</code>. + /// Reasons why App Service Certificate is not renewable at the current moment. + /// Time stamp when the certificate would be auto renewed next. + /// Contact info. + internal AppServiceCertificateOrderPatchResource(string id, string name, string kind, string type, IDictionary certificates, string distinguishedName, string domainVerificationToken, int? validityInYears, int? keySize, CertificateProductType? productType, bool? autoRenew, ProvisioningState? provisioningState, CertificateOrderStatus? status, CertificateDetails signedCertificate, string csr, CertificateDetails intermediate, CertificateDetails root, string serialNumber, DateTimeOffset? lastCertificateIssuanceTime, DateTimeOffset? expirationTime, bool? isPrivateKeyExternal, IReadOnlyList appServiceCertificateNotRenewableReasons, DateTimeOffset? nextAutoRenewalTimeStamp, CertificateOrderContact contact) : base(id, name, kind, type) { Certificates = certificates; DistinguishedName = distinguishedName; @@ -100,154 +67,48 @@ public AppServiceCertificateOrderPatchResource() IsPrivateKeyExternal = isPrivateKeyExternal; AppServiceCertificateNotRenewableReasons = appServiceCertificateNotRenewableReasons; NextAutoRenewalTimeStamp = nextAutoRenewalTimeStamp; - CustomInit(); + Contact = contact; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets state of the Key Vault secret. - /// - [JsonProperty(PropertyName = "properties.certificates")] - public IDictionary Certificates { get; set; } - - /// - /// Gets or sets certificate distinguished name. - /// - [JsonProperty(PropertyName = "properties.distinguishedName")] + /// State of the Key Vault secret. + public IDictionary Certificates { get; } + /// Certificate distinguished name. public string DistinguishedName { get; set; } - - /// - /// Gets domain verification token. - /// - [JsonProperty(PropertyName = "properties.domainVerificationToken")] - public string DomainVerificationToken { get; private set; } - - /// - /// Gets or sets duration in years (must be between 1 and 3). - /// - [JsonProperty(PropertyName = "properties.validityInYears")] + /// Domain verification token. + public string DomainVerificationToken { get; } + /// Duration in years (must be 1). public int? ValidityInYears { get; set; } - - /// - /// Gets or sets certificate key size. - /// - [JsonProperty(PropertyName = "properties.keySize")] + /// Certificate key size. public int? KeySize { get; set; } - - /// - /// Gets or sets certificate product type. Possible values include: - /// 'StandardDomainValidatedSsl', 'StandardDomainValidatedWildCardSsl' - /// - [JsonProperty(PropertyName = "properties.productType")] - public CertificateProductType ProductType { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// certificate should be automatically renewed when it expires; - /// otherwise, &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.autoRenew")] + /// Certificate product type. + public CertificateProductType? ProductType { get; set; } + /// <code>true</code> if the certificate should be automatically renewed when it expires; otherwise, <code>false</code>. public bool? AutoRenew { get; set; } - - /// - /// Gets status of certificate order. Possible values include: - /// 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public ProvisioningState? ProvisioningState { get; private set; } - - /// - /// Gets current order status. Possible values include: - /// 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', - /// 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', - /// 'NotSubmitted' - /// - [JsonProperty(PropertyName = "properties.status")] - public CertificateOrderStatus? Status { get; private set; } - - /// - /// Gets signed certificate. - /// - [JsonProperty(PropertyName = "properties.signedCertificate")] - public CertificateDetails SignedCertificate { get; private set; } - - /// - /// Gets or sets last CSR that was created for this order. - /// - [JsonProperty(PropertyName = "properties.csr")] + /// Status of certificate order. + public ProvisioningState? ProvisioningState { get; } + /// Current order status. + public CertificateOrderStatus? Status { get; } + /// Signed certificate. + public CertificateDetails SignedCertificate { get; } + /// Last CSR that was created for this order. public string Csr { get; set; } - - /// - /// Gets intermediate certificate. - /// - [JsonProperty(PropertyName = "properties.intermediate")] - public CertificateDetails Intermediate { get; private set; } - - /// - /// Gets root certificate. - /// - [JsonProperty(PropertyName = "properties.root")] - public CertificateDetails Root { get; private set; } - - /// - /// Gets current serial number of the certificate. - /// - [JsonProperty(PropertyName = "properties.serialNumber")] - public string SerialNumber { get; private set; } - - /// - /// Gets certificate last issuance time. - /// - [JsonProperty(PropertyName = "properties.lastCertificateIssuanceTime")] - public System.DateTime? LastCertificateIssuanceTime { get; private set; } - - /// - /// Gets certificate expiration time. - /// - [JsonProperty(PropertyName = "properties.expirationTime")] - public System.DateTime? ExpirationTime { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if private key - /// is external; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.isPrivateKeyExternal")] - public bool? IsPrivateKeyExternal { get; private set; } - - /// - /// Gets reasons why App Service Certificate is not renewable at the - /// current moment. - /// - [JsonProperty(PropertyName = "properties.appServiceCertificateNotRenewableReasons")] - public IList AppServiceCertificateNotRenewableReasons { get; private set; } - - /// - /// Gets time stamp when the certificate would be auto renewed next - /// - [JsonProperty(PropertyName = "properties.nextAutoRenewalTimeStamp")] - public System.DateTime? NextAutoRenewalTimeStamp { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ValidityInYears > 3) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ValidityInYears", 3); - } - if (ValidityInYears < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ValidityInYears", 1); - } - } + /// Intermediate certificate. + public CertificateDetails Intermediate { get; } + /// Root certificate. + public CertificateDetails Root { get; } + /// Current serial number of the certificate. + public string SerialNumber { get; } + /// Certificate last issuance time. + public DateTimeOffset? LastCertificateIssuanceTime { get; } + /// Certificate expiration time. + public DateTimeOffset? ExpirationTime { get; } + /// <code>true</code> if private key is external; otherwise, <code>false</code>. + public bool? IsPrivateKeyExternal { get; } + /// Reasons why App Service Certificate is not renewable at the current moment. + public IReadOnlyList AppServiceCertificateNotRenewableReasons { get; } + /// Time stamp when the certificate would be auto renewed next. + public DateTimeOffset? NextAutoRenewalTimeStamp { get; } + /// Contact info. + public CertificateOrderContact Contact { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.cs new file mode 100644 index 000000000000..268a2fe6f71d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem. + public readonly partial struct AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegistrationStatusNotSupportedForRenewalValue = "RegistrationStatusNotSupportedForRenewal"; + private const string ExpirationNotInRenewalTimeRangeValue = "ExpirationNotInRenewalTimeRange"; + private const string SubscriptionNotActiveValue = "SubscriptionNotActive"; + + /// RegistrationStatusNotSupportedForRenewal. + public static AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem RegistrationStatusNotSupportedForRenewal { get; } = new AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(RegistrationStatusNotSupportedForRenewalValue); + /// ExpirationNotInRenewalTimeRange. + public static AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem ExpirationNotInRenewalTimeRange { get; } = new AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(ExpirationNotInRenewalTimeRangeValue); + /// SubscriptionNotActive. + public static AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem SubscriptionNotActive { get; } = new AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(SubscriptionNotActiveValue); + /// Determines if two values are the same. + public static bool operator ==(AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem left, AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem left, AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(string value) => new AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem other && Equals(other); + /// + public bool Equals(AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.cs new file mode 100644 index 000000000000..40f1c4f78603 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem. + public readonly partial struct AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegistrationStatusNotSupportedForRenewalValue = "RegistrationStatusNotSupportedForRenewal"; + private const string ExpirationNotInRenewalTimeRangeValue = "ExpirationNotInRenewalTimeRange"; + private const string SubscriptionNotActiveValue = "SubscriptionNotActive"; + + /// RegistrationStatusNotSupportedForRenewal. + public static AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem RegistrationStatusNotSupportedForRenewal { get; } = new AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(RegistrationStatusNotSupportedForRenewalValue); + /// ExpirationNotInRenewalTimeRange. + public static AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem ExpirationNotInRenewalTimeRange { get; } = new AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(ExpirationNotInRenewalTimeRangeValue); + /// SubscriptionNotActive. + public static AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem SubscriptionNotActive { get; } = new AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(SubscriptionNotActiveValue); + /// Determines if two values are the same. + public static bool operator ==(AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem left, AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem left, AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(string value) => new AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem other && Equals(other); + /// + public bool Equals(AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.Serialization.cs new file mode 100644 index 000000000000..59bb9a519ed7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.Serialization.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppServiceCertificatePatchResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(KeyVaultId)) + { + writer.WritePropertyName("keyVaultId"); + writer.WriteStringValue(KeyVaultId); + } + if (Optional.IsDefined(KeyVaultSecretName)) + { + writer.WritePropertyName("keyVaultSecretName"); + writer.WriteStringValue(KeyVaultSecretName); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AppServiceCertificatePatchResource DeserializeAppServiceCertificatePatchResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional keyVaultId = default; + Optional keyVaultSecretName = default; + Optional provisioningState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("keyVaultId")) + { + keyVaultId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("keyVaultSecretName")) + { + keyVaultSecretName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property0.Value.GetString().ToKeyVaultSecretStatus(); + continue; + } + } + continue; + } + } + return new AppServiceCertificatePatchResource(id.Value, name.Value, kind.Value, type.Value, keyVaultId.Value, keyVaultSecretName.Value, Optional.ToNullable(provisioningState)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.cs index cabf8228ef12..c5c3f283eee8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.cs @@ -1,89 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Key Vault container ARM resource for a certificate that is purchased - /// through Azure. - /// - [Rest.Serialization.JsonTransformation] + /// Key Vault container ARM resource for a certificate that is purchased through Azure. public partial class AppServiceCertificatePatchResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the - /// AppServiceCertificatePatchResource class. - /// + /// Initializes a new instance of AppServiceCertificatePatchResource. public AppServiceCertificatePatchResource() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// AppServiceCertificatePatchResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Key Vault resource Id. - /// Key Vault secret name. - /// Status of the Key Vault secret. - /// Possible values include: 'Initialized', - /// 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', - /// 'OperationNotPermittedOnKeyVault', - /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', - /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', - /// 'Unknown' - public AppServiceCertificatePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? provisioningState = default(KeyVaultSecretStatus?)) - : base(id, name, kind, type) + /// Initializes a new instance of AppServiceCertificatePatchResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Key Vault resource Id. + /// Key Vault secret name. + /// Status of the Key Vault secret. + internal AppServiceCertificatePatchResource(string id, string name, string kind, string type, string keyVaultId, string keyVaultSecretName, KeyVaultSecretStatus? provisioningState) : base(id, name, kind, type) { KeyVaultId = keyVaultId; KeyVaultSecretName = keyVaultSecretName; ProvisioningState = provisioningState; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets key Vault resource Id. - /// - [JsonProperty(PropertyName = "properties.keyVaultId")] + /// Key Vault resource Id. public string KeyVaultId { get; set; } - - /// - /// Gets or sets key Vault secret name. - /// - [JsonProperty(PropertyName = "properties.keyVaultSecretName")] + /// Key Vault secret name. public string KeyVaultSecretName { get; set; } - - /// - /// Gets status of the Key Vault secret. Possible values include: - /// 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', - /// 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', - /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', - /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', - /// 'Unknown' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public KeyVaultSecretStatus? ProvisioningState { get; private set; } - + /// Status of the Key Vault secret. + public KeyVaultSecretStatus? ProvisioningState { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.Serialization.cs new file mode 100644 index 000000000000..2b510c0cbd2e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppServiceCertificateResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(KeyVaultId)) + { + writer.WritePropertyName("keyVaultId"); + writer.WriteStringValue(KeyVaultId); + } + if (Optional.IsDefined(KeyVaultSecretName)) + { + writer.WritePropertyName("keyVaultSecretName"); + writer.WriteStringValue(KeyVaultSecretName); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AppServiceCertificateResource DeserializeAppServiceCertificateResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + string location = default; + Optional type = default; + Optional> tags = default; + Optional keyVaultId = default; + Optional keyVaultSecretName = default; + Optional provisioningState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("keyVaultId")) + { + keyVaultId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("keyVaultSecretName")) + { + keyVaultSecretName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property0.Value.GetString().ToKeyVaultSecretStatus(); + continue; + } + } + continue; + } + } + return new AppServiceCertificateResource(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), keyVaultId.Value, keyVaultSecretName.Value, Optional.ToNullable(provisioningState)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.cs index a9b3c95a4df4..d11737695292 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.cs @@ -1,103 +1,51 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Key Vault container ARM resource for a certificate that is purchased - /// through Azure. - /// - [Rest.Serialization.JsonTransformation] + /// Key Vault container ARM resource for a certificate that is purchased through Azure. public partial class AppServiceCertificateResource : Resource { - /// - /// Initializes a new instance of the AppServiceCertificateResource - /// class. - /// - public AppServiceCertificateResource() + /// Initializes a new instance of AppServiceCertificateResource. + /// Resource Location. + /// is null. + public AppServiceCertificateResource(string location) : base(location) { - CustomInit(); + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } } - /// - /// Initializes a new instance of the AppServiceCertificateResource - /// class. - /// - /// Resource Location. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Resource tags. - /// Key Vault resource Id. - /// Key Vault secret name. - /// Status of the Key Vault secret. - /// Possible values include: 'Initialized', - /// 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', - /// 'OperationNotPermittedOnKeyVault', - /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', - /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', - /// 'Unknown' - public AppServiceCertificateResource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? provisioningState = default(KeyVaultSecretStatus?)) - : base(location, id, name, kind, type, tags) + /// Initializes a new instance of AppServiceCertificateResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource Location. + /// Resource type. + /// Resource tags. + /// Key Vault resource Id. + /// Key Vault secret name. + /// Status of the Key Vault secret. + internal AppServiceCertificateResource(string id, string name, string kind, string location, string type, IDictionary tags, string keyVaultId, string keyVaultSecretName, KeyVaultSecretStatus? provisioningState) : base(id, name, kind, location, type, tags) { KeyVaultId = keyVaultId; KeyVaultSecretName = keyVaultSecretName; ProvisioningState = provisioningState; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets key Vault resource Id. - /// - [JsonProperty(PropertyName = "properties.keyVaultId")] + /// Key Vault resource Id. public string KeyVaultId { get; set; } - - /// - /// Gets or sets key Vault secret name. - /// - [JsonProperty(PropertyName = "properties.keyVaultSecretName")] + /// Key Vault secret name. public string KeyVaultSecretName { get; set; } - - /// - /// Gets status of the Key Vault secret. Possible values include: - /// 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', - /// 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', - /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', - /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', - /// 'Unknown' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public KeyVaultSecretStatus? ProvisioningState { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } + /// Status of the Key Vault secret. + public KeyVaultSecretStatus? ProvisioningState { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.Serialization.cs new file mode 100644 index 000000000000..4920a92afeb6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.Serialization.cs @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppServiceEnvironment : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("virtualNetwork"); + writer.WriteObjectValue(VirtualNetwork); + if (Optional.IsDefined(InternalLoadBalancingMode)) + { + writer.WritePropertyName("internalLoadBalancingMode"); + writer.WriteStringValue(InternalLoadBalancingMode.Value.ToString()); + } + if (Optional.IsDefined(MultiSize)) + { + writer.WritePropertyName("multiSize"); + writer.WriteStringValue(MultiSize); + } + if (Optional.IsDefined(IpsslAddressCount)) + { + writer.WritePropertyName("ipsslAddressCount"); + writer.WriteNumberValue(IpsslAddressCount.Value); + } + if (Optional.IsDefined(DnsSuffix)) + { + writer.WritePropertyName("dnsSuffix"); + writer.WriteStringValue(DnsSuffix); + } + if (Optional.IsDefined(FrontEndScaleFactor)) + { + writer.WritePropertyName("frontEndScaleFactor"); + writer.WriteNumberValue(FrontEndScaleFactor.Value); + } + if (Optional.IsCollectionDefined(ClusterSettings)) + { + writer.WritePropertyName("clusterSettings"); + writer.WriteStartArray(); + foreach (var item in ClusterSettings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(UserWhitelistedIpRanges)) + { + writer.WritePropertyName("userWhitelistedIpRanges"); + writer.WriteStartArray(); + foreach (var item in UserWhitelistedIpRanges) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static AppServiceEnvironment DeserializeAppServiceEnvironment(JsonElement element) + { + Optional provisioningState = default; + Optional status = default; + VirtualNetworkProfile virtualNetwork = default; + Optional internalLoadBalancingMode = default; + Optional multiSize = default; + Optional multiRoleCount = default; + Optional ipsslAddressCount = default; + Optional dnsSuffix = default; + Optional maximumNumberOfMachines = default; + Optional frontEndScaleFactor = default; + Optional suspended = default; + Optional> clusterSettings = default; + Optional> userWhitelistedIpRanges = default; + Optional hasLinuxWorkers = default; + Optional dedicatedHostCount = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property.Value.GetString().ToProvisioningState(); + continue; + } + if (property.NameEquals("status")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property.Value.GetString().ToHostingEnvironmentStatus(); + continue; + } + if (property.NameEquals("virtualNetwork")) + { + virtualNetwork = VirtualNetworkProfile.DeserializeVirtualNetworkProfile(property.Value); + continue; + } + if (property.NameEquals("internalLoadBalancingMode")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + internalLoadBalancingMode = new LoadBalancingMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("multiSize")) + { + multiSize = property.Value.GetString(); + continue; + } + if (property.NameEquals("multiRoleCount")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + multiRoleCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ipsslAddressCount")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + ipsslAddressCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dnsSuffix")) + { + dnsSuffix = property.Value.GetString(); + continue; + } + if (property.NameEquals("maximumNumberOfMachines")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + maximumNumberOfMachines = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("frontEndScaleFactor")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + frontEndScaleFactor = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("suspended")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + suspended = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("clusterSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePair.DeserializeNameValuePair(item)); + } + clusterSettings = array; + continue; + } + if (property.NameEquals("userWhitelistedIpRanges")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + userWhitelistedIpRanges = array; + continue; + } + if (property.NameEquals("hasLinuxWorkers")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + hasLinuxWorkers = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dedicatedHostCount")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + dedicatedHostCount = property.Value.GetInt32(); + continue; + } + } + return new AppServiceEnvironment(Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipsslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIpRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(dedicatedHostCount)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs index d7562b769f24..6ebc6663c2a8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs @@ -1,459 +1,104 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Description of an App Service Environment. - /// + /// Description of an App Service Environment. public partial class AppServiceEnvironment { - /// - /// Initializes a new instance of the AppServiceEnvironment class. - /// - public AppServiceEnvironment() + /// Initializes a new instance of AppServiceEnvironment. + /// Description of the Virtual Network. + /// is null. + public AppServiceEnvironment(VirtualNetworkProfile virtualNetwork) { - CustomInit(); + if (virtualNetwork == null) + { + throw new ArgumentNullException(nameof(virtualNetwork)); + } + + VirtualNetwork = virtualNetwork; + ClusterSettings = new ChangeTrackingList(); + UserWhitelistedIpRanges = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the AppServiceEnvironment class. - /// - /// Name of the App Service Environment. - /// Location of the App Service Environment, - /// e.g. "West US". - /// Description of the Virtual - /// Network. - /// Description of worker pools with worker - /// size IDs, VM sizes, and number of workers in each pool. - /// Provisioning state of the App - /// Service Environment. Possible values include: 'Succeeded', - /// 'Failed', 'Canceled', 'InProgress', 'Deleting' - /// Current status of the App Service Environment. - /// Possible values include: 'Preparing', 'Ready', 'Scaling', - /// 'Deleting' - /// Name of the Virtual Network for the App - /// Service Environment. - /// Resource group of the Virtual - /// Network. - /// Subnet of the Virtual Network. - /// Specifies which endpoints - /// to serve internally in the Virtual Network for the App Service - /// Environment. Possible values include: 'None', 'Web', 'Publishing', - /// 'Web,Publishing' - /// Front-end VM size, e.g. "Medium", - /// "Large". - /// Number of front-end instances. - /// Number of IP SSL addresses reserved - /// for the App Service Environment. - /// Edition of the metadata database for - /// the App Service Environment, e.g. "Standard". - /// Service objective of the - /// metadata database for the App Service Environment, e.g. - /// "S0". - /// Number of upgrade domains of the App - /// Service Environment. - /// Subscription of the App Service - /// Environment. - /// DNS suffix of the App Service - /// Environment. - /// Last deployment action on the App Service - /// Environment. - /// Result of the last deployment action - /// on the App Service Environment. - /// List of comma separated strings - /// describing which VM sizes are allowed for front-ends. - /// List of comma separated strings - /// describing which VM sizes are allowed for workers. - /// Maximum number of VMs in the - /// App Service Environment. - /// Description of IP SSL mapping for the App - /// Service Environment. - /// Current total, used, and - /// available worker capacities. - /// Access control list for - /// controlling traffic to the App Service Environment. - /// True/false indicating whether - /// the App Service Environment is healthy. - /// Detailed message about with results - /// of the last check of the App Service Environment. - /// Resource group of the App Service - /// Environment. - /// Scale factor for - /// front-ends. - /// Default Scale Factor for - /// FrontEnds. - /// API Management Account - /// associated with the App Service Environment. - /// <code>true</code> if the App - /// Service Environment is suspended; otherwise, - /// <code>false</code>. The environment can be suspended, - /// e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// True/false indicating whether the - /// App Service Environment is suspended. The environment can be - /// suspended e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// Custom settings for changing the - /// behavior of the App Service Environment. - /// User added ip ranges to - /// whitelist on ASE db - /// Flag that displays whether an ASE has - /// linux workers or not - /// Key Vault ID for ILB App Service - /// Environment default SSL certificate - /// Key Vault Secret Name for - /// ILB App Service Environment default SSL certificate - public AppServiceEnvironment(string name, string location, VirtualNetworkProfile virtualNetwork, IList workerPools, ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) + /// Initializes a new instance of AppServiceEnvironment. + /// Provisioning state of the App Service Environment. + /// Current status of the App Service Environment. + /// Description of the Virtual Network. + /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. + /// Front-end VM size, e.g. "Medium", "Large". + /// Number of front-end instances. + /// Number of IP SSL addresses reserved for the App Service Environment. + /// DNS suffix of the App Service Environment. + /// Maximum number of VMs in the App Service Environment. + /// Scale factor for front-ends. + /// + /// <code>true</code> if the App Service Environment is suspended; otherwise, <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// + /// Custom settings for changing the behavior of the App Service Environment. + /// User added ip ranges to whitelist on ASE db. + /// Flag that displays whether an ASE has linux workers or not. + /// Dedicated Host Count. + internal AppServiceEnvironment(ProvisioningState? provisioningState, HostingEnvironmentStatus? status, VirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipsslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? suspended, IList clusterSettings, IList userWhitelistedIpRanges, bool? hasLinuxWorkers, int? dedicatedHostCount) { - Name = name; - Location = location; ProvisioningState = provisioningState; Status = status; - VnetName = vnetName; - VnetResourceGroupName = vnetResourceGroupName; - VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; - WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; - DatabaseEdition = databaseEdition; - DatabaseServiceObjective = databaseServiceObjective; - UpgradeDomains = upgradeDomains; - SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; - LastAction = lastAction; - LastActionResult = lastActionResult; - AllowedMultiSizes = allowedMultiSizes; - AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; - VipMappings = vipMappings; - EnvironmentCapacities = environmentCapacities; - NetworkAccessControlList = networkAccessControlList; - EnvironmentIsHealthy = environmentIsHealthy; - EnvironmentStatus = environmentStatus; - ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; - DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; - ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; - DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - SslCertKeyVaultId = sslCertKeyVaultId; - SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; - CustomInit(); + DedicatedHostCount = dedicatedHostCount; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the App Service Environment. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets location of the App Service Environment, e.g. "West - /// US". - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets provisioning state of the App Service Environment. Possible - /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', - /// 'Deleting' - /// - [JsonProperty(PropertyName = "provisioningState")] - public ProvisioningState? ProvisioningState { get; private set; } - - /// - /// Gets current status of the App Service Environment. Possible values - /// include: 'Preparing', 'Ready', 'Scaling', 'Deleting' - /// - [JsonProperty(PropertyName = "status")] - public HostingEnvironmentStatus? Status { get; private set; } - - /// - /// Gets or sets name of the Virtual Network for the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "vnetName")] - public string VnetName { get; set; } - - /// - /// Gets or sets resource group of the Virtual Network. - /// - [JsonProperty(PropertyName = "vnetResourceGroupName")] - public string VnetResourceGroupName { get; set; } - - /// - /// Gets or sets subnet of the Virtual Network. - /// - [JsonProperty(PropertyName = "vnetSubnetName")] - public string VnetSubnetName { get; set; } - - /// - /// Gets or sets description of the Virtual Network. - /// - [JsonProperty(PropertyName = "virtualNetwork")] + /// Provisioning state of the App Service Environment. + public ProvisioningState? ProvisioningState { get; } + /// Current status of the App Service Environment. + public HostingEnvironmentStatus? Status { get; } + /// Description of the Virtual Network. public VirtualNetworkProfile VirtualNetwork { get; set; } - - /// - /// Gets or sets specifies which endpoints to serve internally in the - /// Virtual Network for the App Service Environment. Possible values - /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' - /// - [JsonProperty(PropertyName = "internalLoadBalancingMode")] - public string InternalLoadBalancingMode { get; set; } - - /// - /// Gets or sets front-end VM size, e.g. "Medium", "Large". - /// - [JsonProperty(PropertyName = "multiSize")] + /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. + public LoadBalancingMode? InternalLoadBalancingMode { get; set; } + /// Front-end VM size, e.g. "Medium", "Large". public string MultiSize { get; set; } - - /// - /// Gets or sets number of front-end instances. - /// - [JsonProperty(PropertyName = "multiRoleCount")] - public int? MultiRoleCount { get; set; } - - /// - /// Gets or sets description of worker pools with worker size IDs, VM - /// sizes, and number of workers in each pool. - /// - [JsonProperty(PropertyName = "workerPools")] - public IList WorkerPools { get; set; } - - /// - /// Gets or sets number of IP SSL addresses reserved for the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "ipsslAddressCount")] + /// Number of front-end instances. + public int? MultiRoleCount { get; } + /// Number of IP SSL addresses reserved for the App Service Environment. public int? IpsslAddressCount { get; set; } - - /// - /// Gets edition of the metadata database for the App Service - /// Environment, e.g. "Standard". - /// - [JsonProperty(PropertyName = "databaseEdition")] - public string DatabaseEdition { get; private set; } - - /// - /// Gets service objective of the metadata database for the App Service - /// Environment, e.g. "S0". - /// - [JsonProperty(PropertyName = "databaseServiceObjective")] - public string DatabaseServiceObjective { get; private set; } - - /// - /// Gets number of upgrade domains of the App Service Environment. - /// - [JsonProperty(PropertyName = "upgradeDomains")] - public int? UpgradeDomains { get; private set; } - - /// - /// Gets subscription of the App Service Environment. - /// - [JsonProperty(PropertyName = "subscriptionId")] - public string SubscriptionId { get; private set; } - - /// - /// Gets or sets DNS suffix of the App Service Environment. - /// - [JsonProperty(PropertyName = "dnsSuffix")] + /// DNS suffix of the App Service Environment. public string DnsSuffix { get; set; } - - /// - /// Gets last deployment action on the App Service Environment. - /// - [JsonProperty(PropertyName = "lastAction")] - public string LastAction { get; private set; } - - /// - /// Gets result of the last deployment action on the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "lastActionResult")] - public string LastActionResult { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for front-ends. - /// - [JsonProperty(PropertyName = "allowedMultiSizes")] - public string AllowedMultiSizes { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for workers. - /// - [JsonProperty(PropertyName = "allowedWorkerSizes")] - public string AllowedWorkerSizes { get; private set; } - - /// - /// Gets maximum number of VMs in the App Service Environment. - /// - [JsonProperty(PropertyName = "maximumNumberOfMachines")] - public int? MaximumNumberOfMachines { get; private set; } - - /// - /// Gets description of IP SSL mapping for the App Service Environment. - /// - [JsonProperty(PropertyName = "vipMappings")] - public IList VipMappings { get; private set; } - - /// - /// Gets current total, used, and available worker capacities. - /// - [JsonProperty(PropertyName = "environmentCapacities")] - public IList EnvironmentCapacities { get; private set; } - - /// - /// Gets or sets access control list for controlling traffic to the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "networkAccessControlList")] - public IList NetworkAccessControlList { get; set; } - - /// - /// Gets true/false indicating whether the App Service Environment is - /// healthy. - /// - [JsonProperty(PropertyName = "environmentIsHealthy")] - public bool? EnvironmentIsHealthy { get; private set; } - - /// - /// Gets detailed message about with results of the last check of the - /// App Service Environment. - /// - [JsonProperty(PropertyName = "environmentStatus")] - public string EnvironmentStatus { get; private set; } - - /// - /// Gets resource group of the App Service Environment. - /// - [JsonProperty(PropertyName = "resourceGroup")] - public string ResourceGroup { get; private set; } - - /// - /// Gets or sets scale factor for front-ends. - /// - [JsonProperty(PropertyName = "frontEndScaleFactor")] + /// Maximum number of VMs in the App Service Environment. + public int? MaximumNumberOfMachines { get; } + /// Scale factor for front-ends. public int? FrontEndScaleFactor { get; set; } - - /// - /// Gets default Scale Factor for FrontEnds. - /// - [JsonProperty(PropertyName = "defaultFrontEndScaleFactor")] - public int? DefaultFrontEndScaleFactor { get; private set; } - /// - /// Gets or sets API Management Account associated with the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "apiManagementAccountId")] - public string ApiManagementAccountId { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// App Service Environment is suspended; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. The environment can - /// be suspended, e.g. when the management endpoint is no longer - /// available - /// (most likely because NSG blocked the incoming traffic). - /// - [JsonProperty(PropertyName = "suspended")] - public bool? Suspended { get; set; } - - /// - /// Gets or sets true/false indicating whether the App Service - /// Environment is suspended. The environment can be suspended e.g. - /// when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - [JsonProperty(PropertyName = "dynamicCacheEnabled")] - public bool? DynamicCacheEnabled { get; set; } - - /// - /// Gets or sets custom settings for changing the behavior of the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "clusterSettings")] - public IList ClusterSettings { get; set; } - - /// - /// Gets or sets user added ip ranges to whitelist on ASE db - /// - [JsonProperty(PropertyName = "userWhitelistedIpRanges")] - public IList UserWhitelistedIpRanges { get; set; } - - /// - /// Gets or sets flag that displays whether an ASE has linux workers or - /// not - /// - [JsonProperty(PropertyName = "hasLinuxWorkers")] - public bool? HasLinuxWorkers { get; set; } - - /// - /// Gets or sets key Vault ID for ILB App Service Environment default - /// SSL certificate - /// - [JsonProperty(PropertyName = "sslCertKeyVaultId")] - public string SslCertKeyVaultId { get; set; } - - /// - /// Gets or sets key Vault Secret Name for ILB App Service Environment - /// default SSL certificate - /// - [JsonProperty(PropertyName = "sslCertKeyVaultSecretName")] - public string SslCertKeyVaultSecretName { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - if (VirtualNetwork == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); - } - if (WorkerPools == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); - } - } + /// <code>true</code> if the App Service Environment is suspended; otherwise, <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// + public bool? Suspended { get; } + /// Custom settings for changing the behavior of the App Service Environment. + public IList ClusterSettings { get; } + /// User added ip ranges to whitelist on ASE db. + public IList UserWhitelistedIpRanges { get; } + /// Flag that displays whether an ASE has linux workers or not. + public bool? HasLinuxWorkers { get; } + /// Dedicated Host Count. + public int? DedicatedHostCount { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.Serialization.cs new file mode 100644 index 000000000000..dea6114515c0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class AppServiceEnvironmentCollection + { + internal static AppServiceEnvironmentCollection DeserializeAppServiceEnvironmentCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AppServiceEnvironmentResource.DeserializeAppServiceEnvironmentResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new AppServiceEnvironmentCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.cs new file mode 100644 index 000000000000..81a50b0a1987 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of App Service Environments. + internal partial class AppServiceEnvironmentCollection + { + /// Initializes a new instance of AppServiceEnvironmentCollection. + /// Collection of resources. + /// is null. + internal AppServiceEnvironmentCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of AppServiceEnvironmentCollection. + /// Collection of resources. + /// Link to next page of resources. + internal AppServiceEnvironmentCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.Serialization.cs new file mode 100644 index 000000000000..de2b58245ed5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.Serialization.cs @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppServiceEnvironmentPatchResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(VirtualNetwork)) + { + writer.WritePropertyName("virtualNetwork"); + writer.WriteObjectValue(VirtualNetwork); + } + if (Optional.IsDefined(InternalLoadBalancingMode)) + { + writer.WritePropertyName("internalLoadBalancingMode"); + writer.WriteStringValue(InternalLoadBalancingMode.Value.ToString()); + } + if (Optional.IsDefined(MultiSize)) + { + writer.WritePropertyName("multiSize"); + writer.WriteStringValue(MultiSize); + } + if (Optional.IsDefined(IpsslAddressCount)) + { + writer.WritePropertyName("ipsslAddressCount"); + writer.WriteNumberValue(IpsslAddressCount.Value); + } + if (Optional.IsDefined(DnsSuffix)) + { + writer.WritePropertyName("dnsSuffix"); + writer.WriteStringValue(DnsSuffix); + } + if (Optional.IsDefined(FrontEndScaleFactor)) + { + writer.WritePropertyName("frontEndScaleFactor"); + writer.WriteNumberValue(FrontEndScaleFactor.Value); + } + if (Optional.IsCollectionDefined(ClusterSettings)) + { + writer.WritePropertyName("clusterSettings"); + writer.WriteStartArray(); + foreach (var item in ClusterSettings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(UserWhitelistedIpRanges)) + { + writer.WritePropertyName("userWhitelistedIpRanges"); + writer.WriteStartArray(); + foreach (var item in UserWhitelistedIpRanges) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AppServiceEnvironmentPatchResource DeserializeAppServiceEnvironmentPatchResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional provisioningState = default; + Optional status = default; + Optional virtualNetwork = default; + Optional internalLoadBalancingMode = default; + Optional multiSize = default; + Optional multiRoleCount = default; + Optional ipsslAddressCount = default; + Optional dnsSuffix = default; + Optional maximumNumberOfMachines = default; + Optional frontEndScaleFactor = default; + Optional suspended = default; + Optional> clusterSettings = default; + Optional> userWhitelistedIpRanges = default; + Optional hasLinuxWorkers = default; + Optional dedicatedHostCount = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property0.Value.GetString().ToProvisioningState(); + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property0.Value.GetString().ToHostingEnvironmentStatus(); + continue; + } + if (property0.NameEquals("virtualNetwork")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + virtualNetwork = VirtualNetworkProfile.DeserializeVirtualNetworkProfile(property0.Value); + continue; + } + if (property0.NameEquals("internalLoadBalancingMode")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + internalLoadBalancingMode = new LoadBalancingMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("multiSize")) + { + multiSize = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("multiRoleCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + multiRoleCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("ipsslAddressCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + ipsslAddressCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("dnsSuffix")) + { + dnsSuffix = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("maximumNumberOfMachines")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + maximumNumberOfMachines = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("frontEndScaleFactor")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + frontEndScaleFactor = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("suspended")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + suspended = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("clusterSettings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(NameValuePair.DeserializeNameValuePair(item)); + } + clusterSettings = array; + continue; + } + if (property0.NameEquals("userWhitelistedIpRanges")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + userWhitelistedIpRanges = array; + continue; + } + if (property0.NameEquals("hasLinuxWorkers")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hasLinuxWorkers = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("dedicatedHostCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + dedicatedHostCount = property0.Value.GetInt32(); + continue; + } + } + continue; + } + } + return new AppServiceEnvironmentPatchResource(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork.Value, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipsslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIpRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(dedicatedHostCount)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs index bf9e55680b03..bd0c5cb634a9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs @@ -1,469 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// ARM resource for a app service environment. - /// - [Rest.Serialization.JsonTransformation] + /// ARM resource for a app service environment. public partial class AppServiceEnvironmentPatchResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the - /// AppServiceEnvironmentPatchResource class. - /// + /// Initializes a new instance of AppServiceEnvironmentPatchResource. public AppServiceEnvironmentPatchResource() { - CustomInit(); + ClusterSettings = new ChangeTrackingList(); + UserWhitelistedIpRanges = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the - /// AppServiceEnvironmentPatchResource class. - /// - /// Name of the - /// App Service Environment. - /// Location of the App Service Environment, - /// e.g. "West US". - /// Description of the Virtual - /// Network. - /// Description of worker pools with worker - /// size IDs, VM sizes, and number of workers in each pool. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Provisioning state of the App - /// Service Environment. Possible values include: 'Succeeded', - /// 'Failed', 'Canceled', 'InProgress', 'Deleting' - /// Current status of the App Service Environment. - /// Possible values include: 'Preparing', 'Ready', 'Scaling', - /// 'Deleting' - /// Name of the Virtual Network for the App - /// Service Environment. - /// Resource group of the Virtual - /// Network. - /// Subnet of the Virtual Network. - /// Specifies which endpoints - /// to serve internally in the Virtual Network for the App Service - /// Environment. Possible values include: 'None', 'Web', 'Publishing', - /// 'Web,Publishing' - /// Front-end VM size, e.g. "Medium", - /// "Large". - /// Number of front-end instances. - /// Number of IP SSL addresses reserved - /// for the App Service Environment. - /// Edition of the metadata database for - /// the App Service Environment, e.g. "Standard". - /// Service objective of the - /// metadata database for the App Service Environment, e.g. - /// "S0". - /// Number of upgrade domains of the App - /// Service Environment. - /// Subscription of the App Service - /// Environment. - /// DNS suffix of the App Service - /// Environment. - /// Last deployment action on the App Service - /// Environment. - /// Result of the last deployment action - /// on the App Service Environment. - /// List of comma separated strings - /// describing which VM sizes are allowed for front-ends. - /// List of comma separated strings - /// describing which VM sizes are allowed for workers. - /// Maximum number of VMs in the - /// App Service Environment. - /// Description of IP SSL mapping for the App - /// Service Environment. - /// Current total, used, and - /// available worker capacities. - /// Access control list for - /// controlling traffic to the App Service Environment. - /// True/false indicating whether - /// the App Service Environment is healthy. - /// Detailed message about with results - /// of the last check of the App Service Environment. - /// Resource group of the App Service - /// Environment. - /// Scale factor for - /// front-ends. - /// Default Scale Factor for - /// FrontEnds. - /// API Management Account - /// associated with the App Service Environment. - /// <code>true</code> if the App - /// Service Environment is suspended; otherwise, - /// <code>false</code>. The environment can be suspended, - /// e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// True/false indicating whether the - /// App Service Environment is suspended. The environment can be - /// suspended e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// Custom settings for changing the - /// behavior of the App Service Environment. - /// User added ip ranges to - /// whitelist on ASE db - /// Flag that displays whether an ASE has - /// linux workers or not - /// Key Vault ID for ILB App Service - /// Environment default SSL certificate - /// Key Vault Secret Name for - /// ILB App Service Environment default SSL certificate - public AppServiceEnvironmentPatchResource(string appServiceEnvironmentPatchResourceName, string location, VirtualNetworkProfile virtualNetwork, IList workerPools, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of AppServiceEnvironmentPatchResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Provisioning state of the App Service Environment. + /// Current status of the App Service Environment. + /// Description of the Virtual Network. + /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. + /// Front-end VM size, e.g. "Medium", "Large". + /// Number of front-end instances. + /// Number of IP SSL addresses reserved for the App Service Environment. + /// DNS suffix of the App Service Environment. + /// Maximum number of VMs in the App Service Environment. + /// Scale factor for front-ends. + /// + /// <code>true</code> if the App Service Environment is suspended; otherwise, <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// + /// Custom settings for changing the behavior of the App Service Environment. + /// User added ip ranges to whitelist on ASE db. + /// Flag that displays whether an ASE has linux workers or not. + /// Dedicated Host Count. + internal AppServiceEnvironmentPatchResource(string id, string name, string kind, string type, ProvisioningState? provisioningState, HostingEnvironmentStatus? status, VirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipsslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? suspended, IList clusterSettings, IList userWhitelistedIpRanges, bool? hasLinuxWorkers, int? dedicatedHostCount) : base(id, name, kind, type) { - AppServiceEnvironmentPatchResourceName = appServiceEnvironmentPatchResourceName; - Location = location; ProvisioningState = provisioningState; Status = status; - VnetName = vnetName; - VnetResourceGroupName = vnetResourceGroupName; - VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; - WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; - DatabaseEdition = databaseEdition; - DatabaseServiceObjective = databaseServiceObjective; - UpgradeDomains = upgradeDomains; - SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; - LastAction = lastAction; - LastActionResult = lastActionResult; - AllowedMultiSizes = allowedMultiSizes; - AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; - VipMappings = vipMappings; - EnvironmentCapacities = environmentCapacities; - NetworkAccessControlList = networkAccessControlList; - EnvironmentIsHealthy = environmentIsHealthy; - EnvironmentStatus = environmentStatus; - ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; - DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; - ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; - DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - SslCertKeyVaultId = sslCertKeyVaultId; - SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; - CustomInit(); + DedicatedHostCount = dedicatedHostCount; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.name")] - public string AppServiceEnvironmentPatchResourceName { get; set; } - - /// - /// Gets or sets location of the App Service Environment, e.g. "West - /// US". - /// - [JsonProperty(PropertyName = "properties.location")] - public string Location { get; set; } - - /// - /// Gets provisioning state of the App Service Environment. Possible - /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', - /// 'Deleting' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public ProvisioningState? ProvisioningState { get; private set; } - - /// - /// Gets current status of the App Service Environment. Possible values - /// include: 'Preparing', 'Ready', 'Scaling', 'Deleting' - /// - [JsonProperty(PropertyName = "properties.status")] - public HostingEnvironmentStatus? Status { get; private set; } - - /// - /// Gets or sets name of the Virtual Network for the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.vnetName")] - public string VnetName { get; set; } - - /// - /// Gets or sets resource group of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.vnetResourceGroupName")] - public string VnetResourceGroupName { get; set; } - - /// - /// Gets or sets subnet of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.vnetSubnetName")] - public string VnetSubnetName { get; set; } - - /// - /// Gets or sets description of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.virtualNetwork")] + /// Provisioning state of the App Service Environment. + public ProvisioningState? ProvisioningState { get; } + /// Current status of the App Service Environment. + public HostingEnvironmentStatus? Status { get; } + /// Description of the Virtual Network. public VirtualNetworkProfile VirtualNetwork { get; set; } - - /// - /// Gets or sets specifies which endpoints to serve internally in the - /// Virtual Network for the App Service Environment. Possible values - /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' - /// - [JsonProperty(PropertyName = "properties.internalLoadBalancingMode")] - public string InternalLoadBalancingMode { get; set; } - - /// - /// Gets or sets front-end VM size, e.g. "Medium", "Large". - /// - [JsonProperty(PropertyName = "properties.multiSize")] + /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. + public LoadBalancingMode? InternalLoadBalancingMode { get; set; } + /// Front-end VM size, e.g. "Medium", "Large". public string MultiSize { get; set; } - - /// - /// Gets or sets number of front-end instances. - /// - [JsonProperty(PropertyName = "properties.multiRoleCount")] - public int? MultiRoleCount { get; set; } - - /// - /// Gets or sets description of worker pools with worker size IDs, VM - /// sizes, and number of workers in each pool. - /// - [JsonProperty(PropertyName = "properties.workerPools")] - public IList WorkerPools { get; set; } - - /// - /// Gets or sets number of IP SSL addresses reserved for the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "properties.ipsslAddressCount")] + /// Number of front-end instances. + public int? MultiRoleCount { get; } + /// Number of IP SSL addresses reserved for the App Service Environment. public int? IpsslAddressCount { get; set; } - - /// - /// Gets edition of the metadata database for the App Service - /// Environment, e.g. "Standard". - /// - [JsonProperty(PropertyName = "properties.databaseEdition")] - public string DatabaseEdition { get; private set; } - - /// - /// Gets service objective of the metadata database for the App Service - /// Environment, e.g. "S0". - /// - [JsonProperty(PropertyName = "properties.databaseServiceObjective")] - public string DatabaseServiceObjective { get; private set; } - - /// - /// Gets number of upgrade domains of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.upgradeDomains")] - public int? UpgradeDomains { get; private set; } - - /// - /// Gets subscription of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.subscriptionId")] - public string SubscriptionId { get; private set; } - - /// - /// Gets or sets DNS suffix of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.dnsSuffix")] + /// DNS suffix of the App Service Environment. public string DnsSuffix { get; set; } - - /// - /// Gets last deployment action on the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.lastAction")] - public string LastAction { get; private set; } - - /// - /// Gets result of the last deployment action on the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.lastActionResult")] - public string LastActionResult { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for front-ends. - /// - [JsonProperty(PropertyName = "properties.allowedMultiSizes")] - public string AllowedMultiSizes { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for workers. - /// - [JsonProperty(PropertyName = "properties.allowedWorkerSizes")] - public string AllowedWorkerSizes { get; private set; } - - /// - /// Gets maximum number of VMs in the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.maximumNumberOfMachines")] - public int? MaximumNumberOfMachines { get; private set; } - - /// - /// Gets description of IP SSL mapping for the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.vipMappings")] - public IList VipMappings { get; private set; } - - /// - /// Gets current total, used, and available worker capacities. - /// - [JsonProperty(PropertyName = "properties.environmentCapacities")] - public IList EnvironmentCapacities { get; private set; } - - /// - /// Gets or sets access control list for controlling traffic to the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "properties.networkAccessControlList")] - public IList NetworkAccessControlList { get; set; } - - /// - /// Gets true/false indicating whether the App Service Environment is - /// healthy. - /// - [JsonProperty(PropertyName = "properties.environmentIsHealthy")] - public bool? EnvironmentIsHealthy { get; private set; } - - /// - /// Gets detailed message about with results of the last check of the - /// App Service Environment. - /// - [JsonProperty(PropertyName = "properties.environmentStatus")] - public string EnvironmentStatus { get; private set; } - - /// - /// Gets resource group of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.resourceGroup")] - public string ResourceGroup { get; private set; } - - /// - /// Gets or sets scale factor for front-ends. - /// - [JsonProperty(PropertyName = "properties.frontEndScaleFactor")] + /// Maximum number of VMs in the App Service Environment. + public int? MaximumNumberOfMachines { get; } + /// Scale factor for front-ends. public int? FrontEndScaleFactor { get; set; } - - /// - /// Gets default Scale Factor for FrontEnds. - /// - [JsonProperty(PropertyName = "properties.defaultFrontEndScaleFactor")] - public int? DefaultFrontEndScaleFactor { get; private set; } - - /// - /// Gets or sets API Management Account associated with the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.apiManagementAccountId")] - public string ApiManagementAccountId { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// App Service Environment is suspended; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. The environment can - /// be suspended, e.g. when the management endpoint is no longer - /// available - /// (most likely because NSG blocked the incoming traffic). - /// - [JsonProperty(PropertyName = "properties.suspended")] - public bool? Suspended { get; set; } - - /// - /// Gets or sets true/false indicating whether the App Service - /// Environment is suspended. The environment can be suspended e.g. - /// when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - [JsonProperty(PropertyName = "properties.dynamicCacheEnabled")] - public bool? DynamicCacheEnabled { get; set; } - - /// - /// Gets or sets custom settings for changing the behavior of the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "properties.clusterSettings")] - public IList ClusterSettings { get; set; } - - /// - /// Gets or sets user added ip ranges to whitelist on ASE db - /// - [JsonProperty(PropertyName = "properties.userWhitelistedIpRanges")] - public IList UserWhitelistedIpRanges { get; set; } - - /// - /// Gets or sets flag that displays whether an ASE has linux workers or - /// not - /// - [JsonProperty(PropertyName = "properties.hasLinuxWorkers")] - public bool? HasLinuxWorkers { get; set; } - - /// - /// Gets or sets key Vault ID for ILB App Service Environment default - /// SSL certificate - /// - [JsonProperty(PropertyName = "properties.sslCertKeyVaultId")] - public string SslCertKeyVaultId { get; set; } - - /// - /// Gets or sets key Vault Secret Name for ILB App Service Environment - /// default SSL certificate - /// - [JsonProperty(PropertyName = "properties.sslCertKeyVaultSecretName")] - public string SslCertKeyVaultSecretName { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AppServiceEnvironmentPatchResourceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentPatchResourceName"); - } - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - if (VirtualNetwork == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); - } - if (WorkerPools == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); - } - } + /// <code>true</code> if the App Service Environment is suspended; otherwise, <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// + public bool? Suspended { get; } + /// Custom settings for changing the behavior of the App Service Environment. + public IList ClusterSettings { get; } + /// User added ip ranges to whitelist on ASE db. + public IList UserWhitelistedIpRanges { get; } + /// Flag that displays whether an ASE has linux workers or not. + public bool? HasLinuxWorkers { get; } + /// Dedicated Host Count. + public int? DedicatedHostCount { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.Serialization.cs new file mode 100644 index 000000000000..a6597f6e3aa3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.Serialization.cs @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppServiceEnvironmentResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(VirtualNetwork)) + { + writer.WritePropertyName("virtualNetwork"); + writer.WriteObjectValue(VirtualNetwork); + } + if (Optional.IsDefined(InternalLoadBalancingMode)) + { + writer.WritePropertyName("internalLoadBalancingMode"); + writer.WriteStringValue(InternalLoadBalancingMode.Value.ToString()); + } + if (Optional.IsDefined(MultiSize)) + { + writer.WritePropertyName("multiSize"); + writer.WriteStringValue(MultiSize); + } + if (Optional.IsDefined(IpsslAddressCount)) + { + writer.WritePropertyName("ipsslAddressCount"); + writer.WriteNumberValue(IpsslAddressCount.Value); + } + if (Optional.IsDefined(DnsSuffix)) + { + writer.WritePropertyName("dnsSuffix"); + writer.WriteStringValue(DnsSuffix); + } + if (Optional.IsDefined(FrontEndScaleFactor)) + { + writer.WritePropertyName("frontEndScaleFactor"); + writer.WriteNumberValue(FrontEndScaleFactor.Value); + } + if (Optional.IsCollectionDefined(ClusterSettings)) + { + writer.WritePropertyName("clusterSettings"); + writer.WriteStartArray(); + foreach (var item in ClusterSettings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(UserWhitelistedIpRanges)) + { + writer.WritePropertyName("userWhitelistedIpRanges"); + writer.WriteStartArray(); + foreach (var item in UserWhitelistedIpRanges) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AppServiceEnvironmentResource DeserializeAppServiceEnvironmentResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + string location = default; + Optional type = default; + Optional> tags = default; + Optional provisioningState = default; + Optional status = default; + Optional virtualNetwork = default; + Optional internalLoadBalancingMode = default; + Optional multiSize = default; + Optional multiRoleCount = default; + Optional ipsslAddressCount = default; + Optional dnsSuffix = default; + Optional maximumNumberOfMachines = default; + Optional frontEndScaleFactor = default; + Optional suspended = default; + Optional> clusterSettings = default; + Optional> userWhitelistedIpRanges = default; + Optional hasLinuxWorkers = default; + Optional dedicatedHostCount = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property0.Value.GetString().ToProvisioningState(); + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property0.Value.GetString().ToHostingEnvironmentStatus(); + continue; + } + if (property0.NameEquals("virtualNetwork")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + virtualNetwork = VirtualNetworkProfile.DeserializeVirtualNetworkProfile(property0.Value); + continue; + } + if (property0.NameEquals("internalLoadBalancingMode")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + internalLoadBalancingMode = new LoadBalancingMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("multiSize")) + { + multiSize = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("multiRoleCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + multiRoleCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("ipsslAddressCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + ipsslAddressCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("dnsSuffix")) + { + dnsSuffix = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("maximumNumberOfMachines")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + maximumNumberOfMachines = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("frontEndScaleFactor")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + frontEndScaleFactor = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("suspended")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + suspended = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("clusterSettings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(NameValuePair.DeserializeNameValuePair(item)); + } + clusterSettings = array; + continue; + } + if (property0.NameEquals("userWhitelistedIpRanges")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + userWhitelistedIpRanges = array; + continue; + } + if (property0.NameEquals("hasLinuxWorkers")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hasLinuxWorkers = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("dedicatedHostCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + dedicatedHostCount = property0.Value.GetInt32(); + continue; + } + } + continue; + } + } + return new AppServiceEnvironmentResource(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork.Value, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipsslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIpRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(dedicatedHostCount)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs index 910c484a40d3..d04fff939fd8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs @@ -1,472 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// App Service Environment ARM resource. - /// - [Rest.Serialization.JsonTransformation] + /// App Service Environment ARM resource. public partial class AppServiceEnvironmentResource : Resource { - /// - /// Initializes a new instance of the AppServiceEnvironmentResource - /// class. - /// - public AppServiceEnvironmentResource() + /// Initializes a new instance of AppServiceEnvironmentResource. + /// Resource Location. + /// is null. + public AppServiceEnvironmentResource(string location) : base(location) { - CustomInit(); + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + ClusterSettings = new ChangeTrackingList(); + UserWhitelistedIpRanges = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the AppServiceEnvironmentResource - /// class. - /// - /// Resource Location. - /// Name of the App - /// Service Environment. - /// Location of the - /// App Service Environment, e.g. "West US". - /// Description of the Virtual - /// Network. - /// Description of worker pools with worker - /// size IDs, VM sizes, and number of workers in each pool. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Resource tags. - /// Provisioning state of the App - /// Service Environment. Possible values include: 'Succeeded', - /// 'Failed', 'Canceled', 'InProgress', 'Deleting' - /// Current status of the App Service Environment. - /// Possible values include: 'Preparing', 'Ready', 'Scaling', - /// 'Deleting' - /// Name of the Virtual Network for the App - /// Service Environment. - /// Resource group of the Virtual - /// Network. - /// Subnet of the Virtual Network. - /// Specifies which endpoints - /// to serve internally in the Virtual Network for the App Service - /// Environment. Possible values include: 'None', 'Web', 'Publishing', - /// 'Web,Publishing' - /// Front-end VM size, e.g. "Medium", - /// "Large". - /// Number of front-end instances. - /// Number of IP SSL addresses reserved - /// for the App Service Environment. - /// Edition of the metadata database for - /// the App Service Environment, e.g. "Standard". - /// Service objective of the - /// metadata database for the App Service Environment, e.g. - /// "S0". - /// Number of upgrade domains of the App - /// Service Environment. - /// Subscription of the App Service - /// Environment. - /// DNS suffix of the App Service - /// Environment. - /// Last deployment action on the App Service - /// Environment. - /// Result of the last deployment action - /// on the App Service Environment. - /// List of comma separated strings - /// describing which VM sizes are allowed for front-ends. - /// List of comma separated strings - /// describing which VM sizes are allowed for workers. - /// Maximum number of VMs in the - /// App Service Environment. - /// Description of IP SSL mapping for the App - /// Service Environment. - /// Current total, used, and - /// available worker capacities. - /// Access control list for - /// controlling traffic to the App Service Environment. - /// True/false indicating whether - /// the App Service Environment is healthy. - /// Detailed message about with results - /// of the last check of the App Service Environment. - /// Resource group of the App Service - /// Environment. - /// Scale factor for - /// front-ends. - /// Default Scale Factor for - /// FrontEnds. - /// API Management Account - /// associated with the App Service Environment. - /// <code>true</code> if the App - /// Service Environment is suspended; otherwise, - /// <code>false</code>. The environment can be suspended, - /// e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// True/false indicating whether the - /// App Service Environment is suspended. The environment can be - /// suspended e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// Custom settings for changing the - /// behavior of the App Service Environment. - /// User added ip ranges to - /// whitelist on ASE db - /// Flag that displays whether an ASE has - /// linux workers or not - /// Key Vault ID for ILB App Service - /// Environment default SSL certificate - /// Key Vault Secret Name for - /// ILB App Service Environment default SSL certificate - public AppServiceEnvironmentResource(string location, string appServiceEnvironmentResourceName, string appServiceEnvironmentResourceLocation, VirtualNetworkProfile virtualNetwork, IList workerPools, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) - : base(location, id, name, kind, type, tags) + /// Initializes a new instance of AppServiceEnvironmentResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource Location. + /// Resource type. + /// Resource tags. + /// Provisioning state of the App Service Environment. + /// Current status of the App Service Environment. + /// Description of the Virtual Network. + /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. + /// Front-end VM size, e.g. "Medium", "Large". + /// Number of front-end instances. + /// Number of IP SSL addresses reserved for the App Service Environment. + /// DNS suffix of the App Service Environment. + /// Maximum number of VMs in the App Service Environment. + /// Scale factor for front-ends. + /// + /// <code>true</code> if the App Service Environment is suspended; otherwise, <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// + /// Custom settings for changing the behavior of the App Service Environment. + /// User added ip ranges to whitelist on ASE db. + /// Flag that displays whether an ASE has linux workers or not. + /// Dedicated Host Count. + internal AppServiceEnvironmentResource(string id, string name, string kind, string location, string type, IDictionary tags, ProvisioningState? provisioningState, HostingEnvironmentStatus? status, VirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipsslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? suspended, IList clusterSettings, IList userWhitelistedIpRanges, bool? hasLinuxWorkers, int? dedicatedHostCount) : base(id, name, kind, location, type, tags) { - AppServiceEnvironmentResourceName = appServiceEnvironmentResourceName; - AppServiceEnvironmentResourceLocation = appServiceEnvironmentResourceLocation; ProvisioningState = provisioningState; Status = status; - VnetName = vnetName; - VnetResourceGroupName = vnetResourceGroupName; - VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; - WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; - DatabaseEdition = databaseEdition; - DatabaseServiceObjective = databaseServiceObjective; - UpgradeDomains = upgradeDomains; - SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; - LastAction = lastAction; - LastActionResult = lastActionResult; - AllowedMultiSizes = allowedMultiSizes; - AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; - VipMappings = vipMappings; - EnvironmentCapacities = environmentCapacities; - NetworkAccessControlList = networkAccessControlList; - EnvironmentIsHealthy = environmentIsHealthy; - EnvironmentStatus = environmentStatus; - ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; - DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; - ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; - DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - SslCertKeyVaultId = sslCertKeyVaultId; - SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; - CustomInit(); + DedicatedHostCount = dedicatedHostCount; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.name")] - public string AppServiceEnvironmentResourceName { get; set; } - - /// - /// Gets or sets location of the App Service Environment, e.g. "West - /// US". - /// - [JsonProperty(PropertyName = "properties.location")] - public string AppServiceEnvironmentResourceLocation { get; set; } - - /// - /// Gets provisioning state of the App Service Environment. Possible - /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', - /// 'Deleting' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public ProvisioningState? ProvisioningState { get; private set; } - - /// - /// Gets current status of the App Service Environment. Possible values - /// include: 'Preparing', 'Ready', 'Scaling', 'Deleting' - /// - [JsonProperty(PropertyName = "properties.status")] - public HostingEnvironmentStatus? Status { get; private set; } - - /// - /// Gets or sets name of the Virtual Network for the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.vnetName")] - public string VnetName { get; set; } - - /// - /// Gets or sets resource group of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.vnetResourceGroupName")] - public string VnetResourceGroupName { get; set; } - - /// - /// Gets or sets subnet of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.vnetSubnetName")] - public string VnetSubnetName { get; set; } - - /// - /// Gets or sets description of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.virtualNetwork")] + /// Provisioning state of the App Service Environment. + public ProvisioningState? ProvisioningState { get; } + /// Current status of the App Service Environment. + public HostingEnvironmentStatus? Status { get; } + /// Description of the Virtual Network. public VirtualNetworkProfile VirtualNetwork { get; set; } - - /// - /// Gets or sets specifies which endpoints to serve internally in the - /// Virtual Network for the App Service Environment. Possible values - /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' - /// - [JsonProperty(PropertyName = "properties.internalLoadBalancingMode")] - public string InternalLoadBalancingMode { get; set; } - - /// - /// Gets or sets front-end VM size, e.g. "Medium", "Large". - /// - [JsonProperty(PropertyName = "properties.multiSize")] + /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. + public LoadBalancingMode? InternalLoadBalancingMode { get; set; } + /// Front-end VM size, e.g. "Medium", "Large". public string MultiSize { get; set; } - - /// - /// Gets or sets number of front-end instances. - /// - [JsonProperty(PropertyName = "properties.multiRoleCount")] - public int? MultiRoleCount { get; set; } - - /// - /// Gets or sets description of worker pools with worker size IDs, VM - /// sizes, and number of workers in each pool. - /// - [JsonProperty(PropertyName = "properties.workerPools")] - public IList WorkerPools { get; set; } - - /// - /// Gets or sets number of IP SSL addresses reserved for the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "properties.ipsslAddressCount")] + /// Number of front-end instances. + public int? MultiRoleCount { get; } + /// Number of IP SSL addresses reserved for the App Service Environment. public int? IpsslAddressCount { get; set; } - - /// - /// Gets edition of the metadata database for the App Service - /// Environment, e.g. "Standard". - /// - [JsonProperty(PropertyName = "properties.databaseEdition")] - public string DatabaseEdition { get; private set; } - - /// - /// Gets service objective of the metadata database for the App Service - /// Environment, e.g. "S0". - /// - [JsonProperty(PropertyName = "properties.databaseServiceObjective")] - public string DatabaseServiceObjective { get; private set; } - - /// - /// Gets number of upgrade domains of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.upgradeDomains")] - public int? UpgradeDomains { get; private set; } - - /// - /// Gets subscription of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.subscriptionId")] - public string SubscriptionId { get; private set; } - - /// - /// Gets or sets DNS suffix of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.dnsSuffix")] + /// DNS suffix of the App Service Environment. public string DnsSuffix { get; set; } - - /// - /// Gets last deployment action on the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.lastAction")] - public string LastAction { get; private set; } - - /// - /// Gets result of the last deployment action on the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.lastActionResult")] - public string LastActionResult { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for front-ends. - /// - [JsonProperty(PropertyName = "properties.allowedMultiSizes")] - public string AllowedMultiSizes { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for workers. - /// - [JsonProperty(PropertyName = "properties.allowedWorkerSizes")] - public string AllowedWorkerSizes { get; private set; } - - /// - /// Gets maximum number of VMs in the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.maximumNumberOfMachines")] - public int? MaximumNumberOfMachines { get; private set; } - - /// - /// Gets description of IP SSL mapping for the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.vipMappings")] - public IList VipMappings { get; private set; } - - /// - /// Gets current total, used, and available worker capacities. - /// - [JsonProperty(PropertyName = "properties.environmentCapacities")] - public IList EnvironmentCapacities { get; private set; } - - /// - /// Gets or sets access control list for controlling traffic to the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "properties.networkAccessControlList")] - public IList NetworkAccessControlList { get; set; } - - /// - /// Gets true/false indicating whether the App Service Environment is - /// healthy. - /// - [JsonProperty(PropertyName = "properties.environmentIsHealthy")] - public bool? EnvironmentIsHealthy { get; private set; } - - /// - /// Gets detailed message about with results of the last check of the - /// App Service Environment. - /// - [JsonProperty(PropertyName = "properties.environmentStatus")] - public string EnvironmentStatus { get; private set; } - - /// - /// Gets resource group of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.resourceGroup")] - public string ResourceGroup { get; private set; } - - /// - /// Gets or sets scale factor for front-ends. - /// - [JsonProperty(PropertyName = "properties.frontEndScaleFactor")] + /// Maximum number of VMs in the App Service Environment. + public int? MaximumNumberOfMachines { get; } + /// Scale factor for front-ends. public int? FrontEndScaleFactor { get; set; } - - /// - /// Gets default Scale Factor for FrontEnds. - /// - [JsonProperty(PropertyName = "properties.defaultFrontEndScaleFactor")] - public int? DefaultFrontEndScaleFactor { get; private set; } - /// - /// Gets or sets API Management Account associated with the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.apiManagementAccountId")] - public string ApiManagementAccountId { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// App Service Environment is suspended; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. The environment can - /// be suspended, e.g. when the management endpoint is no longer - /// available - /// (most likely because NSG blocked the incoming traffic). - /// - [JsonProperty(PropertyName = "properties.suspended")] - public bool? Suspended { get; set; } - - /// - /// Gets or sets true/false indicating whether the App Service - /// Environment is suspended. The environment can be suspended e.g. - /// when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - [JsonProperty(PropertyName = "properties.dynamicCacheEnabled")] - public bool? DynamicCacheEnabled { get; set; } - - /// - /// Gets or sets custom settings for changing the behavior of the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "properties.clusterSettings")] - public IList ClusterSettings { get; set; } - - /// - /// Gets or sets user added ip ranges to whitelist on ASE db - /// - [JsonProperty(PropertyName = "properties.userWhitelistedIpRanges")] - public IList UserWhitelistedIpRanges { get; set; } - - /// - /// Gets or sets flag that displays whether an ASE has linux workers or - /// not - /// - [JsonProperty(PropertyName = "properties.hasLinuxWorkers")] - public bool? HasLinuxWorkers { get; set; } - - /// - /// Gets or sets key Vault ID for ILB App Service Environment default - /// SSL certificate - /// - [JsonProperty(PropertyName = "properties.sslCertKeyVaultId")] - public string SslCertKeyVaultId { get; set; } - - /// - /// Gets or sets key Vault Secret Name for ILB App Service Environment - /// default SSL certificate - /// - [JsonProperty(PropertyName = "properties.sslCertKeyVaultSecretName")] - public string SslCertKeyVaultSecretName { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (AppServiceEnvironmentResourceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentResourceName"); - } - if (AppServiceEnvironmentResourceLocation == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentResourceLocation"); - } - if (VirtualNetwork == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); - } - if (WorkerPools == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); - } - } + /// <code>true</code> if the App Service Environment is suspended; otherwise, <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// + public bool? Suspended { get; } + /// Custom settings for changing the behavior of the App Service Environment. + public IList ClusterSettings { get; } + /// User added ip ranges to whitelist on ASE db. + public IList UserWhitelistedIpRanges { get; } + /// Flag that displays whether an ASE has linux workers or not. + public bool? HasLinuxWorkers { get; } + /// Dedicated Host Count. + public int? DedicatedHostCount { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.Serialization.cs new file mode 100644 index 000000000000..0f81eb1ed486 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.Serialization.cs @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppServicePlan : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"); + writer.WriteObjectValue(Sku); + } + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(WorkerTierName)) + { + writer.WritePropertyName("workerTierName"); + writer.WriteStringValue(WorkerTierName); + } + if (Optional.IsDefined(HostingEnvironmentProfile)) + { + writer.WritePropertyName("hostingEnvironmentProfile"); + writer.WriteObjectValue(HostingEnvironmentProfile); + } + if (Optional.IsDefined(PerSiteScaling)) + { + writer.WritePropertyName("perSiteScaling"); + writer.WriteBooleanValue(PerSiteScaling.Value); + } + if (Optional.IsDefined(MaximumElasticWorkerCount)) + { + writer.WritePropertyName("maximumElasticWorkerCount"); + writer.WriteNumberValue(MaximumElasticWorkerCount.Value); + } + if (Optional.IsDefined(IsSpot)) + { + writer.WritePropertyName("isSpot"); + writer.WriteBooleanValue(IsSpot.Value); + } + if (Optional.IsDefined(SpotExpirationTime)) + { + writer.WritePropertyName("spotExpirationTime"); + writer.WriteStringValue(SpotExpirationTime.Value, "O"); + } + if (Optional.IsDefined(FreeOfferExpirationTime)) + { + writer.WritePropertyName("freeOfferExpirationTime"); + writer.WriteStringValue(FreeOfferExpirationTime.Value, "O"); + } + if (Optional.IsDefined(Reserved)) + { + writer.WritePropertyName("reserved"); + writer.WriteBooleanValue(Reserved.Value); + } + if (Optional.IsDefined(IsXenon)) + { + writer.WritePropertyName("isXenon"); + writer.WriteBooleanValue(IsXenon.Value); + } + if (Optional.IsDefined(HyperV)) + { + writer.WritePropertyName("hyperV"); + writer.WriteBooleanValue(HyperV.Value); + } + if (Optional.IsDefined(TargetWorkerCount)) + { + writer.WritePropertyName("targetWorkerCount"); + writer.WriteNumberValue(TargetWorkerCount.Value); + } + if (Optional.IsDefined(TargetWorkerSizeId)) + { + writer.WritePropertyName("targetWorkerSizeId"); + writer.WriteNumberValue(TargetWorkerSizeId.Value); + } + if (Optional.IsDefined(KubeEnvironmentProfile)) + { + writer.WritePropertyName("kubeEnvironmentProfile"); + writer.WriteObjectValue(KubeEnvironmentProfile); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AppServicePlan DeserializeAppServicePlan(JsonElement element) + { + Optional sku = default; + Optional id = default; + Optional name = default; + Optional kind = default; + string location = default; + Optional type = default; + Optional> tags = default; + Optional workerTierName = default; + Optional status = default; + Optional subscription = default; + Optional hostingEnvironmentProfile = default; + Optional maximumNumberOfWorkers = default; + Optional geoRegion = default; + Optional perSiteScaling = default; + Optional maximumElasticWorkerCount = default; + Optional numberOfSites = default; + Optional isSpot = default; + Optional spotExpirationTime = default; + Optional freeOfferExpirationTime = default; + Optional resourceGroup = default; + Optional reserved = default; + Optional isXenon = default; + Optional hyperV = default; + Optional targetWorkerCount = default; + Optional targetWorkerSizeId = default; + Optional provisioningState = default; + Optional kubeEnvironmentProfile = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sku")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + sku = SkuDescription.DeserializeSkuDescription(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("workerTierName")) + { + workerTierName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property0.Value.GetString().ToStatusOptions(); + continue; + } + if (property0.NameEquals("subscription")) + { + subscription = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostingEnvironmentProfile")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); + continue; + } + if (property0.NameEquals("maximumNumberOfWorkers")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + maximumNumberOfWorkers = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("geoRegion")) + { + geoRegion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("perSiteScaling")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + perSiteScaling = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("maximumElasticWorkerCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + maximumElasticWorkerCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("numberOfSites")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfSites = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("isSpot")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isSpot = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("spotExpirationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + spotExpirationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("freeOfferExpirationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + freeOfferExpirationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("resourceGroup")) + { + resourceGroup = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("reserved")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + reserved = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("isXenon")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isXenon = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("hyperV")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hyperV = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("targetWorkerCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + targetWorkerCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("targetWorkerSizeId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + targetWorkerSizeId = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property0.Value.GetString().ToProvisioningState(); + continue; + } + if (property0.NameEquals("kubeEnvironmentProfile")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + kubeEnvironmentProfile = KubeEnvironmentProfile.DeserializeKubeEnvironmentProfile(property0.Value); + continue; + } + } + continue; + } + } + return new AppServicePlan(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), sku.Value, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(maximumElasticWorkerCount), Optional.ToNullable(numberOfSites), Optional.ToNullable(isSpot), Optional.ToNullable(spotExpirationTime), Optional.ToNullable(freeOfferExpirationTime), resourceGroup.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(targetWorkerCount), Optional.ToNullable(targetWorkerSizeId), Optional.ToNullable(provisioningState), kubeEnvironmentProfile.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs index 6f5f763da3eb..a586a8578ab5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs @@ -1,90 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// App Service plan. - /// - [Rest.Serialization.JsonTransformation] + /// App Service plan. public partial class AppServicePlan : Resource { - /// - /// Initializes a new instance of the AppServicePlan class. - /// - public AppServicePlan() + /// Initializes a new instance of AppServicePlan. + /// Resource Location. + /// is null. + public AppServicePlan(string location) : base(location) { - CustomInit(); + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } } - /// - /// Initializes a new instance of the AppServicePlan class. - /// - /// Resource Location. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Resource tags. - /// Target worker tier assigned to the App - /// Service plan. - /// App Service plan status. Possible values - /// include: 'Ready', 'Pending', 'Creating' - /// App Service plan subscription. - /// Specification for the App - /// Service Environment to use for the App Service plan. - /// Maximum number of instances - /// that can be assigned to this App Service plan. - /// Geographical location for the App Service - /// plan. - /// If <code>true</code>, apps - /// assigned to this App Service plan can be scaled independently. - /// If <code>false</code>, apps assigned to this App - /// Service plan will scale to all instances of the plan. - /// Maximum number of total - /// workers allowed for this ElasticScaleEnabled App Service - /// Plan - /// Number of apps assigned to this App - /// Service plan. - /// If <code>true</code>, this App - /// Service Plan owns spot instances. - /// The time when the server farm - /// expires. Valid only if it is a spot server farm. - /// The time when the server farm - /// free offer expires. - /// Resource group of the App Service - /// plan. - /// If Linux app service plan - /// <code>true</code>, <code>false</code> - /// otherwise. - /// Obsolete: If Hyper-V container app service - /// plan <code>true</code>, <code>false</code> - /// otherwise. - /// If Hyper-V container app service plan - /// <code>true</code>, <code>false</code> - /// otherwise. - /// Scaling worker count. - /// Scaling worker size ID. - /// Provisioning state of the App - /// Service Environment. Possible values include: 'Succeeded', - /// 'Failed', 'Canceled', 'InProgress', 'Deleting' - public AppServicePlan(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), SkuDescription sku = default(SkuDescription)) - : base(location, id, name, kind, type, tags) + /// Initializes a new instance of AppServicePlan. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource Location. + /// Resource type. + /// Resource tags. + /// Description of a SKU for a scalable resource. + /// Target worker tier assigned to the App Service plan. + /// App Service plan status. + /// App Service plan subscription. + /// Specification for the App Service Environment to use for the App Service plan. + /// Maximum number of instances that can be assigned to this App Service plan. + /// Geographical location for the App Service plan. + /// + /// If <code>true</code>, apps assigned to this App Service plan can be scaled independently. + /// If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the plan. + /// + /// Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan. + /// Number of apps assigned to this App Service plan. + /// If <code>true</code>, this App Service Plan owns spot instances. + /// The time when the server farm expires. Valid only if it is a spot server farm. + /// The time when the server farm free offer expires. + /// Resource group of the App Service plan. + /// If Linux app service plan <code>true</code>, <code>false</code> otherwise. + /// Obsolete: If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. + /// If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. + /// Scaling worker count. + /// Scaling worker size ID. + /// Provisioning state of the App Service Plan. + /// Specification for the Kubernetes Environment to use for the App Service plan. + internal AppServicePlan(string id, string name, string kind, string location, string type, IDictionary tags, SkuDescription sku, string workerTierName, StatusOptions? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, string geoRegion, bool? perSiteScaling, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpirationTime, DateTimeOffset? freeOfferExpirationTime, string resourceGroup, bool? reserved, bool? isXenon, bool? hyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile) : base(id, name, kind, location, type, tags) { + Sku = sku; WorkerTierName = workerTierName; Status = status; Subscription = subscription; @@ -104,160 +77,53 @@ public AppServicePlan() TargetWorkerCount = targetWorkerCount; TargetWorkerSizeId = targetWorkerSizeId; ProvisioningState = provisioningState; - Sku = sku; - CustomInit(); + KubeEnvironmentProfile = kubeEnvironmentProfile; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets target worker tier assigned to the App Service plan. - /// - [JsonProperty(PropertyName = "properties.workerTierName")] + /// Description of a SKU for a scalable resource. + public SkuDescription Sku { get; set; } + /// Target worker tier assigned to the App Service plan. public string WorkerTierName { get; set; } - - /// - /// Gets app Service plan status. Possible values include: 'Ready', - /// 'Pending', 'Creating' - /// - [JsonProperty(PropertyName = "properties.status")] - public StatusOptions? Status { get; private set; } - - /// - /// Gets app Service plan subscription. - /// - [JsonProperty(PropertyName = "properties.subscription")] - public string Subscription { get; private set; } - - /// - /// Gets or sets specification for the App Service Environment to use - /// for the App Service plan. - /// - [JsonProperty(PropertyName = "properties.hostingEnvironmentProfile")] + /// App Service plan status. + public StatusOptions? Status { get; } + /// App Service plan subscription. + public string Subscription { get; } + /// Specification for the App Service Environment to use for the App Service plan. public HostingEnvironmentProfile HostingEnvironmentProfile { get; set; } - + /// Maximum number of instances that can be assigned to this App Service plan. + public int? MaximumNumberOfWorkers { get; } + /// Geographical location for the App Service plan. + public string GeoRegion { get; } /// - /// Gets maximum number of instances that can be assigned to this App - /// Service plan. + /// If <code>true</code>, apps assigned to this App Service plan can be scaled independently. + /// If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the plan. /// - [JsonProperty(PropertyName = "properties.maximumNumberOfWorkers")] - public int? MaximumNumberOfWorkers { get; private set; } - - /// - /// Gets geographical location for the App Service plan. - /// - [JsonProperty(PropertyName = "properties.geoRegion")] - public string GeoRegion { get; private set; } - - /// - /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, apps - /// assigned to this App Service plan can be scaled independently. - /// If &lt;code&gt;false&lt;/code&gt;, apps assigned to - /// this App Service plan will scale to all instances of the plan. - /// - [JsonProperty(PropertyName = "properties.perSiteScaling")] public bool? PerSiteScaling { get; set; } - - /// - /// Gets or sets maximum number of total workers allowed for this - /// ElasticScaleEnabled App Service Plan - /// - [JsonProperty(PropertyName = "properties.maximumElasticWorkerCount")] + /// Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan. public int? MaximumElasticWorkerCount { get; set; } - - /// - /// Gets number of apps assigned to this App Service plan. - /// - [JsonProperty(PropertyName = "properties.numberOfSites")] - public int? NumberOfSites { get; private set; } - - /// - /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, this - /// App Service Plan owns spot instances. - /// - [JsonProperty(PropertyName = "properties.isSpot")] + /// Number of apps assigned to this App Service plan. + public int? NumberOfSites { get; } + /// If <code>true</code>, this App Service Plan owns spot instances. public bool? IsSpot { get; set; } - - /// - /// Gets or sets the time when the server farm expires. Valid only if - /// it is a spot server farm. - /// - [JsonProperty(PropertyName = "properties.spotExpirationTime")] - public System.DateTime? SpotExpirationTime { get; set; } - - /// - /// Gets or sets the time when the server farm free offer expires. - /// - [JsonProperty(PropertyName = "properties.freeOfferExpirationTime")] - public System.DateTime? FreeOfferExpirationTime { get; set; } - - /// - /// Gets resource group of the App Service plan. - /// - [JsonProperty(PropertyName = "properties.resourceGroup")] - public string ResourceGroup { get; private set; } - - /// - /// Gets or sets if Linux app service plan - /// &lt;code&gt;true&lt;/code&gt;, - /// &lt;code&gt;false&lt;/code&gt; otherwise. - /// - [JsonProperty(PropertyName = "properties.reserved")] + /// The time when the server farm expires. Valid only if it is a spot server farm. + public DateTimeOffset? SpotExpirationTime { get; set; } + /// The time when the server farm free offer expires. + public DateTimeOffset? FreeOfferExpirationTime { get; set; } + /// Resource group of the App Service plan. + public string ResourceGroup { get; } + /// If Linux app service plan <code>true</code>, <code>false</code> otherwise. public bool? Reserved { get; set; } - - /// - /// Gets or sets obsolete: If Hyper-V container app service plan - /// &lt;code&gt;true&lt;/code&gt;, - /// &lt;code&gt;false&lt;/code&gt; otherwise. - /// - [JsonProperty(PropertyName = "properties.isXenon")] + /// Obsolete: If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. public bool? IsXenon { get; set; } - - /// - /// Gets or sets if Hyper-V container app service plan - /// &lt;code&gt;true&lt;/code&gt;, - /// &lt;code&gt;false&lt;/code&gt; otherwise. - /// - [JsonProperty(PropertyName = "properties.hyperV")] + /// If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. public bool? HyperV { get; set; } - - /// - /// Gets or sets scaling worker count. - /// - [JsonProperty(PropertyName = "properties.targetWorkerCount")] + /// Scaling worker count. public int? TargetWorkerCount { get; set; } - - /// - /// Gets or sets scaling worker size ID. - /// - [JsonProperty(PropertyName = "properties.targetWorkerSizeId")] + /// Scaling worker size ID. public int? TargetWorkerSizeId { get; set; } - - /// - /// Gets provisioning state of the App Service Environment. Possible - /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', - /// 'Deleting' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public ProvisioningState? ProvisioningState { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "sku")] - public SkuDescription Sku { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } + /// Provisioning state of the App Service Plan. + public ProvisioningState? ProvisioningState { get; } + /// Specification for the Kubernetes Environment to use for the App Service plan. + public KubeEnvironmentProfile KubeEnvironmentProfile { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.Serialization.cs new file mode 100644 index 000000000000..e3d14f1695ef --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class AppServicePlanCollection + { + internal static AppServicePlanCollection DeserializeAppServicePlanCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AppServicePlan.DeserializeAppServicePlan(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new AppServicePlanCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.cs new file mode 100644 index 000000000000..46c3866242d5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of App Service plans. + internal partial class AppServicePlanCollection + { + /// Initializes a new instance of AppServicePlanCollection. + /// Collection of resources. + /// is null. + internal AppServicePlanCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of AppServicePlanCollection. + /// Collection of resources. + /// Link to next page of resources. + internal AppServicePlanCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.Serialization.cs new file mode 100644 index 000000000000..501b7df31a47 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.Serialization.cs @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppServicePlanPatchResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(WorkerTierName)) + { + writer.WritePropertyName("workerTierName"); + writer.WriteStringValue(WorkerTierName); + } + if (Optional.IsDefined(HostingEnvironmentProfile)) + { + writer.WritePropertyName("hostingEnvironmentProfile"); + writer.WriteObjectValue(HostingEnvironmentProfile); + } + if (Optional.IsDefined(PerSiteScaling)) + { + writer.WritePropertyName("perSiteScaling"); + writer.WriteBooleanValue(PerSiteScaling.Value); + } + if (Optional.IsDefined(MaximumElasticWorkerCount)) + { + writer.WritePropertyName("maximumElasticWorkerCount"); + writer.WriteNumberValue(MaximumElasticWorkerCount.Value); + } + if (Optional.IsDefined(IsSpot)) + { + writer.WritePropertyName("isSpot"); + writer.WriteBooleanValue(IsSpot.Value); + } + if (Optional.IsDefined(SpotExpirationTime)) + { + writer.WritePropertyName("spotExpirationTime"); + writer.WriteStringValue(SpotExpirationTime.Value, "O"); + } + if (Optional.IsDefined(FreeOfferExpirationTime)) + { + writer.WritePropertyName("freeOfferExpirationTime"); + writer.WriteStringValue(FreeOfferExpirationTime.Value, "O"); + } + if (Optional.IsDefined(Reserved)) + { + writer.WritePropertyName("reserved"); + writer.WriteBooleanValue(Reserved.Value); + } + if (Optional.IsDefined(IsXenon)) + { + writer.WritePropertyName("isXenon"); + writer.WriteBooleanValue(IsXenon.Value); + } + if (Optional.IsDefined(HyperV)) + { + writer.WritePropertyName("hyperV"); + writer.WriteBooleanValue(HyperV.Value); + } + if (Optional.IsDefined(TargetWorkerCount)) + { + writer.WritePropertyName("targetWorkerCount"); + writer.WriteNumberValue(TargetWorkerCount.Value); + } + if (Optional.IsDefined(TargetWorkerSizeId)) + { + writer.WritePropertyName("targetWorkerSizeId"); + writer.WriteNumberValue(TargetWorkerSizeId.Value); + } + if (Optional.IsDefined(KubeEnvironmentProfile)) + { + writer.WritePropertyName("kubeEnvironmentProfile"); + writer.WriteObjectValue(KubeEnvironmentProfile); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AppServicePlanPatchResource DeserializeAppServicePlanPatchResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional workerTierName = default; + Optional status = default; + Optional subscription = default; + Optional hostingEnvironmentProfile = default; + Optional maximumNumberOfWorkers = default; + Optional geoRegion = default; + Optional perSiteScaling = default; + Optional maximumElasticWorkerCount = default; + Optional numberOfSites = default; + Optional isSpot = default; + Optional spotExpirationTime = default; + Optional freeOfferExpirationTime = default; + Optional resourceGroup = default; + Optional reserved = default; + Optional isXenon = default; + Optional hyperV = default; + Optional targetWorkerCount = default; + Optional targetWorkerSizeId = default; + Optional provisioningState = default; + Optional kubeEnvironmentProfile = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("workerTierName")) + { + workerTierName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property0.Value.GetString().ToStatusOptions(); + continue; + } + if (property0.NameEquals("subscription")) + { + subscription = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostingEnvironmentProfile")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); + continue; + } + if (property0.NameEquals("maximumNumberOfWorkers")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + maximumNumberOfWorkers = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("geoRegion")) + { + geoRegion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("perSiteScaling")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + perSiteScaling = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("maximumElasticWorkerCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + maximumElasticWorkerCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("numberOfSites")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfSites = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("isSpot")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isSpot = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("spotExpirationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + spotExpirationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("freeOfferExpirationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + freeOfferExpirationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("resourceGroup")) + { + resourceGroup = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("reserved")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + reserved = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("isXenon")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isXenon = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("hyperV")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hyperV = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("targetWorkerCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + targetWorkerCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("targetWorkerSizeId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + targetWorkerSizeId = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property0.Value.GetString().ToProvisioningState(); + continue; + } + if (property0.NameEquals("kubeEnvironmentProfile")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + kubeEnvironmentProfile = KubeEnvironmentProfile.DeserializeKubeEnvironmentProfile(property0.Value); + continue; + } + } + continue; + } + } + return new AppServicePlanPatchResource(id.Value, name.Value, kind.Value, type.Value, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(maximumElasticWorkerCount), Optional.ToNullable(numberOfSites), Optional.ToNullable(isSpot), Optional.ToNullable(spotExpirationTime), Optional.ToNullable(freeOfferExpirationTime), resourceGroup.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(targetWorkerCount), Optional.ToNullable(targetWorkerSizeId), Optional.ToNullable(provisioningState), kubeEnvironmentProfile.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs index 55716222a405..6d69334f52ec 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs @@ -1,89 +1,51 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// ARM resource for a app service plan. - /// - [Rest.Serialization.JsonTransformation] + /// ARM resource for a app service plan. public partial class AppServicePlanPatchResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the AppServicePlanPatchResource - /// class. - /// + /// Initializes a new instance of AppServicePlanPatchResource. public AppServicePlanPatchResource() { - CustomInit(); } - /// - /// Initializes a new instance of the AppServicePlanPatchResource - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Target worker tier assigned to the App - /// Service plan. - /// App Service plan status. Possible values - /// include: 'Ready', 'Pending', 'Creating' - /// App Service plan subscription. - /// Specification for the App - /// Service Environment to use for the App Service plan. - /// Maximum number of instances - /// that can be assigned to this App Service plan. - /// Geographical location for the App Service - /// plan. - /// If <code>true</code>, apps - /// assigned to this App Service plan can be scaled independently. - /// If <code>false</code>, apps assigned to this App - /// Service plan will scale to all instances of the plan. - /// Maximum number of total - /// workers allowed for this ElasticScaleEnabled App Service - /// Plan - /// Number of apps assigned to this App - /// Service plan. - /// If <code>true</code>, this App - /// Service Plan owns spot instances. - /// The time when the server farm - /// expires. Valid only if it is a spot server farm. - /// The time when the server farm - /// free offer expires. - /// Resource group of the App Service - /// plan. - /// This needs to set to - /// <code>true</code> when creating a Linux App Service - /// Plan, along with <code>kind</code> set to - /// <code>Linux</code>. It should be - /// <code>false</code> otherwise. - /// Obsolete: If Hyper-V container app service - /// plan <code>true</code>, <code>false</code> - /// otherwise. - /// If Hyper-V container app service plan - /// <code>true</code>, <code>false</code> - /// otherwise. - /// Scaling worker count. - /// Scaling worker size ID. - /// Provisioning state of the App - /// Service Environment. Possible values include: 'Succeeded', - /// 'Failed', 'Canceled', 'InProgress', 'Deleting' - public AppServicePlanPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?)) - : base(id, name, kind, type) + /// Initializes a new instance of AppServicePlanPatchResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Target worker tier assigned to the App Service plan. + /// App Service plan status. + /// App Service plan subscription. + /// Specification for the App Service Environment to use for the App Service plan. + /// Maximum number of instances that can be assigned to this App Service plan. + /// Geographical location for the App Service plan. + /// + /// If <code>true</code>, apps assigned to this App Service plan can be scaled independently. + /// If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the plan. + /// + /// Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan. + /// Number of apps assigned to this App Service plan. + /// If <code>true</code>, this App Service Plan owns spot instances. + /// The time when the server farm expires. Valid only if it is a spot server farm. + /// The time when the server farm free offer expires. + /// Resource group of the App Service plan. + /// If Linux app service plan <code>true</code>, <code>false</code> otherwise. + /// Obsolete: If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. + /// If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. + /// Scaling worker count. + /// Scaling worker size ID. + /// Provisioning state of the App Service Plan. + /// Specification for the Kubernetes Environment to use for the App Service plan. + internal AppServicePlanPatchResource(string id, string name, string kind, string type, string workerTierName, StatusOptions? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, string geoRegion, bool? perSiteScaling, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpirationTime, DateTimeOffset? freeOfferExpirationTime, string resourceGroup, bool? reserved, bool? isXenon, bool? hyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile) : base(id, name, kind, type) { WorkerTierName = workerTierName; Status = status; @@ -104,147 +66,51 @@ public AppServicePlanPatchResource() TargetWorkerCount = targetWorkerCount; TargetWorkerSizeId = targetWorkerSizeId; ProvisioningState = provisioningState; - CustomInit(); + KubeEnvironmentProfile = kubeEnvironmentProfile; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets target worker tier assigned to the App Service plan. - /// - [JsonProperty(PropertyName = "properties.workerTierName")] + /// Target worker tier assigned to the App Service plan. public string WorkerTierName { get; set; } - - /// - /// Gets app Service plan status. Possible values include: 'Ready', - /// 'Pending', 'Creating' - /// - [JsonProperty(PropertyName = "properties.status")] - public StatusOptions? Status { get; private set; } - - /// - /// Gets app Service plan subscription. - /// - [JsonProperty(PropertyName = "properties.subscription")] - public string Subscription { get; private set; } - - /// - /// Gets or sets specification for the App Service Environment to use - /// for the App Service plan. - /// - [JsonProperty(PropertyName = "properties.hostingEnvironmentProfile")] + /// App Service plan status. + public StatusOptions? Status { get; } + /// App Service plan subscription. + public string Subscription { get; } + /// Specification for the App Service Environment to use for the App Service plan. public HostingEnvironmentProfile HostingEnvironmentProfile { get; set; } - - /// - /// Gets maximum number of instances that can be assigned to this App - /// Service plan. - /// - [JsonProperty(PropertyName = "properties.maximumNumberOfWorkers")] - public int? MaximumNumberOfWorkers { get; private set; } - - /// - /// Gets geographical location for the App Service plan. - /// - [JsonProperty(PropertyName = "properties.geoRegion")] - public string GeoRegion { get; private set; } - + /// Maximum number of instances that can be assigned to this App Service plan. + public int? MaximumNumberOfWorkers { get; } + /// Geographical location for the App Service plan. + public string GeoRegion { get; } /// - /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, apps - /// assigned to this App Service plan can be scaled independently. - /// If &lt;code&gt;false&lt;/code&gt;, apps assigned to - /// this App Service plan will scale to all instances of the plan. + /// If <code>true</code>, apps assigned to this App Service plan can be scaled independently. + /// If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the plan. /// - [JsonProperty(PropertyName = "properties.perSiteScaling")] public bool? PerSiteScaling { get; set; } - - /// - /// Gets or sets maximum number of total workers allowed for this - /// ElasticScaleEnabled App Service Plan - /// - [JsonProperty(PropertyName = "properties.maximumElasticWorkerCount")] + /// Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan. public int? MaximumElasticWorkerCount { get; set; } - - /// - /// Gets number of apps assigned to this App Service plan. - /// - [JsonProperty(PropertyName = "properties.numberOfSites")] - public int? NumberOfSites { get; private set; } - - /// - /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, this - /// App Service Plan owns spot instances. - /// - [JsonProperty(PropertyName = "properties.isSpot")] + /// Number of apps assigned to this App Service plan. + public int? NumberOfSites { get; } + /// If <code>true</code>, this App Service Plan owns spot instances. public bool? IsSpot { get; set; } - - /// - /// Gets or sets the time when the server farm expires. Valid only if - /// it is a spot server farm. - /// - [JsonProperty(PropertyName = "properties.spotExpirationTime")] - public System.DateTime? SpotExpirationTime { get; set; } - - /// - /// Gets or sets the time when the server farm free offer expires. - /// - [JsonProperty(PropertyName = "properties.freeOfferExpirationTime")] - public System.DateTime? FreeOfferExpirationTime { get; set; } - - /// - /// Gets resource group of the App Service plan. - /// - [JsonProperty(PropertyName = "properties.resourceGroup")] - public string ResourceGroup { get; private set; } - - /// - /// Gets or sets this needs to set to - /// &lt;code&gt;true&lt;/code&gt; when creating a Linux - /// App Service Plan, along with - /// &lt;code&gt;kind&lt;/code&gt; set to - /// &lt;code&gt;Linux&lt;/code&gt;. It should be - /// &lt;code&gt;false&lt;/code&gt; otherwise. - /// - [JsonProperty(PropertyName = "properties.reserved")] + /// The time when the server farm expires. Valid only if it is a spot server farm. + public DateTimeOffset? SpotExpirationTime { get; set; } + /// The time when the server farm free offer expires. + public DateTimeOffset? FreeOfferExpirationTime { get; set; } + /// Resource group of the App Service plan. + public string ResourceGroup { get; } + /// If Linux app service plan <code>true</code>, <code>false</code> otherwise. public bool? Reserved { get; set; } - - /// - /// Gets or sets obsolete: If Hyper-V container app service plan - /// &lt;code&gt;true&lt;/code&gt;, - /// &lt;code&gt;false&lt;/code&gt; otherwise. - /// - [JsonProperty(PropertyName = "properties.isXenon")] + /// Obsolete: If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. public bool? IsXenon { get; set; } - - /// - /// Gets or sets if Hyper-V container app service plan - /// &lt;code&gt;true&lt;/code&gt;, - /// &lt;code&gt;false&lt;/code&gt; otherwise. - /// - [JsonProperty(PropertyName = "properties.hyperV")] + /// If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. public bool? HyperV { get; set; } - - /// - /// Gets or sets scaling worker count. - /// - [JsonProperty(PropertyName = "properties.targetWorkerCount")] + /// Scaling worker count. public int? TargetWorkerCount { get; set; } - - /// - /// Gets or sets scaling worker size ID. - /// - [JsonProperty(PropertyName = "properties.targetWorkerSizeId")] + /// Scaling worker size ID. public int? TargetWorkerSizeId { get; set; } - - /// - /// Gets provisioning state of the App Service Environment. Possible - /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', - /// 'Deleting' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public ProvisioningState? ProvisioningState { get; private set; } - + /// Provisioning state of the App Service Plan. + public ProvisioningState? ProvisioningState { get; } + /// Specification for the Kubernetes Environment to use for the App Service plan. + public KubeEnvironmentProfile KubeEnvironmentProfile { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.Serialization.cs new file mode 100644 index 000000000000..b3486f8ae599 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.Serialization.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class AppServicePlanRestrictionsExtensions + { + public static string ToSerialString(this AppServicePlanRestrictions value) => value switch + { + AppServicePlanRestrictions.None => "None", + AppServicePlanRestrictions.Free => "Free", + AppServicePlanRestrictions.Shared => "Shared", + AppServicePlanRestrictions.Basic => "Basic", + AppServicePlanRestrictions.Standard => "Standard", + AppServicePlanRestrictions.Premium => "Premium", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AppServicePlanRestrictions value.") + }; + + public static AppServicePlanRestrictions ToAppServicePlanRestrictions(this string value) + { + if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return AppServicePlanRestrictions.None; + if (string.Equals(value, "Free", StringComparison.InvariantCultureIgnoreCase)) return AppServicePlanRestrictions.Free; + if (string.Equals(value, "Shared", StringComparison.InvariantCultureIgnoreCase)) return AppServicePlanRestrictions.Shared; + if (string.Equals(value, "Basic", StringComparison.InvariantCultureIgnoreCase)) return AppServicePlanRestrictions.Basic; + if (string.Equals(value, "Standard", StringComparison.InvariantCultureIgnoreCase)) return AppServicePlanRestrictions.Standard; + if (string.Equals(value, "Premium", StringComparison.InvariantCultureIgnoreCase)) return AppServicePlanRestrictions.Premium; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AppServicePlanRestrictions value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.cs index e27c1a65a91a..9cd006d48f56 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.cs @@ -1,84 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for AppServicePlanRestrictions. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// App Service plans this offer is restricted to. public enum AppServicePlanRestrictions { - [EnumMember(Value = "None")] + /// None. None, - [EnumMember(Value = "Free")] + /// Free. Free, - [EnumMember(Value = "Shared")] + /// Shared. Shared, - [EnumMember(Value = "Basic")] + /// Basic. Basic, - [EnumMember(Value = "Standard")] + /// Standard. Standard, - [EnumMember(Value = "Premium")] + /// Premium. Premium } - internal static class AppServicePlanRestrictionsEnumExtension - { - internal static string ToSerializedValue(this AppServicePlanRestrictions? value) - { - return value == null ? null : ((AppServicePlanRestrictions)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this AppServicePlanRestrictions value) - { - switch( value ) - { - case AppServicePlanRestrictions.None: - return "None"; - case AppServicePlanRestrictions.Free: - return "Free"; - case AppServicePlanRestrictions.Shared: - return "Shared"; - case AppServicePlanRestrictions.Basic: - return "Basic"; - case AppServicePlanRestrictions.Standard: - return "Standard"; - case AppServicePlanRestrictions.Premium: - return "Premium"; - } - return null; - } - - internal static AppServicePlanRestrictions? ParseAppServicePlanRestrictions(this string value) - { - switch( value ) - { - case "None": - return AppServicePlanRestrictions.None; - case "Free": - return AppServicePlanRestrictions.Free; - case "Shared": - return AppServicePlanRestrictions.Shared; - case "Basic": - return AppServicePlanRestrictions.Basic; - case "Standard": - return AppServicePlanRestrictions.Standard; - case "Premium": - return AppServicePlanRestrictions.Premium; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.Serialization.cs new file mode 100644 index 000000000000..f274f16d9d2a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Apple : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Registration)) + { + writer.WritePropertyName("registration"); + writer.WriteObjectValue(Registration); + } + if (Optional.IsDefined(Login)) + { + writer.WritePropertyName("login"); + writer.WriteObjectValue(Login); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Apple DeserializeApple(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional registration = default; + Optional login = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("registration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + registration = AppleRegistration.DeserializeAppleRegistration(property0.Value); + continue; + } + if (property0.NameEquals("login")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + login = LoginScopes.DeserializeLoginScopes(property0.Value); + continue; + } + } + continue; + } + } + return new Apple(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, login.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs new file mode 100644 index 000000000000..f598b3fb34b4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The configuration settings of the Apple provider. + public partial class Apple : ProxyOnlyResource + { + /// Initializes a new instance of Apple. + public Apple() + { + } + + /// Initializes a new instance of Apple. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the Apple provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// The configuration settings of the Apple registration. + /// The configuration settings of the login flow. + internal Apple(string id, string name, string kind, string type, bool? enabled, AppleRegistration registration, LoginScopes login) : base(id, name, kind, type) + { + Enabled = enabled; + Registration = registration; + Login = login; + } + + /// <code>false</code> if the Apple provider should not be enabled despite the set registration; otherwise, <code>true</code>. + public bool? Enabled { get; set; } + /// The configuration settings of the Apple registration. + public AppleRegistration Registration { get; set; } + /// The configuration settings of the login flow. + public LoginScopes Login { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.Serialization.cs new file mode 100644 index 000000000000..bb2f205bf8cb --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.Serialization.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppleRegistration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"); + writer.WriteStringValue(ClientId); + } + if (Optional.IsDefined(ClientSecretSettingName)) + { + writer.WritePropertyName("clientSecretSettingName"); + writer.WriteStringValue(ClientSecretSettingName); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AppleRegistration DeserializeAppleRegistration(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional clientId = default; + Optional clientSecretSettingName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("clientId")) + { + clientId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientSecretSettingName")) + { + clientSecretSettingName = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new AppleRegistration(id.Value, name.Value, kind.Value, type.Value, clientId.Value, clientSecretSettingName.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs new file mode 100644 index 000000000000..a327f3e1f226 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The configuration settings of the registration for the Apple provider. + public partial class AppleRegistration : ProxyOnlyResource + { + /// Initializes a new instance of AppleRegistration. + public AppleRegistration() + { + } + + /// Initializes a new instance of AppleRegistration. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Client ID of the app used for login. + /// The app setting name that contains the client secret. + internal AppleRegistration(string id, string name, string kind, string type, string clientId, string clientSecretSettingName) : base(id, name, kind, type) + { + ClientId = clientId; + ClientSecretSettingName = clientSecretSettingName; + } + + /// The Client ID of the app used for login. + public string ClientId { get; set; } + /// The app setting name that contains the client secret. + public string ClientSecretSettingName { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.Serialization.cs new file mode 100644 index 000000000000..6808d603e257 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.Serialization.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ApplicationLogsConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(FileSystem)) + { + writer.WritePropertyName("fileSystem"); + writer.WriteObjectValue(FileSystem); + } + if (Optional.IsDefined(AzureTableStorage)) + { + writer.WritePropertyName("azureTableStorage"); + writer.WriteObjectValue(AzureTableStorage); + } + if (Optional.IsDefined(AzureBlobStorage)) + { + writer.WritePropertyName("azureBlobStorage"); + writer.WriteObjectValue(AzureBlobStorage); + } + writer.WriteEndObject(); + } + + internal static ApplicationLogsConfig DeserializeApplicationLogsConfig(JsonElement element) + { + Optional fileSystem = default; + Optional azureTableStorage = default; + Optional azureBlobStorage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fileSystem")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + fileSystem = FileSystemApplicationLogsConfig.DeserializeFileSystemApplicationLogsConfig(property.Value); + continue; + } + if (property.NameEquals("azureTableStorage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + azureTableStorage = AzureTableStorageApplicationLogsConfig.DeserializeAzureTableStorageApplicationLogsConfig(property.Value); + continue; + } + if (property.NameEquals("azureBlobStorage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + azureBlobStorage = AzureBlobStorageApplicationLogsConfig.DeserializeAzureBlobStorageApplicationLogsConfig(property.Value); + continue; + } + } + return new ApplicationLogsConfig(fileSystem.Value, azureTableStorage.Value, azureBlobStorage.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.cs index 49d7982d2b0b..fb1d757f4fcf 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.cs @@ -1,83 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Application logs configuration. - /// + /// Application logs configuration. public partial class ApplicationLogsConfig { - /// - /// Initializes a new instance of the ApplicationLogsConfig class. - /// + /// Initializes a new instance of ApplicationLogsConfig. public ApplicationLogsConfig() { - CustomInit(); } - /// - /// Initializes a new instance of the ApplicationLogsConfig class. - /// - /// Application logs to file system - /// configuration. - /// Application logs to azure table - /// storage configuration. - /// Application logs to blob storage - /// configuration. - public ApplicationLogsConfig(FileSystemApplicationLogsConfig fileSystem = default(FileSystemApplicationLogsConfig), AzureTableStorageApplicationLogsConfig azureTableStorage = default(AzureTableStorageApplicationLogsConfig), AzureBlobStorageApplicationLogsConfig azureBlobStorage = default(AzureBlobStorageApplicationLogsConfig)) + /// Initializes a new instance of ApplicationLogsConfig. + /// Application logs to file system configuration. + /// Application logs to azure table storage configuration. + /// Application logs to blob storage configuration. + internal ApplicationLogsConfig(FileSystemApplicationLogsConfig fileSystem, AzureTableStorageApplicationLogsConfig azureTableStorage, AzureBlobStorageApplicationLogsConfig azureBlobStorage) { FileSystem = fileSystem; AzureTableStorage = azureTableStorage; AzureBlobStorage = azureBlobStorage; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets application logs to file system configuration. - /// - [JsonProperty(PropertyName = "fileSystem")] + /// Application logs to file system configuration. public FileSystemApplicationLogsConfig FileSystem { get; set; } - - /// - /// Gets or sets application logs to azure table storage configuration. - /// - [JsonProperty(PropertyName = "azureTableStorage")] + /// Application logs to azure table storage configuration. public AzureTableStorageApplicationLogsConfig AzureTableStorage { get; set; } - - /// - /// Gets or sets application logs to blob storage configuration. - /// - [JsonProperty(PropertyName = "azureBlobStorage")] + /// Application logs to blob storage configuration. public AzureBlobStorageApplicationLogsConfig AzureBlobStorage { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AzureTableStorage != null) - { - AzureTableStorage.Validate(); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.Serialization.cs new file mode 100644 index 000000000000..38907973405c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ApplicationStack : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"); + writer.WriteStringValue(Display); + } + if (Optional.IsDefined(Dependency)) + { + writer.WritePropertyName("dependency"); + writer.WriteStringValue(Dependency); + } + if (Optional.IsCollectionDefined(MajorVersions)) + { + writer.WritePropertyName("majorVersions"); + writer.WriteStartArray(); + foreach (var item in MajorVersions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Frameworks)) + { + writer.WritePropertyName("frameworks"); + writer.WriteStartArray(); + foreach (var item in Frameworks) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IsDeprecated)) + { + writer.WritePropertyName("isDeprecated"); + writer.WriteStartArray(); + foreach (var item in IsDeprecated) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static ApplicationStack DeserializeApplicationStack(JsonElement element) + { + Optional name = default; + Optional display = default; + Optional dependency = default; + Optional> majorVersions = default; + Optional> frameworks = default; + Optional> isDeprecated = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("display")) + { + display = property.Value.GetString(); + continue; + } + if (property.NameEquals("dependency")) + { + dependency = property.Value.GetString(); + continue; + } + if (property.NameEquals("majorVersions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StackMajorVersion.DeserializeStackMajorVersion(item)); + } + majorVersions = array; + continue; + } + if (property.NameEquals("frameworks")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeApplicationStack(item)); + } + frameworks = array; + continue; + } + if (property.NameEquals("isDeprecated")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeApplicationStack(item)); + } + isDeprecated = array; + continue; + } + } + return new ApplicationStack(name.Value, display.Value, dependency.Value, Optional.ToList(majorVersions), Optional.ToList(frameworks), Optional.ToList(isDeprecated)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs index 1eb2589b59e0..1cc471b98f26 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs @@ -1,87 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Application stack. - /// + /// Application stack. public partial class ApplicationStack { - /// - /// Initializes a new instance of the ApplicationStack class. - /// + /// Initializes a new instance of ApplicationStack. public ApplicationStack() { - CustomInit(); + MajorVersions = new ChangeTrackingList(); + Frameworks = new ChangeTrackingList(); + IsDeprecated = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the ApplicationStack class. - /// - /// Application stack name. - /// Application stack display name. - /// Application stack dependency. - /// List of major versions - /// available. - /// List of frameworks associated with - /// application stack. - public ApplicationStack(string name = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList)) + /// Initializes a new instance of ApplicationStack. + /// Application stack name. + /// Application stack display name. + /// Application stack dependency. + /// List of major versions available. + /// List of frameworks associated with application stack. + /// <code>true</code> if this is the stack is deprecated; otherwise, <code>false</code>. + internal ApplicationStack(string name, string display, string dependency, IList majorVersions, IList frameworks, IList isDeprecated) { Name = name; Display = display; Dependency = dependency; MajorVersions = majorVersions; Frameworks = frameworks; - CustomInit(); + IsDeprecated = isDeprecated; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets application stack name. - /// - [JsonProperty(PropertyName = "name")] + /// Application stack name. public string Name { get; set; } - - /// - /// Gets or sets application stack display name. - /// - [JsonProperty(PropertyName = "display")] + /// Application stack display name. public string Display { get; set; } - - /// - /// Gets or sets application stack dependency. - /// - [JsonProperty(PropertyName = "dependency")] + /// Application stack dependency. public string Dependency { get; set; } - - /// - /// Gets or sets list of major versions available. - /// - [JsonProperty(PropertyName = "majorVersions")] - public IList MajorVersions { get; set; } - - /// - /// Gets or sets list of frameworks associated with application stack. - /// - [JsonProperty(PropertyName = "frameworks")] - public IList Frameworks { get; set; } - + /// List of major versions available. + public IList MajorVersions { get; } + /// List of frameworks associated with application stack. + public IList Frameworks { get; } + /// <code>true</code> if this is the stack is deprecated; otherwise, <code>false</code>. + public IList IsDeprecated { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.Serialization.cs new file mode 100644 index 000000000000..88acb590dda9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class ApplicationStackCollection + { + internal static ApplicationStackCollection DeserializeApplicationStackCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ApplicationStackResource.DeserializeApplicationStackResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ApplicationStackCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.cs new file mode 100644 index 000000000000..23bc8311d9b4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Application Stacks. + internal partial class ApplicationStackCollection + { + /// Initializes a new instance of ApplicationStackCollection. + /// Collection of resources. + /// is null. + internal ApplicationStackCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of ApplicationStackCollection. + /// Collection of resources. + /// Link to next page of resources. + internal ApplicationStackCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.Serialization.cs new file mode 100644 index 000000000000..ac230ddad216 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ApplicationStackResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(NamePropertiesName)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(NamePropertiesName); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"); + writer.WriteStringValue(Display); + } + if (Optional.IsDefined(Dependency)) + { + writer.WritePropertyName("dependency"); + writer.WriteStringValue(Dependency); + } + if (Optional.IsCollectionDefined(MajorVersions)) + { + writer.WritePropertyName("majorVersions"); + writer.WriteStartArray(); + foreach (var item in MajorVersions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Frameworks)) + { + writer.WritePropertyName("frameworks"); + writer.WriteStartArray(); + foreach (var item in Frameworks) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(IsDeprecated)) + { + writer.WritePropertyName("isDeprecated"); + writer.WriteStartArray(); + foreach (var item in IsDeprecated) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ApplicationStackResource DeserializeApplicationStackResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional name0 = default; + Optional display = default; + Optional dependency = default; + Optional> majorVersions = default; + Optional> frameworks = default; + Optional> isDeprecated = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("name")) + { + name0 = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("display")) + { + display = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("dependency")) + { + dependency = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("majorVersions")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(StackMajorVersion.DeserializeStackMajorVersion(item)); + } + majorVersions = array; + continue; + } + if (property0.NameEquals("frameworks")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ApplicationStack.DeserializeApplicationStack(item)); + } + frameworks = array; + continue; + } + if (property0.NameEquals("isDeprecated")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ApplicationStack.DeserializeApplicationStack(item)); + } + isDeprecated = array; + continue; + } + } + continue; + } + } + return new ApplicationStackResource(id.Value, name.Value, kind.Value, type.Value, name0.Value, display.Value, dependency.Value, Optional.ToList(majorVersions), Optional.ToList(frameworks), Optional.ToList(isDeprecated)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs index ac8153b7ec12..42ea7c1fabde 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs @@ -1,96 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// ARM resource for a ApplicationStack. - /// - [Rest.Serialization.JsonTransformation] + /// ARM resource for a ApplicationStack. public partial class ApplicationStackResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the ApplicationStackResource class. - /// + /// Initializes a new instance of ApplicationStackResource. public ApplicationStackResource() { - CustomInit(); + MajorVersions = new ChangeTrackingList(); + Frameworks = new ChangeTrackingList(); + IsDeprecated = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the ApplicationStackResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Application stack - /// name. - /// Application stack display name. - /// Application stack dependency. - /// List of major versions - /// available. - /// List of frameworks associated with - /// application stack. - public ApplicationStackResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string applicationStackResourceName = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of ApplicationStackResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Application stack name. + /// Application stack display name. + /// Application stack dependency. + /// List of major versions available. + /// List of frameworks associated with application stack. + /// <code>true</code> if this is the stack is deprecated; otherwise, <code>false</code>. + internal ApplicationStackResource(string id, string name, string kind, string type, string namePropertiesName, string display, string dependency, IList majorVersions, IList frameworks, IList isDeprecated) : base(id, name, kind, type) { - ApplicationStackResourceName = applicationStackResourceName; + NamePropertiesName = namePropertiesName; Display = display; Dependency = dependency; MajorVersions = majorVersions; Frameworks = frameworks; - CustomInit(); + IsDeprecated = isDeprecated; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets application stack name. - /// - [JsonProperty(PropertyName = "properties.name")] - public string ApplicationStackResourceName { get; set; } - - /// - /// Gets or sets application stack display name. - /// - [JsonProperty(PropertyName = "properties.display")] + /// Application stack name. + public string NamePropertiesName { get; set; } + /// Application stack display name. public string Display { get; set; } - - /// - /// Gets or sets application stack dependency. - /// - [JsonProperty(PropertyName = "properties.dependency")] + /// Application stack dependency. public string Dependency { get; set; } - - /// - /// Gets or sets list of major versions available. - /// - [JsonProperty(PropertyName = "properties.majorVersions")] - public IList MajorVersions { get; set; } - - /// - /// Gets or sets list of frameworks associated with application stack. - /// - [JsonProperty(PropertyName = "properties.frameworks")] - public IList Frameworks { get; set; } - + /// List of major versions available. + public IList MajorVersions { get; } + /// List of frameworks associated with application stack. + public IList Frameworks { get; } + /// <code>true</code> if this is the stack is deprecated; otherwise, <code>false</code>. + public IList IsDeprecated { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.Serialization.cs new file mode 100644 index 000000000000..4c012b3d7485 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.Serialization.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AppserviceGithubToken + { + internal static AppserviceGithubToken DeserializeAppserviceGithubToken(JsonElement element) + { + Optional accessToken = default; + Optional scope = default; + Optional tokenType = default; + Optional gotToken = default; + Optional errorMessage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("accessToken")) + { + accessToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("scope")) + { + scope = property.Value.GetString(); + continue; + } + if (property.NameEquals("tokenType")) + { + tokenType = property.Value.GetString(); + continue; + } + if (property.NameEquals("gotToken")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + gotToken = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("errorMessage")) + { + errorMessage = property.Value.GetString(); + continue; + } + } + return new AppserviceGithubToken(accessToken.Value, scope.Value, tokenType.Value, Optional.ToNullable(gotToken), errorMessage.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs new file mode 100644 index 000000000000..32a8f75151e2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Github access token for Appservice CLI github integration. + public partial class AppserviceGithubToken + { + /// Initializes a new instance of AppserviceGithubToken. + internal AppserviceGithubToken() + { + } + + /// Initializes a new instance of AppserviceGithubToken. + /// Github access token for Appservice CLI github integration. + /// Scope of the github access token. + /// token type. + /// True if valid github token received, False otherwise. + /// Error message if unable to get token. + internal AppserviceGithubToken(string accessToken, string scope, string tokenType, bool? gotToken, string errorMessage) + { + AccessToken = accessToken; + Scope = scope; + TokenType = tokenType; + GotToken = gotToken; + ErrorMessage = errorMessage; + } + + /// Github access token for Appservice CLI github integration. + public string AccessToken { get; } + /// Scope of the github access token. + public string Scope { get; } + /// token type. + public string TokenType { get; } + /// True if valid github token received, False otherwise. + public bool? GotToken { get; } + /// Error message if unable to get token. + public string ErrorMessage { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.Serialization.cs new file mode 100644 index 000000000000..96dd3cd7b89b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.Serialization.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class AppserviceGithubTokenRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("code"); + writer.WriteStringValue(Code); + writer.WritePropertyName("state"); + writer.WriteStringValue(State); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs new file mode 100644 index 000000000000..27e7d1f3f1bc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Appservice Github token request content. + internal partial class AppserviceGithubTokenRequest + { + /// Initializes a new instance of AppserviceGithubTokenRequest. + /// Code string to exchange for Github Access token. + /// State string used for verification. + /// or is null. + public AppserviceGithubTokenRequest(string code, string state) + { + if (code == null) + { + throw new ArgumentNullException(nameof(code)); + } + if (state == null) + { + throw new ArgumentNullException(nameof(state)); + } + + Code = code; + State = state; + } + + /// Code string to exchange for Github Access token. + public string Code { get; } + /// State string used for verification. + public string State { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.Serialization.cs new file mode 100644 index 000000000000..80ce650d842e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ArmIdWrapper : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } + + internal static ArmIdWrapper DeserializeArmIdWrapper(JsonElement element) + { + Optional id = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + } + return new ArmIdWrapper(id.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.cs index 29086012629d..c620e2ce5ce9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.cs @@ -1,49 +1,27 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// A wrapper for an ARM resource id - /// + /// A wrapper for an ARM resource id. public partial class ArmIdWrapper { - /// - /// Initializes a new instance of the ArmIdWrapper class. - /// + /// Initializes a new instance of ArmIdWrapper. public ArmIdWrapper() { - CustomInit(); } - /// - /// Initializes a new instance of the ArmIdWrapper class. - /// - public ArmIdWrapper(string id = default(string)) + /// Initializes a new instance of ArmIdWrapper. + /// . + internal ArmIdWrapper(string id) { Id = id; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - + public string Id { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.Serialization.cs new file mode 100644 index 000000000000..26e9979fe39a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ArmPlan + { + internal static ArmPlan DeserializeArmPlan(JsonElement element) + { + Optional name = default; + Optional publisher = default; + Optional product = default; + Optional promotionCode = default; + Optional version = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisher")) + { + publisher = property.Value.GetString(); + continue; + } + if (property.NameEquals("product")) + { + product = property.Value.GetString(); + continue; + } + if (property.NameEquals("promotionCode")) + { + promotionCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("version")) + { + version = property.Value.GetString(); + continue; + } + } + return new ArmPlan(name.Value, publisher.Value, product.Value, promotionCode.Value, version.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.cs new file mode 100644 index 000000000000..febf65d9d70e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The plan object in Azure Resource Manager, represents a marketplace plan. + public partial class ArmPlan + { + /// Initializes a new instance of ArmPlan. + internal ArmPlan() + { + } + + /// Initializes a new instance of ArmPlan. + /// The name. + /// The publisher. + /// The product. + /// The promotion code. + /// Version of product. + internal ArmPlan(string name, string publisher, string product, string promotionCode, string version) + { + Name = name; + Publisher = publisher; + Product = product; + PromotionCode = promotionCode; + Version = version; + } + + /// The name. + public string Name { get; } + /// The publisher. + public string Publisher { get; } + /// The product. + public string Product { get; } + /// The promotion code. + public string PromotionCode { get; } + /// Version of product. + public string Version { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.Serialization.cs new file mode 100644 index 000000000000..8c06fa0780b4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.Serialization.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AseV3NetworkingConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(AllowNewPrivateEndpointConnections)) + { + writer.WritePropertyName("allowNewPrivateEndpointConnections"); + writer.WriteBooleanValue(AllowNewPrivateEndpointConnections.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AseV3NetworkingConfiguration DeserializeAseV3NetworkingConfiguration(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional> windowsOutboundIpAddresses = default; + Optional> linuxOutboundIpAddresses = default; + Optional allowNewPrivateEndpointConnections = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("windowsOutboundIpAddresses")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + windowsOutboundIpAddresses = array; + continue; + } + if (property0.NameEquals("linuxOutboundIpAddresses")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + linuxOutboundIpAddresses = array; + continue; + } + if (property0.NameEquals("allowNewPrivateEndpointConnections")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + allowNewPrivateEndpointConnections = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new AseV3NetworkingConfiguration(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(windowsOutboundIpAddresses), Optional.ToList(linuxOutboundIpAddresses), Optional.ToNullable(allowNewPrivateEndpointConnections)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs new file mode 100644 index 000000000000..0020b194bb9e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Full view of networking configuration for an ASE. + public partial class AseV3NetworkingConfiguration : ProxyOnlyResource + { + /// Initializes a new instance of AseV3NetworkingConfiguration. + public AseV3NetworkingConfiguration() + { + WindowsOutboundIpAddresses = new ChangeTrackingList(); + LinuxOutboundIpAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of AseV3NetworkingConfiguration. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// . + /// . + /// Property to enable and disable new private endpoint connection creation on ASE. + internal AseV3NetworkingConfiguration(string id, string name, string kind, string type, IReadOnlyList windowsOutboundIpAddresses, IReadOnlyList linuxOutboundIpAddresses, bool? allowNewPrivateEndpointConnections) : base(id, name, kind, type) + { + WindowsOutboundIpAddresses = windowsOutboundIpAddresses; + LinuxOutboundIpAddresses = linuxOutboundIpAddresses; + AllowNewPrivateEndpointConnections = allowNewPrivateEndpointConnections; + } + + public IReadOnlyList WindowsOutboundIpAddresses { get; } + public IReadOnlyList LinuxOutboundIpAddresses { get; } + /// Property to enable and disable new private endpoint connection creation on ASE. + public bool? AllowNewPrivateEndpointConnections { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.Serialization.cs new file mode 100644 index 000000000000..96710f2366fe --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.Serialization.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AuthPlatform : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(RuntimeVersion)) + { + writer.WritePropertyName("runtimeVersion"); + writer.WriteStringValue(RuntimeVersion); + } + if (Optional.IsDefined(ConfigFilePath)) + { + writer.WritePropertyName("configFilePath"); + writer.WriteStringValue(ConfigFilePath); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AuthPlatform DeserializeAuthPlatform(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional runtimeVersion = default; + Optional configFilePath = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("runtimeVersion")) + { + runtimeVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("configFilePath")) + { + configFilePath = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new AuthPlatform(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), runtimeVersion.Value, configFilePath.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.cs index fcb76de8feff..a412039e2548 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.cs @@ -1,66 +1,52 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the platform of App Service Authentication/Authorization. public partial class AuthPlatform : ProxyOnlyResource { - /// - /// Initializes a new instance of the AuthPlatform class. - /// + /// Initializes a new instance of AuthPlatform. public AuthPlatform() { - CustomInit(); } - /// - /// Initializes a new instance of the AuthPlatform class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public AuthPlatform(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), string runtimeVersion = default(string), string configFilePath = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of AuthPlatform. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>true</code> if the Authentication / Authorization feature is enabled for the current app; otherwise, <code>false</code>. + /// + /// The RuntimeVersion of the Authentication / Authorization feature in use for the current app. + /// The setting in this value can control the behavior of certain features in the Authentication / Authorization module. + /// + /// + /// The path of the config file containing auth settings if they come from a file. + /// If the path is relative, base will the site's root directory. + /// + internal AuthPlatform(string id, string name, string kind, string type, bool? enabled, string runtimeVersion, string configFilePath) : base(id, name, kind, type) { Enabled = enabled; RuntimeVersion = runtimeVersion; ConfigFilePath = configFilePath; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// <code>true</code> if the Authentication / Authorization feature is enabled for the current app; otherwise, <code>false</code>. public bool? Enabled { get; set; } - /// + /// The RuntimeVersion of the Authentication / Authorization feature in use for the current app. + /// The setting in this value can control the behavior of certain features in the Authentication / Authorization module. /// - [JsonProperty(PropertyName = "properties.runtimeVersion")] public string RuntimeVersion { get; set; } - /// + /// The path of the config file containing auth settings if they come from a file. + /// If the path is relative, base will the site's root directory. /// - [JsonProperty(PropertyName = "properties.configFilePath")] public string ConfigFilePath { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.Serialization.cs new file mode 100644 index 000000000000..a6e1d2b60aa0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class AutoHealActionTypeExtensions + { + public static string ToSerialString(this AutoHealActionType value) => value switch + { + AutoHealActionType.Recycle => "Recycle", + AutoHealActionType.LogEvent => "LogEvent", + AutoHealActionType.CustomAction => "CustomAction", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AutoHealActionType value.") + }; + + public static AutoHealActionType ToAutoHealActionType(this string value) + { + if (string.Equals(value, "Recycle", StringComparison.InvariantCultureIgnoreCase)) return AutoHealActionType.Recycle; + if (string.Equals(value, "LogEvent", StringComparison.InvariantCultureIgnoreCase)) return AutoHealActionType.LogEvent; + if (string.Equals(value, "CustomAction", StringComparison.InvariantCultureIgnoreCase)) return AutoHealActionType.CustomAction; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AutoHealActionType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.cs index 60d28758200e..3b121c8bbd0e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for AutoHealActionType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Predefined action to be taken. public enum AutoHealActionType { - [EnumMember(Value = "Recycle")] + /// Recycle. Recycle, - [EnumMember(Value = "LogEvent")] + /// LogEvent. LogEvent, - [EnumMember(Value = "CustomAction")] + /// CustomAction. CustomAction } - internal static class AutoHealActionTypeEnumExtension - { - internal static string ToSerializedValue(this AutoHealActionType? value) - { - return value == null ? null : ((AutoHealActionType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this AutoHealActionType value) - { - switch( value ) - { - case AutoHealActionType.Recycle: - return "Recycle"; - case AutoHealActionType.LogEvent: - return "LogEvent"; - case AutoHealActionType.CustomAction: - return "CustomAction"; - } - return null; - } - - internal static AutoHealActionType? ParseAutoHealActionType(this string value) - { - switch( value ) - { - case "Recycle": - return AutoHealActionType.Recycle; - case "LogEvent": - return AutoHealActionType.LogEvent; - case "CustomAction": - return AutoHealActionType.CustomAction; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.Serialization.cs new file mode 100644 index 000000000000..d3a1e1fcb80d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.Serialization.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AutoHealActions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ActionType)) + { + writer.WritePropertyName("actionType"); + writer.WriteStringValue(ActionType.Value.ToSerialString()); + } + if (Optional.IsDefined(CustomAction)) + { + writer.WritePropertyName("customAction"); + writer.WriteObjectValue(CustomAction); + } + if (Optional.IsDefined(MinProcessExecutionTime)) + { + writer.WritePropertyName("minProcessExecutionTime"); + writer.WriteStringValue(MinProcessExecutionTime); + } + writer.WriteEndObject(); + } + + internal static AutoHealActions DeserializeAutoHealActions(JsonElement element) + { + Optional actionType = default; + Optional customAction = default; + Optional minProcessExecutionTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("actionType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + actionType = property.Value.GetString().ToAutoHealActionType(); + continue; + } + if (property.NameEquals("customAction")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + customAction = AutoHealCustomAction.DeserializeAutoHealCustomAction(property.Value); + continue; + } + if (property.NameEquals("minProcessExecutionTime")) + { + minProcessExecutionTime = property.Value.GetString(); + continue; + } + } + return new AutoHealActions(Optional.ToNullable(actionType), customAction.Value, minProcessExecutionTime.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.cs index 14b9448320b6..b9e07d8aaeca 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.cs @@ -1,72 +1,42 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Actions which to take by the auto-heal module when a rule is triggered. - /// + /// Actions which to take by the auto-heal module when a rule is triggered. public partial class AutoHealActions { - /// - /// Initializes a new instance of the AutoHealActions class. - /// + /// Initializes a new instance of AutoHealActions. public AutoHealActions() { - CustomInit(); } - /// - /// Initializes a new instance of the AutoHealActions class. - /// - /// Predefined action to be taken. Possible - /// values include: 'Recycle', 'LogEvent', 'CustomAction' - /// Custom action to be taken. - /// Minimum time the process must - /// execute - /// before taking the action - public AutoHealActions(AutoHealActionType? actionType = default(AutoHealActionType?), AutoHealCustomAction customAction = default(AutoHealCustomAction), string minProcessExecutionTime = default(string)) + /// Initializes a new instance of AutoHealActions. + /// Predefined action to be taken. + /// Custom action to be taken. + /// + /// Minimum time the process must execute + /// before taking the action. + /// + internal AutoHealActions(AutoHealActionType? actionType, AutoHealCustomAction customAction, string minProcessExecutionTime) { ActionType = actionType; CustomAction = customAction; MinProcessExecutionTime = minProcessExecutionTime; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets predefined action to be taken. Possible values - /// include: 'Recycle', 'LogEvent', 'CustomAction' - /// - [JsonProperty(PropertyName = "actionType")] + /// Predefined action to be taken. public AutoHealActionType? ActionType { get; set; } - - /// - /// Gets or sets custom action to be taken. - /// - [JsonProperty(PropertyName = "customAction")] + /// Custom action to be taken. public AutoHealCustomAction CustomAction { get; set; } - /// - /// Gets or sets minimum time the process must execute - /// before taking the action + /// Minimum time the process must execute + /// before taking the action. /// - [JsonProperty(PropertyName = "minProcessExecutionTime")] public string MinProcessExecutionTime { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.Serialization.cs new file mode 100644 index 000000000000..6ca77cf75dbd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AutoHealCustomAction : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Exe)) + { + writer.WritePropertyName("exe"); + writer.WriteStringValue(Exe); + } + if (Optional.IsDefined(Parameters)) + { + writer.WritePropertyName("parameters"); + writer.WriteStringValue(Parameters); + } + writer.WriteEndObject(); + } + + internal static AutoHealCustomAction DeserializeAutoHealCustomAction(JsonElement element) + { + Optional exe = default; + Optional parameters = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exe")) + { + exe = property.Value.GetString(); + continue; + } + if (property.NameEquals("parameters")) + { + parameters = property.Value.GetString(); + continue; + } + } + return new AutoHealCustomAction(exe.Value, parameters.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.cs index d21dbb6d57f3..a6f95eb73cd3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.cs @@ -1,60 +1,35 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - /// /// Custom action to be executed /// when an auto heal rule is triggered. /// public partial class AutoHealCustomAction { - /// - /// Initializes a new instance of the AutoHealCustomAction class. - /// + /// Initializes a new instance of AutoHealCustomAction. public AutoHealCustomAction() { - CustomInit(); } - /// - /// Initializes a new instance of the AutoHealCustomAction class. - /// - /// Executable to be run. - /// Parameters for the executable. - public AutoHealCustomAction(string exe = default(string), string parameters = default(string)) + /// Initializes a new instance of AutoHealCustomAction. + /// Executable to be run. + /// Parameters for the executable. + internal AutoHealCustomAction(string exe, string parameters) { Exe = exe; Parameters = parameters; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets executable to be run. - /// - [JsonProperty(PropertyName = "exe")] + /// Executable to be run. public string Exe { get; set; } - - /// - /// Gets or sets parameters for the executable. - /// - [JsonProperty(PropertyName = "parameters")] + /// Parameters for the executable. public string Parameters { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.Serialization.cs new file mode 100644 index 000000000000..d5c863b5abe7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AutoHealRules : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Triggers)) + { + writer.WritePropertyName("triggers"); + writer.WriteObjectValue(Triggers); + } + if (Optional.IsDefined(Actions)) + { + writer.WritePropertyName("actions"); + writer.WriteObjectValue(Actions); + } + writer.WriteEndObject(); + } + + internal static AutoHealRules DeserializeAutoHealRules(JsonElement element) + { + Optional triggers = default; + Optional actions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("triggers")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + triggers = AutoHealTriggers.DeserializeAutoHealTriggers(property.Value); + continue; + } + if (property.NameEquals("actions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + actions = AutoHealActions.DeserializeAutoHealActions(property.Value); + continue; + } + } + return new AutoHealRules(triggers.Value, actions.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.cs index 73309239d4f8..dcd8d5e3650e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.cs @@ -1,62 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Rules that can be defined for auto-heal. - /// + /// Rules that can be defined for auto-heal. public partial class AutoHealRules { - /// - /// Initializes a new instance of the AutoHealRules class. - /// + /// Initializes a new instance of AutoHealRules. public AutoHealRules() { - CustomInit(); } - /// - /// Initializes a new instance of the AutoHealRules class. - /// - /// Conditions that describe when to execute the - /// auto-heal actions. - /// Actions to be executed when a rule is - /// triggered. - public AutoHealRules(AutoHealTriggers triggers = default(AutoHealTriggers), AutoHealActions actions = default(AutoHealActions)) + /// Initializes a new instance of AutoHealRules. + /// Conditions that describe when to execute the auto-heal actions. + /// Actions to be executed when a rule is triggered. + internal AutoHealRules(AutoHealTriggers triggers, AutoHealActions actions) { Triggers = triggers; Actions = actions; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets conditions that describe when to execute the auto-heal - /// actions. - /// - [JsonProperty(PropertyName = "triggers")] + /// Conditions that describe when to execute the auto-heal actions. public AutoHealTriggers Triggers { get; set; } - - /// - /// Gets or sets actions to be executed when a rule is triggered. - /// - [JsonProperty(PropertyName = "actions")] + /// Actions to be executed when a rule is triggered. public AutoHealActions Actions { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.Serialization.cs new file mode 100644 index 000000000000..42f5c3b11625 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AutoHealTriggers : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Requests)) + { + writer.WritePropertyName("requests"); + writer.WriteObjectValue(Requests); + } + if (Optional.IsDefined(PrivateBytesInKB)) + { + writer.WritePropertyName("privateBytesInKB"); + writer.WriteNumberValue(PrivateBytesInKB.Value); + } + if (Optional.IsCollectionDefined(StatusCodes)) + { + writer.WritePropertyName("statusCodes"); + writer.WriteStartArray(); + foreach (var item in StatusCodes) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(SlowRequests)) + { + writer.WritePropertyName("slowRequests"); + writer.WriteObjectValue(SlowRequests); + } + if (Optional.IsCollectionDefined(SlowRequestsWithPath)) + { + writer.WritePropertyName("slowRequestsWithPath"); + writer.WriteStartArray(); + foreach (var item in SlowRequestsWithPath) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(StatusCodesRange)) + { + writer.WritePropertyName("statusCodesRange"); + writer.WriteStartArray(); + foreach (var item in StatusCodesRange) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static AutoHealTriggers DeserializeAutoHealTriggers(JsonElement element) + { + Optional requests = default; + Optional privateBytesInKB = default; + Optional> statusCodes = default; + Optional slowRequests = default; + Optional> slowRequestsWithPath = default; + Optional> statusCodesRange = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("requests")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + requests = RequestsBasedTrigger.DeserializeRequestsBasedTrigger(property.Value); + continue; + } + if (property.NameEquals("privateBytesInKB")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + privateBytesInKB = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("statusCodes")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StatusCodesBasedTrigger.DeserializeStatusCodesBasedTrigger(item)); + } + statusCodes = array; + continue; + } + if (property.NameEquals("slowRequests")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + slowRequests = SlowRequestsBasedTrigger.DeserializeSlowRequestsBasedTrigger(property.Value); + continue; + } + if (property.NameEquals("slowRequestsWithPath")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SlowRequestsBasedTrigger.DeserializeSlowRequestsBasedTrigger(item)); + } + slowRequestsWithPath = array; + continue; + } + if (property.NameEquals("statusCodesRange")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StatusCodesRangeBasedTrigger.DeserializeStatusCodesRangeBasedTrigger(item)); + } + statusCodesRange = array; + continue; + } + } + return new AutoHealTriggers(requests.Value, Optional.ToNullable(privateBytesInKB), Optional.ToList(statusCodes), slowRequests.Value, Optional.ToList(slowRequestsWithPath), Optional.ToList(statusCodesRange)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs index 1249271bac0a..a0fecbfd0c17 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs @@ -1,79 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Triggers for auto-heal. - /// + /// Triggers for auto-heal. public partial class AutoHealTriggers { - /// - /// Initializes a new instance of the AutoHealTriggers class. - /// + /// Initializes a new instance of AutoHealTriggers. public AutoHealTriggers() { - CustomInit(); + StatusCodes = new ChangeTrackingList(); + SlowRequestsWithPath = new ChangeTrackingList(); + StatusCodesRange = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the AutoHealTriggers class. - /// - /// A rule based on total requests. - /// A rule based on private - /// bytes. - /// A rule based on status codes. - /// A rule based on request execution - /// time. - public AutoHealTriggers(RequestsBasedTrigger requests = default(RequestsBasedTrigger), int? privateBytesInKB = default(int?), IList statusCodes = default(IList), SlowRequestsBasedTrigger slowRequests = default(SlowRequestsBasedTrigger)) + /// Initializes a new instance of AutoHealTriggers. + /// A rule based on total requests. + /// A rule based on private bytes. + /// A rule based on status codes. + /// A rule based on request execution time. + /// A rule based on multiple Slow Requests Rule with path. + /// A rule based on status codes ranges. + internal AutoHealTriggers(RequestsBasedTrigger requests, int? privateBytesInKB, IList statusCodes, SlowRequestsBasedTrigger slowRequests, IList slowRequestsWithPath, IList statusCodesRange) { Requests = requests; PrivateBytesInKB = privateBytesInKB; StatusCodes = statusCodes; SlowRequests = slowRequests; - CustomInit(); + SlowRequestsWithPath = slowRequestsWithPath; + StatusCodesRange = statusCodesRange; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a rule based on total requests. - /// - [JsonProperty(PropertyName = "requests")] + /// A rule based on total requests. public RequestsBasedTrigger Requests { get; set; } - - /// - /// Gets or sets a rule based on private bytes. - /// - [JsonProperty(PropertyName = "privateBytesInKB")] + /// A rule based on private bytes. public int? PrivateBytesInKB { get; set; } - - /// - /// Gets or sets a rule based on status codes. - /// - [JsonProperty(PropertyName = "statusCodes")] - public IList StatusCodes { get; set; } - - /// - /// Gets or sets a rule based on request execution time. - /// - [JsonProperty(PropertyName = "slowRequests")] + /// A rule based on status codes. + public IList StatusCodes { get; } + /// A rule based on request execution time. public SlowRequestsBasedTrigger SlowRequests { get; set; } - + /// A rule based on multiple Slow Requests Rule with path. + public IList SlowRequestsWithPath { get; } + /// A rule based on status codes ranges. + public IList StatusCodesRange { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.Serialization.cs new file mode 100644 index 000000000000..5a8eed589752 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AzureActiveDirectory : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Registration)) + { + writer.WritePropertyName("registration"); + writer.WriteObjectValue(Registration); + } + if (Optional.IsDefined(Login)) + { + writer.WritePropertyName("login"); + writer.WriteObjectValue(Login); + } + if (Optional.IsDefined(Validation)) + { + writer.WritePropertyName("validation"); + writer.WriteObjectValue(Validation); + } + if (Optional.IsDefined(IsAutoProvisioned)) + { + writer.WritePropertyName("isAutoProvisioned"); + writer.WriteBooleanValue(IsAutoProvisioned.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AzureActiveDirectory DeserializeAzureActiveDirectory(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional registration = default; + Optional login = default; + Optional validation = default; + Optional isAutoProvisioned = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("registration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + registration = AzureActiveDirectoryRegistration.DeserializeAzureActiveDirectoryRegistration(property0.Value); + continue; + } + if (property0.NameEquals("login")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + login = AzureActiveDirectoryLogin.DeserializeAzureActiveDirectoryLogin(property0.Value); + continue; + } + if (property0.NameEquals("validation")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + validation = AzureActiveDirectoryValidation.DeserializeAzureActiveDirectoryValidation(property0.Value); + continue; + } + if (property0.NameEquals("isAutoProvisioned")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isAutoProvisioned = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new AzureActiveDirectory(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, login.Value, validation.Value, Optional.ToNullable(isAutoProvisioned)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.cs index 1adab0d29484..470e43f85806 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.cs @@ -1,78 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the Azure Active directory provider. public partial class AzureActiveDirectory : ProxyOnlyResource { - /// - /// Initializes a new instance of the AzureActiveDirectory class. - /// + /// Initializes a new instance of AzureActiveDirectory. public AzureActiveDirectory() { - CustomInit(); } - /// - /// Initializes a new instance of the AzureActiveDirectory class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public AzureActiveDirectory(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), AzureActiveDirectoryRegistration registration = default(AzureActiveDirectoryRegistration), AzureActiveDirectoryLogin login = default(AzureActiveDirectoryLogin), AzureActiveDirectoryValidation validation = default(AzureActiveDirectoryValidation), bool? isAutoProvisioned = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of AzureActiveDirectory. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// The configuration settings of the Azure Active Directory app registration. + /// The configuration settings of the Azure Active Directory login flow. + /// The configuration settings of the Azure Active Directory token validation flow. + /// + /// Gets a value indicating whether the Azure AD configuration was auto-provisioned using 1st party tooling. + /// This is an internal flag primarily intended to support the Azure Management Portal. Users should not + /// read or write to this property. + /// + internal AzureActiveDirectory(string id, string name, string kind, string type, bool? enabled, AzureActiveDirectoryRegistration registration, AzureActiveDirectoryLogin login, AzureActiveDirectoryValidation validation, bool? isAutoProvisioned) : base(id, name, kind, type) { Enabled = enabled; Registration = registration; Login = login; Validation = validation; IsAutoProvisioned = isAutoProvisioned; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// <code>false</code> if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, <code>true</code>. public bool? Enabled { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.registration")] + /// The configuration settings of the Azure Active Directory app registration. public AzureActiveDirectoryRegistration Registration { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.login")] + /// The configuration settings of the Azure Active Directory login flow. public AzureActiveDirectoryLogin Login { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.validation")] + /// The configuration settings of the Azure Active Directory token validation flow. public AzureActiveDirectoryValidation Validation { get; set; } - /// + /// Gets a value indicating whether the Azure AD configuration was auto-provisioned using 1st party tooling. + /// This is an internal flag primarily intended to support the Azure Management Portal. Users should not + /// read or write to this property. /// - [JsonProperty(PropertyName = "properties.isAutoProvisioned")] public bool? IsAutoProvisioned { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.Serialization.cs new file mode 100644 index 000000000000..e0d32b44fc40 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.Serialization.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AzureActiveDirectoryLogin : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(DisableWWWAuthenticate)) + { + writer.WritePropertyName("disableWWWAuthenticate"); + writer.WriteBooleanValue(DisableWWWAuthenticate.Value); + } + if (Optional.IsCollectionDefined(LoginParameters)) + { + writer.WritePropertyName("loginParameters"); + writer.WriteStartArray(); + foreach (var item in LoginParameters) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AzureActiveDirectoryLogin DeserializeAzureActiveDirectoryLogin(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional disableWWWAuthenticate = default; + Optional> loginParameters = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("disableWWWAuthenticate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + disableWWWAuthenticate = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("loginParameters")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + loginParameters = array; + continue; + } + } + continue; + } + } + return new AzureActiveDirectoryLogin(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(disableWWWAuthenticate), Optional.ToList(loginParameters)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.cs index 108a38b756cf..27da8519f256 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.cs @@ -1,62 +1,45 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the Azure Active Directory login flow. public partial class AzureActiveDirectoryLogin : ProxyOnlyResource { - /// - /// Initializes a new instance of the AzureActiveDirectoryLogin class. - /// + /// Initializes a new instance of AzureActiveDirectoryLogin. public AzureActiveDirectoryLogin() { - CustomInit(); + LoginParameters = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the AzureActiveDirectoryLogin class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public AzureActiveDirectoryLogin(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? disableWWWAuthenticate = default(bool?), IList loginParameters = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of AzureActiveDirectoryLogin. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// . + /// + /// Login parameters to send to the OpenID Connect authorization endpoint when + /// a user logs in. Each parameter must be in the form "key=value". + /// + internal AzureActiveDirectoryLogin(string id, string name, string kind, string type, bool? disableWWWAuthenticate, IList loginParameters) : base(id, name, kind, type) { DisableWWWAuthenticate = disableWWWAuthenticate; LoginParameters = loginParameters; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.disableWWWAuthenticate")] public bool? DisableWWWAuthenticate { get; set; } - /// + /// Login parameters to send to the OpenID Connect authorization endpoint when + /// a user logs in. Each parameter must be in the form "key=value". /// - [JsonProperty(PropertyName = "properties.loginParameters")] - public IList LoginParameters { get; set; } - + public IList LoginParameters { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.Serialization.cs new file mode 100644 index 000000000000..2c9381862ff1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AzureActiveDirectoryRegistration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(OpenIdIssuer)) + { + writer.WritePropertyName("openIdIssuer"); + writer.WriteStringValue(OpenIdIssuer); + } + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"); + writer.WriteStringValue(ClientId); + } + if (Optional.IsDefined(ClientSecretSettingName)) + { + writer.WritePropertyName("clientSecretSettingName"); + writer.WriteStringValue(ClientSecretSettingName); + } + if (Optional.IsDefined(ClientSecretCertificateThumbprint)) + { + writer.WritePropertyName("clientSecretCertificateThumbprint"); + writer.WriteStringValue(ClientSecretCertificateThumbprint); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AzureActiveDirectoryRegistration DeserializeAzureActiveDirectoryRegistration(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional openIdIssuer = default; + Optional clientId = default; + Optional clientSecretSettingName = default; + Optional clientSecretCertificateThumbprint = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("openIdIssuer")) + { + openIdIssuer = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientId")) + { + clientId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientSecretSettingName")) + { + clientSecretSettingName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientSecretCertificateThumbprint")) + { + clientSecretCertificateThumbprint = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new AzureActiveDirectoryRegistration(id.Value, name.Value, kind.Value, type.Value, openIdIssuer.Value, clientId.Value, clientSecretSettingName.Value, clientSecretCertificateThumbprint.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.cs index 28c6a7986420..11dfa562d4a0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.cs @@ -1,74 +1,70 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the Azure Active Directory app registration. public partial class AzureActiveDirectoryRegistration : ProxyOnlyResource { - /// - /// Initializes a new instance of the AzureActiveDirectoryRegistration - /// class. - /// + /// Initializes a new instance of AzureActiveDirectoryRegistration. public AzureActiveDirectoryRegistration() { - CustomInit(); } - /// - /// Initializes a new instance of the AzureActiveDirectoryRegistration - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public AzureActiveDirectoryRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string openIdIssuer = default(string), string clientId = default(string), string clientSecretSettingName = default(string), string clientSecretCertificateThumbprint = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of AzureActiveDirectoryRegistration. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// + /// The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. + /// When using Azure Active Directory, this value is the URI of the directory tenant, e.g. https://login.microsoftonline.com/v2.0/{tenant-guid}/. + /// This URI is a case-sensitive identifier for the token issuer. + /// More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. + /// + /// + /// The Client ID of this relying party application, known as the client_id. + /// This setting is required for enabling OpenID Connection authentication with Azure Active Directory or + /// other 3rd party OpenID Connect providers. + /// More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + /// + /// The app setting name that contains the client secret of the relying party application. + /// + /// An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as + /// a replacement for the Client Secret. It is also optional. + /// + internal AzureActiveDirectoryRegistration(string id, string name, string kind, string type, string openIdIssuer, string clientId, string clientSecretSettingName, string clientSecretCertificateThumbprint) : base(id, name, kind, type) { OpenIdIssuer = openIdIssuer; ClientId = clientId; ClientSecretSettingName = clientSecretSettingName; ClientSecretCertificateThumbprint = clientSecretCertificateThumbprint; - CustomInit(); } /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// + /// The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. + /// When using Azure Active Directory, this value is the URI of the directory tenant, e.g. https://login.microsoftonline.com/v2.0/{tenant-guid}/. + /// This URI is a case-sensitive identifier for the token issuer. + /// More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. /// - [JsonProperty(PropertyName = "properties.openIdIssuer")] public string OpenIdIssuer { get; set; } - /// + /// The Client ID of this relying party application, known as the client_id. + /// This setting is required for enabling OpenID Connection authentication with Azure Active Directory or + /// other 3rd party OpenID Connect providers. + /// More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. /// - [JsonProperty(PropertyName = "properties.clientId")] public string ClientId { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.clientSecretSettingName")] + /// The app setting name that contains the client secret of the relying party application. public string ClientSecretSettingName { get; set; } - /// + /// An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as + /// a replacement for the Client Secret. It is also optional. /// - [JsonProperty(PropertyName = "properties.clientSecretCertificateThumbprint")] public string ClientSecretCertificateThumbprint { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.Serialization.cs new file mode 100644 index 000000000000..bda8d9ef8598 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.Serialization.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AzureActiveDirectoryValidation : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(JwtClaimChecks)) + { + writer.WritePropertyName("jwtClaimChecks"); + writer.WriteObjectValue(JwtClaimChecks); + } + if (Optional.IsCollectionDefined(AllowedAudiences)) + { + writer.WritePropertyName("allowedAudiences"); + writer.WriteStartArray(); + foreach (var item in AllowedAudiences) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AzureActiveDirectoryValidation DeserializeAzureActiveDirectoryValidation(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional jwtClaimChecks = default; + Optional> allowedAudiences = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("jwtClaimChecks")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + jwtClaimChecks = JwtClaimChecks.DeserializeJwtClaimChecks(property0.Value); + continue; + } + if (property0.NameEquals("allowedAudiences")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedAudiences = array; + continue; + } + } + continue; + } + } + return new AzureActiveDirectoryValidation(id.Value, name.Value, kind.Value, type.Value, jwtClaimChecks.Value, Optional.ToList(allowedAudiences)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.cs index 4122b36d7f76..48104650098c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.cs @@ -1,64 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the Azure Active Directory token validation flow. public partial class AzureActiveDirectoryValidation : ProxyOnlyResource { - /// - /// Initializes a new instance of the AzureActiveDirectoryValidation - /// class. - /// + /// Initializes a new instance of AzureActiveDirectoryValidation. public AzureActiveDirectoryValidation() { - CustomInit(); + AllowedAudiences = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the AzureActiveDirectoryValidation - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public AzureActiveDirectoryValidation(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), JwtClaimChecks jwtClaimChecks = default(JwtClaimChecks), IList allowedAudiences = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of AzureActiveDirectoryValidation. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The configuration settings of the checks that should be made while validating the JWT Claims. + /// The list of audiences that can make successful authentication/authorization requests. + internal AzureActiveDirectoryValidation(string id, string name, string kind, string type, JwtClaimChecks jwtClaimChecks, IList allowedAudiences) : base(id, name, kind, type) { JwtClaimChecks = jwtClaimChecks; AllowedAudiences = allowedAudiences; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.jwtClaimChecks")] + /// The configuration settings of the checks that should be made while validating the JWT Claims. public JwtClaimChecks JwtClaimChecks { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.allowedAudiences")] - public IList AllowedAudiences { get; set; } - + /// The list of audiences that can make successful authentication/authorization requests. + public IList AllowedAudiences { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.Serialization.cs new file mode 100644 index 000000000000..975035246dc3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.Serialization.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AzureBlobStorageApplicationLogsConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Level)) + { + writer.WritePropertyName("level"); + writer.WriteStringValue(Level.Value.ToSerialString()); + } + if (Optional.IsDefined(SasUrl)) + { + writer.WritePropertyName("sasUrl"); + writer.WriteStringValue(SasUrl); + } + if (Optional.IsDefined(RetentionInDays)) + { + writer.WritePropertyName("retentionInDays"); + writer.WriteNumberValue(RetentionInDays.Value); + } + writer.WriteEndObject(); + } + + internal static AzureBlobStorageApplicationLogsConfig DeserializeAzureBlobStorageApplicationLogsConfig(JsonElement element) + { + Optional level = default; + Optional sasUrl = default; + Optional retentionInDays = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("level")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + level = property.Value.GetString().ToLogLevel(); + continue; + } + if (property.NameEquals("sasUrl")) + { + sasUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("retentionInDays")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + retentionInDays = property.Value.GetInt32(); + continue; + } + } + return new AzureBlobStorageApplicationLogsConfig(Optional.ToNullable(level), sasUrl.Value, Optional.ToNullable(retentionInDays)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.cs index dbfaddf80d36..ef35b9d02623 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.cs @@ -1,77 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Application logs azure blob storage configuration. - /// + /// Application logs azure blob storage configuration. public partial class AzureBlobStorageApplicationLogsConfig { - /// - /// Initializes a new instance of the - /// AzureBlobStorageApplicationLogsConfig class. - /// + /// Initializes a new instance of AzureBlobStorageApplicationLogsConfig. public AzureBlobStorageApplicationLogsConfig() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// AzureBlobStorageApplicationLogsConfig class. - /// - /// Log level. Possible values include: 'Off', - /// 'Verbose', 'Information', 'Warning', 'Error' - /// SAS url to a azure blob container with - /// read/write/list/delete permissions. - /// Retention in days. + /// Initializes a new instance of AzureBlobStorageApplicationLogsConfig. + /// Log level. + /// SAS url to a azure blob container with read/write/list/delete permissions. + /// + /// Retention in days. /// Remove blobs older than X days. - /// 0 or lower means no retention. - public AzureBlobStorageApplicationLogsConfig(LogLevel? level = default(LogLevel?), string sasUrl = default(string), int? retentionInDays = default(int?)) + /// 0 or lower means no retention. + /// + internal AzureBlobStorageApplicationLogsConfig(LogLevel? level, string sasUrl, int? retentionInDays) { Level = level; SasUrl = sasUrl; RetentionInDays = retentionInDays; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets log level. Possible values include: 'Off', 'Verbose', - /// 'Information', 'Warning', 'Error' - /// - [JsonProperty(PropertyName = "level")] + /// Log level. public LogLevel? Level { get; set; } - - /// - /// Gets or sets SAS url to a azure blob container with - /// read/write/list/delete permissions. - /// - [JsonProperty(PropertyName = "sasUrl")] + /// SAS url to a azure blob container with read/write/list/delete permissions. public string SasUrl { get; set; } - /// - /// Gets or sets retention in days. + /// Retention in days. /// Remove blobs older than X days. /// 0 or lower means no retention. /// - [JsonProperty(PropertyName = "retentionInDays")] public int? RetentionInDays { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.Serialization.cs new file mode 100644 index 000000000000..319372c375c4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.Serialization.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AzureBlobStorageHttpLogsConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(SasUrl)) + { + writer.WritePropertyName("sasUrl"); + writer.WriteStringValue(SasUrl); + } + if (Optional.IsDefined(RetentionInDays)) + { + writer.WritePropertyName("retentionInDays"); + writer.WriteNumberValue(RetentionInDays.Value); + } + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + writer.WriteEndObject(); + } + + internal static AzureBlobStorageHttpLogsConfig DeserializeAzureBlobStorageHttpLogsConfig(JsonElement element) + { + Optional sasUrl = default; + Optional retentionInDays = default; + Optional enabled = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sasUrl")) + { + sasUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("retentionInDays")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + retentionInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("enabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + } + return new AzureBlobStorageHttpLogsConfig(sasUrl.Value, Optional.ToNullable(retentionInDays), Optional.ToNullable(enabled)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.cs index c192a6ca93fe..c1fb93c28e14 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.cs @@ -1,77 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Http logs to azure blob storage configuration. - /// + /// Http logs to azure blob storage configuration. public partial class AzureBlobStorageHttpLogsConfig { - /// - /// Initializes a new instance of the AzureBlobStorageHttpLogsConfig - /// class. - /// + /// Initializes a new instance of AzureBlobStorageHttpLogsConfig. public AzureBlobStorageHttpLogsConfig() { - CustomInit(); } - /// - /// Initializes a new instance of the AzureBlobStorageHttpLogsConfig - /// class. - /// - /// SAS url to a azure blob container with - /// read/write/list/delete permissions. - /// Retention in days. + /// Initializes a new instance of AzureBlobStorageHttpLogsConfig. + /// SAS url to a azure blob container with read/write/list/delete permissions. + /// + /// Retention in days. /// Remove blobs older than X days. - /// 0 or lower means no retention. - /// True if configuration is enabled, false if it - /// is disabled and null if configuration is not set. - public AzureBlobStorageHttpLogsConfig(string sasUrl = default(string), int? retentionInDays = default(int?), bool? enabled = default(bool?)) + /// 0 or lower means no retention. + /// + /// True if configuration is enabled, false if it is disabled and null if configuration is not set. + internal AzureBlobStorageHttpLogsConfig(string sasUrl, int? retentionInDays, bool? enabled) { SasUrl = sasUrl; RetentionInDays = retentionInDays; Enabled = enabled; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets SAS url to a azure blob container with - /// read/write/list/delete permissions. - /// - [JsonProperty(PropertyName = "sasUrl")] + /// SAS url to a azure blob container with read/write/list/delete permissions. public string SasUrl { get; set; } - /// - /// Gets or sets retention in days. + /// Retention in days. /// Remove blobs older than X days. /// 0 or lower means no retention. /// - [JsonProperty(PropertyName = "retentionInDays")] public int? RetentionInDays { get; set; } - - /// - /// Gets or sets true if configuration is enabled, false if it is - /// disabled and null if configuration is not set. - /// - [JsonProperty(PropertyName = "enabled")] + /// True if configuration is enabled, false if it is disabled and null if configuration is not set. public bool? Enabled { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.Serialization.cs new file mode 100644 index 000000000000..f51022705820 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class AzureResourceTypeExtensions + { + public static string ToSerialString(this AzureResourceType value) => value switch + { + AzureResourceType.Website => "Website", + AzureResourceType.TrafficManager => "TrafficManager", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureResourceType value.") + }; + + public static AzureResourceType ToAzureResourceType(this string value) + { + if (string.Equals(value, "Website", StringComparison.InvariantCultureIgnoreCase)) return AzureResourceType.Website; + if (string.Equals(value, "TrafficManager", StringComparison.InvariantCultureIgnoreCase)) return AzureResourceType.TrafficManager; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureResourceType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.cs index ea35b94ba2e5..c9c779a4b5f4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for AzureResourceType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Type of the Azure resource the hostname is assigned to. public enum AzureResourceType { - [EnumMember(Value = "Website")] + /// Website. Website, - [EnumMember(Value = "TrafficManager")] + /// TrafficManager. TrafficManager } - internal static class AzureResourceTypeEnumExtension - { - internal static string ToSerializedValue(this AzureResourceType? value) - { - return value == null ? null : ((AzureResourceType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this AzureResourceType value) - { - switch( value ) - { - case AzureResourceType.Website: - return "Website"; - case AzureResourceType.TrafficManager: - return "TrafficManager"; - } - return null; - } - - internal static AzureResourceType? ParseAzureResourceType(this string value) - { - switch( value ) - { - case "Website": - return AzureResourceType.Website; - case "TrafficManager": - return AzureResourceType.TrafficManager; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.Serialization.cs new file mode 100644 index 000000000000..cae093bcd089 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.Serialization.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AzureStaticWebApps : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Registration)) + { + writer.WritePropertyName("registration"); + writer.WriteObjectValue(Registration); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AzureStaticWebApps DeserializeAzureStaticWebApps(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional registration = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("registration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + registration = AzureStaticWebAppsRegistration.DeserializeAzureStaticWebAppsRegistration(property0.Value); + continue; + } + } + continue; + } + } + return new AzureStaticWebApps(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs new file mode 100644 index 000000000000..75e5fa73466f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The configuration settings of the Azure Static Web Apps provider. + public partial class AzureStaticWebApps : ProxyOnlyResource + { + /// Initializes a new instance of AzureStaticWebApps. + public AzureStaticWebApps() + { + } + + /// Initializes a new instance of AzureStaticWebApps. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// The configuration settings of the Azure Static Web Apps registration. + internal AzureStaticWebApps(string id, string name, string kind, string type, bool? enabled, AzureStaticWebAppsRegistration registration) : base(id, name, kind, type) + { + Enabled = enabled; + Registration = registration; + } + + /// <code>false</code> if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, <code>true</code>. + public bool? Enabled { get; set; } + /// The configuration settings of the Azure Static Web Apps registration. + public AzureStaticWebAppsRegistration Registration { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.Serialization.cs new file mode 100644 index 000000000000..c5880b9911f9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AzureStaticWebAppsRegistration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"); + writer.WriteStringValue(ClientId); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AzureStaticWebAppsRegistration DeserializeAzureStaticWebAppsRegistration(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional clientId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("clientId")) + { + clientId = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new AzureStaticWebAppsRegistration(id.Value, name.Value, kind.Value, type.Value, clientId.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs new file mode 100644 index 000000000000..7d122e03f36f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The configuration settings of the registration for the Azure Static Web Apps provider. + public partial class AzureStaticWebAppsRegistration : ProxyOnlyResource + { + /// Initializes a new instance of AzureStaticWebAppsRegistration. + public AzureStaticWebAppsRegistration() + { + } + + /// Initializes a new instance of AzureStaticWebAppsRegistration. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Client ID of the app used for login. + internal AzureStaticWebAppsRegistration(string id, string name, string kind, string type, string clientId) : base(id, name, kind, type) + { + ClientId = clientId; + } + + /// The Client ID of the app used for login. + public string ClientId { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.Serialization.cs new file mode 100644 index 000000000000..ba1c2552d158 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AzureStorageInfoValue : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.Value.ToSerialString()); + } + if (Optional.IsDefined(AccountName)) + { + writer.WritePropertyName("accountName"); + writer.WriteStringValue(AccountName); + } + if (Optional.IsDefined(ShareName)) + { + writer.WritePropertyName("shareName"); + writer.WriteStringValue(ShareName); + } + if (Optional.IsDefined(AccessKey)) + { + writer.WritePropertyName("accessKey"); + writer.WriteStringValue(AccessKey); + } + if (Optional.IsDefined(MountPath)) + { + writer.WritePropertyName("mountPath"); + writer.WriteStringValue(MountPath); + } + writer.WriteEndObject(); + } + + internal static AzureStorageInfoValue DeserializeAzureStorageInfoValue(JsonElement element) + { + Optional type = default; + Optional accountName = default; + Optional shareName = default; + Optional accessKey = default; + Optional mountPath = default; + Optional state = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + type = property.Value.GetString().ToAzureStorageType(); + continue; + } + if (property.NameEquals("accountName")) + { + accountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("shareName")) + { + shareName = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessKey")) + { + accessKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("mountPath")) + { + mountPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("state")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + state = property.Value.GetString().ToAzureStorageState(); + continue; + } + } + return new AzureStorageInfoValue(Optional.ToNullable(type), accountName.Value, shareName.Value, accessKey.Value, mountPath.Value, Optional.ToNullable(state)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs index a0dec36fc138..a187e4ab2246 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs @@ -1,46 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Azure Files or Blob Storage access information value for dictionary - /// storage. - /// + /// Azure Files or Blob Storage access information value for dictionary storage. public partial class AzureStorageInfoValue { - /// - /// Initializes a new instance of the AzureStorageInfoValue class. - /// + /// Initializes a new instance of AzureStorageInfoValue. public AzureStorageInfoValue() { - CustomInit(); } - /// - /// Initializes a new instance of the AzureStorageInfoValue class. - /// - /// Type of storage. Possible values include: - /// 'AzureFiles', 'AzureBlob' - /// Name of the storage account. - /// Name of the file share (container name, for - /// Blob storage). - /// Access key for the storage account. - /// Path to mount the storage within the site's - /// runtime environment. - /// State of the storage account. Possible values - /// include: 'Ok', 'InvalidCredentials', 'InvalidShare' - public AzureStorageInfoValue(AzureStorageType? type = default(AzureStorageType?), string accountName = default(string), string shareName = default(string), string accessKey = default(string), string mountPath = default(string), AzureStorageState? state = default(AzureStorageState?)) + /// Initializes a new instance of AzureStorageInfoValue. + /// Type of storage. + /// Name of the storage account. + /// Name of the file share (container name, for Blob storage). + /// Access key for the storage account. + /// Path to mount the storage within the site's runtime environment. + /// State of the storage account. + internal AzureStorageInfoValue(AzureStorageType? type, string accountName, string shareName, string accessKey, string mountPath, AzureStorageState? state) { Type = type; AccountName = accountName; @@ -48,53 +30,19 @@ public AzureStorageInfoValue() AccessKey = accessKey; MountPath = mountPath; State = state; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets type of storage. Possible values include: - /// 'AzureFiles', 'AzureBlob' - /// - [JsonProperty(PropertyName = "type")] + /// Type of storage. public AzureStorageType? Type { get; set; } - - /// - /// Gets or sets name of the storage account. - /// - [JsonProperty(PropertyName = "accountName")] + /// Name of the storage account. public string AccountName { get; set; } - - /// - /// Gets or sets name of the file share (container name, for Blob - /// storage). - /// - [JsonProperty(PropertyName = "shareName")] + /// Name of the file share (container name, for Blob storage). public string ShareName { get; set; } - - /// - /// Gets or sets access key for the storage account. - /// - [JsonProperty(PropertyName = "accessKey")] + /// Access key for the storage account. public string AccessKey { get; set; } - - /// - /// Gets or sets path to mount the storage within the site's runtime - /// environment. - /// - [JsonProperty(PropertyName = "mountPath")] + /// Path to mount the storage within the site's runtime environment. public string MountPath { get; set; } - - /// - /// Gets state of the storage account. Possible values include: 'Ok', - /// 'InvalidCredentials', 'InvalidShare' - /// - [JsonProperty(PropertyName = "state")] - public AzureStorageState? State { get; private set; } - + /// State of the storage account. + public AzureStorageState? State { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.Serialization.cs new file mode 100644 index 000000000000..922c6123da60 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.Serialization.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AzureStoragePropertyDictionaryResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + foreach (var item in Properties) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WriteEndObject(); + } + + internal static AzureStoragePropertyDictionaryResource DeserializeAzureStoragePropertyDictionaryResource(JsonElement element) + { + Optional> properties = default; + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, AzureStorageInfoValue.DeserializeAzureStorageInfoValue(property0.Value)); + } + properties = dictionary; + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + } + return new AzureStoragePropertyDictionaryResource(id.Value, name.Value, kind.Value, type.Value, Optional.ToDictionary(properties)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.cs index 331960cea659..3cbeb5a43e65 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.cs @@ -1,60 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// AzureStorageInfo dictionary resource. - /// + /// AzureStorageInfo dictionary resource. public partial class AzureStoragePropertyDictionaryResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the - /// AzureStoragePropertyDictionaryResource class. - /// + /// Initializes a new instance of AzureStoragePropertyDictionaryResource. public AzureStoragePropertyDictionaryResource() { - CustomInit(); + Properties = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the - /// AzureStoragePropertyDictionaryResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Azure storage accounts. - public AzureStoragePropertyDictionaryResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary properties = default(IDictionary)) - : base(id, name, kind, type) + /// Initializes a new instance of AzureStoragePropertyDictionaryResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Azure storage accounts. + internal AzureStoragePropertyDictionaryResource(string id, string name, string kind, string type, IDictionary properties) : base(id, name, kind, type) { Properties = properties; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets azure storage accounts. - /// - [JsonProperty(PropertyName = "properties")] - public IDictionary Properties { get; set; } - + /// Azure storage accounts. + public IDictionary Properties { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.Serialization.cs new file mode 100644 index 000000000000..0ef989d0b238 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class AzureStorageStateExtensions + { + public static string ToSerialString(this AzureStorageState value) => value switch + { + AzureStorageState.Ok => "Ok", + AzureStorageState.InvalidCredentials => "InvalidCredentials", + AzureStorageState.InvalidShare => "InvalidShare", + AzureStorageState.NotValidated => "NotValidated", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureStorageState value.") + }; + + public static AzureStorageState ToAzureStorageState(this string value) + { + if (string.Equals(value, "Ok", StringComparison.InvariantCultureIgnoreCase)) return AzureStorageState.Ok; + if (string.Equals(value, "InvalidCredentials", StringComparison.InvariantCultureIgnoreCase)) return AzureStorageState.InvalidCredentials; + if (string.Equals(value, "InvalidShare", StringComparison.InvariantCultureIgnoreCase)) return AzureStorageState.InvalidShare; + if (string.Equals(value, "NotValidated", StringComparison.InvariantCultureIgnoreCase)) return AzureStorageState.NotValidated; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureStorageState value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs index 49d68d686c25..70bc96a6e1bd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs @@ -1,66 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for AzureStorageState. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// State of the storage account. public enum AzureStorageState { - [EnumMember(Value = "Ok")] + /// Ok. Ok, - [EnumMember(Value = "InvalidCredentials")] + /// InvalidCredentials. InvalidCredentials, - [EnumMember(Value = "InvalidShare")] - InvalidShare - } - internal static class AzureStorageStateEnumExtension - { - internal static string ToSerializedValue(this AzureStorageState? value) - { - return value == null ? null : ((AzureStorageState)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this AzureStorageState value) - { - switch( value ) - { - case AzureStorageState.Ok: - return "Ok"; - case AzureStorageState.InvalidCredentials: - return "InvalidCredentials"; - case AzureStorageState.InvalidShare: - return "InvalidShare"; - } - return null; - } - - internal static AzureStorageState? ParseAzureStorageState(this string value) - { - switch( value ) - { - case "Ok": - return AzureStorageState.Ok; - case "InvalidCredentials": - return AzureStorageState.InvalidCredentials; - case "InvalidShare": - return AzureStorageState.InvalidShare; - } - return null; - } + /// InvalidShare. + InvalidShare, + /// NotValidated. + NotValidated } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.Serialization.cs new file mode 100644 index 000000000000..05b1f95639b2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class AzureStorageTypeExtensions + { + public static string ToSerialString(this AzureStorageType value) => value switch + { + AzureStorageType.AzureFiles => "AzureFiles", + AzureStorageType.AzureBlob => "AzureBlob", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureStorageType value.") + }; + + public static AzureStorageType ToAzureStorageType(this string value) + { + if (string.Equals(value, "AzureFiles", StringComparison.InvariantCultureIgnoreCase)) return AzureStorageType.AzureFiles; + if (string.Equals(value, "AzureBlob", StringComparison.InvariantCultureIgnoreCase)) return AzureStorageType.AzureBlob; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureStorageType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.cs index 15dcdf17157f..c7998d792a5b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for AzureStorageType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Type of storage. public enum AzureStorageType { - [EnumMember(Value = "AzureFiles")] + /// AzureFiles. AzureFiles, - [EnumMember(Value = "AzureBlob")] + /// AzureBlob. AzureBlob } - internal static class AzureStorageTypeEnumExtension - { - internal static string ToSerializedValue(this AzureStorageType? value) - { - return value == null ? null : ((AzureStorageType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this AzureStorageType value) - { - switch( value ) - { - case AzureStorageType.AzureFiles: - return "AzureFiles"; - case AzureStorageType.AzureBlob: - return "AzureBlob"; - } - return null; - } - - internal static AzureStorageType? ParseAzureStorageType(this string value) - { - switch( value ) - { - case "AzureFiles": - return AzureStorageType.AzureFiles; - case "AzureBlob": - return AzureStorageType.AzureBlob; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.Serialization.cs new file mode 100644 index 000000000000..bba00e73d938 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class AzureTableStorageApplicationLogsConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Level)) + { + writer.WritePropertyName("level"); + writer.WriteStringValue(Level.Value.ToSerialString()); + } + writer.WritePropertyName("sasUrl"); + writer.WriteStringValue(SasUrl); + writer.WriteEndObject(); + } + + internal static AzureTableStorageApplicationLogsConfig DeserializeAzureTableStorageApplicationLogsConfig(JsonElement element) + { + Optional level = default; + string sasUrl = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("level")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + level = property.Value.GetString().ToLogLevel(); + continue; + } + if (property.NameEquals("sasUrl")) + { + sasUrl = property.Value.GetString(); + continue; + } + } + return new AzureTableStorageApplicationLogsConfig(Optional.ToNullable(level), sasUrl); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.cs index a44928dcfd91..77d8c07f6022 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.cs @@ -1,79 +1,42 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Application logs to Azure table storage configuration. - /// + /// Application logs to Azure table storage configuration. public partial class AzureTableStorageApplicationLogsConfig { - /// - /// Initializes a new instance of the - /// AzureTableStorageApplicationLogsConfig class. - /// - public AzureTableStorageApplicationLogsConfig() + /// Initializes a new instance of AzureTableStorageApplicationLogsConfig. + /// SAS URL to an Azure table with add/query/delete permissions. + /// is null. + public AzureTableStorageApplicationLogsConfig(string sasUrl) { - CustomInit(); + if (sasUrl == null) + { + throw new ArgumentNullException(nameof(sasUrl)); + } + + SasUrl = sasUrl; } - /// - /// Initializes a new instance of the - /// AzureTableStorageApplicationLogsConfig class. - /// - /// SAS URL to an Azure table with - /// add/query/delete permissions. - /// Log level. Possible values include: 'Off', - /// 'Verbose', 'Information', 'Warning', 'Error' - public AzureTableStorageApplicationLogsConfig(string sasUrl, LogLevel? level = default(LogLevel?)) + /// Initializes a new instance of AzureTableStorageApplicationLogsConfig. + /// Log level. + /// SAS URL to an Azure table with add/query/delete permissions. + internal AzureTableStorageApplicationLogsConfig(LogLevel? level, string sasUrl) { Level = level; SasUrl = sasUrl; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets log level. Possible values include: 'Off', 'Verbose', - /// 'Information', 'Warning', 'Error' - /// - [JsonProperty(PropertyName = "level")] + /// Log level. public LogLevel? Level { get; set; } - - /// - /// Gets or sets SAS URL to an Azure table with add/query/delete - /// permissions. - /// - [JsonProperty(PropertyName = "sasUrl")] + /// SAS URL to an Azure table with add/query/delete permissions. public string SasUrl { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (SasUrl == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SasUrl"); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.Serialization.cs new file mode 100644 index 000000000000..f7e8e5d022d4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class BackupItem : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static BackupItem DeserializeBackupItem(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional id0 = default; + Optional storageAccountUrl = default; + Optional blobName = default; + Optional name0 = default; + Optional status = default; + Optional sizeInBytes = default; + Optional created = default; + Optional log = default; + Optional> databases = default; + Optional scheduled = default; + Optional lastRestoreTimeStamp = default; + Optional finishedTimeStamp = default; + Optional correlationId = default; + Optional websiteSizeInBytes = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("id")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + id0 = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("storageAccountUrl")) + { + storageAccountUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("blobName")) + { + blobName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("name")) + { + name0 = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property0.Value.GetString().ToBackupItemStatus(); + continue; + } + if (property0.NameEquals("sizeInBytes")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + sizeInBytes = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("created")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + created = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("log")) + { + log = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("databases")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DatabaseBackupSetting.DeserializeDatabaseBackupSetting(item)); + } + databases = array; + continue; + } + if (property0.NameEquals("scheduled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + scheduled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("lastRestoreTimeStamp")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + lastRestoreTimeStamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("finishedTimeStamp")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + finishedTimeStamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("correlationId")) + { + correlationId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("websiteSizeInBytes")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + websiteSizeInBytes = property0.Value.GetInt64(); + continue; + } + } + continue; + } + } + return new BackupItem(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(id0), storageAccountUrl.Value, blobName.Value, name0.Value, Optional.ToNullable(status), Optional.ToNullable(sizeInBytes), Optional.ToNullable(created), log.Value, Optional.ToList(databases), Optional.ToNullable(scheduled), Optional.ToNullable(lastRestoreTimeStamp), Optional.ToNullable(finishedTimeStamp), correlationId.Value, Optional.ToNullable(websiteSizeInBytes)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.cs index d88db9a81169..61b9f974c8dd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.cs @@ -1,77 +1,50 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Backup description. - /// - [Rest.Serialization.JsonTransformation] + /// Backup description. public partial class BackupItem : ProxyOnlyResource { - /// - /// Initializes a new instance of the BackupItem class. - /// + /// Initializes a new instance of BackupItem. public BackupItem() { - CustomInit(); + Databases = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the BackupItem class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Id of the backup. - /// SAS URL for the storage account - /// container which contains this backup. - /// Name of the blob which contains data for - /// this backup. - /// Name of this backup. - /// Backup status. Possible values include: - /// 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created', - /// 'Skipped', 'PartiallySucceeded', 'DeleteInProgress', - /// 'DeleteFailed', 'Deleted' - /// Size of the backup in bytes. - /// Timestamp of the backup creation. - /// Details regarding this backup. Might contain an - /// error message. - /// List of databases included in the - /// backup. - /// True if this backup has been created due to - /// a schedule being triggered. - /// Timestamp of a last restore - /// operation which used this backup. - /// Timestamp when this backup - /// finished. - /// Unique correlation identifier. Please - /// use this along with the timestamp while communicating with Azure - /// support. - /// Size of the original web app which - /// has been backed up. - public BackupItem(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? backupId = default(int?), string storageAccountUrl = default(string), string blobName = default(string), string backupItemName = default(string), BackupItemStatus? status = default(BackupItemStatus?), long? sizeInBytes = default(long?), System.DateTime? created = default(System.DateTime?), string log = default(string), IList databases = default(IList), bool? scheduled = default(bool?), System.DateTime? lastRestoreTimeStamp = default(System.DateTime?), System.DateTime? finishedTimeStamp = default(System.DateTime?), string correlationId = default(string), long? websiteSizeInBytes = default(long?)) - : base(id, name, kind, type) + /// Initializes a new instance of BackupItem. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Id of the backup. + /// SAS URL for the storage account container which contains this backup. + /// Name of the blob which contains data for this backup. + /// Name of this backup. + /// Backup status. + /// Size of the backup in bytes. + /// Timestamp of the backup creation. + /// Details regarding this backup. Might contain an error message. + /// List of databases included in the backup. + /// True if this backup has been created due to a schedule being triggered. + /// Timestamp of a last restore operation which used this backup. + /// Timestamp when this backup finished. + /// Unique correlation identifier. Please use this along with the timestamp while communicating with Azure support. + /// Size of the original web app which has been backed up. + internal BackupItem(string id, string name, string kind, string type, int? backupId, string storageAccountUrl, string blobName, string namePropertiesName, BackupItemStatus? status, long? sizeInBytes, DateTimeOffset? created, string log, IReadOnlyList databases, bool? scheduled, DateTimeOffset? lastRestoreTimeStamp, DateTimeOffset? finishedTimeStamp, string correlationId, long? websiteSizeInBytes) : base(id, name, kind, type) { BackupId = backupId; StorageAccountUrl = storageAccountUrl; BlobName = blobName; - BackupItemName = backupItemName; + NamePropertiesName = namePropertiesName; Status = status; SizeInBytes = sizeInBytes; Created = created; @@ -82,102 +55,35 @@ public BackupItem() FinishedTimeStamp = finishedTimeStamp; CorrelationId = correlationId; WebsiteSizeInBytes = websiteSizeInBytes; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets id of the backup. - /// - [JsonProperty(PropertyName = "properties.id")] - public int? BackupId { get; private set; } - - /// - /// Gets SAS URL for the storage account container which contains this - /// backup. - /// - [JsonProperty(PropertyName = "properties.storageAccountUrl")] - public string StorageAccountUrl { get; private set; } - - /// - /// Gets name of the blob which contains data for this backup. - /// - [JsonProperty(PropertyName = "properties.blobName")] - public string BlobName { get; private set; } - - /// - /// Gets name of this backup. - /// - [JsonProperty(PropertyName = "properties.name")] - public string BackupItemName { get; private set; } - - /// - /// Gets backup status. Possible values include: 'InProgress', - /// 'Failed', 'Succeeded', 'TimedOut', 'Created', 'Skipped', - /// 'PartiallySucceeded', 'DeleteInProgress', 'DeleteFailed', 'Deleted' - /// - [JsonProperty(PropertyName = "properties.status")] - public BackupItemStatus? Status { get; private set; } - - /// - /// Gets size of the backup in bytes. - /// - [JsonProperty(PropertyName = "properties.sizeInBytes")] - public long? SizeInBytes { get; private set; } - - /// - /// Gets timestamp of the backup creation. - /// - [JsonProperty(PropertyName = "properties.created")] - public System.DateTime? Created { get; private set; } - - /// - /// Gets details regarding this backup. Might contain an error message. - /// - [JsonProperty(PropertyName = "properties.log")] - public string Log { get; private set; } - - /// - /// Gets list of databases included in the backup. - /// - [JsonProperty(PropertyName = "properties.databases")] - public IList Databases { get; private set; } - - /// - /// Gets true if this backup has been created due to a schedule being - /// triggered. - /// - [JsonProperty(PropertyName = "properties.scheduled")] - public bool? Scheduled { get; private set; } - - /// - /// Gets timestamp of a last restore operation which used this backup. - /// - [JsonProperty(PropertyName = "properties.lastRestoreTimeStamp")] - public System.DateTime? LastRestoreTimeStamp { get; private set; } - - /// - /// Gets timestamp when this backup finished. - /// - [JsonProperty(PropertyName = "properties.finishedTimeStamp")] - public System.DateTime? FinishedTimeStamp { get; private set; } - - /// - /// Gets unique correlation identifier. Please use this along with the - /// timestamp while communicating with Azure support. - /// - [JsonProperty(PropertyName = "properties.correlationId")] - public string CorrelationId { get; private set; } - - /// - /// Gets size of the original web app which has been backed up. - /// - [JsonProperty(PropertyName = "properties.websiteSizeInBytes")] - public long? WebsiteSizeInBytes { get; private set; } - + /// Id of the backup. + public int? BackupId { get; } + /// SAS URL for the storage account container which contains this backup. + public string StorageAccountUrl { get; } + /// Name of the blob which contains data for this backup. + public string BlobName { get; } + /// Name of this backup. + public string NamePropertiesName { get; } + /// Backup status. + public BackupItemStatus? Status { get; } + /// Size of the backup in bytes. + public long? SizeInBytes { get; } + /// Timestamp of the backup creation. + public DateTimeOffset? Created { get; } + /// Details regarding this backup. Might contain an error message. + public string Log { get; } + /// List of databases included in the backup. + public IReadOnlyList Databases { get; } + /// True if this backup has been created due to a schedule being triggered. + public bool? Scheduled { get; } + /// Timestamp of a last restore operation which used this backup. + public DateTimeOffset? LastRestoreTimeStamp { get; } + /// Timestamp when this backup finished. + public DateTimeOffset? FinishedTimeStamp { get; } + /// Unique correlation identifier. Please use this along with the timestamp while communicating with Azure support. + public string CorrelationId { get; } + /// Size of the original web app which has been backed up. + public long? WebsiteSizeInBytes { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.Serialization.cs new file mode 100644 index 000000000000..23a5352e5f4f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class BackupItemCollection + { + internal static BackupItemCollection DeserializeBackupItemCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BackupItem.DeserializeBackupItem(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new BackupItemCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.cs new file mode 100644 index 000000000000..77467c50bd05 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of backup items. + internal partial class BackupItemCollection + { + /// Initializes a new instance of BackupItemCollection. + /// Collection of resources. + /// is null. + internal BackupItemCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of BackupItemCollection. + /// Collection of resources. + /// Link to next page of resources. + internal BackupItemCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.Serialization.cs new file mode 100644 index 000000000000..75e146ed7044 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.Serialization.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class BackupItemStatusExtensions + { + public static string ToSerialString(this BackupItemStatus value) => value switch + { + BackupItemStatus.InProgress => "InProgress", + BackupItemStatus.Failed => "Failed", + BackupItemStatus.Succeeded => "Succeeded", + BackupItemStatus.TimedOut => "TimedOut", + BackupItemStatus.Created => "Created", + BackupItemStatus.Skipped => "Skipped", + BackupItemStatus.PartiallySucceeded => "PartiallySucceeded", + BackupItemStatus.DeleteInProgress => "DeleteInProgress", + BackupItemStatus.DeleteFailed => "DeleteFailed", + BackupItemStatus.Deleted => "Deleted", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BackupItemStatus value.") + }; + + public static BackupItemStatus ToBackupItemStatus(this string value) + { + if (string.Equals(value, "InProgress", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.InProgress; + if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.Failed; + if (string.Equals(value, "Succeeded", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.Succeeded; + if (string.Equals(value, "TimedOut", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.TimedOut; + if (string.Equals(value, "Created", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.Created; + if (string.Equals(value, "Skipped", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.Skipped; + if (string.Equals(value, "PartiallySucceeded", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.PartiallySucceeded; + if (string.Equals(value, "DeleteInProgress", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.DeleteInProgress; + if (string.Equals(value, "DeleteFailed", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.DeleteFailed; + if (string.Equals(value, "Deleted", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.Deleted; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BackupItemStatus value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.cs index e2752ce9307d..fcc79e43bbaa 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.cs @@ -1,108 +1,34 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for BackupItemStatus. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Backup status. public enum BackupItemStatus { - [EnumMember(Value = "InProgress")] + /// InProgress. InProgress, - [EnumMember(Value = "Failed")] + /// Failed. Failed, - [EnumMember(Value = "Succeeded")] + /// Succeeded. Succeeded, - [EnumMember(Value = "TimedOut")] + /// TimedOut. TimedOut, - [EnumMember(Value = "Created")] + /// Created. Created, - [EnumMember(Value = "Skipped")] + /// Skipped. Skipped, - [EnumMember(Value = "PartiallySucceeded")] + /// PartiallySucceeded. PartiallySucceeded, - [EnumMember(Value = "DeleteInProgress")] + /// DeleteInProgress. DeleteInProgress, - [EnumMember(Value = "DeleteFailed")] + /// DeleteFailed. DeleteFailed, - [EnumMember(Value = "Deleted")] + /// Deleted. Deleted } - internal static class BackupItemStatusEnumExtension - { - internal static string ToSerializedValue(this BackupItemStatus? value) - { - return value == null ? null : ((BackupItemStatus)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this BackupItemStatus value) - { - switch( value ) - { - case BackupItemStatus.InProgress: - return "InProgress"; - case BackupItemStatus.Failed: - return "Failed"; - case BackupItemStatus.Succeeded: - return "Succeeded"; - case BackupItemStatus.TimedOut: - return "TimedOut"; - case BackupItemStatus.Created: - return "Created"; - case BackupItemStatus.Skipped: - return "Skipped"; - case BackupItemStatus.PartiallySucceeded: - return "PartiallySucceeded"; - case BackupItemStatus.DeleteInProgress: - return "DeleteInProgress"; - case BackupItemStatus.DeleteFailed: - return "DeleteFailed"; - case BackupItemStatus.Deleted: - return "Deleted"; - } - return null; - } - - internal static BackupItemStatus? ParseBackupItemStatus(this string value) - { - switch( value ) - { - case "InProgress": - return BackupItemStatus.InProgress; - case "Failed": - return BackupItemStatus.Failed; - case "Succeeded": - return BackupItemStatus.Succeeded; - case "TimedOut": - return BackupItemStatus.TimedOut; - case "Created": - return BackupItemStatus.Created; - case "Skipped": - return BackupItemStatus.Skipped; - case "PartiallySucceeded": - return BackupItemStatus.PartiallySucceeded; - case "DeleteInProgress": - return BackupItemStatus.DeleteInProgress; - case "DeleteFailed": - return BackupItemStatus.DeleteFailed; - case "Deleted": - return BackupItemStatus.Deleted; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.Serialization.cs new file mode 100644 index 000000000000..0d820c70a422 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class BackupRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(BackupName)) + { + writer.WritePropertyName("backupName"); + writer.WriteStringValue(BackupName); + } + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(StorageAccountUrl)) + { + writer.WritePropertyName("storageAccountUrl"); + writer.WriteStringValue(StorageAccountUrl); + } + if (Optional.IsDefined(BackupSchedule)) + { + writer.WritePropertyName("backupSchedule"); + writer.WriteObjectValue(BackupSchedule); + } + if (Optional.IsCollectionDefined(Databases)) + { + writer.WritePropertyName("databases"); + writer.WriteStartArray(); + foreach (var item in Databases) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static BackupRequest DeserializeBackupRequest(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional backupName = default; + Optional enabled = default; + Optional storageAccountUrl = default; + Optional backupSchedule = default; + Optional> databases = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("backupName")) + { + backupName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("storageAccountUrl")) + { + storageAccountUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("backupSchedule")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + backupSchedule = BackupSchedule.DeserializeBackupSchedule(property0.Value); + continue; + } + if (property0.NameEquals("databases")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DatabaseBackupSetting.DeserializeDatabaseBackupSetting(item)); + } + databases = array; + continue; + } + } + continue; + } + } + return new BackupRequest(id.Value, name.Value, kind.Value, type.Value, backupName.Value, Optional.ToNullable(enabled), storageAccountUrl.Value, backupSchedule.Value, Optional.ToList(databases)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.cs index 8a5bda6bc021..3c2a859a0248 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.cs @@ -1,126 +1,52 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Description of a backup which will be performed. - /// - [Rest.Serialization.JsonTransformation] + /// Description of a backup which will be performed. public partial class BackupRequest : ProxyOnlyResource { - /// - /// Initializes a new instance of the BackupRequest class. - /// + /// Initializes a new instance of BackupRequest. public BackupRequest() { - CustomInit(); + Databases = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the BackupRequest class. - /// - /// SAS URL to the container. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Name of the backup. - /// True if the backup schedule is enabled (must - /// be included in that case), false if the backup schedule should be - /// disabled. - /// Schedule for the backup if it is - /// executed periodically. - /// Databases included in the backup. - public BackupRequest(string storageAccountUrl, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string backupName = default(string), bool? enabled = default(bool?), BackupSchedule backupSchedule = default(BackupSchedule), IList databases = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of BackupRequest. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Name of the backup. + /// True if the backup schedule is enabled (must be included in that case), false if the backup schedule should be disabled. + /// SAS URL to the container. + /// Schedule for the backup if it is executed periodically. + /// Databases included in the backup. + internal BackupRequest(string id, string name, string kind, string type, string backupName, bool? enabled, string storageAccountUrl, BackupSchedule backupSchedule, IList databases) : base(id, name, kind, type) { BackupName = backupName; Enabled = enabled; StorageAccountUrl = storageAccountUrl; BackupSchedule = backupSchedule; Databases = databases; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the backup. - /// - [JsonProperty(PropertyName = "properties.backupName")] + /// Name of the backup. public string BackupName { get; set; } - - /// - /// Gets or sets true if the backup schedule is enabled (must be - /// included in that case), false if the backup schedule should be - /// disabled. - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// True if the backup schedule is enabled (must be included in that case), false if the backup schedule should be disabled. public bool? Enabled { get; set; } - - /// - /// Gets or sets SAS URL to the container. - /// - [JsonProperty(PropertyName = "properties.storageAccountUrl")] + /// SAS URL to the container. public string StorageAccountUrl { get; set; } - - /// - /// Gets or sets schedule for the backup if it is executed - /// periodically. - /// - [JsonProperty(PropertyName = "properties.backupSchedule")] + /// Schedule for the backup if it is executed periodically. public BackupSchedule BackupSchedule { get; set; } - - /// - /// Gets or sets databases included in the backup. - /// - [JsonProperty(PropertyName = "properties.databases")] - public IList Databases { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (StorageAccountUrl == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccountUrl"); - } - if (BackupSchedule != null) - { - BackupSchedule.Validate(); - } - if (Databases != null) - { - foreach (var element in Databases) - { - if (element != null) - { - element.Validate(); - } - } - } - } + /// Databases included in the backup. + public IList Databases { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.Serialization.cs new file mode 100644 index 000000000000..4a62674af966 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class BackupRestoreOperationTypeExtensions + { + public static string ToSerialString(this BackupRestoreOperationType value) => value switch + { + BackupRestoreOperationType.Default => "Default", + BackupRestoreOperationType.Clone => "Clone", + BackupRestoreOperationType.Relocation => "Relocation", + BackupRestoreOperationType.Snapshot => "Snapshot", + BackupRestoreOperationType.CloudFS => "CloudFS", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BackupRestoreOperationType value.") + }; + + public static BackupRestoreOperationType ToBackupRestoreOperationType(this string value) + { + if (string.Equals(value, "Default", StringComparison.InvariantCultureIgnoreCase)) return BackupRestoreOperationType.Default; + if (string.Equals(value, "Clone", StringComparison.InvariantCultureIgnoreCase)) return BackupRestoreOperationType.Clone; + if (string.Equals(value, "Relocation", StringComparison.InvariantCultureIgnoreCase)) return BackupRestoreOperationType.Relocation; + if (string.Equals(value, "Snapshot", StringComparison.InvariantCultureIgnoreCase)) return BackupRestoreOperationType.Snapshot; + if (string.Equals(value, "CloudFS", StringComparison.InvariantCultureIgnoreCase)) return BackupRestoreOperationType.CloudFS; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BackupRestoreOperationType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.cs index bc7721d2bbd7..3ed80c4e6a83 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.cs @@ -1,78 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for BackupRestoreOperationType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Operation type. public enum BackupRestoreOperationType { - [EnumMember(Value = "Default")] + /// Default. Default, - [EnumMember(Value = "Clone")] + /// Clone. Clone, - [EnumMember(Value = "Relocation")] + /// Relocation. Relocation, - [EnumMember(Value = "Snapshot")] + /// Snapshot. Snapshot, - [EnumMember(Value = "CloudFS")] + /// CloudFS. CloudFS } - internal static class BackupRestoreOperationTypeEnumExtension - { - internal static string ToSerializedValue(this BackupRestoreOperationType? value) - { - return value == null ? null : ((BackupRestoreOperationType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this BackupRestoreOperationType value) - { - switch( value ) - { - case BackupRestoreOperationType.Default: - return "Default"; - case BackupRestoreOperationType.Clone: - return "Clone"; - case BackupRestoreOperationType.Relocation: - return "Relocation"; - case BackupRestoreOperationType.Snapshot: - return "Snapshot"; - case BackupRestoreOperationType.CloudFS: - return "CloudFS"; - } - return null; - } - - internal static BackupRestoreOperationType? ParseBackupRestoreOperationType(this string value) - { - switch( value ) - { - case "Default": - return BackupRestoreOperationType.Default; - case "Clone": - return BackupRestoreOperationType.Clone; - case "Relocation": - return BackupRestoreOperationType.Relocation; - case "Snapshot": - return BackupRestoreOperationType.Snapshot; - case "CloudFS": - return BackupRestoreOperationType.CloudFS; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.Serialization.cs new file mode 100644 index 000000000000..2ff6701423f7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.Serialization.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class BackupSchedule : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("frequencyInterval"); + writer.WriteNumberValue(FrequencyInterval); + writer.WritePropertyName("frequencyUnit"); + writer.WriteStringValue(FrequencyUnit.ToSerialString()); + writer.WritePropertyName("keepAtLeastOneBackup"); + writer.WriteBooleanValue(KeepAtLeastOneBackup); + writer.WritePropertyName("retentionPeriodInDays"); + writer.WriteNumberValue(RetentionPeriodInDays); + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"); + writer.WriteStringValue(StartTime.Value, "O"); + } + writer.WriteEndObject(); + } + + internal static BackupSchedule DeserializeBackupSchedule(JsonElement element) + { + int frequencyInterval = default; + FrequencyUnit frequencyUnit = default; + bool keepAtLeastOneBackup = default; + int retentionPeriodInDays = default; + Optional startTime = default; + Optional lastExecutionTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("frequencyInterval")) + { + frequencyInterval = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("frequencyUnit")) + { + frequencyUnit = property.Value.GetString().ToFrequencyUnit(); + continue; + } + if (property.NameEquals("keepAtLeastOneBackup")) + { + keepAtLeastOneBackup = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("retentionPeriodInDays")) + { + retentionPeriodInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("startTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastExecutionTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + lastExecutionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new BackupSchedule(frequencyInterval, frequencyUnit, keepAtLeastOneBackup, retentionPeriodInDays, Optional.ToNullable(startTime), Optional.ToNullable(lastExecutionTime)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.cs index ca17ab471980..e33fb8181d7b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.cs @@ -1,52 +1,38 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Description of a backup schedule. Describes how often should be the - /// backup performed and what should be the retention policy. - /// + /// Description of a backup schedule. Describes how often should be the backup performed and what should be the retention policy. public partial class BackupSchedule { - /// - /// Initializes a new instance of the BackupSchedule class. - /// - public BackupSchedule() + /// Initializes a new instance of BackupSchedule. + /// How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day). + /// The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). + /// True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise. + /// After how many days backups should be deleted. + public BackupSchedule(int frequencyInterval, FrequencyUnit frequencyUnit, bool keepAtLeastOneBackup, int retentionPeriodInDays) { - CustomInit(); + FrequencyInterval = frequencyInterval; + FrequencyUnit = frequencyUnit; + KeepAtLeastOneBackup = keepAtLeastOneBackup; + RetentionPeriodInDays = retentionPeriodInDays; } - /// - /// Initializes a new instance of the BackupSchedule class. - /// - /// How often the backup should be - /// executed (e.g. for weekly backup, this should be set to 7 and - /// FrequencyUnit should be set to Day) - /// The unit of time for how often the - /// backup should be executed (e.g. for weekly backup, this should be - /// set to Day and FrequencyInterval should be set to 7). Possible - /// values include: 'Day', 'Hour' - /// True if the retention policy - /// should always keep at least one backup in the storage account, - /// regardless how old it is; false otherwise. - /// After how many days backups - /// should be deleted. - /// When the schedule should start - /// working. - /// Last time when this schedule was - /// triggered. - public BackupSchedule(int frequencyInterval, FrequencyUnit frequencyUnit, bool keepAtLeastOneBackup, int retentionPeriodInDays, System.DateTime? startTime = default(System.DateTime?), System.DateTime? lastExecutionTime = default(System.DateTime?)) + /// Initializes a new instance of BackupSchedule. + /// How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day). + /// The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). + /// True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise. + /// After how many days backups should be deleted. + /// When the schedule should start working. + /// Last time when this schedule was triggered. + internal BackupSchedule(int frequencyInterval, FrequencyUnit frequencyUnit, bool keepAtLeastOneBackup, int retentionPeriodInDays, DateTimeOffset? startTime, DateTimeOffset? lastExecutionTime) { FrequencyInterval = frequencyInterval; FrequencyUnit = frequencyUnit; @@ -54,65 +40,19 @@ public BackupSchedule() RetentionPeriodInDays = retentionPeriodInDays; StartTime = startTime; LastExecutionTime = lastExecutionTime; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets how often the backup should be executed (e.g. for - /// weekly backup, this should be set to 7 and FrequencyUnit should be - /// set to Day) - /// - [JsonProperty(PropertyName = "frequencyInterval")] + /// How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day). public int FrequencyInterval { get; set; } - - /// - /// Gets or sets the unit of time for how often the backup should be - /// executed (e.g. for weekly backup, this should be set to Day and - /// FrequencyInterval should be set to 7). Possible values include: - /// 'Day', 'Hour' - /// - [JsonProperty(PropertyName = "frequencyUnit")] + /// The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). public FrequencyUnit FrequencyUnit { get; set; } - - /// - /// Gets or sets true if the retention policy should always keep at - /// least one backup in the storage account, regardless how old it is; - /// false otherwise. - /// - [JsonProperty(PropertyName = "keepAtLeastOneBackup")] + /// True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise. public bool KeepAtLeastOneBackup { get; set; } - - /// - /// Gets or sets after how many days backups should be deleted. - /// - [JsonProperty(PropertyName = "retentionPeriodInDays")] + /// After how many days backups should be deleted. public int RetentionPeriodInDays { get; set; } - - /// - /// Gets or sets when the schedule should start working. - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets last time when this schedule was triggered. - /// - [JsonProperty(PropertyName = "lastExecutionTime")] - public System.DateTime? LastExecutionTime { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - } + /// When the schedule should start working. + public DateTimeOffset? StartTime { get; set; } + /// Last time when this schedule was triggered. + public DateTimeOffset? LastExecutionTime { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.Serialization.cs new file mode 100644 index 000000000000..1a4effb7bfcc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class BillingMeter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(MeterId)) + { + writer.WritePropertyName("meterId"); + writer.WriteStringValue(MeterId); + } + if (Optional.IsDefined(BillingLocation)) + { + writer.WritePropertyName("billingLocation"); + writer.WriteStringValue(BillingLocation); + } + if (Optional.IsDefined(ShortName)) + { + writer.WritePropertyName("shortName"); + writer.WriteStringValue(ShortName); + } + if (Optional.IsDefined(FriendlyName)) + { + writer.WritePropertyName("friendlyName"); + writer.WriteStringValue(FriendlyName); + } + if (Optional.IsDefined(ResourceType)) + { + writer.WritePropertyName("resourceType"); + writer.WriteStringValue(ResourceType); + } + if (Optional.IsDefined(OsType)) + { + writer.WritePropertyName("osType"); + writer.WriteStringValue(OsType); + } + if (Optional.IsDefined(Multiplier)) + { + writer.WritePropertyName("multiplier"); + writer.WriteNumberValue(Multiplier.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static BillingMeter DeserializeBillingMeter(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional meterId = default; + Optional billingLocation = default; + Optional shortName = default; + Optional friendlyName = default; + Optional resourceType = default; + Optional osType = default; + Optional multiplier = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("meterId")) + { + meterId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("billingLocation")) + { + billingLocation = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("shortName")) + { + shortName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("friendlyName")) + { + friendlyName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("resourceType")) + { + resourceType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("osType")) + { + osType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("multiplier")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + multiplier = property0.Value.GetDouble(); + continue; + } + } + continue; + } + } + return new BillingMeter(id.Value, name.Value, kind.Value, type.Value, meterId.Value, billingLocation.Value, shortName.Value, friendlyName.Value, resourceType.Value, osType.Value, Optional.ToNullable(multiplier)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs index 2e6698cad5cd..361998ab5c9e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs @@ -1,53 +1,33 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// App Service billing entity that contains information about meter which - /// the Azure billing system utilizes to charge users for services. - /// - [Rest.Serialization.JsonTransformation] + /// App Service billing entity that contains information about meter which the Azure billing system utilizes to charge users for services. public partial class BillingMeter : ProxyOnlyResource { - /// - /// Initializes a new instance of the BillingMeter class. - /// + /// Initializes a new instance of BillingMeter. public BillingMeter() { - CustomInit(); } - /// - /// Initializes a new instance of the BillingMeter class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Meter GUID onboarded in Commerce - /// Azure Location of billable - /// resource - /// Short Name from App Service Azure pricing - /// Page - /// Friendly name of the meter - /// App Service ResourceType meter used - /// for - /// App Service OS type meter used for - public BillingMeter(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string meterId = default(string), string billingLocation = default(string), string shortName = default(string), string friendlyName = default(string), string resourceType = default(string), string osType = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of BillingMeter. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Meter GUID onboarded in Commerce. + /// Azure Location of billable resource. + /// Short Name from App Service Azure pricing Page. + /// Friendly name of the meter. + /// App Service ResourceType meter used for. + /// App Service OS type meter used for. + /// Meter Multiplier. + internal BillingMeter(string id, string name, string kind, string type, string meterId, string billingLocation, string shortName, string friendlyName, string resourceType, string osType, double? multiplier) : base(id, name, kind, type) { MeterId = meterId; BillingLocation = billingLocation; @@ -55,49 +35,22 @@ public BillingMeter() FriendlyName = friendlyName; ResourceType = resourceType; OsType = osType; - CustomInit(); + Multiplier = multiplier; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets meter GUID onboarded in Commerce - /// - [JsonProperty(PropertyName = "properties.meterId")] + /// Meter GUID onboarded in Commerce. public string MeterId { get; set; } - - /// - /// Gets or sets azure Location of billable resource - /// - [JsonProperty(PropertyName = "properties.billingLocation")] + /// Azure Location of billable resource. public string BillingLocation { get; set; } - - /// - /// Gets or sets short Name from App Service Azure pricing Page - /// - [JsonProperty(PropertyName = "properties.shortName")] + /// Short Name from App Service Azure pricing Page. public string ShortName { get; set; } - - /// - /// Gets or sets friendly name of the meter - /// - [JsonProperty(PropertyName = "properties.friendlyName")] + /// Friendly name of the meter. public string FriendlyName { get; set; } - - /// - /// Gets or sets app Service ResourceType meter used for - /// - [JsonProperty(PropertyName = "properties.resourceType")] + /// App Service ResourceType meter used for. public string ResourceType { get; set; } - - /// - /// Gets or sets app Service OS type meter used for - /// - [JsonProperty(PropertyName = "properties.osType")] + /// App Service OS type meter used for. public string OsType { get; set; } - + /// Meter Multiplier. + public double? Multiplier { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.Serialization.cs new file mode 100644 index 000000000000..e2e9ecb7151d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class BillingMeterCollection + { + internal static BillingMeterCollection DeserializeBillingMeterCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BillingMeter.DeserializeBillingMeter(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new BillingMeterCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.cs new file mode 100644 index 000000000000..a7e7ac2bdfb1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Billing Meters. + internal partial class BillingMeterCollection + { + /// Initializes a new instance of BillingMeterCollection. + /// Collection of resources. + /// is null. + internal BillingMeterCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of BillingMeterCollection. + /// Collection of resources. + /// Link to next page of resources. + internal BillingMeterCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.Serialization.cs new file mode 100644 index 000000000000..0fbd1f3259c0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class BlobStorageTokenStore : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(SasUrlSettingName)) + { + writer.WritePropertyName("sasUrlSettingName"); + writer.WriteStringValue(SasUrlSettingName); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static BlobStorageTokenStore DeserializeBlobStorageTokenStore(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional sasUrlSettingName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("sasUrlSettingName")) + { + sasUrlSettingName = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new BlobStorageTokenStore(id.Value, name.Value, kind.Value, type.Value, sasUrlSettingName.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.cs index 477633b938cb..903e04acc18c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.cs @@ -1,54 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the storage of the tokens if blob storage is used. public partial class BlobStorageTokenStore : ProxyOnlyResource { - /// - /// Initializes a new instance of the BlobStorageTokenStore class. - /// + /// Initializes a new instance of BlobStorageTokenStore. public BlobStorageTokenStore() { - CustomInit(); } - /// - /// Initializes a new instance of the BlobStorageTokenStore class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public BlobStorageTokenStore(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string sasUrlSettingName = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of BlobStorageTokenStore. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The name of the app setting containing the SAS URL of the blob storage containing the tokens. + internal BlobStorageTokenStore(string id, string name, string kind, string type, string sasUrlSettingName) : base(id, name, kind, type) { SasUrlSettingName = sasUrlSettingName; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.sasUrlSettingName")] + /// The name of the app setting containing the SAS URL of the blob storage containing the tokens. public string SasUrlSettingName { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuildStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuildStatus.cs index 108549cc3987..c380c88c30a4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuildStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuildStatus.cs @@ -1,27 +1,66 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for BuildStatus. - /// - public static class BuildStatus + /// The status of the static site build. + public readonly partial struct BuildStatus : IEquatable { - public const string WaitingForDeployment = "WaitingForDeployment"; - public const string Uploading = "Uploading"; - public const string Deploying = "Deploying"; - public const string Ready = "Ready"; - public const string Failed = "Failed"; - public const string Deleting = "Deleting"; - public const string Detached = "Detached"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public BuildStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WaitingForDeploymentValue = "WaitingForDeployment"; + private const string UploadingValue = "Uploading"; + private const string DeployingValue = "Deploying"; + private const string ReadyValue = "Ready"; + private const string FailedValue = "Failed"; + private const string DeletingValue = "Deleting"; + private const string DetachedValue = "Detached"; + + /// WaitingForDeployment. + public static BuildStatus WaitingForDeployment { get; } = new BuildStatus(WaitingForDeploymentValue); + /// Uploading. + public static BuildStatus Uploading { get; } = new BuildStatus(UploadingValue); + /// Deploying. + public static BuildStatus Deploying { get; } = new BuildStatus(DeployingValue); + /// Ready. + public static BuildStatus Ready { get; } = new BuildStatus(ReadyValue); + /// Failed. + public static BuildStatus Failed { get; } = new BuildStatus(FailedValue); + /// Deleting. + public static BuildStatus Deleting { get; } = new BuildStatus(DeletingValue); + /// Detached. + public static BuildStatus Detached { get; } = new BuildStatus(DetachedValue); + /// Determines if two values are the same. + public static bool operator ==(BuildStatus left, BuildStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BuildStatus left, BuildStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator BuildStatus(string value) => new BuildStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BuildStatus other && Equals(other); + /// + public bool Equals(BuildStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.Serialization.cs new file mode 100644 index 000000000000..dc0c5330c9e1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.Serialization.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class BuiltInAuthenticationProviderExtensions + { + public static string ToSerialString(this BuiltInAuthenticationProvider value) => value switch + { + BuiltInAuthenticationProvider.AzureActiveDirectory => "AzureActiveDirectory", + BuiltInAuthenticationProvider.Facebook => "Facebook", + BuiltInAuthenticationProvider.Google => "Google", + BuiltInAuthenticationProvider.MicrosoftAccount => "MicrosoftAccount", + BuiltInAuthenticationProvider.Twitter => "Twitter", + BuiltInAuthenticationProvider.Github => "Github", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BuiltInAuthenticationProvider value.") + }; + + public static BuiltInAuthenticationProvider ToBuiltInAuthenticationProvider(this string value) + { + if (string.Equals(value, "AzureActiveDirectory", StringComparison.InvariantCultureIgnoreCase)) return BuiltInAuthenticationProvider.AzureActiveDirectory; + if (string.Equals(value, "Facebook", StringComparison.InvariantCultureIgnoreCase)) return BuiltInAuthenticationProvider.Facebook; + if (string.Equals(value, "Google", StringComparison.InvariantCultureIgnoreCase)) return BuiltInAuthenticationProvider.Google; + if (string.Equals(value, "MicrosoftAccount", StringComparison.InvariantCultureIgnoreCase)) return BuiltInAuthenticationProvider.MicrosoftAccount; + if (string.Equals(value, "Twitter", StringComparison.InvariantCultureIgnoreCase)) return BuiltInAuthenticationProvider.Twitter; + if (string.Equals(value, "Github", StringComparison.InvariantCultureIgnoreCase)) return BuiltInAuthenticationProvider.Github; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BuiltInAuthenticationProvider value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.cs index 7c1d8d8ded9a..ef4031d77a81 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.cs @@ -1,84 +1,30 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - /// - /// Defines values for BuiltInAuthenticationProvider. + /// The default authentication provider to use when multiple providers are configured. + /// This setting is only needed if multiple providers are configured and the unauthenticated client + /// action is set to "RedirectToLoginPage". /// - [JsonConverter(typeof(StringEnumConverter))] public enum BuiltInAuthenticationProvider { - [EnumMember(Value = "AzureActiveDirectory")] + /// AzureActiveDirectory. AzureActiveDirectory, - [EnumMember(Value = "Facebook")] + /// Facebook. Facebook, - [EnumMember(Value = "Google")] + /// Google. Google, - [EnumMember(Value = "MicrosoftAccount")] + /// MicrosoftAccount. MicrosoftAccount, - [EnumMember(Value = "Twitter")] + /// Twitter. Twitter, - [EnumMember(Value = "Github")] + /// Github. Github } - internal static class BuiltInAuthenticationProviderEnumExtension - { - internal static string ToSerializedValue(this BuiltInAuthenticationProvider? value) - { - return value == null ? null : ((BuiltInAuthenticationProvider)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this BuiltInAuthenticationProvider value) - { - switch( value ) - { - case BuiltInAuthenticationProvider.AzureActiveDirectory: - return "AzureActiveDirectory"; - case BuiltInAuthenticationProvider.Facebook: - return "Facebook"; - case BuiltInAuthenticationProvider.Google: - return "Google"; - case BuiltInAuthenticationProvider.MicrosoftAccount: - return "MicrosoftAccount"; - case BuiltInAuthenticationProvider.Twitter: - return "Twitter"; - case BuiltInAuthenticationProvider.Github: - return "Github"; - } - return null; - } - - internal static BuiltInAuthenticationProvider? ParseBuiltInAuthenticationProvider(this string value) - { - switch( value ) - { - case "AzureActiveDirectory": - return BuiltInAuthenticationProvider.AzureActiveDirectory; - case "Facebook": - return BuiltInAuthenticationProvider.Facebook; - case "Google": - return BuiltInAuthenticationProvider.Google; - case "MicrosoftAccount": - return BuiltInAuthenticationProvider.MicrosoftAccount; - case "Twitter": - return BuiltInAuthenticationProvider.Twitter; - case "Github": - return BuiltInAuthenticationProvider.Github; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.Serialization.cs new file mode 100644 index 000000000000..08032a8aab99 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Capability : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"); + writer.WriteStringValue(Value); + } + if (Optional.IsDefined(Reason)) + { + writer.WritePropertyName("reason"); + writer.WriteStringValue(Reason); + } + writer.WriteEndObject(); + } + + internal static Capability DeserializeCapability(JsonElement element) + { + Optional name = default; + Optional value = default; + Optional reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value")) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("reason")) + { + reason = property.Value.GetString(); + continue; + } + } + return new Capability(name.Value, value.Value, reason.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.cs index 789072a1e19a..53e496330103 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.cs @@ -1,67 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Describes the capabilities/features allowed for a specific SKU. - /// + /// Describes the capabilities/features allowed for a specific SKU. public partial class Capability { - /// - /// Initializes a new instance of the Capability class. - /// + /// Initializes a new instance of Capability. public Capability() { - CustomInit(); } - /// - /// Initializes a new instance of the Capability class. - /// - /// Name of the SKU capability. - /// Value of the SKU capability. - /// Reason of the SKU capability. - public Capability(string name = default(string), string value = default(string), string reason = default(string)) + /// Initializes a new instance of Capability. + /// Name of the SKU capability. + /// Value of the SKU capability. + /// Reason of the SKU capability. + internal Capability(string name, string value, string reason) { Name = name; Value = value; Reason = reason; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the SKU capability. - /// - [JsonProperty(PropertyName = "name")] + /// Name of the SKU capability. public string Name { get; set; } - - /// - /// Gets or sets value of the SKU capability. - /// - [JsonProperty(PropertyName = "value")] + /// Value of the SKU capability. public string Value { get; set; } - - /// - /// Gets or sets reason of the SKU capability. - /// - [JsonProperty(PropertyName = "reason")] + /// Reason of the SKU capability. public string Reason { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.Serialization.cs new file mode 100644 index 000000000000..feb79889223f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.Serialization.cs @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Certificate : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"); + writer.WriteStringValue(Password); + } + if (Optional.IsCollectionDefined(HostNames)) + { + writer.WritePropertyName("hostNames"); + writer.WriteStartArray(); + foreach (var item in HostNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PfxBlob)) + { + writer.WritePropertyName("pfxBlob"); + writer.WriteBase64StringValue(PfxBlob, "D"); + } + if (Optional.IsDefined(KeyVaultId)) + { + writer.WritePropertyName("keyVaultId"); + writer.WriteStringValue(KeyVaultId); + } + if (Optional.IsDefined(KeyVaultSecretName)) + { + writer.WritePropertyName("keyVaultSecretName"); + writer.WriteStringValue(KeyVaultSecretName); + } + if (Optional.IsDefined(ServerFarmId)) + { + writer.WritePropertyName("serverFarmId"); + writer.WriteStringValue(ServerFarmId); + } + if (Optional.IsDefined(CanonicalName)) + { + writer.WritePropertyName("canonicalName"); + writer.WriteStringValue(CanonicalName); + } + if (Optional.IsDefined(DomainValidationMethod)) + { + writer.WritePropertyName("domainValidationMethod"); + writer.WriteStringValue(DomainValidationMethod); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Certificate DeserializeCertificate(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + string location = default; + Optional type = default; + Optional> tags = default; + Optional password = default; + Optional friendlyName = default; + Optional subjectName = default; + Optional> hostNames = default; + Optional pfxBlob = default; + Optional siteName = default; + Optional selfLink = default; + Optional issuer = default; + Optional issueDate = default; + Optional expirationDate = default; + Optional thumbprint = default; + Optional valid = default; + Optional cerBlob = default; + Optional publicKeyHash = default; + Optional hostingEnvironmentProfile = default; + Optional keyVaultId = default; + Optional keyVaultSecretName = default; + Optional keyVaultSecretStatus = default; + Optional serverFarmId = default; + Optional canonicalName = default; + Optional domainValidationMethod = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("password")) + { + password = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("friendlyName")) + { + friendlyName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("subjectName")) + { + subjectName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + hostNames = array; + continue; + } + if (property0.NameEquals("pfxBlob")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + pfxBlob = property0.Value.GetBytesFromBase64("D"); + continue; + } + if (property0.NameEquals("siteName")) + { + siteName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("selfLink")) + { + selfLink = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("issuer")) + { + issuer = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("issueDate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + issueDate = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("expirationDate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + expirationDate = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("thumbprint")) + { + thumbprint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("valid")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + valid = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("cerBlob")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + cerBlob = property0.Value.GetBytesFromBase64("D"); + continue; + } + if (property0.NameEquals("publicKeyHash")) + { + publicKeyHash = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostingEnvironmentProfile")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); + continue; + } + if (property0.NameEquals("keyVaultId")) + { + keyVaultId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("keyVaultSecretName")) + { + keyVaultSecretName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("keyVaultSecretStatus")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + keyVaultSecretStatus = property0.Value.GetString().ToKeyVaultSecretStatus(); + continue; + } + if (property0.NameEquals("serverFarmId")) + { + serverFarmId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("canonicalName")) + { + canonicalName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("domainValidationMethod")) + { + domainValidationMethod = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new Certificate(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), password.Value, friendlyName.Value, subjectName.Value, Optional.ToList(hostNames), pfxBlob.Value, siteName.Value, selfLink.Value, issuer.Value, Optional.ToNullable(issueDate), Optional.ToNullable(expirationDate), thumbprint.Value, Optional.ToNullable(valid), cerBlob.Value, publicKeyHash.Value, hostingEnvironmentProfile.Value, keyVaultId.Value, keyVaultSecretName.Value, Optional.ToNullable(keyVaultSecretStatus), serverFarmId.Value, canonicalName.Value, domainValidationMethod.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs index d46eb9c0661c..839ef4e94fb7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs @@ -1,80 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// SSL certificate for an app. - /// - [Rest.Serialization.JsonTransformation] + /// SSL certificate for an app. public partial class Certificate : Resource { - /// - /// Initializes a new instance of the Certificate class. - /// - public Certificate() + /// Initializes a new instance of Certificate. + /// Resource Location. + /// is null. + public Certificate(string location) : base(location) { - CustomInit(); + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + HostNames = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the Certificate class. - /// - /// Resource Location. - /// Certificate password. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Resource tags. - /// Friendly name of the - /// certificate. - /// Subject name of the certificate. - /// Host names the certificate applies - /// to. - /// Pfx blob. - /// App name. - /// Self link. - /// Certificate issuer. - /// Certificate issue Date. - /// Certificate expiration date. - /// Certificate thumbprint. - /// Is the certificate valid?. - /// Raw bytes of .cer file - /// Public key hash. - /// Specification for the App - /// Service Environment to use for the certificate. - /// Key Vault Csm resource Id. - /// Key Vault secret name. - /// Status of the Key Vault secret. - /// Possible values include: 'Initialized', - /// 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', - /// 'OperationNotPermittedOnKeyVault', - /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', - /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', - /// 'Unknown' - /// Resource ID of the associated App - /// Service plan, formatted as: - /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - /// CNAME of the certificate to be issued - /// via free certificate - public Certificate(string location, string password, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string)) - : base(location, id, name, kind, type, tags) + /// Initializes a new instance of Certificate. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource Location. + /// Resource type. + /// Resource tags. + /// Certificate password. + /// Friendly name of the certificate. + /// Subject name of the certificate. + /// Host names the certificate applies to. + /// Pfx blob. + /// App name. + /// Self link. + /// Certificate issuer. + /// Certificate issue Date. + /// Certificate expiration date. + /// Certificate thumbprint. + /// Is the certificate valid?. + /// Raw bytes of .cer file. + /// Public key hash. + /// Specification for the App Service Environment to use for the certificate. + /// Key Vault Csm resource Id. + /// Key Vault secret name. + /// Status of the Key Vault secret. + /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + /// CNAME of the certificate to be issued via free certificate. + /// Method of domain validation for free cert. + internal Certificate(string id, string name, string kind, string location, string type, IDictionary tags, string password, string friendlyName, string subjectName, IList hostNames, byte[] pfxBlob, string siteName, string selfLink, string issuer, DateTimeOffset? issueDate, DateTimeOffset? expirationDate, string thumbprint, bool? valid, byte[] cerBlob, string publicKeyHash, HostingEnvironmentProfile hostingEnvironmentProfile, string keyVaultId, string keyVaultSecretName, KeyVaultSecretStatus? keyVaultSecretStatus, string serverFarmId, string canonicalName, string domainValidationMethod) : base(id, name, kind, location, type, tags) { + Password = password; FriendlyName = friendlyName; SubjectName = subjectName; HostNames = hostNames; @@ -84,7 +67,6 @@ public Certificate() Issuer = issuer; IssueDate = issueDate; ExpirationDate = expirationDate; - Password = password; Thumbprint = thumbprint; Valid = valid; CerBlob = cerBlob; @@ -95,156 +77,50 @@ public Certificate() KeyVaultSecretStatus = keyVaultSecretStatus; ServerFarmId = serverFarmId; CanonicalName = canonicalName; - CustomInit(); + DomainValidationMethod = domainValidationMethod; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets friendly name of the certificate. - /// - [JsonProperty(PropertyName = "properties.friendlyName")] - public string FriendlyName { get; private set; } - - /// - /// Gets subject name of the certificate. - /// - [JsonProperty(PropertyName = "properties.subjectName")] - public string SubjectName { get; private set; } - - /// - /// Gets or sets host names the certificate applies to. - /// - [JsonProperty(PropertyName = "properties.hostNames")] - public IList HostNames { get; set; } - - /// - /// Gets or sets pfx blob. - /// - [JsonProperty(PropertyName = "properties.pfxBlob")] - public byte[] PfxBlob { get; set; } - - /// - /// Gets app name. - /// - [JsonProperty(PropertyName = "properties.siteName")] - public string SiteName { get; private set; } - - /// - /// Gets self link. - /// - [JsonProperty(PropertyName = "properties.selfLink")] - public string SelfLink { get; private set; } - - /// - /// Gets certificate issuer. - /// - [JsonProperty(PropertyName = "properties.issuer")] - public string Issuer { get; private set; } - - /// - /// Gets certificate issue Date. - /// - [JsonProperty(PropertyName = "properties.issueDate")] - public System.DateTime? IssueDate { get; private set; } - - /// - /// Gets certificate expiration date. - /// - [JsonProperty(PropertyName = "properties.expirationDate")] - public System.DateTime? ExpirationDate { get; private set; } - - /// - /// Gets or sets certificate password. - /// - [JsonProperty(PropertyName = "properties.password")] + /// Certificate password. public string Password { get; set; } - - /// - /// Gets certificate thumbprint. - /// - [JsonProperty(PropertyName = "properties.thumbprint")] - public string Thumbprint { get; private set; } - - /// - /// Gets is the certificate valid?. - /// - [JsonProperty(PropertyName = "properties.valid")] - public bool? Valid { get; private set; } - - /// - /// Gets raw bytes of .cer file - /// - [JsonProperty(PropertyName = "properties.cerBlob")] - public byte[] CerBlob { get; private set; } - - /// - /// Gets public key hash. - /// - [JsonProperty(PropertyName = "properties.publicKeyHash")] - public string PublicKeyHash { get; private set; } - - /// - /// Gets specification for the App Service Environment to use for the - /// certificate. - /// - [JsonProperty(PropertyName = "properties.hostingEnvironmentProfile")] - public HostingEnvironmentProfile HostingEnvironmentProfile { get; private set; } - - /// - /// Gets or sets key Vault Csm resource Id. - /// - [JsonProperty(PropertyName = "properties.keyVaultId")] + /// Friendly name of the certificate. + public string FriendlyName { get; } + /// Subject name of the certificate. + public string SubjectName { get; } + /// Host names the certificate applies to. + public IList HostNames { get; } + /// Pfx blob. + public byte[] PfxBlob { get; set; } + /// App name. + public string SiteName { get; } + /// Self link. + public string SelfLink { get; } + /// Certificate issuer. + public string Issuer { get; } + /// Certificate issue Date. + public DateTimeOffset? IssueDate { get; } + /// Certificate expiration date. + public DateTimeOffset? ExpirationDate { get; } + /// Certificate thumbprint. + public string Thumbprint { get; } + /// Is the certificate valid?. + public bool? Valid { get; } + /// Raw bytes of .cer file. + public byte[] CerBlob { get; } + /// Public key hash. + public string PublicKeyHash { get; } + /// Specification for the App Service Environment to use for the certificate. + public HostingEnvironmentProfile HostingEnvironmentProfile { get; } + /// Key Vault Csm resource Id. public string KeyVaultId { get; set; } - - /// - /// Gets or sets key Vault secret name. - /// - [JsonProperty(PropertyName = "properties.keyVaultSecretName")] + /// Key Vault secret name. public string KeyVaultSecretName { get; set; } - - /// - /// Gets status of the Key Vault secret. Possible values include: - /// 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', - /// 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', - /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', - /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', - /// 'Unknown' - /// - [JsonProperty(PropertyName = "properties.keyVaultSecretStatus")] - public KeyVaultSecretStatus? KeyVaultSecretStatus { get; private set; } - - /// - /// Gets or sets resource ID of the associated App Service plan, - /// formatted as: - /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - /// - [JsonProperty(PropertyName = "properties.serverFarmId")] + /// Status of the Key Vault secret. + public KeyVaultSecretStatus? KeyVaultSecretStatus { get; } + /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". public string ServerFarmId { get; set; } - - /// - /// Gets or sets CNAME of the certificate to be issued via free - /// certificate - /// - [JsonProperty(PropertyName = "properties.canonicalName")] + /// CNAME of the certificate to be issued via free certificate. public string CanonicalName { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (Password == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Password"); - } - } + /// Method of domain validation for free cert. + public string DomainValidationMethod { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.Serialization.cs new file mode 100644 index 000000000000..5ac197bc1d8c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class CertificateCollection + { + internal static CertificateCollection DeserializeCertificateCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Certificate.DeserializeCertificate(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new CertificateCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.cs new file mode 100644 index 000000000000..c286a293e4dd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of certificates. + internal partial class CertificateCollection + { + /// Initializes a new instance of CertificateCollection. + /// Collection of resources. + /// is null. + internal CertificateCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of CertificateCollection. + /// Collection of resources. + /// Link to next page of resources. + internal CertificateCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.Serialization.cs new file mode 100644 index 000000000000..c229c791d75b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.Serialization.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CertificateDetails + { + internal static CertificateDetails DeserializeCertificateDetails(JsonElement element) + { + Optional version = default; + Optional serialNumber = default; + Optional thumbprint = default; + Optional subject = default; + Optional notBefore = default; + Optional notAfter = default; + Optional signatureAlgorithm = default; + Optional issuer = default; + Optional rawData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("serialNumber")) + { + serialNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("thumbprint")) + { + thumbprint = property.Value.GetString(); + continue; + } + if (property.NameEquals("subject")) + { + subject = property.Value.GetString(); + continue; + } + if (property.NameEquals("notBefore")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + notBefore = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("notAfter")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + notAfter = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("signatureAlgorithm")) + { + signatureAlgorithm = property.Value.GetString(); + continue; + } + if (property.NameEquals("issuer")) + { + issuer = property.Value.GetString(); + continue; + } + if (property.NameEquals("rawData")) + { + rawData = property.Value.GetString(); + continue; + } + } + return new CertificateDetails(Optional.ToNullable(version), serialNumber.Value, thumbprint.Value, subject.Value, Optional.ToNullable(notBefore), Optional.ToNullable(notAfter), signatureAlgorithm.Value, issuer.Value, rawData.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.cs index 88da305a42c3..346fc8986c7f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.cs @@ -1,45 +1,33 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// SSL certificate details. - /// + /// SSL certificate details. public partial class CertificateDetails { - /// - /// Initializes a new instance of the CertificateDetails class. - /// - public CertificateDetails() + /// Initializes a new instance of CertificateDetails. + internal CertificateDetails() { - CustomInit(); } - /// - /// Initializes a new instance of the CertificateDetails class. - /// - /// Certificate Version. - /// Certificate Serial Number. - /// Certificate Thumbprint. - /// Certificate Subject. - /// Date Certificate is valid from. - /// Date Certificate is valid to. - /// Certificate Signature - /// algorithm. - /// Certificate Issuer. - /// Raw certificate data. - public CertificateDetails(int? version = default(int?), string serialNumber = default(string), string thumbprint = default(string), string subject = default(string), System.DateTime? notBefore = default(System.DateTime?), System.DateTime? notAfter = default(System.DateTime?), string signatureAlgorithm = default(string), string issuer = default(string), string rawData = default(string)) + /// Initializes a new instance of CertificateDetails. + /// Certificate Version. + /// Certificate Serial Number. + /// Certificate Thumbprint. + /// Certificate Subject. + /// Date Certificate is valid from. + /// Date Certificate is valid to. + /// Certificate Signature algorithm. + /// Certificate Issuer. + /// Raw certificate data. + internal CertificateDetails(int? version, string serialNumber, string thumbprint, string subject, DateTimeOffset? notBefore, DateTimeOffset? notAfter, string signatureAlgorithm, string issuer, string rawData) { Version = version; SerialNumber = serialNumber; @@ -50,67 +38,25 @@ public CertificateDetails() SignatureAlgorithm = signatureAlgorithm; Issuer = issuer; RawData = rawData; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets certificate Version. - /// - [JsonProperty(PropertyName = "version")] - public int? Version { get; private set; } - - /// - /// Gets certificate Serial Number. - /// - [JsonProperty(PropertyName = "serialNumber")] - public string SerialNumber { get; private set; } - - /// - /// Gets certificate Thumbprint. - /// - [JsonProperty(PropertyName = "thumbprint")] - public string Thumbprint { get; private set; } - - /// - /// Gets certificate Subject. - /// - [JsonProperty(PropertyName = "subject")] - public string Subject { get; private set; } - - /// - /// Gets date Certificate is valid from. - /// - [JsonProperty(PropertyName = "notBefore")] - public System.DateTime? NotBefore { get; private set; } - - /// - /// Gets date Certificate is valid to. - /// - [JsonProperty(PropertyName = "notAfter")] - public System.DateTime? NotAfter { get; private set; } - - /// - /// Gets certificate Signature algorithm. - /// - [JsonProperty(PropertyName = "signatureAlgorithm")] - public string SignatureAlgorithm { get; private set; } - - /// - /// Gets certificate Issuer. - /// - [JsonProperty(PropertyName = "issuer")] - public string Issuer { get; private set; } - - /// - /// Gets raw certificate data. - /// - [JsonProperty(PropertyName = "rawData")] - public string RawData { get; private set; } - + /// Certificate Version. + public int? Version { get; } + /// Certificate Serial Number. + public string SerialNumber { get; } + /// Certificate Thumbprint. + public string Thumbprint { get; } + /// Certificate Subject. + public string Subject { get; } + /// Date Certificate is valid from. + public DateTimeOffset? NotBefore { get; } + /// Date Certificate is valid to. + public DateTimeOffset? NotAfter { get; } + /// Certificate Signature algorithm. + public string SignatureAlgorithm { get; } + /// Certificate Issuer. + public string Issuer { get; } + /// Raw certificate data. + public string RawData { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.Serialization.cs new file mode 100644 index 000000000000..abee94842940 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.Serialization.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CertificateEmail : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(EmailId)) + { + writer.WritePropertyName("emailId"); + writer.WriteStringValue(EmailId); + } + if (Optional.IsDefined(TimeStamp)) + { + writer.WritePropertyName("timeStamp"); + writer.WriteStringValue(TimeStamp.Value, "O"); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static CertificateEmail DeserializeCertificateEmail(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional emailId = default; + Optional timeStamp = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("emailId")) + { + emailId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("timeStamp")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + timeStamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + } + return new CertificateEmail(id.Value, name.Value, kind.Value, type.Value, emailId.Value, Optional.ToNullable(timeStamp)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.cs index 964709077aa5..e44b7139b2c3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.cs @@ -1,67 +1,38 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// SSL certificate email. - /// - [Rest.Serialization.JsonTransformation] + /// SSL certificate email. public partial class CertificateEmail : ProxyOnlyResource { - /// - /// Initializes a new instance of the CertificateEmail class. - /// + /// Initializes a new instance of CertificateEmail. public CertificateEmail() { - CustomInit(); } - /// - /// Initializes a new instance of the CertificateEmail class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Email id. - /// Time stamp. - public CertificateEmail(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string emailId = default(string), System.DateTime? timeStamp = default(System.DateTime?)) - : base(id, name, kind, type) + /// Initializes a new instance of CertificateEmail. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Email id. + /// Time stamp. + internal CertificateEmail(string id, string name, string kind, string type, string emailId, DateTimeOffset? timeStamp) : base(id, name, kind, type) { EmailId = emailId; TimeStamp = timeStamp; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets email id. - /// - [JsonProperty(PropertyName = "properties.emailId")] + /// Email id. public string EmailId { get; set; } - - /// - /// Gets or sets time stamp. - /// - [JsonProperty(PropertyName = "properties.timeStamp")] - public System.DateTime? TimeStamp { get; set; } - + /// Time stamp. + public DateTimeOffset? TimeStamp { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.Serialization.cs new file mode 100644 index 000000000000..afedc3b9c2d3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.Serialization.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CertificateOrderAction : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static CertificateOrderAction DeserializeCertificateOrderAction(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional actionType = default; + Optional createdAt = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("actionType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + actionType = property0.Value.GetString().ToCertificateOrderActionType(); + continue; + } + if (property0.NameEquals("createdAt")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + createdAt = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + } + return new CertificateOrderAction(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(actionType), Optional.ToNullable(createdAt)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.cs index 19be35309378..122ef7336dd9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.cs @@ -1,80 +1,38 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Certificate order action. - /// - [Rest.Serialization.JsonTransformation] + /// Certificate order action. public partial class CertificateOrderAction : ProxyOnlyResource { - /// - /// Initializes a new instance of the CertificateOrderAction class. - /// + /// Initializes a new instance of CertificateOrderAction. public CertificateOrderAction() { - CustomInit(); } - /// - /// Initializes a new instance of the CertificateOrderAction class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Action type. Possible values include: - /// 'CertificateIssued', 'CertificateOrderCanceled', - /// 'CertificateOrderCreated', 'CertificateRevoked', - /// 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', - /// 'OrgValidationComplete', 'SanDrop', 'FraudCleared', - /// 'CertificateExpired', 'CertificateExpirationWarning', - /// 'FraudDocumentationRequired', 'Unknown' - /// Time at which the certificate action was - /// performed. - public CertificateOrderAction(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), CertificateOrderActionType? actionType = default(CertificateOrderActionType?), System.DateTime? createdAt = default(System.DateTime?)) - : base(id, name, kind, type) + /// Initializes a new instance of CertificateOrderAction. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Action type. + /// Time at which the certificate action was performed. + internal CertificateOrderAction(string id, string name, string kind, string type, CertificateOrderActionType? actionType, DateTimeOffset? createdAt) : base(id, name, kind, type) { ActionType = actionType; CreatedAt = createdAt; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets action type. Possible values include: 'CertificateIssued', - /// 'CertificateOrderCanceled', 'CertificateOrderCreated', - /// 'CertificateRevoked', 'DomainValidationComplete', 'FraudDetected', - /// 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', - /// 'FraudCleared', 'CertificateExpired', - /// 'CertificateExpirationWarning', 'FraudDocumentationRequired', - /// 'Unknown' - /// - [JsonProperty(PropertyName = "properties.actionType")] - public CertificateOrderActionType? ActionType { get; private set; } - - /// - /// Gets time at which the certificate action was performed. - /// - [JsonProperty(PropertyName = "properties.createdAt")] - public System.DateTime? CreatedAt { get; private set; } - + /// Action type. + public CertificateOrderActionType? ActionType { get; } + /// Time at which the certificate action was performed. + public DateTimeOffset? CreatedAt { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.Serialization.cs new file mode 100644 index 000000000000..43a3eb07e092 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class CertificateOrderActionTypeExtensions + { + public static string ToSerialString(this CertificateOrderActionType value) => value switch + { + CertificateOrderActionType.CertificateIssued => "CertificateIssued", + CertificateOrderActionType.CertificateOrderCanceled => "CertificateOrderCanceled", + CertificateOrderActionType.CertificateOrderCreated => "CertificateOrderCreated", + CertificateOrderActionType.CertificateRevoked => "CertificateRevoked", + CertificateOrderActionType.DomainValidationComplete => "DomainValidationComplete", + CertificateOrderActionType.FraudDetected => "FraudDetected", + CertificateOrderActionType.OrgNameChange => "OrgNameChange", + CertificateOrderActionType.OrgValidationComplete => "OrgValidationComplete", + CertificateOrderActionType.SanDrop => "SanDrop", + CertificateOrderActionType.FraudCleared => "FraudCleared", + CertificateOrderActionType.CertificateExpired => "CertificateExpired", + CertificateOrderActionType.CertificateExpirationWarning => "CertificateExpirationWarning", + CertificateOrderActionType.FraudDocumentationRequired => "FraudDocumentationRequired", + CertificateOrderActionType.Unknown => "Unknown", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateOrderActionType value.") + }; + + public static CertificateOrderActionType ToCertificateOrderActionType(this string value) + { + if (string.Equals(value, "CertificateIssued", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.CertificateIssued; + if (string.Equals(value, "CertificateOrderCanceled", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.CertificateOrderCanceled; + if (string.Equals(value, "CertificateOrderCreated", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.CertificateOrderCreated; + if (string.Equals(value, "CertificateRevoked", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.CertificateRevoked; + if (string.Equals(value, "DomainValidationComplete", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.DomainValidationComplete; + if (string.Equals(value, "FraudDetected", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.FraudDetected; + if (string.Equals(value, "OrgNameChange", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.OrgNameChange; + if (string.Equals(value, "OrgValidationComplete", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.OrgValidationComplete; + if (string.Equals(value, "SanDrop", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.SanDrop; + if (string.Equals(value, "FraudCleared", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.FraudCleared; + if (string.Equals(value, "CertificateExpired", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.CertificateExpired; + if (string.Equals(value, "CertificateExpirationWarning", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.CertificateExpirationWarning; + if (string.Equals(value, "FraudDocumentationRequired", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.FraudDocumentationRequired; + if (string.Equals(value, "Unknown", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.Unknown; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateOrderActionType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.cs index 6ada766d33f4..7cdff7e605a2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.cs @@ -1,132 +1,42 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for CertificateOrderActionType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Action type. public enum CertificateOrderActionType { - [EnumMember(Value = "CertificateIssued")] + /// CertificateIssued. CertificateIssued, - [EnumMember(Value = "CertificateOrderCanceled")] + /// CertificateOrderCanceled. CertificateOrderCanceled, - [EnumMember(Value = "CertificateOrderCreated")] + /// CertificateOrderCreated. CertificateOrderCreated, - [EnumMember(Value = "CertificateRevoked")] + /// CertificateRevoked. CertificateRevoked, - [EnumMember(Value = "DomainValidationComplete")] + /// DomainValidationComplete. DomainValidationComplete, - [EnumMember(Value = "FraudDetected")] + /// FraudDetected. FraudDetected, - [EnumMember(Value = "OrgNameChange")] + /// OrgNameChange. OrgNameChange, - [EnumMember(Value = "OrgValidationComplete")] + /// OrgValidationComplete. OrgValidationComplete, - [EnumMember(Value = "SanDrop")] + /// SanDrop. SanDrop, - [EnumMember(Value = "FraudCleared")] + /// FraudCleared. FraudCleared, - [EnumMember(Value = "CertificateExpired")] + /// CertificateExpired. CertificateExpired, - [EnumMember(Value = "CertificateExpirationWarning")] + /// CertificateExpirationWarning. CertificateExpirationWarning, - [EnumMember(Value = "FraudDocumentationRequired")] + /// FraudDocumentationRequired. FraudDocumentationRequired, - [EnumMember(Value = "Unknown")] + /// Unknown. Unknown } - internal static class CertificateOrderActionTypeEnumExtension - { - internal static string ToSerializedValue(this CertificateOrderActionType? value) - { - return value == null ? null : ((CertificateOrderActionType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this CertificateOrderActionType value) - { - switch( value ) - { - case CertificateOrderActionType.CertificateIssued: - return "CertificateIssued"; - case CertificateOrderActionType.CertificateOrderCanceled: - return "CertificateOrderCanceled"; - case CertificateOrderActionType.CertificateOrderCreated: - return "CertificateOrderCreated"; - case CertificateOrderActionType.CertificateRevoked: - return "CertificateRevoked"; - case CertificateOrderActionType.DomainValidationComplete: - return "DomainValidationComplete"; - case CertificateOrderActionType.FraudDetected: - return "FraudDetected"; - case CertificateOrderActionType.OrgNameChange: - return "OrgNameChange"; - case CertificateOrderActionType.OrgValidationComplete: - return "OrgValidationComplete"; - case CertificateOrderActionType.SanDrop: - return "SanDrop"; - case CertificateOrderActionType.FraudCleared: - return "FraudCleared"; - case CertificateOrderActionType.CertificateExpired: - return "CertificateExpired"; - case CertificateOrderActionType.CertificateExpirationWarning: - return "CertificateExpirationWarning"; - case CertificateOrderActionType.FraudDocumentationRequired: - return "FraudDocumentationRequired"; - case CertificateOrderActionType.Unknown: - return "Unknown"; - } - return null; - } - - internal static CertificateOrderActionType? ParseCertificateOrderActionType(this string value) - { - switch( value ) - { - case "CertificateIssued": - return CertificateOrderActionType.CertificateIssued; - case "CertificateOrderCanceled": - return CertificateOrderActionType.CertificateOrderCanceled; - case "CertificateOrderCreated": - return CertificateOrderActionType.CertificateOrderCreated; - case "CertificateRevoked": - return CertificateOrderActionType.CertificateRevoked; - case "DomainValidationComplete": - return CertificateOrderActionType.DomainValidationComplete; - case "FraudDetected": - return CertificateOrderActionType.FraudDetected; - case "OrgNameChange": - return CertificateOrderActionType.OrgNameChange; - case "OrgValidationComplete": - return CertificateOrderActionType.OrgValidationComplete; - case "SanDrop": - return CertificateOrderActionType.SanDrop; - case "FraudCleared": - return CertificateOrderActionType.FraudCleared; - case "CertificateExpired": - return CertificateOrderActionType.CertificateExpired; - case "CertificateExpirationWarning": - return CertificateOrderActionType.CertificateExpirationWarning; - case "FraudDocumentationRequired": - return CertificateOrderActionType.FraudDocumentationRequired; - case "Unknown": - return CertificateOrderActionType.Unknown; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.Serialization.cs new file mode 100644 index 000000000000..8f71676d9913 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CertificateOrderContact + { + internal static CertificateOrderContact DeserializeCertificateOrderContact(JsonElement element) + { + Optional email = default; + Optional nameFirst = default; + Optional nameLast = default; + Optional phone = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("email")) + { + email = property.Value.GetString(); + continue; + } + if (property.NameEquals("nameFirst")) + { + nameFirst = property.Value.GetString(); + continue; + } + if (property.NameEquals("nameLast")) + { + nameLast = property.Value.GetString(); + continue; + } + if (property.NameEquals("phone")) + { + phone = property.Value.GetString(); + continue; + } + } + return new CertificateOrderContact(email.Value, nameFirst.Value, nameLast.Value, phone.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs new file mode 100644 index 000000000000..d59e113f695d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The CertificateOrderContact. + public partial class CertificateOrderContact + { + /// Initializes a new instance of CertificateOrderContact. + internal CertificateOrderContact() + { + } + + /// Initializes a new instance of CertificateOrderContact. + /// . + /// . + /// . + /// . + internal CertificateOrderContact(string email, string nameFirst, string nameLast, string phone) + { + Email = email; + NameFirst = nameFirst; + NameLast = nameLast; + Phone = phone; + } + + public string Email { get; } + public string NameFirst { get; } + public string NameLast { get; } + public string Phone { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.Serialization.cs new file mode 100644 index 000000000000..79b6a36e21a9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.Serialization.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class CertificateOrderStatusExtensions + { + public static string ToSerialString(this CertificateOrderStatus value) => value switch + { + CertificateOrderStatus.Pendingissuance => "Pendingissuance", + CertificateOrderStatus.Issued => "Issued", + CertificateOrderStatus.Revoked => "Revoked", + CertificateOrderStatus.Canceled => "Canceled", + CertificateOrderStatus.Denied => "Denied", + CertificateOrderStatus.Pendingrevocation => "Pendingrevocation", + CertificateOrderStatus.PendingRekey => "PendingRekey", + CertificateOrderStatus.Unused => "Unused", + CertificateOrderStatus.Expired => "Expired", + CertificateOrderStatus.NotSubmitted => "NotSubmitted", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateOrderStatus value.") + }; + + public static CertificateOrderStatus ToCertificateOrderStatus(this string value) + { + if (string.Equals(value, "Pendingissuance", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Pendingissuance; + if (string.Equals(value, "Issued", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Issued; + if (string.Equals(value, "Revoked", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Revoked; + if (string.Equals(value, "Canceled", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Canceled; + if (string.Equals(value, "Denied", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Denied; + if (string.Equals(value, "Pendingrevocation", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Pendingrevocation; + if (string.Equals(value, "PendingRekey", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.PendingRekey; + if (string.Equals(value, "Unused", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Unused; + if (string.Equals(value, "Expired", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Expired; + if (string.Equals(value, "NotSubmitted", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.NotSubmitted; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateOrderStatus value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.cs index 47bd350eb582..5d7da3418885 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.cs @@ -1,108 +1,34 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for CertificateOrderStatus. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Current order status. public enum CertificateOrderStatus { - [EnumMember(Value = "Pendingissuance")] + /// Pendingissuance. Pendingissuance, - [EnumMember(Value = "Issued")] + /// Issued. Issued, - [EnumMember(Value = "Revoked")] + /// Revoked. Revoked, - [EnumMember(Value = "Canceled")] + /// Canceled. Canceled, - [EnumMember(Value = "Denied")] + /// Denied. Denied, - [EnumMember(Value = "Pendingrevocation")] + /// Pendingrevocation. Pendingrevocation, - [EnumMember(Value = "PendingRekey")] + /// PendingRekey. PendingRekey, - [EnumMember(Value = "Unused")] + /// Unused. Unused, - [EnumMember(Value = "Expired")] + /// Expired. Expired, - [EnumMember(Value = "NotSubmitted")] + /// NotSubmitted. NotSubmitted } - internal static class CertificateOrderStatusEnumExtension - { - internal static string ToSerializedValue(this CertificateOrderStatus? value) - { - return value == null ? null : ((CertificateOrderStatus)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this CertificateOrderStatus value) - { - switch( value ) - { - case CertificateOrderStatus.Pendingissuance: - return "Pendingissuance"; - case CertificateOrderStatus.Issued: - return "Issued"; - case CertificateOrderStatus.Revoked: - return "Revoked"; - case CertificateOrderStatus.Canceled: - return "Canceled"; - case CertificateOrderStatus.Denied: - return "Denied"; - case CertificateOrderStatus.Pendingrevocation: - return "Pendingrevocation"; - case CertificateOrderStatus.PendingRekey: - return "PendingRekey"; - case CertificateOrderStatus.Unused: - return "Unused"; - case CertificateOrderStatus.Expired: - return "Expired"; - case CertificateOrderStatus.NotSubmitted: - return "NotSubmitted"; - } - return null; - } - - internal static CertificateOrderStatus? ParseCertificateOrderStatus(this string value) - { - switch( value ) - { - case "Pendingissuance": - return CertificateOrderStatus.Pendingissuance; - case "Issued": - return CertificateOrderStatus.Issued; - case "Revoked": - return CertificateOrderStatus.Revoked; - case "Canceled": - return CertificateOrderStatus.Canceled; - case "Denied": - return CertificateOrderStatus.Denied; - case "Pendingrevocation": - return CertificateOrderStatus.Pendingrevocation; - case "PendingRekey": - return CertificateOrderStatus.PendingRekey; - case "Unused": - return CertificateOrderStatus.Unused; - case "Expired": - return CertificateOrderStatus.Expired; - case "NotSubmitted": - return CertificateOrderStatus.NotSubmitted; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.Serialization.cs new file mode 100644 index 000000000000..9e2bc0e3f279 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.Serialization.cs @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CertificatePatchResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"); + writer.WriteStringValue(Password); + } + if (Optional.IsCollectionDefined(HostNames)) + { + writer.WritePropertyName("hostNames"); + writer.WriteStartArray(); + foreach (var item in HostNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PfxBlob)) + { + writer.WritePropertyName("pfxBlob"); + writer.WriteBase64StringValue(PfxBlob, "D"); + } + if (Optional.IsDefined(KeyVaultId)) + { + writer.WritePropertyName("keyVaultId"); + writer.WriteStringValue(KeyVaultId); + } + if (Optional.IsDefined(KeyVaultSecretName)) + { + writer.WritePropertyName("keyVaultSecretName"); + writer.WriteStringValue(KeyVaultSecretName); + } + if (Optional.IsDefined(ServerFarmId)) + { + writer.WritePropertyName("serverFarmId"); + writer.WriteStringValue(ServerFarmId); + } + if (Optional.IsDefined(CanonicalName)) + { + writer.WritePropertyName("canonicalName"); + writer.WriteStringValue(CanonicalName); + } + if (Optional.IsDefined(DomainValidationMethod)) + { + writer.WritePropertyName("domainValidationMethod"); + writer.WriteStringValue(DomainValidationMethod); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static CertificatePatchResource DeserializeCertificatePatchResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional password = default; + Optional friendlyName = default; + Optional subjectName = default; + Optional> hostNames = default; + Optional pfxBlob = default; + Optional siteName = default; + Optional selfLink = default; + Optional issuer = default; + Optional issueDate = default; + Optional expirationDate = default; + Optional thumbprint = default; + Optional valid = default; + Optional cerBlob = default; + Optional publicKeyHash = default; + Optional hostingEnvironmentProfile = default; + Optional keyVaultId = default; + Optional keyVaultSecretName = default; + Optional keyVaultSecretStatus = default; + Optional serverFarmId = default; + Optional canonicalName = default; + Optional domainValidationMethod = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("password")) + { + password = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("friendlyName")) + { + friendlyName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("subjectName")) + { + subjectName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + hostNames = array; + continue; + } + if (property0.NameEquals("pfxBlob")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + pfxBlob = property0.Value.GetBytesFromBase64("D"); + continue; + } + if (property0.NameEquals("siteName")) + { + siteName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("selfLink")) + { + selfLink = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("issuer")) + { + issuer = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("issueDate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + issueDate = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("expirationDate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + expirationDate = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("thumbprint")) + { + thumbprint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("valid")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + valid = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("cerBlob")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + cerBlob = property0.Value.GetBytesFromBase64("D"); + continue; + } + if (property0.NameEquals("publicKeyHash")) + { + publicKeyHash = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostingEnvironmentProfile")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); + continue; + } + if (property0.NameEquals("keyVaultId")) + { + keyVaultId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("keyVaultSecretName")) + { + keyVaultSecretName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("keyVaultSecretStatus")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + keyVaultSecretStatus = property0.Value.GetString().ToKeyVaultSecretStatus(); + continue; + } + if (property0.NameEquals("serverFarmId")) + { + serverFarmId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("canonicalName")) + { + canonicalName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("domainValidationMethod")) + { + domainValidationMethod = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new CertificatePatchResource(id.Value, name.Value, kind.Value, type.Value, password.Value, friendlyName.Value, subjectName.Value, Optional.ToList(hostNames), pfxBlob.Value, siteName.Value, selfLink.Value, issuer.Value, Optional.ToNullable(issueDate), Optional.ToNullable(expirationDate), thumbprint.Value, Optional.ToNullable(valid), cerBlob.Value, publicKeyHash.Value, hostingEnvironmentProfile.Value, keyVaultId.Value, keyVaultSecretName.Value, Optional.ToNullable(keyVaultSecretStatus), serverFarmId.Value, canonicalName.Value, domainValidationMethod.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs index f2579bd985bc..4d7e6ca0b5c5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs @@ -1,78 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// ARM resource for a certificate. - /// - [Rest.Serialization.JsonTransformation] + /// ARM resource for a certificate. public partial class CertificatePatchResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the CertificatePatchResource class. - /// + /// Initializes a new instance of CertificatePatchResource. public CertificatePatchResource() { - CustomInit(); + HostNames = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the CertificatePatchResource class. - /// - /// Certificate password. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Friendly name of the - /// certificate. - /// Subject name of the certificate. - /// Host names the certificate applies - /// to. - /// Pfx blob. - /// App name. - /// Self link. - /// Certificate issuer. - /// Certificate issue Date. - /// Certificate expiration date. - /// Certificate thumbprint. - /// Is the certificate valid?. - /// Raw bytes of .cer file - /// Public key hash. - /// Specification for the App - /// Service Environment to use for the certificate. - /// Key Vault Csm resource Id. - /// Key Vault secret name. - /// Status of the Key Vault secret. - /// Possible values include: 'Initialized', - /// 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', - /// 'OperationNotPermittedOnKeyVault', - /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', - /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', - /// 'Unknown' - /// Resource ID of the associated App - /// Service plan, formatted as: - /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - /// CNAME of the certificate to be issued - /// via free certificate - public CertificatePatchResource(string password, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of CertificatePatchResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Certificate password. + /// Friendly name of the certificate. + /// Subject name of the certificate. + /// Host names the certificate applies to. + /// Pfx blob. + /// App name. + /// Self link. + /// Certificate issuer. + /// Certificate issue Date. + /// Certificate expiration date. + /// Certificate thumbprint. + /// Is the certificate valid?. + /// Raw bytes of .cer file. + /// Public key hash. + /// Specification for the App Service Environment to use for the certificate. + /// Key Vault Csm resource Id. + /// Key Vault secret name. + /// Status of the Key Vault secret. + /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + /// CNAME of the certificate to be issued via free certificate. + /// Method of domain validation for free cert. + internal CertificatePatchResource(string id, string name, string kind, string type, string password, string friendlyName, string subjectName, IList hostNames, byte[] pfxBlob, string siteName, string selfLink, string issuer, DateTimeOffset? issueDate, DateTimeOffset? expirationDate, string thumbprint, bool? valid, byte[] cerBlob, string publicKeyHash, HostingEnvironmentProfile hostingEnvironmentProfile, string keyVaultId, string keyVaultSecretName, KeyVaultSecretStatus? keyVaultSecretStatus, string serverFarmId, string canonicalName, string domainValidationMethod) : base(id, name, kind, type) { + Password = password; FriendlyName = friendlyName; SubjectName = subjectName; HostNames = hostNames; @@ -82,7 +58,6 @@ public CertificatePatchResource() Issuer = issuer; IssueDate = issueDate; ExpirationDate = expirationDate; - Password = password; Thumbprint = thumbprint; Valid = valid; CerBlob = cerBlob; @@ -93,155 +68,50 @@ public CertificatePatchResource() KeyVaultSecretStatus = keyVaultSecretStatus; ServerFarmId = serverFarmId; CanonicalName = canonicalName; - CustomInit(); + DomainValidationMethod = domainValidationMethod; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets friendly name of the certificate. - /// - [JsonProperty(PropertyName = "properties.friendlyName")] - public string FriendlyName { get; private set; } - - /// - /// Gets subject name of the certificate. - /// - [JsonProperty(PropertyName = "properties.subjectName")] - public string SubjectName { get; private set; } - - /// - /// Gets or sets host names the certificate applies to. - /// - [JsonProperty(PropertyName = "properties.hostNames")] - public IList HostNames { get; set; } - - /// - /// Gets or sets pfx blob. - /// - [JsonProperty(PropertyName = "properties.pfxBlob")] - public byte[] PfxBlob { get; set; } - - /// - /// Gets app name. - /// - [JsonProperty(PropertyName = "properties.siteName")] - public string SiteName { get; private set; } - - /// - /// Gets self link. - /// - [JsonProperty(PropertyName = "properties.selfLink")] - public string SelfLink { get; private set; } - - /// - /// Gets certificate issuer. - /// - [JsonProperty(PropertyName = "properties.issuer")] - public string Issuer { get; private set; } - - /// - /// Gets certificate issue Date. - /// - [JsonProperty(PropertyName = "properties.issueDate")] - public System.DateTime? IssueDate { get; private set; } - - /// - /// Gets certificate expiration date. - /// - [JsonProperty(PropertyName = "properties.expirationDate")] - public System.DateTime? ExpirationDate { get; private set; } - - /// - /// Gets or sets certificate password. - /// - [JsonProperty(PropertyName = "properties.password")] + /// Certificate password. public string Password { get; set; } - - /// - /// Gets certificate thumbprint. - /// - [JsonProperty(PropertyName = "properties.thumbprint")] - public string Thumbprint { get; private set; } - - /// - /// Gets is the certificate valid?. - /// - [JsonProperty(PropertyName = "properties.valid")] - public bool? Valid { get; private set; } - - /// - /// Gets raw bytes of .cer file - /// - [JsonProperty(PropertyName = "properties.cerBlob")] - public byte[] CerBlob { get; private set; } - - /// - /// Gets public key hash. - /// - [JsonProperty(PropertyName = "properties.publicKeyHash")] - public string PublicKeyHash { get; private set; } - - /// - /// Gets specification for the App Service Environment to use for the - /// certificate. - /// - [JsonProperty(PropertyName = "properties.hostingEnvironmentProfile")] - public HostingEnvironmentProfile HostingEnvironmentProfile { get; private set; } - - /// - /// Gets or sets key Vault Csm resource Id. - /// - [JsonProperty(PropertyName = "properties.keyVaultId")] + /// Friendly name of the certificate. + public string FriendlyName { get; } + /// Subject name of the certificate. + public string SubjectName { get; } + /// Host names the certificate applies to. + public IList HostNames { get; } + /// Pfx blob. + public byte[] PfxBlob { get; set; } + /// App name. + public string SiteName { get; } + /// Self link. + public string SelfLink { get; } + /// Certificate issuer. + public string Issuer { get; } + /// Certificate issue Date. + public DateTimeOffset? IssueDate { get; } + /// Certificate expiration date. + public DateTimeOffset? ExpirationDate { get; } + /// Certificate thumbprint. + public string Thumbprint { get; } + /// Is the certificate valid?. + public bool? Valid { get; } + /// Raw bytes of .cer file. + public byte[] CerBlob { get; } + /// Public key hash. + public string PublicKeyHash { get; } + /// Specification for the App Service Environment to use for the certificate. + public HostingEnvironmentProfile HostingEnvironmentProfile { get; } + /// Key Vault Csm resource Id. public string KeyVaultId { get; set; } - - /// - /// Gets or sets key Vault secret name. - /// - [JsonProperty(PropertyName = "properties.keyVaultSecretName")] + /// Key Vault secret name. public string KeyVaultSecretName { get; set; } - - /// - /// Gets status of the Key Vault secret. Possible values include: - /// 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', - /// 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', - /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', - /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', - /// 'Unknown' - /// - [JsonProperty(PropertyName = "properties.keyVaultSecretStatus")] - public KeyVaultSecretStatus? KeyVaultSecretStatus { get; private set; } - - /// - /// Gets or sets resource ID of the associated App Service plan, - /// formatted as: - /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - /// - [JsonProperty(PropertyName = "properties.serverFarmId")] + /// Status of the Key Vault secret. + public KeyVaultSecretStatus? KeyVaultSecretStatus { get; } + /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". public string ServerFarmId { get; set; } - - /// - /// Gets or sets CNAME of the certificate to be issued via free - /// certificate - /// - [JsonProperty(PropertyName = "properties.canonicalName")] + /// CNAME of the certificate to be issued via free certificate. public string CanonicalName { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Password == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Password"); - } - } + /// Method of domain validation for free cert. + public string DomainValidationMethod { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.Serialization.cs new file mode 100644 index 000000000000..365bfbdd1b04 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class CertificateProductTypeExtensions + { + public static string ToSerialString(this CertificateProductType value) => value switch + { + CertificateProductType.StandardDomainValidatedSsl => "StandardDomainValidatedSsl", + CertificateProductType.StandardDomainValidatedWildCardSsl => "StandardDomainValidatedWildCardSsl", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateProductType value.") + }; + + public static CertificateProductType ToCertificateProductType(this string value) + { + if (string.Equals(value, "StandardDomainValidatedSsl", StringComparison.InvariantCultureIgnoreCase)) return CertificateProductType.StandardDomainValidatedSsl; + if (string.Equals(value, "StandardDomainValidatedWildCardSsl", StringComparison.InvariantCultureIgnoreCase)) return CertificateProductType.StandardDomainValidatedWildCardSsl; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateProductType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.cs index 218a545ac0ee..37db093b8507 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for CertificateProductType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Certificate product type. public enum CertificateProductType { - [EnumMember(Value = "StandardDomainValidatedSsl")] + /// StandardDomainValidatedSsl. StandardDomainValidatedSsl, - [EnumMember(Value = "StandardDomainValidatedWildCardSsl")] + /// StandardDomainValidatedWildCardSsl. StandardDomainValidatedWildCardSsl } - internal static class CertificateProductTypeEnumExtension - { - internal static string ToSerializedValue(this CertificateProductType? value) - { - return value == null ? null : ((CertificateProductType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this CertificateProductType value) - { - switch( value ) - { - case CertificateProductType.StandardDomainValidatedSsl: - return "StandardDomainValidatedSsl"; - case CertificateProductType.StandardDomainValidatedWildCardSsl: - return "StandardDomainValidatedWildCardSsl"; - } - return null; - } - - internal static CertificateProductType? ParseCertificateProductType(this string value) - { - switch( value ) - { - case "StandardDomainValidatedSsl": - return CertificateProductType.StandardDomainValidatedSsl; - case "StandardDomainValidatedWildCardSsl": - return CertificateProductType.StandardDomainValidatedWildCardSsl; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.Serialization.cs new file mode 100644 index 000000000000..a0acb8deaaf9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class ChannelsExtensions + { + public static string ToSerialString(this Channels value) => value switch + { + Channels.Notification => "Notification", + Channels.Api => "Api", + Channels.Email => "Email", + Channels.Webhook => "Webhook", + Channels.All => "All", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Channels value.") + }; + + public static Channels ToChannels(this string value) + { + if (string.Equals(value, "Notification", StringComparison.InvariantCultureIgnoreCase)) return Channels.Notification; + if (string.Equals(value, "Api", StringComparison.InvariantCultureIgnoreCase)) return Channels.Api; + if (string.Equals(value, "Email", StringComparison.InvariantCultureIgnoreCase)) return Channels.Email; + if (string.Equals(value, "Webhook", StringComparison.InvariantCultureIgnoreCase)) return Channels.Webhook; + if (string.Equals(value, "All", StringComparison.InvariantCultureIgnoreCase)) return Channels.All; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Channels value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.cs index 509a07710bdf..b4ed6f6ec535 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.cs @@ -1,78 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for Channels. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// List of channels that this recommendation can apply. public enum Channels { - [EnumMember(Value = "Notification")] + /// Notification. Notification, - [EnumMember(Value = "Api")] + /// Api. Api, - [EnumMember(Value = "Email")] + /// Email. Email, - [EnumMember(Value = "Webhook")] + /// Webhook. Webhook, - [EnumMember(Value = "All")] + /// All. All } - internal static class ChannelsEnumExtension - { - internal static string ToSerializedValue(this Channels? value) - { - return value == null ? null : ((Channels)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this Channels value) - { - switch( value ) - { - case Channels.Notification: - return "Notification"; - case Channels.Api: - return "Api"; - case Channels.Email: - return "Email"; - case Channels.Webhook: - return "Webhook"; - case Channels.All: - return "All"; - } - return null; - } - - internal static Channels? ParseChannels(this string value) - { - switch( value ) - { - case "Notification": - return Channels.Notification; - case "Api": - return Channels.Api; - case "Email": - return Channels.Email; - case "Webhook": - return Channels.Webhook; - case "All": - return Channels.All; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CheckNameResourceTypes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CheckNameResourceTypes.cs index b13b8d8adcc4..1aec6905ab01 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CheckNameResourceTypes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CheckNameResourceTypes.cs @@ -1,28 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for CheckNameResourceTypes. - /// - public static class CheckNameResourceTypes + /// Resource type used for verification. + public readonly partial struct CheckNameResourceTypes : IEquatable { - public const string Site = "Site"; - public const string Slot = "Slot"; - public const string HostingEnvironment = "HostingEnvironment"; - public const string PublishingUser = "PublishingUser"; - public const string MicrosoftWebSites = "Microsoft.Web/sites"; - public const string MicrosoftWebSitesSlots = "Microsoft.Web/sites/slots"; - public const string MicrosoftWebHostingEnvironments = "Microsoft.Web/hostingEnvironments"; - public const string MicrosoftWebPublishingUsers = "Microsoft.Web/publishingUsers"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public CheckNameResourceTypes(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SiteValue = "Site"; + private const string SlotValue = "Slot"; + private const string HostingEnvironmentValue = "HostingEnvironment"; + private const string PublishingUserValue = "PublishingUser"; + private const string MicrosoftWebSitesValue = "Microsoft.Web/sites"; + private const string MicrosoftWebSitesSlotsValue = "Microsoft.Web/sites/slots"; + private const string MicrosoftWebHostingEnvironmentsValue = "Microsoft.Web/hostingEnvironments"; + private const string MicrosoftWebPublishingUsersValue = "Microsoft.Web/publishingUsers"; + + /// Site. + public static CheckNameResourceTypes Site { get; } = new CheckNameResourceTypes(SiteValue); + /// Slot. + public static CheckNameResourceTypes Slot { get; } = new CheckNameResourceTypes(SlotValue); + /// HostingEnvironment. + public static CheckNameResourceTypes HostingEnvironment { get; } = new CheckNameResourceTypes(HostingEnvironmentValue); + /// PublishingUser. + public static CheckNameResourceTypes PublishingUser { get; } = new CheckNameResourceTypes(PublishingUserValue); + /// Microsoft.Web/sites. + public static CheckNameResourceTypes MicrosoftWebSites { get; } = new CheckNameResourceTypes(MicrosoftWebSitesValue); + /// Microsoft.Web/sites/slots. + public static CheckNameResourceTypes MicrosoftWebSitesSlots { get; } = new CheckNameResourceTypes(MicrosoftWebSitesSlotsValue); + /// Microsoft.Web/hostingEnvironments. + public static CheckNameResourceTypes MicrosoftWebHostingEnvironments { get; } = new CheckNameResourceTypes(MicrosoftWebHostingEnvironmentsValue); + /// Microsoft.Web/publishingUsers. + public static CheckNameResourceTypes MicrosoftWebPublishingUsers { get; } = new CheckNameResourceTypes(MicrosoftWebPublishingUsersValue); + /// Determines if two values are the same. + public static bool operator ==(CheckNameResourceTypes left, CheckNameResourceTypes right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CheckNameResourceTypes left, CheckNameResourceTypes right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CheckNameResourceTypes(string value) => new CheckNameResourceTypes(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CheckNameResourceTypes other && Equals(other); + /// + public bool Equals(CheckNameResourceTypes other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.Serialization.cs new file mode 100644 index 000000000000..d601a4e5a596 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class ClientCertModeExtensions + { + public static string ToSerialString(this ClientCertMode value) => value switch + { + ClientCertMode.Required => "Required", + ClientCertMode.Optional => "Optional", + ClientCertMode.OptionalInteractiveUser => "OptionalInteractiveUser", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ClientCertMode value.") + }; + + public static ClientCertMode ToClientCertMode(this string value) + { + if (string.Equals(value, "Required", StringComparison.InvariantCultureIgnoreCase)) return ClientCertMode.Required; + if (string.Equals(value, "Optional", StringComparison.InvariantCultureIgnoreCase)) return ClientCertMode.Optional; + if (string.Equals(value, "OptionalInteractiveUser", StringComparison.InvariantCultureIgnoreCase)) return ClientCertMode.OptionalInteractiveUser; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ClientCertMode value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs index 422855315598..359687cb657e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs @@ -1,60 +1,25 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - /// - /// Defines values for ClientCertMode. + /// This composes with ClientCertEnabled setting. + /// - ClientCertEnabled: false means ClientCert is ignored. + /// - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + /// - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. /// - [JsonConverter(typeof(StringEnumConverter))] public enum ClientCertMode { - [EnumMember(Value = "Required")] + /// Required. Required, - [EnumMember(Value = "Optional")] - Optional - } - internal static class ClientCertModeEnumExtension - { - internal static string ToSerializedValue(this ClientCertMode? value) - { - return value == null ? null : ((ClientCertMode)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ClientCertMode value) - { - switch( value ) - { - case ClientCertMode.Required: - return "Required"; - case ClientCertMode.Optional: - return "Optional"; - } - return null; - } - - internal static ClientCertMode? ParseClientCertMode(this string value) - { - switch( value ) - { - case "Required": - return ClientCertMode.Required; - case "Optional": - return ClientCertMode.Optional; - } - return null; - } + /// Optional. + Optional, + /// OptionalInteractiveUser. + OptionalInteractiveUser } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.Serialization.cs new file mode 100644 index 000000000000..0b0b0e6ac25e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.Serialization.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ClientRegistration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"); + writer.WriteStringValue(ClientId); + } + if (Optional.IsDefined(ClientSecretSettingName)) + { + writer.WritePropertyName("clientSecretSettingName"); + writer.WriteStringValue(ClientSecretSettingName); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ClientRegistration DeserializeClientRegistration(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional clientId = default; + Optional clientSecretSettingName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("clientId")) + { + clientId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientSecretSettingName")) + { + clientSecretSettingName = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new ClientRegistration(id.Value, name.Value, kind.Value, type.Value, clientId.Value, clientSecretSettingName.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.cs index 516e1eda692c..b64a39ea0ec8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.cs @@ -1,60 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the app registration for providers that have client ids and client secrets. public partial class ClientRegistration : ProxyOnlyResource { - /// - /// Initializes a new instance of the ClientRegistration class. - /// + /// Initializes a new instance of ClientRegistration. public ClientRegistration() { - CustomInit(); } - /// - /// Initializes a new instance of the ClientRegistration class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public ClientRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string clientId = default(string), string clientSecretSettingName = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of ClientRegistration. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Client ID of the app used for login. + /// The app setting name that contains the client secret. + internal ClientRegistration(string id, string name, string kind, string type, string clientId, string clientSecretSettingName) : base(id, name, kind, type) { ClientId = clientId; ClientSecretSettingName = clientSecretSettingName; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.clientId")] + /// The Client ID of the app used for login. public string ClientId { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.clientSecretSettingName")] + /// The app setting name that contains the client secret. public string ClientSecretSettingName { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.Serialization.cs new file mode 100644 index 000000000000..3a59a8760746 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class CloneAbilityResultExtensions + { + public static string ToSerialString(this CloneAbilityResult value) => value switch + { + CloneAbilityResult.Cloneable => "Cloneable", + CloneAbilityResult.PartiallyCloneable => "PartiallyCloneable", + CloneAbilityResult.NotCloneable => "NotCloneable", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CloneAbilityResult value.") + }; + + public static CloneAbilityResult ToCloneAbilityResult(this string value) + { + if (string.Equals(value, "Cloneable", StringComparison.InvariantCultureIgnoreCase)) return CloneAbilityResult.Cloneable; + if (string.Equals(value, "PartiallyCloneable", StringComparison.InvariantCultureIgnoreCase)) return CloneAbilityResult.PartiallyCloneable; + if (string.Equals(value, "NotCloneable", StringComparison.InvariantCultureIgnoreCase)) return CloneAbilityResult.NotCloneable; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CloneAbilityResult value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.cs index 3555d8200dba..40e143b0a282 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for CloneAbilityResult. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Name of app. public enum CloneAbilityResult { - [EnumMember(Value = "Cloneable")] + /// Cloneable. Cloneable, - [EnumMember(Value = "PartiallyCloneable")] + /// PartiallyCloneable. PartiallyCloneable, - [EnumMember(Value = "NotCloneable")] + /// NotCloneable. NotCloneable } - internal static class CloneAbilityResultEnumExtension - { - internal static string ToSerializedValue(this CloneAbilityResult? value) - { - return value == null ? null : ((CloneAbilityResult)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this CloneAbilityResult value) - { - switch( value ) - { - case CloneAbilityResult.Cloneable: - return "Cloneable"; - case CloneAbilityResult.PartiallyCloneable: - return "PartiallyCloneable"; - case CloneAbilityResult.NotCloneable: - return "NotCloneable"; - } - return null; - } - - internal static CloneAbilityResult? ParseCloneAbilityResult(this string value) - { - switch( value ) - { - case "Cloneable": - return CloneAbilityResult.Cloneable; - case "PartiallyCloneable": - return CloneAbilityResult.PartiallyCloneable; - case "NotCloneable": - return CloneAbilityResult.NotCloneable; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.Serialization.cs new file mode 100644 index 000000000000..ff456e4c7ee2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CloningInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"); + writer.WriteStringValue(CorrelationId.Value); + } + if (Optional.IsDefined(Overwrite)) + { + writer.WritePropertyName("overwrite"); + writer.WriteBooleanValue(Overwrite.Value); + } + if (Optional.IsDefined(CloneCustomHostNames)) + { + writer.WritePropertyName("cloneCustomHostNames"); + writer.WriteBooleanValue(CloneCustomHostNames.Value); + } + if (Optional.IsDefined(CloneSourceControl)) + { + writer.WritePropertyName("cloneSourceControl"); + writer.WriteBooleanValue(CloneSourceControl.Value); + } + writer.WritePropertyName("sourceWebAppId"); + writer.WriteStringValue(SourceWebAppId); + if (Optional.IsDefined(SourceWebAppLocation)) + { + writer.WritePropertyName("sourceWebAppLocation"); + writer.WriteStringValue(SourceWebAppLocation); + } + if (Optional.IsDefined(HostingEnvironment)) + { + writer.WritePropertyName("hostingEnvironment"); + writer.WriteStringValue(HostingEnvironment); + } + if (Optional.IsCollectionDefined(AppSettingsOverrides)) + { + writer.WritePropertyName("appSettingsOverrides"); + writer.WriteStartObject(); + foreach (var item in AppSettingsOverrides) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(ConfigureLoadBalancing)) + { + writer.WritePropertyName("configureLoadBalancing"); + writer.WriteBooleanValue(ConfigureLoadBalancing.Value); + } + if (Optional.IsDefined(TrafficManagerProfileId)) + { + writer.WritePropertyName("trafficManagerProfileId"); + writer.WriteStringValue(TrafficManagerProfileId); + } + if (Optional.IsDefined(TrafficManagerProfileName)) + { + writer.WritePropertyName("trafficManagerProfileName"); + writer.WriteStringValue(TrafficManagerProfileName); + } + writer.WriteEndObject(); + } + + internal static CloningInfo DeserializeCloningInfo(JsonElement element) + { + Optional correlationId = default; + Optional overwrite = default; + Optional cloneCustomHostNames = default; + Optional cloneSourceControl = default; + string sourceWebAppId = default; + Optional sourceWebAppLocation = default; + Optional hostingEnvironment = default; + Optional> appSettingsOverrides = default; + Optional configureLoadBalancing = default; + Optional trafficManagerProfileId = default; + Optional trafficManagerProfileName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("correlationId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + correlationId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("overwrite")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + overwrite = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("cloneCustomHostNames")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + cloneCustomHostNames = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("cloneSourceControl")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + cloneSourceControl = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("sourceWebAppId")) + { + sourceWebAppId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceWebAppLocation")) + { + sourceWebAppLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostingEnvironment")) + { + hostingEnvironment = property.Value.GetString(); + continue; + } + if (property.NameEquals("appSettingsOverrides")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + appSettingsOverrides = dictionary; + continue; + } + if (property.NameEquals("configureLoadBalancing")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + configureLoadBalancing = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("trafficManagerProfileId")) + { + trafficManagerProfileId = property.Value.GetString(); + continue; + } + if (property.NameEquals("trafficManagerProfileName")) + { + trafficManagerProfileName = property.Value.GetString(); + continue; + } + } + return new CloningInfo(Optional.ToNullable(correlationId), Optional.ToNullable(overwrite), Optional.ToNullable(cloneCustomHostNames), Optional.ToNullable(cloneSourceControl), sourceWebAppId, sourceWebAppLocation.Value, hostingEnvironment.Value, Optional.ToDictionary(appSettingsOverrides), Optional.ToNullable(configureLoadBalancing), trafficManagerProfileId.Value, trafficManagerProfileName.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.cs index 173b4f376d33..436aa76c80cc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.cs @@ -1,72 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Information needed for cloning operation. - /// + /// Information needed for cloning operation. public partial class CloningInfo { - /// - /// Initializes a new instance of the CloningInfo class. - /// - public CloningInfo() + /// Initializes a new instance of CloningInfo. + /// + /// ARM resource ID of the source app. App resource ID is of the form + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. + /// + /// is null. + public CloningInfo(string sourceWebAppId) { - CustomInit(); + if (sourceWebAppId == null) + { + throw new ArgumentNullException(nameof(sourceWebAppId)); + } + + SourceWebAppId = sourceWebAppId; + AppSettingsOverrides = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the CloningInfo class. - /// - /// ARM resource ID of the source app. App - /// resource ID is of the form - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} - /// for production slots and - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} - /// for other slots. - /// Correlation ID of cloning operation. - /// This ID ties multiple cloning operations - /// together to use the same snapshot. - /// <code>true</code> to overwrite - /// destination app; otherwise, <code>false</code>. - /// <code>true</code> to - /// clone custom hostnames from source app; otherwise, - /// <code>false</code>. - /// <code>true</code> to - /// clone source control from source app; otherwise, - /// <code>false</code>. - /// Location of source app ex: West - /// US or North Europe - /// App Service Environment. - /// Application setting overrides - /// for cloned app. If specified, these settings override the settings - /// cloned - /// from source app. Otherwise, application settings from source app - /// are retained. - /// <code>true</code> - /// to configure load balancing for source and destination app. - /// ARM resource ID of the - /// Traffic Manager profile to use, if it exists. Traffic Manager - /// resource ID is of the form - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. - /// Name of Traffic Manager - /// profile to create. This is only needed if Traffic Manager profile - /// does not already exist. - public CloningInfo(string sourceWebAppId, System.Guid? correlationId = default(System.Guid?), bool? overwrite = default(bool?), bool? cloneCustomHostNames = default(bool?), bool? cloneSourceControl = default(bool?), string sourceWebAppLocation = default(string), string hostingEnvironment = default(string), IDictionary appSettingsOverrides = default(IDictionary), bool? configureLoadBalancing = default(bool?), string trafficManagerProfileId = default(string), string trafficManagerProfileName = default(string)) + /// Initializes a new instance of CloningInfo. + /// + /// Correlation ID of cloning operation. This ID ties multiple cloning operations + /// together to use the same snapshot. + /// + /// <code>true</code> to overwrite destination app; otherwise, <code>false</code>. + /// <code>true</code> to clone custom hostnames from source app; otherwise, <code>false</code>. + /// <code>true</code> to clone source control from source app; otherwise, <code>false</code>. + /// + /// ARM resource ID of the source app. App resource ID is of the form + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. + /// + /// Location of source app ex: West US or North Europe. + /// App Service Environment. + /// + /// Application setting overrides for cloned app. If specified, these settings override the settings cloned + /// from source app. Otherwise, application settings from source app are retained. + /// + /// <code>true</code> to configure load balancing for source and destination app. + /// + /// ARM resource ID of the Traffic Manager profile to use, if it exists. Traffic Manager resource ID is of the form + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + /// + /// Name of Traffic Manager profile to create. This is only needed if Traffic Manager profile does not already exist. + internal CloningInfo(Guid? correlationId, bool? overwrite, bool? cloneCustomHostNames, bool? cloneSourceControl, string sourceWebAppId, string sourceWebAppLocation, string hostingEnvironment, IDictionary appSettingsOverrides, bool? configureLoadBalancing, string trafficManagerProfileId, string trafficManagerProfileName) { CorrelationId = correlationId; Overwrite = overwrite; @@ -79,112 +70,42 @@ public CloningInfo() ConfigureLoadBalancing = configureLoadBalancing; TrafficManagerProfileId = trafficManagerProfileId; TrafficManagerProfileName = trafficManagerProfileName; - CustomInit(); } /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets correlation ID of cloning operation. This ID ties - /// multiple cloning operations + /// Correlation ID of cloning operation. This ID ties multiple cloning operations /// together to use the same snapshot. /// - [JsonProperty(PropertyName = "correlationId")] - public System.Guid? CorrelationId { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// overwrite destination app; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "overwrite")] + public Guid? CorrelationId { get; set; } + /// <code>true</code> to overwrite destination app; otherwise, <code>false</code>. public bool? Overwrite { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to clone - /// custom hostnames from source app; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "cloneCustomHostNames")] + /// <code>true</code> to clone custom hostnames from source app; otherwise, <code>false</code>. public bool? CloneCustomHostNames { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to clone - /// source control from source app; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "cloneSourceControl")] + /// <code>true</code> to clone source control from source app; otherwise, <code>false</code>. public bool? CloneSourceControl { get; set; } - /// - /// Gets or sets ARM resource ID of the source app. App resource ID is - /// of the form - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} - /// for production slots and - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} - /// for other slots. + /// ARM resource ID of the source app. App resource ID is of the form + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. /// - [JsonProperty(PropertyName = "sourceWebAppId")] public string SourceWebAppId { get; set; } - - /// - /// Gets or sets location of source app ex: West US or North Europe - /// - [JsonProperty(PropertyName = "sourceWebAppLocation")] + /// Location of source app ex: West US or North Europe. public string SourceWebAppLocation { get; set; } - - /// - /// Gets or sets app Service Environment. - /// - [JsonProperty(PropertyName = "hostingEnvironment")] + /// App Service Environment. public string HostingEnvironment { get; set; } - - /// - /// Gets or sets application setting overrides for cloned app. If - /// specified, these settings override the settings cloned - /// from source app. Otherwise, application settings from source app - /// are retained. - /// - [JsonProperty(PropertyName = "appSettingsOverrides")] - public IDictionary AppSettingsOverrides { get; set; } - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// configure load balancing for source and destination app. + /// Application setting overrides for cloned app. If specified, these settings override the settings cloned + /// from source app. Otherwise, application settings from source app are retained. /// - [JsonProperty(PropertyName = "configureLoadBalancing")] + public IDictionary AppSettingsOverrides { get; } + /// <code>true</code> to configure load balancing for source and destination app. public bool? ConfigureLoadBalancing { get; set; } - /// - /// Gets or sets ARM resource ID of the Traffic Manager profile to use, - /// if it exists. Traffic Manager resource ID is of the form + /// ARM resource ID of the Traffic Manager profile to use, if it exists. Traffic Manager resource ID is of the form /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. /// - [JsonProperty(PropertyName = "trafficManagerProfileId")] public string TrafficManagerProfileId { get; set; } - - /// - /// Gets or sets name of Traffic Manager profile to create. This is - /// only needed if Traffic Manager profile does not already exist. - /// - [JsonProperty(PropertyName = "trafficManagerProfileName")] + /// Name of Traffic Manager profile to create. This is only needed if Traffic Manager profile does not already exist. public string TrafficManagerProfileName { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (SourceWebAppId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SourceWebAppId"); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.Serialization.cs new file mode 100644 index 000000000000..8ca1e771e43c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } + + internal static Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties DeserializeComponents1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(JsonElement element) + { + Optional principalId = default; + Optional clientId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("principalId")) + { + principalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientId")) + { + clientId = property.Value.GetString(); + continue; + } + } + return new Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(principalId.Value, clientId.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs new file mode 100644 index 000000000000..e65733473777 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + public partial class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties + { + /// Initializes a new instance of Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + public Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties() + { + } + + /// Initializes a new instance of Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. + /// Principal Id of user assigned identity. + /// Client Id of user assigned identity. + internal Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(string principalId, string clientId) + { + PrincipalId = principalId; + ClientId = clientId; + } + + /// Principal Id of user assigned identity. + public string PrincipalId { get; } + /// Client Id of user assigned identity. + public string ClientId { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.Serialization.cs new file mode 100644 index 000000000000..93844470290a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class ComputeModeOptionsExtensions + { + public static string ToSerialString(this ComputeModeOptions value) => value switch + { + ComputeModeOptions.Shared => "Shared", + ComputeModeOptions.Dedicated => "Dedicated", + ComputeModeOptions.Dynamic => "Dynamic", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeModeOptions value.") + }; + + public static ComputeModeOptions ToComputeModeOptions(this string value) + { + if (string.Equals(value, "Shared", StringComparison.InvariantCultureIgnoreCase)) return ComputeModeOptions.Shared; + if (string.Equals(value, "Dedicated", StringComparison.InvariantCultureIgnoreCase)) return ComputeModeOptions.Dedicated; + if (string.Equals(value, "Dynamic", StringComparison.InvariantCultureIgnoreCase)) return ComputeModeOptions.Dynamic; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeModeOptions value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.cs index d294d5065e68..0f7865e7ba68 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ComputeModeOptions. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Shared/dedicated workers. public enum ComputeModeOptions { - [EnumMember(Value = "Shared")] + /// Shared. Shared, - [EnumMember(Value = "Dedicated")] + /// Dedicated. Dedicated, - [EnumMember(Value = "Dynamic")] + /// Dynamic. Dynamic } - internal static class ComputeModeOptionsEnumExtension - { - internal static string ToSerializedValue(this ComputeModeOptions? value) - { - return value == null ? null : ((ComputeModeOptions)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ComputeModeOptions value) - { - switch( value ) - { - case ComputeModeOptions.Shared: - return "Shared"; - case ComputeModeOptions.Dedicated: - return "Dedicated"; - case ComputeModeOptions.Dynamic: - return "Dynamic"; - } - return null; - } - - internal static ComputeModeOptions? ParseComputeModeOptions(this string value) - { - switch( value ) - { - case "Shared": - return ComputeModeOptions.Shared; - case "Dedicated": - return ComputeModeOptions.Dedicated; - case "Dynamic": - return ComputeModeOptions.Dynamic; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.Serialization.cs new file mode 100644 index 000000000000..bea643e51951 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.Serialization.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ConnStringInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(ConnectionString)) + { + writer.WritePropertyName("connectionString"); + writer.WriteStringValue(ConnectionString); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + internal static ConnStringInfo DeserializeConnStringInfo(JsonElement element) + { + Optional name = default; + Optional connectionString = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("connectionString")) + { + connectionString = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + type = property.Value.GetString().ToConnectionStringType(); + continue; + } + } + return new ConnStringInfo(name.Value, connectionString.Value, Optional.ToNullable(type)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.cs index aaf7a07978ca..f0923dfef98d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.cs @@ -1,72 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Database connection string information. - /// + /// Database connection string information. public partial class ConnStringInfo { - /// - /// Initializes a new instance of the ConnStringInfo class. - /// + /// Initializes a new instance of ConnStringInfo. public ConnStringInfo() { - CustomInit(); } - /// - /// Initializes a new instance of the ConnStringInfo class. - /// - /// Name of connection string. - /// Connection string value. - /// Type of database. Possible values include: - /// 'MySql', 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', - /// 'ServiceBus', 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', - /// 'PostgreSQL' - public ConnStringInfo(string name = default(string), string connectionString = default(string), ConnectionStringType? type = default(ConnectionStringType?)) + /// Initializes a new instance of ConnStringInfo. + /// Name of connection string. + /// Connection string value. + /// Type of database. + internal ConnStringInfo(string name, string connectionString, ConnectionStringType? type) { Name = name; ConnectionString = connectionString; Type = type; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of connection string. - /// - [JsonProperty(PropertyName = "name")] + /// Name of connection string. public string Name { get; set; } - - /// - /// Gets or sets connection string value. - /// - [JsonProperty(PropertyName = "connectionString")] + /// Connection string value. public string ConnectionString { get; set; } - - /// - /// Gets or sets type of database. Possible values include: 'MySql', - /// 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', 'ServiceBus', - /// 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' - /// - [JsonProperty(PropertyName = "type")] + /// Type of database. public ConnectionStringType? Type { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.Serialization.cs new file mode 100644 index 000000000000..50c2cb5d9265 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ConnStringValueTypePair : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("value"); + writer.WriteStringValue(Value); + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.ToSerialString()); + writer.WriteEndObject(); + } + + internal static ConnStringValueTypePair DeserializeConnStringValueTypePair(JsonElement element) + { + string value = default; + ConnectionStringType type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString().ToConnectionStringType(); + continue; + } + } + return new ConnStringValueTypePair(value, type); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.cs index 7ea4321cc8c3..941ad080f959 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.cs @@ -1,78 +1,35 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Database connection string value to type pair. - /// + /// Database connection string value to type pair. public partial class ConnStringValueTypePair { - /// - /// Initializes a new instance of the ConnStringValueTypePair class. - /// - public ConnStringValueTypePair() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ConnStringValueTypePair class. - /// - /// Value of pair. - /// Type of database. Possible values include: - /// 'MySql', 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', - /// 'ServiceBus', 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', - /// 'PostgreSQL' + /// Initializes a new instance of ConnStringValueTypePair. + /// Value of pair. + /// Type of database. + /// is null. public ConnStringValueTypePair(string value, ConnectionStringType type) { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + Value = value; Type = type; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets value of pair. - /// - [JsonProperty(PropertyName = "value")] + /// Value of pair. public string Value { get; set; } - - /// - /// Gets or sets type of database. Possible values include: 'MySql', - /// 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', 'ServiceBus', - /// 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' - /// - [JsonProperty(PropertyName = "type")] + /// Type of database. public ConnectionStringType Type { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Value == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.Serialization.cs new file mode 100644 index 000000000000..f8e0ec37d4ff --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.Serialization.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ConnectionStringDictionary : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + foreach (var item in Properties) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WriteEndObject(); + } + + internal static ConnectionStringDictionary DeserializeConnectionStringDictionary(JsonElement element) + { + Optional> properties = default; + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, ConnStringValueTypePair.DeserializeConnStringValueTypePair(property0.Value)); + } + properties = dictionary; + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + } + return new ConnectionStringDictionary(id.Value, name.Value, kind.Value, type.Value, Optional.ToDictionary(properties)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.cs index 2211f6ff3636..25dcbd5a3a72 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.cs @@ -1,58 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// String dictionary resource. - /// + /// String dictionary resource. public partial class ConnectionStringDictionary : ProxyOnlyResource { - /// - /// Initializes a new instance of the ConnectionStringDictionary class. - /// + /// Initializes a new instance of ConnectionStringDictionary. public ConnectionStringDictionary() { - CustomInit(); + Properties = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the ConnectionStringDictionary class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Connection strings. - public ConnectionStringDictionary(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary properties = default(IDictionary)) - : base(id, name, kind, type) + /// Initializes a new instance of ConnectionStringDictionary. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Connection strings. + internal ConnectionStringDictionary(string id, string name, string kind, string type, IDictionary properties) : base(id, name, kind, type) { Properties = properties; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets connection strings. - /// - [JsonProperty(PropertyName = "properties")] - public IDictionary Properties { get; set; } - + /// Connection strings. + public IDictionary Properties { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.Serialization.cs new file mode 100644 index 000000000000..3c8cd294c35b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class ConnectionStringTypeExtensions + { + public static string ToSerialString(this ConnectionStringType value) => value switch + { + ConnectionStringType.MySql => "MySql", + ConnectionStringType.SQLServer => "SQLServer", + ConnectionStringType.SQLAzure => "SQLAzure", + ConnectionStringType.Custom => "Custom", + ConnectionStringType.NotificationHub => "NotificationHub", + ConnectionStringType.ServiceBus => "ServiceBus", + ConnectionStringType.EventHub => "EventHub", + ConnectionStringType.ApiHub => "ApiHub", + ConnectionStringType.DocDb => "DocDb", + ConnectionStringType.RedisCache => "RedisCache", + ConnectionStringType.PostgreSQL => "PostgreSQL", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ConnectionStringType value.") + }; + + public static ConnectionStringType ToConnectionStringType(this string value) + { + if (string.Equals(value, "MySql", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.MySql; + if (string.Equals(value, "SQLServer", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.SQLServer; + if (string.Equals(value, "SQLAzure", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.SQLAzure; + if (string.Equals(value, "Custom", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.Custom; + if (string.Equals(value, "NotificationHub", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.NotificationHub; + if (string.Equals(value, "ServiceBus", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.ServiceBus; + if (string.Equals(value, "EventHub", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.EventHub; + if (string.Equals(value, "ApiHub", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.ApiHub; + if (string.Equals(value, "DocDb", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.DocDb; + if (string.Equals(value, "RedisCache", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.RedisCache; + if (string.Equals(value, "PostgreSQL", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.PostgreSQL; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ConnectionStringType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.cs index 5e79b9550271..be2da8c04a42 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.cs @@ -1,114 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ConnectionStringType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Type of database. public enum ConnectionStringType { - [EnumMember(Value = "MySql")] + /// MySql. MySql, - [EnumMember(Value = "SQLServer")] + /// SQLServer. SQLServer, - [EnumMember(Value = "SQLAzure")] + /// SQLAzure. SQLAzure, - [EnumMember(Value = "Custom")] + /// Custom. Custom, - [EnumMember(Value = "NotificationHub")] + /// NotificationHub. NotificationHub, - [EnumMember(Value = "ServiceBus")] + /// ServiceBus. ServiceBus, - [EnumMember(Value = "EventHub")] + /// EventHub. EventHub, - [EnumMember(Value = "ApiHub")] + /// ApiHub. ApiHub, - [EnumMember(Value = "DocDb")] + /// DocDb. DocDb, - [EnumMember(Value = "RedisCache")] + /// RedisCache. RedisCache, - [EnumMember(Value = "PostgreSQL")] + /// PostgreSQL. PostgreSQL } - internal static class ConnectionStringTypeEnumExtension - { - internal static string ToSerializedValue(this ConnectionStringType? value) - { - return value == null ? null : ((ConnectionStringType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ConnectionStringType value) - { - switch( value ) - { - case ConnectionStringType.MySql: - return "MySql"; - case ConnectionStringType.SQLServer: - return "SQLServer"; - case ConnectionStringType.SQLAzure: - return "SQLAzure"; - case ConnectionStringType.Custom: - return "Custom"; - case ConnectionStringType.NotificationHub: - return "NotificationHub"; - case ConnectionStringType.ServiceBus: - return "ServiceBus"; - case ConnectionStringType.EventHub: - return "EventHub"; - case ConnectionStringType.ApiHub: - return "ApiHub"; - case ConnectionStringType.DocDb: - return "DocDb"; - case ConnectionStringType.RedisCache: - return "RedisCache"; - case ConnectionStringType.PostgreSQL: - return "PostgreSQL"; - } - return null; - } - - internal static ConnectionStringType? ParseConnectionStringType(this string value) - { - switch( value ) - { - case "MySql": - return ConnectionStringType.MySql; - case "SQLServer": - return ConnectionStringType.SQLServer; - case "SQLAzure": - return ConnectionStringType.SQLAzure; - case "Custom": - return ConnectionStringType.Custom; - case "NotificationHub": - return ConnectionStringType.NotificationHub; - case "ServiceBus": - return ConnectionStringType.ServiceBus; - case "EventHub": - return ConnectionStringType.EventHub; - case "ApiHub": - return ConnectionStringType.ApiHub; - case "DocDb": - return ConnectionStringType.DocDb; - case "RedisCache": - return ConnectionStringType.RedisCache; - case "PostgreSQL": - return ConnectionStringType.PostgreSQL; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.Serialization.cs new file mode 100644 index 000000000000..182ccb75898e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Contact : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(AddressMailing)) + { + writer.WritePropertyName("addressMailing"); + writer.WriteObjectValue(AddressMailing); + } + writer.WritePropertyName("email"); + writer.WriteStringValue(Email); + if (Optional.IsDefined(Fax)) + { + writer.WritePropertyName("fax"); + writer.WriteStringValue(Fax); + } + if (Optional.IsDefined(JobTitle)) + { + writer.WritePropertyName("jobTitle"); + writer.WriteStringValue(JobTitle); + } + writer.WritePropertyName("nameFirst"); + writer.WriteStringValue(NameFirst); + writer.WritePropertyName("nameLast"); + writer.WriteStringValue(NameLast); + if (Optional.IsDefined(NameMiddle)) + { + writer.WritePropertyName("nameMiddle"); + writer.WriteStringValue(NameMiddle); + } + if (Optional.IsDefined(Organization)) + { + writer.WritePropertyName("organization"); + writer.WriteStringValue(Organization); + } + writer.WritePropertyName("phone"); + writer.WriteStringValue(Phone); + writer.WriteEndObject(); + } + + internal static Contact DeserializeContact(JsonElement element) + { + Optional
addressMailing = default; + string email = default; + Optional fax = default; + Optional jobTitle = default; + string nameFirst = default; + string nameLast = default; + Optional nameMiddle = default; + Optional organization = default; + string phone = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("addressMailing")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + addressMailing = Address.DeserializeAddress(property.Value); + continue; + } + if (property.NameEquals("email")) + { + email = property.Value.GetString(); + continue; + } + if (property.NameEquals("fax")) + { + fax = property.Value.GetString(); + continue; + } + if (property.NameEquals("jobTitle")) + { + jobTitle = property.Value.GetString(); + continue; + } + if (property.NameEquals("nameFirst")) + { + nameFirst = property.Value.GetString(); + continue; + } + if (property.NameEquals("nameLast")) + { + nameLast = property.Value.GetString(); + continue; + } + if (property.NameEquals("nameMiddle")) + { + nameMiddle = property.Value.GetString(); + continue; + } + if (property.NameEquals("organization")) + { + organization = property.Value.GetString(); + continue; + } + if (property.NameEquals("phone")) + { + phone = property.Value.GetString(); + continue; + } + } + return new Contact(addressMailing.Value, email, fax.Value, jobTitle.Value, nameFirst, nameLast, nameMiddle.Value, organization.Value, phone); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.cs index 89b6c43702b3..224d9cb2bb2c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.cs @@ -1,48 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - /// - /// Contact information for domain registration. If 'Domain Privacy' option - /// is not selected then the contact information is made publicly available - /// through the Whois + /// Contact information for domain registration. If 'Domain Privacy' option is not selected then the contact information is made publicly available through the Whois /// directories as per ICANN requirements. /// public partial class Contact { - /// - /// Initializes a new instance of the Contact class. - /// - public Contact() + /// Initializes a new instance of Contact. + /// Email address. + /// First name. + /// Last name. + /// Phone number. + /// , , , or is null. + public Contact(string email, string nameFirst, string nameLast, string phone) { - CustomInit(); + if (email == null) + { + throw new ArgumentNullException(nameof(email)); + } + if (nameFirst == null) + { + throw new ArgumentNullException(nameof(nameFirst)); + } + if (nameLast == null) + { + throw new ArgumentNullException(nameof(nameLast)); + } + if (phone == null) + { + throw new ArgumentNullException(nameof(phone)); + } + + Email = email; + NameFirst = nameFirst; + NameLast = nameLast; + Phone = phone; } - /// - /// Initializes a new instance of the Contact class. - /// - /// Email address. - /// First name. - /// Last name. - /// Phone number. - /// Mailing address. - /// Fax number. - /// Job title. - /// Middle name. - /// Organization contact belongs to. - public Contact(string email, string nameFirst, string nameLast, string phone, Address addressMailing = default(Address), string fax = default(string), string jobTitle = default(string), string nameMiddle = default(string), string organization = default(string)) + /// Initializes a new instance of Contact. + /// Mailing address. + /// Email address. + /// Fax number. + /// Job title. + /// First name. + /// Last name. + /// Middle name. + /// Organization contact belongs to. + /// Phone number. + internal Contact(Address addressMailing, string email, string fax, string jobTitle, string nameFirst, string nameLast, string nameMiddle, string organization, string phone) { AddressMailing = addressMailing; Email = email; @@ -53,96 +67,25 @@ public Contact() NameMiddle = nameMiddle; Organization = organization; Phone = phone; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets mailing address. - /// - [JsonProperty(PropertyName = "addressMailing")] + /// Mailing address. public Address AddressMailing { get; set; } - - /// - /// Gets or sets email address. - /// - [JsonProperty(PropertyName = "email")] + /// Email address. public string Email { get; set; } - - /// - /// Gets or sets fax number. - /// - [JsonProperty(PropertyName = "fax")] + /// Fax number. public string Fax { get; set; } - - /// - /// Gets or sets job title. - /// - [JsonProperty(PropertyName = "jobTitle")] + /// Job title. public string JobTitle { get; set; } - - /// - /// Gets or sets first name. - /// - [JsonProperty(PropertyName = "nameFirst")] + /// First name. public string NameFirst { get; set; } - - /// - /// Gets or sets last name. - /// - [JsonProperty(PropertyName = "nameLast")] + /// Last name. public string NameLast { get; set; } - - /// - /// Gets or sets middle name. - /// - [JsonProperty(PropertyName = "nameMiddle")] + /// Middle name. public string NameMiddle { get; set; } - - /// - /// Gets or sets organization contact belongs to. - /// - [JsonProperty(PropertyName = "organization")] + /// Organization contact belongs to. public string Organization { get; set; } - - /// - /// Gets or sets phone number. - /// - [JsonProperty(PropertyName = "phone")] + /// Phone number. public string Phone { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Email == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Email"); - } - if (NameFirst == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "NameFirst"); - } - if (NameLast == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "NameLast"); - } - if (Phone == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Phone"); - } - if (AddressMailing != null) - { - AddressMailing.Validate(); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.Serialization.cs new file mode 100644 index 000000000000..741db1579d32 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.Serialization.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ContainerCpuStatistics : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(CpuUsage)) + { + writer.WritePropertyName("cpuUsage"); + writer.WriteObjectValue(CpuUsage); + } + if (Optional.IsDefined(SystemCpuUsage)) + { + writer.WritePropertyName("systemCpuUsage"); + writer.WriteNumberValue(SystemCpuUsage.Value); + } + if (Optional.IsDefined(OnlineCpuCount)) + { + writer.WritePropertyName("onlineCpuCount"); + writer.WriteNumberValue(OnlineCpuCount.Value); + } + if (Optional.IsDefined(ThrottlingData)) + { + writer.WritePropertyName("throttlingData"); + writer.WriteObjectValue(ThrottlingData); + } + writer.WriteEndObject(); + } + + internal static ContainerCpuStatistics DeserializeContainerCpuStatistics(JsonElement element) + { + Optional cpuUsage = default; + Optional systemCpuUsage = default; + Optional onlineCpuCount = default; + Optional throttlingData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("cpuUsage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + cpuUsage = ContainerCpuUsage.DeserializeContainerCpuUsage(property.Value); + continue; + } + if (property.NameEquals("systemCpuUsage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemCpuUsage = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("onlineCpuCount")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + onlineCpuCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("throttlingData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + throttlingData = ContainerThrottlingData.DeserializeContainerThrottlingData(property.Value); + continue; + } + } + return new ContainerCpuStatistics(cpuUsage.Value, Optional.ToNullable(systemCpuUsage), Optional.ToNullable(onlineCpuCount), throttlingData.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.cs index fef297e782d1..626c10e2d7f2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.cs @@ -1,64 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - + /// The ContainerCpuStatistics. public partial class ContainerCpuStatistics { - /// - /// Initializes a new instance of the ContainerCpuStatistics class. - /// + /// Initializes a new instance of ContainerCpuStatistics. public ContainerCpuStatistics() { - CustomInit(); } - /// - /// Initializes a new instance of the ContainerCpuStatistics class. - /// - public ContainerCpuStatistics(ContainerCpuUsage cpuUsage = default(ContainerCpuUsage), long? systemCpuUsage = default(long?), int? onlineCpuCount = default(int?), ContainerThrottlingData throttlingData = default(ContainerThrottlingData)) + /// Initializes a new instance of ContainerCpuStatistics. + /// . + /// . + /// . + /// . + internal ContainerCpuStatistics(ContainerCpuUsage cpuUsage, long? systemCpuUsage, int? onlineCpuCount, ContainerThrottlingData throttlingData) { CpuUsage = cpuUsage; SystemCpuUsage = systemCpuUsage; OnlineCpuCount = onlineCpuCount; ThrottlingData = throttlingData; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "cpuUsage")] public ContainerCpuUsage CpuUsage { get; set; } - - /// - /// - [JsonProperty(PropertyName = "systemCpuUsage")] public long? SystemCpuUsage { get; set; } - - /// - /// - [JsonProperty(PropertyName = "onlineCpuCount")] public int? OnlineCpuCount { get; set; } - - /// - /// - [JsonProperty(PropertyName = "throttlingData")] public ContainerThrottlingData ThrottlingData { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.Serialization.cs new file mode 100644 index 000000000000..e9915c007aa3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.Serialization.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ContainerCpuUsage : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(TotalUsage)) + { + writer.WritePropertyName("totalUsage"); + writer.WriteNumberValue(TotalUsage.Value); + } + if (Optional.IsCollectionDefined(PerCpuUsage)) + { + writer.WritePropertyName("perCpuUsage"); + writer.WriteStartArray(); + foreach (var item in PerCpuUsage) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(KernelModeUsage)) + { + writer.WritePropertyName("kernelModeUsage"); + writer.WriteNumberValue(KernelModeUsage.Value); + } + if (Optional.IsDefined(UserModeUsage)) + { + writer.WritePropertyName("userModeUsage"); + writer.WriteNumberValue(UserModeUsage.Value); + } + writer.WriteEndObject(); + } + + internal static ContainerCpuUsage DeserializeContainerCpuUsage(JsonElement element) + { + Optional totalUsage = default; + Optional> perCpuUsage = default; + Optional kernelModeUsage = default; + Optional userModeUsage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("totalUsage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + totalUsage = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("perCpuUsage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt64()); + } + perCpuUsage = array; + continue; + } + if (property.NameEquals("kernelModeUsage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + kernelModeUsage = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("userModeUsage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + userModeUsage = property.Value.GetInt64(); + continue; + } + } + return new ContainerCpuUsage(Optional.ToNullable(totalUsage), Optional.ToList(perCpuUsage), Optional.ToNullable(kernelModeUsage), Optional.ToNullable(userModeUsage)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.cs index b0d93c37d24d..b24823e31234 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.cs @@ -1,66 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - + /// The ContainerCpuUsage. public partial class ContainerCpuUsage { - /// - /// Initializes a new instance of the ContainerCpuUsage class. - /// + /// Initializes a new instance of ContainerCpuUsage. public ContainerCpuUsage() { - CustomInit(); + PerCpuUsage = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the ContainerCpuUsage class. - /// - public ContainerCpuUsage(long? totalUsage = default(long?), IList perCpuUsage = default(IList), long? kernelModeUsage = default(long?), long? userModeUsage = default(long?)) + /// Initializes a new instance of ContainerCpuUsage. + /// . + /// . + /// . + /// . + internal ContainerCpuUsage(long? totalUsage, IList perCpuUsage, long? kernelModeUsage, long? userModeUsage) { TotalUsage = totalUsage; PerCpuUsage = perCpuUsage; KernelModeUsage = kernelModeUsage; UserModeUsage = userModeUsage; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "totalUsage")] public long? TotalUsage { get; set; } - - /// - /// - [JsonProperty(PropertyName = "perCpuUsage")] - public IList PerCpuUsage { get; set; } - - /// - /// - [JsonProperty(PropertyName = "kernelModeUsage")] + public IList PerCpuUsage { get; } public long? KernelModeUsage { get; set; } - - /// - /// - [JsonProperty(PropertyName = "userModeUsage")] public long? UserModeUsage { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.Serialization.cs new file mode 100644 index 000000000000..cd9bd6469100 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ContainerInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(CurrentTimeStamp)) + { + writer.WritePropertyName("currentTimeStamp"); + writer.WriteStringValue(CurrentTimeStamp.Value, "O"); + } + if (Optional.IsDefined(PreviousTimeStamp)) + { + writer.WritePropertyName("previousTimeStamp"); + writer.WriteStringValue(PreviousTimeStamp.Value, "O"); + } + if (Optional.IsDefined(CurrentCpuStats)) + { + writer.WritePropertyName("currentCpuStats"); + writer.WriteObjectValue(CurrentCpuStats); + } + if (Optional.IsDefined(PreviousCpuStats)) + { + writer.WritePropertyName("previousCpuStats"); + writer.WriteObjectValue(PreviousCpuStats); + } + if (Optional.IsDefined(MemoryStats)) + { + writer.WritePropertyName("memoryStats"); + writer.WriteObjectValue(MemoryStats); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Eth0)) + { + writer.WritePropertyName("eth0"); + writer.WriteObjectValue(Eth0); + } + writer.WriteEndObject(); + } + + internal static ContainerInfo DeserializeContainerInfo(JsonElement element) + { + Optional currentTimeStamp = default; + Optional previousTimeStamp = default; + Optional currentCpuStats = default; + Optional previousCpuStats = default; + Optional memoryStats = default; + Optional name = default; + Optional id = default; + Optional eth0 = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("currentTimeStamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + currentTimeStamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("previousTimeStamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + previousTimeStamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("currentCpuStats")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + currentCpuStats = ContainerCpuStatistics.DeserializeContainerCpuStatistics(property.Value); + continue; + } + if (property.NameEquals("previousCpuStats")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + previousCpuStats = ContainerCpuStatistics.DeserializeContainerCpuStatistics(property.Value); + continue; + } + if (property.NameEquals("memoryStats")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + memoryStats = ContainerMemoryStatistics.DeserializeContainerMemoryStatistics(property.Value); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("eth0")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + eth0 = ContainerNetworkInterfaceStatistics.DeserializeContainerNetworkInterfaceStatistics(property.Value); + continue; + } + } + return new ContainerInfo(Optional.ToNullable(currentTimeStamp), Optional.ToNullable(previousTimeStamp), currentCpuStats.Value, previousCpuStats.Value, memoryStats.Value, name.Value, id.Value, eth0.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.cs index 0eecbf3b3654..c1544f41337a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.cs @@ -1,32 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - + /// The ContainerInfo. public partial class ContainerInfo { - /// - /// Initializes a new instance of the ContainerInfo class. - /// + /// Initializes a new instance of ContainerInfo. public ContainerInfo() { - CustomInit(); } - /// - /// Initializes a new instance of the ContainerInfo class. - /// - public ContainerInfo(System.DateTime? currentTimeStamp = default(System.DateTime?), System.DateTime? previousTimeStamp = default(System.DateTime?), ContainerCpuStatistics currentCpuStats = default(ContainerCpuStatistics), ContainerCpuStatistics previousCpuStats = default(ContainerCpuStatistics), ContainerMemoryStatistics memoryStats = default(ContainerMemoryStatistics), string name = default(string), string id = default(string), ContainerNetworkInterfaceStatistics eth0 = default(ContainerNetworkInterfaceStatistics)) + /// Initializes a new instance of ContainerInfo. + /// . + /// . + /// . + /// . + /// . + /// . + /// . + /// . + internal ContainerInfo(DateTimeOffset? currentTimeStamp, DateTimeOffset? previousTimeStamp, ContainerCpuStatistics currentCpuStats, ContainerCpuStatistics previousCpuStats, ContainerMemoryStatistics memoryStats, string name, string id, ContainerNetworkInterfaceStatistics eth0) { CurrentTimeStamp = currentTimeStamp; PreviousTimeStamp = previousTimeStamp; @@ -36,53 +36,15 @@ public ContainerInfo() Name = name; Id = id; Eth0 = eth0; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "currentTimeStamp")] - public System.DateTime? CurrentTimeStamp { get; set; } - - /// - /// - [JsonProperty(PropertyName = "previousTimeStamp")] - public System.DateTime? PreviousTimeStamp { get; set; } - - /// - /// - [JsonProperty(PropertyName = "currentCpuStats")] + public DateTimeOffset? CurrentTimeStamp { get; set; } + public DateTimeOffset? PreviousTimeStamp { get; set; } public ContainerCpuStatistics CurrentCpuStats { get; set; } - - /// - /// - [JsonProperty(PropertyName = "previousCpuStats")] public ContainerCpuStatistics PreviousCpuStats { get; set; } - - /// - /// - [JsonProperty(PropertyName = "memoryStats")] public ContainerMemoryStatistics MemoryStats { get; set; } - - /// - /// - [JsonProperty(PropertyName = "name")] public string Name { get; set; } - - /// - /// - [JsonProperty(PropertyName = "id")] public string Id { get; set; } - - /// - /// - [JsonProperty(PropertyName = "eth0")] public ContainerNetworkInterfaceStatistics Eth0 { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.Serialization.cs new file mode 100644 index 000000000000..41d2d05229d0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.Serialization.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ContainerMemoryStatistics : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Usage)) + { + writer.WritePropertyName("usage"); + writer.WriteNumberValue(Usage.Value); + } + if (Optional.IsDefined(MaxUsage)) + { + writer.WritePropertyName("maxUsage"); + writer.WriteNumberValue(MaxUsage.Value); + } + if (Optional.IsDefined(Limit)) + { + writer.WritePropertyName("limit"); + writer.WriteNumberValue(Limit.Value); + } + writer.WriteEndObject(); + } + + internal static ContainerMemoryStatistics DeserializeContainerMemoryStatistics(JsonElement element) + { + Optional usage = default; + Optional maxUsage = default; + Optional limit = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("usage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + usage = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("maxUsage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + maxUsage = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("limit")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + limit = property.Value.GetInt64(); + continue; + } + } + return new ContainerMemoryStatistics(Optional.ToNullable(usage), Optional.ToNullable(maxUsage), Optional.ToNullable(limit)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.cs index ac4bc9cbfc83..b0cadd3c0aa8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.cs @@ -1,58 +1,33 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - + /// The ContainerMemoryStatistics. public partial class ContainerMemoryStatistics { - /// - /// Initializes a new instance of the ContainerMemoryStatistics class. - /// + /// Initializes a new instance of ContainerMemoryStatistics. public ContainerMemoryStatistics() { - CustomInit(); } - /// - /// Initializes a new instance of the ContainerMemoryStatistics class. - /// - public ContainerMemoryStatistics(long? usage = default(long?), long? maxUsage = default(long?), long? limit = default(long?)) + /// Initializes a new instance of ContainerMemoryStatistics. + /// . + /// . + /// . + internal ContainerMemoryStatistics(long? usage, long? maxUsage, long? limit) { Usage = usage; MaxUsage = maxUsage; Limit = limit; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "usage")] public long? Usage { get; set; } - - /// - /// - [JsonProperty(PropertyName = "maxUsage")] public long? MaxUsage { get; set; } - - /// - /// - [JsonProperty(PropertyName = "limit")] public long? Limit { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.Serialization.cs new file mode 100644 index 000000000000..66ea662d7f99 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ContainerNetworkInterfaceStatistics : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(RxBytes)) + { + writer.WritePropertyName("rxBytes"); + writer.WriteNumberValue(RxBytes.Value); + } + if (Optional.IsDefined(RxPackets)) + { + writer.WritePropertyName("rxPackets"); + writer.WriteNumberValue(RxPackets.Value); + } + if (Optional.IsDefined(RxErrors)) + { + writer.WritePropertyName("rxErrors"); + writer.WriteNumberValue(RxErrors.Value); + } + if (Optional.IsDefined(RxDropped)) + { + writer.WritePropertyName("rxDropped"); + writer.WriteNumberValue(RxDropped.Value); + } + if (Optional.IsDefined(TxBytes)) + { + writer.WritePropertyName("txBytes"); + writer.WriteNumberValue(TxBytes.Value); + } + if (Optional.IsDefined(TxPackets)) + { + writer.WritePropertyName("txPackets"); + writer.WriteNumberValue(TxPackets.Value); + } + if (Optional.IsDefined(TxErrors)) + { + writer.WritePropertyName("txErrors"); + writer.WriteNumberValue(TxErrors.Value); + } + if (Optional.IsDefined(TxDropped)) + { + writer.WritePropertyName("txDropped"); + writer.WriteNumberValue(TxDropped.Value); + } + writer.WriteEndObject(); + } + + internal static ContainerNetworkInterfaceStatistics DeserializeContainerNetworkInterfaceStatistics(JsonElement element) + { + Optional rxBytes = default; + Optional rxPackets = default; + Optional rxErrors = default; + Optional rxDropped = default; + Optional txBytes = default; + Optional txPackets = default; + Optional txErrors = default; + Optional txDropped = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rxBytes")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + rxBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("rxPackets")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + rxPackets = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("rxErrors")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + rxErrors = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("rxDropped")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + rxDropped = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("txBytes")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + txBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("txPackets")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + txPackets = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("txErrors")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + txErrors = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("txDropped")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + txDropped = property.Value.GetInt64(); + continue; + } + } + return new ContainerNetworkInterfaceStatistics(Optional.ToNullable(rxBytes), Optional.ToNullable(rxPackets), Optional.ToNullable(rxErrors), Optional.ToNullable(rxDropped), Optional.ToNullable(txBytes), Optional.ToNullable(txPackets), Optional.ToNullable(txErrors), Optional.ToNullable(txDropped)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.cs index f2a7bdfdb180..204d400ee756 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.cs @@ -1,34 +1,30 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - + /// The ContainerNetworkInterfaceStatistics. public partial class ContainerNetworkInterfaceStatistics { - /// - /// Initializes a new instance of the - /// ContainerNetworkInterfaceStatistics class. - /// + /// Initializes a new instance of ContainerNetworkInterfaceStatistics. public ContainerNetworkInterfaceStatistics() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// ContainerNetworkInterfaceStatistics class. - /// - public ContainerNetworkInterfaceStatistics(long? rxBytes = default(long?), long? rxPackets = default(long?), long? rxErrors = default(long?), long? rxDropped = default(long?), long? txBytes = default(long?), long? txPackets = default(long?), long? txErrors = default(long?), long? txDropped = default(long?)) + /// Initializes a new instance of ContainerNetworkInterfaceStatistics. + /// . + /// . + /// . + /// . + /// . + /// . + /// . + /// . + internal ContainerNetworkInterfaceStatistics(long? rxBytes, long? rxPackets, long? rxErrors, long? rxDropped, long? txBytes, long? txPackets, long? txErrors, long? txDropped) { RxBytes = rxBytes; RxPackets = rxPackets; @@ -38,53 +34,15 @@ public ContainerNetworkInterfaceStatistics() TxPackets = txPackets; TxErrors = txErrors; TxDropped = txDropped; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "rxBytes")] public long? RxBytes { get; set; } - - /// - /// - [JsonProperty(PropertyName = "rxPackets")] public long? RxPackets { get; set; } - - /// - /// - [JsonProperty(PropertyName = "rxErrors")] public long? RxErrors { get; set; } - - /// - /// - [JsonProperty(PropertyName = "rxDropped")] public long? RxDropped { get; set; } - - /// - /// - [JsonProperty(PropertyName = "txBytes")] public long? TxBytes { get; set; } - - /// - /// - [JsonProperty(PropertyName = "txPackets")] public long? TxPackets { get; set; } - - /// - /// - [JsonProperty(PropertyName = "txErrors")] public long? TxErrors { get; set; } - - /// - /// - [JsonProperty(PropertyName = "txDropped")] public long? TxDropped { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.Serialization.cs new file mode 100644 index 000000000000..3bb6653883d6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.Serialization.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ContainerThrottlingData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Periods)) + { + writer.WritePropertyName("periods"); + writer.WriteNumberValue(Periods.Value); + } + if (Optional.IsDefined(ThrottledPeriods)) + { + writer.WritePropertyName("throttledPeriods"); + writer.WriteNumberValue(ThrottledPeriods.Value); + } + if (Optional.IsDefined(ThrottledTime)) + { + writer.WritePropertyName("throttledTime"); + writer.WriteNumberValue(ThrottledTime.Value); + } + writer.WriteEndObject(); + } + + internal static ContainerThrottlingData DeserializeContainerThrottlingData(JsonElement element) + { + Optional periods = default; + Optional throttledPeriods = default; + Optional throttledTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("periods")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + periods = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("throttledPeriods")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + throttledPeriods = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("throttledTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + throttledTime = property.Value.GetInt32(); + continue; + } + } + return new ContainerThrottlingData(Optional.ToNullable(periods), Optional.ToNullable(throttledPeriods), Optional.ToNullable(throttledTime)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.cs index 286d2ae0c717..ab89cb3e931f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.cs @@ -1,58 +1,33 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - + /// The ContainerThrottlingData. public partial class ContainerThrottlingData { - /// - /// Initializes a new instance of the ContainerThrottlingData class. - /// + /// Initializes a new instance of ContainerThrottlingData. public ContainerThrottlingData() { - CustomInit(); } - /// - /// Initializes a new instance of the ContainerThrottlingData class. - /// - public ContainerThrottlingData(int? periods = default(int?), int? throttledPeriods = default(int?), int? throttledTime = default(int?)) + /// Initializes a new instance of ContainerThrottlingData. + /// . + /// . + /// . + internal ContainerThrottlingData(int? periods, int? throttledPeriods, int? throttledTime) { Periods = periods; ThrottledPeriods = throttledPeriods; ThrottledTime = throttledTime; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "periods")] public int? Periods { get; set; } - - /// - /// - [JsonProperty(PropertyName = "throttledPeriods")] public int? ThrottledPeriods { get; set; } - - /// - /// - [JsonProperty(PropertyName = "throttledTime")] public int? ThrottledTime { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.Serialization.cs new file mode 100644 index 000000000000..8f24a756046f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ContinuousWebJob : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"); + writer.WriteStringValue(Status.Value.ToSerialString()); + } + if (Optional.IsDefined(DetailedStatus)) + { + writer.WritePropertyName("detailed_status"); + writer.WriteStringValue(DetailedStatus); + } + if (Optional.IsDefined(LogUrl)) + { + writer.WritePropertyName("log_url"); + writer.WriteStringValue(LogUrl); + } + if (Optional.IsDefined(RunCommand)) + { + writer.WritePropertyName("run_command"); + writer.WriteStringValue(RunCommand); + } + if (Optional.IsDefined(Url)) + { + writer.WritePropertyName("url"); + writer.WriteStringValue(Url); + } + if (Optional.IsDefined(ExtraInfoUrl)) + { + writer.WritePropertyName("extra_info_url"); + writer.WriteStringValue(ExtraInfoUrl); + } + if (Optional.IsDefined(WebJobType)) + { + writer.WritePropertyName("web_job_type"); + writer.WriteStringValue(WebJobType.Value.ToSerialString()); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(UsingSdk)) + { + writer.WritePropertyName("using_sdk"); + writer.WriteBooleanValue(UsingSdk.Value); + } + if (Optional.IsCollectionDefined(Settings)) + { + writer.WritePropertyName("settings"); + writer.WriteStartObject(); + foreach (var item in Settings) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ContinuousWebJob DeserializeContinuousWebJob(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional status = default; + Optional detailedStatus = default; + Optional logUrl = default; + Optional runCommand = default; + Optional url = default; + Optional extraInfoUrl = default; + Optional webJobType = default; + Optional error = default; + Optional usingSdk = default; + Optional> settings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property0.Value.GetString().ToContinuousWebJobStatus(); + continue; + } + if (property0.NameEquals("detailed_status")) + { + detailedStatus = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("log_url")) + { + logUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("run_command")) + { + runCommand = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("url")) + { + url = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("extra_info_url")) + { + extraInfoUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("web_job_type")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + webJobType = property0.Value.GetString().ToWebJobType(); + continue; + } + if (property0.NameEquals("error")) + { + error = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("using_sdk")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + usingSdk = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("settings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetObject()); + } + settings = dictionary; + continue; + } + } + continue; + } + } + return new ContinuousWebJob(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(status), detailedStatus.Value, logUrl.Value, runCommand.Value, url.Value, extraInfoUrl.Value, Optional.ToNullable(webJobType), error.Value, Optional.ToNullable(usingSdk), Optional.ToDictionary(settings)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.cs index f8139a745481..569c2977f90d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.cs @@ -1,58 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Continuous Web Job Information. - /// - [Rest.Serialization.JsonTransformation] + /// Continuous Web Job Information. public partial class ContinuousWebJob : ProxyOnlyResource { - /// - /// Initializes a new instance of the ContinuousWebJob class. - /// + /// Initializes a new instance of ContinuousWebJob. public ContinuousWebJob() { - CustomInit(); + Settings = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the ContinuousWebJob class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Job status. Possible values include: - /// 'Initializing', 'Starting', 'Running', 'PendingRestart', - /// 'Stopped' - /// Detailed status. - /// Log URL. - /// Run command. - /// Job URL. - /// Extra Info URL. - /// Job type. Possible values include: - /// 'Continuous', 'Triggered' - /// Error information. - /// Using SDK? - /// Job settings. - public ContinuousWebJob(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ContinuousWebJobStatus? status = default(ContinuousWebJobStatus?), string detailedStatus = default(string), string logUrl = default(string), string runCommand = default(string), string url = default(string), string extraInfoUrl = default(string), WebJobType? webJobType = default(WebJobType?), string error = default(string), bool? usingSdk = default(bool?), IDictionary settings = default(IDictionary)) - : base(id, name, kind, type) + /// Initializes a new instance of ContinuousWebJob. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Job status. + /// Detailed status. + /// Log URL. + /// Run command. + /// Job URL. + /// Extra Info URL. + /// Job type. + /// Error information. + /// Using SDK?. + /// Job settings. + internal ContinuousWebJob(string id, string name, string kind, string type, ContinuousWebJobStatus? status, string detailedStatus, string logUrl, string runCommand, string url, string extraInfoUrl, WebJobType? webJobType, string error, bool? usingSdk, IDictionary settings) : base(id, name, kind, type) { Status = status; DetailedStatus = detailedStatus; @@ -64,75 +46,27 @@ public ContinuousWebJob() Error = error; UsingSdk = usingSdk; Settings = settings; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets job status. Possible values include: 'Initializing', - /// 'Starting', 'Running', 'PendingRestart', 'Stopped' - /// - [JsonProperty(PropertyName = "properties.status")] + /// Job status. public ContinuousWebJobStatus? Status { get; set; } - - /// - /// Gets or sets detailed status. - /// - [JsonProperty(PropertyName = "properties.detailed_status")] + /// Detailed status. public string DetailedStatus { get; set; } - - /// - /// Gets or sets log URL. - /// - [JsonProperty(PropertyName = "properties.log_url")] + /// Log URL. public string LogUrl { get; set; } - - /// - /// Gets or sets run command. - /// - [JsonProperty(PropertyName = "properties.run_command")] + /// Run command. public string RunCommand { get; set; } - - /// - /// Gets or sets job URL. - /// - [JsonProperty(PropertyName = "properties.url")] + /// Job URL. public string Url { get; set; } - - /// - /// Gets or sets extra Info URL. - /// - [JsonProperty(PropertyName = "properties.extra_info_url")] + /// Extra Info URL. public string ExtraInfoUrl { get; set; } - - /// - /// Gets or sets job type. Possible values include: 'Continuous', - /// 'Triggered' - /// - [JsonProperty(PropertyName = "properties.web_job_type")] + /// Job type. public WebJobType? WebJobType { get; set; } - - /// - /// Gets or sets error information. - /// - [JsonProperty(PropertyName = "properties.error")] + /// Error information. public string Error { get; set; } - - /// - /// Gets or sets using SDK? - /// - [JsonProperty(PropertyName = "properties.using_sdk")] + /// Using SDK?. public bool? UsingSdk { get; set; } - - /// - /// Gets or sets job settings. - /// - [JsonProperty(PropertyName = "properties.settings")] - public IDictionary Settings { get; set; } - + /// Job settings. + public IDictionary Settings { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.Serialization.cs new file mode 100644 index 000000000000..e1940f8e8e1b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class ContinuousWebJobCollection + { + internal static ContinuousWebJobCollection DeserializeContinuousWebJobCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContinuousWebJob.DeserializeContinuousWebJob(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ContinuousWebJobCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.cs new file mode 100644 index 000000000000..c9cb5f8029ef --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Kudu continuous web job information elements. + internal partial class ContinuousWebJobCollection + { + /// Initializes a new instance of ContinuousWebJobCollection. + /// Collection of resources. + /// is null. + internal ContinuousWebJobCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of ContinuousWebJobCollection. + /// Collection of resources. + /// Link to next page of resources. + internal ContinuousWebJobCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.Serialization.cs new file mode 100644 index 000000000000..2cbb4fd36f4a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class ContinuousWebJobStatusExtensions + { + public static string ToSerialString(this ContinuousWebJobStatus value) => value switch + { + ContinuousWebJobStatus.Initializing => "Initializing", + ContinuousWebJobStatus.Starting => "Starting", + ContinuousWebJobStatus.Running => "Running", + ContinuousWebJobStatus.PendingRestart => "PendingRestart", + ContinuousWebJobStatus.Stopped => "Stopped", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ContinuousWebJobStatus value.") + }; + + public static ContinuousWebJobStatus ToContinuousWebJobStatus(this string value) + { + if (string.Equals(value, "Initializing", StringComparison.InvariantCultureIgnoreCase)) return ContinuousWebJobStatus.Initializing; + if (string.Equals(value, "Starting", StringComparison.InvariantCultureIgnoreCase)) return ContinuousWebJobStatus.Starting; + if (string.Equals(value, "Running", StringComparison.InvariantCultureIgnoreCase)) return ContinuousWebJobStatus.Running; + if (string.Equals(value, "PendingRestart", StringComparison.InvariantCultureIgnoreCase)) return ContinuousWebJobStatus.PendingRestart; + if (string.Equals(value, "Stopped", StringComparison.InvariantCultureIgnoreCase)) return ContinuousWebJobStatus.Stopped; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ContinuousWebJobStatus value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.cs index 4ee338d1cd45..79be39ecd3dd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.cs @@ -1,78 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ContinuousWebJobStatus. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Job status. public enum ContinuousWebJobStatus { - [EnumMember(Value = "Initializing")] + /// Initializing. Initializing, - [EnumMember(Value = "Starting")] + /// Starting. Starting, - [EnumMember(Value = "Running")] + /// Running. Running, - [EnumMember(Value = "PendingRestart")] + /// PendingRestart. PendingRestart, - [EnumMember(Value = "Stopped")] + /// Stopped. Stopped } - internal static class ContinuousWebJobStatusEnumExtension - { - internal static string ToSerializedValue(this ContinuousWebJobStatus? value) - { - return value == null ? null : ((ContinuousWebJobStatus)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ContinuousWebJobStatus value) - { - switch( value ) - { - case ContinuousWebJobStatus.Initializing: - return "Initializing"; - case ContinuousWebJobStatus.Starting: - return "Starting"; - case ContinuousWebJobStatus.Running: - return "Running"; - case ContinuousWebJobStatus.PendingRestart: - return "PendingRestart"; - case ContinuousWebJobStatus.Stopped: - return "Stopped"; - } - return null; - } - - internal static ContinuousWebJobStatus? ParseContinuousWebJobStatus(this string value) - { - switch( value ) - { - case "Initializing": - return ContinuousWebJobStatus.Initializing; - case "Starting": - return ContinuousWebJobStatus.Starting; - case "Running": - return ContinuousWebJobStatus.Running; - case "PendingRestart": - return ContinuousWebJobStatus.PendingRestart; - case "Stopped": - return ContinuousWebJobStatus.Stopped; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.Serialization.cs new file mode 100644 index 000000000000..9b08ef122c04 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CookieExpiration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Convention)) + { + writer.WritePropertyName("convention"); + writer.WriteStringValue(Convention.Value.ToSerialString()); + } + if (Optional.IsDefined(TimeToExpiration)) + { + writer.WritePropertyName("timeToExpiration"); + writer.WriteStringValue(TimeToExpiration); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static CookieExpiration DeserializeCookieExpiration(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional convention = default; + Optional timeToExpiration = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("convention")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + convention = property0.Value.GetString().ToCookieExpirationConvention(); + continue; + } + if (property0.NameEquals("timeToExpiration")) + { + timeToExpiration = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new CookieExpiration(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(convention), timeToExpiration.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.cs index 2bad787f8310..b0f4599cc117 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.cs @@ -1,64 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the session cookie's expiration. public partial class CookieExpiration : ProxyOnlyResource { - /// - /// Initializes a new instance of the CookieExpiration class. - /// + /// Initializes a new instance of CookieExpiration. public CookieExpiration() { - CustomInit(); } - /// - /// Initializes a new instance of the CookieExpiration class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Possible values include: 'FixedTime', - /// 'IdentityProviderDerived' - public CookieExpiration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), CookieExpirationConvention? convention = default(CookieExpirationConvention?), string timeToExpiration = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of CookieExpiration. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The convention used when determining the session cookie's expiration. + /// The time after the request is made when the session cookie should expire. + internal CookieExpiration(string id, string name, string kind, string type, CookieExpirationConvention? convention, string timeToExpiration) : base(id, name, kind, type) { Convention = convention; TimeToExpiration = timeToExpiration; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets possible values include: 'FixedTime', - /// 'IdentityProviderDerived' - /// - [JsonProperty(PropertyName = "properties.convention")] + /// The convention used when determining the session cookie's expiration. public CookieExpirationConvention? Convention { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.timeToExpiration")] + /// The time after the request is made when the session cookie should expire. public string TimeToExpiration { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.Serialization.cs new file mode 100644 index 000000000000..f1880787b687 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class CookieExpirationConventionExtensions + { + public static string ToSerialString(this CookieExpirationConvention value) => value switch + { + CookieExpirationConvention.FixedTime => "FixedTime", + CookieExpirationConvention.IdentityProviderDerived => "IdentityProviderDerived", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CookieExpirationConvention value.") + }; + + public static CookieExpirationConvention ToCookieExpirationConvention(this string value) + { + if (string.Equals(value, "FixedTime", StringComparison.InvariantCultureIgnoreCase)) return CookieExpirationConvention.FixedTime; + if (string.Equals(value, "IdentityProviderDerived", StringComparison.InvariantCultureIgnoreCase)) return CookieExpirationConvention.IdentityProviderDerived; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CookieExpirationConvention value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.cs index f70cd921b20d..d93558a9524b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for CookieExpirationConvention. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// The convention used when determining the session cookie's expiration. public enum CookieExpirationConvention { - [EnumMember(Value = "FixedTime")] + /// FixedTime. FixedTime, - [EnumMember(Value = "IdentityProviderDerived")] + /// IdentityProviderDerived. IdentityProviderDerived } - internal static class CookieExpirationConventionEnumExtension - { - internal static string ToSerializedValue(this CookieExpirationConvention? value) - { - return value == null ? null : ((CookieExpirationConvention)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this CookieExpirationConvention value) - { - switch( value ) - { - case CookieExpirationConvention.FixedTime: - return "FixedTime"; - case CookieExpirationConvention.IdentityProviderDerived: - return "IdentityProviderDerived"; - } - return null; - } - - internal static CookieExpirationConvention? ParseCookieExpirationConvention(this string value) - { - switch( value ) - { - case "FixedTime": - return CookieExpirationConvention.FixedTime; - case "IdentityProviderDerived": - return CookieExpirationConvention.IdentityProviderDerived; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.Serialization.cs new file mode 100644 index 000000000000..b90c7d21e2eb --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.Serialization.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CorsSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AllowedOrigins)) + { + writer.WritePropertyName("allowedOrigins"); + writer.WriteStartArray(); + foreach (var item in AllowedOrigins) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(SupportCredentials)) + { + writer.WritePropertyName("supportCredentials"); + writer.WriteBooleanValue(SupportCredentials.Value); + } + writer.WriteEndObject(); + } + + internal static CorsSettings DeserializeCorsSettings(JsonElement element) + { + Optional> allowedOrigins = default; + Optional supportCredentials = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("allowedOrigins")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedOrigins = array; + continue; + } + if (property.NameEquals("supportCredentials")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + supportCredentials = property.Value.GetBoolean(); + continue; + } + } + return new CorsSettings(Optional.ToList(allowedOrigins), Optional.ToNullable(supportCredentials)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.cs index 30cffd37b2a1..870c293c10e0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.cs @@ -1,73 +1,50 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Cross-Origin Resource Sharing (CORS) settings for the app. - /// + /// Cross-Origin Resource Sharing (CORS) settings for the app. public partial class CorsSettings { - /// - /// Initializes a new instance of the CorsSettings class. - /// + /// Initializes a new instance of CorsSettings. public CorsSettings() { - CustomInit(); + AllowedOrigins = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the CorsSettings class. - /// - /// Gets or sets the list of origins that - /// should be allowed to make cross-origin - /// calls (for example: http://example.com:12345). Use "*" to allow - /// all. - /// Gets or sets whether CORS requests - /// with credentials are allowed. See + /// Initializes a new instance of CorsSettings. + /// + /// Gets or sets the list of origins that should be allowed to make cross-origin + /// calls (for example: http://example.com:12345). Use "*" to allow all. + /// + /// + /// Gets or sets whether CORS requests with credentials are allowed. See /// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials - /// for more details. - public CorsSettings(IList allowedOrigins = default(IList), bool? supportCredentials = default(bool?)) + /// for more details. + /// + internal CorsSettings(IList allowedOrigins, bool? supportCredentials) { AllowedOrigins = allowedOrigins; SupportCredentials = supportCredentials; - CustomInit(); } /// - /// An initialization method that performs custom operations like setting defaults + /// Gets or sets the list of origins that should be allowed to make cross-origin + /// calls (for example: http://example.com:12345). Use "*" to allow all. /// - partial void CustomInit(); - + public IList AllowedOrigins { get; } /// - /// Gets or sets the list of origins that should be allowed to make - /// cross-origin - /// calls (for example: http://example.com:12345). Use "*" to allow - /// all. - /// - [JsonProperty(PropertyName = "allowedOrigins")] - public IList AllowedOrigins { get; set; } - - /// - /// Gets or sets whether CORS requests with credentials are allowed. - /// See + /// Gets or sets whether CORS requests with credentials are allowed. See /// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials /// for more details. /// - [JsonProperty(PropertyName = "supportCredentials")] public bool? SupportCredentials { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.Serialization.cs new file mode 100644 index 000000000000..bc0240c5e27b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.Serialization.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CsmMoveResourceEnvelope : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(TargetResourceGroup)) + { + writer.WritePropertyName("targetResourceGroup"); + writer.WriteStringValue(TargetResourceGroup); + } + if (Optional.IsCollectionDefined(Resources)) + { + writer.WritePropertyName("resources"); + writer.WriteStartArray(); + foreach (var item in Resources) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.cs index 221891f818a8..c8dd999c42b8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.cs @@ -1,83 +1,25 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Object with a list of the resources that need to be moved and the - /// resource group they should be moved to. - /// + /// Object with a list of the resources that need to be moved and the resource group they should be moved to. public partial class CsmMoveResourceEnvelope { - /// - /// Initializes a new instance of the CsmMoveResourceEnvelope class. - /// + /// Initializes a new instance of CsmMoveResourceEnvelope. public CsmMoveResourceEnvelope() { - CustomInit(); - } - - /// - /// Initializes a new instance of the CsmMoveResourceEnvelope class. - /// - public CsmMoveResourceEnvelope(string targetResourceGroup = default(string), IList resources = default(IList)) - { - TargetResourceGroup = targetResourceGroup; - Resources = resources; - CustomInit(); + Resources = new ChangeTrackingList(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "targetResourceGroup")] public string TargetResourceGroup { get; set; } - - /// - /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TargetResourceGroup != null) - { - if (TargetResourceGroup.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "TargetResourceGroup", 90); - } - if (TargetResourceGroup.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "TargetResourceGroup", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(TargetResourceGroup, " ^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "TargetResourceGroup", " ^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - } + public IList Resources { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.Serialization.cs new file mode 100644 index 000000000000..8adafeda13d6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class CsmOperationCollection + { + internal static CsmOperationCollection DeserializeCsmOperationCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CsmOperationDescription.DeserializeCsmOperationDescription(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new CsmOperationCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.cs new file mode 100644 index 000000000000..93635c58dad5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Azure resource manager operation metadata. + internal partial class CsmOperationCollection + { + /// Initializes a new instance of CsmOperationCollection. + /// Collection of resources. + /// is null. + internal CsmOperationCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of CsmOperationCollection. + /// Collection of resources. + /// Link to next page of resources. + internal CsmOperationCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.Serialization.cs new file mode 100644 index 000000000000..090730b6b372 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.Serialization.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CsmOperationDescription + { + internal static CsmOperationDescription DeserializeCsmOperationDescription(JsonElement element) + { + Optional name = default; + Optional display = default; + Optional origin = default; + Optional properties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("display")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + display = CsmOperationDisplay.DeserializeCsmOperationDisplay(property.Value); + continue; + } + if (property.NameEquals("origin")) + { + origin = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = CsmOperationDescriptionProperties.DeserializeCsmOperationDescriptionProperties(property.Value); + continue; + } + } + return new CsmOperationDescription(name.Value, display.Value, origin.Value, properties.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.cs index e37bb469ac64..afcad5be5f4b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.cs @@ -1,68 +1,38 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Description of an operation available for Microsoft.Web resource - /// provider. - /// + /// Description of an operation available for Microsoft.Web resource provider. public partial class CsmOperationDescription { - /// - /// Initializes a new instance of the CsmOperationDescription class. - /// - public CsmOperationDescription() + /// Initializes a new instance of CsmOperationDescription. + internal CsmOperationDescription() { - CustomInit(); } - /// - /// Initializes a new instance of the CsmOperationDescription class. - /// - public CsmOperationDescription(string name = default(string), CsmOperationDisplay display = default(CsmOperationDisplay), string origin = default(string), CsmOperationDescriptionProperties properties = default(CsmOperationDescriptionProperties)) + /// Initializes a new instance of CsmOperationDescription. + /// . + /// Meta data about operation used for display in portal. + /// . + /// Properties available for a Microsoft.Web resource provider operation. + internal CsmOperationDescription(string name, CsmOperationDisplay display, string origin, CsmOperationDescriptionProperties properties) { Name = name; Display = display; Origin = origin; Properties = properties; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// - [JsonProperty(PropertyName = "display")] - public CsmOperationDisplay Display { get; set; } - - /// - /// - [JsonProperty(PropertyName = "origin")] - public string Origin { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties")] - public CsmOperationDescriptionProperties Properties { get; set; } - + public string Name { get; } + /// Meta data about operation used for display in portal. + public CsmOperationDisplay Display { get; } + public string Origin { get; } + /// Properties available for a Microsoft.Web resource provider operation. + public CsmOperationDescriptionProperties Properties { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs new file mode 100644 index 000000000000..69996bedbfe9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CsmOperationDescriptionProperties + { + internal static CsmOperationDescriptionProperties DeserializeCsmOperationDescriptionProperties(JsonElement element) + { + Optional serviceSpecification = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceSpecification")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + serviceSpecification = ServiceSpecification.DeserializeServiceSpecification(property.Value); + continue; + } + } + return new CsmOperationDescriptionProperties(serviceSpecification.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.cs index 2c2db9daf03d..88ade7c2c5a2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.cs @@ -1,51 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties available for a Microsoft.Web resource provider operation. - /// + /// Properties available for a Microsoft.Web resource provider operation. public partial class CsmOperationDescriptionProperties { - /// - /// Initializes a new instance of the CsmOperationDescriptionProperties - /// class. - /// - public CsmOperationDescriptionProperties() + /// Initializes a new instance of CsmOperationDescriptionProperties. + internal CsmOperationDescriptionProperties() { - CustomInit(); } - /// - /// Initializes a new instance of the CsmOperationDescriptionProperties - /// class. - /// - public CsmOperationDescriptionProperties(ServiceSpecification serviceSpecification = default(ServiceSpecification)) + /// Initializes a new instance of CsmOperationDescriptionProperties. + /// Resource metrics service provided by Microsoft.Insights resource provider. + internal CsmOperationDescriptionProperties(ServiceSpecification serviceSpecification) { ServiceSpecification = serviceSpecification; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "serviceSpecification")] - public ServiceSpecification ServiceSpecification { get; set; } - + /// Resource metrics service provided by Microsoft.Insights resource provider. + public ServiceSpecification ServiceSpecification { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.Serialization.cs new file mode 100644 index 000000000000..d3e75cadd874 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CsmOperationDisplay + { + internal static CsmOperationDisplay DeserializeCsmOperationDisplay(JsonElement element) + { + Optional provider = default; + Optional resource = default; + Optional operation = default; + Optional description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provider")) + { + provider = property.Value.GetString(); + continue; + } + if (property.NameEquals("resource")) + { + resource = property.Value.GetString(); + continue; + } + if (property.NameEquals("operation")) + { + operation = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + } + return new CsmOperationDisplay(provider.Value, resource.Value, operation.Value, description.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.cs index e22e286ff398..82c6553b4b2b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.cs @@ -1,67 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Meta data about operation used for display in portal. - /// + /// Meta data about operation used for display in portal. public partial class CsmOperationDisplay { - /// - /// Initializes a new instance of the CsmOperationDisplay class. - /// - public CsmOperationDisplay() + /// Initializes a new instance of CsmOperationDisplay. + internal CsmOperationDisplay() { - CustomInit(); } - /// - /// Initializes a new instance of the CsmOperationDisplay class. - /// - public CsmOperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + /// Initializes a new instance of CsmOperationDisplay. + /// . + /// . + /// . + /// . + internal CsmOperationDisplay(string provider, string resource, string operation, string description) { Provider = provider; Resource = resource; Operation = operation; Description = description; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; set; } - - /// - /// - [JsonProperty(PropertyName = "resource")] - public string Resource { get; set; } - - /// - /// - [JsonProperty(PropertyName = "operation")] - public string Operation { get; set; } - - /// - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + public string Provider { get; } + public string Resource { get; } + public string Operation { get; } + public string Description { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.Serialization.cs new file mode 100644 index 000000000000..95642e8ea39b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.Serialization.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CsmPublishingCredentialsPoliciesCollection : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Ftp)) + { + writer.WritePropertyName("ftp"); + writer.WriteObjectValue(Ftp); + } + if (Optional.IsDefined(Scm)) + { + writer.WritePropertyName("scm"); + writer.WriteObjectValue(Scm); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static CsmPublishingCredentialsPoliciesCollection DeserializeCsmPublishingCredentialsPoliciesCollection(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional ftp = default; + Optional scm = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("ftp")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + ftp = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(property0.Value); + continue; + } + if (property0.NameEquals("scm")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + scm = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(property0.Value); + continue; + } + } + continue; + } + } + return new CsmPublishingCredentialsPoliciesCollection(id.Value, name.Value, kind.Value, type.Value, ftp.Value, scm.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.cs index 364b186fed71..02750462c671 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.cs @@ -1,94 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Publishing Credentials Policies collection. - /// - [Rest.Serialization.JsonTransformation] + /// Publishing Credentials Policies collection. public partial class CsmPublishingCredentialsPoliciesCollection : ProxyOnlyResource { - /// - /// Initializes a new instance of the - /// CsmPublishingCredentialsPoliciesCollection class. - /// + /// Initializes a new instance of CsmPublishingCredentialsPoliciesCollection. public CsmPublishingCredentialsPoliciesCollection() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// CsmPublishingCredentialsPoliciesCollection class. - /// - /// Whether FTP is allowed. - /// Whether Scm Basic Auth is allowed. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public CsmPublishingCredentialsPoliciesCollection(CsmPublishingCredentialsPoliciesEntity ftp, CsmPublishingCredentialsPoliciesEntity scm, string id = default(string), string name = default(string), string kind = default(string), string type = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of CsmPublishingCredentialsPoliciesCollection. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Whether FTP is allowed. + /// Whether Scm Basic Auth is allowed. + internal CsmPublishingCredentialsPoliciesCollection(string id, string name, string kind, string type, CsmPublishingCredentialsPoliciesEntity ftp, CsmPublishingCredentialsPoliciesEntity scm) : base(id, name, kind, type) { Ftp = ftp; Scm = scm; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets whether FTP is allowed. - /// - [JsonProperty(PropertyName = "properties.ftp")] + /// Whether FTP is allowed. public CsmPublishingCredentialsPoliciesEntity Ftp { get; set; } - - /// - /// Gets or sets whether Scm Basic Auth is allowed. - /// - [JsonProperty(PropertyName = "properties.scm")] + /// Whether Scm Basic Auth is allowed. public CsmPublishingCredentialsPoliciesEntity Scm { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Ftp == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Ftp"); - } - if (Scm == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Scm"); - } - if (Ftp != null) - { - Ftp.Validate(); - } - if (Scm != null) - { - Scm.Validate(); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.Serialization.cs new file mode 100644 index 000000000000..bfacbbff92bb --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.Serialization.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CsmPublishingCredentialsPoliciesEntity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Allow)) + { + writer.WritePropertyName("allow"); + writer.WriteBooleanValue(Allow.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static CsmPublishingCredentialsPoliciesEntity DeserializeCsmPublishingCredentialsPoliciesEntity(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional allow = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("allow")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + allow = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new CsmPublishingCredentialsPoliciesEntity(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(allow)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.cs index 3b389e6e76fa..5d41bffff318 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.cs @@ -1,75 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Publishing Credentials Policies parameters. - /// - [Rest.Serialization.JsonTransformation] + /// Publishing Credentials Policies parameters. public partial class CsmPublishingCredentialsPoliciesEntity : ProxyOnlyResource { - /// - /// Initializes a new instance of the - /// CsmPublishingCredentialsPoliciesEntity class. - /// + /// Initializes a new instance of CsmPublishingCredentialsPoliciesEntity. public CsmPublishingCredentialsPoliciesEntity() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// CsmPublishingCredentialsPoliciesEntity class. - /// - /// <code>true</code> to allow access - /// to a publishing method; otherwise, - /// <code>false</code>. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public CsmPublishingCredentialsPoliciesEntity(bool allow, string id = default(string), string name = default(string), string kind = default(string), string type = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of CsmPublishingCredentialsPoliciesEntity. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>true</code> to allow access to a publishing method; otherwise, <code>false</code>. + internal CsmPublishingCredentialsPoliciesEntity(string id, string name, string kind, string type, bool? allow) : base(id, name, kind, type) { Allow = allow; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to allow - /// access to a publishing method; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.allow")] - public bool Allow { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - //Nothing to validate - } + /// <code>true</code> to allow access to a publishing method; otherwise, <code>false</code>. + public bool? Allow { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.Serialization.cs new file mode 100644 index 000000000000..f2b9674f8c01 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.Serialization.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CsmPublishingProfileOptions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Format)) + { + writer.WritePropertyName("format"); + writer.WriteStringValue(Format.Value.ToString()); + } + if (Optional.IsDefined(IncludeDisasterRecoveryEndpoints)) + { + writer.WritePropertyName("includeDisasterRecoveryEndpoints"); + writer.WriteBooleanValue(IncludeDisasterRecoveryEndpoints.Value); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.cs index ab77ff58b750..86b308d82a55 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.cs @@ -1,69 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Publishing options for requested profile. - /// + /// Publishing options for requested profile. public partial class CsmPublishingProfileOptions { - /// - /// Initializes a new instance of the CsmPublishingProfileOptions - /// class. - /// + /// Initializes a new instance of CsmPublishingProfileOptions. public CsmPublishingProfileOptions() { - CustomInit(); } /// - /// Initializes a new instance of the CsmPublishingProfileOptions - /// class. - /// - /// Name of the format. Valid values are: + /// Name of the format. Valid values are: /// FileZilla3 /// WebDeploy -- default - /// Ftp. Possible values include: 'FileZilla3', 'WebDeploy', - /// 'Ftp' - /// Include the - /// DisasterRecover endpoint if true - public CsmPublishingProfileOptions(string format = default(string), bool? includeDisasterRecoveryEndpoints = default(bool?)) - { - Format = format; - IncludeDisasterRecoveryEndpoints = includeDisasterRecoveryEndpoints; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults + /// Ftp. /// - partial void CustomInit(); - - /// - /// Gets or sets name of the format. Valid values are: - /// FileZilla3 - /// WebDeploy -- default - /// Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - /// - [JsonProperty(PropertyName = "format")] - public string Format { get; set; } - - /// - /// Gets or sets include the DisasterRecover endpoint if true - /// - [JsonProperty(PropertyName = "includeDisasterRecoveryEndpoints")] + public PublishingProfileFormat? Format { get; set; } + /// Include the DisasterRecover endpoint if true. public bool? IncludeDisasterRecoveryEndpoints { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.Serialization.cs new file mode 100644 index 000000000000..49335c1caa12 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.Serialization.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CsmSlotEntity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("targetSlot"); + writer.WriteStringValue(TargetSlot); + writer.WritePropertyName("preserveVnet"); + writer.WriteBooleanValue(PreserveVnet); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.cs index ab57d287cfc7..956f34622e45 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.cs @@ -1,78 +1,35 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Deployment slot parameters. - /// + /// Deployment slot parameters. public partial class CsmSlotEntity { - /// - /// Initializes a new instance of the CsmSlotEntity class. - /// - public CsmSlotEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CsmSlotEntity class. - /// - /// Destination deployment slot during swap - /// operation. - /// <code>true</code> to - /// preserve Virtual Network to the slot during swap; otherwise, - /// <code>false</code>. + /// Initializes a new instance of CsmSlotEntity. + /// Destination deployment slot during swap operation. + /// <code>true</code> to preserve Virtual Network to the slot during swap; otherwise, <code>false</code>. + /// is null. public CsmSlotEntity(string targetSlot, bool preserveVnet) { + if (targetSlot == null) + { + throw new ArgumentNullException(nameof(targetSlot)); + } + TargetSlot = targetSlot; PreserveVnet = preserveVnet; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets destination deployment slot during swap operation. - /// - [JsonProperty(PropertyName = "targetSlot")] - public string TargetSlot { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// preserve Virtual Network to the slot during swap; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "preserveVnet")] - public bool PreserveVnet { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TargetSlot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetSlot"); - } - } + /// Destination deployment slot during swap operation. + public string TargetSlot { get; } + /// <code>true</code> to preserve Virtual Network to the slot during swap; otherwise, <code>false</code>. + public bool PreserveVnet { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.Serialization.cs new file mode 100644 index 000000000000..644010ed33ec --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CsmUsageQuota + { + internal static CsmUsageQuota DeserializeCsmUsageQuota(JsonElement element) + { + Optional unit = default; + Optional nextResetTime = default; + Optional currentValue = default; + Optional limit = default; + Optional name = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("unit")) + { + unit = property.Value.GetString(); + continue; + } + if (property.NameEquals("nextResetTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + nextResetTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("currentValue")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + currentValue = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("limit")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + limit = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("name")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + name = LocalizableString.DeserializeLocalizableString(property.Value); + continue; + } + } + return new CsmUsageQuota(unit.Value, Optional.ToNullable(nextResetTime), Optional.ToNullable(currentValue), Optional.ToNullable(limit), name.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.cs index 8ebed8720d9e..a397ee5bb02f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.cs @@ -1,86 +1,46 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Usage of the quota resource. - /// + /// Usage of the quota resource. public partial class CsmUsageQuota { - /// - /// Initializes a new instance of the CsmUsageQuota class. - /// - public CsmUsageQuota() + /// Initializes a new instance of CsmUsageQuota. + internal CsmUsageQuota() { - CustomInit(); } - /// - /// Initializes a new instance of the CsmUsageQuota class. - /// - /// Units of measurement for the quota - /// resource. - /// Next reset time for the resource - /// counter. - /// The current value of the resource - /// counter. - /// The resource limit. - /// Quota name. - public CsmUsageQuota(string unit = default(string), System.DateTime? nextResetTime = default(System.DateTime?), long? currentValue = default(long?), long? limit = default(long?), LocalizableString name = default(LocalizableString)) + /// Initializes a new instance of CsmUsageQuota. + /// Units of measurement for the quota resource. + /// Next reset time for the resource counter. + /// The current value of the resource counter. + /// The resource limit. + /// Quota name. + internal CsmUsageQuota(string unit, DateTimeOffset? nextResetTime, long? currentValue, long? limit, LocalizableString name) { Unit = unit; NextResetTime = nextResetTime; CurrentValue = currentValue; Limit = limit; Name = name; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets units of measurement for the quota resource. - /// - [JsonProperty(PropertyName = "unit")] - public string Unit { get; set; } - - /// - /// Gets or sets next reset time for the resource counter. - /// - [JsonProperty(PropertyName = "nextResetTime")] - public System.DateTime? NextResetTime { get; set; } - - /// - /// Gets or sets the current value of the resource counter. - /// - [JsonProperty(PropertyName = "currentValue")] - public long? CurrentValue { get; set; } - - /// - /// Gets or sets the resource limit. - /// - [JsonProperty(PropertyName = "limit")] - public long? Limit { get; set; } - - /// - /// Gets or sets quota name. - /// - [JsonProperty(PropertyName = "name")] - public LocalizableString Name { get; set; } - + /// Units of measurement for the quota resource. + public string Unit { get; } + /// Next reset time for the resource counter. + public DateTimeOffset? NextResetTime { get; } + /// The current value of the resource counter. + public long? CurrentValue { get; } + /// The resource limit. + public long? Limit { get; } + /// Quota name. + public LocalizableString Name { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.Serialization.cs new file mode 100644 index 000000000000..024487639e6e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class CsmUsageQuotaCollection + { + internal static CsmUsageQuotaCollection DeserializeCsmUsageQuotaCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CsmUsageQuota.DeserializeCsmUsageQuota(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new CsmUsageQuotaCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.cs new file mode 100644 index 000000000000..c938bd4d8083 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of CSM usage quotas. + internal partial class CsmUsageQuotaCollection + { + /// Initializes a new instance of CsmUsageQuotaCollection. + /// Collection of resources. + /// is null. + internal CsmUsageQuotaCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of CsmUsageQuotaCollection. + /// Collection of resources. + /// Link to next page of resources. + internal CsmUsageQuotaCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs new file mode 100644 index 000000000000..4dd12a03d6e2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The status of the custom domain. + public readonly partial struct CustomDomainStatus : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public CustomDomainStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RetrievingValidationTokenValue = "RetrievingValidationToken"; + private const string ValidatingValue = "Validating"; + private const string AddingValue = "Adding"; + private const string ReadyValue = "Ready"; + private const string FailedValue = "Failed"; + private const string DeletingValue = "Deleting"; + + /// RetrievingValidationToken. + public static CustomDomainStatus RetrievingValidationToken { get; } = new CustomDomainStatus(RetrievingValidationTokenValue); + /// Validating. + public static CustomDomainStatus Validating { get; } = new CustomDomainStatus(ValidatingValue); + /// Adding. + public static CustomDomainStatus Adding { get; } = new CustomDomainStatus(AddingValue); + /// Ready. + public static CustomDomainStatus Ready { get; } = new CustomDomainStatus(ReadyValue); + /// Failed. + public static CustomDomainStatus Failed { get; } = new CustomDomainStatus(FailedValue); + /// Deleting. + public static CustomDomainStatus Deleting { get; } = new CustomDomainStatus(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(CustomDomainStatus left, CustomDomainStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CustomDomainStatus left, CustomDomainStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CustomDomainStatus(string value) => new CustomDomainStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CustomDomainStatus other && Equals(other); + /// + public bool Equals(CustomDomainStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.Serialization.cs new file mode 100644 index 000000000000..de43ae73baa8 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class CustomHostNameDnsRecordTypeExtensions + { + public static string ToSerialString(this CustomHostNameDnsRecordType value) => value switch + { + CustomHostNameDnsRecordType.CName => "CName", + CustomHostNameDnsRecordType.A => "A", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CustomHostNameDnsRecordType value.") + }; + + public static CustomHostNameDnsRecordType ToCustomHostNameDnsRecordType(this string value) + { + if (string.Equals(value, "CName", StringComparison.InvariantCultureIgnoreCase)) return CustomHostNameDnsRecordType.CName; + if (string.Equals(value, "A", StringComparison.InvariantCultureIgnoreCase)) return CustomHostNameDnsRecordType.A; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CustomHostNameDnsRecordType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.cs index 9226829dbeae..647c8418f5d1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for CustomHostNameDnsRecordType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Type of the DNS record. public enum CustomHostNameDnsRecordType { - [EnumMember(Value = "CName")] + /// CName. CName, - [EnumMember(Value = "A")] + /// A. A } - internal static class CustomHostNameDnsRecordTypeEnumExtension - { - internal static string ToSerializedValue(this CustomHostNameDnsRecordType? value) - { - return value == null ? null : ((CustomHostNameDnsRecordType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this CustomHostNameDnsRecordType value) - { - switch( value ) - { - case CustomHostNameDnsRecordType.CName: - return "CName"; - case CustomHostNameDnsRecordType.A: - return "A"; - } - return null; - } - - internal static CustomHostNameDnsRecordType? ParseCustomHostNameDnsRecordType(this string value) - { - switch( value ) - { - case "CName": - return CustomHostNameDnsRecordType.CName; - case "A": - return CustomHostNameDnsRecordType.A; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.Serialization.cs new file mode 100644 index 000000000000..18ca16f89f18 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.Serialization.cs @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CustomHostnameAnalysisResult : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(CNameRecords)) + { + writer.WritePropertyName("cNameRecords"); + writer.WriteStartArray(); + foreach (var item in CNameRecords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TxtRecords)) + { + writer.WritePropertyName("txtRecords"); + writer.WriteStartArray(); + foreach (var item in TxtRecords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ARecords)) + { + writer.WritePropertyName("aRecords"); + writer.WriteStartArray(); + foreach (var item in ARecords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AlternateCNameRecords)) + { + writer.WritePropertyName("alternateCNameRecords"); + writer.WriteStartArray(); + foreach (var item in AlternateCNameRecords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AlternateTxtRecords)) + { + writer.WritePropertyName("alternateTxtRecords"); + writer.WriteStartArray(); + foreach (var item in AlternateTxtRecords) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static CustomHostnameAnalysisResult DeserializeCustomHostnameAnalysisResult(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional isHostnameAlreadyVerified = default; + Optional customDomainVerificationTest = default; + Optional customDomainVerificationFailureInfo = default; + Optional hasConflictOnScaleUnit = default; + Optional hasConflictAcrossSubscription = default; + Optional conflictingAppResourceId = default; + Optional> cNameRecords = default; + Optional> txtRecords = default; + Optional> aRecords = default; + Optional> alternateCNameRecords = default; + Optional> alternateTxtRecords = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("isHostnameAlreadyVerified")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isHostnameAlreadyVerified = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("customDomainVerificationTest")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + customDomainVerificationTest = property0.Value.GetString().ToDnsVerificationTestResult(); + continue; + } + if (property0.NameEquals("customDomainVerificationFailureInfo")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + customDomainVerificationFailureInfo = ErrorEntity.DeserializeErrorEntity(property0.Value); + continue; + } + if (property0.NameEquals("hasConflictOnScaleUnit")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hasConflictOnScaleUnit = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("hasConflictAcrossSubscription")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hasConflictAcrossSubscription = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("conflictingAppResourceId")) + { + conflictingAppResourceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("cNameRecords")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + cNameRecords = array; + continue; + } + if (property0.NameEquals("txtRecords")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + txtRecords = array; + continue; + } + if (property0.NameEquals("aRecords")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + aRecords = array; + continue; + } + if (property0.NameEquals("alternateCNameRecords")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + alternateCNameRecords = array; + continue; + } + if (property0.NameEquals("alternateTxtRecords")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + alternateTxtRecords = array; + continue; + } + } + continue; + } + } + return new CustomHostnameAnalysisResult(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(isHostnameAlreadyVerified), Optional.ToNullable(customDomainVerificationTest), customDomainVerificationFailureInfo.Value, Optional.ToNullable(hasConflictOnScaleUnit), Optional.ToNullable(hasConflictAcrossSubscription), conflictingAppResourceId.Value, Optional.ToList(cNameRecords), Optional.ToList(txtRecords), Optional.ToList(aRecords), Optional.ToList(alternateCNameRecords), Optional.ToList(alternateTxtRecords)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.cs index 78dddad2e52e..551406042555 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.cs @@ -1,75 +1,45 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Custom domain analysis. - /// - [Rest.Serialization.JsonTransformation] + /// Custom domain analysis. public partial class CustomHostnameAnalysisResult : ProxyOnlyResource { - /// - /// Initializes a new instance of the CustomHostnameAnalysisResult - /// class. - /// + /// Initializes a new instance of CustomHostnameAnalysisResult. public CustomHostnameAnalysisResult() { - CustomInit(); + CNameRecords = new ChangeTrackingList(); + TxtRecords = new ChangeTrackingList(); + ARecords = new ChangeTrackingList(); + AlternateCNameRecords = new ChangeTrackingList(); + AlternateTxtRecords = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the CustomHostnameAnalysisResult - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>true</code> if - /// hostname is already verified; otherwise, - /// <code>false</code>. - /// DNS verification test - /// result. Possible values include: 'Passed', 'Failed', - /// 'Skipped' - /// Raw failure - /// information if DNS verification fails. - /// <code>true</code> - /// if there is a conflict on a scale unit; otherwise, - /// <code>false</code>. - /// <code>true</code> - /// if there is a conflict across subscriptions; otherwise, - /// <code>false</code>. - /// Name of the conflicting app - /// on scale unit if it's within the same subscription. - /// CName records controller can see for - /// this hostname. - /// TXT records controller can see for this - /// hostname. - /// A records controller can see for this - /// hostname. - /// Alternate CName records - /// controller can see for this hostname. - /// Alternate TXT records controller - /// can see for this hostname. - public CustomHostnameAnalysisResult(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? isHostnameAlreadyVerified = default(bool?), DnsVerificationTestResult? customDomainVerificationTest = default(DnsVerificationTestResult?), ErrorEntity customDomainVerificationFailureInfo = default(ErrorEntity), bool? hasConflictOnScaleUnit = default(bool?), bool? hasConflictAcrossSubscription = default(bool?), string conflictingAppResourceId = default(string), IList cNameRecords = default(IList), IList txtRecords = default(IList), IList aRecords = default(IList), IList alternateCNameRecords = default(IList), IList alternateTxtRecords = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of CustomHostnameAnalysisResult. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>true</code> if hostname is already verified; otherwise, <code>false</code>. + /// DNS verification test result. + /// Raw failure information if DNS verification fails. + /// <code>true</code> if there is a conflict on a scale unit; otherwise, <code>false</code>. + /// <code>true</code> if there is a conflict across subscriptions; otherwise, <code>false</code>. + /// Name of the conflicting app on scale unit if it's within the same subscription. + /// CName records controller can see for this hostname. + /// TXT records controller can see for this hostname. + /// A records controller can see for this hostname. + /// Alternate CName records controller can see for this hostname. + /// Alternate TXT records controller can see for this hostname. + internal CustomHostnameAnalysisResult(string id, string name, string kind, string type, bool? isHostnameAlreadyVerified, DnsVerificationTestResult? customDomainVerificationTest, ErrorEntity customDomainVerificationFailureInfo, bool? hasConflictOnScaleUnit, bool? hasConflictAcrossSubscription, string conflictingAppResourceId, IList cNameRecords, IList txtRecords, IList aRecords, IList alternateCNameRecords, IList alternateTxtRecords) : base(id, name, kind, type) { IsHostnameAlreadyVerified = isHostnameAlreadyVerified; CustomDomainVerificationTest = customDomainVerificationTest; @@ -82,89 +52,29 @@ public CustomHostnameAnalysisResult() ARecords = aRecords; AlternateCNameRecords = alternateCNameRecords; AlternateTxtRecords = alternateTxtRecords; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if hostname is - /// already verified; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.isHostnameAlreadyVerified")] - public bool? IsHostnameAlreadyVerified { get; private set; } - - /// - /// Gets DNS verification test result. Possible values include: - /// 'Passed', 'Failed', 'Skipped' - /// - [JsonProperty(PropertyName = "properties.customDomainVerificationTest")] - public DnsVerificationTestResult? CustomDomainVerificationTest { get; private set; } - - /// - /// Gets raw failure information if DNS verification fails. - /// - [JsonProperty(PropertyName = "properties.customDomainVerificationFailureInfo")] - public ErrorEntity CustomDomainVerificationFailureInfo { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if there is a - /// conflict on a scale unit; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.hasConflictOnScaleUnit")] - public bool? HasConflictOnScaleUnit { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if there is a - /// conflict across subscriptions; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.hasConflictAcrossSubscription")] - public bool? HasConflictAcrossSubscription { get; private set; } - - /// - /// Gets name of the conflicting app on scale unit if it's within the - /// same subscription. - /// - [JsonProperty(PropertyName = "properties.conflictingAppResourceId")] - public string ConflictingAppResourceId { get; private set; } - - /// - /// Gets or sets cName records controller can see for this hostname. - /// - [JsonProperty(PropertyName = "properties.cNameRecords")] - public IList CNameRecords { get; set; } - - /// - /// Gets or sets TXT records controller can see for this hostname. - /// - [JsonProperty(PropertyName = "properties.txtRecords")] - public IList TxtRecords { get; set; } - - /// - /// Gets or sets a records controller can see for this hostname. - /// - [JsonProperty(PropertyName = "properties.aRecords")] - public IList ARecords { get; set; } - - /// - /// Gets or sets alternate CName records controller can see for this - /// hostname. - /// - [JsonProperty(PropertyName = "properties.alternateCNameRecords")] - public IList AlternateCNameRecords { get; set; } - - /// - /// Gets or sets alternate TXT records controller can see for this - /// hostname. - /// - [JsonProperty(PropertyName = "properties.alternateTxtRecords")] - public IList AlternateTxtRecords { get; set; } - + /// <code>true</code> if hostname is already verified; otherwise, <code>false</code>. + public bool? IsHostnameAlreadyVerified { get; } + /// DNS verification test result. + public DnsVerificationTestResult? CustomDomainVerificationTest { get; } + /// Raw failure information if DNS verification fails. + public ErrorEntity CustomDomainVerificationFailureInfo { get; } + /// <code>true</code> if there is a conflict on a scale unit; otherwise, <code>false</code>. + public bool? HasConflictOnScaleUnit { get; } + /// <code>true</code> if there is a conflict across subscriptions; otherwise, <code>false</code>. + public bool? HasConflictAcrossSubscription { get; } + /// Name of the conflicting app on scale unit if it's within the same subscription. + public string ConflictingAppResourceId { get; } + /// CName records controller can see for this hostname. + public IList CNameRecords { get; } + /// TXT records controller can see for this hostname. + public IList TxtRecords { get; } + /// A records controller can see for this hostname. + public IList ARecords { get; } + /// Alternate CName records controller can see for this hostname. + public IList AlternateCNameRecords { get; } + /// Alternate TXT records controller can see for this hostname. + public IList AlternateTxtRecords { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.Serialization.cs new file mode 100644 index 000000000000..d3caa8d88bfe --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class CustomOpenIdConnectProvider : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Registration)) + { + writer.WritePropertyName("registration"); + writer.WriteObjectValue(Registration); + } + if (Optional.IsDefined(Login)) + { + writer.WritePropertyName("login"); + writer.WriteObjectValue(Login); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static CustomOpenIdConnectProvider DeserializeCustomOpenIdConnectProvider(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional registration = default; + Optional login = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("registration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + registration = OpenIdConnectRegistration.DeserializeOpenIdConnectRegistration(property0.Value); + continue; + } + if (property0.NameEquals("login")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + login = OpenIdConnectLogin.DeserializeOpenIdConnectLogin(property0.Value); + continue; + } + } + continue; + } + } + return new CustomOpenIdConnectProvider(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, login.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.cs index c6bcf20e8429..c4fd38bc6640 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.cs @@ -1,68 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the custom Open ID Connect provider. public partial class CustomOpenIdConnectProvider : ProxyOnlyResource { - /// - /// Initializes a new instance of the CustomOpenIdConnectProvider - /// class. - /// + /// Initializes a new instance of CustomOpenIdConnectProvider. public CustomOpenIdConnectProvider() { - CustomInit(); } - /// - /// Initializes a new instance of the CustomOpenIdConnectProvider - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public CustomOpenIdConnectProvider(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), OpenIdConnectRegistration registration = default(OpenIdConnectRegistration), OpenIdConnectLogin login = default(OpenIdConnectLogin)) - : base(id, name, kind, type) + /// Initializes a new instance of CustomOpenIdConnectProvider. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the custom Open ID provider provider should not be enabled; otherwise, <code>true</code>. + /// The configuration settings of the app registration for the custom Open ID Connect provider. + /// The configuration settings of the login flow of the custom Open ID Connect provider. + internal CustomOpenIdConnectProvider(string id, string name, string kind, string type, bool? enabled, OpenIdConnectRegistration registration, OpenIdConnectLogin login) : base(id, name, kind, type) { Enabled = enabled; Registration = registration; Login = login; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// <code>false</code> if the custom Open ID provider provider should not be enabled; otherwise, <code>true</code>. public bool? Enabled { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.registration")] + /// The configuration settings of the app registration for the custom Open ID Connect provider. public OpenIdConnectRegistration Registration { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.login")] + /// The configuration settings of the login flow of the custom Open ID Connect provider. public OpenIdConnectLogin Login { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.Serialization.cs new file mode 100644 index 000000000000..afa42df1a4c1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.Serialization.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DataProviderMetadata : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ProviderName)) + { + writer.WritePropertyName("providerName"); + writer.WriteStringValue(ProviderName); + } + writer.WriteEndObject(); + } + + internal static DataProviderMetadata DeserializeDataProviderMetadata(JsonElement element) + { + Optional providerName = default; + Optional> propertyBag = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("providerName")) + { + providerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("propertyBag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(KeyValuePairStringObject.DeserializeKeyValuePairStringObject(item)); + } + propertyBag = array; + continue; + } + } + return new DataProviderMetadata(providerName.Value, Optional.ToList(propertyBag)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs new file mode 100644 index 000000000000..f10919caebe1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Additional configuration for a data providers. + public partial class DataProviderMetadata + { + /// Initializes a new instance of DataProviderMetadata. + public DataProviderMetadata() + { + PropertyBag = new ChangeTrackingList(); + } + + /// Initializes a new instance of DataProviderMetadata. + /// . + /// Settings for the data provider. + internal DataProviderMetadata(string providerName, IReadOnlyList propertyBag) + { + ProviderName = providerName; + PropertyBag = propertyBag; + } + + public string ProviderName { get; set; } + /// Settings for the data provider. + public IReadOnlyList PropertyBag { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.Serialization.cs new file mode 100644 index 000000000000..7f3d5e7453d2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.Serialization.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DataSource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Instructions)) + { + writer.WritePropertyName("instructions"); + writer.WriteStartArray(); + foreach (var item in Instructions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(DataSourceUri)) + { + writer.WritePropertyName("dataSourceUri"); + writer.WriteStartArray(); + foreach (var item in DataSourceUri) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static DataSource DeserializeDataSource(JsonElement element) + { + Optional> instructions = default; + Optional> dataSourceUri = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instructions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + instructions = array; + continue; + } + if (property.NameEquals("dataSourceUri")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePair.DeserializeNameValuePair(item)); + } + dataSourceUri = array; + continue; + } + } + return new DataSource(Optional.ToList(instructions), Optional.ToList(dataSourceUri)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.cs index 8b2f0198c7a7..f26b3aa56c51 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.cs @@ -1,62 +1,37 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Class representing data source used by the detectors - /// + /// Class representing data source used by the detectors. public partial class DataSource { - /// - /// Initializes a new instance of the DataSource class. - /// + /// Initializes a new instance of DataSource. public DataSource() { - CustomInit(); + Instructions = new ChangeTrackingList(); + DataSourceUri = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the DataSource class. - /// - /// Instructions if any for the data - /// source - /// Datasource Uri Links - public DataSource(IList instructions = default(IList), IList dataSourceUri = default(IList)) + /// Initializes a new instance of DataSource. + /// Instructions if any for the data source. + /// Datasource Uri Links. + internal DataSource(IList instructions, IList dataSourceUri) { Instructions = instructions; DataSourceUri = dataSourceUri; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets instructions if any for the data source - /// - [JsonProperty(PropertyName = "instructions")] - public IList Instructions { get; set; } - - /// - /// Gets or sets datasource Uri Links - /// - [JsonProperty(PropertyName = "dataSourceUri")] - public IList DataSourceUri { get; set; } - + /// Instructions if any for the data source. + public IList Instructions { get; } + /// Datasource Uri Links. + public IList DataSourceUri { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.Serialization.cs new file mode 100644 index 000000000000..bef2d52223cb --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DataTableResponseColumn : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ColumnName)) + { + writer.WritePropertyName("columnName"); + writer.WriteStringValue(ColumnName); + } + if (Optional.IsDefined(DataType)) + { + writer.WritePropertyName("dataType"); + writer.WriteStringValue(DataType); + } + if (Optional.IsDefined(ColumnType)) + { + writer.WritePropertyName("columnType"); + writer.WriteStringValue(ColumnType); + } + writer.WriteEndObject(); + } + + internal static DataTableResponseColumn DeserializeDataTableResponseColumn(JsonElement element) + { + Optional columnName = default; + Optional dataType = default; + Optional columnType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("columnName")) + { + columnName = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataType")) + { + dataType = property.Value.GetString(); + continue; + } + if (property.NameEquals("columnType")) + { + columnType = property.Value.GetString(); + continue; + } + } + return new DataTableResponseColumn(columnName.Value, dataType.Value, columnType.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.cs index ecc4760a549b..86d269daa3e0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.cs @@ -1,68 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Column definition - /// + /// Column definition. public partial class DataTableResponseColumn { - /// - /// Initializes a new instance of the DataTableResponseColumn class. - /// + /// Initializes a new instance of DataTableResponseColumn. public DataTableResponseColumn() { - CustomInit(); } - /// - /// Initializes a new instance of the DataTableResponseColumn class. - /// - /// Name of the column - /// Data type which looks like 'String' or - /// 'Int32'. - /// Column Type - public DataTableResponseColumn(string columnName = default(string), string dataType = default(string), string columnType = default(string)) + /// Initializes a new instance of DataTableResponseColumn. + /// Name of the column. + /// Data type which looks like 'String' or 'Int32'. + /// Column Type. + internal DataTableResponseColumn(string columnName, string dataType, string columnType) { ColumnName = columnName; DataType = dataType; ColumnType = columnType; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the column - /// - [JsonProperty(PropertyName = "columnName")] + /// Name of the column. public string ColumnName { get; set; } - - /// - /// Gets or sets data type which looks like 'String' or 'Int32'. - /// - [JsonProperty(PropertyName = "dataType")] + /// Data type which looks like 'String' or 'Int32'. public string DataType { get; set; } - - /// - /// Gets or sets column Type - /// - [JsonProperty(PropertyName = "columnType")] + /// Column Type. public string ColumnType { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.Serialization.cs new file mode 100644 index 000000000000..16b8f9f8bd91 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.Serialization.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DataTableResponseObject : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(TableName)) + { + writer.WritePropertyName("tableName"); + writer.WriteStringValue(TableName); + } + if (Optional.IsCollectionDefined(Columns)) + { + writer.WritePropertyName("columns"); + writer.WriteStartArray(); + foreach (var item in Columns) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Rows)) + { + writer.WritePropertyName("rows"); + writer.WriteStartArray(); + foreach (var item in Rows) + { + writer.WriteStartArray(); + foreach (var item0 in item) + { + writer.WriteStringValue(item0); + } + writer.WriteEndArray(); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static DataTableResponseObject DeserializeDataTableResponseObject(JsonElement element) + { + Optional tableName = default; + Optional> columns = default; + Optional>> rows = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tableName")) + { + tableName = property.Value.GetString(); + continue; + } + if (property.NameEquals("columns")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataTableResponseColumn.DeserializeDataTableResponseColumn(item)); + } + columns = array; + continue; + } + if (property.NameEquals("rows")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List> array = new List>(); + foreach (var item in property.Value.EnumerateArray()) + { + List array0 = new List(); + foreach (var item0 in item.EnumerateArray()) + { + array0.Add(item0.GetString()); + } + array.Add(array0); + } + rows = array; + continue; + } + } + return new DataTableResponseObject(tableName.Value, Optional.ToList(columns), Optional.ToList(rows)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.cs index 685a53bb99b9..40294e694220 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.cs @@ -1,69 +1,41 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Data Table which defines columns and raw row values - /// + /// Data Table which defines columns and raw row values. public partial class DataTableResponseObject { - /// - /// Initializes a new instance of the DataTableResponseObject class. - /// + /// Initializes a new instance of DataTableResponseObject. public DataTableResponseObject() { - CustomInit(); + Columns = new ChangeTrackingList(); + Rows = new ChangeTrackingList>(); } - /// - /// Initializes a new instance of the DataTableResponseObject class. - /// - /// Name of the table - /// List of columns with data types - /// Raw row values - public DataTableResponseObject(string tableName = default(string), IList columns = default(IList), IList> rows = default(IList>)) + /// Initializes a new instance of DataTableResponseObject. + /// Name of the table. + /// List of columns with data types. + /// Raw row values. + internal DataTableResponseObject(string tableName, IList columns, IList> rows) { TableName = tableName; Columns = columns; Rows = rows; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the table - /// - [JsonProperty(PropertyName = "tableName")] + /// Name of the table. public string TableName { get; set; } - - /// - /// Gets or sets list of columns with data types - /// - [JsonProperty(PropertyName = "columns")] - public IList Columns { get; set; } - - /// - /// Gets or sets raw row values - /// - [JsonProperty(PropertyName = "rows")] - public IList> Rows { get; set; } - + /// List of columns with data types. + public IList Columns { get; } + /// Raw row values. + public IList> Rows { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.Serialization.cs new file mode 100644 index 000000000000..45754457ff6d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.Serialization.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DatabaseBackupSetting : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("databaseType"); + writer.WriteStringValue(DatabaseType.ToString()); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(ConnectionStringName)) + { + writer.WritePropertyName("connectionStringName"); + writer.WriteStringValue(ConnectionStringName); + } + if (Optional.IsDefined(ConnectionString)) + { + writer.WritePropertyName("connectionString"); + writer.WriteStringValue(ConnectionString); + } + writer.WriteEndObject(); + } + + internal static DatabaseBackupSetting DeserializeDatabaseBackupSetting(JsonElement element) + { + DatabaseType databaseType = default; + Optional name = default; + Optional connectionStringName = default; + Optional connectionString = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("databaseType")) + { + databaseType = new DatabaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("connectionStringName")) + { + connectionStringName = property.Value.GetString(); + continue; + } + if (property.NameEquals("connectionString")) + { + connectionString = property.Value.GetString(); + continue; + } + } + return new DatabaseBackupSetting(databaseType, name.Value, connectionStringName.Value, connectionString.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.cs index d8bd1344a233..a5506476e3a1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.cs @@ -1,101 +1,47 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Database backup settings. - /// + /// Database backup settings. public partial class DatabaseBackupSetting { - /// - /// Initializes a new instance of the DatabaseBackupSetting class. - /// - public DatabaseBackupSetting() + /// Initializes a new instance of DatabaseBackupSetting. + /// Database type (e.g. SqlAzure / MySql). + public DatabaseBackupSetting(DatabaseType databaseType) { - CustomInit(); + DatabaseType = databaseType; } - /// - /// Initializes a new instance of the DatabaseBackupSetting class. - /// - /// Database type (e.g. SqlAzure / MySql). - /// Possible values include: 'SqlAzure', 'MySql', 'LocalMySql', - /// 'PostgreSql' - /// Contains a connection string - /// name that is linked to the SiteConfig.ConnectionStrings. - /// This is used during restore with overwrite connection strings - /// options. - /// Contains a connection string to a - /// database which is being backed up or restored. If the restore - /// should happen to a new database, the database name inside is the - /// new one. - public DatabaseBackupSetting(string databaseType, string name = default(string), string connectionStringName = default(string), string connectionString = default(string)) + /// Initializes a new instance of DatabaseBackupSetting. + /// Database type (e.g. SqlAzure / MySql). + /// . + /// + /// Contains a connection string name that is linked to the SiteConfig.ConnectionStrings. + /// This is used during restore with overwrite connection strings options. + /// + /// Contains a connection string to a database which is being backed up or restored. If the restore should happen to a new database, the database name inside is the new one. + internal DatabaseBackupSetting(DatabaseType databaseType, string name, string connectionStringName, string connectionString) { DatabaseType = databaseType; Name = name; ConnectionStringName = connectionStringName; ConnectionString = connectionString; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets database type (e.g. SqlAzure / MySql). Possible values - /// include: 'SqlAzure', 'MySql', 'LocalMySql', 'PostgreSql' - /// - [JsonProperty(PropertyName = "databaseType")] - public string DatabaseType { get; set; } - - /// - /// - [JsonProperty(PropertyName = "name")] + /// Database type (e.g. SqlAzure / MySql). + public DatabaseType DatabaseType { get; set; } public string Name { get; set; } - /// - /// Gets or sets contains a connection string name that is linked to - /// the SiteConfig.ConnectionStrings. - /// This is used during restore with overwrite connection strings - /// options. + /// Contains a connection string name that is linked to the SiteConfig.ConnectionStrings. + /// This is used during restore with overwrite connection strings options. /// - [JsonProperty(PropertyName = "connectionStringName")] public string ConnectionStringName { get; set; } - - /// - /// Gets or sets contains a connection string to a database which is - /// being backed up or restored. If the restore should happen to a new - /// database, the database name inside is the new one. - /// - [JsonProperty(PropertyName = "connectionString")] + /// Contains a connection string to a database which is being backed up or restored. If the restore should happen to a new database, the database name inside is the new one. public string ConnectionString { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DatabaseType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DatabaseType"); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseType.cs index ee4f92916ee0..445526091c66 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseType.cs @@ -1,24 +1,57 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for DatabaseType. - /// - public static class DatabaseType + /// Database type (e.g. SqlAzure / MySql). + public readonly partial struct DatabaseType : IEquatable { - public const string SqlAzure = "SqlAzure"; - public const string MySql = "MySql"; - public const string LocalMySql = "LocalMySql"; - public const string PostgreSql = "PostgreSql"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public DatabaseType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SqlAzureValue = "SqlAzure"; + private const string MySqlValue = "MySql"; + private const string LocalMySqlValue = "LocalMySql"; + private const string PostgreSqlValue = "PostgreSql"; + + /// SqlAzure. + public static DatabaseType SqlAzure { get; } = new DatabaseType(SqlAzureValue); + /// MySql. + public static DatabaseType MySql { get; } = new DatabaseType(MySqlValue); + /// LocalMySql. + public static DatabaseType LocalMySql { get; } = new DatabaseType(LocalMySqlValue); + /// PostgreSql. + public static DatabaseType PostgreSql { get; } = new DatabaseType(PostgreSqlValue); + /// Determines if two values are the same. + public static bool operator ==(DatabaseType left, DatabaseType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DatabaseType left, DatabaseType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DatabaseType(string value) => new DatabaseType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DatabaseType other && Equals(other); + /// + public bool Equals(DatabaseType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.Serialization.cs new file mode 100644 index 000000000000..90a436a6edae --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Xml.Linq; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class DefaultErrorResponse + { + internal static DefaultErrorResponse DeserializeDefaultErrorResponse(JsonElement element) + { + Optional error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + error = DefaultErrorResponseError.DeserializeDefaultErrorResponseError(property.Value); + continue; + } + } + return new DefaultErrorResponse(error.Value); + } + + internal static DefaultErrorResponse DeserializeDefaultErrorResponse(XElement element) + { + DefaultErrorResponseError error = default; + if (element.Element("error") is XElement errorElement) + { + error = DefaultErrorResponseError.DeserializeDefaultErrorResponseError(errorElement); + } + return new DefaultErrorResponse(error); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.cs index f70bb4e938fa..ded42ee88475 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.cs @@ -1,51 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// App Service error response. - /// - public partial class DefaultErrorResponse + /// App Service error response. + internal partial class DefaultErrorResponse { - /// - /// Initializes a new instance of the DefaultErrorResponse class. - /// - public DefaultErrorResponse() + /// Initializes a new instance of DefaultErrorResponse. + internal DefaultErrorResponse() { - CustomInit(); } - /// - /// Initializes a new instance of the DefaultErrorResponse class. - /// - /// Error model. - public DefaultErrorResponse(DefaultErrorResponseError error = default(DefaultErrorResponseError)) + /// Initializes a new instance of DefaultErrorResponse. + /// Error model. + internal DefaultErrorResponse(DefaultErrorResponseError error) { Error = error; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets error model. - /// - [JsonProperty(PropertyName = "error")] - public DefaultErrorResponseError Error { get; private set; } - + /// Error model. + public DefaultErrorResponseError Error { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.Serialization.cs new file mode 100644 index 000000000000..2f2fbef30c55 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.Serialization.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using System.Xml.Linq; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class DefaultErrorResponseError + { + internal static DefaultErrorResponseError DeserializeDefaultErrorResponseError(JsonElement element) + { + Optional code = default; + Optional message = default; + Optional target = default; + Optional> details = default; + Optional innererror = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code")) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("target")) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("details")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DefaultErrorResponseErrorDetailsItem.DeserializeDefaultErrorResponseErrorDetailsItem(item)); + } + details = array; + continue; + } + if (property.NameEquals("innererror")) + { + innererror = property.Value.GetString(); + continue; + } + } + return new DefaultErrorResponseError(code.Value, message.Value, target.Value, Optional.ToList(details), innererror.Value); + } + + internal static DefaultErrorResponseError DeserializeDefaultErrorResponseError(XElement element) + { + string code = default; + string message = default; + string target = default; + string innererror = default; + IReadOnlyList details = default; + if (element.Element("code") is XElement codeElement) + { + code = (string)codeElement; + } + if (element.Element("message") is XElement messageElement) + { + message = (string)messageElement; + } + if (element.Element("target") is XElement targetElement) + { + target = (string)targetElement; + } + if (element.Element("innererror") is XElement innererrorElement) + { + innererror = (string)innererrorElement; + } + var array = new List(); + foreach (var e in element.Elements("DefaultErrorResponseErrorDetailsItem")) + { + array.Add(DefaultErrorResponseErrorDetailsItem.DeserializeDefaultErrorResponseErrorDetailsItem(e)); + } + details = array; + return new DefaultErrorResponseError(code, message, target, details, innererror); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.cs index 3c389512860f..d13212bfb1f8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.cs @@ -1,86 +1,47 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Error model. - /// - public partial class DefaultErrorResponseError + /// Error model. + internal partial class DefaultErrorResponseError { - /// - /// Initializes a new instance of the DefaultErrorResponseError class. - /// - public DefaultErrorResponseError() + /// Initializes a new instance of DefaultErrorResponseError. + internal DefaultErrorResponseError() { - CustomInit(); + Details = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the DefaultErrorResponseError class. - /// - /// Standardized string to programmatically identify - /// the error. - /// Detailed error description and debugging - /// information. - /// Detailed error description and debugging - /// information. - /// More information to debug error. - public DefaultErrorResponseError(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), string innererror = default(string)) + /// Initializes a new instance of DefaultErrorResponseError. + /// Standardized string to programmatically identify the error. + /// Detailed error description and debugging information. + /// Detailed error description and debugging information. + /// . + /// More information to debug error. + internal DefaultErrorResponseError(string code, string message, string target, IReadOnlyList details, string innererror) { Code = code; Message = message; Target = target; Details = details; Innererror = innererror; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets standardized string to programmatically identify the error. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } - - /// - /// Gets detailed error description and debugging information. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets detailed error description and debugging information. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } - - /// - /// Gets more information to debug error. - /// - [JsonProperty(PropertyName = "innererror")] - public string Innererror { get; private set; } - + /// Standardized string to programmatically identify the error. + public string Code { get; } + /// Detailed error description and debugging information. + public string Message { get; } + /// Detailed error description and debugging information. + public string Target { get; } + public IReadOnlyList Details { get; } + /// More information to debug error. + public string Innererror { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs new file mode 100644 index 000000000000..f31311c626ee --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Xml.Linq; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class DefaultErrorResponseErrorDetailsItem + { + internal static DefaultErrorResponseErrorDetailsItem DeserializeDefaultErrorResponseErrorDetailsItem(JsonElement element) + { + Optional code = default; + Optional message = default; + Optional target = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code")) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("target")) + { + target = property.Value.GetString(); + continue; + } + } + return new DefaultErrorResponseErrorDetailsItem(code.Value, message.Value, target.Value); + } + + internal static DefaultErrorResponseErrorDetailsItem DeserializeDefaultErrorResponseErrorDetailsItem(XElement element) + { + string code = default; + string message = default; + string target = default; + if (element.Element("code") is XElement codeElement) + { + code = (string)codeElement; + } + if (element.Element("message") is XElement messageElement) + { + message = (string)messageElement; + } + if (element.Element("target") is XElement targetElement) + { + target = (string)targetElement; + } + return new DefaultErrorResponseErrorDetailsItem(code, message, target); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs index 5a4b118818cc..8fcc9656c2fb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs @@ -1,72 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Detailed errors. - /// - public partial class DefaultErrorResponseErrorDetailsItem + /// Detailed errors. + internal partial class DefaultErrorResponseErrorDetailsItem { - /// - /// Initializes a new instance of the - /// DefaultErrorResponseErrorDetailsItem class. - /// - public DefaultErrorResponseErrorDetailsItem() + /// Initializes a new instance of DefaultErrorResponseErrorDetailsItem. + internal DefaultErrorResponseErrorDetailsItem() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// DefaultErrorResponseErrorDetailsItem class. - /// - /// Standardized string to programmatically identify - /// the error. - /// Detailed error description and debugging - /// information. - /// Detailed error description and debugging - /// information. - public DefaultErrorResponseErrorDetailsItem(string code = default(string), string message = default(string), string target = default(string)) + /// Initializes a new instance of DefaultErrorResponseErrorDetailsItem. + /// Standardized string to programmatically identify the error. + /// Detailed error description and debugging information. + /// Detailed error description and debugging information. + internal DefaultErrorResponseErrorDetailsItem(string code, string message, string target) { Code = code; Message = message; Target = target; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets standardized string to programmatically identify the error. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } - - /// - /// Gets detailed error description and debugging information. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets detailed error description and debugging information. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; private set; } - + /// Standardized string to programmatically identify the error. + public string Code { get; } + /// Detailed error description and debugging information. + public string Message { get; } + /// Detailed error description and debugging information. + public string Target { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.Serialization.cs new file mode 100644 index 000000000000..0d5a91c81a0d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.Serialization.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DeletedAppRestoreRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(DeletedSiteId)) + { + writer.WritePropertyName("deletedSiteId"); + writer.WriteStringValue(DeletedSiteId); + } + if (Optional.IsDefined(RecoverConfiguration)) + { + writer.WritePropertyName("recoverConfiguration"); + writer.WriteBooleanValue(RecoverConfiguration.Value); + } + if (Optional.IsDefined(SnapshotTime)) + { + writer.WritePropertyName("snapshotTime"); + writer.WriteStringValue(SnapshotTime); + } + if (Optional.IsDefined(UseDRSecondary)) + { + writer.WritePropertyName("useDRSecondary"); + writer.WriteBooleanValue(UseDRSecondary.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static DeletedAppRestoreRequest DeserializeDeletedAppRestoreRequest(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional deletedSiteId = default; + Optional recoverConfiguration = default; + Optional snapshotTime = default; + Optional useDRSecondary = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("deletedSiteId")) + { + deletedSiteId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("recoverConfiguration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + recoverConfiguration = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("snapshotTime")) + { + snapshotTime = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("useDRSecondary")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + useDRSecondary = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new DeletedAppRestoreRequest(id.Value, name.Value, kind.Value, type.Value, deletedSiteId.Value, Optional.ToNullable(recoverConfiguration), snapshotTime.Value, Optional.ToNullable(useDRSecondary)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.cs index 347a22b2abf2..fdc6172cf3e1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.cs @@ -1,95 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Details about restoring a deleted app. - /// - [Rest.Serialization.JsonTransformation] + /// Details about restoring a deleted app. public partial class DeletedAppRestoreRequest : ProxyOnlyResource { - /// - /// Initializes a new instance of the DeletedAppRestoreRequest class. - /// + /// Initializes a new instance of DeletedAppRestoreRequest. public DeletedAppRestoreRequest() { - CustomInit(); } - /// - /// Initializes a new instance of the DeletedAppRestoreRequest class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// ARM resource ID of the deleted app. - /// Example: - /// /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} - /// If true, deleted site - /// configuration, in addition to content, will be restored. - /// Point in time to restore the deleted app - /// from, formatted as a DateTime string. - /// If unspecified, default value is the time that the app was - /// deleted. - /// If true, the snapshot is retrieved - /// from DRSecondary endpoint. - public DeletedAppRestoreRequest(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string deletedSiteId = default(string), bool? recoverConfiguration = default(bool?), string snapshotTime = default(string), bool? useDRSecondary = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of DeletedAppRestoreRequest. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// + /// ARM resource ID of the deleted app. Example: + /// /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. + /// + /// If true, deleted site configuration, in addition to content, will be restored. + /// + /// Point in time to restore the deleted app from, formatted as a DateTime string. + /// If unspecified, default value is the time that the app was deleted. + /// + /// If true, the snapshot is retrieved from DRSecondary endpoint. + internal DeletedAppRestoreRequest(string id, string name, string kind, string type, string deletedSiteId, bool? recoverConfiguration, string snapshotTime, bool? useDRSecondary) : base(id, name, kind, type) { DeletedSiteId = deletedSiteId; RecoverConfiguration = recoverConfiguration; SnapshotTime = snapshotTime; UseDRSecondary = useDRSecondary; - CustomInit(); } /// - /// An initialization method that performs custom operations like setting defaults + /// ARM resource ID of the deleted app. Example: + /// /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. /// - partial void CustomInit(); - - /// - /// Gets or sets ARM resource ID of the deleted app. Example: - /// /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} - /// - [JsonProperty(PropertyName = "properties.deletedSiteId")] public string DeletedSiteId { get; set; } - - /// - /// Gets or sets if true, deleted site configuration, in addition to - /// content, will be restored. - /// - [JsonProperty(PropertyName = "properties.recoverConfiguration")] + /// If true, deleted site configuration, in addition to content, will be restored. public bool? RecoverConfiguration { get; set; } - /// - /// Gets or sets point in time to restore the deleted app from, - /// formatted as a DateTime string. + /// Point in time to restore the deleted app from, formatted as a DateTime string. /// If unspecified, default value is the time that the app was deleted. /// - [JsonProperty(PropertyName = "properties.snapshotTime")] public string SnapshotTime { get; set; } - - /// - /// Gets or sets if true, the snapshot is retrieved from DRSecondary - /// endpoint. - /// - [JsonProperty(PropertyName = "properties.useDRSecondary")] + /// If true, the snapshot is retrieved from DRSecondary endpoint. public bool? UseDRSecondary { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.Serialization.cs new file mode 100644 index 000000000000..96271c0f4a7f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DeletedSite : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static DeletedSite DeserializeDeletedSite(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional deletedSiteId = default; + Optional deletedTimestamp = default; + Optional subscription = default; + Optional resourceGroup = default; + Optional deletedSiteName = default; + Optional slot = default; + Optional kind0 = default; + Optional geoRegionName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("deletedSiteId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + deletedSiteId = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("deletedTimestamp")) + { + deletedTimestamp = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("subscription")) + { + subscription = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("resourceGroup")) + { + resourceGroup = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("deletedSiteName")) + { + deletedSiteName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("slot")) + { + slot = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("kind")) + { + kind0 = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("geoRegionName")) + { + geoRegionName = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new DeletedSite(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(deletedSiteId), deletedTimestamp.Value, subscription.Value, resourceGroup.Value, deletedSiteName.Value, slot.Value, kind0.Value, geoRegionName.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.cs index 565a9b6b34d0..130e51a84016 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.cs @@ -1,54 +1,34 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A deleted app. - /// - [Rest.Serialization.JsonTransformation] + /// A deleted app. public partial class DeletedSite : ProxyOnlyResource { - /// - /// Initializes a new instance of the DeletedSite class. - /// + /// Initializes a new instance of DeletedSite. public DeletedSite() { - CustomInit(); } - /// - /// Initializes a new instance of the DeletedSite class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Numeric id for the deleted site - /// Time in UTC when the app was - /// deleted. - /// Subscription containing the deleted - /// site - /// ResourceGroup that contained the - /// deleted site - /// Name of the deleted site - /// Slot of the deleted site - /// Kind of site that was deleted - /// Geo Region of the deleted site - public DeletedSite(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? deletedSiteId = default(int?), string deletedTimestamp = default(string), string subscription = default(string), string resourceGroup = default(string), string deletedSiteName = default(string), string slot = default(string), string deletedSiteKind = default(string), string geoRegionName = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of DeletedSite. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Numeric id for the deleted site. + /// Time in UTC when the app was deleted. + /// Subscription containing the deleted site. + /// ResourceGroup that contained the deleted site. + /// Name of the deleted site. + /// Slot of the deleted site. + /// Kind of site that was deleted. + /// Geo Region of the deleted site. + internal DeletedSite(string id, string name, string kind, string type, int? deletedSiteId, string deletedTimestamp, string subscription, string resourceGroup, string deletedSiteName, string slot, string kindPropertiesKind, string geoRegionName) : base(id, name, kind, type) { DeletedSiteId = deletedSiteId; DeletedTimestamp = deletedTimestamp; @@ -56,63 +36,25 @@ public DeletedSite() ResourceGroup = resourceGroup; DeletedSiteName = deletedSiteName; Slot = slot; - DeletedSiteKind = deletedSiteKind; + KindPropertiesKind = kindPropertiesKind; GeoRegionName = geoRegionName; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets numeric id for the deleted site - /// - [JsonProperty(PropertyName = "properties.deletedSiteId")] - public int? DeletedSiteId { get; private set; } - - /// - /// Gets time in UTC when the app was deleted. - /// - [JsonProperty(PropertyName = "properties.deletedTimestamp")] - public string DeletedTimestamp { get; private set; } - - /// - /// Gets subscription containing the deleted site - /// - [JsonProperty(PropertyName = "properties.subscription")] - public string Subscription { get; private set; } - - /// - /// Gets resourceGroup that contained the deleted site - /// - [JsonProperty(PropertyName = "properties.resourceGroup")] - public string ResourceGroup { get; private set; } - - /// - /// Gets name of the deleted site - /// - [JsonProperty(PropertyName = "properties.deletedSiteName")] - public string DeletedSiteName { get; private set; } - - /// - /// Gets slot of the deleted site - /// - [JsonProperty(PropertyName = "properties.slot")] - public string Slot { get; private set; } - - /// - /// Gets kind of site that was deleted - /// - [JsonProperty(PropertyName = "properties.kind")] - public string DeletedSiteKind { get; private set; } - - /// - /// Gets geo Region of the deleted site - /// - [JsonProperty(PropertyName = "properties.geoRegionName")] - public string GeoRegionName { get; private set; } - + /// Numeric id for the deleted site. + public int? DeletedSiteId { get; } + /// Time in UTC when the app was deleted. + public string DeletedTimestamp { get; } + /// Subscription containing the deleted site. + public string Subscription { get; } + /// ResourceGroup that contained the deleted site. + public string ResourceGroup { get; } + /// Name of the deleted site. + public string DeletedSiteName { get; } + /// Slot of the deleted site. + public string Slot { get; } + /// Kind of site that was deleted. + public string KindPropertiesKind { get; } + /// Geo Region of the deleted site. + public string GeoRegionName { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.Serialization.cs new file mode 100644 index 000000000000..01e8a18b926c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class DeletedWebAppCollection + { + internal static DeletedWebAppCollection DeserializeDeletedWebAppCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeletedSite.DeserializeDeletedSite(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new DeletedWebAppCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.cs new file mode 100644 index 000000000000..231fe96ddfb5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of deleted apps. + internal partial class DeletedWebAppCollection + { + /// Initializes a new instance of DeletedWebAppCollection. + /// Collection of resources. + /// is null. + internal DeletedWebAppCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of DeletedWebAppCollection. + /// Collection of resources. + /// Link to next page of resources. + internal DeletedWebAppCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.Serialization.cs new file mode 100644 index 000000000000..8c4e77d0cd5c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Deployment : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"); + writer.WriteNumberValue(Status.Value); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"); + writer.WriteStringValue(Message); + } + if (Optional.IsDefined(Author)) + { + writer.WritePropertyName("author"); + writer.WriteStringValue(Author); + } + if (Optional.IsDefined(Deployer)) + { + writer.WritePropertyName("deployer"); + writer.WriteStringValue(Deployer); + } + if (Optional.IsDefined(AuthorEmail)) + { + writer.WritePropertyName("author_email"); + writer.WriteStringValue(AuthorEmail); + } + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("start_time"); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("end_time"); + writer.WriteStringValue(EndTime.Value, "O"); + } + if (Optional.IsDefined(Active)) + { + writer.WritePropertyName("active"); + writer.WriteBooleanValue(Active.Value); + } + if (Optional.IsDefined(Details)) + { + writer.WritePropertyName("details"); + writer.WriteStringValue(Details); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Deployment DeserializeDeployment(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional status = default; + Optional message = default; + Optional author = default; + Optional deployer = default; + Optional authorEmail = default; + Optional startTime = default; + Optional endTime = default; + Optional active = default; + Optional details = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("message")) + { + message = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("author")) + { + author = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("deployer")) + { + deployer = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("author_email")) + { + authorEmail = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("start_time")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("end_time")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + endTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("active")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + active = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("details")) + { + details = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new Deployment(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(status), message.Value, author.Value, deployer.Value, authorEmail.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToNullable(active), details.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.cs index 9a88a578c6b1..0640c316065f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.cs @@ -1,53 +1,37 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// User credentials used for publishing activity. - /// - [Rest.Serialization.JsonTransformation] + /// User credentials used for publishing activity. public partial class Deployment : ProxyOnlyResource { - /// - /// Initializes a new instance of the Deployment class. - /// + /// Initializes a new instance of Deployment. public Deployment() { - CustomInit(); } - /// - /// Initializes a new instance of the Deployment class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Deployment status. - /// Details about deployment status. - /// Who authored the deployment. - /// Who performed the deployment. - /// Author email. - /// Start time. - /// End time. - /// True if deployment is currently active, false - /// if completed and null if not started. - /// Details on deployment. - public Deployment(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? status = default(int?), string message = default(string), string author = default(string), string deployer = default(string), string authorEmail = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), bool? active = default(bool?), string details = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of Deployment. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Deployment status. + /// Details about deployment status. + /// Who authored the deployment. + /// Who performed the deployment. + /// Author email. + /// Start time. + /// End time. + /// True if deployment is currently active, false if completed and null if not started. + /// Details on deployment. + internal Deployment(string id, string name, string kind, string type, int? status, string message, string author, string deployer, string authorEmail, DateTimeOffset? startTime, DateTimeOffset? endTime, bool? active, string details) : base(id, name, kind, type) { Status = status; Message = message; @@ -58,68 +42,25 @@ public Deployment() EndTime = endTime; Active = active; Details = details; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets deployment status. - /// - [JsonProperty(PropertyName = "properties.status")] + /// Deployment status. public int? Status { get; set; } - - /// - /// Gets or sets details about deployment status. - /// - [JsonProperty(PropertyName = "properties.message")] + /// Details about deployment status. public string Message { get; set; } - - /// - /// Gets or sets who authored the deployment. - /// - [JsonProperty(PropertyName = "properties.author")] + /// Who authored the deployment. public string Author { get; set; } - - /// - /// Gets or sets who performed the deployment. - /// - [JsonProperty(PropertyName = "properties.deployer")] + /// Who performed the deployment. public string Deployer { get; set; } - - /// - /// Gets or sets author email. - /// - [JsonProperty(PropertyName = "properties.author_email")] + /// Author email. public string AuthorEmail { get; set; } - - /// - /// Gets or sets start time. - /// - [JsonProperty(PropertyName = "properties.start_time")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets end time. - /// - [JsonProperty(PropertyName = "properties.end_time")] - public System.DateTime? EndTime { get; set; } - - /// - /// Gets or sets true if deployment is currently active, false if - /// completed and null if not started. - /// - [JsonProperty(PropertyName = "properties.active")] + /// Start time. + public DateTimeOffset? StartTime { get; set; } + /// End time. + public DateTimeOffset? EndTime { get; set; } + /// True if deployment is currently active, false if completed and null if not started. public bool? Active { get; set; } - - /// - /// Gets or sets details on deployment. - /// - [JsonProperty(PropertyName = "properties.details")] + /// Details on deployment. public string Details { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.Serialization.cs new file mode 100644 index 000000000000..eaf8dc14c1c5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class DeploymentCollection + { + internal static DeploymentCollection DeserializeDeploymentCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Deployment.DeserializeDeployment(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new DeploymentCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.cs new file mode 100644 index 000000000000..c698adcc69ef --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of app deployments. + internal partial class DeploymentCollection + { + /// Initializes a new instance of DeploymentCollection. + /// Collection of resources. + /// is null. + internal DeploymentCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of DeploymentCollection. + /// Collection of resources. + /// Link to next page of resources. + internal DeploymentCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.Serialization.cs new file mode 100644 index 000000000000..cb7581aed205 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.Serialization.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DeploymentLocations + { + internal static DeploymentLocations DeserializeDeploymentLocations(JsonElement element) + { + Optional> locations = default; + Optional> hostingEnvironments = default; + Optional> hostingEnvironmentDeploymentInfos = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("locations")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GeoRegion.DeserializeGeoRegion(item)); + } + locations = array; + continue; + } + if (property.NameEquals("hostingEnvironments")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AppServiceEnvironment.DeserializeAppServiceEnvironment(item)); + } + hostingEnvironments = array; + continue; + } + if (property.NameEquals("hostingEnvironmentDeploymentInfos")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HostingEnvironmentDeploymentInfo.DeserializeHostingEnvironmentDeploymentInfo(item)); + } + hostingEnvironmentDeploymentInfos = array; + continue; + } + } + return new DeploymentLocations(Optional.ToList(locations), Optional.ToList(hostingEnvironments), Optional.ToList(hostingEnvironmentDeploymentInfos)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.cs index a51e11fef786..ea7b8d8746ad 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.cs @@ -1,74 +1,45 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - /// /// List of available locations (regions or App Service Environments) for /// deployment of App Service resources. /// public partial class DeploymentLocations { - /// - /// Initializes a new instance of the DeploymentLocations class. - /// - public DeploymentLocations() + /// Initializes a new instance of DeploymentLocations. + internal DeploymentLocations() { - CustomInit(); + Locations = new ChangeTrackingList(); + HostingEnvironments = new ChangeTrackingList(); + HostingEnvironmentDeploymentInfos = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the DeploymentLocations class. - /// - /// Available regions. - /// Available App Service - /// Environments with full descriptions of the environments. - /// Available App - /// Service Environments with basic information. - public DeploymentLocations(IList locations = default(IList), IList hostingEnvironments = default(IList), IList hostingEnvironmentDeploymentInfos = default(IList)) + /// Initializes a new instance of DeploymentLocations. + /// Available regions. + /// Available App Service Environments with full descriptions of the environments. + /// Available App Service Environments with basic information. + internal DeploymentLocations(IReadOnlyList locations, IReadOnlyList hostingEnvironments, IReadOnlyList hostingEnvironmentDeploymentInfos) { Locations = locations; HostingEnvironments = hostingEnvironments; HostingEnvironmentDeploymentInfos = hostingEnvironmentDeploymentInfos; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets available regions. - /// - [JsonProperty(PropertyName = "locations")] - public IList Locations { get; set; } - - /// - /// Gets or sets available App Service Environments with full - /// descriptions of the environments. - /// - [JsonProperty(PropertyName = "hostingEnvironments")] - public IList HostingEnvironments { get; set; } - - /// - /// Gets or sets available App Service Environments with basic - /// information. - /// - [JsonProperty(PropertyName = "hostingEnvironmentDeploymentInfos")] - public IList HostingEnvironmentDeploymentInfos { get; set; } - + /// Available regions. + public IReadOnlyList Locations { get; } + /// Available App Service Environments with full descriptions of the environments. + public IReadOnlyList HostingEnvironments { get; } + /// Available App Service Environments with basic information. + public IReadOnlyList HostingEnvironmentDeploymentInfos { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.Serialization.cs new file mode 100644 index 000000000000..5ea23ccb7c0f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DetectorAbnormalTimePeriod : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("endTime"); + writer.WriteStringValue(EndTime.Value, "O"); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"); + writer.WriteStringValue(Message); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"); + writer.WriteStringValue(Source); + } + if (Optional.IsDefined(Priority)) + { + writer.WritePropertyName("priority"); + writer.WriteNumberValue(Priority.Value); + } + if (Optional.IsCollectionDefined(MetaData)) + { + writer.WritePropertyName("metaData"); + writer.WriteStartArray(); + foreach (var item in MetaData) + { + writer.WriteStartArray(); + foreach (var item0 in item) + { + writer.WriteObjectValue(item0); + } + writer.WriteEndArray(); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(Solutions)) + { + writer.WritePropertyName("solutions"); + writer.WriteStartArray(); + foreach (var item in Solutions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static DetectorAbnormalTimePeriod DeserializeDetectorAbnormalTimePeriod(JsonElement element) + { + Optional startTime = default; + Optional endTime = default; + Optional message = default; + Optional source = default; + Optional priority = default; + Optional>> metaData = default; + Optional type = default; + Optional> solutions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("source")) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("priority")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + priority = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("metaData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List> array = new List>(); + foreach (var item in property.Value.EnumerateArray()) + { + List array0 = new List(); + foreach (var item0 in item.EnumerateArray()) + { + array0.Add(NameValuePair.DeserializeNameValuePair(item0)); + } + array.Add(array0); + } + metaData = array; + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + type = property.Value.GetString().ToIssueType(); + continue; + } + if (property.NameEquals("solutions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Solution.DeserializeSolution(item)); + } + solutions = array; + continue; + } + } + return new DetectorAbnormalTimePeriod(Optional.ToNullable(startTime), Optional.ToNullable(endTime), message.Value, source.Value, Optional.ToNullable(priority), Optional.ToList(metaData), Optional.ToNullable(type), Optional.ToList(solutions)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.cs index f91fda4d5d63..a267ecebb168 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.cs @@ -1,48 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Class representing Abnormal Time Period detected. - /// + /// Class representing Abnormal Time Period detected. public partial class DetectorAbnormalTimePeriod { - /// - /// Initializes a new instance of the DetectorAbnormalTimePeriod class. - /// + /// Initializes a new instance of DetectorAbnormalTimePeriod. public DetectorAbnormalTimePeriod() { - CustomInit(); + MetaData = new ChangeTrackingList>(); + Solutions = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the DetectorAbnormalTimePeriod class. - /// - /// Start time of the correlated event - /// End time of the correlated event - /// Message describing the event - /// Represents the name of the Detector - /// Represents the rank of the Detector - /// Downtime metadata - /// Represents the type of the Detector. Possible - /// values include: 'ServiceIncident', 'AppDeployment', 'AppCrash', - /// 'RuntimeIssueDetected', 'AseDeployment', 'UserIssue', - /// 'PlatformIssue', 'Other' - /// List of proposed solutions - public DetectorAbnormalTimePeriod(System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string message = default(string), string source = default(string), double? priority = default(double?), IList> metaData = default(IList>), IssueType? type = default(IssueType?), IList solutions = default(IList)) + /// Initializes a new instance of DetectorAbnormalTimePeriod. + /// Start time of the correlated event. + /// End time of the correlated event. + /// Message describing the event. + /// Represents the name of the Detector. + /// Represents the rank of the Detector. + /// Downtime metadata. + /// Represents the type of the Detector. + /// List of proposed solutions. + internal DetectorAbnormalTimePeriod(DateTimeOffset? startTime, DateTimeOffset? endTime, string message, string source, double? priority, IList> metaData, IssueType? type, IList solutions) { StartTime = startTime; EndTime = endTime; @@ -52,64 +40,23 @@ public DetectorAbnormalTimePeriod() MetaData = metaData; Type = type; Solutions = solutions; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets start time of the correlated event - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets end time of the correlated event - /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; set; } - - /// - /// Gets or sets message describing the event - /// - [JsonProperty(PropertyName = "message")] + /// Start time of the correlated event. + public DateTimeOffset? StartTime { get; set; } + /// End time of the correlated event. + public DateTimeOffset? EndTime { get; set; } + /// Message describing the event. public string Message { get; set; } - - /// - /// Gets or sets represents the name of the Detector - /// - [JsonProperty(PropertyName = "source")] + /// Represents the name of the Detector. public string Source { get; set; } - - /// - /// Gets or sets represents the rank of the Detector - /// - [JsonProperty(PropertyName = "priority")] + /// Represents the rank of the Detector. public double? Priority { get; set; } - - /// - /// Gets or sets downtime metadata - /// - [JsonProperty(PropertyName = "metaData")] - public IList> MetaData { get; set; } - - /// - /// Gets or sets represents the type of the Detector. Possible values - /// include: 'ServiceIncident', 'AppDeployment', 'AppCrash', - /// 'RuntimeIssueDetected', 'AseDeployment', 'UserIssue', - /// 'PlatformIssue', 'Other' - /// - [JsonProperty(PropertyName = "type")] + /// Downtime metadata. + public IList> MetaData { get; } + /// Represents the type of the Detector. public IssueType? Type { get; set; } - - /// - /// Gets or sets list of proposed solutions - /// - [JsonProperty(PropertyName = "solutions")] - public IList Solutions { get; set; } - + /// List of proposed solutions. + public IList Solutions { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.Serialization.cs new file mode 100644 index 000000000000..2182373f002a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.Serialization.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DetectorDefinition : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static DetectorDefinition DeserializeDetectorDefinition(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional displayName = default; + Optional description = default; + Optional rank = default; + Optional isEnabled = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("displayName")) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("description")) + { + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("rank")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + rank = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("isEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isEnabled = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new DetectorDefinition(id.Value, name.Value, kind.Value, type.Value, displayName.Value, description.Value, Optional.ToNullable(rank), Optional.ToNullable(isEnabled)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.cs index bcccb400ddc8..f7d2781840f1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.cs @@ -1,84 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Class representing detector definition - /// - [Rest.Serialization.JsonTransformation] + /// Class representing detector definition. public partial class DetectorDefinition : ProxyOnlyResource { - /// - /// Initializes a new instance of the DetectorDefinition class. - /// + /// Initializes a new instance of DetectorDefinition. public DetectorDefinition() { - CustomInit(); } - /// - /// Initializes a new instance of the DetectorDefinition class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Display name of the detector - /// Description of the detector - /// Detector Rank - /// Flag representing whether detector is - /// enabled or not. - public DetectorDefinition(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string displayName = default(string), string description = default(string), double? rank = default(double?), bool? isEnabled = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of DetectorDefinition. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Display name of the detector. + /// Description of the detector. + /// Detector Rank. + /// Flag representing whether detector is enabled or not. + internal DetectorDefinition(string id, string name, string kind, string type, string displayName, string description, double? rank, bool? isEnabled) : base(id, name, kind, type) { DisplayName = displayName; Description = description; Rank = rank; IsEnabled = isEnabled; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets display name of the detector - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets description of the detector - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } - - /// - /// Gets detector Rank - /// - [JsonProperty(PropertyName = "properties.rank")] - public double? Rank { get; private set; } - - /// - /// Gets flag representing whether detector is enabled or not. - /// - [JsonProperty(PropertyName = "properties.isEnabled")] - public bool? IsEnabled { get; private set; } - + /// Display name of the detector. + public string DisplayName { get; } + /// Description of the detector. + public string Description { get; } + /// Detector Rank. + public double? Rank { get; } + /// Flag representing whether detector is enabled or not. + public bool? IsEnabled { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.Serialization.cs new file mode 100644 index 000000000000..3ebfcb140af3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.Serialization.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DetectorInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } + + internal static DetectorInfo DeserializeDetectorInfo(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional description = default; + Optional author = default; + Optional category = default; + Optional> supportTopicList = default; + Optional> analysisType = default; + Optional type = default; + Optional score = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("author")) + { + author = property.Value.GetString(); + continue; + } + if (property.NameEquals("category")) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportTopicList")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SupportTopic.DeserializeSupportTopic(item)); + } + supportTopicList = array; + continue; + } + if (property.NameEquals("analysisType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + analysisType = array; + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + type = property.Value.GetString().ToDetectorType(); + continue; + } + if (property.NameEquals("score")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + score = property.Value.GetSingle(); + continue; + } + } + return new DetectorInfo(id.Value, name.Value, description.Value, author.Value, category.Value, Optional.ToList(supportTopicList), Optional.ToList(analysisType), Optional.ToNullable(type), Optional.ToNullable(score)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs index 78af46d0f5c1..b31bdc4c640a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs @@ -1,76 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Definition of Detector - /// + /// Definition of Detector. public partial class DetectorInfo { - /// - /// Initializes a new instance of the DetectorInfo class. - /// + /// Initializes a new instance of DetectorInfo. public DetectorInfo() { - CustomInit(); + SupportTopicList = new ChangeTrackingList(); + AnalysisType = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the DetectorInfo class. - /// - /// Short description of the detector and its - /// purpose - /// Support Category - /// Support Sub Category - /// Support Topic Id - public DetectorInfo(string description = default(string), string category = default(string), string subCategory = default(string), string supportTopicId = default(string)) + /// Initializes a new instance of DetectorInfo. + /// Id of detector. + /// Name of detector. + /// Short description of the detector and its purpose. + /// Author of the detector. + /// Problem category. This serves for organizing group for detectors. + /// List of Support Topics for which this detector is enabled. + /// Analysis Types for which this detector should apply to. + /// Whether this detector is an Analysis Detector or not. + /// Defines score of a detector to power ML based matching. + internal DetectorInfo(string id, string name, string description, string author, string category, IReadOnlyList supportTopicList, IReadOnlyList analysisType, DetectorType? type, float? score) { + Id = id; + Name = name; Description = description; + Author = author; Category = category; - SubCategory = subCategory; - SupportTopicId = supportTopicId; - CustomInit(); + SupportTopicList = supportTopicList; + AnalysisType = analysisType; + Type = type; + Score = score; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets short description of the detector and its purpose - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; private set; } - - /// - /// Gets support Category - /// - [JsonProperty(PropertyName = "category")] - public string Category { get; private set; } - - /// - /// Gets support Sub Category - /// - [JsonProperty(PropertyName = "subCategory")] - public string SubCategory { get; private set; } - - /// - /// Gets support Topic Id - /// - [JsonProperty(PropertyName = "supportTopicId")] - public string SupportTopicId { get; private set; } - + /// Id of detector. + public string Id { get; } + /// Name of detector. + public string Name { get; } + /// Short description of the detector and its purpose. + public string Description { get; } + /// Author of the detector. + public string Author { get; } + /// Problem category. This serves for organizing group for detectors. + public string Category { get; } + /// List of Support Topics for which this detector is enabled. + public IReadOnlyList SupportTopicList { get; } + /// Analysis Types for which this detector should apply to. + public IReadOnlyList AnalysisType { get; } + /// Whether this detector is an Analysis Detector or not. + public DetectorType? Type { get; } + /// Defines score of a detector to power ML based matching. + public float? Score { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.Serialization.cs new file mode 100644 index 000000000000..d838f88fd13c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DetectorResponse : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Metadata)) + { + writer.WritePropertyName("metadata"); + writer.WriteObjectValue(Metadata); + } + if (Optional.IsCollectionDefined(Dataset)) + { + writer.WritePropertyName("dataset"); + writer.WriteStartArray(); + foreach (var item in Dataset) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"); + writer.WriteObjectValue(Status); + } + if (Optional.IsCollectionDefined(DataProvidersMetadata)) + { + writer.WritePropertyName("dataProvidersMetadata"); + writer.WriteStartArray(); + foreach (var item in DataProvidersMetadata) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(SuggestedUtterances)) + { + writer.WritePropertyName("suggestedUtterances"); + writer.WriteObjectValue(SuggestedUtterances); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static DetectorResponse DeserializeDetectorResponse(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional metadata = default; + Optional> dataset = default; + Optional status = default; + Optional> dataProvidersMetadata = default; + Optional suggestedUtterances = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("metadata")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + metadata = DetectorInfo.DeserializeDetectorInfo(property0.Value); + continue; + } + if (property0.NameEquals("dataset")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DiagnosticData.DeserializeDiagnosticData(item)); + } + dataset = array; + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = Status.DeserializeStatus(property0.Value); + continue; + } + if (property0.NameEquals("dataProvidersMetadata")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DataProviderMetadata.DeserializeDataProviderMetadata(item)); + } + dataProvidersMetadata = array; + continue; + } + if (property0.NameEquals("suggestedUtterances")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + suggestedUtterances = QueryUtterancesResults.DeserializeQueryUtterancesResults(property0.Value); + continue; + } + } + continue; + } + } + return new DetectorResponse(id.Value, name.Value, kind.Value, type.Value, metadata.Value, Optional.ToList(dataset), status.Value, Optional.ToList(dataProvidersMetadata), suggestedUtterances.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs index 853860a84c5c..3663ba200263 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs @@ -1,69 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Class representing Response from Detector - /// - [Rest.Serialization.JsonTransformation] + /// Class representing Response from Detector. public partial class DetectorResponse : ProxyOnlyResource { - /// - /// Initializes a new instance of the DetectorResponse class. - /// + /// Initializes a new instance of DetectorResponse. public DetectorResponse() { - CustomInit(); + Dataset = new ChangeTrackingList(); + DataProvidersMetadata = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the DetectorResponse class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// metadata for the detector - /// Data Set - public DetectorResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), DetectorInfo metadata = default(DetectorInfo), IList dataset = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of DetectorResponse. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// metadata for the detector. + /// Data Set. + /// Indicates status of the most severe insight. + /// Additional configuration for different data providers to be used by the UI. + /// Suggested utterances where the detector can be applicable. + internal DetectorResponse(string id, string name, string kind, string type, DetectorInfo metadata, IList dataset, Status status, IList dataProvidersMetadata, QueryUtterancesResults suggestedUtterances) : base(id, name, kind, type) { Metadata = metadata; Dataset = dataset; - CustomInit(); + Status = status; + DataProvidersMetadata = dataProvidersMetadata; + SuggestedUtterances = suggestedUtterances; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets metadata for the detector - /// - [JsonProperty(PropertyName = "properties.metadata")] + /// metadata for the detector. public DetectorInfo Metadata { get; set; } - - /// - /// Gets or sets data Set - /// - [JsonProperty(PropertyName = "properties.dataset")] - public IList Dataset { get; set; } - + /// Data Set. + public IList Dataset { get; } + /// Indicates status of the most severe insight. + public Status Status { get; set; } + /// Additional configuration for different data providers to be used by the UI. + public IList DataProvidersMetadata { get; } + /// Suggested utterances where the detector can be applicable. + public QueryUtterancesResults SuggestedUtterances { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.Serialization.cs new file mode 100644 index 000000000000..f0195e8b4148 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class DetectorResponseCollection + { + internal static DetectorResponseCollection DeserializeDetectorResponseCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DetectorResponse.DeserializeDetectorResponse(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new DetectorResponseCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.cs new file mode 100644 index 000000000000..cde9fd7d7869 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of detector responses. + internal partial class DetectorResponseCollection + { + /// Initializes a new instance of DetectorResponseCollection. + /// Collection of resources. + /// is null. + internal DetectorResponseCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of DetectorResponseCollection. + /// Collection of resources. + /// Link to next page of resources. + internal DetectorResponseCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.Serialization.cs new file mode 100644 index 000000000000..bdb355078c64 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class DetectorTypeExtensions + { + public static string ToSerialString(this DetectorType value) => value switch + { + DetectorType.Detector => "Detector", + DetectorType.Analysis => "Analysis", + DetectorType.CategoryOverview => "CategoryOverview", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DetectorType value.") + }; + + public static DetectorType ToDetectorType(this string value) + { + if (string.Equals(value, "Detector", StringComparison.InvariantCultureIgnoreCase)) return DetectorType.Detector; + if (string.Equals(value, "Analysis", StringComparison.InvariantCultureIgnoreCase)) return DetectorType.Analysis; + if (string.Equals(value, "CategoryOverview", StringComparison.InvariantCultureIgnoreCase)) return DetectorType.CategoryOverview; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DetectorType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs new file mode 100644 index 000000000000..223658e179f5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Whether this detector is an Analysis Detector or not. + public enum DetectorType + { + /// Detector. + Detector, + /// Analysis. + Analysis, + /// CategoryOverview. + CategoryOverview + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.Serialization.cs new file mode 100644 index 000000000000..3ce45d498fa1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DiagnosticAnalysis : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("endTime"); + writer.WriteStringValue(EndTime.Value, "O"); + } + if (Optional.IsCollectionDefined(AbnormalTimePeriods)) + { + writer.WritePropertyName("abnormalTimePeriods"); + writer.WriteStartArray(); + foreach (var item in AbnormalTimePeriods) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Payload)) + { + writer.WritePropertyName("payload"); + writer.WriteStartArray(); + foreach (var item in Payload) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(NonCorrelatedDetectors)) + { + writer.WritePropertyName("nonCorrelatedDetectors"); + writer.WriteStartArray(); + foreach (var item in NonCorrelatedDetectors) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static DiagnosticAnalysis DeserializeDiagnosticAnalysis(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional startTime = default; + Optional endTime = default; + Optional> abnormalTimePeriods = default; + Optional> payload = default; + Optional> nonCorrelatedDetectors = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("startTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("endTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + endTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("abnormalTimePeriods")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(AbnormalTimePeriod.DeserializeAbnormalTimePeriod(item)); + } + abnormalTimePeriods = array; + continue; + } + if (property0.NameEquals("payload")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(AnalysisData.DeserializeAnalysisData(item)); + } + payload = array; + continue; + } + if (property0.NameEquals("nonCorrelatedDetectors")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DetectorDefinition.DeserializeDetectorDefinition(item)); + } + nonCorrelatedDetectors = array; + continue; + } + } + continue; + } + } + return new DiagnosticAnalysis(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToList(abnormalTimePeriods), Optional.ToList(payload), Optional.ToList(nonCorrelatedDetectors)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.cs index a14320e7e5e3..c1139d512225 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.cs @@ -1,95 +1,55 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Class representing a diagnostic analysis done on an application - /// - [Rest.Serialization.JsonTransformation] + /// Class representing a diagnostic analysis done on an application. public partial class DiagnosticAnalysis : ProxyOnlyResource { - /// - /// Initializes a new instance of the DiagnosticAnalysis class. - /// + /// Initializes a new instance of DiagnosticAnalysis. public DiagnosticAnalysis() { - CustomInit(); + AbnormalTimePeriods = new ChangeTrackingList(); + Payload = new ChangeTrackingList(); + NonCorrelatedDetectors = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the DiagnosticAnalysis class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Start time of the period - /// End time of the period - /// List of time periods. - /// Data by each detector - /// Data by each detector for - /// detectors that did not corelate - public DiagnosticAnalysis(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), IList abnormalTimePeriods = default(IList), IList payload = default(IList), IList nonCorrelatedDetectors = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of DiagnosticAnalysis. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Start time of the period. + /// End time of the period. + /// List of time periods. + /// Data by each detector. + /// Data by each detector for detectors that did not corelate. + internal DiagnosticAnalysis(string id, string name, string kind, string type, DateTimeOffset? startTime, DateTimeOffset? endTime, IList abnormalTimePeriods, IList payload, IList nonCorrelatedDetectors) : base(id, name, kind, type) { StartTime = startTime; EndTime = endTime; AbnormalTimePeriods = abnormalTimePeriods; Payload = payload; NonCorrelatedDetectors = nonCorrelatedDetectors; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets start time of the period - /// - [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets end time of the period - /// - [JsonProperty(PropertyName = "properties.endTime")] - public System.DateTime? EndTime { get; set; } - - /// - /// Gets or sets list of time periods. - /// - [JsonProperty(PropertyName = "properties.abnormalTimePeriods")] - public IList AbnormalTimePeriods { get; set; } - - /// - /// Gets or sets data by each detector - /// - [JsonProperty(PropertyName = "properties.payload")] - public IList Payload { get; set; } - - /// - /// Gets or sets data by each detector for detectors that did not - /// corelate - /// - [JsonProperty(PropertyName = "properties.nonCorrelatedDetectors")] - public IList NonCorrelatedDetectors { get; set; } - + /// Start time of the period. + public DateTimeOffset? StartTime { get; set; } + /// End time of the period. + public DateTimeOffset? EndTime { get; set; } + /// List of time periods. + public IList AbnormalTimePeriods { get; } + /// Data by each detector. + public IList Payload { get; } + /// Data by each detector for detectors that did not corelate. + public IList NonCorrelatedDetectors { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.Serialization.cs new file mode 100644 index 000000000000..05f5ebd864f5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class DiagnosticAnalysisCollection + { + internal static DiagnosticAnalysisCollection DeserializeDiagnosticAnalysisCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AnalysisDefinition.DeserializeAnalysisDefinition(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new DiagnosticAnalysisCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.cs new file mode 100644 index 000000000000..bb0b26ede346 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Diagnostic Analyses. + internal partial class DiagnosticAnalysisCollection + { + /// Initializes a new instance of DiagnosticAnalysisCollection. + /// Collection of resources. + /// is null. + internal DiagnosticAnalysisCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of DiagnosticAnalysisCollection. + /// Collection of resources. + /// Link to next page of resources. + internal DiagnosticAnalysisCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.Serialization.cs new file mode 100644 index 000000000000..0a0331c16c11 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.Serialization.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DiagnosticCategory : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static DiagnosticCategory DeserializeDiagnosticCategory(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("description")) + { + description = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new DiagnosticCategory(id.Value, name.Value, kind.Value, type.Value, description.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.cs index 57b10cf75dd7..dca5053fae54 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.cs @@ -1,60 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Class representing detector definition - /// - [Rest.Serialization.JsonTransformation] + /// Class representing detector definition. public partial class DiagnosticCategory : ProxyOnlyResource { - /// - /// Initializes a new instance of the DiagnosticCategory class. - /// + /// Initializes a new instance of DiagnosticCategory. public DiagnosticCategory() { - CustomInit(); } - /// - /// Initializes a new instance of the DiagnosticCategory class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Description of the diagnostic - /// category - public DiagnosticCategory(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string description = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of DiagnosticCategory. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Description of the diagnostic category. + internal DiagnosticCategory(string id, string name, string kind, string type, string description) : base(id, name, kind, type) { Description = description; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets description of the diagnostic category - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } - + /// Description of the diagnostic category. + public string Description { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.Serialization.cs new file mode 100644 index 000000000000..0b7bb69869c6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class DiagnosticCategoryCollection + { + internal static DiagnosticCategoryCollection DeserializeDiagnosticCategoryCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiagnosticCategory.DeserializeDiagnosticCategory(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new DiagnosticCategoryCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.cs new file mode 100644 index 000000000000..558bb7cc0b4d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Diagnostic Categories. + internal partial class DiagnosticCategoryCollection + { + /// Initializes a new instance of DiagnosticCategoryCollection. + /// Collection of resources. + /// is null. + internal DiagnosticCategoryCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of DiagnosticCategoryCollection. + /// Collection of resources. + /// Link to next page of resources. + internal DiagnosticCategoryCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.Serialization.cs new file mode 100644 index 000000000000..9bec690470e3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DiagnosticData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Table)) + { + writer.WritePropertyName("table"); + writer.WriteObjectValue(Table); + } + if (Optional.IsDefined(RenderingProperties)) + { + writer.WritePropertyName("renderingProperties"); + writer.WriteObjectValue(RenderingProperties); + } + writer.WriteEndObject(); + } + + internal static DiagnosticData DeserializeDiagnosticData(JsonElement element) + { + Optional table = default; + Optional renderingProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("table")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + table = DataTableResponseObject.DeserializeDataTableResponseObject(property.Value); + continue; + } + if (property.NameEquals("renderingProperties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + renderingProperties = Rendering.DeserializeRendering(property.Value); + continue; + } + } + return new DiagnosticData(table.Value, renderingProperties.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.cs index af8f9d08d4c9..75ba32a7ef5b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.cs @@ -1,61 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Set of data with rendering instructions - /// + /// Set of data with rendering instructions. public partial class DiagnosticData { - /// - /// Initializes a new instance of the DiagnosticData class. - /// + /// Initializes a new instance of DiagnosticData. public DiagnosticData() { - CustomInit(); } - /// - /// Initializes a new instance of the DiagnosticData class. - /// - /// Data in table form - /// Properties that describe how the - /// table should be rendered - public DiagnosticData(DataTableResponseObject table = default(DataTableResponseObject), Rendering renderingProperties = default(Rendering)) + /// Initializes a new instance of DiagnosticData. + /// Data in table form. + /// Properties that describe how the table should be rendered. + internal DiagnosticData(DataTableResponseObject table, Rendering renderingProperties) { Table = table; RenderingProperties = renderingProperties; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets data in table form - /// - [JsonProperty(PropertyName = "table")] + /// Data in table form. public DataTableResponseObject Table { get; set; } - - /// - /// Gets or sets properties that describe how the table should be - /// rendered - /// - [JsonProperty(PropertyName = "renderingProperties")] + /// Properties that describe how the table should be rendered. public Rendering RenderingProperties { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.Serialization.cs new file mode 100644 index 000000000000..87cc22578f0a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class DiagnosticDetectorCollection + { + internal static DiagnosticDetectorCollection DeserializeDiagnosticDetectorCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DetectorDefinition.DeserializeDetectorDefinition(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new DiagnosticDetectorCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.cs new file mode 100644 index 000000000000..22a94d00e81a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Diagnostic Detectors. + internal partial class DiagnosticDetectorCollection + { + /// Initializes a new instance of DiagnosticDetectorCollection. + /// Collection of resources. + /// is null. + internal DiagnosticDetectorCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of DiagnosticDetectorCollection. + /// Collection of resources. + /// Link to next page of resources. + internal DiagnosticDetectorCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.Serialization.cs new file mode 100644 index 000000000000..0a10d646c42b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.Serialization.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DiagnosticDetectorResponse : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("endTime"); + writer.WriteStringValue(EndTime.Value, "O"); + } + if (Optional.IsDefined(IssueDetected)) + { + writer.WritePropertyName("issueDetected"); + writer.WriteBooleanValue(IssueDetected.Value); + } + if (Optional.IsDefined(DetectorDefinition)) + { + writer.WritePropertyName("detectorDefinition"); + writer.WriteObjectValue(DetectorDefinition); + } + if (Optional.IsCollectionDefined(Metrics)) + { + writer.WritePropertyName("metrics"); + writer.WriteStartArray(); + foreach (var item in Metrics) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AbnormalTimePeriods)) + { + writer.WritePropertyName("abnormalTimePeriods"); + writer.WriteStartArray(); + foreach (var item in AbnormalTimePeriods) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Data)) + { + writer.WritePropertyName("data"); + writer.WriteStartArray(); + foreach (var item in Data) + { + writer.WriteStartArray(); + foreach (var item0 in item) + { + writer.WriteObjectValue(item0); + } + writer.WriteEndArray(); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ResponseMetaData)) + { + writer.WritePropertyName("responseMetaData"); + writer.WriteObjectValue(ResponseMetaData); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static DiagnosticDetectorResponse DeserializeDiagnosticDetectorResponse(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional startTime = default; + Optional endTime = default; + Optional issueDetected = default; + Optional detectorDefinition = default; + Optional> metrics = default; + Optional> abnormalTimePeriods = default; + Optional>> data = default; + Optional responseMetaData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("startTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("endTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + endTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("issueDetected")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + issueDetected = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("detectorDefinition")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + detectorDefinition = DetectorDefinition.DeserializeDetectorDefinition(property0.Value); + continue; + } + if (property0.NameEquals("metrics")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DiagnosticMetricSet.DeserializeDiagnosticMetricSet(item)); + } + metrics = array; + continue; + } + if (property0.NameEquals("abnormalTimePeriods")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DetectorAbnormalTimePeriod.DeserializeDetectorAbnormalTimePeriod(item)); + } + abnormalTimePeriods = array; + continue; + } + if (property0.NameEquals("data")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List> array = new List>(); + foreach (var item in property0.Value.EnumerateArray()) + { + List array0 = new List(); + foreach (var item0 in item.EnumerateArray()) + { + array0.Add(NameValuePair.DeserializeNameValuePair(item0)); + } + array.Add(array0); + } + data = array; + continue; + } + if (property0.NameEquals("responseMetaData")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + responseMetaData = ResponseMetaData.DeserializeResponseMetaData(property0.Value); + continue; + } + } + continue; + } + } + return new DiagnosticDetectorResponse(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToNullable(issueDetected), detectorDefinition.Value, Optional.ToList(metrics), Optional.ToList(abnormalTimePeriods), Optional.ToList(data), responseMetaData.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.cs index 2a896dd8fdef..454d5f3b7f3a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.cs @@ -1,56 +1,41 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Class representing Response from Diagnostic Detectors - /// - [Rest.Serialization.JsonTransformation] + /// Class representing Response from Diagnostic Detectors. public partial class DiagnosticDetectorResponse : ProxyOnlyResource { - /// - /// Initializes a new instance of the DiagnosticDetectorResponse class. - /// + /// Initializes a new instance of DiagnosticDetectorResponse. public DiagnosticDetectorResponse() { - CustomInit(); + Metrics = new ChangeTrackingList(); + AbnormalTimePeriods = new ChangeTrackingList(); + Data = new ChangeTrackingList>(); } - /// - /// Initializes a new instance of the DiagnosticDetectorResponse class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Start time of the period - /// End time of the period - /// Flag representing Issue was - /// detected. - /// Detector's definition - /// Metrics provided by the detector - /// List of Correlated events found - /// by the detector - /// Additional Data that detector wants to - /// send. - /// Meta Data - public DiagnosticDetectorResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), bool? issueDetected = default(bool?), DetectorDefinition detectorDefinition = default(DetectorDefinition), IList metrics = default(IList), IList abnormalTimePeriods = default(IList), IList> data = default(IList>), ResponseMetaData responseMetaData = default(ResponseMetaData)) - : base(id, name, kind, type) + /// Initializes a new instance of DiagnosticDetectorResponse. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Start time of the period. + /// End time of the period. + /// Flag representing Issue was detected. + /// Detector's definition. + /// Metrics provided by the detector. + /// List of Correlated events found by the detector. + /// Additional Data that detector wants to send. + /// Meta Data. + internal DiagnosticDetectorResponse(string id, string name, string kind, string type, DateTimeOffset? startTime, DateTimeOffset? endTime, bool? issueDetected, DetectorDefinition detectorDefinition, IList metrics, IList abnormalTimePeriods, IList> data, ResponseMetaData responseMetaData) : base(id, name, kind, type) { StartTime = startTime; EndTime = endTime; @@ -60,61 +45,23 @@ public DiagnosticDetectorResponse() AbnormalTimePeriods = abnormalTimePeriods; Data = data; ResponseMetaData = responseMetaData; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets start time of the period - /// - [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets end time of the period - /// - [JsonProperty(PropertyName = "properties.endTime")] - public System.DateTime? EndTime { get; set; } - - /// - /// Gets or sets flag representing Issue was detected. - /// - [JsonProperty(PropertyName = "properties.issueDetected")] + /// Start time of the period. + public DateTimeOffset? StartTime { get; set; } + /// End time of the period. + public DateTimeOffset? EndTime { get; set; } + /// Flag representing Issue was detected. public bool? IssueDetected { get; set; } - - /// - /// Gets or sets detector's definition - /// - [JsonProperty(PropertyName = "properties.detectorDefinition")] + /// Detector's definition. public DetectorDefinition DetectorDefinition { get; set; } - - /// - /// Gets or sets metrics provided by the detector - /// - [JsonProperty(PropertyName = "properties.metrics")] - public IList Metrics { get; set; } - - /// - /// Gets or sets list of Correlated events found by the detector - /// - [JsonProperty(PropertyName = "properties.abnormalTimePeriods")] - public IList AbnormalTimePeriods { get; set; } - - /// - /// Gets or sets additional Data that detector wants to send. - /// - [JsonProperty(PropertyName = "properties.data")] - public IList> Data { get; set; } - - /// - /// Gets or sets meta Data - /// - [JsonProperty(PropertyName = "properties.responseMetaData")] + /// Metrics provided by the detector. + public IList Metrics { get; } + /// List of Correlated events found by the detector. + public IList AbnormalTimePeriods { get; } + /// Additional Data that detector wants to send. + public IList> Data { get; } + /// Meta Data. public ResponseMetaData ResponseMetaData { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.Serialization.cs new file mode 100644 index 000000000000..bef57da80be3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DiagnosticMetricSample : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"); + writer.WriteStringValue(Timestamp.Value, "O"); + } + if (Optional.IsDefined(RoleInstance)) + { + writer.WritePropertyName("roleInstance"); + writer.WriteStringValue(RoleInstance); + } + if (Optional.IsDefined(Total)) + { + writer.WritePropertyName("total"); + writer.WriteNumberValue(Total.Value); + } + if (Optional.IsDefined(Maximum)) + { + writer.WritePropertyName("maximum"); + writer.WriteNumberValue(Maximum.Value); + } + if (Optional.IsDefined(Minimum)) + { + writer.WritePropertyName("minimum"); + writer.WriteNumberValue(Minimum.Value); + } + if (Optional.IsDefined(IsAggregated)) + { + writer.WritePropertyName("isAggregated"); + writer.WriteBooleanValue(IsAggregated.Value); + } + writer.WriteEndObject(); + } + + internal static DiagnosticMetricSample DeserializeDiagnosticMetricSample(JsonElement element) + { + Optional timestamp = default; + Optional roleInstance = default; + Optional total = default; + Optional maximum = default; + Optional minimum = default; + Optional isAggregated = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + timestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("roleInstance")) + { + roleInstance = property.Value.GetString(); + continue; + } + if (property.NameEquals("total")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + total = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("maximum")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + maximum = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("minimum")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + minimum = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("isAggregated")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isAggregated = property.Value.GetBoolean(); + continue; + } + } + return new DiagnosticMetricSample(Optional.ToNullable(timestamp), roleInstance.Value, Optional.ToNullable(total), Optional.ToNullable(maximum), Optional.ToNullable(minimum), Optional.ToNullable(isAggregated)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.cs index 5c39fa5a0748..41687074a22a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.cs @@ -1,51 +1,35 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Class representing Diagnostic Metric - /// + /// Class representing Diagnostic Metric. public partial class DiagnosticMetricSample { - /// - /// Initializes a new instance of the DiagnosticMetricSample class. - /// + /// Initializes a new instance of DiagnosticMetricSample. public DiagnosticMetricSample() { - CustomInit(); } - /// - /// Initializes a new instance of the DiagnosticMetricSample class. - /// - /// Time at which metric is measured - /// Role Instance. Null if this counter is - /// not per instance - /// This is returned and should be whichever instance name we desire to - /// be returned + /// Initializes a new instance of DiagnosticMetricSample. + /// Time at which metric is measured. + /// + /// Role Instance. Null if this counter is not per instance + /// This is returned and should be whichever instance name we desire to be returned /// i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) - /// where RDWORKERNAME is Machine name below and RoleInstance name in - /// parenthesis - /// Total value of the metric. If multiple - /// measurements are made this will have sum of all. - /// Maximum of the metric sampled during the time - /// period - /// Minimum of the metric sampled during the time - /// period - /// Whether the values are aggregates across - /// all workers or not - public DiagnosticMetricSample(System.DateTime? timestamp = default(System.DateTime?), string roleInstance = default(string), double? total = default(double?), double? maximum = default(double?), double? minimum = default(double?), bool? isAggregated = default(bool?)) + /// where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis. + /// + /// Total value of the metric. If multiple measurements are made this will have sum of all. + /// Maximum of the metric sampled during the time period. + /// Minimum of the metric sampled during the time period. + /// Whether the values are aggregates across all workers or not. + internal DiagnosticMetricSample(DateTimeOffset? timestamp, string roleInstance, double? total, double? maximum, double? minimum, bool? isAggregated) { Timestamp = timestamp; RoleInstance = roleInstance; @@ -53,57 +37,24 @@ public DiagnosticMetricSample() Maximum = maximum; Minimum = minimum; IsAggregated = isAggregated; - CustomInit(); } + /// Time at which metric is measured. + public DateTimeOffset? Timestamp { get; set; } /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets time at which metric is measured - /// - [JsonProperty(PropertyName = "timestamp")] - public System.DateTime? Timestamp { get; set; } - - /// - /// Gets or sets role Instance. Null if this counter is not per - /// instance - /// This is returned and should be whichever instance name we desire to - /// be returned + /// Role Instance. Null if this counter is not per instance + /// This is returned and should be whichever instance name we desire to be returned /// i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) - /// where RDWORKERNAME is Machine name below and RoleInstance name in - /// parenthesis + /// where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis. /// - [JsonProperty(PropertyName = "roleInstance")] public string RoleInstance { get; set; } - - /// - /// Gets or sets total value of the metric. If multiple measurements - /// are made this will have sum of all. - /// - [JsonProperty(PropertyName = "total")] + /// Total value of the metric. If multiple measurements are made this will have sum of all. public double? Total { get; set; } - - /// - /// Gets or sets maximum of the metric sampled during the time period - /// - [JsonProperty(PropertyName = "maximum")] + /// Maximum of the metric sampled during the time period. public double? Maximum { get; set; } - - /// - /// Gets or sets minimum of the metric sampled during the time period - /// - [JsonProperty(PropertyName = "minimum")] + /// Minimum of the metric sampled during the time period. public double? Minimum { get; set; } - - /// - /// Gets or sets whether the values are aggregates across all workers - /// or not - /// - [JsonProperty(PropertyName = "isAggregated")] + /// Whether the values are aggregates across all workers or not. public bool? IsAggregated { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.Serialization.cs new file mode 100644 index 000000000000..22ef7acd3dd2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.Serialization.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DiagnosticMetricSet : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Unit)) + { + writer.WritePropertyName("unit"); + writer.WriteStringValue(Unit); + } + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("endTime"); + writer.WriteStringValue(EndTime.Value, "O"); + } + if (Optional.IsDefined(TimeGrain)) + { + writer.WritePropertyName("timeGrain"); + writer.WriteStringValue(TimeGrain); + } + if (Optional.IsCollectionDefined(Values)) + { + writer.WritePropertyName("values"); + writer.WriteStartArray(); + foreach (var item in Values) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static DiagnosticMetricSet DeserializeDiagnosticMetricSet(JsonElement element) + { + Optional name = default; + Optional unit = default; + Optional startTime = default; + Optional endTime = default; + Optional timeGrain = default; + Optional> values = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("unit")) + { + unit = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeGrain")) + { + timeGrain = property.Value.GetString(); + continue; + } + if (property.NameEquals("values")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiagnosticMetricSample.DeserializeDiagnosticMetricSample(item)); + } + values = array; + continue; + } + } + return new DiagnosticMetricSet(name.Value, unit.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), timeGrain.Value, Optional.ToList(values)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.cs index d815618a15d5..81998f8fdb97 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.cs @@ -1,46 +1,33 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Class representing Diagnostic Metric information - /// + /// Class representing Diagnostic Metric information. public partial class DiagnosticMetricSet { - /// - /// Initializes a new instance of the DiagnosticMetricSet class. - /// + /// Initializes a new instance of DiagnosticMetricSet. public DiagnosticMetricSet() { - CustomInit(); + Values = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the DiagnosticMetricSet class. - /// - /// Name of the metric - /// Metric's unit - /// Start time of the period - /// End time of the period - /// Presented time grain. Supported grains at - /// the moment are PT1M, PT1H, P1D - /// Collection of metric values for the selected - /// period based on the - /// {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain} - public DiagnosticMetricSet(string name = default(string), string unit = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), IList values = default(IList)) + /// Initializes a new instance of DiagnosticMetricSet. + /// Name of the metric. + /// Metric's unit. + /// Start time of the period. + /// End time of the period. + /// Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D. + /// Collection of metric values for the selected period based on the {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain}. + internal DiagnosticMetricSet(string name, string unit, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain, IList values) { Name = name; Unit = unit; @@ -48,52 +35,19 @@ public DiagnosticMetricSet() EndTime = endTime; TimeGrain = timeGrain; Values = values; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the metric - /// - [JsonProperty(PropertyName = "name")] + /// Name of the metric. public string Name { get; set; } - - /// - /// Gets or sets metric's unit - /// - [JsonProperty(PropertyName = "unit")] + /// Metric's unit. public string Unit { get; set; } - - /// - /// Gets or sets start time of the period - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets end time of the period - /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; set; } - - /// - /// Gets or sets presented time grain. Supported grains at the moment - /// are PT1M, PT1H, P1D - /// - [JsonProperty(PropertyName = "timeGrain")] + /// Start time of the period. + public DateTimeOffset? StartTime { get; set; } + /// End time of the period. + public DateTimeOffset? EndTime { get; set; } + /// Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D. public string TimeGrain { get; set; } - - /// - /// Gets or sets collection of metric values for the selected period - /// based on the - /// {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain} - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - + /// Collection of metric values for the selected period based on the {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain}. + public IList Values { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.Serialization.cs new file mode 100644 index 000000000000..a89ec6e8f30b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Dimension + { + internal static Dimension DeserializeDimension(JsonElement element) + { + Optional name = default; + Optional displayName = default; + Optional internalName = default; + Optional toBeExportedForShoebox = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("internalName")) + { + internalName = property.Value.GetString(); + continue; + } + if (property.NameEquals("toBeExportedForShoebox")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + toBeExportedForShoebox = property.Value.GetBoolean(); + continue; + } + } + return new Dimension(name.Value, displayName.Value, internalName.Value, Optional.ToNullable(toBeExportedForShoebox)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.cs index 1d48f3d78976..0dba87b68e95 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.cs @@ -1,69 +1,39 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - /// - /// Dimension of a resource metric. For e.g. instance specific HTTP - /// requests for a web app, - /// where instance name is dimension of the metric HTTP request + /// Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, + /// where instance name is dimension of the metric HTTP request. /// public partial class Dimension { - /// - /// Initializes a new instance of the Dimension class. - /// - public Dimension() + /// Initializes a new instance of Dimension. + internal Dimension() { - CustomInit(); } - /// - /// Initializes a new instance of the Dimension class. - /// - public Dimension(string name = default(string), string displayName = default(string), string internalName = default(string), bool? toBeExportedForShoebox = default(bool?)) + /// Initializes a new instance of Dimension. + /// . + /// . + /// . + /// . + internal Dimension(string name, string displayName, string internalName, bool? toBeExportedForShoebox) { Name = name; DisplayName = displayName; InternalName = internalName; ToBeExportedForShoebox = toBeExportedForShoebox; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - - /// - /// - [JsonProperty(PropertyName = "internalName")] - public string InternalName { get; set; } - - /// - /// - [JsonProperty(PropertyName = "toBeExportedForShoebox")] - public bool? ToBeExportedForShoebox { get; set; } - + public string Name { get; } + public string DisplayName { get; } + public string InternalName { get; } + public bool? ToBeExportedForShoebox { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.Serialization.cs new file mode 100644 index 000000000000..eb5c4160812b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class DnsTypeExtensions + { + public static string ToSerialString(this DnsType value) => value switch + { + DnsType.AzureDns => "AzureDns", + DnsType.DefaultDomainRegistrarDns => "DefaultDomainRegistrarDns", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DnsType value.") + }; + + public static DnsType ToDnsType(this string value) + { + if (string.Equals(value, "AzureDns", StringComparison.InvariantCultureIgnoreCase)) return DnsType.AzureDns; + if (string.Equals(value, "DefaultDomainRegistrarDns", StringComparison.InvariantCultureIgnoreCase)) return DnsType.DefaultDomainRegistrarDns; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DnsType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.cs index 2790d6b0308b..bb47253477f3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for DnsType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Current DNS type. public enum DnsType { - [EnumMember(Value = "AzureDns")] + /// AzureDns. AzureDns, - [EnumMember(Value = "DefaultDomainRegistrarDns")] + /// DefaultDomainRegistrarDns. DefaultDomainRegistrarDns } - internal static class DnsTypeEnumExtension - { - internal static string ToSerializedValue(this DnsType? value) - { - return value == null ? null : ((DnsType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this DnsType value) - { - switch( value ) - { - case DnsType.AzureDns: - return "AzureDns"; - case DnsType.DefaultDomainRegistrarDns: - return "DefaultDomainRegistrarDns"; - } - return null; - } - - internal static DnsType? ParseDnsType(this string value) - { - switch( value ) - { - case "AzureDns": - return DnsType.AzureDns; - case "DefaultDomainRegistrarDns": - return DnsType.DefaultDomainRegistrarDns; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.Serialization.cs new file mode 100644 index 000000000000..86a9a903bd85 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class DnsVerificationTestResultExtensions + { + public static string ToSerialString(this DnsVerificationTestResult value) => value switch + { + DnsVerificationTestResult.Passed => "Passed", + DnsVerificationTestResult.Failed => "Failed", + DnsVerificationTestResult.Skipped => "Skipped", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DnsVerificationTestResult value.") + }; + + public static DnsVerificationTestResult ToDnsVerificationTestResult(this string value) + { + if (string.Equals(value, "Passed", StringComparison.InvariantCultureIgnoreCase)) return DnsVerificationTestResult.Passed; + if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return DnsVerificationTestResult.Failed; + if (string.Equals(value, "Skipped", StringComparison.InvariantCultureIgnoreCase)) return DnsVerificationTestResult.Skipped; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DnsVerificationTestResult value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.cs index eabbc5fe01af..3033815a2eed 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for DnsVerificationTestResult. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// DNS verification test result. public enum DnsVerificationTestResult { - [EnumMember(Value = "Passed")] + /// Passed. Passed, - [EnumMember(Value = "Failed")] + /// Failed. Failed, - [EnumMember(Value = "Skipped")] + /// Skipped. Skipped } - internal static class DnsVerificationTestResultEnumExtension - { - internal static string ToSerializedValue(this DnsVerificationTestResult? value) - { - return value == null ? null : ((DnsVerificationTestResult)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this DnsVerificationTestResult value) - { - switch( value ) - { - case DnsVerificationTestResult.Passed: - return "Passed"; - case DnsVerificationTestResult.Failed: - return "Failed"; - case DnsVerificationTestResult.Skipped: - return "Skipped"; - } - return null; - } - - internal static DnsVerificationTestResult? ParseDnsVerificationTestResult(this string value) - { - switch( value ) - { - case "Passed": - return DnsVerificationTestResult.Passed; - case "Failed": - return DnsVerificationTestResult.Failed; - case "Skipped": - return DnsVerificationTestResult.Skipped; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.Serialization.cs new file mode 100644 index 000000000000..ce2d3c3ac0e8 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.Serialization.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Domain : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ContactAdmin)) + { + writer.WritePropertyName("contactAdmin"); + writer.WriteObjectValue(ContactAdmin); + } + if (Optional.IsDefined(ContactBilling)) + { + writer.WritePropertyName("contactBilling"); + writer.WriteObjectValue(ContactBilling); + } + if (Optional.IsDefined(ContactRegistrant)) + { + writer.WritePropertyName("contactRegistrant"); + writer.WriteObjectValue(ContactRegistrant); + } + if (Optional.IsDefined(ContactTech)) + { + writer.WritePropertyName("contactTech"); + writer.WriteObjectValue(ContactTech); + } + if (Optional.IsDefined(Privacy)) + { + writer.WritePropertyName("privacy"); + writer.WriteBooleanValue(Privacy.Value); + } + if (Optional.IsDefined(AutoRenew)) + { + writer.WritePropertyName("autoRenew"); + writer.WriteBooleanValue(AutoRenew.Value); + } + if (Optional.IsDefined(Consent)) + { + writer.WritePropertyName("consent"); + writer.WriteObjectValue(Consent); + } + if (Optional.IsDefined(DnsType)) + { + writer.WritePropertyName("dnsType"); + writer.WriteStringValue(DnsType.Value.ToSerialString()); + } + if (Optional.IsDefined(DnsZoneId)) + { + writer.WritePropertyName("dnsZoneId"); + writer.WriteStringValue(DnsZoneId); + } + if (Optional.IsDefined(TargetDnsType)) + { + writer.WritePropertyName("targetDnsType"); + writer.WriteStringValue(TargetDnsType.Value.ToSerialString()); + } + if (Optional.IsDefined(AuthCode)) + { + writer.WritePropertyName("authCode"); + writer.WriteStringValue(AuthCode); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Domain DeserializeDomain(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + string location = default; + Optional type = default; + Optional> tags = default; + Optional contactAdmin = default; + Optional contactBilling = default; + Optional contactRegistrant = default; + Optional contactTech = default; + Optional registrationStatus = default; + Optional provisioningState = default; + Optional> nameServers = default; + Optional privacy = default; + Optional createdTime = default; + Optional expirationTime = default; + Optional lastRenewedTime = default; + Optional autoRenew = default; + Optional readyForDnsRecordManagement = default; + Optional> managedHostNames = default; + Optional consent = default; + Optional> domainNotRenewableReasons = default; + Optional dnsType = default; + Optional dnsZoneId = default; + Optional targetDnsType = default; + Optional authCode = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("contactAdmin")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + contactAdmin = Contact.DeserializeContact(property0.Value); + continue; + } + if (property0.NameEquals("contactBilling")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + contactBilling = Contact.DeserializeContact(property0.Value); + continue; + } + if (property0.NameEquals("contactRegistrant")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + contactRegistrant = Contact.DeserializeContact(property0.Value); + continue; + } + if (property0.NameEquals("contactTech")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + contactTech = Contact.DeserializeContact(property0.Value); + continue; + } + if (property0.NameEquals("registrationStatus")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + registrationStatus = property0.Value.GetString().ToDomainStatus(); + continue; + } + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property0.Value.GetString().ToProvisioningState(); + continue; + } + if (property0.NameEquals("nameServers")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + nameServers = array; + continue; + } + if (property0.NameEquals("privacy")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + privacy = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("createdTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + createdTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("expirationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + expirationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("lastRenewedTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + lastRenewedTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("autoRenew")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + autoRenew = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("readyForDnsRecordManagement")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + readyForDnsRecordManagement = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("managedHostNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(HostName.DeserializeHostName(item)); + } + managedHostNames = array; + continue; + } + if (property0.NameEquals("consent")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + consent = DomainPurchaseConsent.DeserializeDomainPurchaseConsent(property0.Value); + continue; + } + if (property0.NameEquals("domainNotRenewableReasons")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new DomainPropertiesDomainNotRenewableReasonsItem(item.GetString())); + } + domainNotRenewableReasons = array; + continue; + } + if (property0.NameEquals("dnsType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + dnsType = property0.Value.GetString().ToDnsType(); + continue; + } + if (property0.NameEquals("dnsZoneId")) + { + dnsZoneId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("targetDnsType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + targetDnsType = property0.Value.GetString().ToDnsType(); + continue; + } + if (property0.NameEquals("authCode")) + { + authCode = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new Domain(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), contactAdmin.Value, contactBilling.Value, contactRegistrant.Value, contactTech.Value, Optional.ToNullable(registrationStatus), Optional.ToNullable(provisioningState), Optional.ToList(nameServers), Optional.ToNullable(privacy), Optional.ToNullable(createdTime), Optional.ToNullable(expirationTime), Optional.ToNullable(lastRenewedTime), Optional.ToNullable(autoRenew), Optional.ToNullable(readyForDnsRecordManagement), Optional.ToList(managedHostNames), consent.Value, Optional.ToList(domainNotRenewableReasons), Optional.ToNullable(dnsType), dnsZoneId.Value, Optional.ToNullable(targetDnsType), authCode.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.cs index 7b37c3176248..26987b50860c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.cs @@ -1,90 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Information about a domain. - /// - [Rest.Serialization.JsonTransformation] + /// Information about a domain. public partial class Domain : Resource { - /// - /// Initializes a new instance of the Domain class. - /// - public Domain() + /// Initializes a new instance of Domain. + /// Resource Location. + /// is null. + public Domain(string location) : base(location) { - CustomInit(); + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + NameServers = new ChangeTrackingList(); + ManagedHostNames = new ChangeTrackingList(); + DomainNotRenewableReasons = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the Domain class. - /// - /// Resource Location. - /// Administrative contact. - /// Billing contact. - /// Registrant contact. - /// Technical contact. - /// Legal agreement consent. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Resource tags. - /// Domain registration status. - /// Possible values include: 'Active', 'Awaiting', 'Cancelled', - /// 'Confiscated', 'Disabled', 'Excluded', 'Expired', 'Failed', 'Held', - /// 'Locked', 'Parked', 'Pending', 'Reserved', 'Reverted', 'Suspended', - /// 'Transferred', 'Unknown', 'Unlocked', 'Unparked', 'Updated', - /// 'JsonConverterFailed' - /// Domain provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', - /// 'Deleting' - /// Name servers. - /// <code>true</code> if domain - /// privacy is enabled for this domain; otherwise, - /// <code>false</code>. - /// Domain creation timestamp. - /// Domain expiration timestamp. - /// Timestamp when the domain was renewed - /// last time. - /// <code>true</code> if the domain - /// should be automatically renewed; otherwise, - /// <code>false</code>. - /// <code>true</code> if - /// Azure can assign this domain to App Service apps; otherwise, - /// <code>false</code>. This value will be - /// <code>true</code> if domain registration status is - /// active and - /// it is hosted on name servers Azure has programmatic access - /// to. - /// All hostnames derived from the - /// domain and assigned to Azure resources. - /// Reasons why domain is not - /// renewable. - /// Current DNS type. Possible values include: - /// 'AzureDns', 'DefaultDomainRegistrarDns' - /// Azure DNS Zone to use - /// Target DNS type (would be used for - /// migration). Possible values include: 'AzureDns', - /// 'DefaultDomainRegistrarDns' - public Domain(string location, Contact contactAdmin, Contact contactBilling, Contact contactRegistrant, Contact contactTech, DomainPurchaseConsent consent, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), DomainStatus? registrationStatus = default(DomainStatus?), ProvisioningState? provisioningState = default(ProvisioningState?), IList nameServers = default(IList), bool? privacy = default(bool?), System.DateTime? createdTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), System.DateTime? lastRenewedTime = default(System.DateTime?), bool? autoRenew = default(bool?), bool? readyForDnsRecordManagement = default(bool?), IList managedHostNames = default(IList), IList domainNotRenewableReasons = default(IList), DnsType? dnsType = default(DnsType?), string dnsZoneId = default(string), DnsType? targetDnsType = default(DnsType?), string authCode = default(string)) - : base(location, id, name, kind, type, tags) + /// Initializes a new instance of Domain. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource Location. + /// Resource type. + /// Resource tags. + /// Administrative contact. + /// Billing contact. + /// Registrant contact. + /// Technical contact. + /// Domain registration status. + /// Domain provisioning state. + /// Name servers. + /// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>. + /// Domain creation timestamp. + /// Domain expiration timestamp. + /// Timestamp when the domain was renewed last time. + /// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>. + /// + /// <code>true</code> if Azure can assign this domain to App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain registration status is active and + /// it is hosted on name servers Azure has programmatic access to. + /// + /// All hostnames derived from the domain and assigned to Azure resources. + /// Legal agreement consent. + /// Reasons why domain is not renewable. + /// Current DNS type. + /// Azure DNS Zone to use. + /// Target DNS type (would be used for migration). + /// . + internal Domain(string id, string name, string kind, string location, string type, IDictionary tags, Contact contactAdmin, Contact contactBilling, Contact contactRegistrant, Contact contactTech, DomainStatus? registrationStatus, ProvisioningState? provisioningState, IReadOnlyList nameServers, bool? privacy, DateTimeOffset? createdTime, DateTimeOffset? expirationTime, DateTimeOffset? lastRenewedTime, bool? autoRenew, bool? readyForDnsRecordManagement, IReadOnlyList managedHostNames, DomainPurchaseConsent consent, IReadOnlyList domainNotRenewableReasons, DnsType? dnsType, string dnsZoneId, DnsType? targetDnsType, string authCode) : base(id, name, kind, location, type, tags) { ContactAdmin = contactAdmin; ContactBilling = contactBilling; @@ -106,195 +81,49 @@ public Domain() DnsZoneId = dnsZoneId; TargetDnsType = targetDnsType; AuthCode = authCode; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets administrative contact. - /// - [JsonProperty(PropertyName = "properties.contactAdmin")] + /// Administrative contact. public Contact ContactAdmin { get; set; } - - /// - /// Gets or sets billing contact. - /// - [JsonProperty(PropertyName = "properties.contactBilling")] + /// Billing contact. public Contact ContactBilling { get; set; } - - /// - /// Gets or sets registrant contact. - /// - [JsonProperty(PropertyName = "properties.contactRegistrant")] + /// Registrant contact. public Contact ContactRegistrant { get; set; } - - /// - /// Gets or sets technical contact. - /// - [JsonProperty(PropertyName = "properties.contactTech")] + /// Technical contact. public Contact ContactTech { get; set; } - - /// - /// Gets domain registration status. Possible values include: 'Active', - /// 'Awaiting', 'Cancelled', 'Confiscated', 'Disabled', 'Excluded', - /// 'Expired', 'Failed', 'Held', 'Locked', 'Parked', 'Pending', - /// 'Reserved', 'Reverted', 'Suspended', 'Transferred', 'Unknown', - /// 'Unlocked', 'Unparked', 'Updated', 'JsonConverterFailed' - /// - [JsonProperty(PropertyName = "properties.registrationStatus")] - public DomainStatus? RegistrationStatus { get; private set; } - - /// - /// Gets domain provisioning state. Possible values include: - /// 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public ProvisioningState? ProvisioningState { get; private set; } - - /// - /// Gets name servers. - /// - [JsonProperty(PropertyName = "properties.nameServers")] - public IList NameServers { get; private set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// domain privacy is enabled for this domain; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.privacy")] + /// Domain registration status. + public DomainStatus? RegistrationStatus { get; } + /// Domain provisioning state. + public ProvisioningState? ProvisioningState { get; } + /// Name servers. + public IReadOnlyList NameServers { get; } + /// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>. public bool? Privacy { get; set; } - - /// - /// Gets domain creation timestamp. - /// - [JsonProperty(PropertyName = "properties.createdTime")] - public System.DateTime? CreatedTime { get; private set; } - - /// - /// Gets domain expiration timestamp. - /// - [JsonProperty(PropertyName = "properties.expirationTime")] - public System.DateTime? ExpirationTime { get; private set; } - - /// - /// Gets timestamp when the domain was renewed last time. - /// - [JsonProperty(PropertyName = "properties.lastRenewedTime")] - public System.DateTime? LastRenewedTime { get; private set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// domain should be automatically renewed; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.autoRenew")] + /// Domain creation timestamp. + public DateTimeOffset? CreatedTime { get; } + /// Domain expiration timestamp. + public DateTimeOffset? ExpirationTime { get; } + /// Timestamp when the domain was renewed last time. + public DateTimeOffset? LastRenewedTime { get; } + /// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>. public bool? AutoRenew { get; set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if Azure can - /// assign this domain to App Service apps; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. This value will be - /// &lt;code&gt;true&lt;/code&gt; if domain - /// registration status is active and - /// it is hosted on name servers Azure has programmatic access to. - /// - [JsonProperty(PropertyName = "properties.readyForDnsRecordManagement")] - public bool? ReadyForDnsRecordManagement { get; private set; } - /// - /// Gets all hostnames derived from the domain and assigned to Azure - /// resources. + /// <code>true</code> if Azure can assign this domain to App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain registration status is active and + /// it is hosted on name servers Azure has programmatic access to. /// - [JsonProperty(PropertyName = "properties.managedHostNames")] - public IList ManagedHostNames { get; private set; } - - /// - /// Gets or sets legal agreement consent. - /// - [JsonProperty(PropertyName = "properties.consent")] + public bool? ReadyForDnsRecordManagement { get; } + /// All hostnames derived from the domain and assigned to Azure resources. + public IReadOnlyList ManagedHostNames { get; } + /// Legal agreement consent. public DomainPurchaseConsent Consent { get; set; } - - /// - /// Gets reasons why domain is not renewable. - /// - [JsonProperty(PropertyName = "properties.domainNotRenewableReasons")] - public IList DomainNotRenewableReasons { get; private set; } - - /// - /// Gets or sets current DNS type. Possible values include: 'AzureDns', - /// 'DefaultDomainRegistrarDns' - /// - [JsonProperty(PropertyName = "properties.dnsType")] + /// Reasons why domain is not renewable. + public IReadOnlyList DomainNotRenewableReasons { get; } + /// Current DNS type. public DnsType? DnsType { get; set; } - - /// - /// Gets or sets azure DNS Zone to use - /// - [JsonProperty(PropertyName = "properties.dnsZoneId")] + /// Azure DNS Zone to use. public string DnsZoneId { get; set; } - - /// - /// Gets or sets target DNS type (would be used for migration). - /// Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' - /// - [JsonProperty(PropertyName = "properties.targetDnsType")] + /// Target DNS type (would be used for migration). public DnsType? TargetDnsType { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.authCode")] public string AuthCode { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (ContactAdmin == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ContactAdmin"); - } - if (ContactBilling == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ContactBilling"); - } - if (ContactRegistrant == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ContactRegistrant"); - } - if (ContactTech == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ContactTech"); - } - if (Consent == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Consent"); - } - if (ContactAdmin != null) - { - ContactAdmin.Validate(); - } - if (ContactBilling != null) - { - ContactBilling.Validate(); - } - if (ContactRegistrant != null) - { - ContactRegistrant.Validate(); - } - if (ContactTech != null) - { - ContactTech.Validate(); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.Serialization.cs new file mode 100644 index 000000000000..17e49cb55be3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DomainAvailabilityCheckResult + { + internal static DomainAvailabilityCheckResult DeserializeDomainAvailabilityCheckResult(JsonElement element) + { + Optional name = default; + Optional available = default; + Optional domainType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("available")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + available = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("domainType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + domainType = property.Value.GetString().ToDomainType(); + continue; + } + } + return new DomainAvailabilityCheckResult(name.Value, Optional.ToNullable(available), Optional.ToNullable(domainType)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.cs index 42eec84d942e..a15387bee4ac 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.cs @@ -1,80 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Domain availability check result. - /// + /// Domain availability check result. public partial class DomainAvailabilityCheckResult { - /// - /// Initializes a new instance of the DomainAvailabilityCheckResult - /// class. - /// - public DomainAvailabilityCheckResult() + /// Initializes a new instance of DomainAvailabilityCheckResult. + internal DomainAvailabilityCheckResult() { - CustomInit(); } - /// - /// Initializes a new instance of the DomainAvailabilityCheckResult - /// class. - /// - /// Name of the domain. - /// <code>true</code> if domain can - /// be purchased using CreateDomain API; otherwise, - /// <code>false</code>. - /// Valid values are Regular domain: Azure - /// will charge the full price of domain registration, SoftDeleted: - /// Purchasing this domain will simply restore it and this operation - /// will not cost anything. Possible values include: 'Regular', - /// 'SoftDeleted' - public DomainAvailabilityCheckResult(string name = default(string), bool? available = default(bool?), DomainType? domainType = default(DomainType?)) + /// Initializes a new instance of DomainAvailabilityCheckResult. + /// Name of the domain. + /// <code>true</code> if domain can be purchased using CreateDomain API; otherwise, <code>false</code>. + /// Valid values are Regular domain: Azure will charge the full price of domain registration, SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost anything. + internal DomainAvailabilityCheckResult(string name, bool? available, DomainType? domainType) { Name = name; Available = available; DomainType = domainType; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the domain. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// domain can be purchased using CreateDomain API; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "available")] - public bool? Available { get; set; } - - /// - /// Gets or sets valid values are Regular domain: Azure will charge the - /// full price of domain registration, SoftDeleted: Purchasing this - /// domain will simply restore it and this operation will not cost - /// anything. Possible values include: 'Regular', 'SoftDeleted' - /// - [JsonProperty(PropertyName = "domainType")] - public DomainType? DomainType { get; set; } - + /// Name of the domain. + public string Name { get; } + /// <code>true</code> if domain can be purchased using CreateDomain API; otherwise, <code>false</code>. + public bool? Available { get; } + /// Valid values are Regular domain: Azure will charge the full price of domain registration, SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost anything. + public DomainType? DomainType { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.Serialization.cs new file mode 100644 index 000000000000..5bbde88d131f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class DomainCollection + { + internal static DomainCollection DeserializeDomainCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Domain.DeserializeDomain(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new DomainCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.cs new file mode 100644 index 000000000000..325868de778e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of domains. + internal partial class DomainCollection + { + /// Initializes a new instance of DomainCollection. + /// Collection of resources. + /// is null. + internal DomainCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of DomainCollection. + /// Collection of resources. + /// Link to next page of resources. + internal DomainCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.Serialization.cs new file mode 100644 index 000000000000..0085350aa58f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DomainControlCenterSsoRequest + { + internal static DomainControlCenterSsoRequest DeserializeDomainControlCenterSsoRequest(JsonElement element) + { + Optional url = default; + Optional postParameterKey = default; + Optional postParameterValue = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url")) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("postParameterKey")) + { + postParameterKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("postParameterValue")) + { + postParameterValue = property.Value.GetString(); + continue; + } + } + return new DomainControlCenterSsoRequest(url.Value, postParameterKey.Value, postParameterValue.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.cs index 0b2693314b55..d329fdefad1f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.cs @@ -1,73 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Single sign-on request information for domain management. - /// + /// Single sign-on request information for domain management. public partial class DomainControlCenterSsoRequest { - /// - /// Initializes a new instance of the DomainControlCenterSsoRequest - /// class. - /// - public DomainControlCenterSsoRequest() + /// Initializes a new instance of DomainControlCenterSsoRequest. + internal DomainControlCenterSsoRequest() { - CustomInit(); } - /// - /// Initializes a new instance of the DomainControlCenterSsoRequest - /// class. - /// - /// URL where the single sign-on request is to be - /// made. - /// Post parameter key. - /// Post parameter value. Client - /// should use 'application/x-www-form-urlencoded' encoding for this - /// value. - public DomainControlCenterSsoRequest(string url = default(string), string postParameterKey = default(string), string postParameterValue = default(string)) + /// Initializes a new instance of DomainControlCenterSsoRequest. + /// URL where the single sign-on request is to be made. + /// Post parameter key. + /// Post parameter value. Client should use 'application/x-www-form-urlencoded' encoding for this value. + internal DomainControlCenterSsoRequest(string url, string postParameterKey, string postParameterValue) { Url = url; PostParameterKey = postParameterKey; PostParameterValue = postParameterValue; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets URL where the single sign-on request is to be made. - /// - [JsonProperty(PropertyName = "url")] - public string Url { get; private set; } - - /// - /// Gets post parameter key. - /// - [JsonProperty(PropertyName = "postParameterKey")] - public string PostParameterKey { get; private set; } - - /// - /// Gets post parameter value. Client should use - /// 'application/x-www-form-urlencoded' encoding for this value. - /// - [JsonProperty(PropertyName = "postParameterValue")] - public string PostParameterValue { get; private set; } - + /// URL where the single sign-on request is to be made. + public string Url { get; } + /// Post parameter key. + public string PostParameterKey { get; } + /// Post parameter value. Client should use 'application/x-www-form-urlencoded' encoding for this value. + public string PostParameterValue { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.Serialization.cs new file mode 100644 index 000000000000..5c6f0a61438e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DomainOwnershipIdentifier : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(OwnershipId)) + { + writer.WritePropertyName("ownershipId"); + writer.WriteStringValue(OwnershipId); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static DomainOwnershipIdentifier DeserializeDomainOwnershipIdentifier(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional ownershipId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("ownershipId")) + { + ownershipId = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new DomainOwnershipIdentifier(id.Value, name.Value, kind.Value, type.Value, ownershipId.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.cs index 76577cbd5406..aa44f273fe11 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Domain ownership Identifier. - /// - [Rest.Serialization.JsonTransformation] + /// Domain ownership Identifier. public partial class DomainOwnershipIdentifier : ProxyOnlyResource { - /// - /// Initializes a new instance of the DomainOwnershipIdentifier class. - /// + /// Initializes a new instance of DomainOwnershipIdentifier. public DomainOwnershipIdentifier() { - CustomInit(); } - /// - /// Initializes a new instance of the DomainOwnershipIdentifier class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Ownership Id. - public DomainOwnershipIdentifier(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string ownershipId = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of DomainOwnershipIdentifier. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Ownership Id. + internal DomainOwnershipIdentifier(string id, string name, string kind, string type, string ownershipId) : base(id, name, kind, type) { OwnershipId = ownershipId; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets ownership Id. - /// - [JsonProperty(PropertyName = "properties.ownershipId")] + /// Ownership Id. public string OwnershipId { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.Serialization.cs new file mode 100644 index 000000000000..2d375be71247 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class DomainOwnershipIdentifierCollection + { + internal static DomainOwnershipIdentifierCollection DeserializeDomainOwnershipIdentifierCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new DomainOwnershipIdentifierCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.cs new file mode 100644 index 000000000000..4aa25ba011e3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of domain ownership identifiers. + internal partial class DomainOwnershipIdentifierCollection + { + /// Initializes a new instance of DomainOwnershipIdentifierCollection. + /// Collection of resources. + /// is null. + internal DomainOwnershipIdentifierCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of DomainOwnershipIdentifierCollection. + /// Collection of resources. + /// Link to next page of resources. + internal DomainOwnershipIdentifierCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.Serialization.cs new file mode 100644 index 000000000000..35705a4bf92c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.Serialization.cs @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DomainPatchResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ContactAdmin)) + { + writer.WritePropertyName("contactAdmin"); + writer.WriteObjectValue(ContactAdmin); + } + if (Optional.IsDefined(ContactBilling)) + { + writer.WritePropertyName("contactBilling"); + writer.WriteObjectValue(ContactBilling); + } + if (Optional.IsDefined(ContactRegistrant)) + { + writer.WritePropertyName("contactRegistrant"); + writer.WriteObjectValue(ContactRegistrant); + } + if (Optional.IsDefined(ContactTech)) + { + writer.WritePropertyName("contactTech"); + writer.WriteObjectValue(ContactTech); + } + if (Optional.IsDefined(Privacy)) + { + writer.WritePropertyName("privacy"); + writer.WriteBooleanValue(Privacy.Value); + } + if (Optional.IsDefined(AutoRenew)) + { + writer.WritePropertyName("autoRenew"); + writer.WriteBooleanValue(AutoRenew.Value); + } + if (Optional.IsDefined(Consent)) + { + writer.WritePropertyName("consent"); + writer.WriteObjectValue(Consent); + } + if (Optional.IsDefined(DnsType)) + { + writer.WritePropertyName("dnsType"); + writer.WriteStringValue(DnsType.Value.ToSerialString()); + } + if (Optional.IsDefined(DnsZoneId)) + { + writer.WritePropertyName("dnsZoneId"); + writer.WriteStringValue(DnsZoneId); + } + if (Optional.IsDefined(TargetDnsType)) + { + writer.WritePropertyName("targetDnsType"); + writer.WriteStringValue(TargetDnsType.Value.ToSerialString()); + } + if (Optional.IsDefined(AuthCode)) + { + writer.WritePropertyName("authCode"); + writer.WriteStringValue(AuthCode); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static DomainPatchResource DeserializeDomainPatchResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional contactAdmin = default; + Optional contactBilling = default; + Optional contactRegistrant = default; + Optional contactTech = default; + Optional registrationStatus = default; + Optional provisioningState = default; + Optional> nameServers = default; + Optional privacy = default; + Optional createdTime = default; + Optional expirationTime = default; + Optional lastRenewedTime = default; + Optional autoRenew = default; + Optional readyForDnsRecordManagement = default; + Optional> managedHostNames = default; + Optional consent = default; + Optional> domainNotRenewableReasons = default; + Optional dnsType = default; + Optional dnsZoneId = default; + Optional targetDnsType = default; + Optional authCode = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("contactAdmin")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + contactAdmin = Contact.DeserializeContact(property0.Value); + continue; + } + if (property0.NameEquals("contactBilling")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + contactBilling = Contact.DeserializeContact(property0.Value); + continue; + } + if (property0.NameEquals("contactRegistrant")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + contactRegistrant = Contact.DeserializeContact(property0.Value); + continue; + } + if (property0.NameEquals("contactTech")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + contactTech = Contact.DeserializeContact(property0.Value); + continue; + } + if (property0.NameEquals("registrationStatus")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + registrationStatus = property0.Value.GetString().ToDomainStatus(); + continue; + } + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property0.Value.GetString().ToProvisioningState(); + continue; + } + if (property0.NameEquals("nameServers")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + nameServers = array; + continue; + } + if (property0.NameEquals("privacy")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + privacy = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("createdTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + createdTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("expirationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + expirationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("lastRenewedTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + lastRenewedTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("autoRenew")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + autoRenew = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("readyForDnsRecordManagement")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + readyForDnsRecordManagement = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("managedHostNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(HostName.DeserializeHostName(item)); + } + managedHostNames = array; + continue; + } + if (property0.NameEquals("consent")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + consent = DomainPurchaseConsent.DeserializeDomainPurchaseConsent(property0.Value); + continue; + } + if (property0.NameEquals("domainNotRenewableReasons")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(item.GetString())); + } + domainNotRenewableReasons = array; + continue; + } + if (property0.NameEquals("dnsType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + dnsType = property0.Value.GetString().ToDnsType(); + continue; + } + if (property0.NameEquals("dnsZoneId")) + { + dnsZoneId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("targetDnsType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + targetDnsType = property0.Value.GetString().ToDnsType(); + continue; + } + if (property0.NameEquals("authCode")) + { + authCode = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new DomainPatchResource(id.Value, name.Value, kind.Value, type.Value, contactAdmin.Value, contactBilling.Value, contactRegistrant.Value, contactTech.Value, Optional.ToNullable(registrationStatus), Optional.ToNullable(provisioningState), Optional.ToList(nameServers), Optional.ToNullable(privacy), Optional.ToNullable(createdTime), Optional.ToNullable(expirationTime), Optional.ToNullable(lastRenewedTime), Optional.ToNullable(autoRenew), Optional.ToNullable(readyForDnsRecordManagement), Optional.ToList(managedHostNames), consent.Value, Optional.ToList(domainNotRenewableReasons), Optional.ToNullable(dnsType), dnsZoneId.Value, Optional.ToNullable(targetDnsType), authCode.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.cs index c91ad00fac20..0e1acddafd92 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.cs @@ -1,88 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// ARM resource for a domain. - /// - [Rest.Serialization.JsonTransformation] + /// ARM resource for a domain. public partial class DomainPatchResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the DomainPatchResource class. - /// + /// Initializes a new instance of DomainPatchResource. public DomainPatchResource() { - CustomInit(); + NameServers = new ChangeTrackingList(); + ManagedHostNames = new ChangeTrackingList(); + DomainNotRenewableReasons = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the DomainPatchResource class. - /// - /// Administrative contact. - /// Billing contact. - /// Registrant contact. - /// Technical contact. - /// Legal agreement consent. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Domain registration status. - /// Possible values include: 'Active', 'Awaiting', 'Cancelled', - /// 'Confiscated', 'Disabled', 'Excluded', 'Expired', 'Failed', 'Held', - /// 'Locked', 'Parked', 'Pending', 'Reserved', 'Reverted', 'Suspended', - /// 'Transferred', 'Unknown', 'Unlocked', 'Unparked', 'Updated', - /// 'JsonConverterFailed' - /// Domain provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', - /// 'Deleting' - /// Name servers. - /// <code>true</code> if domain - /// privacy is enabled for this domain; otherwise, - /// <code>false</code>. - /// Domain creation timestamp. - /// Domain expiration timestamp. - /// Timestamp when the domain was renewed - /// last time. - /// <code>true</code> if the domain - /// should be automatically renewed; otherwise, - /// <code>false</code>. - /// <code>true</code> if - /// Azure can assign this domain to App Service apps; otherwise, - /// <code>false</code>. This value will be - /// <code>true</code> if domain registration status is - /// active and - /// it is hosted on name servers Azure has programmatic access - /// to. - /// All hostnames derived from the - /// domain and assigned to Azure resources. - /// Reasons why domain is not - /// renewable. - /// Current DNS type. Possible values include: - /// 'AzureDns', 'DefaultDomainRegistrarDns' - /// Azure DNS Zone to use - /// Target DNS type (would be used for - /// migration). Possible values include: 'AzureDns', - /// 'DefaultDomainRegistrarDns' - public DomainPatchResource(Contact contactAdmin, Contact contactBilling, Contact contactRegistrant, Contact contactTech, DomainPurchaseConsent consent, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), DomainStatus? registrationStatus = default(DomainStatus?), ProvisioningState? provisioningState = default(ProvisioningState?), IList nameServers = default(IList), bool? privacy = default(bool?), System.DateTime? createdTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), System.DateTime? lastRenewedTime = default(System.DateTime?), bool? autoRenew = default(bool?), bool? readyForDnsRecordManagement = default(bool?), IList managedHostNames = default(IList), IList domainNotRenewableReasons = default(IList), DnsType? dnsType = default(DnsType?), string dnsZoneId = default(string), DnsType? targetDnsType = default(DnsType?), string authCode = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of DomainPatchResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Administrative contact. + /// Billing contact. + /// Registrant contact. + /// Technical contact. + /// Domain registration status. + /// Domain provisioning state. + /// Name servers. + /// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>. + /// Domain creation timestamp. + /// Domain expiration timestamp. + /// Timestamp when the domain was renewed last time. + /// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>. + /// + /// <code>true</code> if Azure can assign this domain to App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain registration status is active and + /// it is hosted on name servers Azure has programmatic access to. + /// + /// All hostnames derived from the domain and assigned to Azure resources. + /// Legal agreement consent. + /// Reasons why domain is not renewable. + /// Current DNS type. + /// Azure DNS Zone to use. + /// Target DNS type (would be used for migration). + /// . + internal DomainPatchResource(string id, string name, string kind, string type, Contact contactAdmin, Contact contactBilling, Contact contactRegistrant, Contact contactTech, DomainStatus? registrationStatus, ProvisioningState? provisioningState, IReadOnlyList nameServers, bool? privacy, DateTimeOffset? createdTime, DateTimeOffset? expirationTime, DateTimeOffset? lastRenewedTime, bool? autoRenew, bool? readyForDnsRecordManagement, IReadOnlyList managedHostNames, DomainPurchaseConsent consent, IReadOnlyList domainNotRenewableReasons, DnsType? dnsType, string dnsZoneId, DnsType? targetDnsType, string authCode) : base(id, name, kind, type) { ContactAdmin = contactAdmin; ContactBilling = contactBilling; @@ -104,194 +72,49 @@ public DomainPatchResource() DnsZoneId = dnsZoneId; TargetDnsType = targetDnsType; AuthCode = authCode; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets administrative contact. - /// - [JsonProperty(PropertyName = "properties.contactAdmin")] + /// Administrative contact. public Contact ContactAdmin { get; set; } - - /// - /// Gets or sets billing contact. - /// - [JsonProperty(PropertyName = "properties.contactBilling")] + /// Billing contact. public Contact ContactBilling { get; set; } - - /// - /// Gets or sets registrant contact. - /// - [JsonProperty(PropertyName = "properties.contactRegistrant")] + /// Registrant contact. public Contact ContactRegistrant { get; set; } - - /// - /// Gets or sets technical contact. - /// - [JsonProperty(PropertyName = "properties.contactTech")] + /// Technical contact. public Contact ContactTech { get; set; } - - /// - /// Gets domain registration status. Possible values include: 'Active', - /// 'Awaiting', 'Cancelled', 'Confiscated', 'Disabled', 'Excluded', - /// 'Expired', 'Failed', 'Held', 'Locked', 'Parked', 'Pending', - /// 'Reserved', 'Reverted', 'Suspended', 'Transferred', 'Unknown', - /// 'Unlocked', 'Unparked', 'Updated', 'JsonConverterFailed' - /// - [JsonProperty(PropertyName = "properties.registrationStatus")] - public DomainStatus? RegistrationStatus { get; private set; } - - /// - /// Gets domain provisioning state. Possible values include: - /// 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public ProvisioningState? ProvisioningState { get; private set; } - - /// - /// Gets name servers. - /// - [JsonProperty(PropertyName = "properties.nameServers")] - public IList NameServers { get; private set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// domain privacy is enabled for this domain; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.privacy")] + /// Domain registration status. + public DomainStatus? RegistrationStatus { get; } + /// Domain provisioning state. + public ProvisioningState? ProvisioningState { get; } + /// Name servers. + public IReadOnlyList NameServers { get; } + /// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>. public bool? Privacy { get; set; } - - /// - /// Gets domain creation timestamp. - /// - [JsonProperty(PropertyName = "properties.createdTime")] - public System.DateTime? CreatedTime { get; private set; } - - /// - /// Gets domain expiration timestamp. - /// - [JsonProperty(PropertyName = "properties.expirationTime")] - public System.DateTime? ExpirationTime { get; private set; } - - /// - /// Gets timestamp when the domain was renewed last time. - /// - [JsonProperty(PropertyName = "properties.lastRenewedTime")] - public System.DateTime? LastRenewedTime { get; private set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// domain should be automatically renewed; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.autoRenew")] + /// Domain creation timestamp. + public DateTimeOffset? CreatedTime { get; } + /// Domain expiration timestamp. + public DateTimeOffset? ExpirationTime { get; } + /// Timestamp when the domain was renewed last time. + public DateTimeOffset? LastRenewedTime { get; } + /// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>. public bool? AutoRenew { get; set; } - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if Azure can - /// assign this domain to App Service apps; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. This value will be - /// &lt;code&gt;true&lt;/code&gt; if domain - /// registration status is active and - /// it is hosted on name servers Azure has programmatic access to. + /// <code>true</code> if Azure can assign this domain to App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain registration status is active and + /// it is hosted on name servers Azure has programmatic access to. /// - [JsonProperty(PropertyName = "properties.readyForDnsRecordManagement")] - public bool? ReadyForDnsRecordManagement { get; private set; } - - /// - /// Gets all hostnames derived from the domain and assigned to Azure - /// resources. - /// - [JsonProperty(PropertyName = "properties.managedHostNames")] - public IList ManagedHostNames { get; private set; } - - /// - /// Gets or sets legal agreement consent. - /// - [JsonProperty(PropertyName = "properties.consent")] + public bool? ReadyForDnsRecordManagement { get; } + /// All hostnames derived from the domain and assigned to Azure resources. + public IReadOnlyList ManagedHostNames { get; } + /// Legal agreement consent. public DomainPurchaseConsent Consent { get; set; } - - /// - /// Gets reasons why domain is not renewable. - /// - [JsonProperty(PropertyName = "properties.domainNotRenewableReasons")] - public IList DomainNotRenewableReasons { get; private set; } - - /// - /// Gets or sets current DNS type. Possible values include: 'AzureDns', - /// 'DefaultDomainRegistrarDns' - /// - [JsonProperty(PropertyName = "properties.dnsType")] + /// Reasons why domain is not renewable. + public IReadOnlyList DomainNotRenewableReasons { get; } + /// Current DNS type. public DnsType? DnsType { get; set; } - - /// - /// Gets or sets azure DNS Zone to use - /// - [JsonProperty(PropertyName = "properties.dnsZoneId")] + /// Azure DNS Zone to use. public string DnsZoneId { get; set; } - - /// - /// Gets or sets target DNS type (would be used for migration). - /// Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' - /// - [JsonProperty(PropertyName = "properties.targetDnsType")] + /// Target DNS type (would be used for migration). public DnsType? TargetDnsType { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.authCode")] public string AuthCode { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ContactAdmin == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ContactAdmin"); - } - if (ContactBilling == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ContactBilling"); - } - if (ContactRegistrant == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ContactRegistrant"); - } - if (ContactTech == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ContactTech"); - } - if (Consent == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Consent"); - } - if (ContactAdmin != null) - { - ContactAdmin.Validate(); - } - if (ContactBilling != null) - { - ContactBilling.Validate(); - } - if (ContactRegistrant != null) - { - ContactRegistrant.Validate(); - } - if (ContactTech != null) - { - ContactTech.Validate(); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.cs new file mode 100644 index 000000000000..02264a158168 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The DomainPatchResourcePropertiesDomainNotRenewableReasonsItem. + public readonly partial struct DomainPatchResourcePropertiesDomainNotRenewableReasonsItem : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegistrationStatusNotSupportedForRenewalValue = "RegistrationStatusNotSupportedForRenewal"; + private const string ExpirationNotInRenewalTimeRangeValue = "ExpirationNotInRenewalTimeRange"; + private const string SubscriptionNotActiveValue = "SubscriptionNotActive"; + + /// RegistrationStatusNotSupportedForRenewal. + public static DomainPatchResourcePropertiesDomainNotRenewableReasonsItem RegistrationStatusNotSupportedForRenewal { get; } = new DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(RegistrationStatusNotSupportedForRenewalValue); + /// ExpirationNotInRenewalTimeRange. + public static DomainPatchResourcePropertiesDomainNotRenewableReasonsItem ExpirationNotInRenewalTimeRange { get; } = new DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(ExpirationNotInRenewalTimeRangeValue); + /// SubscriptionNotActive. + public static DomainPatchResourcePropertiesDomainNotRenewableReasonsItem SubscriptionNotActive { get; } = new DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(SubscriptionNotActiveValue); + /// Determines if two values are the same. + public static bool operator ==(DomainPatchResourcePropertiesDomainNotRenewableReasonsItem left, DomainPatchResourcePropertiesDomainNotRenewableReasonsItem right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DomainPatchResourcePropertiesDomainNotRenewableReasonsItem left, DomainPatchResourcePropertiesDomainNotRenewableReasonsItem right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(string value) => new DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DomainPatchResourcePropertiesDomainNotRenewableReasonsItem other && Equals(other); + /// + public bool Equals(DomainPatchResourcePropertiesDomainNotRenewableReasonsItem other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPropertiesDomainNotRenewableReasonsItem.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPropertiesDomainNotRenewableReasonsItem.cs new file mode 100644 index 000000000000..3ab804b7c942 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPropertiesDomainNotRenewableReasonsItem.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The DomainPropertiesDomainNotRenewableReasonsItem. + public readonly partial struct DomainPropertiesDomainNotRenewableReasonsItem : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public DomainPropertiesDomainNotRenewableReasonsItem(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegistrationStatusNotSupportedForRenewalValue = "RegistrationStatusNotSupportedForRenewal"; + private const string ExpirationNotInRenewalTimeRangeValue = "ExpirationNotInRenewalTimeRange"; + private const string SubscriptionNotActiveValue = "SubscriptionNotActive"; + + /// RegistrationStatusNotSupportedForRenewal. + public static DomainPropertiesDomainNotRenewableReasonsItem RegistrationStatusNotSupportedForRenewal { get; } = new DomainPropertiesDomainNotRenewableReasonsItem(RegistrationStatusNotSupportedForRenewalValue); + /// ExpirationNotInRenewalTimeRange. + public static DomainPropertiesDomainNotRenewableReasonsItem ExpirationNotInRenewalTimeRange { get; } = new DomainPropertiesDomainNotRenewableReasonsItem(ExpirationNotInRenewalTimeRangeValue); + /// SubscriptionNotActive. + public static DomainPropertiesDomainNotRenewableReasonsItem SubscriptionNotActive { get; } = new DomainPropertiesDomainNotRenewableReasonsItem(SubscriptionNotActiveValue); + /// Determines if two values are the same. + public static bool operator ==(DomainPropertiesDomainNotRenewableReasonsItem left, DomainPropertiesDomainNotRenewableReasonsItem right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DomainPropertiesDomainNotRenewableReasonsItem left, DomainPropertiesDomainNotRenewableReasonsItem right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DomainPropertiesDomainNotRenewableReasonsItem(string value) => new DomainPropertiesDomainNotRenewableReasonsItem(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DomainPropertiesDomainNotRenewableReasonsItem other && Equals(other); + /// + public bool Equals(DomainPropertiesDomainNotRenewableReasonsItem other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.Serialization.cs new file mode 100644 index 000000000000..172fe85d5060 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DomainPurchaseConsent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AgreementKeys)) + { + writer.WritePropertyName("agreementKeys"); + writer.WriteStartArray(); + foreach (var item in AgreementKeys) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AgreedBy)) + { + writer.WritePropertyName("agreedBy"); + writer.WriteStringValue(AgreedBy); + } + if (Optional.IsDefined(AgreedAt)) + { + writer.WritePropertyName("agreedAt"); + writer.WriteStringValue(AgreedAt.Value, "O"); + } + writer.WriteEndObject(); + } + + internal static DomainPurchaseConsent DeserializeDomainPurchaseConsent(JsonElement element) + { + Optional> agreementKeys = default; + Optional agreedBy = default; + Optional agreedAt = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("agreementKeys")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + agreementKeys = array; + continue; + } + if (property.NameEquals("agreedBy")) + { + agreedBy = property.Value.GetString(); + continue; + } + if (property.NameEquals("agreedAt")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + agreedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new DomainPurchaseConsent(Optional.ToList(agreementKeys), agreedBy.Value, Optional.ToNullable(agreedAt)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.cs index 3142541d154d..9ac8fc58cfe7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.cs @@ -1,75 +1,41 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Domain purchase consent object, representing acceptance of applicable - /// legal agreements. - /// + /// Domain purchase consent object, representing acceptance of applicable legal agreements. public partial class DomainPurchaseConsent { - /// - /// Initializes a new instance of the DomainPurchaseConsent class. - /// + /// Initializes a new instance of DomainPurchaseConsent. public DomainPurchaseConsent() { - CustomInit(); + AgreementKeys = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the DomainPurchaseConsent class. - /// - /// List of applicable legal agreement - /// keys. This list can be retrieved using ListLegalAgreements API - /// under <code>TopLevelDomain</code> resource. - /// Client IP address. - /// Timestamp when the agreements were - /// accepted. - public DomainPurchaseConsent(IList agreementKeys = default(IList), string agreedBy = default(string), System.DateTime? agreedAt = default(System.DateTime?)) + /// Initializes a new instance of DomainPurchaseConsent. + /// List of applicable legal agreement keys. This list can be retrieved using ListLegalAgreements API under <code>TopLevelDomain</code> resource. + /// Client IP address. + /// Timestamp when the agreements were accepted. + internal DomainPurchaseConsent(IList agreementKeys, string agreedBy, DateTimeOffset? agreedAt) { AgreementKeys = agreementKeys; AgreedBy = agreedBy; AgreedAt = agreedAt; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of applicable legal agreement keys. This list can - /// be retrieved using ListLegalAgreements API under - /// &lt;code&gt;TopLevelDomain&lt;/code&gt; resource. - /// - [JsonProperty(PropertyName = "agreementKeys")] - public IList AgreementKeys { get; set; } - - /// - /// Gets or sets client IP address. - /// - [JsonProperty(PropertyName = "agreedBy")] + /// List of applicable legal agreement keys. This list can be retrieved using ListLegalAgreements API under <code>TopLevelDomain</code> resource. + public IList AgreementKeys { get; } + /// Client IP address. public string AgreedBy { get; set; } - - /// - /// Gets or sets timestamp when the agreements were accepted. - /// - [JsonProperty(PropertyName = "agreedAt")] - public System.DateTime? AgreedAt { get; set; } - + /// Timestamp when the agreements were accepted. + public DateTimeOffset? AgreedAt { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.Serialization.cs new file mode 100644 index 000000000000..443b7a2ebb8c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.Serialization.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class DomainRecommendationSearchParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Keywords)) + { + writer.WritePropertyName("keywords"); + writer.WriteStringValue(Keywords); + } + if (Optional.IsDefined(MaxDomainRecommendations)) + { + writer.WritePropertyName("maxDomainRecommendations"); + writer.WriteNumberValue(MaxDomainRecommendations.Value); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.cs index c425a7cfabb5..8ca2bf8028dd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.cs @@ -1,64 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Domain recommendation search parameters. - /// + /// Domain recommendation search parameters. public partial class DomainRecommendationSearchParameters { - /// - /// Initializes a new instance of the - /// DomainRecommendationSearchParameters class. - /// + /// Initializes a new instance of DomainRecommendationSearchParameters. public DomainRecommendationSearchParameters() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// DomainRecommendationSearchParameters class. - /// - /// Keywords to be used for generating domain - /// recommendations. - /// Maximum number of - /// recommendations. - public DomainRecommendationSearchParameters(string keywords = default(string), int? maxDomainRecommendations = default(int?)) - { - Keywords = keywords; - MaxDomainRecommendations = maxDomainRecommendations; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets keywords to be used for generating domain - /// recommendations. - /// - [JsonProperty(PropertyName = "keywords")] + /// Keywords to be used for generating domain recommendations. public string Keywords { get; set; } - - /// - /// Gets or sets maximum number of recommendations. - /// - [JsonProperty(PropertyName = "maxDomainRecommendations")] + /// Maximum number of recommendations. public int? MaxDomainRecommendations { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.Serialization.cs new file mode 100644 index 000000000000..3901684eabb9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.Serialization.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class DomainStatusExtensions + { + public static string ToSerialString(this DomainStatus value) => value switch + { + DomainStatus.Active => "Active", + DomainStatus.Awaiting => "Awaiting", + DomainStatus.Cancelled => "Cancelled", + DomainStatus.Confiscated => "Confiscated", + DomainStatus.Disabled => "Disabled", + DomainStatus.Excluded => "Excluded", + DomainStatus.Expired => "Expired", + DomainStatus.Failed => "Failed", + DomainStatus.Held => "Held", + DomainStatus.Locked => "Locked", + DomainStatus.Parked => "Parked", + DomainStatus.Pending => "Pending", + DomainStatus.Reserved => "Reserved", + DomainStatus.Reverted => "Reverted", + DomainStatus.Suspended => "Suspended", + DomainStatus.Transferred => "Transferred", + DomainStatus.Unknown => "Unknown", + DomainStatus.Unlocked => "Unlocked", + DomainStatus.Unparked => "Unparked", + DomainStatus.Updated => "Updated", + DomainStatus.JsonConverterFailed => "JsonConverterFailed", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DomainStatus value.") + }; + + public static DomainStatus ToDomainStatus(this string value) + { + if (string.Equals(value, "Active", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Active; + if (string.Equals(value, "Awaiting", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Awaiting; + if (string.Equals(value, "Cancelled", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Cancelled; + if (string.Equals(value, "Confiscated", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Confiscated; + if (string.Equals(value, "Disabled", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Disabled; + if (string.Equals(value, "Excluded", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Excluded; + if (string.Equals(value, "Expired", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Expired; + if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Failed; + if (string.Equals(value, "Held", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Held; + if (string.Equals(value, "Locked", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Locked; + if (string.Equals(value, "Parked", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Parked; + if (string.Equals(value, "Pending", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Pending; + if (string.Equals(value, "Reserved", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Reserved; + if (string.Equals(value, "Reverted", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Reverted; + if (string.Equals(value, "Suspended", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Suspended; + if (string.Equals(value, "Transferred", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Transferred; + if (string.Equals(value, "Unknown", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Unknown; + if (string.Equals(value, "Unlocked", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Unlocked; + if (string.Equals(value, "Unparked", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Unparked; + if (string.Equals(value, "Updated", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Updated; + if (string.Equals(value, "JsonConverterFailed", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.JsonConverterFailed; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DomainStatus value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.cs index d9b9caa8e3cd..efe0fb81a74a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.cs @@ -1,174 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for DomainStatus. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Domain registration status. public enum DomainStatus { - [EnumMember(Value = "Active")] + /// Active. Active, - [EnumMember(Value = "Awaiting")] + /// Awaiting. Awaiting, - [EnumMember(Value = "Cancelled")] + /// Cancelled. Cancelled, - [EnumMember(Value = "Confiscated")] + /// Confiscated. Confiscated, - [EnumMember(Value = "Disabled")] + /// Disabled. Disabled, - [EnumMember(Value = "Excluded")] + /// Excluded. Excluded, - [EnumMember(Value = "Expired")] + /// Expired. Expired, - [EnumMember(Value = "Failed")] + /// Failed. Failed, - [EnumMember(Value = "Held")] + /// Held. Held, - [EnumMember(Value = "Locked")] + /// Locked. Locked, - [EnumMember(Value = "Parked")] + /// Parked. Parked, - [EnumMember(Value = "Pending")] + /// Pending. Pending, - [EnumMember(Value = "Reserved")] + /// Reserved. Reserved, - [EnumMember(Value = "Reverted")] + /// Reverted. Reverted, - [EnumMember(Value = "Suspended")] + /// Suspended. Suspended, - [EnumMember(Value = "Transferred")] + /// Transferred. Transferred, - [EnumMember(Value = "Unknown")] + /// Unknown. Unknown, - [EnumMember(Value = "Unlocked")] + /// Unlocked. Unlocked, - [EnumMember(Value = "Unparked")] + /// Unparked. Unparked, - [EnumMember(Value = "Updated")] + /// Updated. Updated, - [EnumMember(Value = "JsonConverterFailed")] + /// JsonConverterFailed. JsonConverterFailed } - internal static class DomainStatusEnumExtension - { - internal static string ToSerializedValue(this DomainStatus? value) - { - return value == null ? null : ((DomainStatus)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this DomainStatus value) - { - switch( value ) - { - case DomainStatus.Active: - return "Active"; - case DomainStatus.Awaiting: - return "Awaiting"; - case DomainStatus.Cancelled: - return "Cancelled"; - case DomainStatus.Confiscated: - return "Confiscated"; - case DomainStatus.Disabled: - return "Disabled"; - case DomainStatus.Excluded: - return "Excluded"; - case DomainStatus.Expired: - return "Expired"; - case DomainStatus.Failed: - return "Failed"; - case DomainStatus.Held: - return "Held"; - case DomainStatus.Locked: - return "Locked"; - case DomainStatus.Parked: - return "Parked"; - case DomainStatus.Pending: - return "Pending"; - case DomainStatus.Reserved: - return "Reserved"; - case DomainStatus.Reverted: - return "Reverted"; - case DomainStatus.Suspended: - return "Suspended"; - case DomainStatus.Transferred: - return "Transferred"; - case DomainStatus.Unknown: - return "Unknown"; - case DomainStatus.Unlocked: - return "Unlocked"; - case DomainStatus.Unparked: - return "Unparked"; - case DomainStatus.Updated: - return "Updated"; - case DomainStatus.JsonConverterFailed: - return "JsonConverterFailed"; - } - return null; - } - - internal static DomainStatus? ParseDomainStatus(this string value) - { - switch( value ) - { - case "Active": - return DomainStatus.Active; - case "Awaiting": - return DomainStatus.Awaiting; - case "Cancelled": - return DomainStatus.Cancelled; - case "Confiscated": - return DomainStatus.Confiscated; - case "Disabled": - return DomainStatus.Disabled; - case "Excluded": - return DomainStatus.Excluded; - case "Expired": - return DomainStatus.Expired; - case "Failed": - return DomainStatus.Failed; - case "Held": - return DomainStatus.Held; - case "Locked": - return DomainStatus.Locked; - case "Parked": - return DomainStatus.Parked; - case "Pending": - return DomainStatus.Pending; - case "Reserved": - return DomainStatus.Reserved; - case "Reverted": - return DomainStatus.Reverted; - case "Suspended": - return DomainStatus.Suspended; - case "Transferred": - return DomainStatus.Transferred; - case "Unknown": - return DomainStatus.Unknown; - case "Unlocked": - return DomainStatus.Unlocked; - case "Unparked": - return DomainStatus.Unparked; - case "Updated": - return DomainStatus.Updated; - case "JsonConverterFailed": - return DomainStatus.JsonConverterFailed; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.Serialization.cs new file mode 100644 index 000000000000..c0de1c41365d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class DomainTypeExtensions + { + public static string ToSerialString(this DomainType value) => value switch + { + DomainType.Regular => "Regular", + DomainType.SoftDeleted => "SoftDeleted", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DomainType value.") + }; + + public static DomainType ToDomainType(this string value) + { + if (string.Equals(value, "Regular", StringComparison.InvariantCultureIgnoreCase)) return DomainType.Regular; + if (string.Equals(value, "SoftDeleted", StringComparison.InvariantCultureIgnoreCase)) return DomainType.SoftDeleted; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DomainType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.cs index a3892f6545e3..2e0d28556298 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for DomainType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Valid values are Regular domain: Azure will charge the full price of domain registration, SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost anything. public enum DomainType { - [EnumMember(Value = "Regular")] + /// Regular. Regular, - [EnumMember(Value = "SoftDeleted")] + /// SoftDeleted. SoftDeleted } - internal static class DomainTypeEnumExtension - { - internal static string ToSerializedValue(this DomainType? value) - { - return value == null ? null : ((DomainType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this DomainType value) - { - switch( value ) - { - case DomainType.Regular: - return "Regular"; - case DomainType.SoftDeleted: - return "SoftDeleted"; - } - return null; - } - - internal static DomainType? ParseDomainType(this string value) - { - switch( value ) - { - case "Regular": - return DomainType.Regular; - case "SoftDeleted": - return DomainType.SoftDeleted; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.Serialization.cs new file mode 100644 index 000000000000..d983aa000134 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class EnabledConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + writer.WriteEndObject(); + } + + internal static EnabledConfig DeserializeEnabledConfig(JsonElement element) + { + Optional enabled = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + } + return new EnabledConfig(Optional.ToNullable(enabled)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.cs index 787276cb500e..77307144d024 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.cs @@ -1,53 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Enabled configuration. - /// + /// Enabled configuration. public partial class EnabledConfig { - /// - /// Initializes a new instance of the EnabledConfig class. - /// + /// Initializes a new instance of EnabledConfig. public EnabledConfig() { - CustomInit(); } - /// - /// Initializes a new instance of the EnabledConfig class. - /// - /// True if configuration is enabled, false if it - /// is disabled and null if configuration is not set. - public EnabledConfig(bool? enabled = default(bool?)) + /// Initializes a new instance of EnabledConfig. + /// True if configuration is enabled, false if it is disabled and null if configuration is not set. + internal EnabledConfig(bool? enabled) { Enabled = enabled; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets true if configuration is enabled, false if it is - /// disabled and null if configuration is not set. - /// - [JsonProperty(PropertyName = "enabled")] + /// True if configuration is enabled, false if it is disabled and null if configuration is not set. public bool? Enabled { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.Serialization.cs new file mode 100644 index 000000000000..1e49db8d3fe6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class EndpointDependency + { + internal static EndpointDependency DeserializeEndpointDependency(JsonElement element) + { + Optional domainName = default; + Optional> endpointDetails = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("domainName")) + { + domainName = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpointDetails")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDetail.DeserializeEndpointDetail(item)); + } + endpointDetails = array; + continue; + } + } + return new EndpointDependency(domainName.Value, Optional.ToList(endpointDetails)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.cs index a5cdde253b60..9dd441818f66 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.cs @@ -1,64 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A domain name that a service is reached at, including details of the - /// current connection status. - /// + /// A domain name that a service is reached at, including details of the current connection status. public partial class EndpointDependency { - /// - /// Initializes a new instance of the EndpointDependency class. - /// - public EndpointDependency() + /// Initializes a new instance of EndpointDependency. + internal EndpointDependency() { - CustomInit(); + EndpointDetails = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the EndpointDependency class. - /// - /// The domain name of the dependency. - /// The IP Addresses and Ports used when - /// connecting to DomainName. - public EndpointDependency(string domainName = default(string), IList endpointDetails = default(IList)) + /// Initializes a new instance of EndpointDependency. + /// The domain name of the dependency. + /// The IP Addresses and Ports used when connecting to DomainName. + internal EndpointDependency(string domainName, IReadOnlyList endpointDetails) { DomainName = domainName; EndpointDetails = endpointDetails; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the domain name of the dependency. - /// - [JsonProperty(PropertyName = "domainName")] - public string DomainName { get; set; } - - /// - /// Gets or sets the IP Addresses and Ports used when connecting to - /// DomainName. - /// - [JsonProperty(PropertyName = "endpointDetails")] - public IList EndpointDetails { get; set; } - + /// The domain name of the dependency. + public string DomainName { get; } + /// The IP Addresses and Ports used when connecting to DomainName. + public IReadOnlyList EndpointDetails { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.Serialization.cs new file mode 100644 index 000000000000..706325e80dfa --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class EndpointDetail + { + internal static EndpointDetail DeserializeEndpointDetail(JsonElement element) + { + Optional ipAddress = default; + Optional port = default; + Optional latency = default; + Optional isAccessible = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipAddress")) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("port")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + port = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("latency")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + latency = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("isAccessible")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isAccessible = property.Value.GetBoolean(); + continue; + } + } + return new EndpointDetail(ipAddress.Value, Optional.ToNullable(port), Optional.ToNullable(latency), Optional.ToNullable(isAccessible)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.cs index 427ffe880862..cce246a9ce5c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.cs @@ -1,84 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Current TCP connectivity information from the App Service Environment - /// to a single endpoint. - /// + /// Current TCP connectivity information from the App Service Environment to a single endpoint. public partial class EndpointDetail { - /// - /// Initializes a new instance of the EndpointDetail class. - /// - public EndpointDetail() + /// Initializes a new instance of EndpointDetail. + internal EndpointDetail() { - CustomInit(); } - /// - /// Initializes a new instance of the EndpointDetail class. - /// - /// An IP Address that Domain Name currently - /// resolves to. - /// The port an endpoint is connected to. - /// The time in milliseconds it takes for a TCP - /// connection to be created from the App Service Environment to this - /// IpAddress at this Port. - /// Whether it is possible to create a TCP - /// connection from the App Service Environment to this IpAddress at - /// this Port. - public EndpointDetail(string ipAddress = default(string), int? port = default(int?), double? latency = default(double?), bool? isAccessible = default(bool?)) + /// Initializes a new instance of EndpointDetail. + /// An IP Address that Domain Name currently resolves to. + /// The port an endpoint is connected to. + /// The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. + /// Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. + internal EndpointDetail(string ipAddress, int? port, double? latency, bool? isAccessible) { IpAddress = ipAddress; Port = port; Latency = latency; IsAccessible = isAccessible; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets an IP Address that Domain Name currently resolves to. - /// - [JsonProperty(PropertyName = "ipAddress")] - public string IpAddress { get; set; } - - /// - /// Gets or sets the port an endpoint is connected to. - /// - [JsonProperty(PropertyName = "port")] - public int? Port { get; set; } - - /// - /// Gets or sets the time in milliseconds it takes for a TCP connection - /// to be created from the App Service Environment to this IpAddress at - /// this Port. - /// - [JsonProperty(PropertyName = "latency")] - public double? Latency { get; set; } - - /// - /// Gets or sets whether it is possible to create a TCP connection from - /// the App Service Environment to this IpAddress at this Port. - /// - [JsonProperty(PropertyName = "isAccessible")] - public bool? IsAccessible { get; set; } - + /// An IP Address that Domain Name currently resolves to. + public string IpAddress { get; } + /// The port an endpoint is connected to. + public int? Port { get; } + /// The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. + public double? Latency { get; } + /// Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. + public bool? IsAccessible { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum4.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum4.cs new file mode 100644 index 000000000000..18b450f41e98 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum4.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The Enum4. + public readonly partial struct Enum4 : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public Enum4(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WindowsValue = "Windows"; + private const string LinuxValue = "Linux"; + private const string WindowsFunctionsValue = "WindowsFunctions"; + private const string LinuxFunctionsValue = "LinuxFunctions"; + private const string AllValue = "All"; + + /// Windows. + public static Enum4 Windows { get; } = new Enum4(WindowsValue); + /// Linux. + public static Enum4 Linux { get; } = new Enum4(LinuxValue); + /// WindowsFunctions. + public static Enum4 WindowsFunctions { get; } = new Enum4(WindowsFunctionsValue); + /// LinuxFunctions. + public static Enum4 LinuxFunctions { get; } = new Enum4(LinuxFunctionsValue); + /// All. + public static Enum4 All { get; } = new Enum4(AllValue); + /// Determines if two values are the same. + public static bool operator ==(Enum4 left, Enum4 right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Enum4 left, Enum4 right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Enum4(string value) => new Enum4(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Enum4 other && Equals(other); + /// + public bool Equals(Enum4 other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum5.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum5.cs new file mode 100644 index 000000000000..0909773eaddc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum5.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The Enum5. + public readonly partial struct Enum5 : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public Enum5(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WindowsValue = "Windows"; + private const string LinuxValue = "Linux"; + private const string AllValue = "All"; + + /// Windows. + public static Enum5 Windows { get; } = new Enum5(WindowsValue); + /// Linux. + public static Enum5 Linux { get; } = new Enum5(LinuxValue); + /// All. + public static Enum5 All { get; } = new Enum5(AllValue); + /// Determines if two values are the same. + public static bool operator ==(Enum5 left, Enum5 right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Enum5 left, Enum5 right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Enum5(string value) => new Enum5(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Enum5 other && Equals(other); + /// + public bool Equals(Enum5 other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum6.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum6.cs new file mode 100644 index 000000000000..f378a8aad425 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum6.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The Enum6. + public readonly partial struct Enum6 : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public Enum6(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WindowsValue = "Windows"; + private const string LinuxValue = "Linux"; + private const string AllValue = "All"; + + /// Windows. + public static Enum6 Windows { get; } = new Enum6(WindowsValue); + /// Linux. + public static Enum6 Linux { get; } = new Enum6(LinuxValue); + /// All. + public static Enum6 All { get; } = new Enum6(AllValue); + /// Determines if two values are the same. + public static bool operator ==(Enum6 left, Enum6 right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Enum6 left, Enum6 right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Enum6(string value) => new Enum6(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Enum6 other && Equals(other); + /// + public bool Equals(Enum6 other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum7.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum7.cs new file mode 100644 index 000000000000..5e6bae7eb178 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum7.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The Enum7. + public readonly partial struct Enum7 : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public Enum7(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WindowsValue = "Windows"; + private const string LinuxValue = "Linux"; + private const string AllValue = "All"; + + /// Windows. + public static Enum7 Windows { get; } = new Enum7(WindowsValue); + /// Linux. + public static Enum7 Linux { get; } = new Enum7(LinuxValue); + /// All. + public static Enum7 All { get; } = new Enum7(AllValue); + /// Determines if two values are the same. + public static bool operator ==(Enum7 left, Enum7 right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Enum7 left, Enum7 right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Enum7(string value) => new Enum7(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Enum7 other && Equals(other); + /// + public bool Equals(Enum7 other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum8.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum8.cs new file mode 100644 index 000000000000..5460e500f7a1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum8.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The Enum8. + public readonly partial struct Enum8 : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public Enum8(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WindowsValue = "Windows"; + private const string LinuxValue = "Linux"; + private const string AllValue = "All"; + + /// Windows. + public static Enum8 Windows { get; } = new Enum8(WindowsValue); + /// Linux. + public static Enum8 Linux { get; } = new Enum8(LinuxValue); + /// All. + public static Enum8 All { get; } = new Enum8(AllValue); + /// Determines if two values are the same. + public static bool operator ==(Enum8 left, Enum8 right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Enum8 left, Enum8 right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Enum8(string value) => new Enum8(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Enum8 other && Equals(other); + /// + public bool Equals(Enum8 other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum9.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum9.cs new file mode 100644 index 000000000000..82bb56efaa07 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum9.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The Enum9. + public readonly partial struct Enum9 : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public Enum9(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WindowsValue = "Windows"; + private const string LinuxValue = "Linux"; + private const string WindowsFunctionsValue = "WindowsFunctions"; + private const string LinuxFunctionsValue = "LinuxFunctions"; + private const string AllValue = "All"; + + /// Windows. + public static Enum9 Windows { get; } = new Enum9(WindowsValue); + /// Linux. + public static Enum9 Linux { get; } = new Enum9(LinuxValue); + /// WindowsFunctions. + public static Enum9 WindowsFunctions { get; } = new Enum9(WindowsFunctionsValue); + /// LinuxFunctions. + public static Enum9 LinuxFunctions { get; } = new Enum9(LinuxFunctionsValue); + /// All. + public static Enum9 All { get; } = new Enum9(AllValue); + /// Determines if two values are the same. + public static bool operator ==(Enum9 left, Enum9 right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Enum9 left, Enum9 right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Enum9(string value) => new Enum9(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Enum9 other && Equals(other); + /// + public bool Equals(Enum9 other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.Serialization.cs new file mode 100644 index 000000000000..89267735fe22 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.Serialization.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ErrorEntity + { + internal static ErrorEntity DeserializeErrorEntity(JsonElement element) + { + Optional extendedCode = default; + Optional messageTemplate = default; + Optional> parameters = default; + Optional> innerErrors = default; + Optional code = default; + Optional message = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("extendedCode")) + { + extendedCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("messageTemplate")) + { + messageTemplate = property.Value.GetString(); + continue; + } + if (property.NameEquals("parameters")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parameters = array; + continue; + } + if (property.NameEquals("innerErrors")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeErrorEntity(item)); + } + innerErrors = array; + continue; + } + if (property.NameEquals("code")) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + } + return new ErrorEntity(extendedCode.Value, messageTemplate.Value, Optional.ToList(parameters), Optional.ToList(innerErrors), code.Value, message.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.cs index d4452c070a90..1446ae3a9e84 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.cs @@ -1,43 +1,33 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Body of the error response returned from the API. - /// + /// Body of the error response returned from the API. public partial class ErrorEntity { - /// - /// Initializes a new instance of the ErrorEntity class. - /// - public ErrorEntity() + /// Initializes a new instance of ErrorEntity. + internal ErrorEntity() { - CustomInit(); + Parameters = new ChangeTrackingList(); + InnerErrors = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the ErrorEntity class. - /// - /// Type of error. - /// Message template. - /// Parameters for the template. - /// Inner errors. - /// Basic error code. - /// Any details of the error. - public ErrorEntity(string extendedCode = default(string), string messageTemplate = default(string), IList parameters = default(IList), IList innerErrors = default(IList), string code = default(string), string message = default(string)) + /// Initializes a new instance of ErrorEntity. + /// Type of error. + /// Message template. + /// Parameters for the template. + /// Inner errors. + /// Basic error code. + /// Any details of the error. + internal ErrorEntity(string extendedCode, string messageTemplate, IReadOnlyList parameters, IReadOnlyList innerErrors, string code, string message) { ExtendedCode = extendedCode; MessageTemplate = messageTemplate; @@ -45,49 +35,19 @@ public ErrorEntity() InnerErrors = innerErrors; Code = code; Message = message; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets type of error. - /// - [JsonProperty(PropertyName = "extendedCode")] - public string ExtendedCode { get; set; } - - /// - /// Gets or sets message template. - /// - [JsonProperty(PropertyName = "messageTemplate")] - public string MessageTemplate { get; set; } - - /// - /// Gets or sets parameters for the template. - /// - [JsonProperty(PropertyName = "parameters")] - public IList Parameters { get; set; } - - /// - /// Gets or sets inner errors. - /// - [JsonProperty(PropertyName = "innerErrors")] - public IList InnerErrors { get; set; } - - /// - /// Gets or sets basic error code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets any details of the error. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - + /// Type of error. + public string ExtendedCode { get; } + /// Message template. + public string MessageTemplate { get; } + /// Parameters for the template. + public IReadOnlyList Parameters { get; } + /// Inner errors. + public IReadOnlyList InnerErrors { get; } + /// Basic error code. + public string Code { get; } + /// Any details of the error. + public string Message { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.Serialization.cs new file mode 100644 index 000000000000..0d4485ce9df6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Experiments : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(RampUpRules)) + { + writer.WritePropertyName("rampUpRules"); + writer.WriteStartArray(); + foreach (var item in RampUpRules) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static Experiments DeserializeExperiments(JsonElement element) + { + Optional> rampUpRules = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rampUpRules")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RampUpRule.DeserializeRampUpRule(item)); + } + rampUpRules = array; + continue; + } + } + return new Experiments(Optional.ToList(rampUpRules)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.cs index 291d41df9dbc..e07a90bd0cff 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.cs @@ -1,53 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Routing rules in production experiments. - /// + /// Routing rules in production experiments. public partial class Experiments { - /// - /// Initializes a new instance of the Experiments class. - /// + /// Initializes a new instance of Experiments. public Experiments() { - CustomInit(); + RampUpRules = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the Experiments class. - /// - /// List of ramp-up rules. - public Experiments(IList rampUpRules = default(IList)) + /// Initializes a new instance of Experiments. + /// List of ramp-up rules. + internal Experiments(IList rampUpRules) { RampUpRules = rampUpRules; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of ramp-up rules. - /// - [JsonProperty(PropertyName = "rampUpRules")] - public IList RampUpRules { get; set; } - + /// List of ramp-up rules. + public IList RampUpRules { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.Serialization.cs new file mode 100644 index 000000000000..a6207ed66f3c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Facebook : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Registration)) + { + writer.WritePropertyName("registration"); + writer.WriteObjectValue(Registration); + } + if (Optional.IsDefined(GraphApiVersion)) + { + writer.WritePropertyName("graphApiVersion"); + writer.WriteStringValue(GraphApiVersion); + } + if (Optional.IsDefined(Login)) + { + writer.WritePropertyName("login"); + writer.WriteObjectValue(Login); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Facebook DeserializeFacebook(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional registration = default; + Optional graphApiVersion = default; + Optional login = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("registration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + registration = AppRegistration.DeserializeAppRegistration(property0.Value); + continue; + } + if (property0.NameEquals("graphApiVersion")) + { + graphApiVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("login")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + login = LoginScopes.DeserializeLoginScopes(property0.Value); + continue; + } + } + continue; + } + } + return new Facebook(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, graphApiVersion.Value, login.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.cs index 5d66f50d57a6..02a69c1711e3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.cs @@ -1,72 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the Facebook provider. public partial class Facebook : ProxyOnlyResource { - /// - /// Initializes a new instance of the Facebook class. - /// + /// Initializes a new instance of Facebook. public Facebook() { - CustomInit(); } - /// - /// Initializes a new instance of the Facebook class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public Facebook(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), AppRegistration registration = default(AppRegistration), string graphApiVersion = default(string), LoginScopes login = default(LoginScopes)) - : base(id, name, kind, type) + /// Initializes a new instance of Facebook. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the Facebook provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// The configuration settings of the app registration for the Facebook provider. + /// The version of the Facebook api to be used while logging in. + /// The configuration settings of the login flow. + internal Facebook(string id, string name, string kind, string type, bool? enabled, AppRegistration registration, string graphApiVersion, LoginScopes login) : base(id, name, kind, type) { Enabled = enabled; Registration = registration; GraphApiVersion = graphApiVersion; Login = login; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// <code>false</code> if the Facebook provider should not be enabled despite the set registration; otherwise, <code>true</code>. public bool? Enabled { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.registration")] + /// The configuration settings of the app registration for the Facebook provider. public AppRegistration Registration { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.graphApiVersion")] + /// The version of the Facebook api to be used while logging in. public string GraphApiVersion { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.login")] + /// The configuration settings of the login flow. public LoginScopes Login { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.Serialization.cs new file mode 100644 index 000000000000..165f8ccc726a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class FileSystemApplicationLogsConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Level)) + { + writer.WritePropertyName("level"); + writer.WriteStringValue(Level.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + internal static FileSystemApplicationLogsConfig DeserializeFileSystemApplicationLogsConfig(JsonElement element) + { + Optional level = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("level")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + level = property.Value.GetString().ToLogLevel(); + continue; + } + } + return new FileSystemApplicationLogsConfig(Optional.ToNullable(level)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.cs index 2146691d95fd..1e9bade1d96f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.cs @@ -1,55 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Application logs to file system configuration. - /// + /// Application logs to file system configuration. public partial class FileSystemApplicationLogsConfig { - /// - /// Initializes a new instance of the FileSystemApplicationLogsConfig - /// class. - /// + /// Initializes a new instance of FileSystemApplicationLogsConfig. public FileSystemApplicationLogsConfig() { - CustomInit(); } - /// - /// Initializes a new instance of the FileSystemApplicationLogsConfig - /// class. - /// - /// Log level. Possible values include: 'Off', - /// 'Verbose', 'Information', 'Warning', 'Error' - public FileSystemApplicationLogsConfig(LogLevel? level = default(LogLevel?)) + /// Initializes a new instance of FileSystemApplicationLogsConfig. + /// Log level. + internal FileSystemApplicationLogsConfig(LogLevel? level) { Level = level; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets log level. Possible values include: 'Off', 'Verbose', - /// 'Information', 'Warning', 'Error' - /// - [JsonProperty(PropertyName = "level")] + /// Log level. public LogLevel? Level { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.Serialization.cs new file mode 100644 index 000000000000..8ef865dcbcc6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.Serialization.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class FileSystemHttpLogsConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(RetentionInMb)) + { + writer.WritePropertyName("retentionInMb"); + writer.WriteNumberValue(RetentionInMb.Value); + } + if (Optional.IsDefined(RetentionInDays)) + { + writer.WritePropertyName("retentionInDays"); + writer.WriteNumberValue(RetentionInDays.Value); + } + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + writer.WriteEndObject(); + } + + internal static FileSystemHttpLogsConfig DeserializeFileSystemHttpLogsConfig(JsonElement element) + { + Optional retentionInMb = default; + Optional retentionInDays = default; + Optional enabled = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("retentionInMb")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + retentionInMb = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("retentionInDays")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + retentionInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("enabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + } + return new FileSystemHttpLogsConfig(Optional.ToNullable(retentionInMb), Optional.ToNullable(retentionInDays), Optional.ToNullable(enabled)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.cs index 67c7356df574..673aebf44fea 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.cs @@ -1,98 +1,52 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Http logs to file system configuration. - /// + /// Http logs to file system configuration. public partial class FileSystemHttpLogsConfig { - /// - /// Initializes a new instance of the FileSystemHttpLogsConfig class. - /// + /// Initializes a new instance of FileSystemHttpLogsConfig. public FileSystemHttpLogsConfig() { - CustomInit(); } - /// - /// Initializes a new instance of the FileSystemHttpLogsConfig class. - /// - /// Maximum size in megabytes that http log - /// files can use. - /// When reached old log files will be removed to make space for new - /// ones. - /// Value can range between 25 and 100. - /// Retention in days. + /// Initializes a new instance of FileSystemHttpLogsConfig. + /// + /// Maximum size in megabytes that http log files can use. + /// When reached old log files will be removed to make space for new ones. + /// Value can range between 25 and 100. + /// + /// + /// Retention in days. /// Remove files older than X days. - /// 0 or lower means no retention. - /// True if configuration is enabled, false if it - /// is disabled and null if configuration is not set. - public FileSystemHttpLogsConfig(int? retentionInMb = default(int?), int? retentionInDays = default(int?), bool? enabled = default(bool?)) + /// 0 or lower means no retention. + /// + /// True if configuration is enabled, false if it is disabled and null if configuration is not set. + internal FileSystemHttpLogsConfig(int? retentionInMb, int? retentionInDays, bool? enabled) { RetentionInMb = retentionInMb; RetentionInDays = retentionInDays; Enabled = enabled; - CustomInit(); } /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets maximum size in megabytes that http log files can use. - /// When reached old log files will be removed to make space for new - /// ones. + /// Maximum size in megabytes that http log files can use. + /// When reached old log files will be removed to make space for new ones. /// Value can range between 25 and 100. /// - [JsonProperty(PropertyName = "retentionInMb")] public int? RetentionInMb { get; set; } - /// - /// Gets or sets retention in days. + /// Retention in days. /// Remove files older than X days. /// 0 or lower means no retention. /// - [JsonProperty(PropertyName = "retentionInDays")] public int? RetentionInDays { get; set; } - - /// - /// Gets or sets true if configuration is enabled, false if it is - /// disabled and null if configuration is not set. - /// - [JsonProperty(PropertyName = "enabled")] + /// True if configuration is enabled, false if it is disabled and null if configuration is not set. public bool? Enabled { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (RetentionInMb > 100) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInMb", 100); - } - if (RetentionInMb < 25) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInMb", 25); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.Serialization.cs new file mode 100644 index 000000000000..8f7c3ed6c432 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class FileSystemTokenStore : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Directory)) + { + writer.WritePropertyName("directory"); + writer.WriteStringValue(Directory); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static FileSystemTokenStore DeserializeFileSystemTokenStore(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional directory = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("directory")) + { + directory = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new FileSystemTokenStore(id.Value, name.Value, kind.Value, type.Value, directory.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.cs index d56ea63988fe..ec75ac5e0cee 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.cs @@ -1,54 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the storage of the tokens if a file system is used. public partial class FileSystemTokenStore : ProxyOnlyResource { - /// - /// Initializes a new instance of the FileSystemTokenStore class. - /// + /// Initializes a new instance of FileSystemTokenStore. public FileSystemTokenStore() { - CustomInit(); } - /// - /// Initializes a new instance of the FileSystemTokenStore class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public FileSystemTokenStore(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string directory = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of FileSystemTokenStore. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The directory in which the tokens will be stored. + internal FileSystemTokenStore(string id, string name, string kind, string type, string directory) : base(id, name, kind, type) { Directory = directory; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.directory")] + /// The directory in which the tokens will be stored. public string Directory { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.Serialization.cs new file mode 100644 index 000000000000..96e1a74cbf7a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.Serialization.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ForwardProxy : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Convention)) + { + writer.WritePropertyName("convention"); + writer.WriteStringValue(Convention.Value.ToSerialString()); + } + if (Optional.IsDefined(CustomHostHeaderName)) + { + writer.WritePropertyName("customHostHeaderName"); + writer.WriteStringValue(CustomHostHeaderName); + } + if (Optional.IsDefined(CustomProtoHeaderName)) + { + writer.WritePropertyName("customProtoHeaderName"); + writer.WriteStringValue(CustomProtoHeaderName); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ForwardProxy DeserializeForwardProxy(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional convention = default; + Optional customHostHeaderName = default; + Optional customProtoHeaderName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("convention")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + convention = property0.Value.GetString().ToForwardProxyConvention(); + continue; + } + if (property0.NameEquals("customHostHeaderName")) + { + customHostHeaderName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("customProtoHeaderName")) + { + customProtoHeaderName = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new ForwardProxy(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(convention), customHostHeaderName.Value, customProtoHeaderName.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.cs index 239718fe2b4e..29c9e8c00713 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.cs @@ -1,70 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of a forward proxy used to make the requests. public partial class ForwardProxy : ProxyOnlyResource { - /// - /// Initializes a new instance of the ForwardProxy class. - /// + /// Initializes a new instance of ForwardProxy. public ForwardProxy() { - CustomInit(); } - /// - /// Initializes a new instance of the ForwardProxy class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Possible values include: 'NoProxy', - /// 'Standard', 'Custom' - public ForwardProxy(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ForwardProxyConvention? convention = default(ForwardProxyConvention?), string customHostHeaderName = default(string), string customProtoHeaderName = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of ForwardProxy. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The convention used to determine the url of the request made. + /// The name of the header containing the host of the request. + /// The name of the header containing the scheme of the request. + internal ForwardProxy(string id, string name, string kind, string type, ForwardProxyConvention? convention, string customHostHeaderName, string customProtoHeaderName) : base(id, name, kind, type) { Convention = convention; CustomHostHeaderName = customHostHeaderName; CustomProtoHeaderName = customProtoHeaderName; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets possible values include: 'NoProxy', 'Standard', - /// 'Custom' - /// - [JsonProperty(PropertyName = "properties.convention")] + /// The convention used to determine the url of the request made. public ForwardProxyConvention? Convention { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.customHostHeaderName")] + /// The name of the header containing the host of the request. public string CustomHostHeaderName { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.customProtoHeaderName")] + /// The name of the header containing the scheme of the request. public string CustomProtoHeaderName { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.Serialization.cs new file mode 100644 index 000000000000..cc9ef47da1ec --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class ForwardProxyConventionExtensions + { + public static string ToSerialString(this ForwardProxyConvention value) => value switch + { + ForwardProxyConvention.NoProxy => "NoProxy", + ForwardProxyConvention.Standard => "Standard", + ForwardProxyConvention.Custom => "Custom", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ForwardProxyConvention value.") + }; + + public static ForwardProxyConvention ToForwardProxyConvention(this string value) + { + if (string.Equals(value, "NoProxy", StringComparison.InvariantCultureIgnoreCase)) return ForwardProxyConvention.NoProxy; + if (string.Equals(value, "Standard", StringComparison.InvariantCultureIgnoreCase)) return ForwardProxyConvention.Standard; + if (string.Equals(value, "Custom", StringComparison.InvariantCultureIgnoreCase)) return ForwardProxyConvention.Custom; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ForwardProxyConvention value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.cs index 2f44e3cd8e45..988d5fa90f1b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ForwardProxyConvention. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// The convention used to determine the url of the request made. public enum ForwardProxyConvention { - [EnumMember(Value = "NoProxy")] + /// NoProxy. NoProxy, - [EnumMember(Value = "Standard")] + /// Standard. Standard, - [EnumMember(Value = "Custom")] + /// Custom. Custom } - internal static class ForwardProxyConventionEnumExtension - { - internal static string ToSerializedValue(this ForwardProxyConvention? value) - { - return value == null ? null : ((ForwardProxyConvention)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ForwardProxyConvention value) - { - switch( value ) - { - case ForwardProxyConvention.NoProxy: - return "NoProxy"; - case ForwardProxyConvention.Standard: - return "Standard"; - case ForwardProxyConvention.Custom: - return "Custom"; - } - return null; - } - - internal static ForwardProxyConvention? ParseForwardProxyConvention(this string value) - { - switch( value ) - { - case "NoProxy": - return ForwardProxyConvention.NoProxy; - case "Standard": - return ForwardProxyConvention.Standard; - case "Custom": - return ForwardProxyConvention.Custom; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.Serialization.cs new file mode 100644 index 000000000000..6ea7f77e4c57 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class FrequencyUnitExtensions + { + public static string ToSerialString(this FrequencyUnit value) => value switch + { + FrequencyUnit.Day => "Day", + FrequencyUnit.Hour => "Hour", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FrequencyUnit value.") + }; + + public static FrequencyUnit ToFrequencyUnit(this string value) + { + if (string.Equals(value, "Day", StringComparison.InvariantCultureIgnoreCase)) return FrequencyUnit.Day; + if (string.Equals(value, "Hour", StringComparison.InvariantCultureIgnoreCase)) return FrequencyUnit.Hour; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FrequencyUnit value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.cs index ad2b69d824cd..b665316a8aff 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for FrequencyUnit. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). public enum FrequencyUnit { - [EnumMember(Value = "Day")] + /// Day. Day, - [EnumMember(Value = "Hour")] + /// Hour. Hour } - internal static class FrequencyUnitEnumExtension - { - internal static string ToSerializedValue(this FrequencyUnit? value) - { - return value == null ? null : ((FrequencyUnit)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this FrequencyUnit value) - { - switch( value ) - { - case FrequencyUnit.Day: - return "Day"; - case FrequencyUnit.Hour: - return "Hour"; - } - return null; - } - - internal static FrequencyUnit? ParseFrequencyUnit(this string value) - { - switch( value ) - { - case "Day": - return FrequencyUnit.Day; - case "Hour": - return FrequencyUnit.Hour; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FtpsState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FtpsState.cs index 481d92f38573..0fda6f449bc4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FtpsState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FtpsState.cs @@ -1,23 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for FtpsState. - /// - public static class FtpsState + /// State of FTP / FTPS service. + public readonly partial struct FtpsState : IEquatable { - public const string AllAllowed = "AllAllowed"; - public const string FtpsOnly = "FtpsOnly"; - public const string Disabled = "Disabled"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public FtpsState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AllAllowedValue = "AllAllowed"; + private const string FtpsOnlyValue = "FtpsOnly"; + private const string DisabledValue = "Disabled"; + + /// AllAllowed. + public static FtpsState AllAllowed { get; } = new FtpsState(AllAllowedValue); + /// FtpsOnly. + public static FtpsState FtpsOnly { get; } = new FtpsState(FtpsOnlyValue); + /// Disabled. + public static FtpsState Disabled { get; } = new FtpsState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(FtpsState left, FtpsState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FtpsState left, FtpsState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FtpsState(string value) => new FtpsState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FtpsState other && Equals(other); + /// + public bool Equals(FtpsState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.Serialization.cs new file mode 100644 index 000000000000..cdaf8be2eb89 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class FunctionAppMajorVersion + { + internal static FunctionAppMajorVersion DeserializeFunctionAppMajorVersion(JsonElement element) + { + Optional displayText = default; + Optional value = default; + Optional> minorVersions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayText")) + { + displayText = property.Value.GetString(); + continue; + } + if (property.NameEquals("value")) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("minorVersions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FunctionAppMinorVersion.DeserializeFunctionAppMinorVersion(item)); + } + minorVersions = array; + continue; + } + } + return new FunctionAppMajorVersion(displayText.Value, value.Value, Optional.ToList(minorVersions)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs new file mode 100644 index 000000000000..96b0ea0c7990 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Function App stack major version. + public partial class FunctionAppMajorVersion + { + /// Initializes a new instance of FunctionAppMajorVersion. + internal FunctionAppMajorVersion() + { + MinorVersions = new ChangeTrackingList(); + } + + /// Initializes a new instance of FunctionAppMajorVersion. + /// Function App stack major version (display only). + /// Function App stack major version name. + /// Minor versions associated with the major version. + internal FunctionAppMajorVersion(string displayText, string value, IReadOnlyList minorVersions) + { + DisplayText = displayText; + Value = value; + MinorVersions = minorVersions; + } + + /// Function App stack major version (display only). + public string DisplayText { get; } + /// Function App stack major version name. + public string Value { get; } + /// Minor versions associated with the major version. + public IReadOnlyList MinorVersions { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.Serialization.cs new file mode 100644 index 000000000000..d790410bb25c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class FunctionAppMinorVersion + { + internal static FunctionAppMinorVersion DeserializeFunctionAppMinorVersion(JsonElement element) + { + Optional displayText = default; + Optional value = default; + Optional stackSettings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayText")) + { + displayText = property.Value.GetString(); + continue; + } + if (property.NameEquals("value")) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("stackSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + stackSettings = FunctionAppRuntimes.DeserializeFunctionAppRuntimes(property.Value); + continue; + } + } + return new FunctionAppMinorVersion(displayText.Value, value.Value, stackSettings.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs new file mode 100644 index 000000000000..2f6bc197b7b4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Function App stack minor version. + public partial class FunctionAppMinorVersion + { + /// Initializes a new instance of FunctionAppMinorVersion. + internal FunctionAppMinorVersion() + { + } + + /// Initializes a new instance of FunctionAppMinorVersion. + /// Function App stack (display only). + /// Function App stack name. + /// Settings associated with the minor version. + internal FunctionAppMinorVersion(string displayText, string value, FunctionAppRuntimes stackSettings) + { + DisplayText = displayText; + Value = value; + StackSettings = stackSettings; + } + + /// Function App stack (display only). + public string DisplayText { get; } + /// Function App stack name. + public string Value { get; } + /// Settings associated with the minor version. + public FunctionAppRuntimes StackSettings { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.Serialization.cs new file mode 100644 index 000000000000..79ec2f390a9d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.Serialization.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class FunctionAppRuntimeSettings + { + internal static FunctionAppRuntimeSettings DeserializeFunctionAppRuntimeSettings(JsonElement element) + { + Optional runtimeVersion = default; + Optional remoteDebuggingSupported = default; + Optional appInsightsSettings = default; + Optional gitHubActionSettings = default; + Optional> appSettingsDictionary = default; + Optional siteConfigPropertiesDictionary = default; + Optional> supportedFunctionsExtensionVersions = default; + Optional isPreview = default; + Optional isDeprecated = default; + Optional isHidden = default; + Optional endOfLifeDate = default; + Optional isAutoUpdate = default; + Optional isEarlyAccess = default; + Optional isDefault = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("runtimeVersion")) + { + runtimeVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("remoteDebuggingSupported")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + remoteDebuggingSupported = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("appInsightsSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + appInsightsSettings = AppInsightsWebAppStackSettings.DeserializeAppInsightsWebAppStackSettings(property.Value); + continue; + } + if (property.NameEquals("gitHubActionSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + gitHubActionSettings = GitHubActionWebAppStackSettings.DeserializeGitHubActionWebAppStackSettings(property.Value); + continue; + } + if (property.NameEquals("appSettingsDictionary")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + appSettingsDictionary = dictionary; + continue; + } + if (property.NameEquals("siteConfigPropertiesDictionary")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + siteConfigPropertiesDictionary = SiteConfigPropertiesDictionary.DeserializeSiteConfigPropertiesDictionary(property.Value); + continue; + } + if (property.NameEquals("supportedFunctionsExtensionVersions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedFunctionsExtensionVersions = array; + continue; + } + if (property.NameEquals("isPreview")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isPreview = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isDeprecated")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isDeprecated = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isHidden")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isHidden = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("endOfLifeDate")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + endOfLifeDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isAutoUpdate")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isAutoUpdate = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isEarlyAccess")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isEarlyAccess = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isDefault")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isDefault = property.Value.GetBoolean(); + continue; + } + } + return new FunctionAppRuntimeSettings(runtimeVersion.Value, Optional.ToNullable(remoteDebuggingSupported), appInsightsSettings.Value, gitHubActionSettings.Value, Optional.ToDictionary(appSettingsDictionary), siteConfigPropertiesDictionary.Value, Optional.ToList(supportedFunctionsExtensionVersions), Optional.ToNullable(isPreview), Optional.ToNullable(isDeprecated), Optional.ToNullable(isHidden), Optional.ToNullable(endOfLifeDate), Optional.ToNullable(isAutoUpdate), Optional.ToNullable(isEarlyAccess), Optional.ToNullable(isDefault)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs new file mode 100644 index 000000000000..292c666d4ae5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Function App runtime settings. + public partial class FunctionAppRuntimeSettings + { + /// Initializes a new instance of FunctionAppRuntimeSettings. + internal FunctionAppRuntimeSettings() + { + AppSettingsDictionary = new ChangeTrackingDictionary(); + SupportedFunctionsExtensionVersions = new ChangeTrackingList(); + } + + /// Initializes a new instance of FunctionAppRuntimeSettings. + /// Function App stack minor version (runtime only). + /// <code>true</code> if remote debugging is supported for the stack; otherwise, <code>false</code>. + /// Application Insights settings associated with the minor version. + /// GitHub Actions settings associated with the minor version. + /// Application settings associated with the minor version. + /// Configuration settings associated with the minor version. + /// List of supported Functions extension versions. + /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. + /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. + /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. + /// End-of-life date for the minor version. + /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. + /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. + /// <code>true</code> if the minor version the default; otherwise, <code>false</code>. + internal FunctionAppRuntimeSettings(string runtimeVersion, bool? remoteDebuggingSupported, AppInsightsWebAppStackSettings appInsightsSettings, GitHubActionWebAppStackSettings gitHubActionSettings, IReadOnlyDictionary appSettingsDictionary, SiteConfigPropertiesDictionary siteConfigPropertiesDictionary, IReadOnlyList supportedFunctionsExtensionVersions, bool? isPreview, bool? isDeprecated, bool? isHidden, DateTimeOffset? endOfLifeDate, bool? isAutoUpdate, bool? isEarlyAccess, bool? isDefault) + { + RuntimeVersion = runtimeVersion; + RemoteDebuggingSupported = remoteDebuggingSupported; + AppInsightsSettings = appInsightsSettings; + GitHubActionSettings = gitHubActionSettings; + AppSettingsDictionary = appSettingsDictionary; + SiteConfigPropertiesDictionary = siteConfigPropertiesDictionary; + SupportedFunctionsExtensionVersions = supportedFunctionsExtensionVersions; + IsPreview = isPreview; + IsDeprecated = isDeprecated; + IsHidden = isHidden; + EndOfLifeDate = endOfLifeDate; + IsAutoUpdate = isAutoUpdate; + IsEarlyAccess = isEarlyAccess; + IsDefault = isDefault; + } + + /// Function App stack minor version (runtime only). + public string RuntimeVersion { get; } + /// <code>true</code> if remote debugging is supported for the stack; otherwise, <code>false</code>. + public bool? RemoteDebuggingSupported { get; } + /// Application Insights settings associated with the minor version. + public AppInsightsWebAppStackSettings AppInsightsSettings { get; } + /// GitHub Actions settings associated with the minor version. + public GitHubActionWebAppStackSettings GitHubActionSettings { get; } + /// Application settings associated with the minor version. + public IReadOnlyDictionary AppSettingsDictionary { get; } + /// Configuration settings associated with the minor version. + public SiteConfigPropertiesDictionary SiteConfigPropertiesDictionary { get; } + /// List of supported Functions extension versions. + public IReadOnlyList SupportedFunctionsExtensionVersions { get; } + /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. + public bool? IsPreview { get; } + /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. + public bool? IsDeprecated { get; } + /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. + public bool? IsHidden { get; } + /// End-of-life date for the minor version. + public DateTimeOffset? EndOfLifeDate { get; } + /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. + public bool? IsAutoUpdate { get; } + /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. + public bool? IsEarlyAccess { get; } + /// <code>true</code> if the minor version the default; otherwise, <code>false</code>. + public bool? IsDefault { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.Serialization.cs new file mode 100644 index 000000000000..8b5fa723278c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class FunctionAppRuntimes + { + internal static FunctionAppRuntimes DeserializeFunctionAppRuntimes(JsonElement element) + { + Optional linuxRuntimeSettings = default; + Optional windowsRuntimeSettings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("linuxRuntimeSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + linuxRuntimeSettings = FunctionAppRuntimeSettings.DeserializeFunctionAppRuntimeSettings(property.Value); + continue; + } + if (property.NameEquals("windowsRuntimeSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + windowsRuntimeSettings = FunctionAppRuntimeSettings.DeserializeFunctionAppRuntimeSettings(property.Value); + continue; + } + } + return new FunctionAppRuntimes(linuxRuntimeSettings.Value, windowsRuntimeSettings.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs new file mode 100644 index 000000000000..359592061547 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Function App stack runtimes. + public partial class FunctionAppRuntimes + { + /// Initializes a new instance of FunctionAppRuntimes. + internal FunctionAppRuntimes() + { + } + + /// Initializes a new instance of FunctionAppRuntimes. + /// Linux-specific settings associated with the minor version. + /// Windows-specific settings associated with the minor version. + internal FunctionAppRuntimes(FunctionAppRuntimeSettings linuxRuntimeSettings, FunctionAppRuntimeSettings windowsRuntimeSettings) + { + LinuxRuntimeSettings = linuxRuntimeSettings; + WindowsRuntimeSettings = windowsRuntimeSettings; + } + + /// Linux-specific settings associated with the minor version. + public FunctionAppRuntimeSettings LinuxRuntimeSettings { get; } + /// Windows-specific settings associated with the minor version. + public FunctionAppRuntimeSettings WindowsRuntimeSettings { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.Serialization.cs new file mode 100644 index 000000000000..458fecb2ac7f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class FunctionAppStack : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static FunctionAppStack DeserializeFunctionAppStack(JsonElement element) + { + Optional location = default; + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional displayText = default; + Optional value = default; + Optional> majorVersions = default; + Optional preferredOs = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("displayText")) + { + displayText = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("value")) + { + value = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("majorVersions")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(FunctionAppMajorVersion.DeserializeFunctionAppMajorVersion(item)); + } + majorVersions = array; + continue; + } + if (property0.NameEquals("preferredOs")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + preferredOs = property0.Value.GetString().ToStackPreferredOs(); + continue; + } + } + continue; + } + } + return new FunctionAppStack(id.Value, name.Value, kind.Value, type.Value, location.Value, displayText.Value, value.Value, Optional.ToList(majorVersions), Optional.ToNullable(preferredOs)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs new file mode 100644 index 000000000000..6bcf94102a54 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Function App Stack. + public partial class FunctionAppStack : ProxyOnlyResource + { + /// Initializes a new instance of FunctionAppStack. + public FunctionAppStack() + { + MajorVersions = new ChangeTrackingList(); + } + + /// Initializes a new instance of FunctionAppStack. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Function App stack location. + /// Function App stack (display only). + /// Function App stack name. + /// List of major versions available. + /// Function App stack preferred OS. + internal FunctionAppStack(string id, string name, string kind, string type, string location, string displayText, string value, IReadOnlyList majorVersions, StackPreferredOs? preferredOs) : base(id, name, kind, type) + { + Location = location; + DisplayText = displayText; + Value = value; + MajorVersions = majorVersions; + PreferredOs = preferredOs; + } + + /// Function App stack location. + public string Location { get; } + /// Function App stack (display only). + public string DisplayText { get; } + /// Function App stack name. + public string Value { get; } + /// List of major versions available. + public IReadOnlyList MajorVersions { get; } + /// Function App stack preferred OS. + public StackPreferredOs? PreferredOs { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.Serialization.cs new file mode 100644 index 000000000000..326127a02cf7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class FunctionAppStackCollection + { + internal static FunctionAppStackCollection DeserializeFunctionAppStackCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FunctionAppStack.DeserializeFunctionAppStack(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new FunctionAppStackCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.cs new file mode 100644 index 000000000000..0f23617867f3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Function app Stacks. + internal partial class FunctionAppStackCollection + { + /// Initializes a new instance of FunctionAppStackCollection. + /// Collection of resources. + /// is null. + internal FunctionAppStackCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of FunctionAppStackCollection. + /// Collection of resources. + /// Link to next page of resources. + internal FunctionAppStackCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.Serialization.cs new file mode 100644 index 000000000000..215f44cdb359 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.Serialization.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class FunctionEnvelope : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(FunctionAppId)) + { + writer.WritePropertyName("function_app_id"); + writer.WriteStringValue(FunctionAppId); + } + if (Optional.IsDefined(ScriptRootPathHref)) + { + writer.WritePropertyName("script_root_path_href"); + writer.WriteStringValue(ScriptRootPathHref); + } + if (Optional.IsDefined(ScriptHref)) + { + writer.WritePropertyName("script_href"); + writer.WriteStringValue(ScriptHref); + } + if (Optional.IsDefined(ConfigHref)) + { + writer.WritePropertyName("config_href"); + writer.WriteStringValue(ConfigHref); + } + if (Optional.IsDefined(TestDataHref)) + { + writer.WritePropertyName("test_data_href"); + writer.WriteStringValue(TestDataHref); + } + if (Optional.IsDefined(SecretsFileHref)) + { + writer.WritePropertyName("secrets_file_href"); + writer.WriteStringValue(SecretsFileHref); + } + if (Optional.IsDefined(Href)) + { + writer.WritePropertyName("href"); + writer.WriteStringValue(Href); + } + if (Optional.IsDefined(Config)) + { + writer.WritePropertyName("config"); + writer.WriteObjectValue(Config); + } + if (Optional.IsCollectionDefined(Files)) + { + writer.WritePropertyName("files"); + writer.WriteStartObject(); + foreach (var item in Files) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(TestData)) + { + writer.WritePropertyName("test_data"); + writer.WriteStringValue(TestData); + } + if (Optional.IsDefined(InvokeUrlTemplate)) + { + writer.WritePropertyName("invoke_url_template"); + writer.WriteStringValue(InvokeUrlTemplate); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(IsDisabled)) + { + writer.WritePropertyName("isDisabled"); + writer.WriteBooleanValue(IsDisabled.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static FunctionEnvelope DeserializeFunctionEnvelope(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional functionAppId = default; + Optional scriptRootPathHref = default; + Optional scriptHref = default; + Optional configHref = default; + Optional testDataHref = default; + Optional secretsFileHref = default; + Optional href = default; + Optional config = default; + Optional> files = default; + Optional testData = default; + Optional invokeUrlTemplate = default; + Optional language = default; + Optional isDisabled = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("function_app_id")) + { + functionAppId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("script_root_path_href")) + { + scriptRootPathHref = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("script_href")) + { + scriptHref = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("config_href")) + { + configHref = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("test_data_href")) + { + testDataHref = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("secrets_file_href")) + { + secretsFileHref = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("href")) + { + href = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("config")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + config = property0.Value.GetObject(); + continue; + } + if (property0.NameEquals("files")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + files = dictionary; + continue; + } + if (property0.NameEquals("test_data")) + { + testData = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("invoke_url_template")) + { + invokeUrlTemplate = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("language")) + { + language = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("isDisabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isDisabled = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new FunctionEnvelope(id.Value, name.Value, kind.Value, type.Value, functionAppId.Value, scriptRootPathHref.Value, scriptHref.Value, configHref.Value, testDataHref.Value, secretsFileHref.Value, href.Value, config.Value, Optional.ToDictionary(files), testData.Value, invokeUrlTemplate.Value, language.Value, Optional.ToNullable(isDisabled)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.cs index 0e0627a92be9..a7533e9295bc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.cs @@ -1,60 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Function information. - /// - [Rest.Serialization.JsonTransformation] + /// Function information. public partial class FunctionEnvelope : ProxyOnlyResource { - /// - /// Initializes a new instance of the FunctionEnvelope class. - /// + /// Initializes a new instance of FunctionEnvelope. public FunctionEnvelope() { - CustomInit(); + Files = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the FunctionEnvelope class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Function App ID. - /// Script root path URI. - /// Script URI. - /// Config URI. - /// Test data URI. - /// Secrets file URI. - /// Function URI. - /// Config information. - /// File list. - /// Test data used when testing via the Azure - /// Portal. - /// The invocation URL - /// The function language - /// Gets or sets a value indicating whether - /// the function is disabled - public FunctionEnvelope(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string functionAppId = default(string), string scriptRootPathHref = default(string), string scriptHref = default(string), string configHref = default(string), string testDataHref = default(string), string secretsFileHref = default(string), string href = default(string), object config = default(object), IDictionary files = default(IDictionary), string testData = default(string), string invokeUrlTemplate = default(string), string language = default(string), bool? isDisabled = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of FunctionEnvelope. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Function App ID. + /// Script root path URI. + /// Script URI. + /// Config URI. + /// Test data URI. + /// Secrets file URI. + /// Function URI. + /// Config information. + /// File list. + /// Test data used when testing via the Azure Portal. + /// The invocation URL. + /// The function language. + /// Gets or sets a value indicating whether the function is disabled. + internal FunctionEnvelope(string id, string name, string kind, string type, string functionAppId, string scriptRootPathHref, string scriptHref, string configHref, string testDataHref, string secretsFileHref, string href, object config, IDictionary files, string testData, string invokeUrlTemplate, string language, bool? isDisabled) : base(id, name, kind, type) { FunctionAppId = functionAppId; ScriptRootPathHref = scriptRootPathHref; @@ -69,91 +52,33 @@ public FunctionEnvelope() InvokeUrlTemplate = invokeUrlTemplate; Language = language; IsDisabled = isDisabled; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets function App ID. - /// - [JsonProperty(PropertyName = "properties.function_app_id")] + /// Function App ID. public string FunctionAppId { get; set; } - - /// - /// Gets or sets script root path URI. - /// - [JsonProperty(PropertyName = "properties.script_root_path_href")] + /// Script root path URI. public string ScriptRootPathHref { get; set; } - - /// - /// Gets or sets script URI. - /// - [JsonProperty(PropertyName = "properties.script_href")] + /// Script URI. public string ScriptHref { get; set; } - - /// - /// Gets or sets config URI. - /// - [JsonProperty(PropertyName = "properties.config_href")] + /// Config URI. public string ConfigHref { get; set; } - - /// - /// Gets or sets test data URI. - /// - [JsonProperty(PropertyName = "properties.test_data_href")] + /// Test data URI. public string TestDataHref { get; set; } - - /// - /// Gets or sets secrets file URI. - /// - [JsonProperty(PropertyName = "properties.secrets_file_href")] + /// Secrets file URI. public string SecretsFileHref { get; set; } - - /// - /// Gets or sets function URI. - /// - [JsonProperty(PropertyName = "properties.href")] + /// Function URI. public string Href { get; set; } - - /// - /// Gets or sets config information. - /// - [JsonProperty(PropertyName = "properties.config")] + /// Config information. public object Config { get; set; } - - /// - /// Gets or sets file list. - /// - [JsonProperty(PropertyName = "properties.files")] - public IDictionary Files { get; set; } - - /// - /// Gets or sets test data used when testing via the Azure Portal. - /// - [JsonProperty(PropertyName = "properties.test_data")] + /// File list. + public IDictionary Files { get; } + /// Test data used when testing via the Azure Portal. public string TestData { get; set; } - - /// - /// Gets or sets the invocation URL - /// - [JsonProperty(PropertyName = "properties.invoke_url_template")] + /// The invocation URL. public string InvokeUrlTemplate { get; set; } - - /// - /// Gets or sets the function language - /// - [JsonProperty(PropertyName = "properties.language")] + /// The function language. public string Language { get; set; } - - /// - /// Gets or sets a value indicating whether the function is disabled - /// - [JsonProperty(PropertyName = "properties.isDisabled")] + /// Gets or sets a value indicating whether the function is disabled. public bool? IsDisabled { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.Serialization.cs new file mode 100644 index 000000000000..58787280bb91 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class FunctionEnvelopeCollection + { + internal static FunctionEnvelopeCollection DeserializeFunctionEnvelopeCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FunctionEnvelope.DeserializeFunctionEnvelope(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new FunctionEnvelopeCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.cs new file mode 100644 index 000000000000..3fad76327e5f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Kudu function information elements. + internal partial class FunctionEnvelopeCollection + { + /// Initializes a new instance of FunctionEnvelopeCollection. + /// Collection of resources. + /// is null. + internal FunctionEnvelopeCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of FunctionEnvelopeCollection. + /// Collection of resources. + /// Link to next page of resources. + internal FunctionEnvelopeCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.Serialization.cs new file mode 100644 index 000000000000..ae9ec835007b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class FunctionSecrets + { + internal static FunctionSecrets DeserializeFunctionSecrets(JsonElement element) + { + Optional key = default; + Optional triggerUrl = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key")) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("trigger_url")) + { + triggerUrl = property.Value.GetString(); + continue; + } + } + return new FunctionSecrets(key.Value, triggerUrl.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.cs index 402dfca0c929..1d8acfaab5b5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Function secrets. - /// + /// Function secrets. public partial class FunctionSecrets { - /// - /// Initializes a new instance of the FunctionSecrets class. - /// - public FunctionSecrets() + /// Initializes a new instance of FunctionSecrets. + internal FunctionSecrets() { - CustomInit(); } - /// - /// Initializes a new instance of the FunctionSecrets class. - /// - /// Secret key. - /// Trigger URL. - public FunctionSecrets(string key = default(string), string triggerUrl = default(string)) + /// Initializes a new instance of FunctionSecrets. + /// Secret key. + /// Trigger URL. + internal FunctionSecrets(string key, string triggerUrl) { Key = key; TriggerUrl = triggerUrl; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets secret key. - /// - [JsonProperty(PropertyName = "key")] - public string Key { get; set; } - - /// - /// Gets or sets trigger URL. - /// - [JsonProperty(PropertyName = "trigger_url")] - public string TriggerUrl { get; set; } - + /// Secret key. + public string Key { get; } + /// Trigger URL. + public string TriggerUrl { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.Serialization.cs new file mode 100644 index 000000000000..c0b3acd3634c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.Serialization.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class GeoRegion : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static GeoRegion DeserializeGeoRegion(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional description = default; + Optional displayName = default; + Optional orgDomain = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("description")) + { + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("displayName")) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("orgDomain")) + { + orgDomain = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new GeoRegion(id.Value, name.Value, kind.Value, type.Value, description.Value, displayName.Value, orgDomain.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.cs index e39413ff64dd..04cc371f150f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.cs @@ -1,75 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Geographical region. - /// - [Rest.Serialization.JsonTransformation] + /// Geographical region. public partial class GeoRegion : ProxyOnlyResource { - /// - /// Initializes a new instance of the GeoRegion class. - /// + /// Initializes a new instance of GeoRegion. public GeoRegion() { - CustomInit(); } - /// - /// Initializes a new instance of the GeoRegion class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Region description. - /// Display name for region. - /// Display name for region. - public GeoRegion(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string description = default(string), string displayName = default(string), string orgDomain = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of GeoRegion. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Region description. + /// Display name for region. + /// Display name for region. + internal GeoRegion(string id, string name, string kind, string type, string description, string displayName, string orgDomain) : base(id, name, kind, type) { Description = description; DisplayName = displayName; OrgDomain = orgDomain; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets region description. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } - - /// - /// Gets display name for region. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets display name for region. - /// - [JsonProperty(PropertyName = "properties.orgDomain")] - public string OrgDomain { get; private set; } - + /// Region description. + public string Description { get; } + /// Display name for region. + public string DisplayName { get; } + /// Display name for region. + public string OrgDomain { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.Serialization.cs new file mode 100644 index 000000000000..cd2c70829d70 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class GeoRegionCollection + { + internal static GeoRegionCollection DeserializeGeoRegionCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GeoRegion.DeserializeGeoRegion(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new GeoRegionCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.cs new file mode 100644 index 000000000000..d181f6a0f88c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of geographical regions. + internal partial class GeoRegionCollection + { + /// Initializes a new instance of GeoRegionCollection. + /// Collection of resources. + /// is null. + internal GeoRegionCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of GeoRegionCollection. + /// Collection of resources. + /// Link to next page of resources. + internal GeoRegionCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.Serialization.cs new file mode 100644 index 000000000000..0c62ec03307a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class GitHub : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Registration)) + { + writer.WritePropertyName("registration"); + writer.WriteObjectValue(Registration); + } + if (Optional.IsDefined(Login)) + { + writer.WritePropertyName("login"); + writer.WriteObjectValue(Login); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static GitHub DeserializeGitHub(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional registration = default; + Optional login = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("registration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + registration = ClientRegistration.DeserializeClientRegistration(property0.Value); + continue; + } + if (property0.NameEquals("login")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + login = LoginScopes.DeserializeLoginScopes(property0.Value); + continue; + } + } + continue; + } + } + return new GitHub(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, login.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.cs index 8555c23b8f92..71d7d2064421 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.cs @@ -1,66 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the GitHub provider. public partial class GitHub : ProxyOnlyResource { - /// - /// Initializes a new instance of the GitHub class. - /// + /// Initializes a new instance of GitHub. public GitHub() { - CustomInit(); } - /// - /// Initializes a new instance of the GitHub class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public GitHub(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), ClientRegistration registration = default(ClientRegistration), LoginScopes login = default(LoginScopes)) - : base(id, name, kind, type) + /// Initializes a new instance of GitHub. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the GitHub provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// The configuration settings of the app registration for the GitHub provider. + /// The configuration settings of the login flow. + internal GitHub(string id, string name, string kind, string type, bool? enabled, ClientRegistration registration, LoginScopes login) : base(id, name, kind, type) { Enabled = enabled; Registration = registration; Login = login; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// <code>false</code> if the GitHub provider should not be enabled despite the set registration; otherwise, <code>true</code>. public bool? Enabled { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.registration")] + /// The configuration settings of the app registration for the GitHub provider. public ClientRegistration Registration { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.login")] + /// The configuration settings of the login flow. public LoginScopes Login { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.Serialization.cs new file mode 100644 index 000000000000..81799ac465a1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class GitHubActionCodeConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(RuntimeStack)) + { + writer.WritePropertyName("runtimeStack"); + writer.WriteStringValue(RuntimeStack); + } + if (Optional.IsDefined(RuntimeVersion)) + { + writer.WritePropertyName("runtimeVersion"); + writer.WriteStringValue(RuntimeVersion); + } + writer.WriteEndObject(); + } + + internal static GitHubActionCodeConfiguration DeserializeGitHubActionCodeConfiguration(JsonElement element) + { + Optional runtimeStack = default; + Optional runtimeVersion = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("runtimeStack")) + { + runtimeStack = property.Value.GetString(); + continue; + } + if (property.NameEquals("runtimeVersion")) + { + runtimeVersion = property.Value.GetString(); + continue; + } + } + return new GitHubActionCodeConfiguration(runtimeStack.Value, runtimeVersion.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs new file mode 100644 index 000000000000..022d43ce4a25 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The GitHub action code configuration. + public partial class GitHubActionCodeConfiguration + { + /// Initializes a new instance of GitHubActionCodeConfiguration. + public GitHubActionCodeConfiguration() + { + } + + /// Initializes a new instance of GitHubActionCodeConfiguration. + /// Runtime stack is used to determine the workflow file content for code base apps. + /// Runtime version is used to determine what build version to set in the workflow file. + internal GitHubActionCodeConfiguration(string runtimeStack, string runtimeVersion) + { + RuntimeStack = runtimeStack; + RuntimeVersion = runtimeVersion; + } + + /// Runtime stack is used to determine the workflow file content for code base apps. + public string RuntimeStack { get; set; } + /// Runtime version is used to determine what build version to set in the workflow file. + public string RuntimeVersion { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.Serialization.cs new file mode 100644 index 000000000000..a32fca638d27 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.Serialization.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class GitHubActionConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(CodeConfiguration)) + { + writer.WritePropertyName("codeConfiguration"); + writer.WriteObjectValue(CodeConfiguration); + } + if (Optional.IsDefined(ContainerConfiguration)) + { + writer.WritePropertyName("containerConfiguration"); + writer.WriteObjectValue(ContainerConfiguration); + } + if (Optional.IsDefined(IsLinux)) + { + writer.WritePropertyName("isLinux"); + writer.WriteBooleanValue(IsLinux.Value); + } + if (Optional.IsDefined(GenerateWorkflowFile)) + { + writer.WritePropertyName("generateWorkflowFile"); + writer.WriteBooleanValue(GenerateWorkflowFile.Value); + } + writer.WriteEndObject(); + } + + internal static GitHubActionConfiguration DeserializeGitHubActionConfiguration(JsonElement element) + { + Optional codeConfiguration = default; + Optional containerConfiguration = default; + Optional isLinux = default; + Optional generateWorkflowFile = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("codeConfiguration")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + codeConfiguration = GitHubActionCodeConfiguration.DeserializeGitHubActionCodeConfiguration(property.Value); + continue; + } + if (property.NameEquals("containerConfiguration")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + containerConfiguration = GitHubActionContainerConfiguration.DeserializeGitHubActionContainerConfiguration(property.Value); + continue; + } + if (property.NameEquals("isLinux")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isLinux = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("generateWorkflowFile")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + generateWorkflowFile = property.Value.GetBoolean(); + continue; + } + } + return new GitHubActionConfiguration(codeConfiguration.Value, containerConfiguration.Value, Optional.ToNullable(isLinux), Optional.ToNullable(generateWorkflowFile)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs new file mode 100644 index 000000000000..43fbb4489362 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The GitHub action configuration. + public partial class GitHubActionConfiguration + { + /// Initializes a new instance of GitHubActionConfiguration. + public GitHubActionConfiguration() + { + } + + /// Initializes a new instance of GitHubActionConfiguration. + /// GitHub Action code configuration. + /// GitHub Action container configuration. + /// This will help determine the workflow configuration to select. + /// Workflow option to determine whether the workflow file should be generated and written to the repository. + internal GitHubActionConfiguration(GitHubActionCodeConfiguration codeConfiguration, GitHubActionContainerConfiguration containerConfiguration, bool? isLinux, bool? generateWorkflowFile) + { + CodeConfiguration = codeConfiguration; + ContainerConfiguration = containerConfiguration; + IsLinux = isLinux; + GenerateWorkflowFile = generateWorkflowFile; + } + + /// GitHub Action code configuration. + public GitHubActionCodeConfiguration CodeConfiguration { get; set; } + /// GitHub Action container configuration. + public GitHubActionContainerConfiguration ContainerConfiguration { get; set; } + /// This will help determine the workflow configuration to select. + public bool? IsLinux { get; set; } + /// Workflow option to determine whether the workflow file should be generated and written to the repository. + public bool? GenerateWorkflowFile { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.Serialization.cs new file mode 100644 index 000000000000..d7f5a3632162 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.Serialization.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class GitHubActionContainerConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ServerUrl)) + { + writer.WritePropertyName("serverUrl"); + writer.WriteStringValue(ServerUrl); + } + if (Optional.IsDefined(ImageName)) + { + writer.WritePropertyName("imageName"); + writer.WriteStringValue(ImageName); + } + if (Optional.IsDefined(Username)) + { + writer.WritePropertyName("username"); + writer.WriteStringValue(Username); + } + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"); + writer.WriteStringValue(Password); + } + writer.WriteEndObject(); + } + + internal static GitHubActionContainerConfiguration DeserializeGitHubActionContainerConfiguration(JsonElement element) + { + Optional serverUrl = default; + Optional imageName = default; + Optional username = default; + Optional password = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serverUrl")) + { + serverUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("imageName")) + { + imageName = property.Value.GetString(); + continue; + } + if (property.NameEquals("username")) + { + username = property.Value.GetString(); + continue; + } + if (property.NameEquals("password")) + { + password = property.Value.GetString(); + continue; + } + } + return new GitHubActionContainerConfiguration(serverUrl.Value, imageName.Value, username.Value, password.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs new file mode 100644 index 000000000000..d1963c4c44d5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The GitHub action container configuration. + public partial class GitHubActionContainerConfiguration + { + /// Initializes a new instance of GitHubActionContainerConfiguration. + public GitHubActionContainerConfiguration() + { + } + + /// Initializes a new instance of GitHubActionContainerConfiguration. + /// The server URL for the container registry where the build will be hosted. + /// The image name for the build. + /// The username used to upload the image to the container registry. + /// The password used to upload the image to the container registry. + internal GitHubActionContainerConfiguration(string serverUrl, string imageName, string username, string password) + { + ServerUrl = serverUrl; + ImageName = imageName; + Username = username; + Password = password; + } + + /// The server URL for the container registry where the build will be hosted. + public string ServerUrl { get; set; } + /// The image name for the build. + public string ImageName { get; set; } + /// The username used to upload the image to the container registry. + public string Username { get; set; } + /// The password used to upload the image to the container registry. + public string Password { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.Serialization.cs new file mode 100644 index 000000000000..330decde9f90 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class GitHubActionWebAppStackSettings + { + internal static GitHubActionWebAppStackSettings DeserializeGitHubActionWebAppStackSettings(JsonElement element) + { + Optional isSupported = default; + Optional supportedVersion = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("isSupported")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isSupported = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("supportedVersion")) + { + supportedVersion = property.Value.GetString(); + continue; + } + } + return new GitHubActionWebAppStackSettings(Optional.ToNullable(isSupported), supportedVersion.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs new file mode 100644 index 000000000000..11fab5120a3f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// GitHub Actions Web App stack settings. + public partial class GitHubActionWebAppStackSettings + { + /// Initializes a new instance of GitHubActionWebAppStackSettings. + internal GitHubActionWebAppStackSettings() + { + } + + /// Initializes a new instance of GitHubActionWebAppStackSettings. + /// <code>true</code> if GitHub Actions is supported for the stack; otherwise, <code>false</code>. + /// The minor version that is supported for GitHub Actions. + internal GitHubActionWebAppStackSettings(bool? isSupported, string supportedVersion) + { + IsSupported = isSupported; + SupportedVersion = supportedVersion; + } + + /// <code>true</code> if GitHub Actions is supported for the stack; otherwise, <code>false</code>. + public bool? IsSupported { get; } + /// The minor version that is supported for GitHub Actions. + public string SupportedVersion { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.Serialization.cs new file mode 100644 index 000000000000..ad37901fe43b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.Serialization.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class GlobalCsmSkuDescription + { + internal static GlobalCsmSkuDescription DeserializeGlobalCsmSkuDescription(JsonElement element) + { + Optional name = default; + Optional tier = default; + Optional size = default; + Optional family = default; + Optional capacity = default; + Optional> locations = default; + Optional> capabilities = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("tier")) + { + tier = property.Value.GetString(); + continue; + } + if (property.NameEquals("size")) + { + size = property.Value.GetString(); + continue; + } + if (property.NameEquals("family")) + { + family = property.Value.GetString(); + continue; + } + if (property.NameEquals("capacity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + capacity = SkuCapacity.DeserializeSkuCapacity(property.Value); + continue; + } + if (property.NameEquals("locations")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + locations = array; + continue; + } + if (property.NameEquals("capabilities")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Capability.DeserializeCapability(item)); + } + capabilities = array; + continue; + } + } + return new GlobalCsmSkuDescription(name.Value, tier.Value, size.Value, family.Value, capacity.Value, Optional.ToList(locations), Optional.ToList(capabilities)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.cs index bc1db434b848..e73ca1f88db1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.cs @@ -1,46 +1,34 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Global SKU Description. - /// + /// A Global SKU Description. public partial class GlobalCsmSkuDescription { - /// - /// Initializes a new instance of the GlobalCsmSkuDescription class. - /// - public GlobalCsmSkuDescription() + /// Initializes a new instance of GlobalCsmSkuDescription. + internal GlobalCsmSkuDescription() { - CustomInit(); + Locations = new ChangeTrackingList(); + Capabilities = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the GlobalCsmSkuDescription class. - /// - /// Name of the resource SKU. - /// Service Tier of the resource SKU. - /// Size specifier of the resource SKU. - /// Family code of the resource SKU. - /// Min, max, and default scale values of the - /// SKU. - /// Locations of the SKU. - /// Capabilities of the SKU, e.g., is - /// traffic manager enabled? - public GlobalCsmSkuDescription(string name = default(string), string tier = default(string), string size = default(string), string family = default(string), SkuCapacity capacity = default(SkuCapacity), IList locations = default(IList), IList capabilities = default(IList)) + /// Initializes a new instance of GlobalCsmSkuDescription. + /// Name of the resource SKU. + /// Service Tier of the resource SKU. + /// Size specifier of the resource SKU. + /// Family code of the resource SKU. + /// Min, max, and default scale values of the SKU. + /// Locations of the SKU. + /// Capabilities of the SKU, e.g., is traffic manager enabled?. + internal GlobalCsmSkuDescription(string name, string tier, string size, string family, SkuCapacity capacity, IReadOnlyList locations, IReadOnlyList capabilities) { Name = name; Tier = tier; @@ -49,56 +37,21 @@ public GlobalCsmSkuDescription() Capacity = capacity; Locations = locations; Capabilities = capabilities; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the resource SKU. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets service Tier of the resource SKU. - /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } - - /// - /// Gets or sets size specifier of the resource SKU. - /// - [JsonProperty(PropertyName = "size")] - public string Size { get; set; } - - /// - /// Gets or sets family code of the resource SKU. - /// - [JsonProperty(PropertyName = "family")] - public string Family { get; set; } - - /// - /// Gets or sets min, max, and default scale values of the SKU. - /// - [JsonProperty(PropertyName = "capacity")] - public SkuCapacity Capacity { get; set; } - - /// - /// Gets or sets locations of the SKU. - /// - [JsonProperty(PropertyName = "locations")] - public IList Locations { get; set; } - - /// - /// Gets or sets capabilities of the SKU, e.g., is traffic manager - /// enabled? - /// - [JsonProperty(PropertyName = "capabilities")] - public IList Capabilities { get; set; } - + /// Name of the resource SKU. + public string Name { get; } + /// Service Tier of the resource SKU. + public string Tier { get; } + /// Size specifier of the resource SKU. + public string Size { get; } + /// Family code of the resource SKU. + public string Family { get; } + /// Min, max, and default scale values of the SKU. + public SkuCapacity Capacity { get; } + /// Locations of the SKU. + public IReadOnlyList Locations { get; } + /// Capabilities of the SKU, e.g., is traffic manager enabled?. + public IReadOnlyList Capabilities { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.Serialization.cs new file mode 100644 index 000000000000..9d115c979471 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class GlobalValidation : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RequireAuthentication)) + { + writer.WritePropertyName("requireAuthentication"); + writer.WriteBooleanValue(RequireAuthentication.Value); + } + if (Optional.IsDefined(UnauthenticatedClientAction)) + { + writer.WritePropertyName("unauthenticatedClientAction"); + writer.WriteStringValue(UnauthenticatedClientAction.Value.ToSerialString()); + } + if (Optional.IsDefined(RedirectToProvider)) + { + writer.WritePropertyName("redirectToProvider"); + writer.WriteStringValue(RedirectToProvider); + } + if (Optional.IsCollectionDefined(ExcludedPaths)) + { + writer.WritePropertyName("excludedPaths"); + writer.WriteStartArray(); + foreach (var item in ExcludedPaths) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static GlobalValidation DeserializeGlobalValidation(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional requireAuthentication = default; + Optional unauthenticatedClientAction = default; + Optional redirectToProvider = default; + Optional> excludedPaths = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("requireAuthentication")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + requireAuthentication = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("unauthenticatedClientAction")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + unauthenticatedClientAction = property0.Value.GetString().ToUnauthenticatedClientActionV2(); + continue; + } + if (property0.NameEquals("redirectToProvider")) + { + redirectToProvider = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("excludedPaths")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + excludedPaths = array; + continue; + } + } + continue; + } + } + return new GlobalValidation(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(requireAuthentication), Optional.ToNullable(unauthenticatedClientAction), redirectToProvider.Value, Optional.ToList(excludedPaths)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.cs index 6e668cba711c..71cbba72cce9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.cs @@ -1,79 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. public partial class GlobalValidation : ProxyOnlyResource { - /// - /// Initializes a new instance of the GlobalValidation class. - /// + /// Initializes a new instance of GlobalValidation. public GlobalValidation() { - CustomInit(); + ExcludedPaths = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the GlobalValidation class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Possible values include: - /// 'RedirectToLoginPage', 'AllowAnonymous', 'Return401', - /// 'Return403' - public GlobalValidation(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? requireAuthentication = default(bool?), UnauthenticatedClientActionV2? unauthenticatedClientAction = default(UnauthenticatedClientActionV2?), string redirectToProvider = default(string), IList excludedPaths = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of GlobalValidation. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>true</code> if the authentication flow is required any request is made; otherwise, <code>false</code>. + /// The action to take when an unauthenticated client attempts to access the app. + /// + /// The default authentication provider to use when multiple providers are configured. + /// This setting is only needed if multiple providers are configured and the unauthenticated client + /// action is set to "RedirectToLoginPage". + /// + /// The paths for which unauthenticated flow would not be redirected to the login page. + internal GlobalValidation(string id, string name, string kind, string type, bool? requireAuthentication, UnauthenticatedClientActionV2? unauthenticatedClientAction, string redirectToProvider, IList excludedPaths) : base(id, name, kind, type) { RequireAuthentication = requireAuthentication; UnauthenticatedClientAction = unauthenticatedClientAction; RedirectToProvider = redirectToProvider; ExcludedPaths = excludedPaths; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.requireAuthentication")] + /// <code>true</code> if the authentication flow is required any request is made; otherwise, <code>false</code>. public bool? RequireAuthentication { get; set; } - - /// - /// Gets or sets possible values include: 'RedirectToLoginPage', - /// 'AllowAnonymous', 'Return401', 'Return403' - /// - [JsonProperty(PropertyName = "properties.unauthenticatedClientAction")] + /// The action to take when an unauthenticated client attempts to access the app. public UnauthenticatedClientActionV2? UnauthenticatedClientAction { get; set; } - /// + /// The default authentication provider to use when multiple providers are configured. + /// This setting is only needed if multiple providers are configured and the unauthenticated client + /// action is set to "RedirectToLoginPage". /// - [JsonProperty(PropertyName = "properties.redirectToProvider")] public string RedirectToProvider { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.excludedPaths")] - public IList ExcludedPaths { get; set; } - + /// The paths for which unauthenticated flow would not be redirected to the login page. + public IList ExcludedPaths { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.Serialization.cs new file mode 100644 index 000000000000..c0e78deb279a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Google : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Registration)) + { + writer.WritePropertyName("registration"); + writer.WriteObjectValue(Registration); + } + if (Optional.IsDefined(Login)) + { + writer.WritePropertyName("login"); + writer.WriteObjectValue(Login); + } + if (Optional.IsDefined(Validation)) + { + writer.WritePropertyName("validation"); + writer.WriteObjectValue(Validation); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Google DeserializeGoogle(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional registration = default; + Optional login = default; + Optional validation = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("registration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + registration = ClientRegistration.DeserializeClientRegistration(property0.Value); + continue; + } + if (property0.NameEquals("login")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + login = LoginScopes.DeserializeLoginScopes(property0.Value); + continue; + } + if (property0.NameEquals("validation")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + validation = AllowedAudiencesValidation.DeserializeAllowedAudiencesValidation(property0.Value); + continue; + } + } + continue; + } + } + return new Google(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, login.Value, validation.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.cs index 26af1e210ab7..4959820e9766 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.cs @@ -1,72 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the Google provider. public partial class Google : ProxyOnlyResource { - /// - /// Initializes a new instance of the Google class. - /// + /// Initializes a new instance of Google. public Google() { - CustomInit(); } - /// - /// Initializes a new instance of the Google class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public Google(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), ClientRegistration registration = default(ClientRegistration), LoginScopes login = default(LoginScopes), AllowedAudiencesValidation validation = default(AllowedAudiencesValidation)) - : base(id, name, kind, type) + /// Initializes a new instance of Google. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the Google provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// The configuration settings of the app registration for the Google provider. + /// The configuration settings of the login flow. + /// The configuration settings of the Azure Active Directory token validation flow. + internal Google(string id, string name, string kind, string type, bool? enabled, ClientRegistration registration, LoginScopes login, AllowedAudiencesValidation validation) : base(id, name, kind, type) { Enabled = enabled; Registration = registration; Login = login; Validation = validation; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// <code>false</code> if the Google provider should not be enabled despite the set registration; otherwise, <code>true</code>. public bool? Enabled { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.registration")] + /// The configuration settings of the app registration for the Google provider. public ClientRegistration Registration { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.login")] + /// The configuration settings of the login flow. public LoginScopes Login { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.validation")] + /// The configuration settings of the Azure Active Directory token validation flow. public AllowedAudiencesValidation Validation { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.Serialization.cs new file mode 100644 index 000000000000..277fe9ef9a97 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HandlerMapping : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Extension)) + { + writer.WritePropertyName("extension"); + writer.WriteStringValue(Extension); + } + if (Optional.IsDefined(ScriptProcessor)) + { + writer.WritePropertyName("scriptProcessor"); + writer.WriteStringValue(ScriptProcessor); + } + if (Optional.IsDefined(Arguments)) + { + writer.WritePropertyName("arguments"); + writer.WriteStringValue(Arguments); + } + writer.WriteEndObject(); + } + + internal static HandlerMapping DeserializeHandlerMapping(JsonElement element) + { + Optional extension = default; + Optional scriptProcessor = default; + Optional arguments = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("extension")) + { + extension = property.Value.GetString(); + continue; + } + if (property.NameEquals("scriptProcessor")) + { + scriptProcessor = property.Value.GetString(); + continue; + } + if (property.NameEquals("arguments")) + { + arguments = property.Value.GetString(); + continue; + } + } + return new HandlerMapping(extension.Value, scriptProcessor.Value, arguments.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.cs index 42a290c89308..b7cb2fa7c0cc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.cs @@ -1,75 +1,39 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - /// - /// The IIS handler mappings used to define which handler processes HTTP - /// requests with certain extension. - /// For example, it is used to configure php-cgi.exe process to handle all - /// HTTP requests with *.php extension. + /// The IIS handler mappings used to define which handler processes HTTP requests with certain extension. + /// For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension. /// public partial class HandlerMapping { - /// - /// Initializes a new instance of the HandlerMapping class. - /// + /// Initializes a new instance of HandlerMapping. public HandlerMapping() { - CustomInit(); } - /// - /// Initializes a new instance of the HandlerMapping class. - /// - /// Requests with this extension will be - /// handled using the specified FastCGI application. - /// The absolute path to the FastCGI - /// application. - /// Command-line arguments to be passed to the - /// script processor. - public HandlerMapping(string extension = default(string), string scriptProcessor = default(string), string arguments = default(string)) + /// Initializes a new instance of HandlerMapping. + /// Requests with this extension will be handled using the specified FastCGI application. + /// The absolute path to the FastCGI application. + /// Command-line arguments to be passed to the script processor. + internal HandlerMapping(string extension, string scriptProcessor, string arguments) { Extension = extension; ScriptProcessor = scriptProcessor; Arguments = arguments; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets requests with this extension will be handled using the - /// specified FastCGI application. - /// - [JsonProperty(PropertyName = "extension")] + /// Requests with this extension will be handled using the specified FastCGI application. public string Extension { get; set; } - - /// - /// Gets or sets the absolute path to the FastCGI application. - /// - [JsonProperty(PropertyName = "scriptProcessor")] + /// The absolute path to the FastCGI application. public string ScriptProcessor { get; set; } - - /// - /// Gets or sets command-line arguments to be passed to the script - /// processor. - /// - [JsonProperty(PropertyName = "arguments")] + /// Command-line arguments to be passed to the script processor. public string Arguments { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.Serialization.cs new file mode 100644 index 000000000000..386923a47127 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HostKeys + { + internal static HostKeys DeserializeHostKeys(JsonElement element) + { + Optional masterKey = default; + Optional> functionKeys = default; + Optional> systemKeys = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("masterKey")) + { + masterKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("functionKeys")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + functionKeys = dictionary; + continue; + } + if (property.NameEquals("systemKeys")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + systemKeys = dictionary; + continue; + } + } + return new HostKeys(masterKey.Value, Optional.ToDictionary(functionKeys), Optional.ToDictionary(systemKeys)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.cs index f418e7a6f4b2..db210ee39c7c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.cs @@ -1,69 +1,41 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Functions host level keys. - /// + /// Functions host level keys. public partial class HostKeys { - /// - /// Initializes a new instance of the HostKeys class. - /// - public HostKeys() + /// Initializes a new instance of HostKeys. + internal HostKeys() { - CustomInit(); + FunctionKeys = new ChangeTrackingDictionary(); + SystemKeys = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the HostKeys class. - /// - /// Secret key. - /// Host level function keys. - /// System keys. - public HostKeys(string masterKey = default(string), IDictionary functionKeys = default(IDictionary), IDictionary systemKeys = default(IDictionary)) + /// Initializes a new instance of HostKeys. + /// Secret key. + /// Host level function keys. + /// System keys. + internal HostKeys(string masterKey, IReadOnlyDictionary functionKeys, IReadOnlyDictionary systemKeys) { MasterKey = masterKey; FunctionKeys = functionKeys; SystemKeys = systemKeys; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets secret key. - /// - [JsonProperty(PropertyName = "masterKey")] - public string MasterKey { get; set; } - - /// - /// Gets or sets host level function keys. - /// - [JsonProperty(PropertyName = "functionKeys")] - public IDictionary FunctionKeys { get; set; } - - /// - /// Gets or sets system keys. - /// - [JsonProperty(PropertyName = "systemKeys")] - public IDictionary SystemKeys { get; set; } - + /// Secret key. + public string MasterKey { get; } + /// Host level function keys. + public IReadOnlyDictionary FunctionKeys { get; } + /// System keys. + public IReadOnlyDictionary SystemKeys { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.Serialization.cs new file mode 100644 index 000000000000..aba175fb300e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.Serialization.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HostName + { + internal static HostName DeserializeHostName(JsonElement element) + { + Optional name = default; + Optional> siteNames = default; + Optional azureResourceName = default; + Optional azureResourceType = default; + Optional customHostNameDnsRecordType = default; + Optional hostNameType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("siteNames")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + siteNames = array; + continue; + } + if (property.NameEquals("azureResourceName")) + { + azureResourceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureResourceType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + azureResourceType = property.Value.GetString().ToAzureResourceType(); + continue; + } + if (property.NameEquals("customHostNameDnsRecordType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + customHostNameDnsRecordType = property.Value.GetString().ToCustomHostNameDnsRecordType(); + continue; + } + if (property.NameEquals("hostNameType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + hostNameType = property.Value.GetString().ToHostNameType(); + continue; + } + } + return new HostName(name.Value, Optional.ToList(siteNames), azureResourceName.Value, Optional.ToNullable(azureResourceType), Optional.ToNullable(customHostNameDnsRecordType), Optional.ToNullable(hostNameType)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.cs index 4b90a7163427..4dc57db13bbe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.cs @@ -1,52 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Details of a hostname derived from a domain. - /// + /// Details of a hostname derived from a domain. public partial class HostName { - /// - /// Initializes a new instance of the HostName class. - /// - public HostName() + /// Initializes a new instance of HostName. + internal HostName() { - CustomInit(); + SiteNames = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the HostName class. - /// - /// Name of the hostname. - /// List of apps the hostname is assigned to. - /// This list will have more than one app only if the hostname is - /// pointing to a Traffic Manager. - /// Name of the Azure resource the - /// hostname is assigned to. If it is assigned to a Traffic Manager - /// then it will be the Traffic Manager name otherwise it will be the - /// app name. - /// Type of the Azure resource the - /// hostname is assigned to. Possible values include: 'Website', - /// 'TrafficManager' - /// Type of the DNS record. - /// Possible values include: 'CName', 'A' - /// Type of the hostname. Possible values - /// include: 'Verified', 'Managed' - public HostName(string name = default(string), IList siteNames = default(IList), string azureResourceName = default(string), AzureResourceType? azureResourceType = default(AzureResourceType?), CustomHostNameDnsRecordType? customHostNameDnsRecordType = default(CustomHostNameDnsRecordType?), HostNameType? hostNameType = default(HostNameType?)) + /// Initializes a new instance of HostName. + /// Name of the hostname. + /// List of apps the hostname is assigned to. This list will have more than one app only if the hostname is pointing to a Traffic Manager. + /// Name of the Azure resource the hostname is assigned to. If it is assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it will be the app name. + /// Type of the Azure resource the hostname is assigned to. + /// Type of the DNS record. + /// Type of the hostname. + internal HostName(string name, IReadOnlyList siteNames, string azureResourceName, AzureResourceType? azureResourceType, CustomHostNameDnsRecordType? customHostNameDnsRecordType, HostNameType? hostNameType) { Name = name; SiteNames = siteNames; @@ -54,56 +34,19 @@ public HostName() AzureResourceType = azureResourceType; CustomHostNameDnsRecordType = customHostNameDnsRecordType; HostNameType = hostNameType; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the hostname. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets list of apps the hostname is assigned to. This list - /// will have more than one app only if the hostname is pointing to a - /// Traffic Manager. - /// - [JsonProperty(PropertyName = "siteNames")] - public IList SiteNames { get; set; } - - /// - /// Gets or sets name of the Azure resource the hostname is assigned - /// to. If it is assigned to a Traffic Manager then it will be the - /// Traffic Manager name otherwise it will be the app name. - /// - [JsonProperty(PropertyName = "azureResourceName")] - public string AzureResourceName { get; set; } - - /// - /// Gets or sets type of the Azure resource the hostname is assigned - /// to. Possible values include: 'Website', 'TrafficManager' - /// - [JsonProperty(PropertyName = "azureResourceType")] - public AzureResourceType? AzureResourceType { get; set; } - - /// - /// Gets or sets type of the DNS record. Possible values include: - /// 'CName', 'A' - /// - [JsonProperty(PropertyName = "customHostNameDnsRecordType")] - public CustomHostNameDnsRecordType? CustomHostNameDnsRecordType { get; set; } - - /// - /// Gets or sets type of the hostname. Possible values include: - /// 'Verified', 'Managed' - /// - [JsonProperty(PropertyName = "hostNameType")] - public HostNameType? HostNameType { get; set; } - + /// Name of the hostname. + public string Name { get; } + /// List of apps the hostname is assigned to. This list will have more than one app only if the hostname is pointing to a Traffic Manager. + public IReadOnlyList SiteNames { get; } + /// Name of the Azure resource the hostname is assigned to. If it is assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it will be the app name. + public string AzureResourceName { get; } + /// Type of the Azure resource the hostname is assigned to. + public AzureResourceType? AzureResourceType { get; } + /// Type of the DNS record. + public CustomHostNameDnsRecordType? CustomHostNameDnsRecordType { get; } + /// Type of the hostname. + public HostNameType? HostNameType { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.Serialization.cs new file mode 100644 index 000000000000..b597fbb04807 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HostNameBinding : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(SiteName)) + { + writer.WritePropertyName("siteName"); + writer.WriteStringValue(SiteName); + } + if (Optional.IsDefined(DomainId)) + { + writer.WritePropertyName("domainId"); + writer.WriteStringValue(DomainId); + } + if (Optional.IsDefined(AzureResourceName)) + { + writer.WritePropertyName("azureResourceName"); + writer.WriteStringValue(AzureResourceName); + } + if (Optional.IsDefined(AzureResourceType)) + { + writer.WritePropertyName("azureResourceType"); + writer.WriteStringValue(AzureResourceType.Value.ToSerialString()); + } + if (Optional.IsDefined(CustomHostNameDnsRecordType)) + { + writer.WritePropertyName("customHostNameDnsRecordType"); + writer.WriteStringValue(CustomHostNameDnsRecordType.Value.ToSerialString()); + } + if (Optional.IsDefined(HostNameType)) + { + writer.WritePropertyName("hostNameType"); + writer.WriteStringValue(HostNameType.Value.ToSerialString()); + } + if (Optional.IsDefined(SslState)) + { + writer.WritePropertyName("sslState"); + writer.WriteStringValue(SslState.Value.ToSerialString()); + } + if (Optional.IsDefined(Thumbprint)) + { + writer.WritePropertyName("thumbprint"); + writer.WriteStringValue(Thumbprint); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static HostNameBinding DeserializeHostNameBinding(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional siteName = default; + Optional domainId = default; + Optional azureResourceName = default; + Optional azureResourceType = default; + Optional customHostNameDnsRecordType = default; + Optional hostNameType = default; + Optional sslState = default; + Optional thumbprint = default; + Optional virtualIP = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("siteName")) + { + siteName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("domainId")) + { + domainId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("azureResourceName")) + { + azureResourceName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("azureResourceType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + azureResourceType = property0.Value.GetString().ToAzureResourceType(); + continue; + } + if (property0.NameEquals("customHostNameDnsRecordType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + customHostNameDnsRecordType = property0.Value.GetString().ToCustomHostNameDnsRecordType(); + continue; + } + if (property0.NameEquals("hostNameType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hostNameType = property0.Value.GetString().ToHostNameType(); + continue; + } + if (property0.NameEquals("sslState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + sslState = property0.Value.GetString().ToSslState(); + continue; + } + if (property0.NameEquals("thumbprint")) + { + thumbprint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("virtualIP")) + { + virtualIP = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new HostNameBinding(id.Value, name.Value, kind.Value, type.Value, siteName.Value, domainId.Value, azureResourceName.Value, Optional.ToNullable(azureResourceType), Optional.ToNullable(customHostNameDnsRecordType), Optional.ToNullable(hostNameType), Optional.ToNullable(sslState), thumbprint.Value, virtualIP.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.cs index fd1f70bf2206..6ddfc92e2a3b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.cs @@ -1,58 +1,35 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A hostname binding object. - /// - [Rest.Serialization.JsonTransformation] + /// A hostname binding object. public partial class HostNameBinding : ProxyOnlyResource { - /// - /// Initializes a new instance of the HostNameBinding class. - /// + /// Initializes a new instance of HostNameBinding. public HostNameBinding() { - CustomInit(); } - /// - /// Initializes a new instance of the HostNameBinding class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// App Service app name. - /// Fully qualified ARM domain resource - /// URI. - /// Azure resource name. - /// Azure resource type. Possible - /// values include: 'Website', 'TrafficManager' - /// Custom DNS record type. - /// Possible values include: 'CName', 'A' - /// Hostname type. Possible values include: - /// 'Verified', 'Managed' - /// SSL type. Possible values include: - /// 'Disabled', 'SniEnabled', 'IpBasedEnabled' - /// SSL certificate thumbprint - /// Virtual IP address assigned to the hostname - /// if IP based SSL is enabled. - public HostNameBinding(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string siteName = default(string), string domainId = default(string), string azureResourceName = default(string), AzureResourceType? azureResourceType = default(AzureResourceType?), CustomHostNameDnsRecordType? customHostNameDnsRecordType = default(CustomHostNameDnsRecordType?), HostNameType? hostNameType = default(HostNameType?), SslState? sslState = default(SslState?), string thumbprint = default(string), string virtualIP = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of HostNameBinding. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// App Service app name. + /// Fully qualified ARM domain resource URI. + /// Azure resource name. + /// Azure resource type. + /// Custom DNS record type. + /// Hostname type. + /// SSL type. + /// SSL certificate thumbprint. + /// Virtual IP address assigned to the hostname if IP based SSL is enabled. + internal HostNameBinding(string id, string name, string kind, string type, string siteName, string domainId, string azureResourceName, AzureResourceType? azureResourceType, CustomHostNameDnsRecordType? customHostNameDnsRecordType, HostNameType? hostNameType, SslState? sslState, string thumbprint, string virtualIP) : base(id, name, kind, type) { SiteName = siteName; DomainId = domainId; @@ -63,72 +40,25 @@ public HostNameBinding() SslState = sslState; Thumbprint = thumbprint; VirtualIP = virtualIP; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets app Service app name. - /// - [JsonProperty(PropertyName = "properties.siteName")] + /// App Service app name. public string SiteName { get; set; } - - /// - /// Gets or sets fully qualified ARM domain resource URI. - /// - [JsonProperty(PropertyName = "properties.domainId")] + /// Fully qualified ARM domain resource URI. public string DomainId { get; set; } - - /// - /// Gets or sets azure resource name. - /// - [JsonProperty(PropertyName = "properties.azureResourceName")] + /// Azure resource name. public string AzureResourceName { get; set; } - - /// - /// Gets or sets azure resource type. Possible values include: - /// 'Website', 'TrafficManager' - /// - [JsonProperty(PropertyName = "properties.azureResourceType")] + /// Azure resource type. public AzureResourceType? AzureResourceType { get; set; } - - /// - /// Gets or sets custom DNS record type. Possible values include: - /// 'CName', 'A' - /// - [JsonProperty(PropertyName = "properties.customHostNameDnsRecordType")] + /// Custom DNS record type. public CustomHostNameDnsRecordType? CustomHostNameDnsRecordType { get; set; } - - /// - /// Gets or sets hostname type. Possible values include: 'Verified', - /// 'Managed' - /// - [JsonProperty(PropertyName = "properties.hostNameType")] + /// Hostname type. public HostNameType? HostNameType { get; set; } - - /// - /// Gets or sets SSL type. Possible values include: 'Disabled', - /// 'SniEnabled', 'IpBasedEnabled' - /// - [JsonProperty(PropertyName = "properties.sslState")] + /// SSL type. public SslState? SslState { get; set; } - - /// - /// Gets or sets SSL certificate thumbprint - /// - [JsonProperty(PropertyName = "properties.thumbprint")] + /// SSL certificate thumbprint. public string Thumbprint { get; set; } - - /// - /// Gets virtual IP address assigned to the hostname if IP based SSL is - /// enabled. - /// - [JsonProperty(PropertyName = "properties.virtualIP")] - public string VirtualIP { get; private set; } - + /// Virtual IP address assigned to the hostname if IP based SSL is enabled. + public string VirtualIP { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.Serialization.cs new file mode 100644 index 000000000000..7a63d27784dc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class HostNameBindingCollection + { + internal static HostNameBindingCollection DeserializeHostNameBindingCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HostNameBinding.DeserializeHostNameBinding(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new HostNameBindingCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.cs new file mode 100644 index 000000000000..f3d4b7ef4e41 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of hostname bindings. + internal partial class HostNameBindingCollection + { + /// Initializes a new instance of HostNameBindingCollection. + /// Collection of resources. + /// is null. + internal HostNameBindingCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of HostNameBindingCollection. + /// Collection of resources. + /// Link to next page of resources. + internal HostNameBindingCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.Serialization.cs new file mode 100644 index 000000000000..14804acca60b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HostNameSslState : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(SslState)) + { + writer.WritePropertyName("sslState"); + writer.WriteStringValue(SslState.Value.ToSerialString()); + } + if (Optional.IsDefined(VirtualIP)) + { + writer.WritePropertyName("virtualIP"); + writer.WriteStringValue(VirtualIP); + } + if (Optional.IsDefined(Thumbprint)) + { + writer.WritePropertyName("thumbprint"); + writer.WriteStringValue(Thumbprint); + } + if (Optional.IsDefined(ToUpdate)) + { + writer.WritePropertyName("toUpdate"); + writer.WriteBooleanValue(ToUpdate.Value); + } + if (Optional.IsDefined(HostType)) + { + writer.WritePropertyName("hostType"); + writer.WriteStringValue(HostType.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + internal static HostNameSslState DeserializeHostNameSslState(JsonElement element) + { + Optional name = default; + Optional sslState = default; + Optional virtualIP = default; + Optional thumbprint = default; + Optional toUpdate = default; + Optional hostType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("sslState")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + sslState = property.Value.GetString().ToSslState(); + continue; + } + if (property.NameEquals("virtualIP")) + { + virtualIP = property.Value.GetString(); + continue; + } + if (property.NameEquals("thumbprint")) + { + thumbprint = property.Value.GetString(); + continue; + } + if (property.NameEquals("toUpdate")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + toUpdate = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("hostType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + hostType = property.Value.GetString().ToHostType(); + continue; + } + } + return new HostNameSslState(name.Value, Optional.ToNullable(sslState), virtualIP.Value, thumbprint.Value, Optional.ToNullable(toUpdate), Optional.ToNullable(hostType)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.cs index de29e1c19fa8..9239d68d973c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.cs @@ -1,46 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// SSL-enabled hostname. - /// + /// SSL-enabled hostname. public partial class HostNameSslState { - /// - /// Initializes a new instance of the HostNameSslState class. - /// + /// Initializes a new instance of HostNameSslState. public HostNameSslState() { - CustomInit(); } - /// - /// Initializes a new instance of the HostNameSslState class. - /// - /// Hostname. - /// SSL type. Possible values include: - /// 'Disabled', 'SniEnabled', 'IpBasedEnabled' - /// Virtual IP address assigned to the hostname - /// if IP based SSL is enabled. - /// SSL certificate thumbprint. - /// Set to <code>true</code> to - /// update existing hostname. - /// Indicates whether the hostname is a standard - /// or repository hostname. Possible values include: 'Standard', - /// 'Repository' - public HostNameSslState(string name = default(string), SslState? sslState = default(SslState?), string virtualIP = default(string), string thumbprint = default(string), bool? toUpdate = default(bool?), HostType? hostType = default(HostType?)) + /// Initializes a new instance of HostNameSslState. + /// Hostname. + /// SSL type. + /// Virtual IP address assigned to the hostname if IP based SSL is enabled. + /// SSL certificate thumbprint. + /// Set to <code>true</code> to update existing hostname. + /// Indicates whether the hostname is a standard or repository hostname. + internal HostNameSslState(string name, SslState? sslState, string virtualIP, string thumbprint, bool? toUpdate, HostType? hostType) { Name = name; SslState = sslState; @@ -48,54 +30,19 @@ public HostNameSslState() Thumbprint = thumbprint; ToUpdate = toUpdate; HostType = hostType; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets hostname. - /// - [JsonProperty(PropertyName = "name")] + /// Hostname. public string Name { get; set; } - - /// - /// Gets or sets SSL type. Possible values include: 'Disabled', - /// 'SniEnabled', 'IpBasedEnabled' - /// - [JsonProperty(PropertyName = "sslState")] + /// SSL type. public SslState? SslState { get; set; } - - /// - /// Gets or sets virtual IP address assigned to the hostname if IP - /// based SSL is enabled. - /// - [JsonProperty(PropertyName = "virtualIP")] + /// Virtual IP address assigned to the hostname if IP based SSL is enabled. public string VirtualIP { get; set; } - - /// - /// Gets or sets SSL certificate thumbprint. - /// - [JsonProperty(PropertyName = "thumbprint")] + /// SSL certificate thumbprint. public string Thumbprint { get; set; } - - /// - /// Gets or sets set to &lt;code&gt;true&lt;/code&gt; - /// to update existing hostname. - /// - [JsonProperty(PropertyName = "toUpdate")] + /// Set to <code>true</code> to update existing hostname. public bool? ToUpdate { get; set; } - - /// - /// Gets or sets indicates whether the hostname is a standard or - /// repository hostname. Possible values include: 'Standard', - /// 'Repository' - /// - [JsonProperty(PropertyName = "hostType")] + /// Indicates whether the hostname is a standard or repository hostname. public HostType? HostType { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.Serialization.cs new file mode 100644 index 000000000000..2a6d10117162 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class HostNameTypeExtensions + { + public static string ToSerialString(this HostNameType value) => value switch + { + HostNameType.Verified => "Verified", + HostNameType.Managed => "Managed", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostNameType value.") + }; + + public static HostNameType ToHostNameType(this string value) + { + if (string.Equals(value, "Verified", StringComparison.InvariantCultureIgnoreCase)) return HostNameType.Verified; + if (string.Equals(value, "Managed", StringComparison.InvariantCultureIgnoreCase)) return HostNameType.Managed; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostNameType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.cs index 2aa52b79a3e5..4bfccbd32a9f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for HostNameType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Type of the hostname. public enum HostNameType { - [EnumMember(Value = "Verified")] + /// Verified. Verified, - [EnumMember(Value = "Managed")] + /// Managed. Managed } - internal static class HostNameTypeEnumExtension - { - internal static string ToSerializedValue(this HostNameType? value) - { - return value == null ? null : ((HostNameType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this HostNameType value) - { - switch( value ) - { - case HostNameType.Verified: - return "Verified"; - case HostNameType.Managed: - return "Managed"; - } - return null; - } - - internal static HostNameType? ParseHostNameType(this string value) - { - switch( value ) - { - case "Verified": - return HostNameType.Verified; - case "Managed": - return HostNameType.Managed; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.Serialization.cs new file mode 100644 index 000000000000..e3b140b8261c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class HostTypeExtensions + { + public static string ToSerialString(this HostType value) => value switch + { + HostType.Standard => "Standard", + HostType.Repository => "Repository", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostType value.") + }; + + public static HostType ToHostType(this string value) + { + if (string.Equals(value, "Standard", StringComparison.InvariantCultureIgnoreCase)) return HostType.Standard; + if (string.Equals(value, "Repository", StringComparison.InvariantCultureIgnoreCase)) return HostType.Repository; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.cs index 01df354dfa0e..4452af2b293d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for HostType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Indicates whether the hostname is a standard or repository hostname. public enum HostType { - [EnumMember(Value = "Standard")] + /// Standard. Standard, - [EnumMember(Value = "Repository")] + /// Repository. Repository } - internal static class HostTypeEnumExtension - { - internal static string ToSerializedValue(this HostType? value) - { - return value == null ? null : ((HostType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this HostType value) - { - switch( value ) - { - case HostType.Standard: - return "Standard"; - case HostType.Repository: - return "Repository"; - } - return null; - } - - internal static HostType? ParseHostType(this string value) - { - switch( value ) - { - case "Standard": - return HostType.Standard; - case "Repository": - return HostType.Repository; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.Serialization.cs new file mode 100644 index 000000000000..f91ee175e21b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HostingEnvironmentDeploymentInfo + { + internal static HostingEnvironmentDeploymentInfo DeserializeHostingEnvironmentDeploymentInfo(JsonElement element) + { + Optional name = default; + Optional location = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + } + return new HostingEnvironmentDeploymentInfo(name.Value, location.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.cs index 277d773c6ce7..8ba1babf781e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.cs @@ -1,62 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information needed to create resources on an App Service Environment. - /// + /// Information needed to create resources on an App Service Environment. public partial class HostingEnvironmentDeploymentInfo { - /// - /// Initializes a new instance of the HostingEnvironmentDeploymentInfo - /// class. - /// - public HostingEnvironmentDeploymentInfo() + /// Initializes a new instance of HostingEnvironmentDeploymentInfo. + internal HostingEnvironmentDeploymentInfo() { - CustomInit(); } - /// - /// Initializes a new instance of the HostingEnvironmentDeploymentInfo - /// class. - /// - /// Name of the App Service Environment. - /// Location of the App Service - /// Environment. - public HostingEnvironmentDeploymentInfo(string name = default(string), string location = default(string)) + /// Initializes a new instance of HostingEnvironmentDeploymentInfo. + /// Name of the App Service Environment. + /// Location of the App Service Environment. + internal HostingEnvironmentDeploymentInfo(string name, string location) { Name = name; Location = location; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the App Service Environment. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets location of the App Service Environment. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - + /// Name of the App Service Environment. + public string Name { get; } + /// Location of the App Service Environment. + public string Location { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.Serialization.cs new file mode 100644 index 000000000000..f729f252c5bf --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HostingEnvironmentDiagnostics + { + internal static HostingEnvironmentDiagnostics DeserializeHostingEnvironmentDiagnostics(JsonElement element) + { + Optional name = default; + Optional diagnosticsOutput = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("diagnosticsOutput")) + { + diagnosticsOutput = property.Value.GetString(); + continue; + } + } + return new HostingEnvironmentDiagnostics(name.Value, diagnosticsOutput.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.cs index bf1546b5752d..2473f8473354 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.cs @@ -1,61 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Diagnostics for an App Service Environment. - /// + /// Diagnostics for an App Service Environment. public partial class HostingEnvironmentDiagnostics { - /// - /// Initializes a new instance of the HostingEnvironmentDiagnostics - /// class. - /// - public HostingEnvironmentDiagnostics() + /// Initializes a new instance of HostingEnvironmentDiagnostics. + internal HostingEnvironmentDiagnostics() { - CustomInit(); } - /// - /// Initializes a new instance of the HostingEnvironmentDiagnostics - /// class. - /// - /// Name/identifier of the diagnostics. - /// Diagnostics output. - public HostingEnvironmentDiagnostics(string name = default(string), string diagnosticsOutput = default(string)) + /// Initializes a new instance of HostingEnvironmentDiagnostics. + /// Name/identifier of the diagnostics. + /// Diagnostics output. + internal HostingEnvironmentDiagnostics(string name, string diagnosticsOutput) { Name = name; DiagnosticsOutput = diagnosticsOutput; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name/identifier of the diagnostics. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets diagnostics output. - /// - [JsonProperty(PropertyName = "diagnosticsOutput")] - public string DiagnosticsOutput { get; set; } - + /// Name/identifier of the diagnostics. + public string Name { get; } + /// Diagnostics output. + public string DiagnosticsOutput { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.Serialization.cs new file mode 100644 index 000000000000..f2b921a8e956 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HostingEnvironmentProfile : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + writer.WriteEndObject(); + } + + internal static HostingEnvironmentProfile DeserializeHostingEnvironmentProfile(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + } + return new HostingEnvironmentProfile(id.Value, name.Value, type.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.cs index 735924754efa..5342cbb6923c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.cs @@ -1,69 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Specification for an App Service Environment to use for this resource. - /// + /// Specification for an App Service Environment to use for this resource. public partial class HostingEnvironmentProfile { - /// - /// Initializes a new instance of the HostingEnvironmentProfile class. - /// + /// Initializes a new instance of HostingEnvironmentProfile. public HostingEnvironmentProfile() { - CustomInit(); } - /// - /// Initializes a new instance of the HostingEnvironmentProfile class. - /// - /// Resource ID of the App Service - /// Environment. - /// Name of the App Service Environment. - /// Resource type of the App Service - /// Environment. - public HostingEnvironmentProfile(string id = default(string), string name = default(string), string type = default(string)) + /// Initializes a new instance of HostingEnvironmentProfile. + /// Resource ID of the App Service Environment. + /// Name of the App Service Environment. + /// Resource type of the App Service Environment. + internal HostingEnvironmentProfile(string id, string name, string type) { Id = id; Name = name; Type = type; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource ID of the App Service Environment. - /// - [JsonProperty(PropertyName = "id")] + /// Resource ID of the App Service Environment. public string Id { get; set; } - - /// - /// Gets name of the App Service Environment. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets resource type of the App Service Environment. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + /// Name of the App Service Environment. + public string Name { get; } + /// Resource type of the App Service Environment. + public string Type { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.Serialization.cs new file mode 100644 index 000000000000..e5c4769022d5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class HostingEnvironmentStatusExtensions + { + public static string ToSerialString(this HostingEnvironmentStatus value) => value switch + { + HostingEnvironmentStatus.Preparing => "Preparing", + HostingEnvironmentStatus.Ready => "Ready", + HostingEnvironmentStatus.Scaling => "Scaling", + HostingEnvironmentStatus.Deleting => "Deleting", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostingEnvironmentStatus value.") + }; + + public static HostingEnvironmentStatus ToHostingEnvironmentStatus(this string value) + { + if (string.Equals(value, "Preparing", StringComparison.InvariantCultureIgnoreCase)) return HostingEnvironmentStatus.Preparing; + if (string.Equals(value, "Ready", StringComparison.InvariantCultureIgnoreCase)) return HostingEnvironmentStatus.Ready; + if (string.Equals(value, "Scaling", StringComparison.InvariantCultureIgnoreCase)) return HostingEnvironmentStatus.Scaling; + if (string.Equals(value, "Deleting", StringComparison.InvariantCultureIgnoreCase)) return HostingEnvironmentStatus.Deleting; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostingEnvironmentStatus value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.cs index 67db91b82f23..876f07ab7b2a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.cs @@ -1,72 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for HostingEnvironmentStatus. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Current status of the App Service Environment. public enum HostingEnvironmentStatus { - [EnumMember(Value = "Preparing")] + /// Preparing. Preparing, - [EnumMember(Value = "Ready")] + /// Ready. Ready, - [EnumMember(Value = "Scaling")] + /// Scaling. Scaling, - [EnumMember(Value = "Deleting")] + /// Deleting. Deleting } - internal static class HostingEnvironmentStatusEnumExtension - { - internal static string ToSerializedValue(this HostingEnvironmentStatus? value) - { - return value == null ? null : ((HostingEnvironmentStatus)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this HostingEnvironmentStatus value) - { - switch( value ) - { - case HostingEnvironmentStatus.Preparing: - return "Preparing"; - case HostingEnvironmentStatus.Ready: - return "Ready"; - case HostingEnvironmentStatus.Scaling: - return "Scaling"; - case HostingEnvironmentStatus.Deleting: - return "Deleting"; - } - return null; - } - - internal static HostingEnvironmentStatus? ParseHostingEnvironmentStatus(this string value) - { - switch( value ) - { - case "Preparing": - return HostingEnvironmentStatus.Preparing; - case "Ready": - return HostingEnvironmentStatus.Ready; - case "Scaling": - return HostingEnvironmentStatus.Scaling; - case "Deleting": - return HostingEnvironmentStatus.Deleting; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.Serialization.cs new file mode 100644 index 000000000000..d158733c4370 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HttpLogsConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(FileSystem)) + { + writer.WritePropertyName("fileSystem"); + writer.WriteObjectValue(FileSystem); + } + if (Optional.IsDefined(AzureBlobStorage)) + { + writer.WritePropertyName("azureBlobStorage"); + writer.WriteObjectValue(AzureBlobStorage); + } + writer.WriteEndObject(); + } + + internal static HttpLogsConfig DeserializeHttpLogsConfig(JsonElement element) + { + Optional fileSystem = default; + Optional azureBlobStorage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fileSystem")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + fileSystem = FileSystemHttpLogsConfig.DeserializeFileSystemHttpLogsConfig(property.Value); + continue; + } + if (property.NameEquals("azureBlobStorage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + azureBlobStorage = AzureBlobStorageHttpLogsConfig.DeserializeAzureBlobStorageHttpLogsConfig(property.Value); + continue; + } + } + return new HttpLogsConfig(fileSystem.Value, azureBlobStorage.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.cs index 32628ade3880..efe0f813abe0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.cs @@ -1,74 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Http logs configuration. - /// + /// Http logs configuration. public partial class HttpLogsConfig { - /// - /// Initializes a new instance of the HttpLogsConfig class. - /// + /// Initializes a new instance of HttpLogsConfig. public HttpLogsConfig() { - CustomInit(); } - /// - /// Initializes a new instance of the HttpLogsConfig class. - /// - /// Http logs to file system - /// configuration. - /// Http logs to azure blob storage - /// configuration. - public HttpLogsConfig(FileSystemHttpLogsConfig fileSystem = default(FileSystemHttpLogsConfig), AzureBlobStorageHttpLogsConfig azureBlobStorage = default(AzureBlobStorageHttpLogsConfig)) + /// Initializes a new instance of HttpLogsConfig. + /// Http logs to file system configuration. + /// Http logs to azure blob storage configuration. + internal HttpLogsConfig(FileSystemHttpLogsConfig fileSystem, AzureBlobStorageHttpLogsConfig azureBlobStorage) { FileSystem = fileSystem; AzureBlobStorage = azureBlobStorage; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets http logs to file system configuration. - /// - [JsonProperty(PropertyName = "fileSystem")] + /// Http logs to file system configuration. public FileSystemHttpLogsConfig FileSystem { get; set; } - - /// - /// Gets or sets http logs to azure blob storage configuration. - /// - [JsonProperty(PropertyName = "azureBlobStorage")] + /// Http logs to azure blob storage configuration. public AzureBlobStorageHttpLogsConfig AzureBlobStorage { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (FileSystem != null) - { - FileSystem.Validate(); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.Serialization.cs new file mode 100644 index 000000000000..9db932592b6b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HttpSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RequireHttps)) + { + writer.WritePropertyName("requireHttps"); + writer.WriteBooleanValue(RequireHttps.Value); + } + if (Optional.IsDefined(Routes)) + { + writer.WritePropertyName("routes"); + writer.WriteObjectValue(Routes); + } + if (Optional.IsDefined(ForwardProxy)) + { + writer.WritePropertyName("forwardProxy"); + writer.WriteObjectValue(ForwardProxy); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static HttpSettings DeserializeHttpSettings(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional requireHttps = default; + Optional routes = default; + Optional forwardProxy = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("requireHttps")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + requireHttps = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("routes")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + routes = HttpSettingsRoutes.DeserializeHttpSettingsRoutes(property0.Value); + continue; + } + if (property0.NameEquals("forwardProxy")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + forwardProxy = ForwardProxy.DeserializeForwardProxy(property0.Value); + continue; + } + } + continue; + } + } + return new HttpSettings(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(requireHttps), routes.Value, forwardProxy.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.cs index b5090a80f932..9ea5cdf9bdfc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.cs @@ -1,66 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. public partial class HttpSettings : ProxyOnlyResource { - /// - /// Initializes a new instance of the HttpSettings class. - /// + /// Initializes a new instance of HttpSettings. public HttpSettings() { - CustomInit(); } - /// - /// Initializes a new instance of the HttpSettings class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public HttpSettings(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? requireHttps = default(bool?), HttpSettingsRoutes routes = default(HttpSettingsRoutes), ForwardProxy forwardProxy = default(ForwardProxy)) - : base(id, name, kind, type) + /// Initializes a new instance of HttpSettings. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, <code>true</code>. + /// The configuration settings of the paths HTTP requests. + /// The configuration settings of a forward proxy used to make the requests. + internal HttpSettings(string id, string name, string kind, string type, bool? requireHttps, HttpSettingsRoutes routes, ForwardProxy forwardProxy) : base(id, name, kind, type) { RequireHttps = requireHttps; Routes = routes; ForwardProxy = forwardProxy; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.requireHttps")] + /// <code>false</code> if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, <code>true</code>. public bool? RequireHttps { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.routes")] + /// The configuration settings of the paths HTTP requests. public HttpSettingsRoutes Routes { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.forwardProxy")] + /// The configuration settings of a forward proxy used to make the requests. public ForwardProxy ForwardProxy { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.Serialization.cs new file mode 100644 index 000000000000..3918ca745cd2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HttpSettingsRoutes : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ApiPrefix)) + { + writer.WritePropertyName("apiPrefix"); + writer.WriteStringValue(ApiPrefix); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static HttpSettingsRoutes DeserializeHttpSettingsRoutes(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional apiPrefix = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("apiPrefix")) + { + apiPrefix = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new HttpSettingsRoutes(id.Value, name.Value, kind.Value, type.Value, apiPrefix.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.cs index 1c71deecd7f2..4e30599758a8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.cs @@ -1,54 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the paths HTTP requests. public partial class HttpSettingsRoutes : ProxyOnlyResource { - /// - /// Initializes a new instance of the HttpSettingsRoutes class. - /// + /// Initializes a new instance of HttpSettingsRoutes. public HttpSettingsRoutes() { - CustomInit(); } - /// - /// Initializes a new instance of the HttpSettingsRoutes class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public HttpSettingsRoutes(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string apiPrefix = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of HttpSettingsRoutes. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The prefix that should precede all the authentication/authorization paths. + internal HttpSettingsRoutes(string id, string name, string kind, string type, string apiPrefix) : base(id, name, kind, type) { ApiPrefix = apiPrefix; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.apiPrefix")] + /// The prefix that should precede all the authentication/authorization paths. public string ApiPrefix { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.Serialization.cs new file mode 100644 index 000000000000..97827cdf86d3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HybridConnection : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ServiceBusNamespace)) + { + writer.WritePropertyName("serviceBusNamespace"); + writer.WriteStringValue(ServiceBusNamespace); + } + if (Optional.IsDefined(RelayName)) + { + writer.WritePropertyName("relayName"); + writer.WriteStringValue(RelayName); + } + if (Optional.IsDefined(RelayArmUri)) + { + writer.WritePropertyName("relayArmUri"); + writer.WriteStringValue(RelayArmUri); + } + if (Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"); + writer.WriteStringValue(Hostname); + } + if (Optional.IsDefined(Port)) + { + writer.WritePropertyName("port"); + writer.WriteNumberValue(Port.Value); + } + if (Optional.IsDefined(SendKeyName)) + { + writer.WritePropertyName("sendKeyName"); + writer.WriteStringValue(SendKeyName); + } + if (Optional.IsDefined(SendKeyValue)) + { + writer.WritePropertyName("sendKeyValue"); + writer.WriteStringValue(SendKeyValue); + } + if (Optional.IsDefined(ServiceBusSuffix)) + { + writer.WritePropertyName("serviceBusSuffix"); + writer.WriteStringValue(ServiceBusSuffix); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static HybridConnection DeserializeHybridConnection(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional serviceBusNamespace = default; + Optional relayName = default; + Optional relayArmUri = default; + Optional hostname = default; + Optional port = default; + Optional sendKeyName = default; + Optional sendKeyValue = default; + Optional serviceBusSuffix = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("serviceBusNamespace")) + { + serviceBusNamespace = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("relayName")) + { + relayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("relayArmUri")) + { + relayArmUri = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostname")) + { + hostname = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("port")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + port = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("sendKeyName")) + { + sendKeyName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("sendKeyValue")) + { + sendKeyValue = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("serviceBusSuffix")) + { + serviceBusSuffix = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new HybridConnection(id.Value, name.Value, kind.Value, type.Value, serviceBusNamespace.Value, relayName.Value, relayArmUri.Value, hostname.Value, Optional.ToNullable(port), sendKeyName.Value, sendKeyValue.Value, serviceBusSuffix.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.cs index e98573aa1d10..a514f7cfe91e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.cs @@ -1,60 +1,37 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Hybrid Connection contract. This is used to configure a Hybrid - /// Connection. - /// - [Rest.Serialization.JsonTransformation] + /// Hybrid Connection contract. This is used to configure a Hybrid Connection. public partial class HybridConnection : ProxyOnlyResource { - /// - /// Initializes a new instance of the HybridConnection class. - /// + /// Initializes a new instance of HybridConnection. public HybridConnection() { - CustomInit(); } - /// - /// Initializes a new instance of the HybridConnection class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The name of the Service Bus - /// namespace. - /// The name of the Service Bus relay. - /// The ARM URI to the Service Bus - /// relay. - /// The hostname of the endpoint. - /// The port of the endpoint. - /// The name of the Service Bus key which has - /// Send permissions. This is used to authenticate to Service - /// Bus. - /// The value of the Service Bus key. This - /// is used to authenticate to Service Bus. In ARM this key will not be - /// returned - /// normally, use the POST /listKeys API instead. - /// The suffix for the service bus - /// endpoint. By default this is .servicebus.windows.net - public HybridConnection(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string serviceBusNamespace = default(string), string relayName = default(string), string relayArmUri = default(string), string hostname = default(string), int? port = default(int?), string sendKeyName = default(string), string sendKeyValue = default(string), string serviceBusSuffix = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of HybridConnection. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The name of the Service Bus namespace. + /// The name of the Service Bus relay. + /// The ARM URI to the Service Bus relay. + /// The hostname of the endpoint. + /// The port of the endpoint. + /// The name of the Service Bus key which has Send permissions. This is used to authenticate to Service Bus. + /// + /// The value of the Service Bus key. This is used to authenticate to Service Bus. In ARM this key will not be returned + /// normally, use the POST /listKeys API instead. + /// + /// The suffix for the service bus endpoint. By default this is .servicebus.windows.net. + internal HybridConnection(string id, string name, string kind, string type, string serviceBusNamespace, string relayName, string relayArmUri, string hostname, int? port, string sendKeyName, string sendKeyValue, string serviceBusSuffix) : base(id, name, kind, type) { ServiceBusNamespace = serviceBusNamespace; RelayName = relayName; @@ -64,65 +41,26 @@ public HybridConnection() SendKeyName = sendKeyName; SendKeyValue = sendKeyValue; ServiceBusSuffix = serviceBusSuffix; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the Service Bus namespace. - /// - [JsonProperty(PropertyName = "properties.serviceBusNamespace")] + /// The name of the Service Bus namespace. public string ServiceBusNamespace { get; set; } - - /// - /// Gets or sets the name of the Service Bus relay. - /// - [JsonProperty(PropertyName = "properties.relayName")] + /// The name of the Service Bus relay. public string RelayName { get; set; } - - /// - /// Gets or sets the ARM URI to the Service Bus relay. - /// - [JsonProperty(PropertyName = "properties.relayArmUri")] + /// The ARM URI to the Service Bus relay. public string RelayArmUri { get; set; } - - /// - /// Gets or sets the hostname of the endpoint. - /// - [JsonProperty(PropertyName = "properties.hostname")] + /// The hostname of the endpoint. public string Hostname { get; set; } - - /// - /// Gets or sets the port of the endpoint. - /// - [JsonProperty(PropertyName = "properties.port")] + /// The port of the endpoint. public int? Port { get; set; } - - /// - /// Gets or sets the name of the Service Bus key which has Send - /// permissions. This is used to authenticate to Service Bus. - /// - [JsonProperty(PropertyName = "properties.sendKeyName")] + /// The name of the Service Bus key which has Send permissions. This is used to authenticate to Service Bus. public string SendKeyName { get; set; } - /// - /// Gets or sets the value of the Service Bus key. This is used to - /// authenticate to Service Bus. In ARM this key will not be returned + /// The value of the Service Bus key. This is used to authenticate to Service Bus. In ARM this key will not be returned /// normally, use the POST /listKeys API instead. /// - [JsonProperty(PropertyName = "properties.sendKeyValue")] public string SendKeyValue { get; set; } - - /// - /// Gets or sets the suffix for the service bus endpoint. By default - /// this is .servicebus.windows.net - /// - [JsonProperty(PropertyName = "properties.serviceBusSuffix")] + /// The suffix for the service bus endpoint. By default this is .servicebus.windows.net. public string ServiceBusSuffix { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.Serialization.cs new file mode 100644 index 000000000000..2d247d62f3aa --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class HybridConnectionCollection + { + internal static HybridConnectionCollection DeserializeHybridConnectionCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HybridConnection.DeserializeHybridConnection(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new HybridConnectionCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.cs new file mode 100644 index 000000000000..dcce5544c688 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of hostname bindings. + internal partial class HybridConnectionCollection + { + /// Initializes a new instance of HybridConnectionCollection. + /// Collection of resources. + /// is null. + internal HybridConnectionCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of HybridConnectionCollection. + /// Collection of resources. + /// Link to next page of resources. + internal HybridConnectionCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.Serialization.cs new file mode 100644 index 000000000000..c2aa23d2cbbf --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.Serialization.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HybridConnectionKey : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static HybridConnectionKey DeserializeHybridConnectionKey(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional sendKeyName = default; + Optional sendKeyValue = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("sendKeyName")) + { + sendKeyName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("sendKeyValue")) + { + sendKeyValue = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new HybridConnectionKey(id.Value, name.Value, kind.Value, type.Value, sendKeyName.Value, sendKeyValue.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.cs index c2e79154a648..1d6fdbb9c8dc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.cs @@ -1,68 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Hybrid Connection key contract. This has the send key name and value - /// for a Hybrid Connection. - /// - [Rest.Serialization.JsonTransformation] + /// Hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. public partial class HybridConnectionKey : ProxyOnlyResource { - /// - /// Initializes a new instance of the HybridConnectionKey class. - /// + /// Initializes a new instance of HybridConnectionKey. public HybridConnectionKey() { - CustomInit(); } - /// - /// Initializes a new instance of the HybridConnectionKey class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The name of the send key. - /// The value of the send key. - public HybridConnectionKey(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string sendKeyName = default(string), string sendKeyValue = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of HybridConnectionKey. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The name of the send key. + /// The value of the send key. + internal HybridConnectionKey(string id, string name, string kind, string type, string sendKeyName, string sendKeyValue) : base(id, name, kind, type) { SendKeyName = sendKeyName; SendKeyValue = sendKeyValue; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the name of the send key. - /// - [JsonProperty(PropertyName = "properties.sendKeyName")] - public string SendKeyName { get; private set; } - - /// - /// Gets the value of the send key. - /// - [JsonProperty(PropertyName = "properties.sendKeyValue")] - public string SendKeyValue { get; private set; } - + /// The name of the send key. + public string SendKeyName { get; } + /// The value of the send key. + public string SendKeyValue { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.Serialization.cs new file mode 100644 index 000000000000..41e55e661322 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.Serialization.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class HybridConnectionLimits : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static HybridConnectionLimits DeserializeHybridConnectionLimits(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional current = default; + Optional maximum = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("current")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + current = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("maximum")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + maximum = property0.Value.GetInt32(); + continue; + } + } + continue; + } + } + return new HybridConnectionLimits(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(current), Optional.ToNullable(maximum)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.cs index 9ada5c91749b..9f3192c29d46 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.cs @@ -1,70 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Hybrid Connection limits contract. This is used to return the plan - /// limits of Hybrid Connections. - /// - [Rest.Serialization.JsonTransformation] + /// Hybrid Connection limits contract. This is used to return the plan limits of Hybrid Connections. public partial class HybridConnectionLimits : ProxyOnlyResource { - /// - /// Initializes a new instance of the HybridConnectionLimits class. - /// + /// Initializes a new instance of HybridConnectionLimits. public HybridConnectionLimits() { - CustomInit(); } - /// - /// Initializes a new instance of the HybridConnectionLimits class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The current number of Hybrid - /// Connections. - /// The maximum number of Hybrid Connections - /// allowed. - public HybridConnectionLimits(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? current = default(int?), int? maximum = default(int?)) - : base(id, name, kind, type) + /// Initializes a new instance of HybridConnectionLimits. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The current number of Hybrid Connections. + /// The maximum number of Hybrid Connections allowed. + internal HybridConnectionLimits(string id, string name, string kind, string type, int? current, int? maximum) : base(id, name, kind, type) { Current = current; Maximum = maximum; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the current number of Hybrid Connections. - /// - [JsonProperty(PropertyName = "properties.current")] - public int? Current { get; private set; } - - /// - /// Gets the maximum number of Hybrid Connections allowed. - /// - [JsonProperty(PropertyName = "properties.maximum")] - public int? Maximum { get; private set; } - + /// The current number of Hybrid Connections. + public int? Current { get; } + /// The maximum number of Hybrid Connections allowed. + public int? Maximum { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.Serialization.cs new file mode 100644 index 000000000000..9bf0479c16c2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Identifier : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Identifier DeserializeIdentifier(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional id0 = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("id")) + { + id0 = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new Identifier(id.Value, name.Value, kind.Value, type.Value, id0.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.cs index 7571f8806156..ce537d340eb1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A domain specific resource identifier. - /// - [Rest.Serialization.JsonTransformation] + /// A domain specific resource identifier. public partial class Identifier : ProxyOnlyResource { - /// - /// Initializes a new instance of the Identifier class. - /// + /// Initializes a new instance of Identifier. public Identifier() { - CustomInit(); } - /// - /// Initializes a new instance of the Identifier class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// String representation of the identity. - public Identifier(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string value = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of Identifier. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// String representation of the identity. + internal Identifier(string id, string name, string kind, string type, string value) : base(id, name, kind, type) { Value = value; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets string representation of the identity. - /// - [JsonProperty(PropertyName = "properties.id")] + /// String representation of the identity. public string Value { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.Serialization.cs new file mode 100644 index 000000000000..c89b87a01924 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class IdentifierCollection + { + internal static IdentifierCollection DeserializeIdentifierCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Identifier.DeserializeIdentifier(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new IdentifierCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.cs new file mode 100644 index 000000000000..cf4c2b39ecb3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of identifiers. + internal partial class IdentifierCollection + { + /// Initializes a new instance of IdentifierCollection. + /// Collection of resources. + /// is null. + internal IdentifierCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of IdentifierCollection. + /// Collection of resources. + /// Link to next page of resources. + internal IdentifierCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.Serialization.cs new file mode 100644 index 000000000000..20a1610b8e4a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.Serialization.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class IdentityProviders : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(AzureActiveDirectory)) + { + writer.WritePropertyName("azureActiveDirectory"); + writer.WriteObjectValue(AzureActiveDirectory); + } + if (Optional.IsDefined(Facebook)) + { + writer.WritePropertyName("facebook"); + writer.WriteObjectValue(Facebook); + } + if (Optional.IsDefined(GitHub)) + { + writer.WritePropertyName("gitHub"); + writer.WriteObjectValue(GitHub); + } + if (Optional.IsDefined(Google)) + { + writer.WritePropertyName("google"); + writer.WriteObjectValue(Google); + } + if (Optional.IsDefined(Twitter)) + { + writer.WritePropertyName("twitter"); + writer.WriteObjectValue(Twitter); + } + if (Optional.IsCollectionDefined(CustomOpenIdConnectProviders)) + { + writer.WritePropertyName("customOpenIdConnectProviders"); + writer.WriteStartObject(); + foreach (var item in CustomOpenIdConnectProviders) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(LegacyMicrosoftAccount)) + { + writer.WritePropertyName("legacyMicrosoftAccount"); + writer.WriteObjectValue(LegacyMicrosoftAccount); + } + if (Optional.IsDefined(Apple)) + { + writer.WritePropertyName("apple"); + writer.WriteObjectValue(Apple); + } + if (Optional.IsDefined(AzureStaticWebApps)) + { + writer.WritePropertyName("azureStaticWebApps"); + writer.WriteObjectValue(AzureStaticWebApps); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static IdentityProviders DeserializeIdentityProviders(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional azureActiveDirectory = default; + Optional facebook = default; + Optional gitHub = default; + Optional google = default; + Optional twitter = default; + Optional> customOpenIdConnectProviders = default; + Optional legacyMicrosoftAccount = default; + Optional apple = default; + Optional azureStaticWebApps = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("azureActiveDirectory")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + azureActiveDirectory = AzureActiveDirectory.DeserializeAzureActiveDirectory(property0.Value); + continue; + } + if (property0.NameEquals("facebook")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + facebook = Facebook.DeserializeFacebook(property0.Value); + continue; + } + if (property0.NameEquals("gitHub")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + gitHub = GitHub.DeserializeGitHub(property0.Value); + continue; + } + if (property0.NameEquals("google")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + google = Google.DeserializeGoogle(property0.Value); + continue; + } + if (property0.NameEquals("twitter")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + twitter = Twitter.DeserializeTwitter(property0.Value); + continue; + } + if (property0.NameEquals("customOpenIdConnectProviders")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, CustomOpenIdConnectProvider.DeserializeCustomOpenIdConnectProvider(property1.Value)); + } + customOpenIdConnectProviders = dictionary; + continue; + } + if (property0.NameEquals("legacyMicrosoftAccount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + legacyMicrosoftAccount = LegacyMicrosoftAccount.DeserializeLegacyMicrosoftAccount(property0.Value); + continue; + } + if (property0.NameEquals("apple")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + apple = Apple.DeserializeApple(property0.Value); + continue; + } + if (property0.NameEquals("azureStaticWebApps")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + azureStaticWebApps = AzureStaticWebApps.DeserializeAzureStaticWebApps(property0.Value); + continue; + } + } + continue; + } + } + return new IdentityProviders(id.Value, name.Value, kind.Value, type.Value, azureActiveDirectory.Value, facebook.Value, gitHub.Value, google.Value, twitter.Value, Optional.ToDictionary(customOpenIdConnectProviders), legacyMicrosoftAccount.Value, apple.Value, azureStaticWebApps.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs index 25b7f98e559f..f7a37e7ad2b1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs @@ -1,42 +1,42 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. public partial class IdentityProviders : ProxyOnlyResource { - /// - /// Initializes a new instance of the IdentityProviders class. - /// + /// Initializes a new instance of IdentityProviders. public IdentityProviders() { - CustomInit(); + CustomOpenIdConnectProviders = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the IdentityProviders class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public IdentityProviders(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), Facebook facebook = default(Facebook), GitHub gitHub = default(GitHub), Google google = default(Google), Twitter twitter = default(Twitter), IDictionary customOpenIdConnectProviders = default(IDictionary)) - : base(id, name, kind, type) + /// Initializes a new instance of IdentityProviders. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The configuration settings of the Azure Active directory provider. + /// The configuration settings of the Facebook provider. + /// The configuration settings of the GitHub provider. + /// The configuration settings of the Google provider. + /// The configuration settings of the Twitter provider. + /// + /// The map of the name of the alias of each custom Open ID Connect provider to the + /// configuration settings of the custom Open ID Connect provider. + /// + /// The configuration settings of the legacy Microsoft Account provider. + /// The configuration settings of the Apple provider. + /// The configuration settings of the Azure Static Web Apps provider. + internal IdentityProviders(string id, string name, string kind, string type, AzureActiveDirectory azureActiveDirectory, Facebook facebook, GitHub gitHub, Google google, Twitter twitter, IDictionary customOpenIdConnectProviders, LegacyMicrosoftAccount legacyMicrosoftAccount, Apple apple, AzureStaticWebApps azureStaticWebApps) : base(id, name, kind, type) { AzureActiveDirectory = azureActiveDirectory; Facebook = facebook; @@ -44,43 +44,31 @@ public IdentityProviders() Google = google; Twitter = twitter; CustomOpenIdConnectProviders = customOpenIdConnectProviders; - CustomInit(); + LegacyMicrosoftAccount = legacyMicrosoftAccount; + Apple = apple; + AzureStaticWebApps = azureStaticWebApps; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.azureActiveDirectory")] + /// The configuration settings of the Azure Active directory provider. public AzureActiveDirectory AzureActiveDirectory { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.facebook")] + /// The configuration settings of the Facebook provider. public Facebook Facebook { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.gitHub")] + /// The configuration settings of the GitHub provider. public GitHub GitHub { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.google")] + /// The configuration settings of the Google provider. public Google Google { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.twitter")] + /// The configuration settings of the Twitter provider. public Twitter Twitter { get; set; } - /// + /// The map of the name of the alias of each custom Open ID Connect provider to the + /// configuration settings of the custom Open ID Connect provider. /// - [JsonProperty(PropertyName = "properties.customOpenIdConnectProviders")] - public IDictionary CustomOpenIdConnectProviders { get; set; } - + public IDictionary CustomOpenIdConnectProviders { get; } + /// The configuration settings of the legacy Microsoft Account provider. + public LegacyMicrosoftAccount LegacyMicrosoftAccount { get; set; } + /// The configuration settings of the Apple provider. + public Apple Apple { get; set; } + /// The configuration settings of the Azure Static Web Apps provider. + public AzureStaticWebApps AzureStaticWebApps { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InAvailabilityReasonType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InAvailabilityReasonType.cs index 49dc1f04dac2..6f44a3adb50b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InAvailabilityReasonType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InAvailabilityReasonType.cs @@ -1,22 +1,51 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for InAvailabilityReasonType. - /// - public static class InAvailabilityReasonType + /// <code>Invalid</code> indicates the name provided does not match Azure App Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and is therefore unavailable. + public readonly partial struct InAvailabilityReasonType : IEquatable { - public const string Invalid = "Invalid"; - public const string AlreadyExists = "AlreadyExists"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public InAvailabilityReasonType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InvalidValue = "Invalid"; + private const string AlreadyExistsValue = "AlreadyExists"; + + /// Invalid. + public static InAvailabilityReasonType Invalid { get; } = new InAvailabilityReasonType(InvalidValue); + /// AlreadyExists. + public static InAvailabilityReasonType AlreadyExists { get; } = new InAvailabilityReasonType(AlreadyExistsValue); + /// Determines if two values are the same. + public static bool operator ==(InAvailabilityReasonType left, InAvailabilityReasonType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(InAvailabilityReasonType left, InAvailabilityReasonType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator InAvailabilityReasonType(string value) => new InAvailabilityReasonType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is InAvailabilityReasonType other && Equals(other); + /// + public bool Equals(InAvailabilityReasonType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.Serialization.cs new file mode 100644 index 000000000000..5be80938c1c7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class InboundEnvironmentEndpoint + { + internal static InboundEnvironmentEndpoint DeserializeInboundEnvironmentEndpoint(JsonElement element) + { + Optional description = default; + Optional> endpoints = default; + Optional> ports = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpoints")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + endpoints = array; + continue; + } + if (property.NameEquals("ports")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ports = array; + continue; + } + } + return new InboundEnvironmentEndpoint(description.Value, Optional.ToList(endpoints), Optional.ToList(ports)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.cs index ca1a6a2421a7..c738b030aa7a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.cs @@ -1,76 +1,41 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The IP Addresses and Ports that require inbound network access to and - /// within the subnet of the App Service Environment. - /// + /// The IP Addresses and Ports that require inbound network access to and within the subnet of the App Service Environment. public partial class InboundEnvironmentEndpoint { - /// - /// Initializes a new instance of the InboundEnvironmentEndpoint class. - /// - public InboundEnvironmentEndpoint() + /// Initializes a new instance of InboundEnvironmentEndpoint. + internal InboundEnvironmentEndpoint() { - CustomInit(); + Endpoints = new ChangeTrackingList(); + Ports = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the InboundEnvironmentEndpoint class. - /// - /// Short text describing the purpose of the - /// network traffic. - /// The IP addresses that network traffic will - /// originate from in cidr notation. - /// The ports that network traffic will arrive to - /// the App Service Environment at. - public InboundEnvironmentEndpoint(string description = default(string), IList endpoints = default(IList), IList ports = default(IList)) + /// Initializes a new instance of InboundEnvironmentEndpoint. + /// Short text describing the purpose of the network traffic. + /// The IP addresses that network traffic will originate from in cidr notation. + /// The ports that network traffic will arrive to the App Service Environment at. + internal InboundEnvironmentEndpoint(string description, IReadOnlyList endpoints, IReadOnlyList ports) { Description = description; Endpoints = endpoints; Ports = ports; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets short text describing the purpose of the network - /// traffic. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets or sets the IP addresses that network traffic will originate - /// from in cidr notation. - /// - [JsonProperty(PropertyName = "endpoints")] - public IList Endpoints { get; set; } - - /// - /// Gets or sets the ports that network traffic will arrive to the App - /// Service Environment at. - /// - [JsonProperty(PropertyName = "ports")] - public IList Ports { get; set; } - + /// Short text describing the purpose of the network traffic. + public string Description { get; } + /// The IP addresses that network traffic will originate from in cidr notation. + public IReadOnlyList Endpoints { get; } + /// The ports that network traffic will arrive to the App Service Environment at. + public IReadOnlyList Ports { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.Serialization.cs new file mode 100644 index 000000000000..32ecb96add87 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class InboundEnvironmentEndpointCollection + { + internal static InboundEnvironmentEndpointCollection DeserializeInboundEnvironmentEndpointCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InboundEnvironmentEndpoint.DeserializeInboundEnvironmentEndpoint(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new InboundEnvironmentEndpointCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.cs new file mode 100644 index 000000000000..934830a75f0d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Inbound Environment Endpoints. + internal partial class InboundEnvironmentEndpointCollection + { + /// Initializes a new instance of InboundEnvironmentEndpointCollection. + /// Collection of resources. + /// is null. + internal InboundEnvironmentEndpointCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of InboundEnvironmentEndpointCollection. + /// Collection of resources. + /// Link to next page of resources. + internal InboundEnvironmentEndpointCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.Serialization.cs new file mode 100644 index 000000000000..0e7ac8aa6583 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class InsightStatusExtensions + { + public static string ToSerialString(this InsightStatus value) => value switch + { + InsightStatus.Critical => "Critical", + InsightStatus.Warning => "Warning", + InsightStatus.Info => "Info", + InsightStatus.Success => "Success", + InsightStatus.None => "None", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown InsightStatus value.") + }; + + public static InsightStatus ToInsightStatus(this string value) + { + if (string.Equals(value, "Critical", StringComparison.InvariantCultureIgnoreCase)) return InsightStatus.Critical; + if (string.Equals(value, "Warning", StringComparison.InvariantCultureIgnoreCase)) return InsightStatus.Warning; + if (string.Equals(value, "Info", StringComparison.InvariantCultureIgnoreCase)) return InsightStatus.Info; + if (string.Equals(value, "Success", StringComparison.InvariantCultureIgnoreCase)) return InsightStatus.Success; + if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return InsightStatus.None; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown InsightStatus value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs new file mode 100644 index 000000000000..968278bec223 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Level of the most severe insight generated by the detector. + public enum InsightStatus + { + /// Critical. + Critical, + /// Warning. + Warning, + /// Info. + Info, + /// Success. + Success, + /// None. + None + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpFilterTag.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpFilterTag.cs index 3b5a6fdf588c..f55bae481cc7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpFilterTag.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpFilterTag.cs @@ -1,23 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for IpFilterTag. - /// - public static class IpFilterTag + /// Defines what this IP filter will be used for. This is to support IP filtering on proxies. + public readonly partial struct IpFilterTag : IEquatable { - public const string Default = "Default"; - public const string XffProxy = "XffProxy"; - public const string ServiceTag = "ServiceTag"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public IpFilterTag(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string XffProxyValue = "XffProxy"; + private const string ServiceTagValue = "ServiceTag"; + + /// Default. + public static IpFilterTag Default { get; } = new IpFilterTag(DefaultValue); + /// XffProxy. + public static IpFilterTag XffProxy { get; } = new IpFilterTag(XffProxyValue); + /// ServiceTag. + public static IpFilterTag ServiceTag { get; } = new IpFilterTag(ServiceTagValue); + /// Determines if two values are the same. + public static bool operator ==(IpFilterTag left, IpFilterTag right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IpFilterTag left, IpFilterTag right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator IpFilterTag(string value) => new IpFilterTag(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IpFilterTag other && Equals(other); + /// + public bool Equals(IpFilterTag other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.Serialization.cs new file mode 100644 index 000000000000..e1788573f0b9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.Serialization.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class IpSecurityRestriction : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(IpAddress)) + { + writer.WritePropertyName("ipAddress"); + writer.WriteStringValue(IpAddress); + } + if (Optional.IsDefined(SubnetMask)) + { + writer.WritePropertyName("subnetMask"); + writer.WriteStringValue(SubnetMask); + } + if (Optional.IsDefined(VnetSubnetResourceId)) + { + writer.WritePropertyName("vnetSubnetResourceId"); + writer.WriteStringValue(VnetSubnetResourceId); + } + if (Optional.IsDefined(VnetTrafficTag)) + { + writer.WritePropertyName("vnetTrafficTag"); + writer.WriteNumberValue(VnetTrafficTag.Value); + } + if (Optional.IsDefined(SubnetTrafficTag)) + { + writer.WritePropertyName("subnetTrafficTag"); + writer.WriteNumberValue(SubnetTrafficTag.Value); + } + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"); + writer.WriteStringValue(Action); + } + if (Optional.IsDefined(Tag)) + { + writer.WritePropertyName("tag"); + writer.WriteStringValue(Tag.Value.ToString()); + } + if (Optional.IsDefined(Priority)) + { + writer.WritePropertyName("priority"); + writer.WriteNumberValue(Priority.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + if (Optional.IsCollectionDefined(Headers)) + { + writer.WritePropertyName("headers"); + writer.WriteStartObject(); + foreach (var item in Headers) + { + writer.WritePropertyName(item.Key); + writer.WriteStartArray(); + foreach (var item0 in item.Value) + { + writer.WriteStringValue(item0); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + } + + internal static IpSecurityRestriction DeserializeIpSecurityRestriction(JsonElement element) + { + Optional ipAddress = default; + Optional subnetMask = default; + Optional vnetSubnetResourceId = default; + Optional vnetTrafficTag = default; + Optional subnetTrafficTag = default; + Optional action = default; + Optional tag = default; + Optional priority = default; + Optional name = default; + Optional description = default; + Optional>> headers = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipAddress")) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnetMask")) + { + subnetMask = property.Value.GetString(); + continue; + } + if (property.NameEquals("vnetSubnetResourceId")) + { + vnetSubnetResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("vnetTrafficTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + vnetTrafficTag = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("subnetTrafficTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + subnetTrafficTag = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("action")) + { + action = property.Value.GetString(); + continue; + } + if (property.NameEquals("tag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + tag = new IpFilterTag(property.Value.GetString()); + continue; + } + if (property.NameEquals("priority")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + priority = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("headers")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary> dictionary = new Dictionary>(); + foreach (var property0 in property.Value.EnumerateObject()) + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dictionary.Add(property0.Name, array); + } + headers = dictionary; + continue; + } + } + return new IpSecurityRestriction(ipAddress.Value, subnetMask.Value, vnetSubnetResourceId.Value, Optional.ToNullable(vnetTrafficTag), Optional.ToNullable(subnetTrafficTag), action.Value, Optional.ToNullable(tag), Optional.ToNullable(priority), name.Value, description.Value, Optional.ToDictionary(headers)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.cs index 7dee1a54d39a..648b6f511031 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.cs @@ -1,84 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// IP security restriction on an app. - /// + /// IP security restriction on an app. public partial class IpSecurityRestriction { - /// - /// Initializes a new instance of the IpSecurityRestriction class. - /// + /// Initializes a new instance of IpSecurityRestriction. public IpSecurityRestriction() { - CustomInit(); + Headers = new ChangeTrackingDictionary>(); } - /// - /// Initializes a new instance of the IpSecurityRestriction class. - /// - /// IP address the security restriction is - /// valid for. - /// It can be in form of pure ipv4 address (required SubnetMask - /// property) or + /// Initializes a new instance of IpSecurityRestriction. + /// + /// IP address the security restriction is valid for. + /// It can be in form of pure ipv4 address (required SubnetMask property) or /// CIDR notation such as ipv4/mask (leading bit match). For CIDR, - /// SubnetMask property must not be specified. - /// Subnet mask for the range of IP addresses - /// the restriction is valid for. - /// Virtual network resource - /// id - /// (internal) Vnet traffic tag - /// (internal) Subnet traffic - /// tag - /// Allow or Deny access for this IP - /// range. - /// Defines what this IP filter will be used for. - /// This is to support IP filtering on proxies. Possible values - /// include: 'Default', 'XffProxy', 'ServiceTag' - /// Priority of IP restriction rule. - /// IP restriction rule name. - /// IP restriction rule description. - /// IP restriction rule headers. - /// X-Forwarded-Host - /// (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). + /// SubnetMask property must not be specified. + /// + /// Subnet mask for the range of IP addresses the restriction is valid for. + /// Virtual network resource id. + /// (internal) Vnet traffic tag. + /// (internal) Subnet traffic tag. + /// Allow or Deny access for this IP range. + /// Defines what this IP filter will be used for. This is to support IP filtering on proxies. + /// Priority of IP restriction rule. + /// IP restriction rule name. + /// IP restriction rule description. + /// + /// IP restriction rule headers. + /// X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). /// The matching logic is .. - /// - If the property is null or empty (default), all hosts(or lack of) - /// are allowed. - /// - A value is compared using ordinal-ignore-case (excluding port - /// number). - /// - Subdomain wildcards are permitted but don't match the root - /// domain. For example, *.contoso.com matches the subdomain - /// foo.contoso.com - /// but not the root domain contoso.com or multi-level - /// foo.bar.contoso.com - /// - Unicode host names are allowed but are converted to Punycode for - /// matching. - /// - /// X-Forwarded-For - /// (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). + /// - If the property is null or empty (default), all hosts(or lack of) are allowed. + /// - A value is compared using ordinal-ignore-case (excluding port number). + /// - Subdomain wildcards are permitted but don't match the root domain. For example, *.contoso.com matches the subdomain foo.contoso.com + /// but not the root domain contoso.com or multi-level foo.bar.contoso.com + /// - Unicode host names are allowed but are converted to Punycode for matching. + /// + /// X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). /// The matching logic is .. - /// - If the property is null or empty (default), any forwarded-for - /// chains (or lack of) are allowed. - /// - If any address (excluding port number) in the chain (comma - /// separated) matches the CIDR defined by the property. - /// + /// - If the property is null or empty (default), any forwarded-for chains (or lack of) are allowed. + /// - If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property. + /// /// X-Azure-FDID and X-FD-HealthProbe. - /// The matching logic is exact match. - public IpSecurityRestriction(string ipAddress = default(string), string subnetMask = default(string), string vnetSubnetResourceId = default(string), int? vnetTrafficTag = default(int?), int? subnetTrafficTag = default(int?), string action = default(string), string tag = default(string), int? priority = default(int?), string name = default(string), string description = default(string), IDictionary> headers = default(IDictionary>)) + /// The matching logic is exact match. + /// + internal IpSecurityRestriction(string ipAddress, string subnetMask, string vnetSubnetResourceId, int? vnetTrafficTag, int? subnetTrafficTag, string action, IpFilterTag? tag, int? priority, string name, string description, IDictionary> headers) { IpAddress = ipAddress; SubnetMask = subnetMask; @@ -91,111 +66,51 @@ public IpSecurityRestriction() Name = name; Description = description; Headers = headers; - CustomInit(); } /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets IP address the security restriction is valid for. - /// It can be in form of pure ipv4 address (required SubnetMask - /// property) or + /// IP address the security restriction is valid for. + /// It can be in form of pure ipv4 address (required SubnetMask property) or /// CIDR notation such as ipv4/mask (leading bit match). For CIDR, /// SubnetMask property must not be specified. /// - [JsonProperty(PropertyName = "ipAddress")] public string IpAddress { get; set; } - - /// - /// Gets or sets subnet mask for the range of IP addresses the - /// restriction is valid for. - /// - [JsonProperty(PropertyName = "subnetMask")] + /// Subnet mask for the range of IP addresses the restriction is valid for. public string SubnetMask { get; set; } - - /// - /// Gets or sets virtual network resource id - /// - [JsonProperty(PropertyName = "vnetSubnetResourceId")] + /// Virtual network resource id. public string VnetSubnetResourceId { get; set; } - - /// - /// Gets or sets (internal) Vnet traffic tag - /// - [JsonProperty(PropertyName = "vnetTrafficTag")] + /// (internal) Vnet traffic tag. public int? VnetTrafficTag { get; set; } - - /// - /// Gets or sets (internal) Subnet traffic tag - /// - [JsonProperty(PropertyName = "subnetTrafficTag")] + /// (internal) Subnet traffic tag. public int? SubnetTrafficTag { get; set; } - - /// - /// Gets or sets allow or Deny access for this IP range. - /// - [JsonProperty(PropertyName = "action")] + /// Allow or Deny access for this IP range. public string Action { get; set; } - - /// - /// Gets or sets defines what this IP filter will be used for. This is - /// to support IP filtering on proxies. Possible values include: - /// 'Default', 'XffProxy', 'ServiceTag' - /// - [JsonProperty(PropertyName = "tag")] - public string Tag { get; set; } - - /// - /// Gets or sets priority of IP restriction rule. - /// - [JsonProperty(PropertyName = "priority")] + /// Defines what this IP filter will be used for. This is to support IP filtering on proxies. + public IpFilterTag? Tag { get; set; } + /// Priority of IP restriction rule. public int? Priority { get; set; } - - /// - /// Gets or sets IP restriction rule name. - /// - [JsonProperty(PropertyName = "name")] + /// IP restriction rule name. public string Name { get; set; } - - /// - /// Gets or sets IP restriction rule description. - /// - [JsonProperty(PropertyName = "description")] + /// IP restriction rule description. public string Description { get; set; } - /// - /// Gets or sets IP restriction rule headers. - /// X-Forwarded-Host - /// (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). + /// IP restriction rule headers. + /// X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). /// The matching logic is .. - /// - If the property is null or empty (default), all hosts(or lack of) - /// are allowed. - /// - A value is compared using ordinal-ignore-case (excluding port - /// number). - /// - Subdomain wildcards are permitted but don't match the root - /// domain. For example, *.contoso.com matches the subdomain - /// foo.contoso.com - /// but not the root domain contoso.com or multi-level - /// foo.bar.contoso.com - /// - Unicode host names are allowed but are converted to Punycode for - /// matching. - /// - /// X-Forwarded-For - /// (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). + /// - If the property is null or empty (default), all hosts(or lack of) are allowed. + /// - A value is compared using ordinal-ignore-case (excluding port number). + /// - Subdomain wildcards are permitted but don't match the root domain. For example, *.contoso.com matches the subdomain foo.contoso.com + /// but not the root domain contoso.com or multi-level foo.bar.contoso.com + /// - Unicode host names are allowed but are converted to Punycode for matching. + /// + /// X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). /// The matching logic is .. - /// - If the property is null or empty (default), any forwarded-for - /// chains (or lack of) are allowed. - /// - If any address (excluding port number) in the chain (comma - /// separated) matches the CIDR defined by the property. - /// + /// - If the property is null or empty (default), any forwarded-for chains (or lack of) are allowed. + /// - If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property. + /// /// X-Azure-FDID and X-FD-HealthProbe. /// The matching logic is exact match. /// - [JsonProperty(PropertyName = "headers")] - public IDictionary> Headers { get; set; } - + public IDictionary> Headers { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.Serialization.cs new file mode 100644 index 000000000000..6d2fb67137fc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class IssueTypeExtensions + { + public static string ToSerialString(this IssueType value) => value switch + { + IssueType.ServiceIncident => "ServiceIncident", + IssueType.AppDeployment => "AppDeployment", + IssueType.AppCrash => "AppCrash", + IssueType.RuntimeIssueDetected => "RuntimeIssueDetected", + IssueType.AseDeployment => "AseDeployment", + IssueType.UserIssue => "UserIssue", + IssueType.PlatformIssue => "PlatformIssue", + IssueType.Other => "Other", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IssueType value.") + }; + + public static IssueType ToIssueType(this string value) + { + if (string.Equals(value, "ServiceIncident", StringComparison.InvariantCultureIgnoreCase)) return IssueType.ServiceIncident; + if (string.Equals(value, "AppDeployment", StringComparison.InvariantCultureIgnoreCase)) return IssueType.AppDeployment; + if (string.Equals(value, "AppCrash", StringComparison.InvariantCultureIgnoreCase)) return IssueType.AppCrash; + if (string.Equals(value, "RuntimeIssueDetected", StringComparison.InvariantCultureIgnoreCase)) return IssueType.RuntimeIssueDetected; + if (string.Equals(value, "AseDeployment", StringComparison.InvariantCultureIgnoreCase)) return IssueType.AseDeployment; + if (string.Equals(value, "UserIssue", StringComparison.InvariantCultureIgnoreCase)) return IssueType.UserIssue; + if (string.Equals(value, "PlatformIssue", StringComparison.InvariantCultureIgnoreCase)) return IssueType.PlatformIssue; + if (string.Equals(value, "Other", StringComparison.InvariantCultureIgnoreCase)) return IssueType.Other; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IssueType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.cs index 0d9046f443e5..0a972bec15d0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.cs @@ -1,96 +1,30 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for IssueType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Represents the type of the Detector. public enum IssueType { - [EnumMember(Value = "ServiceIncident")] + /// ServiceIncident. ServiceIncident, - [EnumMember(Value = "AppDeployment")] + /// AppDeployment. AppDeployment, - [EnumMember(Value = "AppCrash")] + /// AppCrash. AppCrash, - [EnumMember(Value = "RuntimeIssueDetected")] + /// RuntimeIssueDetected. RuntimeIssueDetected, - [EnumMember(Value = "AseDeployment")] + /// AseDeployment. AseDeployment, - [EnumMember(Value = "UserIssue")] + /// UserIssue. UserIssue, - [EnumMember(Value = "PlatformIssue")] + /// PlatformIssue. PlatformIssue, - [EnumMember(Value = "Other")] + /// Other. Other } - internal static class IssueTypeEnumExtension - { - internal static string ToSerializedValue(this IssueType? value) - { - return value == null ? null : ((IssueType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this IssueType value) - { - switch( value ) - { - case IssueType.ServiceIncident: - return "ServiceIncident"; - case IssueType.AppDeployment: - return "AppDeployment"; - case IssueType.AppCrash: - return "AppCrash"; - case IssueType.RuntimeIssueDetected: - return "RuntimeIssueDetected"; - case IssueType.AseDeployment: - return "AseDeployment"; - case IssueType.UserIssue: - return "UserIssue"; - case IssueType.PlatformIssue: - return "PlatformIssue"; - case IssueType.Other: - return "Other"; - } - return null; - } - - internal static IssueType? ParseIssueType(this string value) - { - switch( value ) - { - case "ServiceIncident": - return IssueType.ServiceIncident; - case "AppDeployment": - return IssueType.AppDeployment; - case "AppCrash": - return IssueType.AppCrash; - case "RuntimeIssueDetected": - return IssueType.RuntimeIssueDetected; - case "AseDeployment": - return IssueType.AseDeployment; - case "UserIssue": - return IssueType.UserIssue; - case "PlatformIssue": - return IssueType.PlatformIssue; - case "Other": - return IssueType.Other; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.Serialization.cs new file mode 100644 index 000000000000..6f45c204f7f1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class JwtClaimChecks : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AllowedGroups)) + { + writer.WritePropertyName("allowedGroups"); + writer.WriteStartArray(); + foreach (var item in AllowedGroups) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AllowedClientApplications)) + { + writer.WritePropertyName("allowedClientApplications"); + writer.WriteStartArray(); + foreach (var item in AllowedClientApplications) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static JwtClaimChecks DeserializeJwtClaimChecks(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional> allowedGroups = default; + Optional> allowedClientApplications = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("allowedGroups")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedGroups = array; + continue; + } + if (property0.NameEquals("allowedClientApplications")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedClientApplications = array; + continue; + } + } + continue; + } + } + return new JwtClaimChecks(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(allowedGroups), Optional.ToList(allowedClientApplications)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.cs index b6ac7bf567d9..aca4e7f827f6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.cs @@ -1,62 +1,41 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the checks that should be made while validating the JWT Claims. public partial class JwtClaimChecks : ProxyOnlyResource { - /// - /// Initializes a new instance of the JwtClaimChecks class. - /// + /// Initializes a new instance of JwtClaimChecks. public JwtClaimChecks() { - CustomInit(); + AllowedGroups = new ChangeTrackingList(); + AllowedClientApplications = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the JwtClaimChecks class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public JwtClaimChecks(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList allowedGroups = default(IList), IList allowedClientApplications = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of JwtClaimChecks. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The list of the allowed groups. + /// The list of the allowed client applications. + internal JwtClaimChecks(string id, string name, string kind, string type, IList allowedGroups, IList allowedClientApplications) : base(id, name, kind, type) { AllowedGroups = allowedGroups; AllowedClientApplications = allowedClientApplications; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.allowedGroups")] - public IList AllowedGroups { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.allowedClientApplications")] - public IList AllowedClientApplications { get; set; } - + /// The list of the allowed groups. + public IList AllowedGroups { get; } + /// The list of the allowed client applications. + public IList AllowedClientApplications { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.Serialization.cs new file mode 100644 index 000000000000..cbf04eac502c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class KeyInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"); + writer.WriteStringValue(Value); + } + writer.WriteEndObject(); + } + + internal static KeyInfo DeserializeKeyInfo(JsonElement element) + { + Optional name = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value")) + { + value = property.Value.GetString(); + continue; + } + } + return new KeyInfo(name.Value, value.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.cs index e4ca47f4d7b4..fd3fa9aa3608 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Function key info. - /// + /// Function key info. public partial class KeyInfo { - /// - /// Initializes a new instance of the KeyInfo class. - /// + /// Initializes a new instance of KeyInfo. public KeyInfo() { - CustomInit(); } - /// - /// Initializes a new instance of the KeyInfo class. - /// - /// Key name - /// Key value - public KeyInfo(string name = default(string), string value = default(string)) + /// Initializes a new instance of KeyInfo. + /// Key name. + /// Key value. + internal KeyInfo(string name, string value) { Name = name; Value = value; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets key name - /// - [JsonProperty(PropertyName = "name")] + /// Key name. public string Name { get; set; } - - /// - /// Gets or sets key value - /// - [JsonProperty(PropertyName = "value")] + /// Key value. public string Value { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.Serialization.cs new file mode 100644 index 000000000000..63f7f2647bc7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class KeyValuePairStringObject + { + internal static KeyValuePairStringObject DeserializeKeyValuePairStringObject(JsonElement element) + { + Optional key = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key")) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + value = property.Value.GetObject(); + continue; + } + } + return new KeyValuePairStringObject(key.Value, value.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs new file mode 100644 index 000000000000..8a25ee32a27c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The KeyValuePairStringObject. + public partial class KeyValuePairStringObject + { + /// Initializes a new instance of KeyValuePairStringObject. + internal KeyValuePairStringObject() + { + } + + /// Initializes a new instance of KeyValuePairStringObject. + /// . + /// Any object. + internal KeyValuePairStringObject(string key, object value) + { + Key = key; + Value = value; + } + + public string Key { get; } + /// Any object. + public object Value { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.Serialization.cs new file mode 100644 index 000000000000..6f94bf9a069f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class KeyVaultSecretStatusExtensions + { + public static string ToSerialString(this KeyVaultSecretStatus value) => value switch + { + KeyVaultSecretStatus.Initialized => "Initialized", + KeyVaultSecretStatus.WaitingOnCertificateOrder => "WaitingOnCertificateOrder", + KeyVaultSecretStatus.Succeeded => "Succeeded", + KeyVaultSecretStatus.CertificateOrderFailed => "CertificateOrderFailed", + KeyVaultSecretStatus.OperationNotPermittedOnKeyVault => "OperationNotPermittedOnKeyVault", + KeyVaultSecretStatus.AzureServiceUnauthorizedToAccessKeyVault => "AzureServiceUnauthorizedToAccessKeyVault", + KeyVaultSecretStatus.KeyVaultDoesNotExist => "KeyVaultDoesNotExist", + KeyVaultSecretStatus.KeyVaultSecretDoesNotExist => "KeyVaultSecretDoesNotExist", + KeyVaultSecretStatus.UnknownError => "UnknownError", + KeyVaultSecretStatus.ExternalPrivateKey => "ExternalPrivateKey", + KeyVaultSecretStatus.Unknown => "Unknown", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown KeyVaultSecretStatus value.") + }; + + public static KeyVaultSecretStatus ToKeyVaultSecretStatus(this string value) + { + if (string.Equals(value, "Initialized", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.Initialized; + if (string.Equals(value, "WaitingOnCertificateOrder", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.WaitingOnCertificateOrder; + if (string.Equals(value, "Succeeded", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.Succeeded; + if (string.Equals(value, "CertificateOrderFailed", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.CertificateOrderFailed; + if (string.Equals(value, "OperationNotPermittedOnKeyVault", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.OperationNotPermittedOnKeyVault; + if (string.Equals(value, "AzureServiceUnauthorizedToAccessKeyVault", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.AzureServiceUnauthorizedToAccessKeyVault; + if (string.Equals(value, "KeyVaultDoesNotExist", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.KeyVaultDoesNotExist; + if (string.Equals(value, "KeyVaultSecretDoesNotExist", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.KeyVaultSecretDoesNotExist; + if (string.Equals(value, "UnknownError", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.UnknownError; + if (string.Equals(value, "ExternalPrivateKey", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.ExternalPrivateKey; + if (string.Equals(value, "Unknown", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.Unknown; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown KeyVaultSecretStatus value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.cs index 1befa3ff39e1..3cadf09886d1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.cs @@ -1,114 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for KeyVaultSecretStatus. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Status of the Key Vault secret. public enum KeyVaultSecretStatus { - [EnumMember(Value = "Initialized")] + /// Initialized. Initialized, - [EnumMember(Value = "WaitingOnCertificateOrder")] + /// WaitingOnCertificateOrder. WaitingOnCertificateOrder, - [EnumMember(Value = "Succeeded")] + /// Succeeded. Succeeded, - [EnumMember(Value = "CertificateOrderFailed")] + /// CertificateOrderFailed. CertificateOrderFailed, - [EnumMember(Value = "OperationNotPermittedOnKeyVault")] + /// OperationNotPermittedOnKeyVault. OperationNotPermittedOnKeyVault, - [EnumMember(Value = "AzureServiceUnauthorizedToAccessKeyVault")] + /// AzureServiceUnauthorizedToAccessKeyVault. AzureServiceUnauthorizedToAccessKeyVault, - [EnumMember(Value = "KeyVaultDoesNotExist")] + /// KeyVaultDoesNotExist. KeyVaultDoesNotExist, - [EnumMember(Value = "KeyVaultSecretDoesNotExist")] + /// KeyVaultSecretDoesNotExist. KeyVaultSecretDoesNotExist, - [EnumMember(Value = "UnknownError")] + /// UnknownError. UnknownError, - [EnumMember(Value = "ExternalPrivateKey")] + /// ExternalPrivateKey. ExternalPrivateKey, - [EnumMember(Value = "Unknown")] + /// Unknown. Unknown } - internal static class KeyVaultSecretStatusEnumExtension - { - internal static string ToSerializedValue(this KeyVaultSecretStatus? value) - { - return value == null ? null : ((KeyVaultSecretStatus)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this KeyVaultSecretStatus value) - { - switch( value ) - { - case KeyVaultSecretStatus.Initialized: - return "Initialized"; - case KeyVaultSecretStatus.WaitingOnCertificateOrder: - return "WaitingOnCertificateOrder"; - case KeyVaultSecretStatus.Succeeded: - return "Succeeded"; - case KeyVaultSecretStatus.CertificateOrderFailed: - return "CertificateOrderFailed"; - case KeyVaultSecretStatus.OperationNotPermittedOnKeyVault: - return "OperationNotPermittedOnKeyVault"; - case KeyVaultSecretStatus.AzureServiceUnauthorizedToAccessKeyVault: - return "AzureServiceUnauthorizedToAccessKeyVault"; - case KeyVaultSecretStatus.KeyVaultDoesNotExist: - return "KeyVaultDoesNotExist"; - case KeyVaultSecretStatus.KeyVaultSecretDoesNotExist: - return "KeyVaultSecretDoesNotExist"; - case KeyVaultSecretStatus.UnknownError: - return "UnknownError"; - case KeyVaultSecretStatus.ExternalPrivateKey: - return "ExternalPrivateKey"; - case KeyVaultSecretStatus.Unknown: - return "Unknown"; - } - return null; - } - - internal static KeyVaultSecretStatus? ParseKeyVaultSecretStatus(this string value) - { - switch( value ) - { - case "Initialized": - return KeyVaultSecretStatus.Initialized; - case "WaitingOnCertificateOrder": - return KeyVaultSecretStatus.WaitingOnCertificateOrder; - case "Succeeded": - return KeyVaultSecretStatus.Succeeded; - case "CertificateOrderFailed": - return KeyVaultSecretStatus.CertificateOrderFailed; - case "OperationNotPermittedOnKeyVault": - return KeyVaultSecretStatus.OperationNotPermittedOnKeyVault; - case "AzureServiceUnauthorizedToAccessKeyVault": - return KeyVaultSecretStatus.AzureServiceUnauthorizedToAccessKeyVault; - case "KeyVaultDoesNotExist": - return KeyVaultSecretStatus.KeyVaultDoesNotExist; - case "KeyVaultSecretDoesNotExist": - return KeyVaultSecretStatus.KeyVaultSecretDoesNotExist; - case "UnknownError": - return KeyVaultSecretStatus.UnknownError; - case "ExternalPrivateKey": - return KeyVaultSecretStatus.ExternalPrivateKey; - case "Unknown": - return KeyVaultSecretStatus.Unknown; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.Serialization.cs new file mode 100644 index 000000000000..e51158533da4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class KubeEnvironmentProfile : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + writer.WriteEndObject(); + } + + internal static KubeEnvironmentProfile DeserializeKubeEnvironmentProfile(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + } + return new KubeEnvironmentProfile(id.Value, name.Value, type.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs new file mode 100644 index 000000000000..a7f37fca158a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Specification for a Kubernetes Environment to use for this resource. + public partial class KubeEnvironmentProfile + { + /// Initializes a new instance of KubeEnvironmentProfile. + public KubeEnvironmentProfile() + { + } + + /// Initializes a new instance of KubeEnvironmentProfile. + /// Resource ID of the Kubernetes Environment. + /// Name of the Kubernetes Environment. + /// Resource type of the Kubernetes Environment. + internal KubeEnvironmentProfile(string id, string name, string type) + { + Id = id; + Name = name; + Type = type; + } + + /// Resource ID of the Kubernetes Environment. + public string Id { get; set; } + /// Name of the Kubernetes Environment. + public string Name { get; } + /// Resource type of the Kubernetes Environment. + public string Type { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.Serialization.cs new file mode 100644 index 000000000000..047d5272b69a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class LegacyMicrosoftAccount : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Registration)) + { + writer.WritePropertyName("registration"); + writer.WriteObjectValue(Registration); + } + if (Optional.IsDefined(Login)) + { + writer.WritePropertyName("login"); + writer.WriteObjectValue(Login); + } + if (Optional.IsDefined(Validation)) + { + writer.WritePropertyName("validation"); + writer.WriteObjectValue(Validation); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static LegacyMicrosoftAccount DeserializeLegacyMicrosoftAccount(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional registration = default; + Optional login = default; + Optional validation = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("registration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + registration = ClientRegistration.DeserializeClientRegistration(property0.Value); + continue; + } + if (property0.NameEquals("login")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + login = LoginScopes.DeserializeLoginScopes(property0.Value); + continue; + } + if (property0.NameEquals("validation")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + validation = AllowedAudiencesValidation.DeserializeAllowedAudiencesValidation(property0.Value); + continue; + } + } + continue; + } + } + return new LegacyMicrosoftAccount(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, login.Value, validation.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs new file mode 100644 index 000000000000..77ddbb4cedad --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The configuration settings of the legacy Microsoft Account provider. + public partial class LegacyMicrosoftAccount : ProxyOnlyResource + { + /// Initializes a new instance of LegacyMicrosoftAccount. + public LegacyMicrosoftAccount() + { + } + + /// Initializes a new instance of LegacyMicrosoftAccount. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// The configuration settings of the app registration for the legacy Microsoft Account provider. + /// The configuration settings of the login flow. + /// The configuration settings of the legacy Microsoft Account provider token validation flow. + internal LegacyMicrosoftAccount(string id, string name, string kind, string type, bool? enabled, ClientRegistration registration, LoginScopes login, AllowedAudiencesValidation validation) : base(id, name, kind, type) + { + Enabled = enabled; + Registration = registration; + Login = login; + Validation = validation; + } + + /// <code>false</code> if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, <code>true</code>. + public bool? Enabled { get; set; } + /// The configuration settings of the app registration for the legacy Microsoft Account provider. + public ClientRegistration Registration { get; set; } + /// The configuration settings of the login flow. + public LoginScopes Login { get; set; } + /// The configuration settings of the legacy Microsoft Account provider token validation flow. + public AllowedAudiencesValidation Validation { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.Serialization.cs new file mode 100644 index 000000000000..64aca084c5aa --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.Serialization.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class LinuxJavaContainerSettings + { + internal static LinuxJavaContainerSettings DeserializeLinuxJavaContainerSettings(JsonElement element) + { + Optional java11Runtime = default; + Optional java8Runtime = default; + Optional isPreview = default; + Optional isDeprecated = default; + Optional isHidden = default; + Optional endOfLifeDate = default; + Optional isAutoUpdate = default; + Optional isEarlyAccess = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("java11Runtime")) + { + java11Runtime = property.Value.GetString(); + continue; + } + if (property.NameEquals("java8Runtime")) + { + java8Runtime = property.Value.GetString(); + continue; + } + if (property.NameEquals("isPreview")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isPreview = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isDeprecated")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isDeprecated = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isHidden")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isHidden = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("endOfLifeDate")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + endOfLifeDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isAutoUpdate")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isAutoUpdate = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isEarlyAccess")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isEarlyAccess = property.Value.GetBoolean(); + continue; + } + } + return new LinuxJavaContainerSettings(java11Runtime.Value, java8Runtime.Value, Optional.ToNullable(isPreview), Optional.ToNullable(isDeprecated), Optional.ToNullable(isHidden), Optional.ToNullable(endOfLifeDate), Optional.ToNullable(isAutoUpdate), Optional.ToNullable(isEarlyAccess)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs new file mode 100644 index 000000000000..7f024a995ae7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Linux Java Container settings. + public partial class LinuxJavaContainerSettings + { + /// Initializes a new instance of LinuxJavaContainerSettings. + internal LinuxJavaContainerSettings() + { + } + + /// Initializes a new instance of LinuxJavaContainerSettings. + /// Java 11 version (runtime only). + /// Java 8 version (runtime only). + /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. + /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. + /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. + /// End-of-life date for the minor version. + /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. + /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. + internal LinuxJavaContainerSettings(string java11Runtime, string java8Runtime, bool? isPreview, bool? isDeprecated, bool? isHidden, DateTimeOffset? endOfLifeDate, bool? isAutoUpdate, bool? isEarlyAccess) + { + Java11Runtime = java11Runtime; + Java8Runtime = java8Runtime; + IsPreview = isPreview; + IsDeprecated = isDeprecated; + IsHidden = isHidden; + EndOfLifeDate = endOfLifeDate; + IsAutoUpdate = isAutoUpdate; + IsEarlyAccess = isEarlyAccess; + } + + /// Java 11 version (runtime only). + public string Java11Runtime { get; } + /// Java 8 version (runtime only). + public string Java8Runtime { get; } + /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. + public bool? IsPreview { get; } + /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. + public bool? IsDeprecated { get; } + /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. + public bool? IsHidden { get; } + /// End-of-life date for the minor version. + public DateTimeOffset? EndOfLifeDate { get; } + /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. + public bool? IsAutoUpdate { get; } + /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. + public bool? IsEarlyAccess { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs index a4a9f849e4f9..756f1725959c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs @@ -1,24 +1,57 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for LoadBalancingMode. - /// - public static class LoadBalancingMode + /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. + public readonly partial struct LoadBalancingMode : IEquatable { - public const string None = "None"; - public const string Web = "Web"; - public const string Publishing = "Publishing"; - public const string WebPublishing = "Web,Publishing"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public LoadBalancingMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string WebValue = "Web"; + private const string PublishingValue = "Publishing"; + private const string WebPublishingValue = "Web, Publishing"; + + /// None. + public static LoadBalancingMode None { get; } = new LoadBalancingMode(NoneValue); + /// Web. + public static LoadBalancingMode Web { get; } = new LoadBalancingMode(WebValue); + /// Publishing. + public static LoadBalancingMode Publishing { get; } = new LoadBalancingMode(PublishingValue); + /// Web, Publishing. + public static LoadBalancingMode WebPublishing { get; } = new LoadBalancingMode(WebPublishingValue); + /// Determines if two values are the same. + public static bool operator ==(LoadBalancingMode left, LoadBalancingMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LoadBalancingMode left, LoadBalancingMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator LoadBalancingMode(string value) => new LoadBalancingMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LoadBalancingMode other && Equals(other); + /// + public bool Equals(LoadBalancingMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.Serialization.cs new file mode 100644 index 000000000000..09655b9c46f7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class LocalizableString + { + internal static LocalizableString DeserializeLocalizableString(JsonElement element) + { + Optional value = default; + Optional localizedValue = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("localizedValue")) + { + localizedValue = property.Value.GetString(); + continue; + } + } + return new LocalizableString(value.Value, localizedValue.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.cs index 508f794e803a..573fb4f798a9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Localizable string object containing the name and a localized value. - /// + /// Localizable string object containing the name and a localized value. public partial class LocalizableString { - /// - /// Initializes a new instance of the LocalizableString class. - /// - public LocalizableString() + /// Initializes a new instance of LocalizableString. + internal LocalizableString() { - CustomInit(); } - /// - /// Initializes a new instance of the LocalizableString class. - /// - /// Non-localized name. - /// Localized name. - public LocalizableString(string value = default(string), string localizedValue = default(string)) + /// Initializes a new instance of LocalizableString. + /// Non-localized name. + /// Localized name. + internal LocalizableString(string value, string localizedValue) { Value = value; LocalizedValue = localizedValue; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets non-localized name. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - - /// - /// Gets or sets localized name. - /// - [JsonProperty(PropertyName = "localizedValue")] - public string LocalizedValue { get; set; } - + /// Non-localized name. + public string Value { get; } + /// Localized name. + public string LocalizedValue { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.Serialization.cs new file mode 100644 index 000000000000..d942c6a5e7a1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class LogLevelExtensions + { + public static string ToSerialString(this LogLevel value) => value switch + { + LogLevel.Off => "Off", + LogLevel.Verbose => "Verbose", + LogLevel.Information => "Information", + LogLevel.Warning => "Warning", + LogLevel.Error => "Error", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown LogLevel value.") + }; + + public static LogLevel ToLogLevel(this string value) + { + if (string.Equals(value, "Off", StringComparison.InvariantCultureIgnoreCase)) return LogLevel.Off; + if (string.Equals(value, "Verbose", StringComparison.InvariantCultureIgnoreCase)) return LogLevel.Verbose; + if (string.Equals(value, "Information", StringComparison.InvariantCultureIgnoreCase)) return LogLevel.Information; + if (string.Equals(value, "Warning", StringComparison.InvariantCultureIgnoreCase)) return LogLevel.Warning; + if (string.Equals(value, "Error", StringComparison.InvariantCultureIgnoreCase)) return LogLevel.Error; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown LogLevel value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.cs index 189524b78a3b..b0d8de98eb3c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.cs @@ -1,78 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for LogLevel. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Log level. public enum LogLevel { - [EnumMember(Value = "Off")] + /// Off. Off, - [EnumMember(Value = "Verbose")] + /// Verbose. Verbose, - [EnumMember(Value = "Information")] + /// Information. Information, - [EnumMember(Value = "Warning")] + /// Warning. Warning, - [EnumMember(Value = "Error")] + /// Error. Error } - internal static class LogLevelEnumExtension - { - internal static string ToSerializedValue(this LogLevel? value) - { - return value == null ? null : ((LogLevel)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this LogLevel value) - { - switch( value ) - { - case LogLevel.Off: - return "Off"; - case LogLevel.Verbose: - return "Verbose"; - case LogLevel.Information: - return "Information"; - case LogLevel.Warning: - return "Warning"; - case LogLevel.Error: - return "Error"; - } - return null; - } - - internal static LogLevel? ParseLogLevel(this string value) - { - switch( value ) - { - case "Off": - return LogLevel.Off; - case "Verbose": - return LogLevel.Verbose; - case "Information": - return LogLevel.Information; - case "Warning": - return LogLevel.Warning; - case "Error": - return LogLevel.Error; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.Serialization.cs new file mode 100644 index 000000000000..fe8865291ea9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class LogSpecification + { + internal static LogSpecification DeserializeLogSpecification(JsonElement element) + { + Optional name = default; + Optional displayName = default; + Optional blobDuration = default; + Optional logFilterPattern = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("blobDuration")) + { + blobDuration = property.Value.GetString(); + continue; + } + if (property.NameEquals("logFilterPattern")) + { + logFilterPattern = property.Value.GetString(); + continue; + } + } + return new LogSpecification(name.Value, displayName.Value, blobDuration.Value, logFilterPattern.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.cs index 3fe115f18908..9b0e9ced4d26 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.cs @@ -1,67 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Log Definition of a single resource metric. - /// + /// Log Definition of a single resource metric. public partial class LogSpecification { - /// - /// Initializes a new instance of the LogSpecification class. - /// - public LogSpecification() + /// Initializes a new instance of LogSpecification. + internal LogSpecification() { - CustomInit(); } - /// - /// Initializes a new instance of the LogSpecification class. - /// - public LogSpecification(string name = default(string), string displayName = default(string), string blobDuration = default(string), string logFilterPattern = default(string)) + /// Initializes a new instance of LogSpecification. + /// . + /// . + /// . + /// . + internal LogSpecification(string name, string displayName, string blobDuration, string logFilterPattern) { Name = name; DisplayName = displayName; BlobDuration = blobDuration; LogFilterPattern = logFilterPattern; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - - /// - /// - [JsonProperty(PropertyName = "blobDuration")] - public string BlobDuration { get; set; } - - /// - /// - [JsonProperty(PropertyName = "logFilterPattern")] - public string LogFilterPattern { get; set; } - + public string Name { get; } + public string DisplayName { get; } + public string BlobDuration { get; } + public string LogFilterPattern { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.Serialization.cs new file mode 100644 index 000000000000..60d5eea2c0a1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Login : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Routes)) + { + writer.WritePropertyName("routes"); + writer.WriteObjectValue(Routes); + } + if (Optional.IsDefined(TokenStore)) + { + writer.WritePropertyName("tokenStore"); + writer.WriteObjectValue(TokenStore); + } + if (Optional.IsDefined(PreserveUrlFragmentsForLogins)) + { + writer.WritePropertyName("preserveUrlFragmentsForLogins"); + writer.WriteBooleanValue(PreserveUrlFragmentsForLogins.Value); + } + if (Optional.IsCollectionDefined(AllowedExternalRedirectUrls)) + { + writer.WritePropertyName("allowedExternalRedirectUrls"); + writer.WriteStartArray(); + foreach (var item in AllowedExternalRedirectUrls) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(CookieExpiration)) + { + writer.WritePropertyName("cookieExpiration"); + writer.WriteObjectValue(CookieExpiration); + } + if (Optional.IsDefined(Nonce)) + { + writer.WritePropertyName("nonce"); + writer.WriteObjectValue(Nonce); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Login DeserializeLogin(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional routes = default; + Optional tokenStore = default; + Optional preserveUrlFragmentsForLogins = default; + Optional> allowedExternalRedirectUrls = default; + Optional cookieExpiration = default; + Optional nonce = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("routes")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + routes = LoginRoutes.DeserializeLoginRoutes(property0.Value); + continue; + } + if (property0.NameEquals("tokenStore")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + tokenStore = TokenStore.DeserializeTokenStore(property0.Value); + continue; + } + if (property0.NameEquals("preserveUrlFragmentsForLogins")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + preserveUrlFragmentsForLogins = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("allowedExternalRedirectUrls")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedExternalRedirectUrls = array; + continue; + } + if (property0.NameEquals("cookieExpiration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + cookieExpiration = CookieExpiration.DeserializeCookieExpiration(property0.Value); + continue; + } + if (property0.NameEquals("nonce")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + nonce = Nonce.DeserializeNonce(property0.Value); + continue; + } + } + continue; + } + } + return new Login(id.Value, name.Value, kind.Value, type.Value, routes.Value, tokenStore.Value, Optional.ToNullable(preserveUrlFragmentsForLogins), Optional.ToList(allowedExternalRedirectUrls), cookieExpiration.Value, nonce.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.cs index d14e1bc90117..9945eff10029 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.cs @@ -1,42 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the login flow of users using App Service Authentication/Authorization. public partial class Login : ProxyOnlyResource { - /// - /// Initializes a new instance of the Login class. - /// + /// Initializes a new instance of Login. public Login() { - CustomInit(); + AllowedExternalRedirectUrls = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the Login class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public Login(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), LoginRoutes routes = default(LoginRoutes), TokenStore tokenStore = default(TokenStore), bool? preserveUrlFragmentsForLogins = default(bool?), IList allowedExternalRedirectUrls = default(IList), CookieExpiration cookieExpiration = default(CookieExpiration), Nonce nonce = default(Nonce)) - : base(id, name, kind, type) + /// Initializes a new instance of Login. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The routes that specify the endpoints used for login and logout requests. + /// The configuration settings of the token store. + /// <code>true</code> if the fragments from the request are preserved after the login request is made; otherwise, <code>false</code>. + /// + /// External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. + /// This is an advanced setting typically only needed by Windows Store application backends. + /// Note that URLs within the current domain are always implicitly allowed. + /// + /// The configuration settings of the session cookie's expiration. + /// The configuration settings of the nonce used in the login flow. + internal Login(string id, string name, string kind, string type, LoginRoutes routes, TokenStore tokenStore, bool? preserveUrlFragmentsForLogins, IList allowedExternalRedirectUrls, CookieExpiration cookieExpiration, Nonce nonce) : base(id, name, kind, type) { Routes = routes; TokenStore = tokenStore; @@ -44,43 +42,23 @@ public Login() AllowedExternalRedirectUrls = allowedExternalRedirectUrls; CookieExpiration = cookieExpiration; Nonce = nonce; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.routes")] + /// The routes that specify the endpoints used for login and logout requests. public LoginRoutes Routes { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.tokenStore")] + /// The configuration settings of the token store. public TokenStore TokenStore { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.preserveUrlFragmentsForLogins")] + /// <code>true</code> if the fragments from the request are preserved after the login request is made; otherwise, <code>false</code>. public bool? PreserveUrlFragmentsForLogins { get; set; } - /// + /// External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. + /// This is an advanced setting typically only needed by Windows Store application backends. + /// Note that URLs within the current domain are always implicitly allowed. /// - [JsonProperty(PropertyName = "properties.allowedExternalRedirectUrls")] - public IList AllowedExternalRedirectUrls { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.cookieExpiration")] + public IList AllowedExternalRedirectUrls { get; } + /// The configuration settings of the session cookie's expiration. public CookieExpiration CookieExpiration { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.nonce")] + /// The configuration settings of the nonce used in the login flow. public Nonce Nonce { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.Serialization.cs new file mode 100644 index 000000000000..45b64c605b52 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class LoginRoutes : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(LogoutEndpoint)) + { + writer.WritePropertyName("logoutEndpoint"); + writer.WriteStringValue(LogoutEndpoint); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static LoginRoutes DeserializeLoginRoutes(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional logoutEndpoint = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("logoutEndpoint")) + { + logoutEndpoint = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new LoginRoutes(id.Value, name.Value, kind.Value, type.Value, logoutEndpoint.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.cs index 9b31fe5653bb..3bc9d90bbb5a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.cs @@ -1,54 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The routes that specify the endpoints used for login and logout requests. public partial class LoginRoutes : ProxyOnlyResource { - /// - /// Initializes a new instance of the LoginRoutes class. - /// + /// Initializes a new instance of LoginRoutes. public LoginRoutes() { - CustomInit(); } - /// - /// Initializes a new instance of the LoginRoutes class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public LoginRoutes(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string logoutEndpoint = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of LoginRoutes. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The endpoint at which a logout request should be made. + internal LoginRoutes(string id, string name, string kind, string type, string logoutEndpoint) : base(id, name, kind, type) { LogoutEndpoint = logoutEndpoint; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.logoutEndpoint")] + /// The endpoint at which a logout request should be made. public string LogoutEndpoint { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.Serialization.cs new file mode 100644 index 000000000000..9251c385a69e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class LoginScopes : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Scopes)) + { + writer.WritePropertyName("scopes"); + writer.WriteStartArray(); + foreach (var item in Scopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static LoginScopes DeserializeLoginScopes(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional> scopes = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("scopes")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + scopes = array; + continue; + } + } + continue; + } + } + return new LoginScopes(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(scopes)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.cs index ec2430e910eb..893ef7c100e0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.cs @@ -1,56 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the login flow, including the scopes that should be requested. public partial class LoginScopes : ProxyOnlyResource { - /// - /// Initializes a new instance of the LoginScopes class. - /// + /// Initializes a new instance of LoginScopes. public LoginScopes() { - CustomInit(); + Scopes = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the LoginScopes class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public LoginScopes(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList scopes = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of LoginScopes. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// A list of the scopes that should be requested while authenticating. + internal LoginScopes(string id, string name, string kind, string type, IList scopes) : base(id, name, kind, type) { Scopes = scopes; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.scopes")] - public IList Scopes { get; set; } - + /// A list of the scopes that should be requested while authenticating. + public IList Scopes { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.Serialization.cs new file mode 100644 index 000000000000..d78a3ee0d26e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class MSDeploy : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(PackageUri)) + { + writer.WritePropertyName("packageUri"); + writer.WriteStringValue(PackageUri); + } + if (Optional.IsDefined(ConnectionString)) + { + writer.WritePropertyName("connectionString"); + writer.WriteStringValue(ConnectionString); + } + if (Optional.IsDefined(DbType)) + { + writer.WritePropertyName("dbType"); + writer.WriteStringValue(DbType); + } + if (Optional.IsDefined(SetParametersXmlFileUri)) + { + writer.WritePropertyName("setParametersXmlFileUri"); + writer.WriteStringValue(SetParametersXmlFileUri); + } + if (Optional.IsCollectionDefined(SetParameters)) + { + writer.WritePropertyName("setParameters"); + writer.WriteStartObject(); + foreach (var item in SetParameters) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(SkipAppData)) + { + writer.WritePropertyName("skipAppData"); + writer.WriteBooleanValue(SkipAppData.Value); + } + if (Optional.IsDefined(AppOffline)) + { + writer.WritePropertyName("appOffline"); + writer.WriteBooleanValue(AppOffline.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static MSDeploy DeserializeMSDeploy(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional packageUri = default; + Optional connectionString = default; + Optional dbType = default; + Optional setParametersXmlFileUri = default; + Optional> setParameters = default; + Optional skipAppData = default; + Optional appOffline = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("packageUri")) + { + packageUri = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("connectionString")) + { + connectionString = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("dbType")) + { + dbType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("setParametersXmlFileUri")) + { + setParametersXmlFileUri = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("setParameters")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + setParameters = dictionary; + continue; + } + if (property0.NameEquals("skipAppData")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + skipAppData = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("appOffline")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + appOffline = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new MSDeploy(id.Value, name.Value, kind.Value, type.Value, packageUri.Value, connectionString.Value, dbType.Value, setParametersXmlFileUri.Value, Optional.ToDictionary(setParameters), Optional.ToNullable(skipAppData), Optional.ToNullable(appOffline)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.cs index 2a601fc13092..058a4795b321 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.cs @@ -1,62 +1,45 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// MSDeploy ARM PUT information - /// - [Rest.Serialization.JsonTransformation] + /// MSDeploy ARM PUT information. public partial class MSDeploy : ProxyOnlyResource { - /// - /// Initializes a new instance of the MSDeploy class. - /// + /// Initializes a new instance of MSDeploy. public MSDeploy() { - CustomInit(); + SetParameters = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the MSDeploy class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Package URI - /// SQL Connection String - /// Database Type - /// URI of MSDeploy Parameters - /// file. Must not be set if SetParameters is used. - /// MSDeploy Parameters. Must not be set if - /// SetParametersXmlFileUri is used. - /// Controls whether the MSDeploy operation - /// skips the App_Data directory. - /// If set to <code>true</code>, the existing App_Data - /// directory on the destination - /// will not be deleted, and any App_Data directory in the source will - /// be ignored. - /// Setting is <code>false</code> by default. - /// Sets the AppOffline rule while the - /// MSDeploy operation executes. - /// Setting is <code>false</code> by default. - public MSDeploy(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string packageUri = default(string), string connectionString = default(string), string dbType = default(string), string setParametersXmlFileUri = default(string), IDictionary setParameters = default(IDictionary), bool? skipAppData = default(bool?), bool? appOffline = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of MSDeploy. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Package URI. + /// SQL Connection String. + /// Database Type. + /// URI of MSDeploy Parameters file. Must not be set if SetParameters is used. + /// MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. + /// + /// Controls whether the MSDeploy operation skips the App_Data directory. + /// If set to <code>true</code>, the existing App_Data directory on the destination + /// will not be deleted, and any App_Data directory in the source will be ignored. + /// Setting is <code>false</code> by default. + /// + /// + /// Sets the AppOffline rule while the MSDeploy operation executes. + /// Setting is <code>false</code> by default. + /// + internal MSDeploy(string id, string name, string kind, string type, string packageUri, string connectionString, string dbType, string setParametersXmlFileUri, IDictionary setParameters, bool? skipAppData, bool? appOffline) : base(id, name, kind, type) { PackageUri = packageUri; ConnectionString = connectionString; @@ -65,67 +48,29 @@ public MSDeploy() SetParameters = setParameters; SkipAppData = skipAppData; AppOffline = appOffline; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets package URI - /// - [JsonProperty(PropertyName = "properties.packageUri")] + /// Package URI. public string PackageUri { get; set; } - - /// - /// Gets or sets SQL Connection String - /// - [JsonProperty(PropertyName = "properties.connectionString")] + /// SQL Connection String. public string ConnectionString { get; set; } - - /// - /// Gets or sets database Type - /// - [JsonProperty(PropertyName = "properties.dbType")] + /// Database Type. public string DbType { get; set; } - - /// - /// Gets or sets URI of MSDeploy Parameters file. Must not be set if - /// SetParameters is used. - /// - [JsonProperty(PropertyName = "properties.setParametersXmlFileUri")] + /// URI of MSDeploy Parameters file. Must not be set if SetParameters is used. public string SetParametersXmlFileUri { get; set; } - + /// MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. + public IDictionary SetParameters { get; } /// - /// Gets or sets mSDeploy Parameters. Must not be set if - /// SetParametersXmlFileUri is used. + /// Controls whether the MSDeploy operation skips the App_Data directory. + /// If set to <code>true</code>, the existing App_Data directory on the destination + /// will not be deleted, and any App_Data directory in the source will be ignored. + /// Setting is <code>false</code> by default. /// - [JsonProperty(PropertyName = "properties.setParameters")] - public IDictionary SetParameters { get; set; } - - /// - /// Gets or sets controls whether the MSDeploy operation skips the - /// App_Data directory. - /// If set to &lt;code&gt;true&lt;/code&gt;, the - /// existing App_Data directory on the destination - /// will not be deleted, and any App_Data directory in the source will - /// be ignored. - /// Setting is &lt;code&gt;false&lt;/code&gt; by - /// default. - /// - [JsonProperty(PropertyName = "properties.skipAppData")] public bool? SkipAppData { get; set; } - /// - /// Gets or sets sets the AppOffline rule while the MSDeploy operation - /// executes. - /// Setting is &lt;code&gt;false&lt;/code&gt; by - /// default. + /// Sets the AppOffline rule while the MSDeploy operation executes. + /// Setting is <code>false</code> by default. /// - [JsonProperty(PropertyName = "properties.appOffline")] public bool? AppOffline { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.Serialization.cs new file mode 100644 index 000000000000..161d482259fe --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.Serialization.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class MSDeployLog : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static MSDeployLog DeserializeMSDeployLog(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional> entries = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("entries")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(MSDeployLogEntry.DeserializeMSDeployLogEntry(item)); + } + entries = array; + continue; + } + } + continue; + } + } + return new MSDeployLog(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(entries)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.cs index b98032e54b1e..39c0b77588d5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.cs @@ -1,61 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// MSDeploy log - /// - [Rest.Serialization.JsonTransformation] + /// MSDeploy log. public partial class MSDeployLog : ProxyOnlyResource { - /// - /// Initializes a new instance of the MSDeployLog class. - /// + /// Initializes a new instance of MSDeployLog. public MSDeployLog() { - CustomInit(); + Entries = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the MSDeployLog class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// List of log entry messages - public MSDeployLog(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList entries = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of MSDeployLog. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// List of log entry messages. + internal MSDeployLog(string id, string name, string kind, string type, IReadOnlyList entries) : base(id, name, kind, type) { Entries = entries; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets list of log entry messages - /// - [JsonProperty(PropertyName = "properties.entries")] - public IList Entries { get; private set; } - + /// List of log entry messages. + public IReadOnlyList Entries { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.Serialization.cs new file mode 100644 index 000000000000..c2aa3b7e6a66 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class MSDeployLogEntry + { + internal static MSDeployLogEntry DeserializeMSDeployLogEntry(JsonElement element) + { + Optional time = default; + Optional type = default; + Optional message = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("time")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + time = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + type = property.Value.GetString().ToMSDeployLogEntryType(); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + } + return new MSDeployLogEntry(Optional.ToNullable(time), Optional.ToNullable(type), message.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.cs index f8fa05c9d688..59cafa26c97c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.cs @@ -1,69 +1,38 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// MSDeploy log entry - /// + /// MSDeploy log entry. public partial class MSDeployLogEntry { - /// - /// Initializes a new instance of the MSDeployLogEntry class. - /// - public MSDeployLogEntry() + /// Initializes a new instance of MSDeployLogEntry. + internal MSDeployLogEntry() { - CustomInit(); } - /// - /// Initializes a new instance of the MSDeployLogEntry class. - /// - /// Timestamp of log entry - /// Log entry type. Possible values include: - /// 'Message', 'Warning', 'Error' - /// Log entry message - public MSDeployLogEntry(System.DateTime? time = default(System.DateTime?), MSDeployLogEntryType? type = default(MSDeployLogEntryType?), string message = default(string)) + /// Initializes a new instance of MSDeployLogEntry. + /// Timestamp of log entry. + /// Log entry type. + /// Log entry message. + internal MSDeployLogEntry(DateTimeOffset? time, MSDeployLogEntryType? type, string message) { Time = time; Type = type; Message = message; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets timestamp of log entry - /// - [JsonProperty(PropertyName = "time")] - public System.DateTime? Time { get; private set; } - - /// - /// Gets log entry type. Possible values include: 'Message', 'Warning', - /// 'Error' - /// - [JsonProperty(PropertyName = "type")] - public MSDeployLogEntryType? Type { get; private set; } - - /// - /// Gets log entry message - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - + /// Timestamp of log entry. + public DateTimeOffset? Time { get; } + /// Log entry type. + public MSDeployLogEntryType? Type { get; } + /// Log entry message. + public string Message { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.Serialization.cs new file mode 100644 index 000000000000..67924e072fca --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class MSDeployLogEntryTypeExtensions + { + public static string ToSerialString(this MSDeployLogEntryType value) => value switch + { + MSDeployLogEntryType.Message => "Message", + MSDeployLogEntryType.Warning => "Warning", + MSDeployLogEntryType.Error => "Error", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MSDeployLogEntryType value.") + }; + + public static MSDeployLogEntryType ToMSDeployLogEntryType(this string value) + { + if (string.Equals(value, "Message", StringComparison.InvariantCultureIgnoreCase)) return MSDeployLogEntryType.Message; + if (string.Equals(value, "Warning", StringComparison.InvariantCultureIgnoreCase)) return MSDeployLogEntryType.Warning; + if (string.Equals(value, "Error", StringComparison.InvariantCultureIgnoreCase)) return MSDeployLogEntryType.Error; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MSDeployLogEntryType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.cs index aabc6ea359b2..e659496b0477 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for MSDeployLogEntryType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Log entry type. public enum MSDeployLogEntryType { - [EnumMember(Value = "Message")] + /// Message. Message, - [EnumMember(Value = "Warning")] + /// Warning. Warning, - [EnumMember(Value = "Error")] + /// Error. Error } - internal static class MSDeployLogEntryTypeEnumExtension - { - internal static string ToSerializedValue(this MSDeployLogEntryType? value) - { - return value == null ? null : ((MSDeployLogEntryType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this MSDeployLogEntryType value) - { - switch( value ) - { - case MSDeployLogEntryType.Message: - return "Message"; - case MSDeployLogEntryType.Warning: - return "Warning"; - case MSDeployLogEntryType.Error: - return "Error"; - } - return null; - } - - internal static MSDeployLogEntryType? ParseMSDeployLogEntryType(this string value) - { - switch( value ) - { - case "Message": - return MSDeployLogEntryType.Message; - case "Warning": - return MSDeployLogEntryType.Warning; - case "Error": - return MSDeployLogEntryType.Error; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.Serialization.cs new file mode 100644 index 000000000000..b1852953b302 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class MSDeployProvisioningStateExtensions + { + public static string ToSerialString(this MSDeployProvisioningState value) => value switch + { + MSDeployProvisioningState.Accepted => "accepted", + MSDeployProvisioningState.Running => "running", + MSDeployProvisioningState.Succeeded => "succeeded", + MSDeployProvisioningState.Failed => "failed", + MSDeployProvisioningState.Canceled => "canceled", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MSDeployProvisioningState value.") + }; + + public static MSDeployProvisioningState ToMSDeployProvisioningState(this string value) + { + if (string.Equals(value, "accepted", StringComparison.InvariantCultureIgnoreCase)) return MSDeployProvisioningState.Accepted; + if (string.Equals(value, "running", StringComparison.InvariantCultureIgnoreCase)) return MSDeployProvisioningState.Running; + if (string.Equals(value, "succeeded", StringComparison.InvariantCultureIgnoreCase)) return MSDeployProvisioningState.Succeeded; + if (string.Equals(value, "failed", StringComparison.InvariantCultureIgnoreCase)) return MSDeployProvisioningState.Failed; + if (string.Equals(value, "canceled", StringComparison.InvariantCultureIgnoreCase)) return MSDeployProvisioningState.Canceled; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MSDeployProvisioningState value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.cs index 80c9344125eb..d7f1ce299849 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.cs @@ -1,78 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for MSDeployProvisioningState. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Provisioning state. public enum MSDeployProvisioningState { - [EnumMember(Value = "accepted")] + /// accepted. Accepted, - [EnumMember(Value = "running")] + /// running. Running, - [EnumMember(Value = "succeeded")] + /// succeeded. Succeeded, - [EnumMember(Value = "failed")] + /// failed. Failed, - [EnumMember(Value = "canceled")] + /// canceled. Canceled } - internal static class MSDeployProvisioningStateEnumExtension - { - internal static string ToSerializedValue(this MSDeployProvisioningState? value) - { - return value == null ? null : ((MSDeployProvisioningState)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this MSDeployProvisioningState value) - { - switch( value ) - { - case MSDeployProvisioningState.Accepted: - return "accepted"; - case MSDeployProvisioningState.Running: - return "running"; - case MSDeployProvisioningState.Succeeded: - return "succeeded"; - case MSDeployProvisioningState.Failed: - return "failed"; - case MSDeployProvisioningState.Canceled: - return "canceled"; - } - return null; - } - - internal static MSDeployProvisioningState? ParseMSDeployProvisioningState(this string value) - { - switch( value ) - { - case "accepted": - return MSDeployProvisioningState.Accepted; - case "running": - return MSDeployProvisioningState.Running; - case "succeeded": - return MSDeployProvisioningState.Succeeded; - case "failed": - return MSDeployProvisioningState.Failed; - case "canceled": - return MSDeployProvisioningState.Canceled; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.Serialization.cs new file mode 100644 index 000000000000..85ee27b63717 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.Serialization.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class MSDeployStatus : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static MSDeployStatus DeserializeMSDeployStatus(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional deployer = default; + Optional provisioningState = default; + Optional startTime = default; + Optional endTime = default; + Optional complete = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("deployer")) + { + deployer = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = property0.Value.GetString().ToMSDeployProvisioningState(); + continue; + } + if (property0.NameEquals("startTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("endTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + endTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("complete")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + complete = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new MSDeployStatus(id.Value, name.Value, kind.Value, type.Value, deployer.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToNullable(complete)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.cs index 32175ea1230d..c23f316e6012 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.cs @@ -1,95 +1,50 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// MSDeploy ARM response - /// - [Rest.Serialization.JsonTransformation] + /// MSDeploy ARM response. public partial class MSDeployStatus : ProxyOnlyResource { - /// - /// Initializes a new instance of the MSDeployStatus class. - /// + /// Initializes a new instance of MSDeployStatus. public MSDeployStatus() { - CustomInit(); } - /// - /// Initializes a new instance of the MSDeployStatus class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Username of deployer - /// Provisioning state. Possible values - /// include: 'accepted', 'running', 'succeeded', 'failed', - /// 'canceled' - /// Start time of deploy operation - /// End time of deploy operation - /// Whether the deployment operation has - /// completed - public MSDeployStatus(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string deployer = default(string), MSDeployProvisioningState? provisioningState = default(MSDeployProvisioningState?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), bool? complete = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of MSDeployStatus. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Username of deployer. + /// Provisioning state. + /// Start time of deploy operation. + /// End time of deploy operation. + /// Whether the deployment operation has completed. + internal MSDeployStatus(string id, string name, string kind, string type, string deployer, MSDeployProvisioningState? provisioningState, DateTimeOffset? startTime, DateTimeOffset? endTime, bool? complete) : base(id, name, kind, type) { Deployer = deployer; ProvisioningState = provisioningState; StartTime = startTime; EndTime = endTime; Complete = complete; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets username of deployer - /// - [JsonProperty(PropertyName = "properties.deployer")] - public string Deployer { get; private set; } - - /// - /// Gets provisioning state. Possible values include: 'accepted', - /// 'running', 'succeeded', 'failed', 'canceled' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public MSDeployProvisioningState? ProvisioningState { get; private set; } - - /// - /// Gets start time of deploy operation - /// - [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime? StartTime { get; private set; } - - /// - /// Gets end time of deploy operation - /// - [JsonProperty(PropertyName = "properties.endTime")] - public System.DateTime? EndTime { get; private set; } - - /// - /// Gets whether the deployment operation has completed - /// - [JsonProperty(PropertyName = "properties.complete")] - public bool? Complete { get; private set; } - + /// Username of deployer. + public string Deployer { get; } + /// Provisioning state. + public MSDeployProvisioningState? ProvisioningState { get; } + /// Start time of deploy operation. + public DateTimeOffset? StartTime { get; } + /// End time of deploy operation. + public DateTimeOffset? EndTime { get; } + /// Whether the deployment operation has completed. + public bool? Complete { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.Serialization.cs new file mode 100644 index 000000000000..662ec831c275 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class ManagedPipelineModeExtensions + { + public static string ToSerialString(this ManagedPipelineMode value) => value switch + { + ManagedPipelineMode.Integrated => "Integrated", + ManagedPipelineMode.Classic => "Classic", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedPipelineMode value.") + }; + + public static ManagedPipelineMode ToManagedPipelineMode(this string value) + { + if (string.Equals(value, "Integrated", StringComparison.InvariantCultureIgnoreCase)) return ManagedPipelineMode.Integrated; + if (string.Equals(value, "Classic", StringComparison.InvariantCultureIgnoreCase)) return ManagedPipelineMode.Classic; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedPipelineMode value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.cs index 8eca0a3c40b3..561a080ea51f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ManagedPipelineMode. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Managed pipeline mode. public enum ManagedPipelineMode { - [EnumMember(Value = "Integrated")] + /// Integrated. Integrated, - [EnumMember(Value = "Classic")] + /// Classic. Classic } - internal static class ManagedPipelineModeEnumExtension - { - internal static string ToSerializedValue(this ManagedPipelineMode? value) - { - return value == null ? null : ((ManagedPipelineMode)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ManagedPipelineMode value) - { - switch( value ) - { - case ManagedPipelineMode.Integrated: - return "Integrated"; - case ManagedPipelineMode.Classic: - return "Classic"; - } - return null; - } - - internal static ManagedPipelineMode? ParseManagedPipelineMode(this string value) - { - switch( value ) - { - case "Integrated": - return ManagedPipelineMode.Integrated; - case "Classic": - return ManagedPipelineMode.Classic; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.Serialization.cs new file mode 100644 index 000000000000..ea931763339f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.Serialization.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ManagedServiceIdentity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + } + + internal static ManagedServiceIdentity DeserializeManagedServiceIdentity(JsonElement element) + { + Optional type = default; + Optional tenantId = default; + Optional principalId = default; + Optional> userAssignedIdentities = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + type = property.Value.GetString().ToManagedServiceIdentityType(); + continue; + } + if (property.NameEquals("tenantId")) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("principalId")) + { + principalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("userAssignedIdentities")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.DeserializeComponents1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(property0.Value)); + } + userAssignedIdentities = dictionary; + continue; + } + } + return new ManagedServiceIdentity(Optional.ToNullable(type), tenantId.Value, principalId.Value, Optional.ToDictionary(userAssignedIdentities)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.cs index 2063a4bd6055..6e7d73c3337f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.cs @@ -1,88 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Managed service identity. - /// + /// Managed service identity. public partial class ManagedServiceIdentity { - /// - /// Initializes a new instance of the ManagedServiceIdentity class. - /// + /// Initializes a new instance of ManagedServiceIdentity. public ManagedServiceIdentity() { - CustomInit(); + UserAssignedIdentities = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the ManagedServiceIdentity class. - /// - /// Type of managed service identity. Possible - /// values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, - /// UserAssigned', 'None' - /// Tenant of managed service identity. - /// Principal Id of managed service - /// identity. - /// The list of user assigned - /// identities associated with the resource. The user identity - /// dictionary key references will be ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} - public ManagedServiceIdentity(ManagedServiceIdentityType? type = default(ManagedServiceIdentityType?), string tenantId = default(string), string principalId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) + /// Initializes a new instance of ManagedServiceIdentity. + /// Type of managed service identity. + /// Tenant of managed service identity. + /// Principal Id of managed service identity. + /// The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + internal ManagedServiceIdentity(ManagedServiceIdentityType? type, string tenantId, string principalId, IDictionary userAssignedIdentities) { Type = type; TenantId = tenantId; PrincipalId = principalId; UserAssignedIdentities = userAssignedIdentities; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets type of managed service identity. Possible values - /// include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, - /// UserAssigned', 'None' - /// - [JsonProperty(PropertyName = "type")] + /// Type of managed service identity. public ManagedServiceIdentityType? Type { get; set; } - - /// - /// Gets tenant of managed service identity. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } - - /// - /// Gets principal Id of managed service identity. - /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } - - /// - /// Gets or sets the list of user assigned identities associated with - /// the resource. The user identity dictionary key references will be - /// ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} - /// - [JsonProperty(PropertyName = "userAssignedIdentities")] - public IDictionary UserAssignedIdentities { get; set; } - + /// Tenant of managed service identity. + public string TenantId { get; } + /// Principal Id of managed service identity. + public string PrincipalId { get; } + /// The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + public IDictionary UserAssignedIdentities { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs new file mode 100644 index 000000000000..6843ff70535d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class ManagedServiceIdentityTypeExtensions + { + public static string ToSerialString(this ManagedServiceIdentityType value) => value switch + { + ManagedServiceIdentityType.SystemAssigned => "SystemAssigned", + ManagedServiceIdentityType.UserAssigned => "UserAssigned", + ManagedServiceIdentityType.SystemAssignedUserAssigned => "SystemAssigned, UserAssigned", + ManagedServiceIdentityType.None => "None", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedServiceIdentityType value.") + }; + + public static ManagedServiceIdentityType ToManagedServiceIdentityType(this string value) + { + if (string.Equals(value, "SystemAssigned", StringComparison.InvariantCultureIgnoreCase)) return ManagedServiceIdentityType.SystemAssigned; + if (string.Equals(value, "UserAssigned", StringComparison.InvariantCultureIgnoreCase)) return ManagedServiceIdentityType.UserAssigned; + if (string.Equals(value, "SystemAssigned, UserAssigned", StringComparison.InvariantCultureIgnoreCase)) return ManagedServiceIdentityType.SystemAssignedUserAssigned; + if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return ManagedServiceIdentityType.None; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedServiceIdentityType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.cs index c03bf44b3d17..c8891bf810e1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.cs @@ -1,72 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ManagedServiceIdentityType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Type of managed service identity. public enum ManagedServiceIdentityType { - [EnumMember(Value = "SystemAssigned")] + /// SystemAssigned. SystemAssigned, - [EnumMember(Value = "UserAssigned")] + /// UserAssigned. UserAssigned, - [EnumMember(Value = "SystemAssigned, UserAssigned")] + /// SystemAssigned, UserAssigned. SystemAssignedUserAssigned, - [EnumMember(Value = "None")] + /// None. None } - internal static class ManagedServiceIdentityTypeEnumExtension - { - internal static string ToSerializedValue(this ManagedServiceIdentityType? value) - { - return value == null ? null : ((ManagedServiceIdentityType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ManagedServiceIdentityType value) - { - switch( value ) - { - case ManagedServiceIdentityType.SystemAssigned: - return "SystemAssigned"; - case ManagedServiceIdentityType.UserAssigned: - return "UserAssigned"; - case ManagedServiceIdentityType.SystemAssignedUserAssigned: - return "SystemAssigned, UserAssigned"; - case ManagedServiceIdentityType.None: - return "None"; - } - return null; - } - - internal static ManagedServiceIdentityType? ParseManagedServiceIdentityType(this string value) - { - switch( value ) - { - case "SystemAssigned": - return ManagedServiceIdentityType.SystemAssigned; - case "UserAssigned": - return ManagedServiceIdentityType.UserAssigned; - case "SystemAssigned, UserAssigned": - return ManagedServiceIdentityType.SystemAssignedUserAssigned; - case "None": - return ManagedServiceIdentityType.None; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.Serialization.cs new file mode 100644 index 000000000000..2041ab019c78 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class MetricAvailability + { + internal static MetricAvailability DeserializeMetricAvailability(JsonElement element) + { + Optional timeGrain = default; + Optional blobDuration = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timeGrain")) + { + timeGrain = property.Value.GetString(); + continue; + } + if (property.NameEquals("blobDuration")) + { + blobDuration = property.Value.GetString(); + continue; + } + } + return new MetricAvailability(timeGrain.Value, blobDuration.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.cs index c66947cdbd0a..8565f4065084 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.cs @@ -1,55 +1,30 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Retention policy of a resource metric. - /// + /// Retention policy of a resource metric. public partial class MetricAvailability { - /// - /// Initializes a new instance of the MetricAvailability class. - /// - public MetricAvailability() + /// Initializes a new instance of MetricAvailability. + internal MetricAvailability() { - CustomInit(); } - /// - /// Initializes a new instance of the MetricAvailability class. - /// - public MetricAvailability(string timeGrain = default(string), string blobDuration = default(string)) + /// Initializes a new instance of MetricAvailability. + /// . + /// . + internal MetricAvailability(string timeGrain, string blobDuration) { TimeGrain = timeGrain; BlobDuration = blobDuration; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "timeGrain")] - public string TimeGrain { get; set; } - - /// - /// - [JsonProperty(PropertyName = "blobDuration")] - public string BlobDuration { get; set; } - + public string TimeGrain { get; } + public string BlobDuration { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.Serialization.cs new file mode 100644 index 000000000000..c664633228a4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class MetricSpecification + { + internal static MetricSpecification DeserializeMetricSpecification(JsonElement element) + { + Optional name = default; + Optional displayName = default; + Optional displayDescription = default; + Optional unit = default; + Optional aggregationType = default; + Optional supportsInstanceLevelAggregation = default; + Optional enableRegionalMdmAccount = default; + Optional sourceMdmAccount = default; + Optional sourceMdmNamespace = default; + Optional metricFilterPattern = default; + Optional fillGapWithZero = default; + Optional isInternal = default; + Optional> dimensions = default; + Optional category = default; + Optional> availabilities = default; + Optional> supportedTimeGrainTypes = default; + Optional> supportedAggregationTypes = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayDescription")) + { + displayDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("unit")) + { + unit = property.Value.GetString(); + continue; + } + if (property.NameEquals("aggregationType")) + { + aggregationType = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportsInstanceLevelAggregation")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + supportsInstanceLevelAggregation = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableRegionalMdmAccount")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + enableRegionalMdmAccount = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("sourceMdmAccount")) + { + sourceMdmAccount = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceMdmNamespace")) + { + sourceMdmNamespace = property.Value.GetString(); + continue; + } + if (property.NameEquals("metricFilterPattern")) + { + metricFilterPattern = property.Value.GetString(); + continue; + } + if (property.NameEquals("fillGapWithZero")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + fillGapWithZero = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isInternal")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isInternal = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dimensions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Dimension.DeserializeDimension(item)); + } + dimensions = array; + continue; + } + if (property.NameEquals("category")) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("availabilities")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MetricAvailability.DeserializeMetricAvailability(item)); + } + availabilities = array; + continue; + } + if (property.NameEquals("supportedTimeGrainTypes")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedTimeGrainTypes = array; + continue; + } + if (property.NameEquals("supportedAggregationTypes")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedAggregationTypes = array; + continue; + } + } + return new MetricSpecification(name.Value, displayName.Value, displayDescription.Value, unit.Value, aggregationType.Value, Optional.ToNullable(supportsInstanceLevelAggregation), Optional.ToNullable(enableRegionalMdmAccount), sourceMdmAccount.Value, sourceMdmNamespace.Value, metricFilterPattern.Value, Optional.ToNullable(fillGapWithZero), Optional.ToNullable(isInternal), Optional.ToList(dimensions), category.Value, Optional.ToList(availabilities), Optional.ToList(supportedTimeGrainTypes), Optional.ToList(supportedAggregationTypes)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.cs index 38a0c42b3359..117a99f5d0ad 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.cs @@ -1,37 +1,46 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Definition of a single resource metric. - /// + /// Definition of a single resource metric. public partial class MetricSpecification { - /// - /// Initializes a new instance of the MetricSpecification class. - /// - public MetricSpecification() + /// Initializes a new instance of MetricSpecification. + internal MetricSpecification() { - CustomInit(); + Dimensions = new ChangeTrackingList(); + Availabilities = new ChangeTrackingList(); + SupportedTimeGrainTypes = new ChangeTrackingList(); + SupportedAggregationTypes = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the MetricSpecification class. - /// - public MetricSpecification(string name = default(string), string displayName = default(string), string displayDescription = default(string), string unit = default(string), string aggregationType = default(string), bool? supportsInstanceLevelAggregation = default(bool?), bool? enableRegionalMdmAccount = default(bool?), string sourceMdmAccount = default(string), string sourceMdmNamespace = default(string), string metricFilterPattern = default(string), bool? fillGapWithZero = default(bool?), bool? isInternal = default(bool?), IList dimensions = default(IList), string category = default(string), IList availabilities = default(IList), IList supportedTimeGrainTypes = default(IList), IList supportedAggregationTypes = default(IList)) + /// Initializes a new instance of MetricSpecification. + /// . + /// . + /// . + /// . + /// . + /// . + /// . + /// . + /// . + /// . + /// . + /// . + /// . + /// . + /// . + /// . + /// . + internal MetricSpecification(string name, string displayName, string displayDescription, string unit, string aggregationType, bool? supportsInstanceLevelAggregation, bool? enableRegionalMdmAccount, string sourceMdmAccount, string sourceMdmNamespace, string metricFilterPattern, bool? fillGapWithZero, bool? isInternal, IReadOnlyList dimensions, string category, IReadOnlyList availabilities, IReadOnlyList supportedTimeGrainTypes, IReadOnlyList supportedAggregationTypes) { Name = name; DisplayName = displayName; @@ -50,98 +59,24 @@ public MetricSpecification() Availabilities = availabilities; SupportedTimeGrainTypes = supportedTimeGrainTypes; SupportedAggregationTypes = supportedAggregationTypes; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - - /// - /// - [JsonProperty(PropertyName = "displayDescription")] - public string DisplayDescription { get; set; } - - /// - /// - [JsonProperty(PropertyName = "unit")] - public string Unit { get; set; } - - /// - /// - [JsonProperty(PropertyName = "aggregationType")] - public string AggregationType { get; set; } - - /// - /// - [JsonProperty(PropertyName = "supportsInstanceLevelAggregation")] - public bool? SupportsInstanceLevelAggregation { get; set; } - - /// - /// - [JsonProperty(PropertyName = "enableRegionalMdmAccount")] - public bool? EnableRegionalMdmAccount { get; set; } - - /// - /// - [JsonProperty(PropertyName = "sourceMdmAccount")] - public string SourceMdmAccount { get; set; } - - /// - /// - [JsonProperty(PropertyName = "sourceMdmNamespace")] - public string SourceMdmNamespace { get; set; } - - /// - /// - [JsonProperty(PropertyName = "metricFilterPattern")] - public string MetricFilterPattern { get; set; } - - /// - /// - [JsonProperty(PropertyName = "fillGapWithZero")] - public bool? FillGapWithZero { get; set; } - - /// - /// - [JsonProperty(PropertyName = "isInternal")] - public bool? IsInternal { get; set; } - - /// - /// - [JsonProperty(PropertyName = "dimensions")] - public IList Dimensions { get; set; } - - /// - /// - [JsonProperty(PropertyName = "category")] - public string Category { get; set; } - - /// - /// - [JsonProperty(PropertyName = "availabilities")] - public IList Availabilities { get; set; } - - /// - /// - [JsonProperty(PropertyName = "supportedTimeGrainTypes")] - public IList SupportedTimeGrainTypes { get; set; } - - /// - /// - [JsonProperty(PropertyName = "supportedAggregationTypes")] - public IList SupportedAggregationTypes { get; set; } - + public string Name { get; } + public string DisplayName { get; } + public string DisplayDescription { get; } + public string Unit { get; } + public string AggregationType { get; } + public bool? SupportsInstanceLevelAggregation { get; } + public bool? EnableRegionalMdmAccount { get; } + public string SourceMdmAccount { get; } + public string SourceMdmNamespace { get; } + public string MetricFilterPattern { get; } + public bool? FillGapWithZero { get; } + public bool? IsInternal { get; } + public IReadOnlyList Dimensions { get; } + public string Category { get; } + public IReadOnlyList Availabilities { get; } + public IReadOnlyList SupportedTimeGrainTypes { get; } + public IReadOnlyList SupportedAggregationTypes { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.Serialization.cs new file mode 100644 index 000000000000..372e3a0a460e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class MigrateMySqlRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ConnectionString)) + { + writer.WritePropertyName("connectionString"); + writer.WriteStringValue(ConnectionString); + } + if (Optional.IsDefined(MigrationType)) + { + writer.WritePropertyName("migrationType"); + writer.WriteStringValue(MigrationType.Value.ToSerialString()); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static MigrateMySqlRequest DeserializeMigrateMySqlRequest(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional connectionString = default; + Optional migrationType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("connectionString")) + { + connectionString = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("migrationType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + migrationType = property0.Value.GetString().ToMySqlMigrationType(); + continue; + } + } + continue; + } + } + return new MigrateMySqlRequest(id.Value, name.Value, kind.Value, type.Value, connectionString.Value, Optional.ToNullable(migrationType)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.cs index db3069fe54b2..5395a702c087 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.cs @@ -1,84 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// MySQL migration request. - /// - [Rest.Serialization.JsonTransformation] + /// MySQL migration request. public partial class MigrateMySqlRequest : ProxyOnlyResource { - /// - /// Initializes a new instance of the MigrateMySqlRequest class. - /// + /// Initializes a new instance of MigrateMySqlRequest. public MigrateMySqlRequest() { - CustomInit(); } - /// - /// Initializes a new instance of the MigrateMySqlRequest class. - /// - /// Connection string to the remote - /// MySQL database. - /// The type of migration operation to be - /// done. Possible values include: 'LocalToRemote', - /// 'RemoteToLocal' - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public MigrateMySqlRequest(string connectionString, MySqlMigrationType migrationType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of MigrateMySqlRequest. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Connection string to the remote MySQL database. + /// The type of migration operation to be done. + internal MigrateMySqlRequest(string id, string name, string kind, string type, string connectionString, MySqlMigrationType? migrationType) : base(id, name, kind, type) { ConnectionString = connectionString; MigrationType = migrationType; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets connection string to the remote MySQL database. - /// - [JsonProperty(PropertyName = "properties.connectionString")] + /// Connection string to the remote MySQL database. public string ConnectionString { get; set; } - - /// - /// Gets or sets the type of migration operation to be done. Possible - /// values include: 'LocalToRemote', 'RemoteToLocal' - /// - [JsonProperty(PropertyName = "properties.migrationType")] - public MySqlMigrationType MigrationType { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ConnectionString == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionString"); - } - } + /// The type of migration operation to be done. + public MySqlMigrationType? MigrationType { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.Serialization.cs new file mode 100644 index 000000000000..2909d22ede56 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.Serialization.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class MigrateMySqlStatus : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static MigrateMySqlStatus DeserializeMigrateMySqlStatus(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional migrationOperationStatus = default; + Optional operationId = default; + Optional localMySqlEnabled = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("migrationOperationStatus")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + migrationOperationStatus = property0.Value.GetString().ToOperationStatus(); + continue; + } + if (property0.NameEquals("operationId")) + { + operationId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("localMySqlEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + localMySqlEnabled = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new MigrateMySqlStatus(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(migrationOperationStatus), operationId.Value, Optional.ToNullable(localMySqlEnabled)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.cs index 459d50aef84b..d5d50f4071c5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.cs @@ -1,80 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// MySQL migration status. - /// - [Rest.Serialization.JsonTransformation] + /// MySQL migration status. public partial class MigrateMySqlStatus : ProxyOnlyResource { - /// - /// Initializes a new instance of the MigrateMySqlStatus class. - /// + /// Initializes a new instance of MigrateMySqlStatus. public MigrateMySqlStatus() { - CustomInit(); } - /// - /// Initializes a new instance of the MigrateMySqlStatus class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Status of the migration - /// task. Possible values include: 'InProgress', 'Failed', 'Succeeded', - /// 'TimedOut', 'Created' - /// Operation ID for the migration - /// task. - /// True if the web app has in app - /// MySql enabled - public MigrateMySqlStatus(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), OperationStatus? migrationOperationStatus = default(OperationStatus?), string operationId = default(string), bool? localMySqlEnabled = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of MigrateMySqlStatus. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Status of the migration task. + /// Operation ID for the migration task. + /// True if the web app has in app MySql enabled. + internal MigrateMySqlStatus(string id, string name, string kind, string type, OperationStatus? migrationOperationStatus, string operationId, bool? localMySqlEnabled) : base(id, name, kind, type) { MigrationOperationStatus = migrationOperationStatus; OperationId = operationId; LocalMySqlEnabled = localMySqlEnabled; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets status of the migration task. Possible values include: - /// 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created' - /// - [JsonProperty(PropertyName = "properties.migrationOperationStatus")] - public OperationStatus? MigrationOperationStatus { get; private set; } - - /// - /// Gets operation ID for the migration task. - /// - [JsonProperty(PropertyName = "properties.operationId")] - public string OperationId { get; private set; } - - /// - /// Gets true if the web app has in app MySql enabled - /// - [JsonProperty(PropertyName = "properties.localMySqlEnabled")] - public bool? LocalMySqlEnabled { get; private set; } - + /// Status of the migration task. + public OperationStatus? MigrationOperationStatus { get; } + /// Operation ID for the migration task. + public string OperationId { get; } + /// True if the web app has in app MySql enabled. + public bool? LocalMySqlEnabled { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.Serialization.cs new file mode 100644 index 000000000000..24b1f234a57c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class MySqlMigrationTypeExtensions + { + public static string ToSerialString(this MySqlMigrationType value) => value switch + { + MySqlMigrationType.LocalToRemote => "LocalToRemote", + MySqlMigrationType.RemoteToLocal => "RemoteToLocal", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MySqlMigrationType value.") + }; + + public static MySqlMigrationType ToMySqlMigrationType(this string value) + { + if (string.Equals(value, "LocalToRemote", StringComparison.InvariantCultureIgnoreCase)) return MySqlMigrationType.LocalToRemote; + if (string.Equals(value, "RemoteToLocal", StringComparison.InvariantCultureIgnoreCase)) return MySqlMigrationType.RemoteToLocal; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MySqlMigrationType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.cs index 72b86f7ca14d..129e90f762db 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for MySqlMigrationType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// The type of migration operation to be done. public enum MySqlMigrationType { - [EnumMember(Value = "LocalToRemote")] + /// LocalToRemote. LocalToRemote, - [EnumMember(Value = "RemoteToLocal")] + /// RemoteToLocal. RemoteToLocal } - internal static class MySqlMigrationTypeEnumExtension - { - internal static string ToSerializedValue(this MySqlMigrationType? value) - { - return value == null ? null : ((MySqlMigrationType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this MySqlMigrationType value) - { - switch( value ) - { - case MySqlMigrationType.LocalToRemote: - return "LocalToRemote"; - case MySqlMigrationType.RemoteToLocal: - return "RemoteToLocal"; - } - return null; - } - - internal static MySqlMigrationType? ParseMySqlMigrationType(this string value) - { - switch( value ) - { - case "LocalToRemote": - return MySqlMigrationType.LocalToRemote; - case "RemoteToLocal": - return MySqlMigrationType.RemoteToLocal; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.Serialization.cs new file mode 100644 index 000000000000..7ec59dd72d2d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class NameIdentifier : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + writer.WriteEndObject(); + } + + internal static NameIdentifier DeserializeNameIdentifier(JsonElement element) + { + Optional name = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + } + return new NameIdentifier(name.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.cs index 71bcdbc98296..e677938b3e0f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.cs @@ -1,51 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Identifies an object. - /// + /// Identifies an object. public partial class NameIdentifier { - /// - /// Initializes a new instance of the NameIdentifier class. - /// + /// Initializes a new instance of NameIdentifier. public NameIdentifier() { - CustomInit(); } - /// - /// Initializes a new instance of the NameIdentifier class. - /// - /// Name of the object. - public NameIdentifier(string name = default(string)) + /// Initializes a new instance of NameIdentifier. + /// Name of the object. + internal NameIdentifier(string name) { Name = name; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the object. - /// - [JsonProperty(PropertyName = "name")] + /// Name of the object. public string Name { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.Serialization.cs new file mode 100644 index 000000000000..ea567cd185e9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class NameIdentifierCollection + { + internal static NameIdentifierCollection DeserializeNameIdentifierCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameIdentifier.DeserializeNameIdentifier(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new NameIdentifierCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.cs new file mode 100644 index 000000000000..1e547f586f0d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of domain name identifiers. + internal partial class NameIdentifierCollection + { + /// Initializes a new instance of NameIdentifierCollection. + /// Collection of resources. + /// is null. + internal NameIdentifierCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of NameIdentifierCollection. + /// Collection of resources. + /// Link to next page of resources. + internal NameIdentifierCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.Serialization.cs new file mode 100644 index 000000000000..673babb895cb --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class NameValuePair : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"); + writer.WriteStringValue(Value); + } + writer.WriteEndObject(); + } + + internal static NameValuePair DeserializeNameValuePair(JsonElement element) + { + Optional name = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value")) + { + value = property.Value.GetString(); + continue; + } + } + return new NameValuePair(name.Value, value.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.cs index 81a8ac40a028..4031cad8ef9a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Name value pair. - /// + /// Name value pair. public partial class NameValuePair { - /// - /// Initializes a new instance of the NameValuePair class. - /// + /// Initializes a new instance of NameValuePair. public NameValuePair() { - CustomInit(); } - /// - /// Initializes a new instance of the NameValuePair class. - /// - /// Pair name. - /// Pair value. - public NameValuePair(string name = default(string), string value = default(string)) + /// Initializes a new instance of NameValuePair. + /// Pair name. + /// Pair value. + internal NameValuePair(string name, string value) { Name = name; Value = value; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets pair name. - /// - [JsonProperty(PropertyName = "name")] + /// Pair name. public string Name { get; set; } - - /// - /// Gets or sets pair value. - /// - [JsonProperty(PropertyName = "value")] + /// Pair value. public string Value { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.Serialization.cs new file mode 100644 index 000000000000..ef5b29a44762 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.Serialization.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class NetworkFeatures : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static NetworkFeatures DeserializeNetworkFeatures(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional virtualNetworkName = default; + Optional virtualNetworkConnection = default; + Optional> hybridConnections = default; + Optional> hybridConnectionsV2 = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("virtualNetworkName")) + { + virtualNetworkName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("virtualNetworkConnection")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + virtualNetworkConnection = VnetInfo.DeserializeVnetInfo(property0.Value); + continue; + } + if (property0.NameEquals("hybridConnections")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(item)); + } + hybridConnections = array; + continue; + } + if (property0.NameEquals("hybridConnectionsV2")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(HybridConnection.DeserializeHybridConnection(item)); + } + hybridConnectionsV2 = array; + continue; + } + } + continue; + } + } + return new NetworkFeatures(id.Value, name.Value, kind.Value, type.Value, virtualNetworkName.Value, virtualNetworkConnection.Value, Optional.ToList(hybridConnections), Optional.ToList(hybridConnectionsV2)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.cs index af9cf1928dac..dff1a26a92d3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.cs @@ -1,89 +1,49 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Full view of network features for an app (presently VNET integration - /// and Hybrid Connections). - /// - [Rest.Serialization.JsonTransformation] + /// Full view of network features for an app (presently VNET integration and Hybrid Connections). public partial class NetworkFeatures : ProxyOnlyResource { - /// - /// Initializes a new instance of the NetworkFeatures class. - /// + /// Initializes a new instance of NetworkFeatures. public NetworkFeatures() { - CustomInit(); + HybridConnections = new ChangeTrackingList(); + HybridConnectionsV2 = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the NetworkFeatures class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Virtual Network name. - /// The Virtual Network summary - /// view. - /// The Hybrid Connections summary - /// view. - /// The Hybrid Connection V2 (Service - /// Bus) view. - public NetworkFeatures(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string virtualNetworkName = default(string), VnetInfo virtualNetworkConnection = default(VnetInfo), IList hybridConnections = default(IList), IList hybridConnectionsV2 = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of NetworkFeatures. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Virtual Network name. + /// The Virtual Network summary view. + /// The Hybrid Connections summary view. + /// The Hybrid Connection V2 (Service Bus) view. + internal NetworkFeatures(string id, string name, string kind, string type, string virtualNetworkName, VnetInfo virtualNetworkConnection, IReadOnlyList hybridConnections, IReadOnlyList hybridConnectionsV2) : base(id, name, kind, type) { VirtualNetworkName = virtualNetworkName; VirtualNetworkConnection = virtualNetworkConnection; HybridConnections = hybridConnections; HybridConnectionsV2 = hybridConnectionsV2; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the Virtual Network name. - /// - [JsonProperty(PropertyName = "properties.virtualNetworkName")] - public string VirtualNetworkName { get; private set; } - - /// - /// Gets the Virtual Network summary view. - /// - [JsonProperty(PropertyName = "properties.virtualNetworkConnection")] - public VnetInfo VirtualNetworkConnection { get; private set; } - - /// - /// Gets the Hybrid Connections summary view. - /// - [JsonProperty(PropertyName = "properties.hybridConnections")] - public IList HybridConnections { get; private set; } - - /// - /// Gets the Hybrid Connection V2 (Service Bus) view. - /// - [JsonProperty(PropertyName = "properties.hybridConnectionsV2")] - public IList HybridConnectionsV2 { get; private set; } - + /// The Virtual Network name. + public string VirtualNetworkName { get; } + /// The Virtual Network summary view. + public VnetInfo VirtualNetworkConnection { get; } + /// The Hybrid Connections summary view. + public IReadOnlyList HybridConnections { get; } + /// The Hybrid Connection V2 (Service Bus) view. + public IReadOnlyList HybridConnectionsV2 { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.Serialization.cs new file mode 100644 index 000000000000..93b903c56e47 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class NetworkTrace + { + internal static NetworkTrace DeserializeNetworkTrace(JsonElement element) + { + Optional path = default; + Optional status = default; + Optional message = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("path")) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("status")) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + } + return new NetworkTrace(path.Value, status.Value, message.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.cs index dd2aad70cd18..52ae1fb7c331 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.cs @@ -1,72 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Network trace - /// + /// Network trace. public partial class NetworkTrace { - /// - /// Initializes a new instance of the NetworkTrace class. - /// - public NetworkTrace() + /// Initializes a new instance of NetworkTrace. + internal NetworkTrace() { - CustomInit(); } - /// - /// Initializes a new instance of the NetworkTrace class. - /// - /// Local file path for the captured network trace - /// file. - /// Current status of the network trace operation, - /// same as Operation.Status (InProgress/Succeeded/Failed). - /// Detailed message of a network trace - /// operation, e.g. error message in case of failure. - public NetworkTrace(string path = default(string), string status = default(string), string message = default(string)) + /// Initializes a new instance of NetworkTrace. + /// Local file path for the captured network trace file. + /// Current status of the network trace operation, same as Operation.Status (InProgress/Succeeded/Failed). + /// Detailed message of a network trace operation, e.g. error message in case of failure. + internal NetworkTrace(string path, string status, string message) { Path = path; Status = status; Message = message; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets local file path for the captured network trace file. - /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } - - /// - /// Gets or sets current status of the network trace operation, same as - /// Operation.Status (InProgress/Succeeded/Failed). - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets detailed message of a network trace operation, e.g. - /// error message in case of failure. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - + /// Local file path for the captured network trace file. + public string Path { get; } + /// Current status of the network trace operation, same as Operation.Status (InProgress/Succeeded/Failed). + public string Status { get; } + /// Detailed message of a network trace operation, e.g. error message in case of failure. + public string Message { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.Serialization.cs new file mode 100644 index 000000000000..47c383e5f7d0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Nonce : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ValidateNonce)) + { + writer.WritePropertyName("validateNonce"); + writer.WriteBooleanValue(ValidateNonce.Value); + } + if (Optional.IsDefined(NonceExpirationInterval)) + { + writer.WritePropertyName("nonceExpirationInterval"); + writer.WriteStringValue(NonceExpirationInterval); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Nonce DeserializeNonce(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional validateNonce = default; + Optional nonceExpirationInterval = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("validateNonce")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + validateNonce = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("nonceExpirationInterval")) + { + nonceExpirationInterval = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new Nonce(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(validateNonce), nonceExpirationInterval.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.cs index 0057825eab8b..5aa6cc1d80fe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.cs @@ -1,60 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the nonce used in the login flow. public partial class Nonce : ProxyOnlyResource { - /// - /// Initializes a new instance of the Nonce class. - /// + /// Initializes a new instance of Nonce. public Nonce() { - CustomInit(); } - /// - /// Initializes a new instance of the Nonce class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public Nonce(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? validateNonce = default(bool?), string nonceExpirationInterval = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of Nonce. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the nonce should not be validated while completing the login flow; otherwise, <code>true</code>. + /// The time after the request is made when the nonce should expire. + internal Nonce(string id, string name, string kind, string type, bool? validateNonce, string nonceExpirationInterval) : base(id, name, kind, type) { ValidateNonce = validateNonce; NonceExpirationInterval = nonceExpirationInterval; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.validateNonce")] + /// <code>false</code> if the nonce should not be validated while completing the login flow; otherwise, <code>true</code>. public bool? ValidateNonce { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.nonceExpirationInterval")] + /// The time after the request is made when the nonce should expire. public string NonceExpirationInterval { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.Serialization.cs new file mode 100644 index 000000000000..dcbe29656da6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class NotificationLevelExtensions + { + public static string ToSerialString(this NotificationLevel value) => value switch + { + NotificationLevel.Critical => "Critical", + NotificationLevel.Warning => "Warning", + NotificationLevel.Information => "Information", + NotificationLevel.NonUrgentSuggestion => "NonUrgentSuggestion", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NotificationLevel value.") + }; + + public static NotificationLevel ToNotificationLevel(this string value) + { + if (string.Equals(value, "Critical", StringComparison.InvariantCultureIgnoreCase)) return NotificationLevel.Critical; + if (string.Equals(value, "Warning", StringComparison.InvariantCultureIgnoreCase)) return NotificationLevel.Warning; + if (string.Equals(value, "Information", StringComparison.InvariantCultureIgnoreCase)) return NotificationLevel.Information; + if (string.Equals(value, "NonUrgentSuggestion", StringComparison.InvariantCultureIgnoreCase)) return NotificationLevel.NonUrgentSuggestion; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NotificationLevel value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.cs index 467c91909fdd..8cedc4eed48d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.cs @@ -1,72 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for NotificationLevel. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Level indicating how critical this recommendation can impact. public enum NotificationLevel { - [EnumMember(Value = "Critical")] + /// Critical. Critical, - [EnumMember(Value = "Warning")] + /// Warning. Warning, - [EnumMember(Value = "Information")] + /// Information. Information, - [EnumMember(Value = "NonUrgentSuggestion")] + /// NonUrgentSuggestion. NonUrgentSuggestion } - internal static class NotificationLevelEnumExtension - { - internal static string ToSerializedValue(this NotificationLevel? value) - { - return value == null ? null : ((NotificationLevel)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this NotificationLevel value) - { - switch( value ) - { - case NotificationLevel.Critical: - return "Critical"; - case NotificationLevel.Warning: - return "Warning"; - case NotificationLevel.Information: - return "Information"; - case NotificationLevel.NonUrgentSuggestion: - return "NonUrgentSuggestion"; - } - return null; - } - - internal static NotificationLevel? ParseNotificationLevel(this string value) - { - switch( value ) - { - case "Critical": - return NotificationLevel.Critical; - case "Warning": - return NotificationLevel.Warning; - case "Information": - return NotificationLevel.Information; - case "NonUrgentSuggestion": - return NotificationLevel.NonUrgentSuggestion; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.Serialization.cs new file mode 100644 index 000000000000..9f16180f1101 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.Serialization.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class OpenIdConnectClientCredential : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Method)) + { + writer.WritePropertyName("method"); + writer.WriteStringValue(Method); + } + if (Optional.IsDefined(ClientSecretSettingName)) + { + writer.WritePropertyName("clientSecretSettingName"); + writer.WriteStringValue(ClientSecretSettingName); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static OpenIdConnectClientCredential DeserializeOpenIdConnectClientCredential(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional method = default; + Optional clientSecretSettingName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("method")) + { + method = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientSecretSettingName")) + { + clientSecretSettingName = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new OpenIdConnectClientCredential(id.Value, name.Value, kind.Value, type.Value, method.Value, clientSecretSettingName.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.cs index c0ce182af5cf..7d302bd2f978 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.cs @@ -1,65 +1,37 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The authentication client credentials of the custom Open ID Connect provider. public partial class OpenIdConnectClientCredential : ProxyOnlyResource { - /// - /// Initializes a new instance of the OpenIdConnectClientCredential - /// class. - /// + /// Initializes a new instance of OpenIdConnectClientCredential. public OpenIdConnectClientCredential() { - CustomInit(); + Method = "ClientSecretPost"; } - /// - /// Initializes a new instance of the OpenIdConnectClientCredential - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Possible values include: - /// 'ClientSecretPost' - public OpenIdConnectClientCredential(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ClientCredentialMethod? method = default(ClientCredentialMethod?), string clientSecretSettingName = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of OpenIdConnectClientCredential. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The method that should be used to authenticate the user. + /// The app setting that contains the client secret for the custom Open ID Connect provider. + internal OpenIdConnectClientCredential(string id, string name, string kind, string type, string method, string clientSecretSettingName) : base(id, name, kind, type) { Method = method; ClientSecretSettingName = clientSecretSettingName; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets possible values include: 'ClientSecretPost' - /// - [JsonProperty(PropertyName = "properties.method")] - public ClientCredentialMethod? Method { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.clientSecretSettingName")] + /// The method that should be used to authenticate the user. + public string Method { get; set; } + /// The app setting that contains the client secret for the custom Open ID Connect provider. public string ClientSecretSettingName { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.Serialization.cs new file mode 100644 index 000000000000..b4d5038cf11b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class OpenIdConnectConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(AuthorizationEndpoint)) + { + writer.WritePropertyName("authorizationEndpoint"); + writer.WriteStringValue(AuthorizationEndpoint); + } + if (Optional.IsDefined(TokenEndpoint)) + { + writer.WritePropertyName("tokenEndpoint"); + writer.WriteStringValue(TokenEndpoint); + } + if (Optional.IsDefined(Issuer)) + { + writer.WritePropertyName("issuer"); + writer.WriteStringValue(Issuer); + } + if (Optional.IsDefined(CertificationUri)) + { + writer.WritePropertyName("certificationUri"); + writer.WriteStringValue(CertificationUri); + } + if (Optional.IsDefined(WellKnownOpenIdConfiguration)) + { + writer.WritePropertyName("wellKnownOpenIdConfiguration"); + writer.WriteStringValue(WellKnownOpenIdConfiguration); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static OpenIdConnectConfig DeserializeOpenIdConnectConfig(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional authorizationEndpoint = default; + Optional tokenEndpoint = default; + Optional issuer = default; + Optional certificationUri = default; + Optional wellKnownOpenIdConfiguration = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("authorizationEndpoint")) + { + authorizationEndpoint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("tokenEndpoint")) + { + tokenEndpoint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("issuer")) + { + issuer = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("certificationUri")) + { + certificationUri = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("wellKnownOpenIdConfiguration")) + { + wellKnownOpenIdConfiguration = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new OpenIdConnectConfig(id.Value, name.Value, kind.Value, type.Value, authorizationEndpoint.Value, tokenEndpoint.Value, issuer.Value, certificationUri.Value, wellKnownOpenIdConfiguration.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.cs index fe09ee1f099d..af8c2cb93379 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.cs @@ -1,78 +1,48 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the endpoints used for the custom Open ID Connect provider. public partial class OpenIdConnectConfig : ProxyOnlyResource { - /// - /// Initializes a new instance of the OpenIdConnectConfig class. - /// + /// Initializes a new instance of OpenIdConnectConfig. public OpenIdConnectConfig() { - CustomInit(); } - /// - /// Initializes a new instance of the OpenIdConnectConfig class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public OpenIdConnectConfig(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string authorizationEndpoint = default(string), string tokenEndpoint = default(string), string issuer = default(string), string certificationUri = default(string), string wellKnownOpenIdConfiguration = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of OpenIdConnectConfig. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The endpoint to be used to make an authorization request. + /// The endpoint to be used to request a token. + /// The endpoint that issues the token. + /// The endpoint that provides the keys necessary to validate the token. + /// The endpoint that contains all the configuration endpoints for the provider. + internal OpenIdConnectConfig(string id, string name, string kind, string type, string authorizationEndpoint, string tokenEndpoint, string issuer, string certificationUri, string wellKnownOpenIdConfiguration) : base(id, name, kind, type) { AuthorizationEndpoint = authorizationEndpoint; TokenEndpoint = tokenEndpoint; Issuer = issuer; CertificationUri = certificationUri; WellKnownOpenIdConfiguration = wellKnownOpenIdConfiguration; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.authorizationEndpoint")] + /// The endpoint to be used to make an authorization request. public string AuthorizationEndpoint { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.tokenEndpoint")] + /// The endpoint to be used to request a token. public string TokenEndpoint { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.issuer")] + /// The endpoint that issues the token. public string Issuer { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.certificationUri")] + /// The endpoint that provides the keys necessary to validate the token. public string CertificationUri { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.wellKnownOpenIdConfiguration")] + /// The endpoint that contains all the configuration endpoints for the provider. public string WellKnownOpenIdConfiguration { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.Serialization.cs new file mode 100644 index 000000000000..7827cfc067dd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.Serialization.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class OpenIdConnectLogin : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(NameClaimType)) + { + writer.WritePropertyName("nameClaimType"); + writer.WriteStringValue(NameClaimType); + } + if (Optional.IsCollectionDefined(Scopes)) + { + writer.WritePropertyName("scopes"); + writer.WriteStartArray(); + foreach (var item in Scopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static OpenIdConnectLogin DeserializeOpenIdConnectLogin(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional nameClaimType = default; + Optional> scopes = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("nameClaimType")) + { + nameClaimType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("scopes")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + scopes = array; + continue; + } + } + continue; + } + } + return new OpenIdConnectLogin(id.Value, name.Value, kind.Value, type.Value, nameClaimType.Value, Optional.ToList(scopes)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.cs index cc0fe8682df0..5a580b507ff0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.cs @@ -1,62 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the login flow of the custom Open ID Connect provider. public partial class OpenIdConnectLogin : ProxyOnlyResource { - /// - /// Initializes a new instance of the OpenIdConnectLogin class. - /// + /// Initializes a new instance of OpenIdConnectLogin. public OpenIdConnectLogin() { - CustomInit(); + Scopes = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the OpenIdConnectLogin class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public OpenIdConnectLogin(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string nameClaimType = default(string), IList scopes = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of OpenIdConnectLogin. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The name of the claim that contains the users name. + /// A list of the scopes that should be requested while authenticating. + internal OpenIdConnectLogin(string id, string name, string kind, string type, string nameClaimType, IList scopes) : base(id, name, kind, type) { NameClaimType = nameClaimType; Scopes = scopes; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.nameClaimType")] + /// The name of the claim that contains the users name. public string NameClaimType { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.scopes")] - public IList Scopes { get; set; } - + /// A list of the scopes that should be requested while authenticating. + public IList Scopes { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.Serialization.cs new file mode 100644 index 000000000000..6b7061936151 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.Serialization.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class OpenIdConnectRegistration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"); + writer.WriteStringValue(ClientId); + } + if (Optional.IsDefined(ClientCredential)) + { + writer.WritePropertyName("clientCredential"); + writer.WriteObjectValue(ClientCredential); + } + if (Optional.IsDefined(OpenIdConnectConfiguration)) + { + writer.WritePropertyName("openIdConnectConfiguration"); + writer.WriteObjectValue(OpenIdConnectConfiguration); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static OpenIdConnectRegistration DeserializeOpenIdConnectRegistration(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional clientId = default; + Optional clientCredential = default; + Optional openIdConnectConfiguration = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("clientId")) + { + clientId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientCredential")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + clientCredential = OpenIdConnectClientCredential.DeserializeOpenIdConnectClientCredential(property0.Value); + continue; + } + if (property0.NameEquals("openIdConnectConfiguration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + openIdConnectConfiguration = OpenIdConnectConfig.DeserializeOpenIdConnectConfig(property0.Value); + continue; + } + } + continue; + } + } + return new OpenIdConnectRegistration(id.Value, name.Value, kind.Value, type.Value, clientId.Value, clientCredential.Value, openIdConnectConfiguration.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.cs index 810737d9830a..b69130a44134 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.cs @@ -1,66 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the app registration for the custom Open ID Connect provider. public partial class OpenIdConnectRegistration : ProxyOnlyResource { - /// - /// Initializes a new instance of the OpenIdConnectRegistration class. - /// + /// Initializes a new instance of OpenIdConnectRegistration. public OpenIdConnectRegistration() { - CustomInit(); } - /// - /// Initializes a new instance of the OpenIdConnectRegistration class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public OpenIdConnectRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string clientId = default(string), OpenIdConnectClientCredential clientCredential = default(OpenIdConnectClientCredential), OpenIdConnectConfig openIdConnectConfiguration = default(OpenIdConnectConfig)) - : base(id, name, kind, type) + /// Initializes a new instance of OpenIdConnectRegistration. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The client id of the custom Open ID Connect provider. + /// The authentication credentials of the custom Open ID Connect provider. + /// The configuration settings of the endpoints used for the custom Open ID Connect provider. + internal OpenIdConnectRegistration(string id, string name, string kind, string type, string clientId, OpenIdConnectClientCredential clientCredential, OpenIdConnectConfig openIdConnectConfiguration) : base(id, name, kind, type) { ClientId = clientId; ClientCredential = clientCredential; OpenIdConnectConfiguration = openIdConnectConfiguration; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.clientId")] + /// The client id of the custom Open ID Connect provider. public string ClientId { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.clientCredential")] + /// The authentication credentials of the custom Open ID Connect provider. public OpenIdConnectClientCredential ClientCredential { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.openIdConnectConfiguration")] + /// The configuration settings of the endpoints used for the custom Open ID Connect provider. public OpenIdConnectConfig OpenIdConnectConfiguration { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.Serialization.cs new file mode 100644 index 000000000000..4ca2900c20b5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.Serialization.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Operation + { + internal static Operation DeserializeOperation(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional status = default; + Optional> errors = default; + Optional createdTime = default; + Optional modifiedTime = default; + Optional expirationTime = default; + Optional geoMasterOperationId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("status")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property.Value.GetString().ToOperationStatus(); + continue; + } + if (property.NameEquals("errors")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ErrorEntity.DeserializeErrorEntity(item)); + } + errors = array; + continue; + } + if (property.NameEquals("createdTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("modifiedTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + modifiedTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + expirationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("geoMasterOperationId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + geoMasterOperationId = property.Value.GetGuid(); + continue; + } + } + return new Operation(id.Value, name.Value, Optional.ToNullable(status), Optional.ToList(errors), Optional.ToNullable(createdTime), Optional.ToNullable(modifiedTime), Optional.ToNullable(expirationTime), Optional.ToNullable(geoMasterOperationId)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.cs index 3bc7056b44e8..fd7964ef4360 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.cs @@ -1,51 +1,35 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// An operation on a resource. - /// + /// An operation on a resource. public partial class Operation { - /// - /// Initializes a new instance of the Operation class. - /// - public Operation() + /// Initializes a new instance of Operation. + internal Operation() { - CustomInit(); + Errors = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the Operation class. - /// - /// Operation ID. - /// Operation name. - /// The current status of the operation. Possible - /// values include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', - /// 'Created' - /// Any errors associate with the - /// operation. - /// Time when operation has started. - /// Time when operation has been - /// updated. - /// Time when operation will - /// expire. - /// Applicable only for stamp - /// operation ids. - public Operation(string id = default(string), string name = default(string), OperationStatus? status = default(OperationStatus?), IList errors = default(IList), System.DateTime? createdTime = default(System.DateTime?), System.DateTime? modifiedTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), System.Guid? geoMasterOperationId = default(System.Guid?)) + /// Initializes a new instance of Operation. + /// Operation ID. + /// Operation name. + /// The current status of the operation. + /// Any errors associate with the operation. + /// Time when operation has started. + /// Time when operation has been updated. + /// Time when operation will expire. + /// Applicable only for stamp operation ids. + internal Operation(string id, string name, OperationStatus? status, IReadOnlyList errors, DateTimeOffset? createdTime, DateTimeOffset? modifiedTime, DateTimeOffset? expirationTime, Guid? geoMasterOperationId) { Id = id; Name = name; @@ -55,62 +39,23 @@ public Operation() ModifiedTime = modifiedTime; ExpirationTime = expirationTime; GeoMasterOperationId = geoMasterOperationId; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets operation ID. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets operation name. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the current status of the operation. Possible values - /// include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created' - /// - [JsonProperty(PropertyName = "status")] - public OperationStatus? Status { get; set; } - - /// - /// Gets or sets any errors associate with the operation. - /// - [JsonProperty(PropertyName = "errors")] - public IList Errors { get; set; } - - /// - /// Gets or sets time when operation has started. - /// - [JsonProperty(PropertyName = "createdTime")] - public System.DateTime? CreatedTime { get; set; } - - /// - /// Gets or sets time when operation has been updated. - /// - [JsonProperty(PropertyName = "modifiedTime")] - public System.DateTime? ModifiedTime { get; set; } - - /// - /// Gets or sets time when operation will expire. - /// - [JsonProperty(PropertyName = "expirationTime")] - public System.DateTime? ExpirationTime { get; set; } - - /// - /// Gets or sets applicable only for stamp operation ids. - /// - [JsonProperty(PropertyName = "geoMasterOperationId")] - public System.Guid? GeoMasterOperationId { get; set; } - + /// Operation ID. + public string Id { get; } + /// Operation name. + public string Name { get; } + /// The current status of the operation. + public OperationStatus? Status { get; } + /// Any errors associate with the operation. + public IReadOnlyList Errors { get; } + /// Time when operation has started. + public DateTimeOffset? CreatedTime { get; } + /// Time when operation has been updated. + public DateTimeOffset? ModifiedTime { get; } + /// Time when operation will expire. + public DateTimeOffset? ExpirationTime { get; } + /// Applicable only for stamp operation ids. + public Guid? GeoMasterOperationId { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.Serialization.cs new file mode 100644 index 000000000000..33ced43ca1fd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class OperationStatusExtensions + { + public static string ToSerialString(this OperationStatus value) => value switch + { + OperationStatus.InProgress => "InProgress", + OperationStatus.Failed => "Failed", + OperationStatus.Succeeded => "Succeeded", + OperationStatus.TimedOut => "TimedOut", + OperationStatus.Created => "Created", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OperationStatus value.") + }; + + public static OperationStatus ToOperationStatus(this string value) + { + if (string.Equals(value, "InProgress", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.InProgress; + if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.Failed; + if (string.Equals(value, "Succeeded", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.Succeeded; + if (string.Equals(value, "TimedOut", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.TimedOut; + if (string.Equals(value, "Created", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.Created; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OperationStatus value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.cs index 2c2fdb31a3d3..c1cd56a1bce2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.cs @@ -1,78 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for OperationStatus. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// The current status of the operation. public enum OperationStatus { - [EnumMember(Value = "InProgress")] + /// InProgress. InProgress, - [EnumMember(Value = "Failed")] + /// Failed. Failed, - [EnumMember(Value = "Succeeded")] + /// Succeeded. Succeeded, - [EnumMember(Value = "TimedOut")] + /// TimedOut. TimedOut, - [EnumMember(Value = "Created")] + /// Created. Created } - internal static class OperationStatusEnumExtension - { - internal static string ToSerializedValue(this OperationStatus? value) - { - return value == null ? null : ((OperationStatus)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this OperationStatus value) - { - switch( value ) - { - case OperationStatus.InProgress: - return "InProgress"; - case OperationStatus.Failed: - return "Failed"; - case OperationStatus.Succeeded: - return "Succeeded"; - case OperationStatus.TimedOut: - return "TimedOut"; - case OperationStatus.Created: - return "Created"; - } - return null; - } - - internal static OperationStatus? ParseOperationStatus(this string value) - { - switch( value ) - { - case "InProgress": - return OperationStatus.InProgress; - case "Failed": - return OperationStatus.Failed; - case "Succeeded": - return OperationStatus.Succeeded; - case "TimedOut": - return OperationStatus.TimedOut; - case "Created": - return OperationStatus.Created; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.Serialization.cs new file mode 100644 index 000000000000..49a8e58a38df --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class OutboundEnvironmentEndpoint + { + internal static OutboundEnvironmentEndpoint DeserializeOutboundEnvironmentEndpoint(JsonElement element) + { + Optional category = default; + Optional> endpoints = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category")) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpoints")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDependency.DeserializeEndpointDependency(item)); + } + endpoints = array; + continue; + } + } + return new OutboundEnvironmentEndpoint(category.Value, Optional.ToList(endpoints)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.cs index c7de2355e83d..44314072d066 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.cs @@ -1,70 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Endpoints accessed for a common purpose that the App Service - /// Environment requires outbound network access to. - /// + /// Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. public partial class OutboundEnvironmentEndpoint { - /// - /// Initializes a new instance of the OutboundEnvironmentEndpoint - /// class. - /// - public OutboundEnvironmentEndpoint() + /// Initializes a new instance of OutboundEnvironmentEndpoint. + internal OutboundEnvironmentEndpoint() { - CustomInit(); + Endpoints = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the OutboundEnvironmentEndpoint - /// class. - /// - /// The type of service accessed by the App - /// Service Environment, e.g., Azure Storage, Azure SQL Database, and - /// Azure Active Directory. - /// The endpoints that the App Service - /// Environment reaches the service at. - public OutboundEnvironmentEndpoint(string category = default(string), IList endpoints = default(IList)) + /// Initializes a new instance of OutboundEnvironmentEndpoint. + /// The type of service accessed by the App Service Environment, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory. + /// The endpoints that the App Service Environment reaches the service at. + internal OutboundEnvironmentEndpoint(string category, IReadOnlyList endpoints) { Category = category; Endpoints = endpoints; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of service accessed by the App Service - /// Environment, e.g., Azure Storage, Azure SQL Database, and Azure - /// Active Directory. - /// - [JsonProperty(PropertyName = "category")] - public string Category { get; set; } - - /// - /// Gets or sets the endpoints that the App Service Environment reaches - /// the service at. - /// - [JsonProperty(PropertyName = "endpoints")] - public IList Endpoints { get; set; } - + /// The type of service accessed by the App Service Environment, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory. + public string Category { get; } + /// The endpoints that the App Service Environment reaches the service at. + public IReadOnlyList Endpoints { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.Serialization.cs new file mode 100644 index 000000000000..5c277214f31e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class OutboundEnvironmentEndpointCollection + { + internal static OutboundEnvironmentEndpointCollection DeserializeOutboundEnvironmentEndpointCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OutboundEnvironmentEndpoint.DeserializeOutboundEnvironmentEndpoint(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new OutboundEnvironmentEndpointCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.cs new file mode 100644 index 000000000000..5eb3727dfa90 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Outbound Environment Endpoints. + internal partial class OutboundEnvironmentEndpointCollection + { + /// Initializes a new instance of OutboundEnvironmentEndpointCollection. + /// Collection of resources. + /// is null. + internal OutboundEnvironmentEndpointCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of OutboundEnvironmentEndpointCollection. + /// Collection of resources. + /// Link to next page of resources. + internal OutboundEnvironmentEndpointCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.Serialization.cs new file mode 100644 index 000000000000..4b04103ac667 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class PerfMonCounterCollection + { + internal static PerfMonCounterCollection DeserializePerfMonCounterCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PerfMonResponse.DeserializePerfMonResponse(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new PerfMonCounterCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.cs new file mode 100644 index 000000000000..95cd786f6a13 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of performance monitor counters. + internal partial class PerfMonCounterCollection + { + /// Initializes a new instance of PerfMonCounterCollection. + /// Collection of resources. + /// is null. + internal PerfMonCounterCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of PerfMonCounterCollection. + /// Collection of resources. + /// Link to next page of resources. + internal PerfMonCounterCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.Serialization.cs new file mode 100644 index 000000000000..aaa998c6fe9e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PerfMonResponse + { + internal static PerfMonResponse DeserializePerfMonResponse(JsonElement element) + { + Optional code = default; + Optional message = default; + Optional data = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code")) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("data")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + data = PerfMonSet.DeserializePerfMonSet(property.Value); + continue; + } + } + return new PerfMonResponse(code.Value, message.Value, data.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.cs index 835f102738e4..3bc94eabcb3a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.cs @@ -1,67 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Performance monitor API response. - /// + /// Performance monitor API response. public partial class PerfMonResponse { - /// - /// Initializes a new instance of the PerfMonResponse class. - /// - public PerfMonResponse() + /// Initializes a new instance of PerfMonResponse. + internal PerfMonResponse() { - CustomInit(); } - /// - /// Initializes a new instance of the PerfMonResponse class. - /// - /// The response code. - /// The message. - /// The performance monitor counters. - public PerfMonResponse(string code = default(string), string message = default(string), PerfMonSet data = default(PerfMonSet)) + /// Initializes a new instance of PerfMonResponse. + /// The response code. + /// The message. + /// The performance monitor counters. + internal PerfMonResponse(string code, string message, PerfMonSet data) { Code = code; Message = message; Data = data; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the response code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets the message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - /// - /// Gets or sets the performance monitor counters. - /// - [JsonProperty(PropertyName = "data")] - public PerfMonSet Data { get; set; } - + /// The response code. + public string Code { get; } + /// The message. + public string Message { get; } + /// The performance monitor counters. + public PerfMonSet Data { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.Serialization.cs new file mode 100644 index 000000000000..78427e23bb06 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PerfMonSample + { + internal static PerfMonSample DeserializePerfMonSample(JsonElement element) + { + Optional time = default; + Optional instanceName = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("time")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + time = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("instanceName")) + { + instanceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + value = property.Value.GetDouble(); + continue; + } + } + return new PerfMonSample(Optional.ToNullable(time), instanceName.Value, Optional.ToNullable(value)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.cs index 7680bce28534..a3eb357a6dac 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.cs @@ -1,69 +1,38 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Performance monitor sample in a set. - /// + /// Performance monitor sample in a set. public partial class PerfMonSample { - /// - /// Initializes a new instance of the PerfMonSample class. - /// - public PerfMonSample() + /// Initializes a new instance of PerfMonSample. + internal PerfMonSample() { - CustomInit(); } - /// - /// Initializes a new instance of the PerfMonSample class. - /// - /// Point in time for which counter was - /// measured. - /// Name of the server on which the - /// measurement is made. - /// Value of counter at a certain time. - public PerfMonSample(System.DateTime? time = default(System.DateTime?), string instanceName = default(string), double? value = default(double?)) + /// Initializes a new instance of PerfMonSample. + /// Point in time for which counter was measured. + /// Name of the server on which the measurement is made. + /// Value of counter at a certain time. + internal PerfMonSample(DateTimeOffset? time, string instanceName, double? value) { Time = time; InstanceName = instanceName; Value = value; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets point in time for which counter was measured. - /// - [JsonProperty(PropertyName = "time")] - public System.DateTime? Time { get; set; } - - /// - /// Gets or sets name of the server on which the measurement is made. - /// - [JsonProperty(PropertyName = "instanceName")] - public string InstanceName { get; set; } - - /// - /// Gets or sets value of counter at a certain time. - /// - [JsonProperty(PropertyName = "value")] - public double? Value { get; set; } - + /// Point in time for which counter was measured. + public DateTimeOffset? Time { get; } + /// Name of the server on which the measurement is made. + public string InstanceName { get; } + /// Value of counter at a certain time. + public double? Value { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.Serialization.cs new file mode 100644 index 000000000000..7604e383f000 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.Serialization.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PerfMonSet + { + internal static PerfMonSet DeserializePerfMonSet(JsonElement element) + { + Optional name = default; + Optional startTime = default; + Optional endTime = default; + Optional timeGrain = default; + Optional> values = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeGrain")) + { + timeGrain = property.Value.GetString(); + continue; + } + if (property.NameEquals("values")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PerfMonSample.DeserializePerfMonSample(item)); + } + values = array; + continue; + } + } + return new PerfMonSet(name.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), timeGrain.Value, Optional.ToList(values)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.cs index 3b7842c98441..f6a60217cafb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.cs @@ -1,87 +1,49 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Metric information. - /// + /// Metric information. public partial class PerfMonSet { - /// - /// Initializes a new instance of the PerfMonSet class. - /// - public PerfMonSet() + /// Initializes a new instance of PerfMonSet. + internal PerfMonSet() { - CustomInit(); + Values = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the PerfMonSet class. - /// - /// Unique key name of the counter. - /// Start time of the period. - /// End time of the period. - /// Presented time grain. - /// Collection of workers that are active during - /// this time. - public PerfMonSet(string name = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), IList values = default(IList)) + /// Initializes a new instance of PerfMonSet. + /// Unique key name of the counter. + /// Start time of the period. + /// End time of the period. + /// Presented time grain. + /// Collection of workers that are active during this time. + internal PerfMonSet(string name, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain, IReadOnlyList values) { Name = name; StartTime = startTime; EndTime = endTime; TimeGrain = timeGrain; Values = values; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets unique key name of the counter. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets start time of the period. - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets end time of the period. - /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; set; } - - /// - /// Gets or sets presented time grain. - /// - [JsonProperty(PropertyName = "timeGrain")] - public string TimeGrain { get; set; } - - /// - /// Gets or sets collection of workers that are active during this - /// time. - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - + /// Unique key name of the counter. + public string Name { get; } + /// Start time of the period. + public DateTimeOffset? StartTime { get; } + /// End time of the period. + public DateTimeOffset? EndTime { get; } + /// Presented time grain. + public string TimeGrain { get; } + /// Collection of workers that are active during this time. + public IReadOnlyList Values { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.Serialization.cs new file mode 100644 index 000000000000..9191cb280d87 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PremierAddOn : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"); + writer.WriteStringValue(Sku); + } + if (Optional.IsDefined(Product)) + { + writer.WritePropertyName("product"); + writer.WriteStringValue(Product); + } + if (Optional.IsDefined(Vendor)) + { + writer.WritePropertyName("vendor"); + writer.WriteStringValue(Vendor); + } + if (Optional.IsDefined(MarketplacePublisher)) + { + writer.WritePropertyName("marketplacePublisher"); + writer.WriteStringValue(MarketplacePublisher); + } + if (Optional.IsDefined(MarketplaceOffer)) + { + writer.WritePropertyName("marketplaceOffer"); + writer.WriteStringValue(MarketplaceOffer); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static PremierAddOn DeserializePremierAddOn(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + string location = default; + Optional type = default; + Optional> tags = default; + Optional sku = default; + Optional product = default; + Optional vendor = default; + Optional marketplacePublisher = default; + Optional marketplaceOffer = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("sku")) + { + sku = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("product")) + { + product = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vendor")) + { + vendor = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("marketplacePublisher")) + { + marketplacePublisher = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("marketplaceOffer")) + { + marketplaceOffer = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new PremierAddOn(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), sku.Value, product.Value, vendor.Value, marketplacePublisher.Value, marketplaceOffer.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.cs index 680ea63fa64b..f76b6cb5c8df 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.cs @@ -1,107 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Premier add-on. - /// - [Rest.Serialization.JsonTransformation] + /// Premier add-on. public partial class PremierAddOn : Resource { - /// - /// Initializes a new instance of the PremierAddOn class. - /// - public PremierAddOn() + /// Initializes a new instance of PremierAddOn. + /// Resource Location. + /// is null. + public PremierAddOn(string location) : base(location) { - CustomInit(); + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } } - /// - /// Initializes a new instance of the PremierAddOn class. - /// - /// Resource Location. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Resource tags. - /// Premier add on SKU. - /// Premier add on Product. - /// Premier add on Vendor. - /// Premier add on Marketplace - /// publisher. - /// Premier add on Marketplace - /// offer. - public PremierAddOn(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string sku = default(string), string product = default(string), string vendor = default(string), string marketplacePublisher = default(string), string marketplaceOffer = default(string)) - : base(location, id, name, kind, type, tags) + /// Initializes a new instance of PremierAddOn. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource Location. + /// Resource type. + /// Resource tags. + /// Premier add on SKU. + /// Premier add on Product. + /// Premier add on Vendor. + /// Premier add on Marketplace publisher. + /// Premier add on Marketplace offer. + internal PremierAddOn(string id, string name, string kind, string location, string type, IDictionary tags, string sku, string product, string vendor, string marketplacePublisher, string marketplaceOffer) : base(id, name, kind, location, type, tags) { Sku = sku; Product = product; Vendor = vendor; MarketplacePublisher = marketplacePublisher; MarketplaceOffer = marketplaceOffer; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets premier add on SKU. - /// - [JsonProperty(PropertyName = "properties.sku")] + /// Premier add on SKU. public string Sku { get; set; } - - /// - /// Gets or sets premier add on Product. - /// - [JsonProperty(PropertyName = "properties.product")] + /// Premier add on Product. public string Product { get; set; } - - /// - /// Gets or sets premier add on Vendor. - /// - [JsonProperty(PropertyName = "properties.vendor")] + /// Premier add on Vendor. public string Vendor { get; set; } - - /// - /// Gets or sets premier add on Marketplace publisher. - /// - [JsonProperty(PropertyName = "properties.marketplacePublisher")] + /// Premier add on Marketplace publisher. public string MarketplacePublisher { get; set; } - - /// - /// Gets or sets premier add on Marketplace offer. - /// - [JsonProperty(PropertyName = "properties.marketplaceOffer")] + /// Premier add on Marketplace offer. public string MarketplaceOffer { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.Serialization.cs new file mode 100644 index 000000000000..01d67a8ac027 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PremierAddOnOffer : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"); + writer.WriteStringValue(Sku); + } + if (Optional.IsDefined(Product)) + { + writer.WritePropertyName("product"); + writer.WriteStringValue(Product); + } + if (Optional.IsDefined(Vendor)) + { + writer.WritePropertyName("vendor"); + writer.WriteStringValue(Vendor); + } + if (Optional.IsDefined(PromoCodeRequired)) + { + writer.WritePropertyName("promoCodeRequired"); + writer.WriteBooleanValue(PromoCodeRequired.Value); + } + if (Optional.IsDefined(Quota)) + { + writer.WritePropertyName("quota"); + writer.WriteNumberValue(Quota.Value); + } + if (Optional.IsDefined(WebHostingPlanRestrictions)) + { + writer.WritePropertyName("webHostingPlanRestrictions"); + writer.WriteStringValue(WebHostingPlanRestrictions.Value.ToSerialString()); + } + if (Optional.IsDefined(PrivacyPolicyUrl)) + { + writer.WritePropertyName("privacyPolicyUrl"); + writer.WriteStringValue(PrivacyPolicyUrl); + } + if (Optional.IsDefined(LegalTermsUrl)) + { + writer.WritePropertyName("legalTermsUrl"); + writer.WriteStringValue(LegalTermsUrl); + } + if (Optional.IsDefined(MarketplacePublisher)) + { + writer.WritePropertyName("marketplacePublisher"); + writer.WriteStringValue(MarketplacePublisher); + } + if (Optional.IsDefined(MarketplaceOffer)) + { + writer.WritePropertyName("marketplaceOffer"); + writer.WriteStringValue(MarketplaceOffer); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static PremierAddOnOffer DeserializePremierAddOnOffer(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional sku = default; + Optional product = default; + Optional vendor = default; + Optional promoCodeRequired = default; + Optional quota = default; + Optional webHostingPlanRestrictions = default; + Optional privacyPolicyUrl = default; + Optional legalTermsUrl = default; + Optional marketplacePublisher = default; + Optional marketplaceOffer = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("sku")) + { + sku = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("product")) + { + product = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vendor")) + { + vendor = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("promoCodeRequired")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + promoCodeRequired = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("quota")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + quota = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("webHostingPlanRestrictions")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + webHostingPlanRestrictions = property0.Value.GetString().ToAppServicePlanRestrictions(); + continue; + } + if (property0.NameEquals("privacyPolicyUrl")) + { + privacyPolicyUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("legalTermsUrl")) + { + legalTermsUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("marketplacePublisher")) + { + marketplacePublisher = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("marketplaceOffer")) + { + marketplaceOffer = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new PremierAddOnOffer(id.Value, name.Value, kind.Value, type.Value, sku.Value, product.Value, vendor.Value, Optional.ToNullable(promoCodeRequired), Optional.ToNullable(quota), Optional.ToNullable(webHostingPlanRestrictions), privacyPolicyUrl.Value, legalTermsUrl.Value, marketplacePublisher.Value, marketplaceOffer.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.cs index a81239aad5ef..b1f8d7c61390 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.cs @@ -1,57 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Premier add-on offer. - /// - [Rest.Serialization.JsonTransformation] + /// Premier add-on offer. public partial class PremierAddOnOffer : ProxyOnlyResource { - /// - /// Initializes a new instance of the PremierAddOnOffer class. - /// + /// Initializes a new instance of PremierAddOnOffer. public PremierAddOnOffer() { - CustomInit(); } - /// - /// Initializes a new instance of the PremierAddOnOffer class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Premier add on SKU. - /// Premier add on offer Product. - /// Premier add on offer Vendor. - /// <code>true</code> if - /// promotion code is required; otherwise, - /// <code>false</code>. - /// Premier add on offer Quota. - /// App Service plans this - /// offer is restricted to. Possible values include: 'None', 'Free', - /// 'Shared', 'Basic', 'Standard', 'Premium' - /// Privacy policy URL. - /// Legal terms URL. - /// Marketplace publisher. - /// Marketplace offer. - public PremierAddOnOffer(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string sku = default(string), string product = default(string), string vendor = default(string), bool? promoCodeRequired = default(bool?), int? quota = default(int?), AppServicePlanRestrictions? webHostingPlanRestrictions = default(AppServicePlanRestrictions?), string privacyPolicyUrl = default(string), string legalTermsUrl = default(string), string marketplacePublisher = default(string), string marketplaceOffer = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of PremierAddOnOffer. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Premier add on SKU. + /// Premier add on offer Product. + /// Premier add on offer Vendor. + /// <code>true</code> if promotion code is required; otherwise, <code>false</code>. + /// Premier add on offer Quota. + /// App Service plans this offer is restricted to. + /// Privacy policy URL. + /// Legal terms URL. + /// Marketplace publisher. + /// Marketplace offer. + internal PremierAddOnOffer(string id, string name, string kind, string type, string sku, string product, string vendor, bool? promoCodeRequired, int? quota, AppServicePlanRestrictions? webHostingPlanRestrictions, string privacyPolicyUrl, string legalTermsUrl, string marketplacePublisher, string marketplaceOffer) : base(id, name, kind, type) { Sku = sku; Product = product; @@ -63,77 +42,27 @@ public PremierAddOnOffer() LegalTermsUrl = legalTermsUrl; MarketplacePublisher = marketplacePublisher; MarketplaceOffer = marketplaceOffer; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets premier add on SKU. - /// - [JsonProperty(PropertyName = "properties.sku")] + /// Premier add on SKU. public string Sku { get; set; } - - /// - /// Gets or sets premier add on offer Product. - /// - [JsonProperty(PropertyName = "properties.product")] + /// Premier add on offer Product. public string Product { get; set; } - - /// - /// Gets or sets premier add on offer Vendor. - /// - [JsonProperty(PropertyName = "properties.vendor")] + /// Premier add on offer Vendor. public string Vendor { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// promotion code is required; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.promoCodeRequired")] + /// <code>true</code> if promotion code is required; otherwise, <code>false</code>. public bool? PromoCodeRequired { get; set; } - - /// - /// Gets or sets premier add on offer Quota. - /// - [JsonProperty(PropertyName = "properties.quota")] + /// Premier add on offer Quota. public int? Quota { get; set; } - - /// - /// Gets or sets app Service plans this offer is restricted to. - /// Possible values include: 'None', 'Free', 'Shared', 'Basic', - /// 'Standard', 'Premium' - /// - [JsonProperty(PropertyName = "properties.webHostingPlanRestrictions")] + /// App Service plans this offer is restricted to. public AppServicePlanRestrictions? WebHostingPlanRestrictions { get; set; } - - /// - /// Gets or sets privacy policy URL. - /// - [JsonProperty(PropertyName = "properties.privacyPolicyUrl")] + /// Privacy policy URL. public string PrivacyPolicyUrl { get; set; } - - /// - /// Gets or sets legal terms URL. - /// - [JsonProperty(PropertyName = "properties.legalTermsUrl")] + /// Legal terms URL. public string LegalTermsUrl { get; set; } - - /// - /// Gets or sets marketplace publisher. - /// - [JsonProperty(PropertyName = "properties.marketplacePublisher")] + /// Marketplace publisher. public string MarketplacePublisher { get; set; } - - /// - /// Gets or sets marketplace offer. - /// - [JsonProperty(PropertyName = "properties.marketplaceOffer")] + /// Marketplace offer. public string MarketplaceOffer { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.Serialization.cs new file mode 100644 index 000000000000..1d60e24b46c6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class PremierAddOnOfferCollection + { + internal static PremierAddOnOfferCollection DeserializePremierAddOnOfferCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PremierAddOnOffer.DeserializePremierAddOnOffer(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new PremierAddOnOfferCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.cs new file mode 100644 index 000000000000..fa49335347a7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of premier add-on offers. + internal partial class PremierAddOnOfferCollection + { + /// Initializes a new instance of PremierAddOnOfferCollection. + /// Collection of resources. + /// is null. + internal PremierAddOnOfferCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of PremierAddOnOfferCollection. + /// Collection of resources. + /// Link to next page of resources. + internal PremierAddOnOfferCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.Serialization.cs new file mode 100644 index 000000000000..a7aa0c1a420c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PremierAddOnPatchResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"); + writer.WriteStringValue(Sku); + } + if (Optional.IsDefined(Product)) + { + writer.WritePropertyName("product"); + writer.WriteStringValue(Product); + } + if (Optional.IsDefined(Vendor)) + { + writer.WritePropertyName("vendor"); + writer.WriteStringValue(Vendor); + } + if (Optional.IsDefined(MarketplacePublisher)) + { + writer.WritePropertyName("marketplacePublisher"); + writer.WriteStringValue(MarketplacePublisher); + } + if (Optional.IsDefined(MarketplaceOffer)) + { + writer.WritePropertyName("marketplaceOffer"); + writer.WriteStringValue(MarketplaceOffer); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static PremierAddOnPatchResource DeserializePremierAddOnPatchResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional sku = default; + Optional product = default; + Optional vendor = default; + Optional marketplacePublisher = default; + Optional marketplaceOffer = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("sku")) + { + sku = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("product")) + { + product = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vendor")) + { + vendor = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("marketplacePublisher")) + { + marketplacePublisher = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("marketplaceOffer")) + { + marketplaceOffer = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new PremierAddOnPatchResource(id.Value, name.Value, kind.Value, type.Value, sku.Value, product.Value, vendor.Value, marketplacePublisher.Value, marketplaceOffer.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.cs index db9df88b7a70..04b2cfbd8b5b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.cs @@ -1,93 +1,48 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// ARM resource for a PremierAddOn. - /// - [Rest.Serialization.JsonTransformation] + /// ARM resource for a PremierAddOn. public partial class PremierAddOnPatchResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the PremierAddOnPatchResource class. - /// + /// Initializes a new instance of PremierAddOnPatchResource. public PremierAddOnPatchResource() { - CustomInit(); } - /// - /// Initializes a new instance of the PremierAddOnPatchResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Premier add on SKU. - /// Premier add on Product. - /// Premier add on Vendor. - /// Premier add on Marketplace - /// publisher. - /// Premier add on Marketplace - /// offer. - public PremierAddOnPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string sku = default(string), string product = default(string), string vendor = default(string), string marketplacePublisher = default(string), string marketplaceOffer = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of PremierAddOnPatchResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Premier add on SKU. + /// Premier add on Product. + /// Premier add on Vendor. + /// Premier add on Marketplace publisher. + /// Premier add on Marketplace offer. + internal PremierAddOnPatchResource(string id, string name, string kind, string type, string sku, string product, string vendor, string marketplacePublisher, string marketplaceOffer) : base(id, name, kind, type) { Sku = sku; Product = product; Vendor = vendor; MarketplacePublisher = marketplacePublisher; MarketplaceOffer = marketplaceOffer; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets premier add on SKU. - /// - [JsonProperty(PropertyName = "properties.sku")] + /// Premier add on SKU. public string Sku { get; set; } - - /// - /// Gets or sets premier add on Product. - /// - [JsonProperty(PropertyName = "properties.product")] + /// Premier add on Product. public string Product { get; set; } - - /// - /// Gets or sets premier add on Vendor. - /// - [JsonProperty(PropertyName = "properties.vendor")] + /// Premier add on Vendor. public string Vendor { get; set; } - - /// - /// Gets or sets premier add on Marketplace publisher. - /// - [JsonProperty(PropertyName = "properties.marketplacePublisher")] + /// Premier add on Marketplace publisher. public string MarketplacePublisher { get; set; } - - /// - /// Gets or sets premier add on Marketplace offer. - /// - [JsonProperty(PropertyName = "properties.marketplaceOffer")] + /// Premier add on Marketplace offer. public string MarketplaceOffer { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.Serialization.cs new file mode 100644 index 000000000000..551c4ed3a7ca --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.Serialization.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PrivateAccess : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsCollectionDefined(VirtualNetworks)) + { + writer.WritePropertyName("virtualNetworks"); + writer.WriteStartArray(); + foreach (var item in VirtualNetworks) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static PrivateAccess DeserializePrivateAccess(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional> virtualNetworks = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("virtualNetworks")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PrivateAccessVirtualNetwork.DeserializePrivateAccessVirtualNetwork(item)); + } + virtualNetworks = array; + continue; + } + } + continue; + } + } + return new PrivateAccess(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), Optional.ToList(virtualNetworks)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.cs index 776a949db130..6bca1ca2c002 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.cs @@ -1,72 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Description of the parameters of Private Access for a Web Site. - /// - [Rest.Serialization.JsonTransformation] + /// Description of the parameters of Private Access for a Web Site. public partial class PrivateAccess : ProxyOnlyResource { - /// - /// Initializes a new instance of the PrivateAccess class. - /// + /// Initializes a new instance of PrivateAccess. public PrivateAccess() { - CustomInit(); + VirtualNetworks = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the PrivateAccess class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Whether private access is enabled or - /// not. - /// The Virtual Networks (and subnets) - /// allowed to access the site privately. - public PrivateAccess(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), IList virtualNetworks = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of PrivateAccess. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Whether private access is enabled or not. + /// The Virtual Networks (and subnets) allowed to access the site privately. + internal PrivateAccess(string id, string name, string kind, string type, bool? enabled, IList virtualNetworks) : base(id, name, kind, type) { Enabled = enabled; VirtualNetworks = virtualNetworks; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets whether private access is enabled or not. - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// Whether private access is enabled or not. public bool? Enabled { get; set; } - - /// - /// Gets or sets the Virtual Networks (and subnets) allowed to access - /// the site privately. - /// - [JsonProperty(PropertyName = "properties.virtualNetworks")] - public IList VirtualNetworks { get; set; } - + /// The Virtual Networks (and subnets) allowed to access the site privately. + public IList VirtualNetworks { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.Serialization.cs new file mode 100644 index 000000000000..47cf78a00d62 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PrivateAccessSubnet : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"); + writer.WriteNumberValue(Key.Value); + } + writer.WriteEndObject(); + } + + internal static PrivateAccessSubnet DeserializePrivateAccessSubnet(JsonElement element) + { + Optional name = default; + Optional key = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("key")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + key = property.Value.GetInt32(); + continue; + } + } + return new PrivateAccessSubnet(name.Value, Optional.ToNullable(key)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.cs index ba29e37944d8..4413fc4fcce6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.cs @@ -1,60 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Description of a Virtual Network subnet that is useable for private - /// site access. - /// + /// Description of a Virtual Network subnet that is useable for private site access. public partial class PrivateAccessSubnet { - /// - /// Initializes a new instance of the PrivateAccessSubnet class. - /// + /// Initializes a new instance of PrivateAccessSubnet. public PrivateAccessSubnet() { - CustomInit(); } - /// - /// Initializes a new instance of the PrivateAccessSubnet class. - /// - /// The name of the subnet. - /// The key (ID) of the subnet. - public PrivateAccessSubnet(string name = default(string), int? key = default(int?)) + /// Initializes a new instance of PrivateAccessSubnet. + /// The name of the subnet. + /// The key (ID) of the subnet. + internal PrivateAccessSubnet(string name, int? key) { Name = name; Key = key; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the subnet. - /// - [JsonProperty(PropertyName = "name")] + /// The name of the subnet. public string Name { get; set; } - - /// - /// Gets or sets the key (ID) of the subnet. - /// - [JsonProperty(PropertyName = "key")] + /// The key (ID) of the subnet. public int? Key { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.Serialization.cs new file mode 100644 index 000000000000..f84bcbc24f37 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.Serialization.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PrivateAccessVirtualNetwork : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"); + writer.WriteNumberValue(Key.Value); + } + if (Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"); + writer.WriteStringValue(ResourceId); + } + if (Optional.IsCollectionDefined(Subnets)) + { + writer.WritePropertyName("subnets"); + writer.WriteStartArray(); + foreach (var item in Subnets) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static PrivateAccessVirtualNetwork DeserializePrivateAccessVirtualNetwork(JsonElement element) + { + Optional name = default; + Optional key = default; + Optional resourceId = default; + Optional> subnets = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("key")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + key = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resourceId")) + { + resourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnets")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrivateAccessSubnet.DeserializePrivateAccessSubnet(item)); + } + subnets = array; + continue; + } + } + return new PrivateAccessVirtualNetwork(name.Value, Optional.ToNullable(key), resourceId.Value, Optional.ToList(subnets)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.cs index 56c4af4f74f7..c568a949bd4b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.cs @@ -1,85 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Description of a Virtual Network that is useable for private site - /// access. - /// + /// Description of a Virtual Network that is useable for private site access. public partial class PrivateAccessVirtualNetwork { - /// - /// Initializes a new instance of the PrivateAccessVirtualNetwork - /// class. - /// + /// Initializes a new instance of PrivateAccessVirtualNetwork. public PrivateAccessVirtualNetwork() { - CustomInit(); + Subnets = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the PrivateAccessVirtualNetwork - /// class. - /// - /// The name of the Virtual Network. - /// The key (ID) of the Virtual Network. - /// The ARM uri of the Virtual Network - /// A List of subnets that access is allowed to - /// on this Virtual Network. An empty array (but not null) is - /// interpreted to mean that all subnets are allowed within this - /// Virtual Network. - public PrivateAccessVirtualNetwork(string name = default(string), int? key = default(int?), string resourceId = default(string), IList subnets = default(IList)) + /// Initializes a new instance of PrivateAccessVirtualNetwork. + /// The name of the Virtual Network. + /// The key (ID) of the Virtual Network. + /// The ARM uri of the Virtual Network. + /// A List of subnets that access is allowed to on this Virtual Network. An empty array (but not null) is interpreted to mean that all subnets are allowed within this Virtual Network. + internal PrivateAccessVirtualNetwork(string name, int? key, string resourceId, IList subnets) { Name = name; Key = key; ResourceId = resourceId; Subnets = subnets; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the Virtual Network. - /// - [JsonProperty(PropertyName = "name")] + /// The name of the Virtual Network. public string Name { get; set; } - - /// - /// Gets or sets the key (ID) of the Virtual Network. - /// - [JsonProperty(PropertyName = "key")] + /// The key (ID) of the Virtual Network. public int? Key { get; set; } - - /// - /// Gets or sets the ARM uri of the Virtual Network - /// - [JsonProperty(PropertyName = "resourceId")] + /// The ARM uri of the Virtual Network. public string ResourceId { get; set; } - - /// - /// Gets or sets a List of subnets that access is allowed to on this - /// Virtual Network. An empty array (but not null) is interpreted to - /// mean that all subnets are allowed within this Virtual Network. - /// - [JsonProperty(PropertyName = "subnets")] - public IList Subnets { get; set; } - + /// A List of subnets that access is allowed to on this Virtual Network. An empty array (but not null) is interpreted to mean that all subnets are allowed within this Virtual Network. + public IList Subnets { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.Serialization.cs new file mode 100644 index 000000000000..e9b0eea7adf3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class PrivateEndpointConnectionCollection + { + internal static PrivateEndpointConnectionCollection DeserializePrivateEndpointConnectionCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new PrivateEndpointConnectionCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..7acd559506dd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The PrivateEndpointConnectionCollection. + internal partial class PrivateEndpointConnectionCollection + { + /// Initializes a new instance of PrivateEndpointConnectionCollection. + /// Collection of resources. + /// is null. + internal PrivateEndpointConnectionCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of PrivateEndpointConnectionCollection. + /// Collection of resources. + /// Link to next page of resources. + internal PrivateEndpointConnectionCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.Serialization.cs new file mode 100644 index 000000000000..a8c51d15e6ad --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.Serialization.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PrivateLinkConnectionApprovalRequestResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(PrivateLinkServiceConnectionState)) + { + writer.WritePropertyName("privateLinkServiceConnectionState"); + writer.WriteObjectValue(PrivateLinkServiceConnectionState); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static PrivateLinkConnectionApprovalRequestResource DeserializePrivateLinkConnectionApprovalRequestResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional privateLinkServiceConnectionState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("privateLinkServiceConnectionState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + privateLinkServiceConnectionState = PrivateLinkConnectionState.DeserializePrivateLinkConnectionState(property0.Value); + continue; + } + } + continue; + } + } + return new PrivateLinkConnectionApprovalRequestResource(id.Value, name.Value, kind.Value, type.Value, privateLinkServiceConnectionState.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.cs index ef3b3bd9df49..b80413e0e67f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Private Endpoint Connection Approval ARM resource. - /// - [Rest.Serialization.JsonTransformation] + /// Private Endpoint Connection Approval ARM resource. public partial class PrivateLinkConnectionApprovalRequestResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the - /// PrivateLinkConnectionApprovalRequestResource class. - /// + /// Initializes a new instance of PrivateLinkConnectionApprovalRequestResource. public PrivateLinkConnectionApprovalRequestResource() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// PrivateLinkConnectionApprovalRequestResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public PrivateLinkConnectionApprovalRequestResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), PrivateLinkConnectionState privateLinkServiceConnectionState = default(PrivateLinkConnectionState)) - : base(id, name, kind, type) + /// Initializes a new instance of PrivateLinkConnectionApprovalRequestResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The state of a private link connection. + internal PrivateLinkConnectionApprovalRequestResource(string id, string name, string kind, string type, PrivateLinkConnectionState privateLinkServiceConnectionState) : base(id, name, kind, type) { PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] + /// The state of a private link connection. public PrivateLinkConnectionState PrivateLinkServiceConnectionState { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.Serialization.cs new file mode 100644 index 000000000000..f5195018ddec --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PrivateLinkConnectionState : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"); + writer.WriteStringValue(Status); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(ActionsRequired)) + { + writer.WritePropertyName("actionsRequired"); + writer.WriteStringValue(ActionsRequired); + } + writer.WriteEndObject(); + } + + internal static PrivateLinkConnectionState DeserializePrivateLinkConnectionState(JsonElement element) + { + Optional status = default; + Optional description = default; + Optional actionsRequired = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status")) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("actionsRequired")) + { + actionsRequired = property.Value.GetString(); + continue; + } + } + return new PrivateLinkConnectionState(status.Value, description.Value, actionsRequired.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.cs index 3b63407e7c0e..bb409f6be32d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.cs @@ -1,69 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// The state of a private link connection - /// + /// The state of a private link connection. public partial class PrivateLinkConnectionState { - /// - /// Initializes a new instance of the PrivateLinkConnectionState class. - /// + /// Initializes a new instance of PrivateLinkConnectionState. public PrivateLinkConnectionState() { - CustomInit(); } - /// - /// Initializes a new instance of the PrivateLinkConnectionState class. - /// - /// Status of a private link connection - /// Description of a private link - /// connection - /// ActionsRequired for a private link - /// connection - public PrivateLinkConnectionState(string status = default(string), string description = default(string), string actionsRequired = default(string)) + /// Initializes a new instance of PrivateLinkConnectionState. + /// Status of a private link connection. + /// Description of a private link connection. + /// ActionsRequired for a private link connection. + internal PrivateLinkConnectionState(string status, string description, string actionsRequired) { Status = status; Description = description; ActionsRequired = actionsRequired; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets status of a private link connection - /// - [JsonProperty(PropertyName = "status")] + /// Status of a private link connection. public string Status { get; set; } - - /// - /// Gets or sets description of a private link connection - /// - [JsonProperty(PropertyName = "description")] + /// Description of a private link connection. public string Description { get; set; } - - /// - /// Gets or sets actionsRequired for a private link connection - /// - [JsonProperty(PropertyName = "actionsRequired")] + /// ActionsRequired for a private link connection. public string ActionsRequired { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.Serialization.cs new file mode 100644 index 000000000000..ea62e1bde554 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PrivateLinkResource + { + internal static PrivateLinkResource DeserializePrivateLinkResource(JsonElement element) + { + string id = default; + string name = default; + string type = default; + PrivateLinkResourceProperties properties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + properties = PrivateLinkResourceProperties.DeserializePrivateLinkResourceProperties(property.Value); + continue; + } + } + return new PrivateLinkResource(id, name, type, properties); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.cs index 16b30cfebcc3..3947310c8be2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.cs @@ -1,98 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A private link resource - /// + /// A private link resource. public partial class PrivateLinkResource { - /// - /// Initializes a new instance of the PrivateLinkResource class. - /// - public PrivateLinkResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PrivateLinkResource class. - /// - /// Name of a private link resource - /// Properties of a private link - /// resource - public PrivateLinkResource(string id, string name, string type, PrivateLinkResourceProperties properties) + /// Initializes a new instance of PrivateLinkResource. + /// . + /// Name of a private link resource. + /// . + /// Properties of a private link resource. + /// , , , or is null. + internal PrivateLinkResource(string id, string name, string type, PrivateLinkResourceProperties properties) { - Id = id; - Name = name; - Type = type; - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets name of a private link resource - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets properties of a private link resource - /// - [JsonProperty(PropertyName = "properties")] - public PrivateLinkResourceProperties Properties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Id == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + throw new ArgumentNullException(nameof(id)); } - if (Name == null) + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new ArgumentNullException(nameof(name)); } - if (Type == null) + if (type == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + throw new ArgumentNullException(nameof(type)); } - if (Properties == null) + if (properties == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + throw new ArgumentNullException(nameof(properties)); } + + Id = id; + Name = name; + Type = type; + Properties = properties; } + + public string Id { get; } + /// Name of a private link resource. + public string Name { get; } + public string Type { get; } + /// Properties of a private link resource. + public PrivateLinkResourceProperties Properties { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.Serialization.cs new file mode 100644 index 000000000000..05809f87e128 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PrivateLinkResourceProperties + { + internal static PrivateLinkResourceProperties DeserializePrivateLinkResourceProperties(JsonElement element) + { + Optional groupId = default; + Optional> requiredMembers = default; + Optional> requiredZoneNames = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("groupId")) + { + groupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("requiredMembers")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredMembers = array; + continue; + } + if (property.NameEquals("requiredZoneNames")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredZoneNames = array; + continue; + } + } + return new PrivateLinkResourceProperties(groupId.Value, Optional.ToList(requiredMembers), Optional.ToList(requiredZoneNames)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.cs index e421a58138e6..7f7228168e03 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.cs @@ -1,73 +1,41 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Properties of a private link resource - /// + /// Properties of a private link resource. public partial class PrivateLinkResourceProperties { - /// - /// Initializes a new instance of the PrivateLinkResourceProperties - /// class. - /// - public PrivateLinkResourceProperties() + /// Initializes a new instance of PrivateLinkResourceProperties. + internal PrivateLinkResourceProperties() { - CustomInit(); + RequiredMembers = new ChangeTrackingList(); + RequiredZoneNames = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the PrivateLinkResourceProperties - /// class. - /// - /// GroupId of a private link resource - /// RequiredMembers of a private link - /// resource - /// RequiredZoneNames of a private link - /// resource - public PrivateLinkResourceProperties(string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList)) + /// Initializes a new instance of PrivateLinkResourceProperties. + /// GroupId of a private link resource. + /// RequiredMembers of a private link resource. + /// RequiredZoneNames of a private link resource. + internal PrivateLinkResourceProperties(string groupId, IReadOnlyList requiredMembers, IReadOnlyList requiredZoneNames) { GroupId = groupId; RequiredMembers = requiredMembers; RequiredZoneNames = requiredZoneNames; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets groupId of a private link resource - /// - [JsonProperty(PropertyName = "groupId")] - public string GroupId { get; private set; } - - /// - /// Gets requiredMembers of a private link resource - /// - [JsonProperty(PropertyName = "requiredMembers")] - public IList RequiredMembers { get; private set; } - - /// - /// Gets requiredZoneNames of a private link resource - /// - [JsonProperty(PropertyName = "requiredZoneNames")] - public IList RequiredZoneNames { get; private set; } - + /// GroupId of a private link resource. + public string GroupId { get; } + /// RequiredMembers of a private link resource. + public IReadOnlyList RequiredMembers { get; } + /// RequiredZoneNames of a private link resource. + public IReadOnlyList RequiredZoneNames { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs new file mode 100644 index 000000000000..93e60333a262 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PrivateLinkResourcesWrapper + { + internal static PrivateLinkResourcesWrapper DeserializePrivateLinkResourcesWrapper(JsonElement element) + { + IReadOnlyList value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrivateLinkResource.DeserializePrivateLinkResource(item)); + } + value = array; + continue; + } + } + return new PrivateLinkResourcesWrapper(value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.cs index 0aed6d8e9f87..06b51d154804 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.cs @@ -1,77 +1,39 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Wrapper for a collection of private link resources - /// + /// Wrapper for a collection of private link resources. public partial class PrivateLinkResourcesWrapper { - /// - /// Initializes a new instance of the PrivateLinkResourcesWrapper - /// class. - /// - public PrivateLinkResourcesWrapper() + /// Initializes a new instance of PrivateLinkResourcesWrapper. + /// . + /// is null. + internal PrivateLinkResourcesWrapper(IEnumerable value) { - CustomInit(); + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); } - /// - /// Initializes a new instance of the PrivateLinkResourcesWrapper - /// class. - /// - public PrivateLinkResourcesWrapper(IList value) + /// Initializes a new instance of PrivateLinkResourcesWrapper. + /// . + internal PrivateLinkResourcesWrapper(IReadOnlyList value) { Value = value; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Value == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); - } - if (Value != null) - { - foreach (var element in Value) - { - if (element != null) - { - element.Validate(); - } - } - } - } + public IReadOnlyList Value { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.Serialization.cs new file mode 100644 index 000000000000..bfffa6b5fb31 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.Serialization.cs @@ -0,0 +1,642 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ProcessInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(DeploymentName)) + { + writer.WritePropertyName("deployment_name"); + writer.WriteStringValue(DeploymentName); + } + if (Optional.IsDefined(Href)) + { + writer.WritePropertyName("href"); + writer.WriteStringValue(Href); + } + if (Optional.IsDefined(Minidump)) + { + writer.WritePropertyName("minidump"); + writer.WriteStringValue(Minidump); + } + if (Optional.IsDefined(IsProfileRunning)) + { + writer.WritePropertyName("is_profile_running"); + writer.WriteBooleanValue(IsProfileRunning.Value); + } + if (Optional.IsDefined(IsIisProfileRunning)) + { + writer.WritePropertyName("is_iis_profile_running"); + writer.WriteBooleanValue(IsIisProfileRunning.Value); + } + if (Optional.IsDefined(IisProfileTimeoutInSeconds)) + { + writer.WritePropertyName("iis_profile_timeout_in_seconds"); + writer.WriteNumberValue(IisProfileTimeoutInSeconds.Value); + } + if (Optional.IsDefined(Parent)) + { + writer.WritePropertyName("parent"); + writer.WriteStringValue(Parent); + } + if (Optional.IsCollectionDefined(Children)) + { + writer.WritePropertyName("children"); + writer.WriteStartArray(); + foreach (var item in Children) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Threads)) + { + writer.WritePropertyName("threads"); + writer.WriteStartArray(); + foreach (var item in Threads) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(OpenFileHandles)) + { + writer.WritePropertyName("open_file_handles"); + writer.WriteStartArray(); + foreach (var item in OpenFileHandles) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Modules)) + { + writer.WritePropertyName("modules"); + writer.WriteStartArray(); + foreach (var item in Modules) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(FileName)) + { + writer.WritePropertyName("file_name"); + writer.WriteStringValue(FileName); + } + if (Optional.IsDefined(CommandLine)) + { + writer.WritePropertyName("command_line"); + writer.WriteStringValue(CommandLine); + } + if (Optional.IsDefined(UserName)) + { + writer.WritePropertyName("user_name"); + writer.WriteStringValue(UserName); + } + if (Optional.IsDefined(HandleCount)) + { + writer.WritePropertyName("handle_count"); + writer.WriteNumberValue(HandleCount.Value); + } + if (Optional.IsDefined(ModuleCount)) + { + writer.WritePropertyName("module_count"); + writer.WriteNumberValue(ModuleCount.Value); + } + if (Optional.IsDefined(ThreadCount)) + { + writer.WritePropertyName("thread_count"); + writer.WriteNumberValue(ThreadCount.Value); + } + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("start_time"); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(TotalCpuTime)) + { + writer.WritePropertyName("total_cpu_time"); + writer.WriteStringValue(TotalCpuTime); + } + if (Optional.IsDefined(UserCpuTime)) + { + writer.WritePropertyName("user_cpu_time"); + writer.WriteStringValue(UserCpuTime); + } + if (Optional.IsDefined(PrivilegedCpuTime)) + { + writer.WritePropertyName("privileged_cpu_time"); + writer.WriteStringValue(PrivilegedCpuTime); + } + if (Optional.IsDefined(WorkingSet)) + { + writer.WritePropertyName("working_set"); + writer.WriteNumberValue(WorkingSet.Value); + } + if (Optional.IsDefined(PeakWorkingSet)) + { + writer.WritePropertyName("peak_working_set"); + writer.WriteNumberValue(PeakWorkingSet.Value); + } + if (Optional.IsDefined(PrivateMemory)) + { + writer.WritePropertyName("private_memory"); + writer.WriteNumberValue(PrivateMemory.Value); + } + if (Optional.IsDefined(VirtualMemory)) + { + writer.WritePropertyName("virtual_memory"); + writer.WriteNumberValue(VirtualMemory.Value); + } + if (Optional.IsDefined(PeakVirtualMemory)) + { + writer.WritePropertyName("peak_virtual_memory"); + writer.WriteNumberValue(PeakVirtualMemory.Value); + } + if (Optional.IsDefined(PagedSystemMemory)) + { + writer.WritePropertyName("paged_system_memory"); + writer.WriteNumberValue(PagedSystemMemory.Value); + } + if (Optional.IsDefined(NonPagedSystemMemory)) + { + writer.WritePropertyName("non_paged_system_memory"); + writer.WriteNumberValue(NonPagedSystemMemory.Value); + } + if (Optional.IsDefined(PagedMemory)) + { + writer.WritePropertyName("paged_memory"); + writer.WriteNumberValue(PagedMemory.Value); + } + if (Optional.IsDefined(PeakPagedMemory)) + { + writer.WritePropertyName("peak_paged_memory"); + writer.WriteNumberValue(PeakPagedMemory.Value); + } + if (Optional.IsDefined(TimeStamp)) + { + writer.WritePropertyName("time_stamp"); + writer.WriteStringValue(TimeStamp.Value, "O"); + } + if (Optional.IsCollectionDefined(EnvironmentVariables)) + { + writer.WritePropertyName("environment_variables"); + writer.WriteStartObject(); + foreach (var item in EnvironmentVariables) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(IsScmSite)) + { + writer.WritePropertyName("is_scm_site"); + writer.WriteBooleanValue(IsScmSite.Value); + } + if (Optional.IsDefined(IsWebjob)) + { + writer.WritePropertyName("is_webjob"); + writer.WriteBooleanValue(IsWebjob.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ProcessInfo DeserializeProcessInfo(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional identifier = default; + Optional deploymentName = default; + Optional href = default; + Optional minidump = default; + Optional isProfileRunning = default; + Optional isIisProfileRunning = default; + Optional iisProfileTimeoutInSeconds = default; + Optional parent = default; + Optional> children = default; + Optional> threads = default; + Optional> openFileHandles = default; + Optional> modules = default; + Optional fileName = default; + Optional commandLine = default; + Optional userName = default; + Optional handleCount = default; + Optional moduleCount = default; + Optional threadCount = default; + Optional startTime = default; + Optional totalCpuTime = default; + Optional userCpuTime = default; + Optional privilegedCpuTime = default; + Optional workingSet = default; + Optional peakWorkingSet = default; + Optional privateMemory = default; + Optional virtualMemory = default; + Optional peakVirtualMemory = default; + Optional pagedSystemMemory = default; + Optional nonPagedSystemMemory = default; + Optional pagedMemory = default; + Optional peakPagedMemory = default; + Optional timeStamp = default; + Optional> environmentVariables = default; + Optional isScmSite = default; + Optional isWebjob = default; + Optional description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("identifier")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + identifier = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("deployment_name")) + { + deploymentName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("href")) + { + href = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("minidump")) + { + minidump = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("is_profile_running")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isProfileRunning = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("is_iis_profile_running")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isIisProfileRunning = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("iis_profile_timeout_in_seconds")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + iisProfileTimeoutInSeconds = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("parent")) + { + parent = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("children")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + children = array; + continue; + } + if (property0.NameEquals("threads")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ProcessThreadInfo.DeserializeProcessThreadInfo(item)); + } + threads = array; + continue; + } + if (property0.NameEquals("open_file_handles")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + openFileHandles = array; + continue; + } + if (property0.NameEquals("modules")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ProcessModuleInfo.DeserializeProcessModuleInfo(item)); + } + modules = array; + continue; + } + if (property0.NameEquals("file_name")) + { + fileName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("command_line")) + { + commandLine = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("user_name")) + { + userName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("handle_count")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + handleCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("module_count")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + moduleCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("thread_count")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + threadCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("start_time")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("total_cpu_time")) + { + totalCpuTime = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("user_cpu_time")) + { + userCpuTime = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("privileged_cpu_time")) + { + privilegedCpuTime = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("working_set")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + workingSet = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("peak_working_set")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + peakWorkingSet = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("private_memory")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + privateMemory = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("virtual_memory")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + virtualMemory = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("peak_virtual_memory")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + peakVirtualMemory = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("paged_system_memory")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + pagedSystemMemory = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("non_paged_system_memory")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + nonPagedSystemMemory = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("paged_memory")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + pagedMemory = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("peak_paged_memory")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + peakPagedMemory = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("time_stamp")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + timeStamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("environment_variables")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + environmentVariables = dictionary; + continue; + } + if (property0.NameEquals("is_scm_site")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isScmSite = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("is_webjob")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isWebjob = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("description")) + { + description = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new ProcessInfo(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(identifier), deploymentName.Value, href.Value, minidump.Value, Optional.ToNullable(isProfileRunning), Optional.ToNullable(isIisProfileRunning), Optional.ToNullable(iisProfileTimeoutInSeconds), parent.Value, Optional.ToList(children), Optional.ToList(threads), Optional.ToList(openFileHandles), Optional.ToList(modules), fileName.Value, commandLine.Value, userName.Value, Optional.ToNullable(handleCount), Optional.ToNullable(moduleCount), Optional.ToNullable(threadCount), Optional.ToNullable(startTime), totalCpuTime.Value, userCpuTime.Value, privilegedCpuTime.Value, Optional.ToNullable(workingSet), Optional.ToNullable(peakWorkingSet), Optional.ToNullable(privateMemory), Optional.ToNullable(virtualMemory), Optional.ToNullable(peakVirtualMemory), Optional.ToNullable(pagedSystemMemory), Optional.ToNullable(nonPagedSystemMemory), Optional.ToNullable(pagedMemory), Optional.ToNullable(peakPagedMemory), Optional.ToNullable(timeStamp), Optional.ToDictionary(environmentVariables), Optional.ToNullable(isScmSite), Optional.ToNullable(isWebjob), description.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.cs index a8bf754df141..4064f7e553f1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.cs @@ -1,84 +1,71 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Process Information. - /// - [Rest.Serialization.JsonTransformation] + /// Process Information. public partial class ProcessInfo : ProxyOnlyResource { - /// - /// Initializes a new instance of the ProcessInfo class. - /// + /// Initializes a new instance of ProcessInfo. public ProcessInfo() { - CustomInit(); + Children = new ChangeTrackingList(); + Threads = new ChangeTrackingList(); + OpenFileHandles = new ChangeTrackingList(); + Modules = new ChangeTrackingList(); + EnvironmentVariables = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the ProcessInfo class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// ARM Identifier for deployment. - /// Deployment name. - /// HRef URI. - /// Minidump URI. - /// Is profile running? - /// Is the IIS Profile - /// running? - /// IIS Profile timeout - /// (seconds). - /// Parent process. - /// Child process list. - /// Thread list. - /// List of open files. - /// List of modules. - /// File name of this process. - /// Command line. - /// User name. - /// Handle count. - /// Module count. - /// Thread count. - /// Start time. - /// Total CPU time. - /// User CPU time. - /// Privileged CPU time. - /// Working set. - /// Peak working set. - /// Private memory size. - /// Virtual memory size. - /// Peak virtual memory usage. - /// Paged system memory. - /// Non-paged system memory. - /// Paged memory. - /// Peak paged memory. - /// Time stamp. - /// List of environment - /// variables. - /// Is this the SCM site? - /// Is this a Web Job? - /// Description of process. - public ProcessInfo(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? identifier = default(int?), string deploymentName = default(string), string href = default(string), string minidump = default(string), bool? isProfileRunning = default(bool?), bool? isIisProfileRunning = default(bool?), double? iisProfileTimeoutInSeconds = default(double?), string parent = default(string), IList children = default(IList), IList threads = default(IList), IList openFileHandles = default(IList), IList modules = default(IList), string fileName = default(string), string commandLine = default(string), string userName = default(string), int? handleCount = default(int?), int? moduleCount = default(int?), int? threadCount = default(int?), System.DateTime? startTime = default(System.DateTime?), string totalCpuTime = default(string), string userCpuTime = default(string), string privilegedCpuTime = default(string), long? workingSet = default(long?), long? peakWorkingSet = default(long?), long? privateMemory = default(long?), long? virtualMemory = default(long?), long? peakVirtualMemory = default(long?), long? pagedSystemMemory = default(long?), long? nonPagedSystemMemory = default(long?), long? pagedMemory = default(long?), long? peakPagedMemory = default(long?), System.DateTime? timeStamp = default(System.DateTime?), IDictionary environmentVariables = default(IDictionary), bool? isScmSite = default(bool?), bool? isWebjob = default(bool?), string description = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of ProcessInfo. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// ARM Identifier for deployment. + /// Deployment name. + /// HRef URI. + /// Minidump URI. + /// Is profile running?. + /// Is the IIS Profile running?. + /// IIS Profile timeout (seconds). + /// Parent process. + /// Child process list. + /// Thread list. + /// List of open files. + /// List of modules. + /// File name of this process. + /// Command line. + /// User name. + /// Handle count. + /// Module count. + /// Thread count. + /// Start time. + /// Total CPU time. + /// User CPU time. + /// Privileged CPU time. + /// Working set. + /// Peak working set. + /// Private memory size. + /// Virtual memory size. + /// Peak virtual memory usage. + /// Paged system memory. + /// Non-paged system memory. + /// Paged memory. + /// Peak paged memory. + /// Time stamp. + /// List of environment variables. + /// Is this the SCM site?. + /// Is this a Web Job?. + /// Description of process. + internal ProcessInfo(string id, string name, string kind, string type, int? identifier, string deploymentName, string href, string minidump, bool? isProfileRunning, bool? isIisProfileRunning, double? iisProfileTimeoutInSeconds, string parent, IList children, IList threads, IList openFileHandles, IList modules, string fileName, string commandLine, string userName, int? handleCount, int? moduleCount, int? threadCount, DateTimeOffset? startTime, string totalCpuTime, string userCpuTime, string privilegedCpuTime, long? workingSet, long? peakWorkingSet, long? privateMemory, long? virtualMemory, long? peakVirtualMemory, long? pagedSystemMemory, long? nonPagedSystemMemory, long? pagedMemory, long? peakPagedMemory, DateTimeOffset? timeStamp, IDictionary environmentVariables, bool? isScmSite, bool? isWebjob, string description) : base(id, name, kind, type) { Identifier = identifier; DeploymentName = deploymentName; @@ -116,229 +103,79 @@ public ProcessInfo() IsScmSite = isScmSite; IsWebjob = isWebjob; Description = description; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets ARM Identifier for deployment. - /// - [JsonProperty(PropertyName = "properties.identifier")] - public int? Identifier { get; private set; } - - /// - /// Gets or sets deployment name. - /// - [JsonProperty(PropertyName = "properties.deployment_name")] + /// ARM Identifier for deployment. + public int? Identifier { get; } + /// Deployment name. public string DeploymentName { get; set; } - - /// - /// Gets or sets hRef URI. - /// - [JsonProperty(PropertyName = "properties.href")] + /// HRef URI. public string Href { get; set; } - - /// - /// Gets or sets minidump URI. - /// - [JsonProperty(PropertyName = "properties.minidump")] + /// Minidump URI. public string Minidump { get; set; } - - /// - /// Gets or sets is profile running? - /// - [JsonProperty(PropertyName = "properties.is_profile_running")] + /// Is profile running?. public bool? IsProfileRunning { get; set; } - - /// - /// Gets or sets is the IIS Profile running? - /// - [JsonProperty(PropertyName = "properties.is_iis_profile_running")] + /// Is the IIS Profile running?. public bool? IsIisProfileRunning { get; set; } - - /// - /// Gets or sets IIS Profile timeout (seconds). - /// - [JsonProperty(PropertyName = "properties.iis_profile_timeout_in_seconds")] + /// IIS Profile timeout (seconds). public double? IisProfileTimeoutInSeconds { get; set; } - - /// - /// Gets or sets parent process. - /// - [JsonProperty(PropertyName = "properties.parent")] + /// Parent process. public string Parent { get; set; } - - /// - /// Gets or sets child process list. - /// - [JsonProperty(PropertyName = "properties.children")] - public IList Children { get; set; } - - /// - /// Gets or sets thread list. - /// - [JsonProperty(PropertyName = "properties.threads")] - public IList Threads { get; set; } - - /// - /// Gets or sets list of open files. - /// - [JsonProperty(PropertyName = "properties.open_file_handles")] - public IList OpenFileHandles { get; set; } - - /// - /// Gets or sets list of modules. - /// - [JsonProperty(PropertyName = "properties.modules")] - public IList Modules { get; set; } - - /// - /// Gets or sets file name of this process. - /// - [JsonProperty(PropertyName = "properties.file_name")] + /// Child process list. + public IList Children { get; } + /// Thread list. + public IList Threads { get; } + /// List of open files. + public IList OpenFileHandles { get; } + /// List of modules. + public IList Modules { get; } + /// File name of this process. public string FileName { get; set; } - - /// - /// Gets or sets command line. - /// - [JsonProperty(PropertyName = "properties.command_line")] + /// Command line. public string CommandLine { get; set; } - - /// - /// Gets or sets user name. - /// - [JsonProperty(PropertyName = "properties.user_name")] + /// User name. public string UserName { get; set; } - - /// - /// Gets or sets handle count. - /// - [JsonProperty(PropertyName = "properties.handle_count")] + /// Handle count. public int? HandleCount { get; set; } - - /// - /// Gets or sets module count. - /// - [JsonProperty(PropertyName = "properties.module_count")] + /// Module count. public int? ModuleCount { get; set; } - - /// - /// Gets or sets thread count. - /// - [JsonProperty(PropertyName = "properties.thread_count")] + /// Thread count. public int? ThreadCount { get; set; } - - /// - /// Gets or sets start time. - /// - [JsonProperty(PropertyName = "properties.start_time")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets total CPU time. - /// - [JsonProperty(PropertyName = "properties.total_cpu_time")] + /// Start time. + public DateTimeOffset? StartTime { get; set; } + /// Total CPU time. public string TotalCpuTime { get; set; } - - /// - /// Gets or sets user CPU time. - /// - [JsonProperty(PropertyName = "properties.user_cpu_time")] + /// User CPU time. public string UserCpuTime { get; set; } - - /// - /// Gets or sets privileged CPU time. - /// - [JsonProperty(PropertyName = "properties.privileged_cpu_time")] + /// Privileged CPU time. public string PrivilegedCpuTime { get; set; } - - /// - /// Gets or sets working set. - /// - [JsonProperty(PropertyName = "properties.working_set")] + /// Working set. public long? WorkingSet { get; set; } - - /// - /// Gets or sets peak working set. - /// - [JsonProperty(PropertyName = "properties.peak_working_set")] + /// Peak working set. public long? PeakWorkingSet { get; set; } - - /// - /// Gets or sets private memory size. - /// - [JsonProperty(PropertyName = "properties.private_memory")] + /// Private memory size. public long? PrivateMemory { get; set; } - - /// - /// Gets or sets virtual memory size. - /// - [JsonProperty(PropertyName = "properties.virtual_memory")] + /// Virtual memory size. public long? VirtualMemory { get; set; } - - /// - /// Gets or sets peak virtual memory usage. - /// - [JsonProperty(PropertyName = "properties.peak_virtual_memory")] + /// Peak virtual memory usage. public long? PeakVirtualMemory { get; set; } - - /// - /// Gets or sets paged system memory. - /// - [JsonProperty(PropertyName = "properties.paged_system_memory")] + /// Paged system memory. public long? PagedSystemMemory { get; set; } - - /// - /// Gets or sets non-paged system memory. - /// - [JsonProperty(PropertyName = "properties.non_paged_system_memory")] + /// Non-paged system memory. public long? NonPagedSystemMemory { get; set; } - - /// - /// Gets or sets paged memory. - /// - [JsonProperty(PropertyName = "properties.paged_memory")] + /// Paged memory. public long? PagedMemory { get; set; } - - /// - /// Gets or sets peak paged memory. - /// - [JsonProperty(PropertyName = "properties.peak_paged_memory")] + /// Peak paged memory. public long? PeakPagedMemory { get; set; } - - /// - /// Gets or sets time stamp. - /// - [JsonProperty(PropertyName = "properties.time_stamp")] - public System.DateTime? TimeStamp { get; set; } - - /// - /// Gets or sets list of environment variables. - /// - [JsonProperty(PropertyName = "properties.environment_variables")] - public IDictionary EnvironmentVariables { get; set; } - - /// - /// Gets or sets is this the SCM site? - /// - [JsonProperty(PropertyName = "properties.is_scm_site")] + /// Time stamp. + public DateTimeOffset? TimeStamp { get; set; } + /// List of environment variables. + public IDictionary EnvironmentVariables { get; } + /// Is this the SCM site?. public bool? IsScmSite { get; set; } - - /// - /// Gets or sets is this a Web Job? - /// - [JsonProperty(PropertyName = "properties.is_webjob")] + /// Is this a Web Job?. public bool? IsWebjob { get; set; } - - /// - /// Gets or sets description of process. - /// - [JsonProperty(PropertyName = "properties.description")] + /// Description of process. public string Description { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.Serialization.cs new file mode 100644 index 000000000000..0f43cc2464d4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class ProcessInfoCollection + { + internal static ProcessInfoCollection DeserializeProcessInfoCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProcessInfo.DeserializeProcessInfo(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ProcessInfoCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.cs new file mode 100644 index 000000000000..712ff0ff45e0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Kudu process information elements. + internal partial class ProcessInfoCollection + { + /// Initializes a new instance of ProcessInfoCollection. + /// Collection of resources. + /// is null. + internal ProcessInfoCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of ProcessInfoCollection. + /// Collection of resources. + /// Link to next page of resources. + internal ProcessInfoCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.Serialization.cs new file mode 100644 index 000000000000..f83ebdf1fb19 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.Serialization.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ProcessModuleInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(BaseAddress)) + { + writer.WritePropertyName("base_address"); + writer.WriteStringValue(BaseAddress); + } + if (Optional.IsDefined(FileName)) + { + writer.WritePropertyName("file_name"); + writer.WriteStringValue(FileName); + } + if (Optional.IsDefined(Href)) + { + writer.WritePropertyName("href"); + writer.WriteStringValue(Href); + } + if (Optional.IsDefined(FilePath)) + { + writer.WritePropertyName("file_path"); + writer.WriteStringValue(FilePath); + } + if (Optional.IsDefined(ModuleMemorySize)) + { + writer.WritePropertyName("module_memory_size"); + writer.WriteNumberValue(ModuleMemorySize.Value); + } + if (Optional.IsDefined(FileVersion)) + { + writer.WritePropertyName("file_version"); + writer.WriteStringValue(FileVersion); + } + if (Optional.IsDefined(FileDescription)) + { + writer.WritePropertyName("file_description"); + writer.WriteStringValue(FileDescription); + } + if (Optional.IsDefined(Product)) + { + writer.WritePropertyName("product"); + writer.WriteStringValue(Product); + } + if (Optional.IsDefined(ProductVersion)) + { + writer.WritePropertyName("product_version"); + writer.WriteStringValue(ProductVersion); + } + if (Optional.IsDefined(IsDebug)) + { + writer.WritePropertyName("is_debug"); + writer.WriteBooleanValue(IsDebug.Value); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"); + writer.WriteStringValue(Language); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ProcessModuleInfo DeserializeProcessModuleInfo(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional baseAddress = default; + Optional fileName = default; + Optional href = default; + Optional filePath = default; + Optional moduleMemorySize = default; + Optional fileVersion = default; + Optional fileDescription = default; + Optional product = default; + Optional productVersion = default; + Optional isDebug = default; + Optional language = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("base_address")) + { + baseAddress = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("file_name")) + { + fileName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("href")) + { + href = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("file_path")) + { + filePath = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("module_memory_size")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + moduleMemorySize = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("file_version")) + { + fileVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("file_description")) + { + fileDescription = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("product")) + { + product = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("product_version")) + { + productVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("is_debug")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isDebug = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("language")) + { + language = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new ProcessModuleInfo(id.Value, name.Value, kind.Value, type.Value, baseAddress.Value, fileName.Value, href.Value, filePath.Value, Optional.ToNullable(moduleMemorySize), fileVersion.Value, fileDescription.Value, product.Value, productVersion.Value, Optional.ToNullable(isDebug), language.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.cs index 3f3c4a14c836..b034571f20ee 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.cs @@ -1,55 +1,37 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Process Module Information. - /// - [Rest.Serialization.JsonTransformation] + /// Process Module Information. public partial class ProcessModuleInfo : ProxyOnlyResource { - /// - /// Initializes a new instance of the ProcessModuleInfo class. - /// + /// Initializes a new instance of ProcessModuleInfo. public ProcessModuleInfo() { - CustomInit(); } - /// - /// Initializes a new instance of the ProcessModuleInfo class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Base address. Used as module identifier - /// in ARM resource URI. - /// File name. - /// HRef URI. - /// File path. - /// Module memory size. - /// File version. - /// File description. - /// Product name. - /// Product version. - /// Is debug? - /// Module language (locale). - public ProcessModuleInfo(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string baseAddress = default(string), string fileName = default(string), string href = default(string), string filePath = default(string), int? moduleMemorySize = default(int?), string fileVersion = default(string), string fileDescription = default(string), string product = default(string), string productVersion = default(string), bool? isDebug = default(bool?), string language = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of ProcessModuleInfo. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Base address. Used as module identifier in ARM resource URI. + /// File name. + /// HRef URI. + /// File path. + /// Module memory size. + /// File version. + /// File description. + /// Product name. + /// Product version. + /// Is debug?. + /// Module language (locale). + internal ProcessModuleInfo(string id, string name, string kind, string type, string baseAddress, string fileName, string href, string filePath, int? moduleMemorySize, string fileVersion, string fileDescription, string product, string productVersion, bool? isDebug, string language) : base(id, name, kind, type) { BaseAddress = baseAddress; FileName = fileName; @@ -62,80 +44,29 @@ public ProcessModuleInfo() ProductVersion = productVersion; IsDebug = isDebug; Language = language; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets base address. Used as module identifier in ARM - /// resource URI. - /// - [JsonProperty(PropertyName = "properties.base_address")] + /// Base address. Used as module identifier in ARM resource URI. public string BaseAddress { get; set; } - - /// - /// Gets or sets file name. - /// - [JsonProperty(PropertyName = "properties.file_name")] + /// File name. public string FileName { get; set; } - - /// - /// Gets or sets hRef URI. - /// - [JsonProperty(PropertyName = "properties.href")] + /// HRef URI. public string Href { get; set; } - - /// - /// Gets or sets file path. - /// - [JsonProperty(PropertyName = "properties.file_path")] + /// File path. public string FilePath { get; set; } - - /// - /// Gets or sets module memory size. - /// - [JsonProperty(PropertyName = "properties.module_memory_size")] + /// Module memory size. public int? ModuleMemorySize { get; set; } - - /// - /// Gets or sets file version. - /// - [JsonProperty(PropertyName = "properties.file_version")] + /// File version. public string FileVersion { get; set; } - - /// - /// Gets or sets file description. - /// - [JsonProperty(PropertyName = "properties.file_description")] + /// File description. public string FileDescription { get; set; } - - /// - /// Gets or sets product name. - /// - [JsonProperty(PropertyName = "properties.product")] + /// Product name. public string Product { get; set; } - - /// - /// Gets or sets product version. - /// - [JsonProperty(PropertyName = "properties.product_version")] + /// Product version. public string ProductVersion { get; set; } - - /// - /// Gets or sets is debug? - /// - [JsonProperty(PropertyName = "properties.is_debug")] + /// Is debug?. public bool? IsDebug { get; set; } - - /// - /// Gets or sets module language (locale). - /// - [JsonProperty(PropertyName = "properties.language")] + /// Module language (locale). public string Language { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.Serialization.cs new file mode 100644 index 000000000000..50f17470ed0a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class ProcessModuleInfoCollection + { + internal static ProcessModuleInfoCollection DeserializeProcessModuleInfoCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProcessModuleInfo.DeserializeProcessModuleInfo(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ProcessModuleInfoCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.cs new file mode 100644 index 000000000000..a919e7df1722 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Kudu thread information elements. + internal partial class ProcessModuleInfoCollection + { + /// Initializes a new instance of ProcessModuleInfoCollection. + /// Collection of resources. + /// is null. + internal ProcessModuleInfoCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of ProcessModuleInfoCollection. + /// Collection of resources. + /// Link to next page of resources. + internal ProcessModuleInfoCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.Serialization.cs new file mode 100644 index 000000000000..30b10fb858ef --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ProcessThreadInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Href)) + { + writer.WritePropertyName("href"); + writer.WriteStringValue(Href); + } + if (Optional.IsDefined(Process)) + { + writer.WritePropertyName("process"); + writer.WriteStringValue(Process); + } + if (Optional.IsDefined(StartAddress)) + { + writer.WritePropertyName("start_address"); + writer.WriteStringValue(StartAddress); + } + if (Optional.IsDefined(CurrentPriority)) + { + writer.WritePropertyName("current_priority"); + writer.WriteNumberValue(CurrentPriority.Value); + } + if (Optional.IsDefined(PriorityLevel)) + { + writer.WritePropertyName("priority_level"); + writer.WriteStringValue(PriorityLevel); + } + if (Optional.IsDefined(BasePriority)) + { + writer.WritePropertyName("base_priority"); + writer.WriteNumberValue(BasePriority.Value); + } + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("start_time"); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(TotalProcessorTime)) + { + writer.WritePropertyName("total_processor_time"); + writer.WriteStringValue(TotalProcessorTime); + } + if (Optional.IsDefined(UserProcessorTime)) + { + writer.WritePropertyName("user_processor_time"); + writer.WriteStringValue(UserProcessorTime); + } + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"); + writer.WriteStringValue(State); + } + if (Optional.IsDefined(WaitReason)) + { + writer.WritePropertyName("wait_reason"); + writer.WriteStringValue(WaitReason); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ProcessThreadInfo DeserializeProcessThreadInfo(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional identifier = default; + Optional href = default; + Optional process = default; + Optional startAddress = default; + Optional currentPriority = default; + Optional priorityLevel = default; + Optional basePriority = default; + Optional startTime = default; + Optional totalProcessorTime = default; + Optional userProcessorTime = default; + Optional state = default; + Optional waitReason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("identifier")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + identifier = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("href")) + { + href = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("process")) + { + process = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("start_address")) + { + startAddress = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("current_priority")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + currentPriority = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("priority_level")) + { + priorityLevel = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("base_priority")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + basePriority = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("start_time")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("total_processor_time")) + { + totalProcessorTime = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("user_processor_time")) + { + userProcessorTime = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("state")) + { + state = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("wait_reason")) + { + waitReason = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new ProcessThreadInfo(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(identifier), href.Value, process.Value, startAddress.Value, Optional.ToNullable(currentPriority), priorityLevel.Value, Optional.ToNullable(basePriority), Optional.ToNullable(startTime), totalProcessorTime.Value, userProcessorTime.Value, state.Value, waitReason.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.cs index 7e37d356eccf..4869eb711739 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.cs @@ -1,55 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Process Thread Information. - /// - [Rest.Serialization.JsonTransformation] + /// Process Thread Information. public partial class ProcessThreadInfo : ProxyOnlyResource { - /// - /// Initializes a new instance of the ProcessThreadInfo class. - /// + /// Initializes a new instance of ProcessThreadInfo. public ProcessThreadInfo() { - CustomInit(); } - /// - /// Initializes a new instance of the ProcessThreadInfo class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Site extension ID. - /// HRef URI. - /// Process URI. - /// Start address. - /// Current thread priority. - /// Thread priority level. - /// Base priority. - /// Start time. - /// Total processor time. - /// User processor time. - /// Thread state. - /// Wait reason. - public ProcessThreadInfo(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? identifier = default(int?), string href = default(string), string process = default(string), string startAddress = default(string), int? currentPriority = default(int?), string priorityLevel = default(string), int? basePriority = default(int?), System.DateTime? startTime = default(System.DateTime?), string totalProcessorTime = default(string), string userProcessorTime = default(string), string state = default(string), string waitReason = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of ProcessThreadInfo. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Site extension ID. + /// HRef URI. + /// Process URI. + /// Start address. + /// Current thread priority. + /// Thread priority level. + /// Base priority. + /// Start time. + /// Total processor time. + /// User processor time. + /// Thread state. + /// Wait reason. + internal ProcessThreadInfo(string id, string name, string kind, string type, int? identifier, string href, string process, string startAddress, int? currentPriority, string priorityLevel, int? basePriority, DateTimeOffset? startTime, string totalProcessorTime, string userProcessorTime, string state, string waitReason) : base(id, name, kind, type) { Identifier = identifier; Href = href; @@ -63,85 +48,31 @@ public ProcessThreadInfo() UserProcessorTime = userProcessorTime; State = state; WaitReason = waitReason; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets site extension ID. - /// - [JsonProperty(PropertyName = "properties.identifier")] - public int? Identifier { get; private set; } - - /// - /// Gets or sets hRef URI. - /// - [JsonProperty(PropertyName = "properties.href")] + /// Site extension ID. + public int? Identifier { get; } + /// HRef URI. public string Href { get; set; } - - /// - /// Gets or sets process URI. - /// - [JsonProperty(PropertyName = "properties.process")] + /// Process URI. public string Process { get; set; } - - /// - /// Gets or sets start address. - /// - [JsonProperty(PropertyName = "properties.start_address")] + /// Start address. public string StartAddress { get; set; } - - /// - /// Gets or sets current thread priority. - /// - [JsonProperty(PropertyName = "properties.current_priority")] + /// Current thread priority. public int? CurrentPriority { get; set; } - - /// - /// Gets or sets thread priority level. - /// - [JsonProperty(PropertyName = "properties.priority_level")] + /// Thread priority level. public string PriorityLevel { get; set; } - - /// - /// Gets or sets base priority. - /// - [JsonProperty(PropertyName = "properties.base_priority")] + /// Base priority. public int? BasePriority { get; set; } - - /// - /// Gets or sets start time. - /// - [JsonProperty(PropertyName = "properties.start_time")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets total processor time. - /// - [JsonProperty(PropertyName = "properties.total_processor_time")] + /// Start time. + public DateTimeOffset? StartTime { get; set; } + /// Total processor time. public string TotalProcessorTime { get; set; } - - /// - /// Gets or sets user processor time. - /// - [JsonProperty(PropertyName = "properties.user_processor_time")] + /// User processor time. public string UserProcessorTime { get; set; } - - /// - /// Gets or sets thread state. - /// - [JsonProperty(PropertyName = "properties.state")] + /// Thread state. public string State { get; set; } - - /// - /// Gets or sets wait reason. - /// - [JsonProperty(PropertyName = "properties.wait_reason")] + /// Wait reason. public string WaitReason { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.Serialization.cs new file mode 100644 index 000000000000..87a12ac57a96 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class ProcessThreadInfoCollection + { + internal static ProcessThreadInfoCollection DeserializeProcessThreadInfoCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProcessThreadInfo.DeserializeProcessThreadInfo(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ProcessThreadInfoCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.cs new file mode 100644 index 000000000000..97071bef2f43 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Kudu thread information elements. + internal partial class ProcessThreadInfoCollection + { + /// Initializes a new instance of ProcessThreadInfoCollection. + /// Collection of resources. + /// is null. + internal ProcessThreadInfoCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of ProcessThreadInfoCollection. + /// Collection of resources. + /// Link to next page of resources. + internal ProcessThreadInfoCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.Serialization.cs new file mode 100644 index 000000000000..d54e90a2c03f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class ProvisioningStateExtensions + { + public static string ToSerialString(this ProvisioningState value) => value switch + { + ProvisioningState.Succeeded => "Succeeded", + ProvisioningState.Failed => "Failed", + ProvisioningState.Canceled => "Canceled", + ProvisioningState.InProgress => "InProgress", + ProvisioningState.Deleting => "Deleting", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ProvisioningState value.") + }; + + public static ProvisioningState ToProvisioningState(this string value) + { + if (string.Equals(value, "Succeeded", StringComparison.InvariantCultureIgnoreCase)) return ProvisioningState.Succeeded; + if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return ProvisioningState.Failed; + if (string.Equals(value, "Canceled", StringComparison.InvariantCultureIgnoreCase)) return ProvisioningState.Canceled; + if (string.Equals(value, "InProgress", StringComparison.InvariantCultureIgnoreCase)) return ProvisioningState.InProgress; + if (string.Equals(value, "Deleting", StringComparison.InvariantCultureIgnoreCase)) return ProvisioningState.Deleting; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ProvisioningState value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.cs index 7a208e971733..bacf943c99a0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.cs @@ -1,78 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ProvisioningState. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Status of certificate order. public enum ProvisioningState { - [EnumMember(Value = "Succeeded")] + /// Succeeded. Succeeded, - [EnumMember(Value = "Failed")] + /// Failed. Failed, - [EnumMember(Value = "Canceled")] + /// Canceled. Canceled, - [EnumMember(Value = "InProgress")] + /// InProgress. InProgress, - [EnumMember(Value = "Deleting")] + /// Deleting. Deleting } - internal static class ProvisioningStateEnumExtension - { - internal static string ToSerializedValue(this ProvisioningState? value) - { - return value == null ? null : ((ProvisioningState)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ProvisioningState value) - { - switch( value ) - { - case ProvisioningState.Succeeded: - return "Succeeded"; - case ProvisioningState.Failed: - return "Failed"; - case ProvisioningState.Canceled: - return "Canceled"; - case ProvisioningState.InProgress: - return "InProgress"; - case ProvisioningState.Deleting: - return "Deleting"; - } - return null; - } - - internal static ProvisioningState? ParseProvisioningState(this string value) - { - switch( value ) - { - case "Succeeded": - return ProvisioningState.Succeeded; - case "Failed": - return ProvisioningState.Failed; - case "Canceled": - return ProvisioningState.Canceled; - case "InProgress": - return ProvisioningState.InProgress; - case "Deleting": - return ProvisioningState.Deleting; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.Serialization.cs new file mode 100644 index 000000000000..3148eea73ff3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.Serialization.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ProxyOnlyResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WriteEndObject(); + } + + internal static ProxyOnlyResource DeserializeProxyOnlyResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + } + return new ProxyOnlyResource(id.Value, name.Value, kind.Value, type.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.cs index 1f933160fd10..0c81fcbeb9b6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.cs @@ -1,78 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Azure proxy only resource. This resource is not tracked by Azure - /// Resource Manager. - /// - public partial class ProxyOnlyResource : IResource + /// Azure proxy only resource. This resource is not tracked by Azure Resource Manager. + public partial class ProxyOnlyResource { - /// - /// Initializes a new instance of the ProxyOnlyResource class. - /// + /// Initializes a new instance of ProxyOnlyResource. public ProxyOnlyResource() { - CustomInit(); } - /// - /// Initializes a new instance of the ProxyOnlyResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public ProxyOnlyResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string)) + /// Initializes a new instance of ProxyOnlyResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + internal ProxyOnlyResource(string id, string name, string kind, string type) { Id = id; Name = name; Kind = kind; Type = type; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets resource Id. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource Name. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets or sets kind of resource. - /// - [JsonProperty(PropertyName = "kind")] + /// Resource Id. + public string Id { get; } + /// Resource Name. + public string Name { get; } + /// Kind of resource. public string Kind { get; set; } - - /// - /// Gets resource type. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + /// Resource type. + public string Type { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.Serialization.cs new file mode 100644 index 000000000000..23123a63406c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.Serialization.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PublicCertificate : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Blob)) + { + writer.WritePropertyName("blob"); + writer.WriteBase64StringValue(Blob, "D"); + } + if (Optional.IsDefined(PublicCertificateLocation)) + { + writer.WritePropertyName("publicCertificateLocation"); + writer.WriteStringValue(PublicCertificateLocation.Value.ToSerialString()); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static PublicCertificate DeserializePublicCertificate(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional blob = default; + Optional publicCertificateLocation = default; + Optional thumbprint = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("blob")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + blob = property0.Value.GetBytesFromBase64("D"); + continue; + } + if (property0.NameEquals("publicCertificateLocation")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + publicCertificateLocation = property0.Value.GetString().ToPublicCertificateLocation(); + continue; + } + if (property0.NameEquals("thumbprint")) + { + thumbprint = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new PublicCertificate(id.Value, name.Value, kind.Value, type.Value, blob.Value, Optional.ToNullable(publicCertificateLocation), thumbprint.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.cs index fd1011837ada..137aa90bf890 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.cs @@ -1,78 +1,42 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Public certificate object - /// - [Rest.Serialization.JsonTransformation] + /// Public certificate object. public partial class PublicCertificate : ProxyOnlyResource { - /// - /// Initializes a new instance of the PublicCertificate class. - /// + /// Initializes a new instance of PublicCertificate. public PublicCertificate() { - CustomInit(); } - /// - /// Initializes a new instance of the PublicCertificate class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Public Certificate byte array - /// Public Certificate - /// Location. Possible values include: 'CurrentUserMy', - /// 'LocalMachineMy', 'Unknown' - /// Certificate Thumbprint - public PublicCertificate(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), byte[] blob = default(byte[]), PublicCertificateLocation? publicCertificateLocation = default(PublicCertificateLocation?), string thumbprint = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of PublicCertificate. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Public Certificate byte array. + /// Public Certificate Location. + /// Certificate Thumbprint. + internal PublicCertificate(string id, string name, string kind, string type, byte[] blob, PublicCertificateLocation? publicCertificateLocation, string thumbprint) : base(id, name, kind, type) { Blob = blob; PublicCertificateLocation = publicCertificateLocation; Thumbprint = thumbprint; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets public Certificate byte array - /// - [JsonProperty(PropertyName = "properties.blob")] + /// Public Certificate byte array. public byte[] Blob { get; set; } - - /// - /// Gets or sets public Certificate Location. Possible values include: - /// 'CurrentUserMy', 'LocalMachineMy', 'Unknown' - /// - [JsonProperty(PropertyName = "properties.publicCertificateLocation")] + /// Public Certificate Location. public PublicCertificateLocation? PublicCertificateLocation { get; set; } - - /// - /// Gets certificate Thumbprint - /// - [JsonProperty(PropertyName = "properties.thumbprint")] - public string Thumbprint { get; private set; } - + /// Certificate Thumbprint. + public string Thumbprint { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.Serialization.cs new file mode 100644 index 000000000000..637747f948d9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class PublicCertificateCollection + { + internal static PublicCertificateCollection DeserializePublicCertificateCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PublicCertificate.DeserializePublicCertificate(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new PublicCertificateCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.cs new file mode 100644 index 000000000000..c2ae93ffc5cd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of public certificates. + internal partial class PublicCertificateCollection + { + /// Initializes a new instance of PublicCertificateCollection. + /// Collection of resources. + /// is null. + internal PublicCertificateCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of PublicCertificateCollection. + /// Collection of resources. + /// Link to next page of resources. + internal PublicCertificateCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.Serialization.cs new file mode 100644 index 000000000000..880fd2c11c70 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class PublicCertificateLocationExtensions + { + public static string ToSerialString(this PublicCertificateLocation value) => value switch + { + PublicCertificateLocation.CurrentUserMy => "CurrentUserMy", + PublicCertificateLocation.LocalMachineMy => "LocalMachineMy", + PublicCertificateLocation.Unknown => "Unknown", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PublicCertificateLocation value.") + }; + + public static PublicCertificateLocation ToPublicCertificateLocation(this string value) + { + if (string.Equals(value, "CurrentUserMy", StringComparison.InvariantCultureIgnoreCase)) return PublicCertificateLocation.CurrentUserMy; + if (string.Equals(value, "LocalMachineMy", StringComparison.InvariantCultureIgnoreCase)) return PublicCertificateLocation.LocalMachineMy; + if (string.Equals(value, "Unknown", StringComparison.InvariantCultureIgnoreCase)) return PublicCertificateLocation.Unknown; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PublicCertificateLocation value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.cs index c254bed35845..43cf834470d9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for PublicCertificateLocation. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Public Certificate Location. public enum PublicCertificateLocation { - [EnumMember(Value = "CurrentUserMy")] + /// CurrentUserMy. CurrentUserMy, - [EnumMember(Value = "LocalMachineMy")] + /// LocalMachineMy. LocalMachineMy, - [EnumMember(Value = "Unknown")] + /// Unknown. Unknown } - internal static class PublicCertificateLocationEnumExtension - { - internal static string ToSerializedValue(this PublicCertificateLocation? value) - { - return value == null ? null : ((PublicCertificateLocation)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this PublicCertificateLocation value) - { - switch( value ) - { - case PublicCertificateLocation.CurrentUserMy: - return "CurrentUserMy"; - case PublicCertificateLocation.LocalMachineMy: - return "LocalMachineMy"; - case PublicCertificateLocation.Unknown: - return "Unknown"; - } - return null; - } - - internal static PublicCertificateLocation? ParsePublicCertificateLocation(this string value) - { - switch( value ) - { - case "CurrentUserMy": - return PublicCertificateLocation.CurrentUserMy; - case "LocalMachineMy": - return PublicCertificateLocation.LocalMachineMy; - case "Unknown": - return PublicCertificateLocation.Unknown; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublishingProfileFormat.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublishingProfileFormat.cs index 7d99293b079e..0d4ab5004eac 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublishingProfileFormat.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublishingProfileFormat.cs @@ -1,23 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - /// - /// Defines values for PublishingProfileFormat. + /// Name of the format. Valid values are: + /// FileZilla3 + /// WebDeploy -- default + /// Ftp. /// - public static class PublishingProfileFormat + public readonly partial struct PublishingProfileFormat : IEquatable { - public const string FileZilla3 = "FileZilla3"; - public const string WebDeploy = "WebDeploy"; - public const string Ftp = "Ftp"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public PublishingProfileFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FileZilla3Value = "FileZilla3"; + private const string WebDeployValue = "WebDeploy"; + private const string FtpValue = "Ftp"; + + /// FileZilla3. + public static PublishingProfileFormat FileZilla3 { get; } = new PublishingProfileFormat(FileZilla3Value); + /// WebDeploy. + public static PublishingProfileFormat WebDeploy { get; } = new PublishingProfileFormat(WebDeployValue); + /// Ftp. + public static PublishingProfileFormat Ftp { get; } = new PublishingProfileFormat(FtpValue); + /// Determines if two values are the same. + public static bool operator ==(PublishingProfileFormat left, PublishingProfileFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PublishingProfileFormat left, PublishingProfileFormat right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PublishingProfileFormat(string value) => new PublishingProfileFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PublishingProfileFormat other && Equals(other); + /// + public bool Equals(PublishingProfileFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.Serialization.cs new file mode 100644 index 000000000000..11d865bb8ba3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.Serialization.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class PushSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(IsPushEnabled)) + { + writer.WritePropertyName("isPushEnabled"); + writer.WriteBooleanValue(IsPushEnabled.Value); + } + if (Optional.IsDefined(TagWhitelistJson)) + { + writer.WritePropertyName("tagWhitelistJson"); + writer.WriteStringValue(TagWhitelistJson); + } + if (Optional.IsDefined(TagsRequiringAuth)) + { + writer.WritePropertyName("tagsRequiringAuth"); + writer.WriteStringValue(TagsRequiringAuth); + } + if (Optional.IsDefined(DynamicTagsJson)) + { + writer.WritePropertyName("dynamicTagsJson"); + writer.WriteStringValue(DynamicTagsJson); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static PushSettings DeserializePushSettings(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional isPushEnabled = default; + Optional tagWhitelistJson = default; + Optional tagsRequiringAuth = default; + Optional dynamicTagsJson = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("isPushEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isPushEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("tagWhitelistJson")) + { + tagWhitelistJson = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("tagsRequiringAuth")) + { + tagsRequiringAuth = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("dynamicTagsJson")) + { + dynamicTagsJson = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new PushSettings(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(isPushEnabled), tagWhitelistJson.Value, tagsRequiringAuth.Value, dynamicTagsJson.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.cs index 890d9b51bd1e..ff5f662320db 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.cs @@ -1,111 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Push settings for the App. - /// - [Rest.Serialization.JsonTransformation] + /// Push settings for the App. public partial class PushSettings : ProxyOnlyResource { - /// - /// Initializes a new instance of the PushSettings class. - /// + /// Initializes a new instance of PushSettings. public PushSettings() { - CustomInit(); } - /// - /// Initializes a new instance of the PushSettings class. - /// - /// Gets or sets a flag indicating whether - /// the Push endpoint is enabled. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Gets or sets a JSON string - /// containing a list of tags that are whitelisted for use by the push - /// registration endpoint. - /// Gets or sets a JSON string - /// containing a list of tags that require user authentication to be - /// used in the push registration endpoint. + /// Initializes a new instance of PushSettings. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Gets or sets a flag indicating whether the Push endpoint is enabled. + /// Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint. + /// + /// Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint. /// Tags can consist of alphanumeric characters and the following: - /// '_', '@', '#', '.', ':', '-'. - /// Validation should be performed at the PushRequestHandler. - /// Gets or sets a JSON string containing - /// a list of dynamic tags that will be evaluated from user claims in - /// the push registration endpoint. - public PushSettings(bool isPushEnabled, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string tagWhitelistJson = default(string), string tagsRequiringAuth = default(string), string dynamicTagsJson = default(string)) - : base(id, name, kind, type) + /// '_', '@', '#', '.', ':', '-'. + /// Validation should be performed at the PushRequestHandler. + /// + /// Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint. + internal PushSettings(string id, string name, string kind, string type, bool? isPushEnabled, string tagWhitelistJson, string tagsRequiringAuth, string dynamicTagsJson) : base(id, name, kind, type) { IsPushEnabled = isPushEnabled; TagWhitelistJson = tagWhitelistJson; TagsRequiringAuth = tagsRequiringAuth; DynamicTagsJson = dynamicTagsJson; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a flag indicating whether the Push endpoint is - /// enabled. - /// - [JsonProperty(PropertyName = "properties.isPushEnabled")] - public bool IsPushEnabled { get; set; } - - /// - /// Gets or sets a JSON string containing a list of tags that are - /// whitelisted for use by the push registration endpoint. - /// - [JsonProperty(PropertyName = "properties.tagWhitelistJson")] + /// Gets or sets a flag indicating whether the Push endpoint is enabled. + public bool? IsPushEnabled { get; set; } + /// Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint. public string TagWhitelistJson { get; set; } - /// - /// Gets or sets a JSON string containing a list of tags that require - /// user authentication to be used in the push registration endpoint. + /// Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint. /// Tags can consist of alphanumeric characters and the following: - /// '_', '@', '#', '.', ':', '-'. + /// '_', '@', '#', '.', ':', '-'. /// Validation should be performed at the PushRequestHandler. /// - [JsonProperty(PropertyName = "properties.tagsRequiringAuth")] public string TagsRequiringAuth { get; set; } - - /// - /// Gets or sets a JSON string containing a list of dynamic tags that - /// will be evaluated from user claims in the push registration - /// endpoint. - /// - [JsonProperty(PropertyName = "properties.dynamicTagsJson")] + /// Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint. public string DynamicTagsJson { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - //Nothing to validate - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.Serialization.cs new file mode 100644 index 000000000000..530cd381e740 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class QueryUtterancesResult : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(SampleUtterance)) + { + writer.WritePropertyName("sampleUtterance"); + writer.WriteObjectValue(SampleUtterance); + } + if (Optional.IsDefined(Score)) + { + writer.WritePropertyName("score"); + writer.WriteNumberValue(Score.Value); + } + writer.WriteEndObject(); + } + + internal static QueryUtterancesResult DeserializeQueryUtterancesResult(JsonElement element) + { + Optional sampleUtterance = default; + Optional score = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sampleUtterance")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + sampleUtterance = SampleUtterance.DeserializeSampleUtterance(property.Value); + continue; + } + if (property.NameEquals("score")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + score = property.Value.GetSingle(); + continue; + } + } + return new QueryUtterancesResult(sampleUtterance.Value, Optional.ToNullable(score)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs new file mode 100644 index 000000000000..eb75d14b6e94 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Result for utterances query. + public partial class QueryUtterancesResult + { + /// Initializes a new instance of QueryUtterancesResult. + public QueryUtterancesResult() + { + } + + /// Initializes a new instance of QueryUtterancesResult. + /// A sample utterance. + /// Score of a sample utterance. + internal QueryUtterancesResult(SampleUtterance sampleUtterance, float? score) + { + SampleUtterance = sampleUtterance; + Score = score; + } + + /// A sample utterance. + public SampleUtterance SampleUtterance { get; set; } + /// Score of a sample utterance. + public float? Score { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.Serialization.cs new file mode 100644 index 000000000000..5f6e3eed8770 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.Serialization.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class QueryUtterancesResults : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Query)) + { + writer.WritePropertyName("query"); + writer.WriteStringValue(Query); + } + if (Optional.IsCollectionDefined(Results)) + { + writer.WritePropertyName("results"); + writer.WriteStartArray(); + foreach (var item in Results) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static QueryUtterancesResults DeserializeQueryUtterancesResults(JsonElement element) + { + Optional query = default; + Optional> results = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("query")) + { + query = property.Value.GetString(); + continue; + } + if (property.NameEquals("results")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(QueryUtterancesResult.DeserializeQueryUtterancesResult(item)); + } + results = array; + continue; + } + } + return new QueryUtterancesResults(query.Value, Optional.ToList(results)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs new file mode 100644 index 000000000000..7368df322845 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Suggested utterances where the detector can be applicable. + public partial class QueryUtterancesResults + { + /// Initializes a new instance of QueryUtterancesResults. + public QueryUtterancesResults() + { + Results = new ChangeTrackingList(); + } + + /// Initializes a new instance of QueryUtterancesResults. + /// Search Query. + /// Array of utterance results for search query. + internal QueryUtterancesResults(string query, IList results) + { + Query = query; + Results = results; + } + + /// Search Query. + public string Query { get; set; } + /// Array of utterance results for search query. + public IList Results { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.Serialization.cs new file mode 100644 index 000000000000..e12c447681f3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class RampUpRule : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ActionHostName)) + { + writer.WritePropertyName("actionHostName"); + writer.WriteStringValue(ActionHostName); + } + if (Optional.IsDefined(ReroutePercentage)) + { + writer.WritePropertyName("reroutePercentage"); + writer.WriteNumberValue(ReroutePercentage.Value); + } + if (Optional.IsDefined(ChangeStep)) + { + writer.WritePropertyName("changeStep"); + writer.WriteNumberValue(ChangeStep.Value); + } + if (Optional.IsDefined(ChangeIntervalInMinutes)) + { + writer.WritePropertyName("changeIntervalInMinutes"); + writer.WriteNumberValue(ChangeIntervalInMinutes.Value); + } + if (Optional.IsDefined(MinReroutePercentage)) + { + writer.WritePropertyName("minReroutePercentage"); + writer.WriteNumberValue(MinReroutePercentage.Value); + } + if (Optional.IsDefined(MaxReroutePercentage)) + { + writer.WritePropertyName("maxReroutePercentage"); + writer.WriteNumberValue(MaxReroutePercentage.Value); + } + if (Optional.IsDefined(ChangeDecisionCallbackUrl)) + { + writer.WritePropertyName("changeDecisionCallbackUrl"); + writer.WriteStringValue(ChangeDecisionCallbackUrl); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + writer.WriteEndObject(); + } + + internal static RampUpRule DeserializeRampUpRule(JsonElement element) + { + Optional actionHostName = default; + Optional reroutePercentage = default; + Optional changeStep = default; + Optional changeIntervalInMinutes = default; + Optional minReroutePercentage = default; + Optional maxReroutePercentage = default; + Optional changeDecisionCallbackUrl = default; + Optional name = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("actionHostName")) + { + actionHostName = property.Value.GetString(); + continue; + } + if (property.NameEquals("reroutePercentage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + reroutePercentage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("changeStep")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + changeStep = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("changeIntervalInMinutes")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + changeIntervalInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minReroutePercentage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + minReroutePercentage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("maxReroutePercentage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + maxReroutePercentage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("changeDecisionCallbackUrl")) + { + changeDecisionCallbackUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + } + return new RampUpRule(actionHostName.Value, Optional.ToNullable(reroutePercentage), Optional.ToNullable(changeStep), Optional.ToNullable(changeIntervalInMinutes), Optional.ToNullable(minReroutePercentage), Optional.ToNullable(maxReroutePercentage), changeDecisionCallbackUrl.Value, name.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.cs index 4647553a245d..f71b3aee7a29 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.cs @@ -1,67 +1,37 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Routing rules for ramp up testing. This rule allows to redirect static - /// traffic % to a slot or to gradually change routing % based on - /// performance. - /// + /// Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance. public partial class RampUpRule { - /// - /// Initializes a new instance of the RampUpRule class. - /// + /// Initializes a new instance of RampUpRule. public RampUpRule() { - CustomInit(); } - /// - /// Initializes a new instance of the RampUpRule class. - /// - /// Hostname of a slot to which the - /// traffic will be redirected if decided to. E.g. - /// myapp-stage.azurewebsites.net. - /// Percentage of the traffic which - /// will be redirected to - /// <code>ActionHostName</code>. - /// In auto ramp up scenario this is the step - /// to add/remove from <code>ReroutePercentage</code> until - /// it reaches \n<code>MinReroutePercentage</code> or - /// <code>MaxReroutePercentage</code>. Site metrics are - /// checked every N minutes specified in - /// <code>ChangeIntervalInMinutes</code>.\nCustom decision - /// algorithm - /// can be provided in TiPCallback site extension which URL can be - /// specified in - /// <code>ChangeDecisionCallbackUrl</code>. - /// Specifies interval in minutes - /// to reevaluate ReroutePercentage. - /// Specifies lower boundary above - /// which ReroutePercentage will stay. - /// Specifies upper boundary below - /// which ReroutePercentage will stay. - /// Custom decision algorithm - /// can be provided in TiPCallback site extension which URL can be - /// specified. See TiPCallback site extension for the scaffold and - /// contracts. - /// https://www.siteextensions.net/packages/TiPCallback/ - /// Name of the routing rule. The recommended name - /// would be to point to the slot which will receive the traffic in the - /// experiment. - public RampUpRule(string actionHostName = default(string), double? reroutePercentage = default(double?), double? changeStep = default(double?), int? changeIntervalInMinutes = default(int?), double? minReroutePercentage = default(double?), double? maxReroutePercentage = default(double?), string changeDecisionCallbackUrl = default(string), string name = default(string)) + /// Initializes a new instance of RampUpRule. + /// Hostname of a slot to which the traffic will be redirected if decided to. E.g. myapp-stage.azurewebsites.net. + /// Percentage of the traffic which will be redirected to <code>ActionHostName</code>. + /// + /// In auto ramp up scenario this is the step to add/remove from <code>ReroutePercentage</code> until it reaches \n<code>MinReroutePercentage</code> or + /// <code>MaxReroutePercentage</code>. Site metrics are checked every N minutes specified in <code>ChangeIntervalInMinutes</code>.\nCustom decision algorithm + /// can be provided in TiPCallback site extension which URL can be specified in <code>ChangeDecisionCallbackUrl</code>. + /// + /// Specifies interval in minutes to reevaluate ReroutePercentage. + /// Specifies lower boundary above which ReroutePercentage will stay. + /// Specifies upper boundary below which ReroutePercentage will stay. + /// + /// Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified. See TiPCallback site extension for the scaffold and contracts. + /// https://www.siteextensions.net/packages/TiPCallback/. + /// + /// Name of the routing rule. The recommended name would be to point to the slot which will receive the traffic in the experiment. + internal RampUpRule(string actionHostName, double? reroutePercentage, double? changeStep, int? changeIntervalInMinutes, double? minReroutePercentage, double? maxReroutePercentage, string changeDecisionCallbackUrl, string name) { ActionHostName = actionHostName; ReroutePercentage = reroutePercentage; @@ -71,82 +41,30 @@ public RampUpRule() MaxReroutePercentage = maxReroutePercentage; ChangeDecisionCallbackUrl = changeDecisionCallbackUrl; Name = name; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets hostname of a slot to which the traffic will be - /// redirected if decided to. E.g. myapp-stage.azurewebsites.net. - /// - [JsonProperty(PropertyName = "actionHostName")] + /// Hostname of a slot to which the traffic will be redirected if decided to. E.g. myapp-stage.azurewebsites.net. public string ActionHostName { get; set; } - - /// - /// Gets or sets percentage of the traffic which will be redirected to - /// &lt;code&gt;ActionHostName&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "reroutePercentage")] + /// Percentage of the traffic which will be redirected to <code>ActionHostName</code>. public double? ReroutePercentage { get; set; } - /// - /// Gets or sets in auto ramp up scenario this is the step to - /// add/remove from - /// &lt;code&gt;ReroutePercentage&lt;/code&gt; until it - /// reaches - /// \n&lt;code&gt;MinReroutePercentage&lt;/code&gt; or - /// &lt;code&gt;MaxReroutePercentage&lt;/code&gt;. Site - /// metrics are checked every N minutes specified in - /// &lt;code&gt;ChangeIntervalInMinutes&lt;/code&gt;.\nCustom - /// decision algorithm - /// can be provided in TiPCallback site extension which URL can be - /// specified in - /// &lt;code&gt;ChangeDecisionCallbackUrl&lt;/code&gt;. + /// In auto ramp up scenario this is the step to add/remove from <code>ReroutePercentage</code> until it reaches \n<code>MinReroutePercentage</code> or + /// <code>MaxReroutePercentage</code>. Site metrics are checked every N minutes specified in <code>ChangeIntervalInMinutes</code>.\nCustom decision algorithm + /// can be provided in TiPCallback site extension which URL can be specified in <code>ChangeDecisionCallbackUrl</code>. /// - [JsonProperty(PropertyName = "changeStep")] public double? ChangeStep { get; set; } - - /// - /// Gets or sets specifies interval in minutes to reevaluate - /// ReroutePercentage. - /// - [JsonProperty(PropertyName = "changeIntervalInMinutes")] + /// Specifies interval in minutes to reevaluate ReroutePercentage. public int? ChangeIntervalInMinutes { get; set; } - - /// - /// Gets or sets specifies lower boundary above which ReroutePercentage - /// will stay. - /// - [JsonProperty(PropertyName = "minReroutePercentage")] + /// Specifies lower boundary above which ReroutePercentage will stay. public double? MinReroutePercentage { get; set; } - - /// - /// Gets or sets specifies upper boundary below which ReroutePercentage - /// will stay. - /// - [JsonProperty(PropertyName = "maxReroutePercentage")] + /// Specifies upper boundary below which ReroutePercentage will stay. public double? MaxReroutePercentage { get; set; } - /// - /// Gets or sets custom decision algorithm can be provided in - /// TiPCallback site extension which URL can be specified. See - /// TiPCallback site extension for the scaffold and contracts. - /// https://www.siteextensions.net/packages/TiPCallback/ + /// Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified. See TiPCallback site extension for the scaffold and contracts. + /// https://www.siteextensions.net/packages/TiPCallback/. /// - [JsonProperty(PropertyName = "changeDecisionCallbackUrl")] public string ChangeDecisionCallbackUrl { get; set; } - - /// - /// Gets or sets name of the routing rule. The recommended name would - /// be to point to the slot which will receive the traffic in the - /// experiment. - /// - [JsonProperty(PropertyName = "name")] + /// Name of the routing rule. The recommended name would be to point to the slot which will receive the traffic in the experiment. public string Name { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.Serialization.cs new file mode 100644 index 000000000000..148b4d39f456 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.Serialization.cs @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Recommendation : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(CreationTime)) + { + writer.WritePropertyName("creationTime"); + writer.WriteStringValue(CreationTime.Value, "O"); + } + if (Optional.IsDefined(RecommendationId)) + { + writer.WritePropertyName("recommendationId"); + writer.WriteStringValue(RecommendationId.Value); + } + if (Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"); + writer.WriteStringValue(ResourceId); + } + if (Optional.IsDefined(ResourceScope)) + { + writer.WritePropertyName("resourceScope"); + writer.WriteStringValue(ResourceScope.Value.ToString()); + } + if (Optional.IsDefined(RuleName)) + { + writer.WritePropertyName("ruleName"); + writer.WriteStringValue(RuleName); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"); + writer.WriteStringValue(Message); + } + if (Optional.IsDefined(Level)) + { + writer.WritePropertyName("level"); + writer.WriteStringValue(Level.Value.ToSerialString()); + } + if (Optional.IsDefined(Channels)) + { + writer.WritePropertyName("channels"); + writer.WriteStringValue(Channels.Value.ToSerialString()); + } + if (Optional.IsDefined(ActionName)) + { + writer.WritePropertyName("actionName"); + writer.WriteStringValue(ActionName); + } + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteNumberValue(Enabled.Value); + } + if (Optional.IsCollectionDefined(States)) + { + writer.WritePropertyName("states"); + writer.WriteStartArray(); + foreach (var item in States) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("startTime"); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("endTime"); + writer.WriteStringValue(EndTime.Value, "O"); + } + if (Optional.IsDefined(NextNotificationTime)) + { + writer.WritePropertyName("nextNotificationTime"); + writer.WriteStringValue(NextNotificationTime.Value, "O"); + } + if (Optional.IsDefined(NotificationExpirationTime)) + { + writer.WritePropertyName("notificationExpirationTime"); + writer.WriteStringValue(NotificationExpirationTime.Value, "O"); + } + if (Optional.IsDefined(NotifiedTime)) + { + writer.WritePropertyName("notifiedTime"); + writer.WriteStringValue(NotifiedTime.Value, "O"); + } + if (Optional.IsDefined(Score)) + { + writer.WritePropertyName("score"); + writer.WriteNumberValue(Score.Value); + } + if (Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"); + writer.WriteBooleanValue(IsDynamic.Value); + } + if (Optional.IsDefined(ExtensionName)) + { + writer.WritePropertyName("extensionName"); + writer.WriteStringValue(ExtensionName); + } + if (Optional.IsDefined(BladeName)) + { + writer.WritePropertyName("bladeName"); + writer.WriteStringValue(BladeName); + } + if (Optional.IsDefined(ForwardLink)) + { + writer.WritePropertyName("forwardLink"); + writer.WriteStringValue(ForwardLink); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Recommendation DeserializeRecommendation(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional creationTime = default; + Optional recommendationId = default; + Optional resourceId = default; + Optional resourceScope = default; + Optional ruleName = default; + Optional displayName = default; + Optional message = default; + Optional level = default; + Optional channels = default; + Optional> categoryTags = default; + Optional actionName = default; + Optional enabled = default; + Optional> states = default; + Optional startTime = default; + Optional endTime = default; + Optional nextNotificationTime = default; + Optional notificationExpirationTime = default; + Optional notifiedTime = default; + Optional score = default; + Optional isDynamic = default; + Optional extensionName = default; + Optional bladeName = default; + Optional forwardLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("creationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + creationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("recommendationId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + recommendationId = property0.Value.GetGuid(); + continue; + } + if (property0.NameEquals("resourceId")) + { + resourceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("resourceScope")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + resourceScope = new ResourceScopeType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("ruleName")) + { + ruleName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("displayName")) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("message")) + { + message = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("level")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + level = property0.Value.GetString().ToNotificationLevel(); + continue; + } + if (property0.NameEquals("channels")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + channels = property0.Value.GetString().ToChannels(); + continue; + } + if (property0.NameEquals("categoryTags")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + categoryTags = array; + continue; + } + if (property0.NameEquals("actionName")) + { + actionName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("states")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + states = array; + continue; + } + if (property0.NameEquals("startTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("endTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + endTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("nextNotificationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + nextNotificationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("notificationExpirationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + notificationExpirationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("notifiedTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + notifiedTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("score")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + score = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("isDynamic")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isDynamic = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("extensionName")) + { + extensionName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("bladeName")) + { + bladeName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("forwardLink")) + { + forwardLink = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new Recommendation(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(creationTime), Optional.ToNullable(recommendationId), resourceId.Value, Optional.ToNullable(resourceScope), ruleName.Value, displayName.Value, message.Value, Optional.ToNullable(level), Optional.ToNullable(channels), Optional.ToList(categoryTags), actionName.Value, Optional.ToNullable(enabled), Optional.ToList(states), Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToNullable(nextNotificationTime), Optional.ToNullable(notificationExpirationTime), Optional.ToNullable(notifiedTime), Optional.ToNullable(score), Optional.ToNullable(isDynamic), extensionName.Value, bladeName.Value, forwardLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.cs index 91e53bd92e74..0513a7a7afa8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.cs @@ -1,94 +1,55 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Represents a recommendation result generated by the recommendation - /// engine. - /// - [Rest.Serialization.JsonTransformation] + /// Represents a recommendation result generated by the recommendation engine. public partial class Recommendation : ProxyOnlyResource { - /// - /// Initializes a new instance of the Recommendation class. - /// + /// Initializes a new instance of Recommendation. public Recommendation() { - CustomInit(); + CategoryTags = new ChangeTrackingList(); + States = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the Recommendation class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Timestamp when this instance was - /// created. - /// A GUID value that each - /// recommendation object is associated with. - /// Full ARM resource ID string that this - /// recommendation object is associated with. - /// Name of a resource type this - /// recommendation applies, e.g. Subscription, ServerFarm, Site. - /// Possible values include: 'ServerFarm', 'Subscription', - /// 'WebSite' - /// Unique name of the rule. - /// UI friendly name of the rule (may not be - /// unique). - /// Recommendation text. - /// Level indicating how critical this - /// recommendation can impact. Possible values include: 'Critical', - /// 'Warning', 'Information', 'NonUrgentSuggestion' - /// List of channels that this recommendation - /// can apply. Possible values include: 'Notification', 'Api', 'Email', - /// 'Webhook', 'All' - /// The list of category tags that this - /// recommendation belongs to. - /// Name of action recommended by this - /// object. - /// True if this recommendation is still valid - /// (i.e. "actionable"). False if it is invalid. - /// The list of states of this recommendation. If - /// it's null then it should be considered "Active". - /// The beginning time in UTC of a range that - /// the recommendation refers to. - /// The end time in UTC of a range that the - /// recommendation refers to. - /// When to notify this - /// recommendation next in UTC. Null means that this will never be - /// notified anymore. - /// Date and time in UTC when - /// this notification expires. - /// Last timestamp in UTC this instance was - /// actually notified. Null means that this recommendation hasn't been - /// notified yet. - /// A metric value measured by the rule. - /// True if this is associated with a - /// dynamically added rule - /// Extension name of the portal if - /// exists. - /// Deep link to a blade on the portal. - /// Forward link to an external document - /// associated with the rule. - public Recommendation(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), System.DateTime? creationTime = default(System.DateTime?), System.Guid? recommendationId = default(System.Guid?), string resourceId = default(string), string resourceScope = default(string), string ruleName = default(string), string displayName = default(string), string message = default(string), NotificationLevel? level = default(NotificationLevel?), Channels? channels = default(Channels?), IList categoryTags = default(IList), string actionName = default(string), int? enabled = default(int?), IList states = default(IList), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), System.DateTime? nextNotificationTime = default(System.DateTime?), System.DateTime? notificationExpirationTime = default(System.DateTime?), System.DateTime? notifiedTime = default(System.DateTime?), double? score = default(double?), bool? isDynamic = default(bool?), string extensionName = default(string), string bladeName = default(string), string forwardLink = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of Recommendation. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Timestamp when this instance was created. + /// A GUID value that each recommendation object is associated with. + /// Full ARM resource ID string that this recommendation object is associated with. + /// Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. + /// Unique name of the rule. + /// UI friendly name of the rule (may not be unique). + /// Recommendation text. + /// Level indicating how critical this recommendation can impact. + /// List of channels that this recommendation can apply. + /// The list of category tags that this recommendation belongs to. + /// Name of action recommended by this object. + /// True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. + /// The list of states of this recommendation. If it's null then it should be considered "Active". + /// The beginning time in UTC of a range that the recommendation refers to. + /// The end time in UTC of a range that the recommendation refers to. + /// When to notify this recommendation next in UTC. Null means that this will never be notified anymore. + /// Date and time in UTC when this notification expires. + /// Last timestamp in UTC this instance was actually notified. Null means that this recommendation hasn't been notified yet. + /// A metric value measured by the rule. + /// True if this is associated with a dynamically added rule. + /// Extension name of the portal if exists. + /// Deep link to a blade on the portal. + /// Forward link to an external document associated with the rule. + internal Recommendation(string id, string name, string kind, string type, DateTimeOffset? creationTime, Guid? recommendationId, string resourceId, ResourceScopeType? resourceScope, string ruleName, string displayName, string message, NotificationLevel? level, Channels? channels, IReadOnlyList categoryTags, string actionName, int? enabled, IList states, DateTimeOffset? startTime, DateTimeOffset? endTime, DateTimeOffset? nextNotificationTime, DateTimeOffset? notificationExpirationTime, DateTimeOffset? notifiedTime, double? score, bool? isDynamic, string extensionName, string bladeName, string forwardLink) : base(id, name, kind, type) { CreationTime = creationTime; RecommendationId = recommendationId; @@ -113,168 +74,53 @@ public Recommendation() ExtensionName = extensionName; BladeName = bladeName; ForwardLink = forwardLink; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets timestamp when this instance was created. - /// - [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; set; } - - /// - /// Gets or sets a GUID value that each recommendation object is - /// associated with. - /// - [JsonProperty(PropertyName = "properties.recommendationId")] - public System.Guid? RecommendationId { get; set; } - - /// - /// Gets or sets full ARM resource ID string that this recommendation - /// object is associated with. - /// - [JsonProperty(PropertyName = "properties.resourceId")] + /// Timestamp when this instance was created. + public DateTimeOffset? CreationTime { get; set; } + /// A GUID value that each recommendation object is associated with. + public Guid? RecommendationId { get; set; } + /// Full ARM resource ID string that this recommendation object is associated with. public string ResourceId { get; set; } - - /// - /// Gets or sets name of a resource type this recommendation applies, - /// e.g. Subscription, ServerFarm, Site. Possible values include: - /// 'ServerFarm', 'Subscription', 'WebSite' - /// - [JsonProperty(PropertyName = "properties.resourceScope")] - public string ResourceScope { get; set; } - - /// - /// Gets or sets unique name of the rule. - /// - [JsonProperty(PropertyName = "properties.ruleName")] + /// Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. + public ResourceScopeType? ResourceScope { get; set; } + /// Unique name of the rule. public string RuleName { get; set; } - - /// - /// Gets or sets UI friendly name of the rule (may not be unique). - /// - [JsonProperty(PropertyName = "properties.displayName")] + /// UI friendly name of the rule (may not be unique). public string DisplayName { get; set; } - - /// - /// Gets or sets recommendation text. - /// - [JsonProperty(PropertyName = "properties.message")] + /// Recommendation text. public string Message { get; set; } - - /// - /// Gets or sets level indicating how critical this recommendation can - /// impact. Possible values include: 'Critical', 'Warning', - /// 'Information', 'NonUrgentSuggestion' - /// - [JsonProperty(PropertyName = "properties.level")] + /// Level indicating how critical this recommendation can impact. public NotificationLevel? Level { get; set; } - - /// - /// Gets or sets list of channels that this recommendation can apply. - /// Possible values include: 'Notification', 'Api', 'Email', 'Webhook', - /// 'All' - /// - [JsonProperty(PropertyName = "properties.channels")] + /// List of channels that this recommendation can apply. public Channels? Channels { get; set; } - - /// - /// Gets the list of category tags that this recommendation belongs to. - /// - [JsonProperty(PropertyName = "properties.categoryTags")] - public IList CategoryTags { get; private set; } - - /// - /// Gets or sets name of action recommended by this object. - /// - [JsonProperty(PropertyName = "properties.actionName")] + /// The list of category tags that this recommendation belongs to. + public IReadOnlyList CategoryTags { get; } + /// Name of action recommended by this object. public string ActionName { get; set; } - - /// - /// Gets or sets true if this recommendation is still valid (i.e. - /// "actionable"). False if it is invalid. - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. public int? Enabled { get; set; } - - /// - /// Gets or sets the list of states of this recommendation. If it's - /// null then it should be considered "Active". - /// - [JsonProperty(PropertyName = "properties.states")] - public IList States { get; set; } - - /// - /// Gets or sets the beginning time in UTC of a range that the - /// recommendation refers to. - /// - [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets the end time in UTC of a range that the recommendation - /// refers to. - /// - [JsonProperty(PropertyName = "properties.endTime")] - public System.DateTime? EndTime { get; set; } - - /// - /// Gets or sets when to notify this recommendation next in UTC. Null - /// means that this will never be notified anymore. - /// - [JsonProperty(PropertyName = "properties.nextNotificationTime")] - public System.DateTime? NextNotificationTime { get; set; } - - /// - /// Gets or sets date and time in UTC when this notification expires. - /// - [JsonProperty(PropertyName = "properties.notificationExpirationTime")] - public System.DateTime? NotificationExpirationTime { get; set; } - - /// - /// Gets or sets last timestamp in UTC this instance was actually - /// notified. Null means that this recommendation hasn't been notified - /// yet. - /// - [JsonProperty(PropertyName = "properties.notifiedTime")] - public System.DateTime? NotifiedTime { get; set; } - - /// - /// Gets or sets a metric value measured by the rule. - /// - [JsonProperty(PropertyName = "properties.score")] + /// The list of states of this recommendation. If it's null then it should be considered "Active". + public IList States { get; } + /// The beginning time in UTC of a range that the recommendation refers to. + public DateTimeOffset? StartTime { get; set; } + /// The end time in UTC of a range that the recommendation refers to. + public DateTimeOffset? EndTime { get; set; } + /// When to notify this recommendation next in UTC. Null means that this will never be notified anymore. + public DateTimeOffset? NextNotificationTime { get; set; } + /// Date and time in UTC when this notification expires. + public DateTimeOffset? NotificationExpirationTime { get; set; } + /// Last timestamp in UTC this instance was actually notified. Null means that this recommendation hasn't been notified yet. + public DateTimeOffset? NotifiedTime { get; set; } + /// A metric value measured by the rule. public double? Score { get; set; } - - /// - /// Gets or sets true if this is associated with a dynamically added - /// rule - /// - [JsonProperty(PropertyName = "properties.isDynamic")] + /// True if this is associated with a dynamically added rule. public bool? IsDynamic { get; set; } - - /// - /// Gets or sets extension name of the portal if exists. - /// - [JsonProperty(PropertyName = "properties.extensionName")] + /// Extension name of the portal if exists. public string ExtensionName { get; set; } - - /// - /// Gets or sets deep link to a blade on the portal. - /// - [JsonProperty(PropertyName = "properties.bladeName")] + /// Deep link to a blade on the portal. public string BladeName { get; set; } - - /// - /// Gets or sets forward link to an external document associated with - /// the rule. - /// - [JsonProperty(PropertyName = "properties.forwardLink")] + /// Forward link to an external document associated with the rule. public string ForwardLink { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.Serialization.cs new file mode 100644 index 000000000000..bc9037835d51 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class RecommendationCollection + { + internal static RecommendationCollection DeserializeRecommendationCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Recommendation.DeserializeRecommendation(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new RecommendationCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.cs new file mode 100644 index 000000000000..a1c4d0fbed30 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of recommendations. + internal partial class RecommendationCollection + { + /// Initializes a new instance of RecommendationCollection. + /// Collection of resources. + /// is null. + internal RecommendationCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of RecommendationCollection. + /// Collection of resources. + /// Link to next page of resources. + internal RecommendationCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.Serialization.cs new file mode 100644 index 000000000000..f942fe4bf221 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.Serialization.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class RecommendationRule : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RecommendationName)) + { + writer.WritePropertyName("recommendationName"); + writer.WriteStringValue(RecommendationName); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"); + writer.WriteStringValue(Message); + } + if (Optional.IsDefined(RecommendationId)) + { + writer.WritePropertyName("recommendationId"); + writer.WriteStringValue(RecommendationId.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(ActionName)) + { + writer.WritePropertyName("actionName"); + writer.WriteStringValue(ActionName); + } + if (Optional.IsDefined(Level)) + { + writer.WritePropertyName("level"); + writer.WriteStringValue(Level.Value.ToSerialString()); + } + if (Optional.IsDefined(Channels)) + { + writer.WritePropertyName("channels"); + writer.WriteStringValue(Channels.Value.ToSerialString()); + } + if (Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"); + writer.WriteBooleanValue(IsDynamic.Value); + } + if (Optional.IsDefined(ExtensionName)) + { + writer.WritePropertyName("extensionName"); + writer.WriteStringValue(ExtensionName); + } + if (Optional.IsDefined(BladeName)) + { + writer.WritePropertyName("bladeName"); + writer.WriteStringValue(BladeName); + } + if (Optional.IsDefined(ForwardLink)) + { + writer.WritePropertyName("forwardLink"); + writer.WriteStringValue(ForwardLink); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static RecommendationRule DeserializeRecommendationRule(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional recommendationName = default; + Optional displayName = default; + Optional message = default; + Optional recommendationId = default; + Optional description = default; + Optional actionName = default; + Optional level = default; + Optional channels = default; + Optional> categoryTags = default; + Optional isDynamic = default; + Optional extensionName = default; + Optional bladeName = default; + Optional forwardLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("recommendationName")) + { + recommendationName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("displayName")) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("message")) + { + message = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("recommendationId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + recommendationId = property0.Value.GetGuid(); + continue; + } + if (property0.NameEquals("description")) + { + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("actionName")) + { + actionName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("level")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + level = property0.Value.GetString().ToNotificationLevel(); + continue; + } + if (property0.NameEquals("channels")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + channels = property0.Value.GetString().ToChannels(); + continue; + } + if (property0.NameEquals("categoryTags")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + categoryTags = array; + continue; + } + if (property0.NameEquals("isDynamic")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isDynamic = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("extensionName")) + { + extensionName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("bladeName")) + { + bladeName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("forwardLink")) + { + forwardLink = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new RecommendationRule(id.Value, name.Value, kind.Value, type.Value, recommendationName.Value, displayName.Value, message.Value, Optional.ToNullable(recommendationId), description.Value, actionName.Value, Optional.ToNullable(level), Optional.ToNullable(channels), Optional.ToList(categoryTags), Optional.ToNullable(isDynamic), extensionName.Value, bladeName.Value, forwardLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.cs index 79ad1c3a6199..bc7b8d6a6687 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.cs @@ -1,73 +1,47 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Represents a recommendation rule that the recommendation engine can - /// perform. - /// - [Rest.Serialization.JsonTransformation] + /// Represents a recommendation rule that the recommendation engine can perform. public partial class RecommendationRule : ProxyOnlyResource { - /// - /// Initializes a new instance of the RecommendationRule class. - /// + /// Initializes a new instance of RecommendationRule. public RecommendationRule() { - CustomInit(); + CategoryTags = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the RecommendationRule class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Unique name of the rule. - /// UI friendly name of the rule. - /// Localized name of the rule (Good for - /// UI). - /// Recommendation ID of an associated - /// recommendation object tied to the rule, if exists. - /// If such an object doesn't exist, it is set to null. - /// Localized detailed description of the - /// rule. - /// Name of action that is recommended by this - /// rule in string. - /// Level of impact indicating how critical this - /// rule is. Possible values include: 'Critical', 'Warning', - /// 'Information', 'NonUrgentSuggestion' - /// List of available channels that this rule - /// applies. Possible values include: 'Notification', 'Api', 'Email', - /// 'Webhook', 'All' - /// The list of category tags that this - /// recommendation rule belongs to. - /// True if this is associated with a - /// dynamically added rule - /// Extension name of the portal if exists. - /// Applicable to dynamic rule only. - /// Deep link to a blade on the portal. - /// Applicable to dynamic rule only. - /// Forward link to an external document - /// associated with the rule. Applicable to dynamic rule only. - public RecommendationRule(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string recommendationName = default(string), string displayName = default(string), string message = default(string), System.Guid? recommendationId = default(System.Guid?), string description = default(string), string actionName = default(string), NotificationLevel? level = default(NotificationLevel?), Channels? channels = default(Channels?), IList categoryTags = default(IList), bool? isDynamic = default(bool?), string extensionName = default(string), string bladeName = default(string), string forwardLink = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of RecommendationRule. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Unique name of the rule. + /// UI friendly name of the rule. + /// Localized name of the rule (Good for UI). + /// + /// Recommendation ID of an associated recommendation object tied to the rule, if exists. + /// If such an object doesn't exist, it is set to null. + /// + /// Localized detailed description of the rule. + /// Name of action that is recommended by this rule in string. + /// Level of impact indicating how critical this rule is. + /// List of available channels that this rule applies. + /// The list of category tags that this recommendation rule belongs to. + /// True if this is associated with a dynamically added rule. + /// Extension name of the portal if exists. Applicable to dynamic rule only. + /// Deep link to a blade on the portal. Applicable to dynamic rule only. + /// Forward link to an external document associated with the rule. Applicable to dynamic rule only. + internal RecommendationRule(string id, string name, string kind, string type, string recommendationName, string displayName, string message, Guid? recommendationId, string description, string actionName, NotificationLevel? level, Channels? channels, IReadOnlyList categoryTags, bool? isDynamic, string extensionName, string bladeName, string forwardLink) : base(id, name, kind, type) { RecommendationName = recommendationName; DisplayName = displayName; @@ -82,103 +56,36 @@ public RecommendationRule() ExtensionName = extensionName; BladeName = bladeName; ForwardLink = forwardLink; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets unique name of the rule. - /// - [JsonProperty(PropertyName = "properties.recommendationName")] + /// Unique name of the rule. public string RecommendationName { get; set; } - - /// - /// Gets or sets UI friendly name of the rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] + /// UI friendly name of the rule. public string DisplayName { get; set; } - - /// - /// Gets or sets localized name of the rule (Good for UI). - /// - [JsonProperty(PropertyName = "properties.message")] + /// Localized name of the rule (Good for UI). public string Message { get; set; } - - /// - /// Gets or sets recommendation ID of an associated recommendation - /// object tied to the rule, if exists. - /// If such an object doesn't exist, it is set to null. - /// - [JsonProperty(PropertyName = "properties.recommendationId")] - public System.Guid? RecommendationId { get; set; } - /// - /// Gets or sets localized detailed description of the rule. + /// Recommendation ID of an associated recommendation object tied to the rule, if exists. + /// If such an object doesn't exist, it is set to null. /// - [JsonProperty(PropertyName = "properties.description")] + public Guid? RecommendationId { get; set; } + /// Localized detailed description of the rule. public string Description { get; set; } - - /// - /// Gets or sets name of action that is recommended by this rule in - /// string. - /// - [JsonProperty(PropertyName = "properties.actionName")] + /// Name of action that is recommended by this rule in string. public string ActionName { get; set; } - - /// - /// Gets or sets level of impact indicating how critical this rule is. - /// Possible values include: 'Critical', 'Warning', 'Information', - /// 'NonUrgentSuggestion' - /// - [JsonProperty(PropertyName = "properties.level")] + /// Level of impact indicating how critical this rule is. public NotificationLevel? Level { get; set; } - - /// - /// Gets or sets list of available channels that this rule applies. - /// Possible values include: 'Notification', 'Api', 'Email', 'Webhook', - /// 'All' - /// - [JsonProperty(PropertyName = "properties.channels")] + /// List of available channels that this rule applies. public Channels? Channels { get; set; } - - /// - /// Gets the list of category tags that this recommendation rule - /// belongs to. - /// - [JsonProperty(PropertyName = "properties.categoryTags")] - public IList CategoryTags { get; private set; } - - /// - /// Gets or sets true if this is associated with a dynamically added - /// rule - /// - [JsonProperty(PropertyName = "properties.isDynamic")] + /// The list of category tags that this recommendation rule belongs to. + public IReadOnlyList CategoryTags { get; } + /// True if this is associated with a dynamically added rule. public bool? IsDynamic { get; set; } - - /// - /// Gets or sets extension name of the portal if exists. Applicable to - /// dynamic rule only. - /// - [JsonProperty(PropertyName = "properties.extensionName")] + /// Extension name of the portal if exists. Applicable to dynamic rule only. public string ExtensionName { get; set; } - - /// - /// Gets or sets deep link to a blade on the portal. Applicable to - /// dynamic rule only. - /// - [JsonProperty(PropertyName = "properties.bladeName")] + /// Deep link to a blade on the portal. Applicable to dynamic rule only. public string BladeName { get; set; } - - /// - /// Gets or sets forward link to an external document associated with - /// the rule. Applicable to dynamic rule only. - /// - [JsonProperty(PropertyName = "properties.forwardLink")] + /// Forward link to an external document associated with the rule. Applicable to dynamic rule only. public string ForwardLink { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.Serialization.cs new file mode 100644 index 000000000000..381df8659031 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class RedundancyModeExtensions + { + public static string ToSerialString(this RedundancyMode value) => value switch + { + RedundancyMode.None => "None", + RedundancyMode.Manual => "Manual", + RedundancyMode.Failover => "Failover", + RedundancyMode.ActiveActive => "ActiveActive", + RedundancyMode.GeoRedundant => "GeoRedundant", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RedundancyMode value.") + }; + + public static RedundancyMode ToRedundancyMode(this string value) + { + if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return RedundancyMode.None; + if (string.Equals(value, "Manual", StringComparison.InvariantCultureIgnoreCase)) return RedundancyMode.Manual; + if (string.Equals(value, "Failover", StringComparison.InvariantCultureIgnoreCase)) return RedundancyMode.Failover; + if (string.Equals(value, "ActiveActive", StringComparison.InvariantCultureIgnoreCase)) return RedundancyMode.ActiveActive; + if (string.Equals(value, "GeoRedundant", StringComparison.InvariantCultureIgnoreCase)) return RedundancyMode.GeoRedundant; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RedundancyMode value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.cs index 555eec94aacc..38f8d2657210 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.cs @@ -1,78 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for RedundancyMode. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Site redundancy mode. public enum RedundancyMode { - [EnumMember(Value = "None")] + /// None. None, - [EnumMember(Value = "Manual")] + /// Manual. Manual, - [EnumMember(Value = "Failover")] + /// Failover. Failover, - [EnumMember(Value = "ActiveActive")] + /// ActiveActive. ActiveActive, - [EnumMember(Value = "GeoRedundant")] + /// GeoRedundant. GeoRedundant } - internal static class RedundancyModeEnumExtension - { - internal static string ToSerializedValue(this RedundancyMode? value) - { - return value == null ? null : ((RedundancyMode)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this RedundancyMode value) - { - switch( value ) - { - case RedundancyMode.None: - return "None"; - case RedundancyMode.Manual: - return "Manual"; - case RedundancyMode.Failover: - return "Failover"; - case RedundancyMode.ActiveActive: - return "ActiveActive"; - case RedundancyMode.GeoRedundant: - return "GeoRedundant"; - } - return null; - } - - internal static RedundancyMode? ParseRedundancyMode(this string value) - { - switch( value ) - { - case "None": - return RedundancyMode.None; - case "Manual": - return RedundancyMode.Manual; - case "Failover": - return RedundancyMode.Failover; - case "ActiveActive": - return RedundancyMode.ActiveActive; - case "GeoRedundant": - return RedundancyMode.GeoRedundant; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.Serialization.cs new file mode 100644 index 000000000000..f72a8ce1b88a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ReissueCertificateOrderRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(KeySize)) + { + writer.WritePropertyName("keySize"); + writer.WriteNumberValue(KeySize.Value); + } + if (Optional.IsDefined(DelayExistingRevokeInHours)) + { + writer.WritePropertyName("delayExistingRevokeInHours"); + writer.WriteNumberValue(DelayExistingRevokeInHours.Value); + } + if (Optional.IsDefined(Csr)) + { + writer.WritePropertyName("csr"); + writer.WriteStringValue(Csr); + } + if (Optional.IsDefined(IsPrivateKeyExternal)) + { + writer.WritePropertyName("isPrivateKeyExternal"); + writer.WriteBooleanValue(IsPrivateKeyExternal.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ReissueCertificateOrderRequest DeserializeReissueCertificateOrderRequest(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional keySize = default; + Optional delayExistingRevokeInHours = default; + Optional csr = default; + Optional isPrivateKeyExternal = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("keySize")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + keySize = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("delayExistingRevokeInHours")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + delayExistingRevokeInHours = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("csr")) + { + csr = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("isPrivateKeyExternal")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isPrivateKeyExternal = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new ReissueCertificateOrderRequest(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(keySize), Optional.ToNullable(delayExistingRevokeInHours), csr.Value, Optional.ToNullable(isPrivateKeyExternal)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.cs index 6cc305676cc6..fb729f84d907 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.cs @@ -1,90 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Class representing certificate reissue request. - /// - [Rest.Serialization.JsonTransformation] + /// Class representing certificate reissue request. public partial class ReissueCertificateOrderRequest : ProxyOnlyResource { - /// - /// Initializes a new instance of the ReissueCertificateOrderRequest - /// class. - /// + /// Initializes a new instance of ReissueCertificateOrderRequest. public ReissueCertificateOrderRequest() { - CustomInit(); } - /// - /// Initializes a new instance of the ReissueCertificateOrderRequest - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Certificate Key Size. - /// Delay in hours to revoke - /// existing certificate after the new certificate is issued. - /// Csr to be used for re-key operation. - /// Should we change the ASC type - /// (from managed private key to external private key and vice - /// versa). - public ReissueCertificateOrderRequest(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? keySize = default(int?), int? delayExistingRevokeInHours = default(int?), string csr = default(string), bool? isPrivateKeyExternal = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of ReissueCertificateOrderRequest. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Certificate Key Size. + /// Delay in hours to revoke existing certificate after the new certificate is issued. + /// Csr to be used for re-key operation. + /// Should we change the ASC type (from managed private key to external private key and vice versa). + internal ReissueCertificateOrderRequest(string id, string name, string kind, string type, int? keySize, int? delayExistingRevokeInHours, string csr, bool? isPrivateKeyExternal) : base(id, name, kind, type) { KeySize = keySize; DelayExistingRevokeInHours = delayExistingRevokeInHours; Csr = csr; IsPrivateKeyExternal = isPrivateKeyExternal; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets certificate Key Size. - /// - [JsonProperty(PropertyName = "properties.keySize")] + /// Certificate Key Size. public int? KeySize { get; set; } - - /// - /// Gets or sets delay in hours to revoke existing certificate after - /// the new certificate is issued. - /// - [JsonProperty(PropertyName = "properties.delayExistingRevokeInHours")] + /// Delay in hours to revoke existing certificate after the new certificate is issued. public int? DelayExistingRevokeInHours { get; set; } - - /// - /// Gets or sets csr to be used for re-key operation. - /// - [JsonProperty(PropertyName = "properties.csr")] + /// Csr to be used for re-key operation. public string Csr { get; set; } - - /// - /// Gets or sets should we change the ASC type (from managed private - /// key to external private key and vice versa). - /// - [JsonProperty(PropertyName = "properties.isPrivateKeyExternal")] + /// Should we change the ASC type (from managed private key to external private key and vice versa). public bool? IsPrivateKeyExternal { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.Serialization.cs new file mode 100644 index 000000000000..5e0253c3058f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class RelayServiceConnectionEntity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"); + writer.WriteStringValue(EntityName); + } + if (Optional.IsDefined(EntityConnectionString)) + { + writer.WritePropertyName("entityConnectionString"); + writer.WriteStringValue(EntityConnectionString); + } + if (Optional.IsDefined(ResourceType)) + { + writer.WritePropertyName("resourceType"); + writer.WriteStringValue(ResourceType); + } + if (Optional.IsDefined(ResourceConnectionString)) + { + writer.WritePropertyName("resourceConnectionString"); + writer.WriteStringValue(ResourceConnectionString); + } + if (Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"); + writer.WriteStringValue(Hostname); + } + if (Optional.IsDefined(Port)) + { + writer.WritePropertyName("port"); + writer.WriteNumberValue(Port.Value); + } + if (Optional.IsDefined(BiztalkUri)) + { + writer.WritePropertyName("biztalkUri"); + writer.WriteStringValue(BiztalkUri); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static RelayServiceConnectionEntity DeserializeRelayServiceConnectionEntity(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional entityName = default; + Optional entityConnectionString = default; + Optional resourceType = default; + Optional resourceConnectionString = default; + Optional hostname = default; + Optional port = default; + Optional biztalkUri = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("entityName")) + { + entityName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("entityConnectionString")) + { + entityConnectionString = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("resourceType")) + { + resourceType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("resourceConnectionString")) + { + resourceConnectionString = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostname")) + { + hostname = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("port")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + port = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("biztalkUri")) + { + biztalkUri = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new RelayServiceConnectionEntity(id.Value, name.Value, kind.Value, type.Value, entityName.Value, entityConnectionString.Value, resourceType.Value, resourceConnectionString.Value, hostname.Value, Optional.ToNullable(port), biztalkUri.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.cs index 9323d5b30647..3613870848ef 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.cs @@ -1,45 +1,33 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Hybrid Connection for an App Service app. - /// - [Rest.Serialization.JsonTransformation] + /// Hybrid Connection for an App Service app. public partial class RelayServiceConnectionEntity : ProxyOnlyResource { - /// - /// Initializes a new instance of the RelayServiceConnectionEntity - /// class. - /// + /// Initializes a new instance of RelayServiceConnectionEntity. public RelayServiceConnectionEntity() { - CustomInit(); } - /// - /// Initializes a new instance of the RelayServiceConnectionEntity - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public RelayServiceConnectionEntity(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string entityName = default(string), string entityConnectionString = default(string), string resourceType = default(string), string resourceConnectionString = default(string), string hostname = default(string), int? port = default(int?), string biztalkUri = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of RelayServiceConnectionEntity. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// . + /// . + /// . + /// . + /// . + /// . + /// . + internal RelayServiceConnectionEntity(string id, string name, string kind, string type, string entityName, string entityConnectionString, string resourceType, string resourceConnectionString, string hostname, int? port, string biztalkUri) : base(id, name, kind, type) { EntityName = entityName; EntityConnectionString = entityConnectionString; @@ -48,48 +36,14 @@ public RelayServiceConnectionEntity() Hostname = hostname; Port = port; BiztalkUri = biztalkUri; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.entityName")] public string EntityName { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.entityConnectionString")] public string EntityConnectionString { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.resourceType")] public string ResourceType { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.resourceConnectionString")] public string ResourceConnectionString { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.hostname")] public string Hostname { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.port")] public int? Port { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.biztalkUri")] public string BiztalkUri { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.Serialization.cs new file mode 100644 index 000000000000..b6fd9cfb3295 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.Serialization.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class RemotePrivateEndpointConnection : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(PrivateEndpoint)) + { + writer.WritePropertyName("privateEndpoint"); + writer.WriteObjectValue(PrivateEndpoint); + } + if (Optional.IsDefined(PrivateLinkServiceConnectionState)) + { + writer.WritePropertyName("privateLinkServiceConnectionState"); + writer.WriteObjectValue(PrivateLinkServiceConnectionState); + } + if (Optional.IsCollectionDefined(IpAddresses)) + { + writer.WritePropertyName("ipAddresses"); + writer.WriteStartArray(); + foreach (var item in IpAddresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static RemotePrivateEndpointConnection DeserializeRemotePrivateEndpointConnection(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional provisioningState = default; + Optional privateEndpoint = default; + Optional privateLinkServiceConnectionState = default; + Optional> ipAddresses = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState")) + { + provisioningState = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("privateEndpoint")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + privateEndpoint = ArmIdWrapper.DeserializeArmIdWrapper(property0.Value); + continue; + } + if (property0.NameEquals("privateLinkServiceConnectionState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + privateLinkServiceConnectionState = PrivateLinkConnectionState.DeserializePrivateLinkConnectionState(property0.Value); + continue; + } + if (property0.NameEquals("ipAddresses")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAddresses = array; + continue; + } + } + continue; + } + } + return new RemotePrivateEndpointConnection(id.Value, name.Value, kind.Value, type.Value, provisioningState.Value, privateEndpoint.Value, privateLinkServiceConnectionState.Value, Optional.ToList(ipAddresses)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.cs new file mode 100644 index 000000000000..41f522545c66 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// A remote private endpoint connection. + public partial class RemotePrivateEndpointConnection : ProxyOnlyResource + { + /// Initializes a new instance of RemotePrivateEndpointConnection. + public RemotePrivateEndpointConnection() + { + IpAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of RemotePrivateEndpointConnection. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// . + /// PrivateEndpoint of a remote private endpoint connection. + /// The state of a private link connection. + /// Private IPAddresses mapped to the remote private endpoint. + internal RemotePrivateEndpointConnection(string id, string name, string kind, string type, string provisioningState, ArmIdWrapper privateEndpoint, PrivateLinkConnectionState privateLinkServiceConnectionState, IList ipAddresses) : base(id, name, kind, type) + { + ProvisioningState = provisioningState; + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + IpAddresses = ipAddresses; + } + + public string ProvisioningState { get; } + /// PrivateEndpoint of a remote private endpoint connection. + public ArmIdWrapper PrivateEndpoint { get; set; } + /// The state of a private link connection. + public PrivateLinkConnectionState PrivateLinkServiceConnectionState { get; set; } + /// Private IPAddresses mapped to the remote private endpoint. + public IList IpAddresses { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.Serialization.cs new file mode 100644 index 000000000000..bbf0e4d10351 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.Serialization.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class RemotePrivateEndpointConnectionARMResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(PrivateEndpoint)) + { + writer.WritePropertyName("privateEndpoint"); + writer.WriteObjectValue(PrivateEndpoint); + } + if (Optional.IsDefined(PrivateLinkServiceConnectionState)) + { + writer.WritePropertyName("privateLinkServiceConnectionState"); + writer.WriteObjectValue(PrivateLinkServiceConnectionState); + } + if (Optional.IsCollectionDefined(IpAddresses)) + { + writer.WritePropertyName("ipAddresses"); + writer.WriteStartArray(); + foreach (var item in IpAddresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static RemotePrivateEndpointConnectionARMResource DeserializeRemotePrivateEndpointConnectionARMResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional provisioningState = default; + Optional privateEndpoint = default; + Optional privateLinkServiceConnectionState = default; + Optional> ipAddresses = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState")) + { + provisioningState = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("privateEndpoint")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + privateEndpoint = ArmIdWrapper.DeserializeArmIdWrapper(property0.Value); + continue; + } + if (property0.NameEquals("privateLinkServiceConnectionState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + privateLinkServiceConnectionState = PrivateLinkConnectionState.DeserializePrivateLinkConnectionState(property0.Value); + continue; + } + if (property0.NameEquals("ipAddresses")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAddresses = array; + continue; + } + } + continue; + } + } + return new RemotePrivateEndpointConnectionARMResource(id.Value, name.Value, kind.Value, type.Value, provisioningState.Value, privateEndpoint.Value, privateLinkServiceConnectionState.Value, Optional.ToList(ipAddresses)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs new file mode 100644 index 000000000000..9c662648dc07 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Remote Private Endpoint Connection ARM resource. + public partial class RemotePrivateEndpointConnectionARMResource : ProxyOnlyResource + { + /// Initializes a new instance of RemotePrivateEndpointConnectionARMResource. + public RemotePrivateEndpointConnectionARMResource() + { + IpAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of RemotePrivateEndpointConnectionARMResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// . + /// PrivateEndpoint of a remote private endpoint connection. + /// The state of a private link connection. + /// Private IPAddresses mapped to the remote private endpoint. + internal RemotePrivateEndpointConnectionARMResource(string id, string name, string kind, string type, string provisioningState, ArmIdWrapper privateEndpoint, PrivateLinkConnectionState privateLinkServiceConnectionState, IList ipAddresses) : base(id, name, kind, type) + { + ProvisioningState = provisioningState; + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + IpAddresses = ipAddresses; + } + + public string ProvisioningState { get; } + /// PrivateEndpoint of a remote private endpoint connection. + public ArmIdWrapper PrivateEndpoint { get; set; } + /// The state of a private link connection. + public PrivateLinkConnectionState PrivateLinkServiceConnectionState { get; set; } + /// Private IPAddresses mapped to the remote private endpoint. + public IList IpAddresses { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.Serialization.cs new file mode 100644 index 000000000000..07fb54e2a310 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.Serialization.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Rendering : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.Value.ToSerialString()); + } + if (Optional.IsDefined(Title)) + { + writer.WritePropertyName("title"); + writer.WriteStringValue(Title); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + writer.WriteEndObject(); + } + + internal static Rendering DeserializeRendering(JsonElement element) + { + Optional type = default; + Optional title = default; + Optional description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + type = property.Value.GetString().ToRenderingType(); + continue; + } + if (property.NameEquals("title")) + { + title = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + } + return new Rendering(Optional.ToNullable(type), title.Value, description.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs index 8080fa872330..41cb77b0eb31 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs @@ -1,71 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Instructions for rendering the data - /// + /// Instructions for rendering the data. public partial class Rendering { - /// - /// Initializes a new instance of the Rendering class. - /// + /// Initializes a new instance of Rendering. public Rendering() { - CustomInit(); } - /// - /// Initializes a new instance of the Rendering class. - /// - /// Rendering Type. Possible values include: - /// 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' - /// Title of data - /// Description of the data that will help it - /// be interpreted - public Rendering(RenderingType? type = default(RenderingType?), string title = default(string), string description = default(string)) + /// Initializes a new instance of Rendering. + /// Rendering Type. + /// Title of data. + /// Description of the data that will help it be interpreted. + internal Rendering(RenderingType? type, string title, string description) { Type = type; Title = title; Description = description; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets rendering Type. Possible values include: 'NoGraph', - /// 'Table', 'TimeSeries', 'TimeSeriesPerInstance' - /// - [JsonProperty(PropertyName = "type")] + /// Rendering Type. public RenderingType? Type { get; set; } - - /// - /// Gets or sets title of data - /// - [JsonProperty(PropertyName = "title")] + /// Title of data. public string Title { get; set; } - - /// - /// Gets or sets description of the data that will help it be - /// interpreted - /// - [JsonProperty(PropertyName = "description")] + /// Description of the data that will help it be interpreted. public string Description { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.Serialization.cs new file mode 100644 index 000000000000..b1634af3e465 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class RenderingTypeExtensions + { + public static string ToSerialString(this RenderingType value) => value switch + { + RenderingType.NoGraph => "NoGraph", + RenderingType.Table => "Table", + RenderingType.TimeSeries => "TimeSeries", + RenderingType.TimeSeriesPerInstance => "TimeSeriesPerInstance", + RenderingType.PieChart => "PieChart", + RenderingType.DataSummary => "DataSummary", + RenderingType.Email => "Email", + RenderingType.Insights => "Insights", + RenderingType.DynamicInsight => "DynamicInsight", + RenderingType.Markdown => "Markdown", + RenderingType.Detector => "Detector", + RenderingType.DropDown => "DropDown", + RenderingType.Card => "Card", + RenderingType.Solution => "Solution", + RenderingType.Guage => "Guage", + RenderingType.Form => "Form", + RenderingType.ChangeSets => "ChangeSets", + RenderingType.ChangeAnalysisOnboarding => "ChangeAnalysisOnboarding", + RenderingType.ChangesView => "ChangesView", + RenderingType.AppInsight => "AppInsight", + RenderingType.DependencyGraph => "DependencyGraph", + RenderingType.DownTime => "DownTime", + RenderingType.SummaryCard => "SummaryCard", + RenderingType.SearchComponent => "SearchComponent", + RenderingType.AppInsightEnablement => "AppInsightEnablement", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RenderingType value.") + }; + + public static RenderingType ToRenderingType(this string value) + { + if (string.Equals(value, "NoGraph", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.NoGraph; + if (string.Equals(value, "Table", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Table; + if (string.Equals(value, "TimeSeries", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.TimeSeries; + if (string.Equals(value, "TimeSeriesPerInstance", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.TimeSeriesPerInstance; + if (string.Equals(value, "PieChart", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.PieChart; + if (string.Equals(value, "DataSummary", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.DataSummary; + if (string.Equals(value, "Email", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Email; + if (string.Equals(value, "Insights", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Insights; + if (string.Equals(value, "DynamicInsight", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.DynamicInsight; + if (string.Equals(value, "Markdown", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Markdown; + if (string.Equals(value, "Detector", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Detector; + if (string.Equals(value, "DropDown", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.DropDown; + if (string.Equals(value, "Card", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Card; + if (string.Equals(value, "Solution", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Solution; + if (string.Equals(value, "Guage", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Guage; + if (string.Equals(value, "Form", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Form; + if (string.Equals(value, "ChangeSets", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.ChangeSets; + if (string.Equals(value, "ChangeAnalysisOnboarding", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.ChangeAnalysisOnboarding; + if (string.Equals(value, "ChangesView", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.ChangesView; + if (string.Equals(value, "AppInsight", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.AppInsight; + if (string.Equals(value, "DependencyGraph", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.DependencyGraph; + if (string.Equals(value, "DownTime", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.DownTime; + if (string.Equals(value, "SummaryCard", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.SummaryCard; + if (string.Equals(value, "SearchComponent", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.SearchComponent; + if (string.Equals(value, "AppInsightEnablement", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.AppInsightEnablement; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RenderingType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs index bf0ebdff16f5..3c52520a9a95 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs @@ -1,72 +1,64 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for RenderingType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Rendering Type. public enum RenderingType { - [EnumMember(Value = "NoGraph")] + /// NoGraph. NoGraph, - [EnumMember(Value = "Table")] + /// Table. Table, - [EnumMember(Value = "TimeSeries")] + /// TimeSeries. TimeSeries, - [EnumMember(Value = "TimeSeriesPerInstance")] - TimeSeriesPerInstance - } - internal static class RenderingTypeEnumExtension - { - internal static string ToSerializedValue(this RenderingType? value) - { - return value == null ? null : ((RenderingType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this RenderingType value) - { - switch( value ) - { - case RenderingType.NoGraph: - return "NoGraph"; - case RenderingType.Table: - return "Table"; - case RenderingType.TimeSeries: - return "TimeSeries"; - case RenderingType.TimeSeriesPerInstance: - return "TimeSeriesPerInstance"; - } - return null; - } - - internal static RenderingType? ParseRenderingType(this string value) - { - switch( value ) - { - case "NoGraph": - return RenderingType.NoGraph; - case "Table": - return RenderingType.Table; - case "TimeSeries": - return RenderingType.TimeSeries; - case "TimeSeriesPerInstance": - return RenderingType.TimeSeriesPerInstance; - } - return null; - } + /// TimeSeriesPerInstance. + TimeSeriesPerInstance, + /// PieChart. + PieChart, + /// DataSummary. + DataSummary, + /// Email. + Email, + /// Insights. + Insights, + /// DynamicInsight. + DynamicInsight, + /// Markdown. + Markdown, + /// Detector. + Detector, + /// DropDown. + DropDown, + /// Card. + Card, + /// Solution. + Solution, + /// Guage. + Guage, + /// Form. + Form, + /// ChangeSets. + ChangeSets, + /// ChangeAnalysisOnboarding. + ChangeAnalysisOnboarding, + /// ChangesView. + ChangesView, + /// AppInsight. + AppInsight, + /// DependencyGraph. + DependencyGraph, + /// DownTime. + DownTime, + /// SummaryCard. + SummaryCard, + /// SearchComponent. + SearchComponent, + /// AppInsightEnablement. + AppInsightEnablement } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.Serialization.cs new file mode 100644 index 000000000000..82799e125ff1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.Serialization.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class RenewCertificateOrderRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(KeySize)) + { + writer.WritePropertyName("keySize"); + writer.WriteNumberValue(KeySize.Value); + } + if (Optional.IsDefined(Csr)) + { + writer.WritePropertyName("csr"); + writer.WriteStringValue(Csr); + } + if (Optional.IsDefined(IsPrivateKeyExternal)) + { + writer.WritePropertyName("isPrivateKeyExternal"); + writer.WriteBooleanValue(IsPrivateKeyExternal.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static RenewCertificateOrderRequest DeserializeRenewCertificateOrderRequest(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional keySize = default; + Optional csr = default; + Optional isPrivateKeyExternal = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("keySize")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + keySize = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("csr")) + { + csr = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("isPrivateKeyExternal")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isPrivateKeyExternal = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new RenewCertificateOrderRequest(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(keySize), csr.Value, Optional.ToNullable(isPrivateKeyExternal)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.cs index cdd22b65c909..d88ff1b218f9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.cs @@ -1,80 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Class representing certificate renew request. - /// - [Rest.Serialization.JsonTransformation] + /// Class representing certificate renew request. public partial class RenewCertificateOrderRequest : ProxyOnlyResource { - /// - /// Initializes a new instance of the RenewCertificateOrderRequest - /// class. - /// + /// Initializes a new instance of RenewCertificateOrderRequest. public RenewCertificateOrderRequest() { - CustomInit(); } - /// - /// Initializes a new instance of the RenewCertificateOrderRequest - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Certificate Key Size. - /// Csr to be used for re-key operation. - /// Should we change the ASC type - /// (from managed private key to external private key and vice - /// versa). - public RenewCertificateOrderRequest(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? keySize = default(int?), string csr = default(string), bool? isPrivateKeyExternal = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of RenewCertificateOrderRequest. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Certificate Key Size. + /// Csr to be used for re-key operation. + /// Should we change the ASC type (from managed private key to external private key and vice versa). + internal RenewCertificateOrderRequest(string id, string name, string kind, string type, int? keySize, string csr, bool? isPrivateKeyExternal) : base(id, name, kind, type) { KeySize = keySize; Csr = csr; IsPrivateKeyExternal = isPrivateKeyExternal; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets certificate Key Size. - /// - [JsonProperty(PropertyName = "properties.keySize")] + /// Certificate Key Size. public int? KeySize { get; set; } - - /// - /// Gets or sets csr to be used for re-key operation. - /// - [JsonProperty(PropertyName = "properties.csr")] + /// Csr to be used for re-key operation. public string Csr { get; set; } - - /// - /// Gets or sets should we change the ASC type (from managed private - /// key to external private key and vice versa). - /// - [JsonProperty(PropertyName = "properties.isPrivateKeyExternal")] + /// Should we change the ASC type (from managed private key to external private key and vice versa). public bool? IsPrivateKeyExternal { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.Serialization.cs new file mode 100644 index 000000000000..c6880c2534b1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class RequestsBasedTrigger : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(TimeInterval)) + { + writer.WritePropertyName("timeInterval"); + writer.WriteStringValue(TimeInterval); + } + writer.WriteEndObject(); + } + + internal static RequestsBasedTrigger DeserializeRequestsBasedTrigger(JsonElement element) + { + Optional count = default; + Optional timeInterval = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("count")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + count = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeInterval")) + { + timeInterval = property.Value.GetString(); + continue; + } + } + return new RequestsBasedTrigger(Optional.ToNullable(count), timeInterval.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.cs index d96750f47c95..d1ec596fe3ec 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Trigger based on total requests. - /// + /// Trigger based on total requests. public partial class RequestsBasedTrigger { - /// - /// Initializes a new instance of the RequestsBasedTrigger class. - /// + /// Initializes a new instance of RequestsBasedTrigger. public RequestsBasedTrigger() { - CustomInit(); } - /// - /// Initializes a new instance of the RequestsBasedTrigger class. - /// - /// Request Count. - /// Time interval. - public RequestsBasedTrigger(int? count = default(int?), string timeInterval = default(string)) + /// Initializes a new instance of RequestsBasedTrigger. + /// Request Count. + /// Time interval. + internal RequestsBasedTrigger(int? count, string timeInterval) { Count = count; TimeInterval = timeInterval; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets request Count. - /// - [JsonProperty(PropertyName = "count")] + /// Request Count. public int? Count { get; set; } - - /// - /// Gets or sets time interval. - /// - [JsonProperty(PropertyName = "timeInterval")] + /// Time interval. public string TimeInterval { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.Serialization.cs new file mode 100644 index 000000000000..841655b12455 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class ResolveStatusExtensions + { + public static string ToSerialString(this ResolveStatus value) => value switch + { + ResolveStatus.Initialized => "Initialized", + ResolveStatus.Resolved => "Resolved", + ResolveStatus.InvalidSyntax => "InvalidSyntax", + ResolveStatus.MSINotEnabled => "MSINotEnabled", + ResolveStatus.VaultNotFound => "VaultNotFound", + ResolveStatus.SecretNotFound => "SecretNotFound", + ResolveStatus.SecretVersionNotFound => "SecretVersionNotFound", + ResolveStatus.AccessToKeyVaultDenied => "AccessToKeyVaultDenied", + ResolveStatus.OtherReasons => "OtherReasons", + ResolveStatus.FetchTimedOut => "FetchTimedOut", + ResolveStatus.UnauthorizedClient => "UnauthorizedClient", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResolveStatus value.") + }; + + public static ResolveStatus ToResolveStatus(this string value) + { + if (string.Equals(value, "Initialized", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.Initialized; + if (string.Equals(value, "Resolved", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.Resolved; + if (string.Equals(value, "InvalidSyntax", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.InvalidSyntax; + if (string.Equals(value, "MSINotEnabled", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.MSINotEnabled; + if (string.Equals(value, "VaultNotFound", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.VaultNotFound; + if (string.Equals(value, "SecretNotFound", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.SecretNotFound; + if (string.Equals(value, "SecretVersionNotFound", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.SecretVersionNotFound; + if (string.Equals(value, "AccessToKeyVaultDenied", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.AccessToKeyVaultDenied; + if (string.Equals(value, "OtherReasons", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.OtherReasons; + if (string.Equals(value, "FetchTimedOut", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.FetchTimedOut; + if (string.Equals(value, "UnauthorizedClient", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.UnauthorizedClient; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResolveStatus value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs new file mode 100644 index 000000000000..fdcf177c7557 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// The ResolveStatus. + public enum ResolveStatus + { + /// Initialized. + Initialized, + /// Resolved. + Resolved, + /// InvalidSyntax. + InvalidSyntax, + /// MSINotEnabled. + MSINotEnabled, + /// VaultNotFound. + VaultNotFound, + /// SecretNotFound. + SecretNotFound, + /// SecretVersionNotFound. + SecretVersionNotFound, + /// AccessToKeyVaultDenied. + AccessToKeyVaultDenied, + /// OtherReasons. + OtherReasons, + /// FetchTimedOut. + FetchTimedOut, + /// UnauthorizedClient. + UnauthorizedClient + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.Serialization.cs new file mode 100644 index 000000000000..ba43f587aaf2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.Serialization.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Resource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + } + + internal static Resource DeserializeResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + string location = default; + Optional type = default; + Optional> tags = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + } + return new Resource(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.cs index b9afb2fc04f6..568c2e461049 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.cs @@ -1,45 +1,41 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Azure resource. This resource is tracked in Azure Resource Manager - /// - public partial class Resource : IResource + /// Azure resource. This resource is tracked in Azure Resource Manager. + public partial class Resource { - /// - /// Initializes a new instance of the Resource class. - /// - public Resource() + /// Initializes a new instance of Resource. + /// Resource Location. + /// is null. + public Resource(string location) { - CustomInit(); + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + Location = location; + Tags = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the Resource class. - /// - /// Resource Location. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Resource tags. - public Resource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + /// Initializes a new instance of Resource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource Location. + /// Resource type. + /// Resource tags. + internal Resource(string id, string name, string kind, string location, string type, IDictionary tags) { Id = id; Name = name; @@ -47,62 +43,19 @@ public Resource() Location = location; Type = type; Tags = tags; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets resource Id. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource Name. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets or sets kind of resource. - /// - [JsonProperty(PropertyName = "kind")] + /// Resource Id. + public string Id { get; } + /// Resource Name. + public string Name { get; } + /// Kind of resource. public string Kind { get; set; } - - /// - /// Gets or sets resource Location. - /// - [JsonProperty(PropertyName = "location")] + /// Resource Location. public string Location { get; set; } - - /// - /// Gets resource type. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets or sets resource tags. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - } + /// Resource type. + public string Type { get; } + /// Resource tags. + public IDictionary Tags { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.Serialization.cs new file mode 100644 index 000000000000..346bc9146736 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class ResourceCollection + { + internal static ResourceCollection DeserializeResourceCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ResourceCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.cs new file mode 100644 index 000000000000..b52616340bfc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of resources. + internal partial class ResourceCollection + { + /// Initializes a new instance of ResourceCollection. + /// Collection of resources. + /// is null. + internal ResourceCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of ResourceCollection. + /// Collection of resources. + /// Link to next page of resources. + internal ResourceCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.Serialization.cs new file mode 100644 index 000000000000..d3a434e8e6b5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ResourceHealthMetadata : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"); + writer.WriteStringValue(Category); + } + if (Optional.IsDefined(SignalAvailability)) + { + writer.WritePropertyName("signalAvailability"); + writer.WriteBooleanValue(SignalAvailability.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ResourceHealthMetadata DeserializeResourceHealthMetadata(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional category = default; + Optional signalAvailability = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("category")) + { + category = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("signalAvailability")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + signalAvailability = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new ResourceHealthMetadata(id.Value, name.Value, kind.Value, type.Value, category.Value, Optional.ToNullable(signalAvailability)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.cs index d27a122a6915..c01704979f68 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.cs @@ -1,70 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Used for getting ResourceHealthCheck settings. - /// - [Rest.Serialization.JsonTransformation] + /// Used for getting ResourceHealthCheck settings. public partial class ResourceHealthMetadata : ProxyOnlyResource { - /// - /// Initializes a new instance of the ResourceHealthMetadata class. - /// + /// Initializes a new instance of ResourceHealthMetadata. public ResourceHealthMetadata() { - CustomInit(); } - /// - /// Initializes a new instance of the ResourceHealthMetadata class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The category that the resource matches in - /// the RHC Policy File - /// Is there a health signal for the - /// resource - public ResourceHealthMetadata(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string category = default(string), bool? signalAvailability = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of ResourceHealthMetadata. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The category that the resource matches in the RHC Policy File. + /// Is there a health signal for the resource. + internal ResourceHealthMetadata(string id, string name, string kind, string type, string category, bool? signalAvailability) : base(id, name, kind, type) { Category = category; SignalAvailability = signalAvailability; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the category that the resource matches in the RHC - /// Policy File - /// - [JsonProperty(PropertyName = "properties.category")] + /// The category that the resource matches in the RHC Policy File. public string Category { get; set; } - - /// - /// Gets or sets is there a health signal for the resource - /// - [JsonProperty(PropertyName = "properties.signalAvailability")] + /// Is there a health signal for the resource. public bool? SignalAvailability { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.Serialization.cs new file mode 100644 index 000000000000..e980399e50cf --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class ResourceHealthMetadataCollection + { + internal static ResourceHealthMetadataCollection DeserializeResourceHealthMetadataCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceHealthMetadata.DeserializeResourceHealthMetadata(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ResourceHealthMetadataCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.cs new file mode 100644 index 000000000000..9ee25824870b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of resource health metadata. + internal partial class ResourceHealthMetadataCollection + { + /// Initializes a new instance of ResourceHealthMetadataCollection. + /// Collection of resources. + /// is null. + internal ResourceHealthMetadataCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of ResourceHealthMetadataCollection. + /// Collection of resources. + /// Link to next page of resources. + internal ResourceHealthMetadataCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.Serialization.cs new file mode 100644 index 000000000000..0385710706f1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ResourceMetricAvailability + { + internal static ResourceMetricAvailability DeserializeResourceMetricAvailability(JsonElement element) + { + Optional timeGrain = default; + Optional retention = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timeGrain")) + { + timeGrain = property.Value.GetString(); + continue; + } + if (property.NameEquals("retention")) + { + retention = property.Value.GetString(); + continue; + } + } + return new ResourceMetricAvailability(timeGrain.Value, retention.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.cs index 6a258b8f67f0..caacb7de50e3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.cs @@ -1,60 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Metrics availability and retention. - /// + /// Metrics availability and retention. public partial class ResourceMetricAvailability { - /// - /// Initializes a new instance of the ResourceMetricAvailability class. - /// - public ResourceMetricAvailability() + /// Initializes a new instance of ResourceMetricAvailability. + internal ResourceMetricAvailability() { - CustomInit(); } - /// - /// Initializes a new instance of the ResourceMetricAvailability class. - /// - /// Time grain . - /// Retention period for the current time - /// grain. - public ResourceMetricAvailability(string timeGrain = default(string), string retention = default(string)) + /// Initializes a new instance of ResourceMetricAvailability. + /// Time grain . + /// Retention period for the current time grain. + internal ResourceMetricAvailability(string timeGrain, string retention) { TimeGrain = timeGrain; Retention = retention; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets time grain . - /// - [JsonProperty(PropertyName = "timeGrain")] - public string TimeGrain { get; private set; } - - /// - /// Gets retention period for the current time grain. - /// - [JsonProperty(PropertyName = "retention")] - public string Retention { get; private set; } - + /// Time grain . + public string TimeGrain { get; } + /// Retention period for the current time grain. + public string Retention { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.Serialization.cs new file mode 100644 index 000000000000..9f7df2fcba04 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.Serialization.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ResourceMetricDefinition : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ResourceMetricDefinition DeserializeResourceMetricDefinition(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional unit = default; + Optional primaryAggregationType = default; + Optional> metricAvailabilities = default; + Optional resourceUri = default; + Optional> properties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("unit")) + { + unit = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("primaryAggregationType")) + { + primaryAggregationType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("metricAvailabilities")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ResourceMetricAvailability.DeserializeResourceMetricAvailability(item)); + } + metricAvailabilities = array; + continue; + } + if (property0.NameEquals("resourceUri")) + { + resourceUri = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("properties")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + properties = dictionary; + continue; + } + } + continue; + } + } + return new ResourceMetricDefinition(id.Value, name.Value, kind.Value, type.Value, unit.Value, primaryAggregationType.Value, Optional.ToList(metricAvailabilities), resourceUri.Value, Optional.ToDictionary(properties)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.cs index 022529f87010..620f7a30dd23 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.cs @@ -1,97 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Metadata for the metrics. - /// - [Rest.Serialization.JsonTransformation] + /// Metadata for the metrics. public partial class ResourceMetricDefinition : ProxyOnlyResource { - /// - /// Initializes a new instance of the ResourceMetricDefinition class. - /// + /// Initializes a new instance of ResourceMetricDefinition. public ResourceMetricDefinition() { - CustomInit(); + MetricAvailabilities = new ChangeTrackingList(); + Properties = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the ResourceMetricDefinition class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Unit of the metric. - /// Primary aggregation - /// type. - /// List of time grains supported - /// for the metric together with retention period. - /// Resource URI. - /// Resource metric definition - /// properties. - public ResourceMetricDefinition(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string unit = default(string), string primaryAggregationType = default(string), IList metricAvailabilities = default(IList), string resourceUri = default(string), IDictionary properties = default(IDictionary)) - : base(id, name, kind, type) + /// Initializes a new instance of ResourceMetricDefinition. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Unit of the metric. + /// Primary aggregation type. + /// List of time grains supported for the metric together with retention period. + /// Resource URI. + /// Resource metric definition properties. + internal ResourceMetricDefinition(string id, string name, string kind, string type, string unit, string primaryAggregationType, IReadOnlyList metricAvailabilities, string resourceUri, IReadOnlyDictionary properties) : base(id, name, kind, type) { Unit = unit; PrimaryAggregationType = primaryAggregationType; MetricAvailabilities = metricAvailabilities; ResourceUri = resourceUri; Properties = properties; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets unit of the metric. - /// - [JsonProperty(PropertyName = "properties.unit")] - public string Unit { get; private set; } - - /// - /// Gets primary aggregation type. - /// - [JsonProperty(PropertyName = "properties.primaryAggregationType")] - public string PrimaryAggregationType { get; private set; } - - /// - /// Gets list of time grains supported for the metric together with - /// retention period. - /// - [JsonProperty(PropertyName = "properties.metricAvailabilities")] - public IList MetricAvailabilities { get; private set; } - - /// - /// Gets resource URI. - /// - [JsonProperty(PropertyName = "properties.resourceUri")] - public string ResourceUri { get; private set; } - - /// - /// Gets resource metric definition properties. - /// - [JsonProperty(PropertyName = "properties.properties")] - public IDictionary Properties { get; private set; } - + /// Unit of the metric. + public string Unit { get; } + /// Primary aggregation type. + public string PrimaryAggregationType { get; } + /// List of time grains supported for the metric together with retention period. + public IReadOnlyList MetricAvailabilities { get; } + /// Resource URI. + public string ResourceUri { get; } + /// Resource metric definition properties. + public IReadOnlyDictionary Properties { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.Serialization.cs new file mode 100644 index 000000000000..bac1a00b74bb --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class ResourceMetricDefinitionCollection + { + internal static ResourceMetricDefinitionCollection DeserializeResourceMetricDefinitionCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceMetricDefinition.DeserializeResourceMetricDefinition(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ResourceMetricDefinitionCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.cs new file mode 100644 index 000000000000..6b8400c0fb76 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of metric definitions. + internal partial class ResourceMetricDefinitionCollection + { + /// Initializes a new instance of ResourceMetricDefinitionCollection. + /// Collection of resources. + /// is null. + internal ResourceMetricDefinitionCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of ResourceMetricDefinitionCollection. + /// Collection of resources. + /// Link to next page of resources. + internal ResourceMetricDefinitionCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.Serialization.cs new file mode 100644 index 000000000000..797a39c765f4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ResourceNameAvailability + { + internal static ResourceNameAvailability DeserializeResourceNameAvailability(JsonElement element) + { + Optional nameAvailable = default; + Optional reason = default; + Optional message = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nameAvailable")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + nameAvailable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("reason")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + reason = new InAvailabilityReasonType(property.Value.GetString()); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + } + return new ResourceNameAvailability(Optional.ToNullable(nameAvailable), Optional.ToNullable(reason), message.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.cs index c199116b2ea1..48c0037cf8ce 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.cs @@ -1,89 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information regarding availability of a resource name. - /// + /// Information regarding availability of a resource name. public partial class ResourceNameAvailability { - /// - /// Initializes a new instance of the ResourceNameAvailability class. - /// - public ResourceNameAvailability() + /// Initializes a new instance of ResourceNameAvailability. + internal ResourceNameAvailability() { - CustomInit(); } - /// - /// Initializes a new instance of the ResourceNameAvailability class. - /// - /// <code>true</code> indicates - /// name is valid and available. <code>false</code> - /// indicates the name is invalid, unavailable, or both. - /// <code>Invalid</code> indicates the - /// name provided does not match Azure App Service naming requirements. - /// <code>AlreadyExists</code> indicates that the name is - /// already in use and is therefore unavailable. Possible values - /// include: 'Invalid', 'AlreadyExists' - /// If reason == invalid, provide the user with - /// the reason why the given name is invalid, and provide the resource - /// naming requirements so that the user can select a valid name. If - /// reason == AlreadyExists, explain that resource name is already in - /// use, and direct them to select a different name. - public ResourceNameAvailability(bool? nameAvailable = default(bool?), string reason = default(string), string message = default(string)) + /// Initializes a new instance of ResourceNameAvailability. + /// <code>true</code> indicates name is valid and available. <code>false</code> indicates the name is invalid, unavailable, or both. + /// <code>Invalid</code> indicates the name provided does not match Azure App Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and is therefore unavailable. + /// If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. + internal ResourceNameAvailability(bool? nameAvailable, InAvailabilityReasonType? reason, string message) { NameAvailable = nameAvailable; Reason = reason; Message = message; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; - /// indicates name is valid and available. - /// &lt;code&gt;false&lt;/code&gt; indicates the name - /// is invalid, unavailable, or both. - /// - [JsonProperty(PropertyName = "nameAvailable")] - public bool? NameAvailable { get; set; } - - /// - /// Gets or sets &lt;code&gt;Invalid&lt;/code&gt; - /// indicates the name provided does not match Azure App Service naming - /// requirements. - /// &lt;code&gt;AlreadyExists&lt;/code&gt; indicates - /// that the name is already in use and is therefore unavailable. - /// Possible values include: 'Invalid', 'AlreadyExists' - /// - [JsonProperty(PropertyName = "reason")] - public string Reason { get; set; } - - /// - /// Gets or sets if reason == invalid, provide the user with the reason - /// why the given name is invalid, and provide the resource naming - /// requirements so that the user can select a valid name. If reason == - /// AlreadyExists, explain that resource name is already in use, and - /// direct them to select a different name. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - + /// <code>true</code> indicates name is valid and available. <code>false</code> indicates the name is invalid, unavailable, or both. + public bool? NameAvailable { get; } + /// <code>Invalid</code> indicates the name provided does not match Azure App Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and is therefore unavailable. + public InAvailabilityReasonType? Reason { get; } + /// If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. + public string Message { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.Serialization.cs new file mode 100644 index 000000000000..27577830594d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class ResourceNameAvailabilityRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsDefined(IsFqdn)) + { + writer.WritePropertyName("isFqdn"); + writer.WriteBooleanValue(IsFqdn.Value); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.cs index 7269a0be5826..69bff60c9006 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.cs @@ -1,95 +1,37 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Resource name availability request content. - /// - public partial class ResourceNameAvailabilityRequest + /// Resource name availability request content. + internal partial class ResourceNameAvailabilityRequest { - /// - /// Initializes a new instance of the ResourceNameAvailabilityRequest - /// class. - /// - public ResourceNameAvailabilityRequest() + /// Initializes a new instance of ResourceNameAvailabilityRequest. + /// Resource name to verify. + /// Resource type used for verification. + /// is null. + public ResourceNameAvailabilityRequest(string name, CheckNameResourceTypes type) { - CustomInit(); - } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } - /// - /// Initializes a new instance of the ResourceNameAvailabilityRequest - /// class. - /// - /// Resource name to verify. - /// Resource type used for verification. Possible - /// values include: 'Site', 'Slot', 'HostingEnvironment', - /// 'PublishingUser', 'Microsoft.Web/sites', - /// 'Microsoft.Web/sites/slots', 'Microsoft.Web/hostingEnvironments', - /// 'Microsoft.Web/publishingUsers' - /// Is fully qualified domain name. - public ResourceNameAvailabilityRequest(string name, string type, bool? isFqdn = default(bool?)) - { Name = name; Type = type; - IsFqdn = isFqdn; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource name to verify. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets resource type used for verification. Possible values - /// include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', - /// 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', - /// 'Microsoft.Web/hostingEnvironments', - /// 'Microsoft.Web/publishingUsers' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets is fully qualified domain name. - /// - [JsonProperty(PropertyName = "isFqdn")] + /// Resource name to verify. + public string Name { get; } + /// Resource type used for verification. + public CheckNameResourceTypes Type { get; } + /// Is fully qualified domain name. public bool? IsFqdn { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Type == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Type"); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceScopeType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceScopeType.cs index 42cd0d7da6b8..c4f1f52c8a63 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceScopeType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceScopeType.cs @@ -1,23 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for ResourceScopeType. - /// - public static class ResourceScopeType + /// Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. + public readonly partial struct ResourceScopeType : IEquatable { - public const string ServerFarm = "ServerFarm"; - public const string Subscription = "Subscription"; - public const string WebSite = "WebSite"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public ResourceScopeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ServerFarmValue = "ServerFarm"; + private const string SubscriptionValue = "Subscription"; + private const string WebSiteValue = "WebSite"; + + /// ServerFarm. + public static ResourceScopeType ServerFarm { get; } = new ResourceScopeType(ServerFarmValue); + /// Subscription. + public static ResourceScopeType Subscription { get; } = new ResourceScopeType(SubscriptionValue); + /// WebSite. + public static ResourceScopeType WebSite { get; } = new ResourceScopeType(WebSiteValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceScopeType left, ResourceScopeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceScopeType left, ResourceScopeType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ResourceScopeType(string value) => new ResourceScopeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceScopeType other && Equals(other); + /// + public bool Equals(ResourceScopeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.Serialization.cs new file mode 100644 index 000000000000..e9927973cba2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ResponseMessageEnvelopeRemotePrivateEndpointConnection + { + internal static ResponseMessageEnvelopeRemotePrivateEndpointConnection DeserializeResponseMessageEnvelopeRemotePrivateEndpointConnection(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional type = default; + Optional location = default; + Optional> tags = default; + Optional plan = default; + Optional properties = default; + Optional sku = default; + Optional status = default; + Optional error = default; + Optional identity = default; + Optional> zones = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("plan")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + plan = ArmPlan.DeserializeArmPlan(property.Value); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = RemotePrivateEndpointConnection.DeserializeRemotePrivateEndpointConnection(property.Value); + continue; + } + if (property.NameEquals("sku")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + sku = SkuDescription.DeserializeSkuDescription(property.Value); + continue; + } + if (property.NameEquals("status")) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("error")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + error = ErrorEntity.DeserializeErrorEntity(property.Value); + continue; + } + if (property.NameEquals("identity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value); + continue; + } + if (property.NameEquals("zones")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + continue; + } + } + return new ResponseMessageEnvelopeRemotePrivateEndpointConnection(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), plan.Value, properties.Value, sku.Value, status.Value, error.Value, identity.Value, Optional.ToList(zones)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs new file mode 100644 index 000000000000..dbe1f859a9ae --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Message envelope that contains the common Azure resource manager properties and the resource provider specific content. + public partial class ResponseMessageEnvelopeRemotePrivateEndpointConnection + { + /// Initializes a new instance of ResponseMessageEnvelopeRemotePrivateEndpointConnection. + internal ResponseMessageEnvelopeRemotePrivateEndpointConnection() + { + Tags = new ChangeTrackingDictionary(); + Zones = new ChangeTrackingList(); + } + + /// Initializes a new instance of ResponseMessageEnvelopeRemotePrivateEndpointConnection. + /// + /// Resource Id. Typically ID is populated only for responses to GET requests. Caller is responsible for passing in this + /// value for GET requests only. + /// For example: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupId}/providers/Microsoft.Web/sites/{sitename}. + /// + /// Name of resource. + /// Type of resource e.g "Microsoft.Web/sites". + /// Geographical region resource belongs to e.g. SouthCentralUS, SouthEastAsia. + /// Tags associated with resource. + /// Azure resource manager plan. + /// Resource specific properties. + /// SKU description of the resource. + /// Azure-AsyncOperation Status info. + /// Azure-AsyncOperation Error info. + /// MSI resource. + /// Logical Availability Zones the service is hosted in. + internal ResponseMessageEnvelopeRemotePrivateEndpointConnection(string id, string name, string type, string location, IReadOnlyDictionary tags, ArmPlan plan, RemotePrivateEndpointConnection properties, SkuDescription sku, string status, ErrorEntity error, ManagedServiceIdentity identity, IReadOnlyList zones) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + Plan = plan; + Properties = properties; + Sku = sku; + Status = status; + Error = error; + Identity = identity; + Zones = zones; + } + + /// + /// Resource Id. Typically ID is populated only for responses to GET requests. Caller is responsible for passing in this + /// value for GET requests only. + /// For example: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupId}/providers/Microsoft.Web/sites/{sitename}. + /// + public string Id { get; } + /// Name of resource. + public string Name { get; } + /// Type of resource e.g "Microsoft.Web/sites". + public string Type { get; } + /// Geographical region resource belongs to e.g. SouthCentralUS, SouthEastAsia. + public string Location { get; } + /// Tags associated with resource. + public IReadOnlyDictionary Tags { get; } + /// Azure resource manager plan. + public ArmPlan Plan { get; } + /// Resource specific properties. + public RemotePrivateEndpointConnection Properties { get; } + /// SKU description of the resource. + public SkuDescription Sku { get; } + /// Azure-AsyncOperation Status info. + public string Status { get; } + /// Azure-AsyncOperation Error info. + public ErrorEntity Error { get; } + /// MSI resource. + public ManagedServiceIdentity Identity { get; } + /// Logical Availability Zones the service is hosted in. + public IReadOnlyList Zones { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.Serialization.cs new file mode 100644 index 000000000000..138b66937622 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ResponseMetaData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(DataSource)) + { + writer.WritePropertyName("dataSource"); + writer.WriteObjectValue(DataSource); + } + writer.WriteEndObject(); + } + + internal static ResponseMetaData DeserializeResponseMetaData(JsonElement element) + { + Optional dataSource = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dataSource")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + dataSource = DataSource.DeserializeDataSource(property.Value); + continue; + } + } + return new ResponseMetaData(dataSource.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.cs index e8846b26ab8c..d96155414591 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.cs @@ -1,48 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - + /// The ResponseMetaData. public partial class ResponseMetaData { - /// - /// Initializes a new instance of the ResponseMetaData class. - /// + /// Initializes a new instance of ResponseMetaData. public ResponseMetaData() { - CustomInit(); } - /// - /// Initializes a new instance of the ResponseMetaData class. - /// - /// Source of the Data - public ResponseMetaData(DataSource dataSource = default(DataSource)) + /// Initializes a new instance of ResponseMetaData. + /// Source of the Data. + internal ResponseMetaData(DataSource dataSource) { DataSource = dataSource; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets source of the Data - /// - [JsonProperty(PropertyName = "dataSource")] + /// Source of the Data. public DataSource DataSource { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.Serialization.cs new file mode 100644 index 000000000000..86f1a72955fd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.Serialization.cs @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class RestoreRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(StorageAccountUrl)) + { + writer.WritePropertyName("storageAccountUrl"); + writer.WriteStringValue(StorageAccountUrl); + } + if (Optional.IsDefined(BlobName)) + { + writer.WritePropertyName("blobName"); + writer.WriteStringValue(BlobName); + } + if (Optional.IsDefined(Overwrite)) + { + writer.WritePropertyName("overwrite"); + writer.WriteBooleanValue(Overwrite.Value); + } + if (Optional.IsDefined(SiteName)) + { + writer.WritePropertyName("siteName"); + writer.WriteStringValue(SiteName); + } + if (Optional.IsCollectionDefined(Databases)) + { + writer.WritePropertyName("databases"); + writer.WriteStartArray(); + foreach (var item in Databases) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IgnoreConflictingHostNames)) + { + writer.WritePropertyName("ignoreConflictingHostNames"); + writer.WriteBooleanValue(IgnoreConflictingHostNames.Value); + } + if (Optional.IsDefined(IgnoreDatabases)) + { + writer.WritePropertyName("ignoreDatabases"); + writer.WriteBooleanValue(IgnoreDatabases.Value); + } + if (Optional.IsDefined(AppServicePlan)) + { + writer.WritePropertyName("appServicePlan"); + writer.WriteStringValue(AppServicePlan); + } + if (Optional.IsDefined(OperationType)) + { + writer.WritePropertyName("operationType"); + writer.WriteStringValue(OperationType.Value.ToSerialString()); + } + if (Optional.IsDefined(AdjustConnectionStrings)) + { + writer.WritePropertyName("adjustConnectionStrings"); + writer.WriteBooleanValue(AdjustConnectionStrings.Value); + } + if (Optional.IsDefined(HostingEnvironment)) + { + writer.WritePropertyName("hostingEnvironment"); + writer.WriteStringValue(HostingEnvironment); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static RestoreRequest DeserializeRestoreRequest(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional storageAccountUrl = default; + Optional blobName = default; + Optional overwrite = default; + Optional siteName = default; + Optional> databases = default; + Optional ignoreConflictingHostNames = default; + Optional ignoreDatabases = default; + Optional appServicePlan = default; + Optional operationType = default; + Optional adjustConnectionStrings = default; + Optional hostingEnvironment = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("storageAccountUrl")) + { + storageAccountUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("blobName")) + { + blobName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("overwrite")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + overwrite = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("siteName")) + { + siteName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("databases")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DatabaseBackupSetting.DeserializeDatabaseBackupSetting(item)); + } + databases = array; + continue; + } + if (property0.NameEquals("ignoreConflictingHostNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + ignoreConflictingHostNames = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("ignoreDatabases")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + ignoreDatabases = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("appServicePlan")) + { + appServicePlan = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("operationType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + operationType = property0.Value.GetString().ToBackupRestoreOperationType(); + continue; + } + if (property0.NameEquals("adjustConnectionStrings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + adjustConnectionStrings = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("hostingEnvironment")) + { + hostingEnvironment = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new RestoreRequest(id.Value, name.Value, kind.Value, type.Value, storageAccountUrl.Value, blobName.Value, Optional.ToNullable(overwrite), siteName.Value, Optional.ToList(databases), Optional.ToNullable(ignoreConflictingHostNames), Optional.ToNullable(ignoreDatabases), appServicePlan.Value, Optional.ToNullable(operationType), Optional.ToNullable(adjustConnectionStrings), hostingEnvironment.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.cs index 7f9f46f4791e..52f9f09516d1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.cs @@ -1,75 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Description of a restore request. - /// - [Rest.Serialization.JsonTransformation] + /// Description of a restore request. public partial class RestoreRequest : ProxyOnlyResource { - /// - /// Initializes a new instance of the RestoreRequest class. - /// + /// Initializes a new instance of RestoreRequest. public RestoreRequest() { - CustomInit(); + Databases = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the RestoreRequest class. - /// - /// SAS URL to the container. - /// <code>true</code> if the - /// restore operation can overwrite target app; otherwise, - /// <code>false</code>. <code>true</code> is - /// needed if trying to restore over an existing app. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Name of a blob which contains the - /// backup. - /// Name of an app. - /// Collection of databases which should be - /// restored. This list has to match the list of databases included in - /// the backup. - /// Changes a logic when - /// restoring an app with custom domains. <code>true</code> - /// to remove custom domains automatically. If - /// <code>false</code>, custom domains are added to - /// the app's object when it is being restored, but that might fail due - /// to conflicts during the operation. - /// Ignore the databases and only restore - /// the site content - /// Specify app service plan that will own - /// restored site. - /// Operation type. Possible values - /// include: 'Default', 'Clone', 'Relocation', 'Snapshot', - /// 'CloudFS' - /// <code>true</code> - /// if SiteConfig.ConnectionStrings should be set in new app; - /// otherwise, <code>false</code>. - /// App Service Environment name, if - /// needed (only when restoring an app to an App Service - /// Environment). - public RestoreRequest(string storageAccountUrl, bool overwrite, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string blobName = default(string), string siteName = default(string), IList databases = default(IList), bool? ignoreConflictingHostNames = default(bool?), bool? ignoreDatabases = default(bool?), string appServicePlan = default(string), BackupRestoreOperationType? operationType = default(BackupRestoreOperationType?), bool? adjustConnectionStrings = default(bool?), string hostingEnvironment = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of RestoreRequest. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// SAS URL to the container. + /// Name of a blob which contains the backup. + /// <code>true</code> if the restore operation can overwrite target app; otherwise, <code>false</code>. <code>true</code> is needed if trying to restore over an existing app. + /// Name of an app. + /// Collection of databases which should be restored. This list has to match the list of databases included in the backup. + /// + /// Changes a logic when restoring an app with custom domains. <code>true</code> to remove custom domains automatically. If <code>false</code>, custom domains are added to + /// the app's object when it is being restored, but that might fail due to conflicts during the operation. + /// + /// Ignore the databases and only restore the site content. + /// Specify app service plan that will own restored site. + /// Operation type. + /// <code>true</code> if SiteConfig.ConnectionStrings should be set in new app; otherwise, <code>false</code>. + /// App Service Environment name, if needed (only when restoring an app to an App Service Environment). + internal RestoreRequest(string id, string name, string kind, string type, string storageAccountUrl, string blobName, bool? overwrite, string siteName, IList databases, bool? ignoreConflictingHostNames, bool? ignoreDatabases, string appServicePlan, BackupRestoreOperationType? operationType, bool? adjustConnectionStrings, string hostingEnvironment) : base(id, name, kind, type) { StorageAccountUrl = storageAccountUrl; BlobName = blobName; @@ -82,117 +51,32 @@ public RestoreRequest() OperationType = operationType; AdjustConnectionStrings = adjustConnectionStrings; HostingEnvironment = hostingEnvironment; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets SAS URL to the container. - /// - [JsonProperty(PropertyName = "properties.storageAccountUrl")] + /// SAS URL to the container. public string StorageAccountUrl { get; set; } - - /// - /// Gets or sets name of a blob which contains the backup. - /// - [JsonProperty(PropertyName = "properties.blobName")] + /// Name of a blob which contains the backup. public string BlobName { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// restore operation can overwrite target app; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// &lt;code&gt;true&lt;/code&gt; is needed if trying - /// to restore over an existing app. - /// - [JsonProperty(PropertyName = "properties.overwrite")] - public bool Overwrite { get; set; } - - /// - /// Gets or sets name of an app. - /// - [JsonProperty(PropertyName = "properties.siteName")] + /// <code>true</code> if the restore operation can overwrite target app; otherwise, <code>false</code>. <code>true</code> is needed if trying to restore over an existing app. + public bool? Overwrite { get; set; } + /// Name of an app. public string SiteName { get; set; } - + /// Collection of databases which should be restored. This list has to match the list of databases included in the backup. + public IList Databases { get; } /// - /// Gets or sets collection of databases which should be restored. This - /// list has to match the list of databases included in the backup. + /// Changes a logic when restoring an app with custom domains. <code>true</code> to remove custom domains automatically. If <code>false</code>, custom domains are added to + /// the app's object when it is being restored, but that might fail due to conflicts during the operation. /// - [JsonProperty(PropertyName = "properties.databases")] - public IList Databases { get; set; } - - /// - /// Gets or sets changes a logic when restoring an app with custom - /// domains. &lt;code&gt;true&lt;/code&gt; to remove - /// custom domains automatically. If - /// &lt;code&gt;false&lt;/code&gt;, custom domains are - /// added to - /// the app's object when it is being restored, but that might fail due - /// to conflicts during the operation. - /// - [JsonProperty(PropertyName = "properties.ignoreConflictingHostNames")] public bool? IgnoreConflictingHostNames { get; set; } - - /// - /// Gets or sets ignore the databases and only restore the site content - /// - [JsonProperty(PropertyName = "properties.ignoreDatabases")] + /// Ignore the databases and only restore the site content. public bool? IgnoreDatabases { get; set; } - - /// - /// Gets or sets specify app service plan that will own restored site. - /// - [JsonProperty(PropertyName = "properties.appServicePlan")] + /// Specify app service plan that will own restored site. public string AppServicePlan { get; set; } - - /// - /// Gets or sets operation type. Possible values include: 'Default', - /// 'Clone', 'Relocation', 'Snapshot', 'CloudFS' - /// - [JsonProperty(PropertyName = "properties.operationType")] + /// Operation type. public BackupRestoreOperationType? OperationType { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// SiteConfig.ConnectionStrings should be set in new app; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.adjustConnectionStrings")] + /// <code>true</code> if SiteConfig.ConnectionStrings should be set in new app; otherwise, <code>false</code>. public bool? AdjustConnectionStrings { get; set; } - - /// - /// Gets or sets app Service Environment name, if needed (only when - /// restoring an app to an App Service Environment). - /// - [JsonProperty(PropertyName = "properties.hostingEnvironment")] + /// App Service Environment name, if needed (only when restoring an app to an App Service Environment). public string HostingEnvironment { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (StorageAccountUrl == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccountUrl"); - } - if (Databases != null) - { - foreach (var element in Databases) - { - if (element != null) - { - element.Validate(); - } - } - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RouteType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RouteType.cs index 45453b399b4e..2fd2a4b912b4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RouteType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RouteType.cs @@ -1,23 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - /// - /// Defines values for RouteType. + /// The type of route this is: + /// DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + /// INHERITED - Routes inherited from the real Virtual Network routes + /// STATIC - Static route set on the app only + /// + /// These values will be used for syncing an app's routes with those from a Virtual Network. /// - public static class RouteType + public readonly partial struct RouteType : IEquatable { - public const string DEFAULT = "DEFAULT"; - public const string INHERITED = "INHERITED"; - public const string STATIC = "STATIC"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public RouteType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "DEFAULT"; + private const string InheritedValue = "INHERITED"; + private const string StaticValue = "STATIC"; + + /// DEFAULT. + public static RouteType Default { get; } = new RouteType(DefaultValue); + /// INHERITED. + public static RouteType Inherited { get; } = new RouteType(InheritedValue); + /// STATIC. + public static RouteType Static { get; } = new RouteType(StaticValue); + /// Determines if two values are the same. + public static bool operator ==(RouteType left, RouteType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RouteType left, RouteType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RouteType(string value) => new RouteType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RouteType other && Equals(other); + /// + public bool Equals(RouteType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.Serialization.cs new file mode 100644 index 000000000000..26a9cd059abd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SampleUtterance : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Text)) + { + writer.WritePropertyName("text"); + writer.WriteStringValue(Text); + } + if (Optional.IsCollectionDefined(Links)) + { + writer.WritePropertyName("links"); + writer.WriteStartArray(); + foreach (var item in Links) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Qid)) + { + writer.WritePropertyName("qid"); + writer.WriteStringValue(Qid); + } + writer.WriteEndObject(); + } + + internal static SampleUtterance DeserializeSampleUtterance(JsonElement element) + { + Optional text = default; + Optional> links = default; + Optional qid = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text")) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("links")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + links = array; + continue; + } + if (property.NameEquals("qid")) + { + qid = property.Value.GetString(); + continue; + } + } + return new SampleUtterance(text.Value, Optional.ToList(links), qid.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs new file mode 100644 index 000000000000..40dcdb9e9359 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Sample utterance. + public partial class SampleUtterance + { + /// Initializes a new instance of SampleUtterance. + public SampleUtterance() + { + Links = new ChangeTrackingList(); + } + + /// Initializes a new instance of SampleUtterance. + /// Text attribute of sample utterance. + /// Links attribute of sample utterance. + /// Question id of sample utterance (for stackoverflow questions titles). + internal SampleUtterance(string text, IList links, string qid) + { + Text = text; + Links = links; + Qid = qid; + } + + /// Text attribute of sample utterance. + public string Text { get; set; } + /// Links attribute of sample utterance. + public IList Links { get; } + /// Question id of sample utterance (for stackoverflow questions titles). + public string Qid { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ScmType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ScmType.cs index 20a633dd2b81..730117af6b46 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ScmType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ScmType.cs @@ -1,34 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for ScmType. - /// - public static class ScmType + /// SCM type. + public readonly partial struct ScmType : IEquatable { - public const string None = "None"; - public const string Dropbox = "Dropbox"; - public const string Tfs = "Tfs"; - public const string LocalGit = "LocalGit"; - public const string GitHub = "GitHub"; - public const string CodePlexGit = "CodePlexGit"; - public const string CodePlexHg = "CodePlexHg"; - public const string BitbucketGit = "BitbucketGit"; - public const string BitbucketHg = "BitbucketHg"; - public const string ExternalGit = "ExternalGit"; - public const string ExternalHg = "ExternalHg"; - public const string OneDrive = "OneDrive"; - public const string VSO = "VSO"; - public const string VSTSRM = "VSTSRM"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public ScmType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string DropboxValue = "Dropbox"; + private const string TfsValue = "Tfs"; + private const string LocalGitValue = "LocalGit"; + private const string GitHubValue = "GitHub"; + private const string CodePlexGitValue = "CodePlexGit"; + private const string CodePlexHgValue = "CodePlexHg"; + private const string BitbucketGitValue = "BitbucketGit"; + private const string BitbucketHgValue = "BitbucketHg"; + private const string ExternalGitValue = "ExternalGit"; + private const string ExternalHgValue = "ExternalHg"; + private const string OneDriveValue = "OneDrive"; + private const string VSOValue = "VSO"; + private const string VstsrmValue = "VSTSRM"; + + /// None. + public static ScmType None { get; } = new ScmType(NoneValue); + /// Dropbox. + public static ScmType Dropbox { get; } = new ScmType(DropboxValue); + /// Tfs. + public static ScmType Tfs { get; } = new ScmType(TfsValue); + /// LocalGit. + public static ScmType LocalGit { get; } = new ScmType(LocalGitValue); + /// GitHub. + public static ScmType GitHub { get; } = new ScmType(GitHubValue); + /// CodePlexGit. + public static ScmType CodePlexGit { get; } = new ScmType(CodePlexGitValue); + /// CodePlexHg. + public static ScmType CodePlexHg { get; } = new ScmType(CodePlexHgValue); + /// BitbucketGit. + public static ScmType BitbucketGit { get; } = new ScmType(BitbucketGitValue); + /// BitbucketHg. + public static ScmType BitbucketHg { get; } = new ScmType(BitbucketHgValue); + /// ExternalGit. + public static ScmType ExternalGit { get; } = new ScmType(ExternalGitValue); + /// ExternalHg. + public static ScmType ExternalHg { get; } = new ScmType(ExternalHgValue); + /// OneDrive. + public static ScmType OneDrive { get; } = new ScmType(OneDriveValue); + /// VSO. + public static ScmType VSO { get; } = new ScmType(VSOValue); + /// VSTSRM. + public static ScmType Vstsrm { get; } = new ScmType(VstsrmValue); + /// Determines if two values are the same. + public static bool operator ==(ScmType left, ScmType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ScmType left, ScmType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ScmType(string value) => new ScmType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ScmType other && Equals(other); + /// + public bool Equals(ScmType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.Serialization.cs new file mode 100644 index 000000000000..201d34a1d527 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ServiceSpecification + { + internal static ServiceSpecification DeserializeServiceSpecification(JsonElement element) + { + Optional> metricSpecifications = default; + Optional> logSpecifications = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("metricSpecifications")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MetricSpecification.DeserializeMetricSpecification(item)); + } + metricSpecifications = array; + continue; + } + if (property.NameEquals("logSpecifications")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LogSpecification.DeserializeLogSpecification(item)); + } + logSpecifications = array; + continue; + } + } + return new ServiceSpecification(Optional.ToList(metricSpecifications), Optional.ToList(logSpecifications)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.cs index 5fa815145211..5a9ff4d0457d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.cs @@ -1,58 +1,35 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Resource metrics service provided by Microsoft.Insights resource - /// provider. - /// + /// Resource metrics service provided by Microsoft.Insights resource provider. public partial class ServiceSpecification { - /// - /// Initializes a new instance of the ServiceSpecification class. - /// - public ServiceSpecification() + /// Initializes a new instance of ServiceSpecification. + internal ServiceSpecification() { - CustomInit(); + MetricSpecifications = new ChangeTrackingList(); + LogSpecifications = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the ServiceSpecification class. - /// - public ServiceSpecification(IList metricSpecifications = default(IList), IList logSpecifications = default(IList)) + /// Initializes a new instance of ServiceSpecification. + /// . + /// . + internal ServiceSpecification(IReadOnlyList metricSpecifications, IReadOnlyList logSpecifications) { MetricSpecifications = metricSpecifications; LogSpecifications = logSpecifications; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "metricSpecifications")] - public IList MetricSpecifications { get; set; } - - /// - /// - [JsonProperty(PropertyName = "logSpecifications")] - public IList LogSpecifications { get; set; } - + public IReadOnlyList MetricSpecifications { get; } + public IReadOnlyList LogSpecifications { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.Serialization.cs new file mode 100644 index 000000000000..7fd2d393e144 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.Serialization.cs @@ -0,0 +1,657 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Site : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + writer.WriteObjectValue(Identity); + } + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsCollectionDefined(HostNameSslStates)) + { + writer.WritePropertyName("hostNameSslStates"); + writer.WriteStartArray(); + foreach (var item in HostNameSslStates) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ServerFarmId)) + { + writer.WritePropertyName("serverFarmId"); + writer.WriteStringValue(ServerFarmId); + } + if (Optional.IsDefined(Reserved)) + { + writer.WritePropertyName("reserved"); + writer.WriteBooleanValue(Reserved.Value); + } + if (Optional.IsDefined(IsXenon)) + { + writer.WritePropertyName("isXenon"); + writer.WriteBooleanValue(IsXenon.Value); + } + if (Optional.IsDefined(HyperV)) + { + writer.WritePropertyName("hyperV"); + writer.WriteBooleanValue(HyperV.Value); + } + if (Optional.IsDefined(SiteConfig)) + { + writer.WritePropertyName("siteConfig"); + writer.WriteObjectValue(SiteConfig); + } + if (Optional.IsDefined(ScmSiteAlsoStopped)) + { + writer.WritePropertyName("scmSiteAlsoStopped"); + writer.WriteBooleanValue(ScmSiteAlsoStopped.Value); + } + if (Optional.IsDefined(HostingEnvironmentProfile)) + { + writer.WritePropertyName("hostingEnvironmentProfile"); + writer.WriteObjectValue(HostingEnvironmentProfile); + } + if (Optional.IsDefined(ClientAffinityEnabled)) + { + writer.WritePropertyName("clientAffinityEnabled"); + writer.WriteBooleanValue(ClientAffinityEnabled.Value); + } + if (Optional.IsDefined(ClientCertEnabled)) + { + writer.WritePropertyName("clientCertEnabled"); + writer.WriteBooleanValue(ClientCertEnabled.Value); + } + if (Optional.IsDefined(ClientCertMode)) + { + writer.WritePropertyName("clientCertMode"); + writer.WriteStringValue(ClientCertMode.Value.ToSerialString()); + } + if (Optional.IsDefined(ClientCertExclusionPaths)) + { + writer.WritePropertyName("clientCertExclusionPaths"); + writer.WriteStringValue(ClientCertExclusionPaths); + } + if (Optional.IsDefined(HostNamesDisabled)) + { + writer.WritePropertyName("hostNamesDisabled"); + writer.WriteBooleanValue(HostNamesDisabled.Value); + } + if (Optional.IsDefined(CustomDomainVerificationId)) + { + writer.WritePropertyName("customDomainVerificationId"); + writer.WriteStringValue(CustomDomainVerificationId); + } + if (Optional.IsDefined(ContainerSize)) + { + writer.WritePropertyName("containerSize"); + writer.WriteNumberValue(ContainerSize.Value); + } + if (Optional.IsDefined(DailyMemoryTimeQuota)) + { + writer.WritePropertyName("dailyMemoryTimeQuota"); + writer.WriteNumberValue(DailyMemoryTimeQuota.Value); + } + if (Optional.IsDefined(CloningInfo)) + { + writer.WritePropertyName("cloningInfo"); + writer.WriteObjectValue(CloningInfo); + } + if (Optional.IsDefined(HttpsOnly)) + { + writer.WritePropertyName("httpsOnly"); + writer.WriteBooleanValue(HttpsOnly.Value); + } + if (Optional.IsDefined(RedundancyMode)) + { + writer.WritePropertyName("redundancyMode"); + writer.WriteStringValue(RedundancyMode.Value.ToSerialString()); + } + if (Optional.IsDefined(StorageAccountRequired)) + { + writer.WritePropertyName("storageAccountRequired"); + writer.WriteBooleanValue(StorageAccountRequired.Value); + } + if (Optional.IsDefined(KeyVaultReferenceIdentity)) + { + writer.WritePropertyName("keyVaultReferenceIdentity"); + writer.WriteStringValue(KeyVaultReferenceIdentity); + } + if (Optional.IsDefined(VirtualNetworkSubnetId)) + { + writer.WritePropertyName("virtualNetworkSubnetId"); + writer.WriteStringValue(VirtualNetworkSubnetId); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Site DeserializeSite(JsonElement element) + { + Optional identity = default; + Optional id = default; + Optional name = default; + Optional kind = default; + string location = default; + Optional type = default; + Optional> tags = default; + Optional state = default; + Optional> hostNames = default; + Optional repositorySiteName = default; + Optional usageState = default; + Optional enabled = default; + Optional> enabledHostNames = default; + Optional availabilityState = default; + Optional> hostNameSslStates = default; + Optional serverFarmId = default; + Optional reserved = default; + Optional isXenon = default; + Optional hyperV = default; + Optional lastModifiedTimeUtc = default; + Optional siteConfig = default; + Optional> trafficManagerHostNames = default; + Optional scmSiteAlsoStopped = default; + Optional targetSwapSlot = default; + Optional hostingEnvironmentProfile = default; + Optional clientAffinityEnabled = default; + Optional clientCertEnabled = default; + Optional clientCertMode = default; + Optional clientCertExclusionPaths = default; + Optional hostNamesDisabled = default; + Optional customDomainVerificationId = default; + Optional outboundIpAddresses = default; + Optional possibleOutboundIpAddresses = default; + Optional containerSize = default; + Optional dailyMemoryTimeQuota = default; + Optional suspendedTill = default; + Optional maxNumberOfWorkers = default; + Optional cloningInfo = default; + Optional resourceGroup = default; + Optional isDefaultContainer = default; + Optional defaultHostName = default; + Optional slotSwapStatus = default; + Optional httpsOnly = default; + Optional redundancyMode = default; + Optional inProgressOperationId = default; + Optional storageAccountRequired = default; + Optional keyVaultReferenceIdentity = default; + Optional virtualNetworkSubnetId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("state")) + { + state = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + hostNames = array; + continue; + } + if (property0.NameEquals("repositorySiteName")) + { + repositorySiteName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("usageState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + usageState = property0.Value.GetString().ToUsageState(); + continue; + } + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("enabledHostNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + enabledHostNames = array; + continue; + } + if (property0.NameEquals("availabilityState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + availabilityState = property0.Value.GetString().ToSiteAvailabilityState(); + continue; + } + if (property0.NameEquals("hostNameSslStates")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(HostNameSslState.DeserializeHostNameSslState(item)); + } + hostNameSslStates = array; + continue; + } + if (property0.NameEquals("serverFarmId")) + { + serverFarmId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("reserved")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + reserved = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("isXenon")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isXenon = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("hyperV")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hyperV = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("lastModifiedTimeUtc")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + lastModifiedTimeUtc = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("siteConfig")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + siteConfig = SiteConfig.DeserializeSiteConfig(property0.Value); + continue; + } + if (property0.NameEquals("trafficManagerHostNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + trafficManagerHostNames = array; + continue; + } + if (property0.NameEquals("scmSiteAlsoStopped")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + scmSiteAlsoStopped = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("targetSwapSlot")) + { + targetSwapSlot = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostingEnvironmentProfile")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); + continue; + } + if (property0.NameEquals("clientAffinityEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + clientAffinityEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("clientCertEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + clientCertEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("clientCertMode")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + clientCertMode = property0.Value.GetString().ToClientCertMode(); + continue; + } + if (property0.NameEquals("clientCertExclusionPaths")) + { + clientCertExclusionPaths = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostNamesDisabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hostNamesDisabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("customDomainVerificationId")) + { + customDomainVerificationId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("outboundIpAddresses")) + { + outboundIpAddresses = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("possibleOutboundIpAddresses")) + { + possibleOutboundIpAddresses = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("containerSize")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + containerSize = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("dailyMemoryTimeQuota")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + dailyMemoryTimeQuota = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("suspendedTill")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + suspendedTill = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("maxNumberOfWorkers")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + maxNumberOfWorkers = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("cloningInfo")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + cloningInfo = CloningInfo.DeserializeCloningInfo(property0.Value); + continue; + } + if (property0.NameEquals("resourceGroup")) + { + resourceGroup = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("isDefaultContainer")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isDefaultContainer = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("defaultHostName")) + { + defaultHostName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("slotSwapStatus")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + slotSwapStatus = SlotSwapStatus.DeserializeSlotSwapStatus(property0.Value); + continue; + } + if (property0.NameEquals("httpsOnly")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + httpsOnly = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("redundancyMode")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + redundancyMode = property0.Value.GetString().ToRedundancyMode(); + continue; + } + if (property0.NameEquals("inProgressOperationId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + inProgressOperationId = property0.Value.GetGuid(); + continue; + } + if (property0.NameEquals("storageAccountRequired")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + storageAccountRequired = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("keyVaultReferenceIdentity")) + { + keyVaultReferenceIdentity = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("virtualNetworkSubnetId")) + { + virtualNetworkSubnetId = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new Site(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), identity.Value, state.Value, Optional.ToList(hostNames), repositorySiteName.Value, Optional.ToNullable(usageState), Optional.ToNullable(enabled), Optional.ToList(enabledHostNames), Optional.ToNullable(availabilityState), Optional.ToList(hostNameSslStates), serverFarmId.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(lastModifiedTimeUtc), siteConfig.Value, Optional.ToList(trafficManagerHostNames), Optional.ToNullable(scmSiteAlsoStopped), targetSwapSlot.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(clientAffinityEnabled), Optional.ToNullable(clientCertEnabled), Optional.ToNullable(clientCertMode), clientCertExclusionPaths.Value, Optional.ToNullable(hostNamesDisabled), customDomainVerificationId.Value, outboundIpAddresses.Value, possibleOutboundIpAddresses.Value, Optional.ToNullable(containerSize), Optional.ToNullable(dailyMemoryTimeQuota), Optional.ToNullable(suspendedTill), Optional.ToNullable(maxNumberOfWorkers), cloningInfo.Value, resourceGroup.Value, Optional.ToNullable(isDefaultContainer), defaultHostName.Value, slotSwapStatus.Value, Optional.ToNullable(httpsOnly), Optional.ToNullable(redundancyMode), Optional.ToNullable(inProgressOperationId), Optional.ToNullable(storageAccountRequired), keyVaultReferenceIdentity.Value, virtualNetworkSubnetId.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs index 5a5d96d804c3..8b089f4af305 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs @@ -1,148 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A web app, a mobile app backend, or an API app. - /// - [Rest.Serialization.JsonTransformation] + /// A web app, a mobile app backend, or an API app. public partial class Site : Resource { - /// - /// Initializes a new instance of the Site class. - /// - public Site() + /// Initializes a new instance of Site. + /// Resource Location. + /// is null. + public Site(string location) : base(location) { - CustomInit(); + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + HostNames = new ChangeTrackingList(); + EnabledHostNames = new ChangeTrackingList(); + HostNameSslStates = new ChangeTrackingList(); + TrafficManagerHostNames = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the Site class. - /// - /// Resource Location. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Resource tags. - /// Current state of the app. - /// Hostnames associated with the app. - /// Name of the repository - /// site. - /// State indicating whether the app has - /// exceeded its quota usage. Read-only. Possible values include: - /// 'Normal', 'Exceeded' - /// <code>true</code> if the app is - /// enabled; otherwise, <code>false</code>. Setting this - /// value to false disables the app (takes the app offline). - /// Enabled hostnames for the - /// app.Hostnames need to be assigned (see HostNames) AND enabled. - /// Otherwise, - /// the app is not served on those hostnames. - /// Management information availability - /// state for the app. Possible values include: 'Normal', 'Limited', - /// 'DisasterRecoveryMode' - /// Hostname SSL states are used to - /// manage the SSL bindings for app's hostnames. - /// Resource ID of the associated App - /// Service plan, formatted as: - /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - /// <code>true</code> if reserved; - /// otherwise, <code>false</code>. - /// Obsolete: Hyper-V sandbox. - /// Hyper-V sandbox. - /// Last time the app was modified, - /// in UTC. Read-only. - /// Configuration of the app. - /// Azure Traffic Manager - /// hostnames associated with the app. Read-only. - /// <code>true</code> to - /// stop SCM (KUDU) site when the app is stopped; otherwise, - /// <code>false</code>. The default is - /// <code>false</code>. - /// Specifies which deployment slot this - /// app will swap into. Read-only. - /// App Service Environment to - /// use for the app. - /// <code>true</code> - /// to enable client affinity; <code>false</code> to stop - /// sending session affinity cookies, which route client requests in - /// the same session to the same instance. Default is - /// <code>true</code>. - /// <code>true</code> to - /// enable client certificate authentication (TLS mutual - /// authentication); otherwise, <code>false</code>. Default - /// is <code>false</code>. - /// This composes with ClientCertEnabled - /// setting. + /// Initializes a new instance of Site. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource Location. + /// Resource type. + /// Resource tags. + /// Managed service identity. + /// Current state of the app. + /// Hostnames associated with the app. + /// Name of the repository site. + /// State indicating whether the app has exceeded its quota usage. Read-only. + /// <code>true</code> if the app is enabled; otherwise, <code>false</code>. Setting this value to false disables the app (takes the app offline). + /// + /// Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, + /// the app is not served on those hostnames. + /// + /// Management information availability state for the app. + /// Hostname SSL states are used to manage the SSL bindings for app's hostnames. + /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + /// <code>true</code> if reserved; otherwise, <code>false</code>. + /// Obsolete: Hyper-V sandbox. + /// Hyper-V sandbox. + /// Last time the app was modified, in UTC. Read-only. + /// Configuration of the app. + /// Azure Traffic Manager hostnames associated with the app. Read-only. + /// <code>true</code> to stop SCM (KUDU) site when the app is stopped; otherwise, <code>false</code>. The default is <code>false</code>. + /// Specifies which deployment slot this app will swap into. Read-only. + /// App Service Environment to use for the app. + /// <code>true</code> to enable client affinity; <code>false</code> to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is <code>true</code>. + /// <code>true</code> to enable client certificate authentication (TLS mutual authentication); otherwise, <code>false</code>. Default is <code>false</code>. + /// + /// This composes with ClientCertEnabled setting. /// - ClientCertEnabled: false means ClientCert is ignored. - /// - ClientCertEnabled: true and ClientCertMode: Required means - /// ClientCert is required. - /// - ClientCertEnabled: true and ClientCertMode: Optional means - /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional' - /// client certificate - /// authentication comma-separated exclusion paths - /// <code>true</code> to - /// disable the public hostnames of the app; otherwise, - /// <code>false</code>. - /// If <code>true</code>, the app is only accessible via - /// API management process. - /// Unique identifier that - /// verifies the custom domains assigned to the app. Customer will add - /// this id to a txt record for verification. - /// List of IP addresses that the app - /// uses for outbound connections (e.g. database access). Includes VIPs - /// from tenants that site can be hosted with current settings. - /// Read-only. - /// List of IP addresses that - /// the app uses for outbound connections (e.g. database access). - /// Includes VIPs from all tenants except dataComponent. - /// Read-only. - /// Size of the function container. - /// Maximum allowed daily - /// memory-time quota (applicable on dynamic apps only). - /// App suspended till in case memory-time - /// quota is exceeded. - /// Maximum number of workers. - /// This only applies to Functions container. - /// If specified during app creation, the app - /// is cloned from a source app. - /// Name of the resource group the app - /// belongs to. Read-only. - /// <code>true</code> if - /// the app is a default container; otherwise, - /// <code>false</code>. - /// Default hostname of the app. - /// Read-only. - /// Status of the last deployment slot - /// swap operation. - /// HttpsOnly: configures a web site to accept - /// only https requests. Issues redirect for - /// http requests - /// Site redundancy mode. Possible values - /// include: 'None', 'Manual', 'Failover', 'ActiveActive', - /// 'GeoRedundant' - /// Specifies an operation id if - /// this site has a pending operation. - public Site(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) - : base(location, id, name, kind, type, tags) + /// - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + /// - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. + /// + /// client certificate authentication comma-separated exclusion paths. + /// + /// <code>true</code> to disable the public hostnames of the app; otherwise, <code>false</code>. + /// If <code>true</code>, the app is only accessible via API management process. + /// + /// Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. + /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. + /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. + /// Size of the function container. + /// Maximum allowed daily memory-time quota (applicable on dynamic apps only). + /// App suspended till in case memory-time quota is exceeded. + /// + /// Maximum number of workers. + /// This only applies to Functions container. + /// + /// If specified during app creation, the app is cloned from a source app. + /// Name of the resource group the app belongs to. Read-only. + /// <code>true</code> if the app is a default container; otherwise, <code>false</code>. + /// Default hostname of the app. Read-only. + /// Status of the last deployment slot swap operation. + /// + /// HttpsOnly: configures a web site to accept only https requests. Issues redirect for + /// http requests. + /// + /// Site redundancy mode. + /// Specifies an operation id if this site has a pending operation. + /// Checks if Customer provided storage account is required. + /// Identity to use for Key Vault Reference authentication. + /// + /// Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. + /// This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + /// + internal Site(string id, string name, string kind, string location, string type, IDictionary tags, ManagedServiceIdentity identity, string state, IReadOnlyList hostNames, string repositorySiteName, UsageState? usageState, bool? enabled, IReadOnlyList enabledHostNames, SiteAvailabilityState? availabilityState, IList hostNameSslStates, string serverFarmId, bool? reserved, bool? isXenon, bool? hyperV, DateTimeOffset? lastModifiedTimeUtc, SiteConfig siteConfig, IReadOnlyList trafficManagerHostNames, bool? scmSiteAlsoStopped, string targetSwapSlot, HostingEnvironmentProfile hostingEnvironmentProfile, bool? clientAffinityEnabled, bool? clientCertEnabled, ClientCertMode? clientCertMode, string clientCertExclusionPaths, bool? hostNamesDisabled, string customDomainVerificationId, string outboundIpAddresses, string possibleOutboundIpAddresses, int? containerSize, int? dailyMemoryTimeQuota, DateTimeOffset? suspendedTill, int? maxNumberOfWorkers, CloningInfo cloningInfo, string resourceGroup, bool? isDefaultContainer, string defaultHostName, SlotSwapStatus slotSwapStatus, bool? httpsOnly, RedundancyMode? redundancyMode, Guid? inProgressOperationId, bool? storageAccountRequired, string keyVaultReferenceIdentity, string virtualNetworkSubnetId) : base(id, name, kind, location, type, tags) { + Identity = identity; State = state; HostNames = hostNames; RepositorySiteName = repositorySiteName; @@ -181,318 +140,114 @@ public Site() HttpsOnly = httpsOnly; RedundancyMode = redundancyMode; InProgressOperationId = inProgressOperationId; - Identity = identity; - CustomInit(); + StorageAccountRequired = storageAccountRequired; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + VirtualNetworkSubnetId = virtualNetworkSubnetId; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets current state of the app. - /// - [JsonProperty(PropertyName = "properties.state")] - public string State { get; private set; } - - /// - /// Gets hostnames associated with the app. - /// - [JsonProperty(PropertyName = "properties.hostNames")] - public IList HostNames { get; private set; } - - /// - /// Gets name of the repository site. - /// - [JsonProperty(PropertyName = "properties.repositorySiteName")] - public string RepositorySiteName { get; private set; } - - /// - /// Gets state indicating whether the app has exceeded its quota usage. - /// Read-only. Possible values include: 'Normal', 'Exceeded' - /// - [JsonProperty(PropertyName = "properties.usageState")] - public UsageState? UsageState { get; private set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// app is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. Setting this value - /// to false disables the app (takes the app offline). - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// Managed service identity. + public ManagedServiceIdentity Identity { get; set; } + /// Current state of the app. + public string State { get; } + /// Hostnames associated with the app. + public IReadOnlyList HostNames { get; } + /// Name of the repository site. + public string RepositorySiteName { get; } + /// State indicating whether the app has exceeded its quota usage. Read-only. + public UsageState? UsageState { get; } + /// <code>true</code> if the app is enabled; otherwise, <code>false</code>. Setting this value to false disables the app (takes the app offline). public bool? Enabled { get; set; } - /// - /// Gets enabled hostnames for the app.Hostnames need to be assigned - /// (see HostNames) AND enabled. Otherwise, + /// Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, /// the app is not served on those hostnames. /// - [JsonProperty(PropertyName = "properties.enabledHostNames")] - public IList EnabledHostNames { get; private set; } - - /// - /// Gets management information availability state for the app. - /// Possible values include: 'Normal', 'Limited', - /// 'DisasterRecoveryMode' - /// - [JsonProperty(PropertyName = "properties.availabilityState")] - public SiteAvailabilityState? AvailabilityState { get; private set; } - - /// - /// Gets or sets hostname SSL states are used to manage the SSL - /// bindings for app's hostnames. - /// - [JsonProperty(PropertyName = "properties.hostNameSslStates")] - public IList HostNameSslStates { get; set; } - - /// - /// Gets or sets resource ID of the associated App Service plan, - /// formatted as: - /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - /// - [JsonProperty(PropertyName = "properties.serverFarmId")] + public IReadOnlyList EnabledHostNames { get; } + /// Management information availability state for the app. + public SiteAvailabilityState? AvailabilityState { get; } + /// Hostname SSL states are used to manage the SSL bindings for app's hostnames. + public IList HostNameSslStates { get; } + /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". public string ServerFarmId { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// reserved; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.reserved")] + /// <code>true</code> if reserved; otherwise, <code>false</code>. public bool? Reserved { get; set; } - - /// - /// Gets or sets obsolete: Hyper-V sandbox. - /// - [JsonProperty(PropertyName = "properties.isXenon")] + /// Obsolete: Hyper-V sandbox. public bool? IsXenon { get; set; } - - /// - /// Gets or sets hyper-V sandbox. - /// - [JsonProperty(PropertyName = "properties.hyperV")] + /// Hyper-V sandbox. public bool? HyperV { get; set; } - - /// - /// Gets last time the app was modified, in UTC. Read-only. - /// - [JsonProperty(PropertyName = "properties.lastModifiedTimeUtc")] - public System.DateTime? LastModifiedTimeUtc { get; private set; } - - /// - /// Gets or sets configuration of the app. - /// - [JsonProperty(PropertyName = "properties.siteConfig")] + /// Last time the app was modified, in UTC. Read-only. + public DateTimeOffset? LastModifiedTimeUtc { get; } + /// Configuration of the app. public SiteConfig SiteConfig { get; set; } - - /// - /// Gets azure Traffic Manager hostnames associated with the app. - /// Read-only. - /// - [JsonProperty(PropertyName = "properties.trafficManagerHostNames")] - public IList TrafficManagerHostNames { get; private set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to stop - /// SCM (KUDU) site when the app is stopped; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. The default is - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.scmSiteAlsoStopped")] + /// Azure Traffic Manager hostnames associated with the app. Read-only. + public IReadOnlyList TrafficManagerHostNames { get; } + /// <code>true</code> to stop SCM (KUDU) site when the app is stopped; otherwise, <code>false</code>. The default is <code>false</code>. public bool? ScmSiteAlsoStopped { get; set; } - - /// - /// Gets specifies which deployment slot this app will swap into. - /// Read-only. - /// - [JsonProperty(PropertyName = "properties.targetSwapSlot")] - public string TargetSwapSlot { get; private set; } - - /// - /// Gets or sets app Service Environment to use for the app. - /// - [JsonProperty(PropertyName = "properties.hostingEnvironmentProfile")] + /// Specifies which deployment slot this app will swap into. Read-only. + public string TargetSwapSlot { get; } + /// App Service Environment to use for the app. public HostingEnvironmentProfile HostingEnvironmentProfile { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// enable client affinity; - /// &lt;code&gt;false&lt;/code&gt; to stop sending - /// session affinity cookies, which route client requests in the same - /// session to the same instance. Default is - /// &lt;code&gt;true&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.clientAffinityEnabled")] + /// <code>true</code> to enable client affinity; <code>false</code> to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is <code>true</code>. public bool? ClientAffinityEnabled { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// enable client certificate authentication (TLS mutual - /// authentication); otherwise, - /// &lt;code&gt;false&lt;/code&gt;. Default is - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.clientCertEnabled")] + /// <code>true</code> to enable client certificate authentication (TLS mutual authentication); otherwise, <code>false</code>. Default is <code>false</code>. public bool? ClientCertEnabled { get; set; } - /// - /// Gets or sets this composes with ClientCertEnabled setting. + /// This composes with ClientCertEnabled setting. /// - ClientCertEnabled: false means ClientCert is ignored. - /// - ClientCertEnabled: true and ClientCertMode: Required means - /// ClientCert is required. - /// - ClientCertEnabled: true and ClientCertMode: Optional means - /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional' + /// - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + /// - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. /// - [JsonProperty(PropertyName = "properties.clientCertMode")] public ClientCertMode? ClientCertMode { get; set; } - - /// - /// Gets or sets client certificate authentication comma-separated - /// exclusion paths - /// - [JsonProperty(PropertyName = "properties.clientCertExclusionPaths")] + /// client certificate authentication comma-separated exclusion paths. public string ClientCertExclusionPaths { get; set; } - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// disable the public hostnames of the app; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// If &lt;code&gt;true&lt;/code&gt;, the app is only - /// accessible via API management process. + /// <code>true</code> to disable the public hostnames of the app; otherwise, <code>false</code>. + /// If <code>true</code>, the app is only accessible via API management process. /// - [JsonProperty(PropertyName = "properties.hostNamesDisabled")] public bool? HostNamesDisabled { get; set; } - - /// - /// Gets or sets unique identifier that verifies the custom domains - /// assigned to the app. Customer will add this id to a txt record for - /// verification. - /// - [JsonProperty(PropertyName = "properties.customDomainVerificationId")] + /// Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. public string CustomDomainVerificationId { get; set; } - - /// - /// Gets list of IP addresses that the app uses for outbound - /// connections (e.g. database access). Includes VIPs from tenants that - /// site can be hosted with current settings. Read-only. - /// - [JsonProperty(PropertyName = "properties.outboundIpAddresses")] - public string OutboundIpAddresses { get; private set; } - - /// - /// Gets list of IP addresses that the app uses for outbound - /// connections (e.g. database access). Includes VIPs from all tenants - /// except dataComponent. Read-only. - /// - [JsonProperty(PropertyName = "properties.possibleOutboundIpAddresses")] - public string PossibleOutboundIpAddresses { get; private set; } - - /// - /// Gets or sets size of the function container. - /// - [JsonProperty(PropertyName = "properties.containerSize")] + /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. + public string OutboundIpAddresses { get; } + /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. + public string PossibleOutboundIpAddresses { get; } + /// Size of the function container. public int? ContainerSize { get; set; } - - /// - /// Gets or sets maximum allowed daily memory-time quota (applicable on - /// dynamic apps only). - /// - [JsonProperty(PropertyName = "properties.dailyMemoryTimeQuota")] + /// Maximum allowed daily memory-time quota (applicable on dynamic apps only). public int? DailyMemoryTimeQuota { get; set; } - + /// App suspended till in case memory-time quota is exceeded. + public DateTimeOffset? SuspendedTill { get; } /// - /// Gets app suspended till in case memory-time quota is exceeded. - /// - [JsonProperty(PropertyName = "properties.suspendedTill")] - public System.DateTime? SuspendedTill { get; private set; } - - /// - /// Gets maximum number of workers. + /// Maximum number of workers. /// This only applies to Functions container. /// - [JsonProperty(PropertyName = "properties.maxNumberOfWorkers")] - public int? MaxNumberOfWorkers { get; private set; } - - /// - /// Gets or sets if specified during app creation, the app is cloned - /// from a source app. - /// - [JsonProperty(PropertyName = "properties.cloningInfo")] + public int? MaxNumberOfWorkers { get; } + /// If specified during app creation, the app is cloned from a source app. public CloningInfo CloningInfo { get; set; } - - /// - /// Gets name of the resource group the app belongs to. Read-only. + /// Name of the resource group the app belongs to. Read-only. + public string ResourceGroup { get; } + /// <code>true</code> if the app is a default container; otherwise, <code>false</code>. + public bool? IsDefaultContainer { get; } + /// Default hostname of the app. Read-only. + public string DefaultHostName { get; } + /// Status of the last deployment slot swap operation. + public SlotSwapStatus SlotSwapStatus { get; } + /// + /// HttpsOnly: configures a web site to accept only https requests. Issues redirect for + /// http requests. /// - [JsonProperty(PropertyName = "properties.resourceGroup")] - public string ResourceGroup { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the app is a - /// default container; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.isDefaultContainer")] - public bool? IsDefaultContainer { get; private set; } - - /// - /// Gets default hostname of the app. Read-only. - /// - [JsonProperty(PropertyName = "properties.defaultHostName")] - public string DefaultHostName { get; private set; } - - /// - /// Gets status of the last deployment slot swap operation. - /// - [JsonProperty(PropertyName = "properties.slotSwapStatus")] - public SlotSwapStatus SlotSwapStatus { get; private set; } - - /// - /// Gets or sets httpsOnly: configures a web site to accept only https - /// requests. Issues redirect for - /// http requests - /// - [JsonProperty(PropertyName = "properties.httpsOnly")] public bool? HttpsOnly { get; set; } - - /// - /// Gets or sets site redundancy mode. Possible values include: 'None', - /// 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' - /// - [JsonProperty(PropertyName = "properties.redundancyMode")] + /// Site redundancy mode. public RedundancyMode? RedundancyMode { get; set; } - - /// - /// Gets specifies an operation id if this site has a pending - /// operation. - /// - [JsonProperty(PropertyName = "properties.inProgressOperationId")] - public System.Guid? InProgressOperationId { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "identity")] - public ManagedServiceIdentity Identity { get; set; } - + /// Specifies an operation id if this site has a pending operation. + public Guid? InProgressOperationId { get; } + /// Checks if Customer provided storage account is required. + public bool? StorageAccountRequired { get; set; } + /// Identity to use for Key Vault Reference authentication. + public string KeyVaultReferenceIdentity { get; set; } /// - /// Validate the object. + /// Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. + /// This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (SiteConfig != null) - { - SiteConfig.Validate(); - } - if (CloningInfo != null) - { - CloningInfo.Validate(); - } - } + public string VirtualNetworkSubnetId { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.Serialization.cs new file mode 100644 index 000000000000..f818556ff007 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.Serialization.cs @@ -0,0 +1,627 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteAuthSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(RuntimeVersion)) + { + writer.WritePropertyName("runtimeVersion"); + writer.WriteStringValue(RuntimeVersion); + } + if (Optional.IsDefined(UnauthenticatedClientAction)) + { + writer.WritePropertyName("unauthenticatedClientAction"); + writer.WriteStringValue(UnauthenticatedClientAction.Value.ToSerialString()); + } + if (Optional.IsDefined(TokenStoreEnabled)) + { + writer.WritePropertyName("tokenStoreEnabled"); + writer.WriteBooleanValue(TokenStoreEnabled.Value); + } + if (Optional.IsCollectionDefined(AllowedExternalRedirectUrls)) + { + writer.WritePropertyName("allowedExternalRedirectUrls"); + writer.WriteStartArray(); + foreach (var item in AllowedExternalRedirectUrls) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DefaultProvider)) + { + writer.WritePropertyName("defaultProvider"); + writer.WriteStringValue(DefaultProvider.Value.ToSerialString()); + } + if (Optional.IsDefined(TokenRefreshExtensionHours)) + { + writer.WritePropertyName("tokenRefreshExtensionHours"); + writer.WriteNumberValue(TokenRefreshExtensionHours.Value); + } + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"); + writer.WriteStringValue(ClientId); + } + if (Optional.IsDefined(ClientSecret)) + { + writer.WritePropertyName("clientSecret"); + writer.WriteStringValue(ClientSecret); + } + if (Optional.IsDefined(ClientSecretSettingName)) + { + writer.WritePropertyName("clientSecretSettingName"); + writer.WriteStringValue(ClientSecretSettingName); + } + if (Optional.IsDefined(ClientSecretCertificateThumbprint)) + { + writer.WritePropertyName("clientSecretCertificateThumbprint"); + writer.WriteStringValue(ClientSecretCertificateThumbprint); + } + if (Optional.IsDefined(Issuer)) + { + writer.WritePropertyName("issuer"); + writer.WriteStringValue(Issuer); + } + if (Optional.IsDefined(ValidateIssuer)) + { + writer.WritePropertyName("validateIssuer"); + writer.WriteBooleanValue(ValidateIssuer.Value); + } + if (Optional.IsCollectionDefined(AllowedAudiences)) + { + writer.WritePropertyName("allowedAudiences"); + writer.WriteStartArray(); + foreach (var item in AllowedAudiences) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AdditionalLoginParams)) + { + writer.WritePropertyName("additionalLoginParams"); + writer.WriteStartArray(); + foreach (var item in AdditionalLoginParams) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AadClaimsAuthorization)) + { + writer.WritePropertyName("aadClaimsAuthorization"); + writer.WriteStringValue(AadClaimsAuthorization); + } + if (Optional.IsDefined(GoogleClientId)) + { + writer.WritePropertyName("googleClientId"); + writer.WriteStringValue(GoogleClientId); + } + if (Optional.IsDefined(GoogleClientSecret)) + { + writer.WritePropertyName("googleClientSecret"); + writer.WriteStringValue(GoogleClientSecret); + } + if (Optional.IsDefined(GoogleClientSecretSettingName)) + { + writer.WritePropertyName("googleClientSecretSettingName"); + writer.WriteStringValue(GoogleClientSecretSettingName); + } + if (Optional.IsCollectionDefined(GoogleOAuthScopes)) + { + writer.WritePropertyName("googleOAuthScopes"); + writer.WriteStartArray(); + foreach (var item in GoogleOAuthScopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(FacebookAppId)) + { + writer.WritePropertyName("facebookAppId"); + writer.WriteStringValue(FacebookAppId); + } + if (Optional.IsDefined(FacebookAppSecret)) + { + writer.WritePropertyName("facebookAppSecret"); + writer.WriteStringValue(FacebookAppSecret); + } + if (Optional.IsDefined(FacebookAppSecretSettingName)) + { + writer.WritePropertyName("facebookAppSecretSettingName"); + writer.WriteStringValue(FacebookAppSecretSettingName); + } + if (Optional.IsCollectionDefined(FacebookOAuthScopes)) + { + writer.WritePropertyName("facebookOAuthScopes"); + writer.WriteStartArray(); + foreach (var item in FacebookOAuthScopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(GitHubClientId)) + { + writer.WritePropertyName("gitHubClientId"); + writer.WriteStringValue(GitHubClientId); + } + if (Optional.IsDefined(GitHubClientSecret)) + { + writer.WritePropertyName("gitHubClientSecret"); + writer.WriteStringValue(GitHubClientSecret); + } + if (Optional.IsDefined(GitHubClientSecretSettingName)) + { + writer.WritePropertyName("gitHubClientSecretSettingName"); + writer.WriteStringValue(GitHubClientSecretSettingName); + } + if (Optional.IsCollectionDefined(GitHubOAuthScopes)) + { + writer.WritePropertyName("gitHubOAuthScopes"); + writer.WriteStartArray(); + foreach (var item in GitHubOAuthScopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(TwitterConsumerKey)) + { + writer.WritePropertyName("twitterConsumerKey"); + writer.WriteStringValue(TwitterConsumerKey); + } + if (Optional.IsDefined(TwitterConsumerSecret)) + { + writer.WritePropertyName("twitterConsumerSecret"); + writer.WriteStringValue(TwitterConsumerSecret); + } + if (Optional.IsDefined(TwitterConsumerSecretSettingName)) + { + writer.WritePropertyName("twitterConsumerSecretSettingName"); + writer.WriteStringValue(TwitterConsumerSecretSettingName); + } + if (Optional.IsDefined(MicrosoftAccountClientId)) + { + writer.WritePropertyName("microsoftAccountClientId"); + writer.WriteStringValue(MicrosoftAccountClientId); + } + if (Optional.IsDefined(MicrosoftAccountClientSecret)) + { + writer.WritePropertyName("microsoftAccountClientSecret"); + writer.WriteStringValue(MicrosoftAccountClientSecret); + } + if (Optional.IsDefined(MicrosoftAccountClientSecretSettingName)) + { + writer.WritePropertyName("microsoftAccountClientSecretSettingName"); + writer.WriteStringValue(MicrosoftAccountClientSecretSettingName); + } + if (Optional.IsCollectionDefined(MicrosoftAccountOAuthScopes)) + { + writer.WritePropertyName("microsoftAccountOAuthScopes"); + writer.WriteStartArray(); + foreach (var item in MicrosoftAccountOAuthScopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IsAuthFromFile)) + { + writer.WritePropertyName("isAuthFromFile"); + writer.WriteStringValue(IsAuthFromFile); + } + if (Optional.IsDefined(AuthFilePath)) + { + writer.WritePropertyName("authFilePath"); + writer.WriteStringValue(AuthFilePath); + } + if (Optional.IsDefined(ConfigVersion)) + { + writer.WritePropertyName("configVersion"); + writer.WriteStringValue(ConfigVersion); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SiteAuthSettings DeserializeSiteAuthSettings(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional runtimeVersion = default; + Optional unauthenticatedClientAction = default; + Optional tokenStoreEnabled = default; + Optional> allowedExternalRedirectUrls = default; + Optional defaultProvider = default; + Optional tokenRefreshExtensionHours = default; + Optional clientId = default; + Optional clientSecret = default; + Optional clientSecretSettingName = default; + Optional clientSecretCertificateThumbprint = default; + Optional issuer = default; + Optional validateIssuer = default; + Optional> allowedAudiences = default; + Optional> additionalLoginParams = default; + Optional aadClaimsAuthorization = default; + Optional googleClientId = default; + Optional googleClientSecret = default; + Optional googleClientSecretSettingName = default; + Optional> googleOAuthScopes = default; + Optional facebookAppId = default; + Optional facebookAppSecret = default; + Optional facebookAppSecretSettingName = default; + Optional> facebookOAuthScopes = default; + Optional gitHubClientId = default; + Optional gitHubClientSecret = default; + Optional gitHubClientSecretSettingName = default; + Optional> gitHubOAuthScopes = default; + Optional twitterConsumerKey = default; + Optional twitterConsumerSecret = default; + Optional twitterConsumerSecretSettingName = default; + Optional microsoftAccountClientId = default; + Optional microsoftAccountClientSecret = default; + Optional microsoftAccountClientSecretSettingName = default; + Optional> microsoftAccountOAuthScopes = default; + Optional isAuthFromFile = default; + Optional authFilePath = default; + Optional configVersion = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("runtimeVersion")) + { + runtimeVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("unauthenticatedClientAction")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + unauthenticatedClientAction = property0.Value.GetString().ToUnauthenticatedClientAction(); + continue; + } + if (property0.NameEquals("tokenStoreEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + tokenStoreEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("allowedExternalRedirectUrls")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedExternalRedirectUrls = array; + continue; + } + if (property0.NameEquals("defaultProvider")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + defaultProvider = property0.Value.GetString().ToBuiltInAuthenticationProvider(); + continue; + } + if (property0.NameEquals("tokenRefreshExtensionHours")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + tokenRefreshExtensionHours = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("clientId")) + { + clientId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientSecret")) + { + clientSecret = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientSecretSettingName")) + { + clientSecretSettingName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientSecretCertificateThumbprint")) + { + clientSecretCertificateThumbprint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("issuer")) + { + issuer = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("validateIssuer")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + validateIssuer = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("allowedAudiences")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedAudiences = array; + continue; + } + if (property0.NameEquals("additionalLoginParams")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + additionalLoginParams = array; + continue; + } + if (property0.NameEquals("aadClaimsAuthorization")) + { + aadClaimsAuthorization = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("googleClientId")) + { + googleClientId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("googleClientSecret")) + { + googleClientSecret = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("googleClientSecretSettingName")) + { + googleClientSecretSettingName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("googleOAuthScopes")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + googleOAuthScopes = array; + continue; + } + if (property0.NameEquals("facebookAppId")) + { + facebookAppId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("facebookAppSecret")) + { + facebookAppSecret = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("facebookAppSecretSettingName")) + { + facebookAppSecretSettingName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("facebookOAuthScopes")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + facebookOAuthScopes = array; + continue; + } + if (property0.NameEquals("gitHubClientId")) + { + gitHubClientId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("gitHubClientSecret")) + { + gitHubClientSecret = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("gitHubClientSecretSettingName")) + { + gitHubClientSecretSettingName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("gitHubOAuthScopes")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + gitHubOAuthScopes = array; + continue; + } + if (property0.NameEquals("twitterConsumerKey")) + { + twitterConsumerKey = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("twitterConsumerSecret")) + { + twitterConsumerSecret = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("twitterConsumerSecretSettingName")) + { + twitterConsumerSecretSettingName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("microsoftAccountClientId")) + { + microsoftAccountClientId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("microsoftAccountClientSecret")) + { + microsoftAccountClientSecret = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("microsoftAccountClientSecretSettingName")) + { + microsoftAccountClientSecretSettingName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("microsoftAccountOAuthScopes")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + microsoftAccountOAuthScopes = array; + continue; + } + if (property0.NameEquals("isAuthFromFile")) + { + isAuthFromFile = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("authFilePath")) + { + authFilePath = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("configVersion")) + { + configVersion = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new SiteAuthSettings(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), runtimeVersion.Value, Optional.ToNullable(unauthenticatedClientAction), Optional.ToNullable(tokenStoreEnabled), Optional.ToList(allowedExternalRedirectUrls), Optional.ToNullable(defaultProvider), Optional.ToNullable(tokenRefreshExtensionHours), clientId.Value, clientSecret.Value, clientSecretSettingName.Value, clientSecretCertificateThumbprint.Value, issuer.Value, Optional.ToNullable(validateIssuer), Optional.ToList(allowedAudiences), Optional.ToList(additionalLoginParams), aadClaimsAuthorization.Value, googleClientId.Value, googleClientSecret.Value, googleClientSecretSettingName.Value, Optional.ToList(googleOAuthScopes), facebookAppId.Value, facebookAppSecret.Value, facebookAppSecretSettingName.Value, Optional.ToList(facebookOAuthScopes), gitHubClientId.Value, gitHubClientSecret.Value, gitHubClientSecretSettingName.Value, Optional.ToList(gitHubOAuthScopes), twitterConsumerKey.Value, twitterConsumerSecret.Value, twitterConsumerSecretSettingName.Value, microsoftAccountClientId.Value, microsoftAccountClientSecret.Value, microsoftAccountClientSecretSettingName.Value, Optional.ToList(microsoftAccountOAuthScopes), isAuthFromFile.Value, authFilePath.Value, configVersion.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs index a87bf293faac..1dbdc0c614e3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs @@ -1,212 +1,190 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Configuration settings for the Azure App Service Authentication / - /// Authorization feature. - /// - [Rest.Serialization.JsonTransformation] + /// Configuration settings for the Azure App Service Authentication / Authorization feature. public partial class SiteAuthSettings : ProxyOnlyResource { - /// - /// Initializes a new instance of the SiteAuthSettings class. - /// + /// Initializes a new instance of SiteAuthSettings. public SiteAuthSettings() { - CustomInit(); + AllowedExternalRedirectUrls = new ChangeTrackingList(); + AllowedAudiences = new ChangeTrackingList(); + AdditionalLoginParams = new ChangeTrackingList(); + GoogleOAuthScopes = new ChangeTrackingList(); + FacebookOAuthScopes = new ChangeTrackingList(); + GitHubOAuthScopes = new ChangeTrackingList(); + MicrosoftAccountOAuthScopes = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the SiteAuthSettings class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>true</code> if the - /// Authentication / Authorization feature is enabled for the current - /// app; otherwise, <code>false</code>. - /// The RuntimeVersion of the - /// Authentication / Authorization feature in use for the current app. - /// The setting in this value can control the behavior of certain - /// features in the Authentication / Authorization module. - /// The action to take when - /// an unauthenticated client attempts to access the app. Possible - /// values include: 'RedirectToLoginPage', 'AllowAnonymous' - /// <code>true</code> to - /// durably store platform-specific security tokens that are obtained - /// during login flows; otherwise, <code>false</code>. - /// The default is <code>false</code>. - /// External URLs that can be - /// redirected to as part of logging in or logging out of the app. Note - /// that the query string part of the URL is ignored. - /// This is an advanced setting typically only needed by Windows Store - /// application backends. - /// Note that URLs within the current domain are always implicitly - /// allowed. - /// The default authentication provider - /// to use when multiple providers are configured. - /// This setting is only needed if multiple providers are configured - /// and the unauthenticated client - /// action is set to "RedirectToLoginPage". Possible values include: - /// 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', - /// 'Twitter', 'Github' - /// The number of hours after - /// session token expiration that a session token can be used to - /// call the token refresh API. The default is 72 hours. - /// The Client ID of this relying party - /// application, known as the client_id. - /// This setting is required for enabling OpenID Connection - /// authentication with Azure Active Directory or + /// Initializes a new instance of SiteAuthSettings. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>true</code> if the Authentication / Authorization feature is enabled for the current app; otherwise, <code>false</code>. + /// + /// The RuntimeVersion of the Authentication / Authorization feature in use for the current app. + /// The setting in this value can control the behavior of certain features in the Authentication / Authorization module. + /// + /// The action to take when an unauthenticated client attempts to access the app. + /// + /// <code>true</code> to durably store platform-specific security tokens that are obtained during login flows; otherwise, <code>false</code>. + /// The default is <code>false</code>. + /// + /// + /// External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. + /// This is an advanced setting typically only needed by Windows Store application backends. + /// Note that URLs within the current domain are always implicitly allowed. + /// + /// + /// The default authentication provider to use when multiple providers are configured. + /// This setting is only needed if multiple providers are configured and the unauthenticated client + /// action is set to "RedirectToLoginPage". + /// + /// + /// The number of hours after session token expiration that a session token can be used to + /// call the token refresh API. The default is 72 hours. + /// + /// + /// The Client ID of this relying party application, known as the client_id. + /// This setting is required for enabling OpenID Connection authentication with Azure Active Directory or /// other 3rd party OpenID Connect providers. - /// More information on OpenID Connect: - /// http://openid.net/specs/openid-connect-core-1_0.html - /// The Client Secret of this relying party - /// application (in Azure Active Directory, this is also referred to as - /// the Key). - /// This setting is optional. If no client secret is configured, the - /// OpenID Connect implicit auth flow is used to authenticate end - /// users. - /// Otherwise, the OpenID Connect Authorization Code Flow is used to - /// authenticate end users. - /// More information on OpenID Connect: - /// http://openid.net/specs/openid-connect-core-1_0.html - /// The app setting name that - /// contains the client secret of the relying party - /// application. - /// An alternative to - /// the client secret, that is the thumbprint of a certificate used for - /// signing purposes. This property acts as - /// a replacement for the Client Secret. It is also optional. - /// The OpenID Connect Issuer URI that represents - /// the entity which issues access tokens for this application. - /// When using Azure Active Directory, this value is the URI of the - /// directory tenant, e.g. https://sts.windows.net/{tenant-guid}/. + /// More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + /// + /// + /// The Client Secret of this relying party application (in Azure Active Directory, this is also referred to as the Key). + /// This setting is optional. If no client secret is configured, the OpenID Connect implicit auth flow is used to authenticate end users. + /// Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. + /// More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + /// + /// The app setting name that contains the client secret of the relying party application. + /// + /// An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as + /// a replacement for the Client Secret. It is also optional. + /// + /// + /// The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. + /// When using Azure Active Directory, this value is the URI of the directory tenant, e.g. https://sts.windows.net/{tenant-guid}/. /// This URI is a case-sensitive identifier for the token issuer. - /// More information on OpenID Connect Discovery: - /// http://openid.net/specs/openid-connect-discovery-1_0.html - /// Gets a value indicating whether the - /// issuer should be a valid HTTPS url and be validated as - /// such. - /// Allowed audience values to consider - /// when validating JWTs issued by - /// Azure Active Directory. Note that the - /// <code>ClientID</code> value is always considered an - /// allowed audience, regardless of this setting. - /// Login parameters to send to the - /// OpenID Connect authorization endpoint when - /// a user logs in. Each parameter must be in the form - /// "key=value". - /// Gets a JSON string containing - /// the Azure AD Acl settings. - /// The OpenID Connect Client ID for the - /// Google web application. + /// More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. + /// + /// Gets a value indicating whether the issuer should be a valid HTTPS url and be validated as such. + /// + /// Allowed audience values to consider when validating JWTs issued by + /// Azure Active Directory. Note that the <code>ClientID</code> value is always considered an + /// allowed audience, regardless of this setting. + /// + /// + /// Login parameters to send to the OpenID Connect authorization endpoint when + /// a user logs in. Each parameter must be in the form "key=value". + /// + /// Gets a JSON string containing the Azure AD Acl settings. + /// + /// The OpenID Connect Client ID for the Google web application. /// This setting is required for enabling Google Sign-In. - /// Google Sign-In documentation: - /// https://developers.google.com/identity/sign-in/web/ - /// The client secret associated with - /// the Google web application. + /// Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + /// + /// + /// The client secret associated with the Google web application. /// This setting is required for enabling Google Sign-In. - /// Google Sign-In documentation: - /// https://developers.google.com/identity/sign-in/web/ - /// The app setting name - /// that contains the client secret associated with - /// the Google web application. - /// The OAuth 2.0 scopes that will be - /// requested as part of Google Sign-In authentication. - /// This setting is optional. If not specified, "openid", "profile", - /// and "email" are used as default scopes. - /// Google Sign-In documentation: - /// https://developers.google.com/identity/sign-in/web/ - /// The App ID of the Facebook app used for - /// login. + /// Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + /// + /// + /// The app setting name that contains the client secret associated with + /// the Google web application. + /// + /// + /// The OAuth 2.0 scopes that will be requested as part of Google Sign-In authentication. + /// This setting is optional. If not specified, "openid", "profile", and "email" are used as default scopes. + /// Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + /// + /// + /// The App ID of the Facebook app used for login. /// This setting is required for enabling Facebook Login. - /// Facebook Login documentation: - /// https://developers.facebook.com/docs/facebook-login - /// The App Secret of the Facebook app - /// used for Facebook Login. + /// Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + /// + /// + /// The App Secret of the Facebook app used for Facebook Login. /// This setting is required for enabling Facebook Login. - /// Facebook Login documentation: - /// https://developers.facebook.com/docs/facebook-login - /// The app setting name - /// that contains the app secret used for Facebook Login. - /// The OAuth 2.0 scopes that will be - /// requested as part of Facebook Login authentication. + /// Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + /// + /// The app setting name that contains the app secret used for Facebook Login. + /// + /// The OAuth 2.0 scopes that will be requested as part of Facebook Login authentication. + /// This setting is optional. + /// Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + /// + /// + /// The Client Id of the GitHub app used for login. + /// This setting is required for enabling Github login. + /// + /// + /// The Client Secret of the GitHub app used for Github Login. + /// This setting is required for enabling Github login. + /// + /// + /// The app setting name that contains the client secret of the Github + /// app used for GitHub Login. + /// + /// + /// The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. /// This setting is optional. - /// Facebook Login documentation: - /// https://developers.facebook.com/docs/facebook-login - /// The Client Id of the GitHub app used - /// for login. - /// This setting is required for enabling Github login - /// The Client Secret of the GitHub - /// app used for Github Login. - /// This setting is required for enabling Github login. - /// The app setting name - /// that contains the client secret of the Github - /// app used for GitHub Login. - /// The OAuth 2.0 scopes that will be - /// requested as part of GitHub Login authentication. - /// This setting is optional - /// The OAuth 1.0a consumer key of the - /// Twitter application used for sign-in. + /// + /// + /// The OAuth 1.0a consumer key of the Twitter application used for sign-in. /// This setting is required for enabling Twitter Sign-In. - /// Twitter Sign-In documentation: - /// https://dev.twitter.com/web/sign-in - /// The OAuth 1.0a consumer secret - /// of the Twitter application used for sign-in. + /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + /// + /// + /// The OAuth 1.0a consumer secret of the Twitter application used for sign-in. /// This setting is required for enabling Twitter Sign-In. - /// Twitter Sign-In documentation: - /// https://dev.twitter.com/web/sign-in - /// The app setting name - /// that contains the OAuth 1.0a consumer secret of the Twitter - /// application used for sign-in. - /// The OAuth 2.0 client ID that - /// was created for the app used for authentication. - /// This setting is required for enabling Microsoft Account - /// authentication. - /// Microsoft Account OAuth documentation: - /// https://dev.onedrive.com/auth/msa_oauth.htm - /// The OAuth 2.0 client - /// secret that was created for the app used for authentication. - /// This setting is required for enabling Microsoft Account - /// authentication. - /// Microsoft Account OAuth documentation: - /// https://dev.onedrive.com/auth/msa_oauth.htm - /// The app - /// setting name containing the OAuth 2.0 client secret that was - /// created for the - /// app used for authentication. - /// The OAuth 2.0 scopes that - /// will be requested as part of Microsoft Account authentication. - /// This setting is optional. If not specified, "wl.basic" is used as - /// the default scope. - /// Microsoft Account Scopes and permissions documentation: - /// https://msdn.microsoft.com/en-us/library/dn631845.aspx - /// "true" if the auth config settings - /// should be read from a file, - /// "false" otherwise - /// The path of the config file containing - /// auth settings. - /// If the path is relative, base will the site's root - /// directory. - public SiteAuthSettings(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), string runtimeVersion = default(string), UnauthenticatedClientAction? unauthenticatedClientAction = default(UnauthenticatedClientAction?), bool? tokenStoreEnabled = default(bool?), IList allowedExternalRedirectUrls = default(IList), BuiltInAuthenticationProvider? defaultProvider = default(BuiltInAuthenticationProvider?), double? tokenRefreshExtensionHours = default(double?), string clientId = default(string), string clientSecret = default(string), string clientSecretSettingName = default(string), string clientSecretCertificateThumbprint = default(string), string issuer = default(string), bool? validateIssuer = default(bool?), IList allowedAudiences = default(IList), IList additionalLoginParams = default(IList), string aadClaimsAuthorization = default(string), string googleClientId = default(string), string googleClientSecret = default(string), string googleClientSecretSettingName = default(string), IList googleOAuthScopes = default(IList), string facebookAppId = default(string), string facebookAppSecret = default(string), string facebookAppSecretSettingName = default(string), IList facebookOAuthScopes = default(IList), string gitHubClientId = default(string), string gitHubClientSecret = default(string), string gitHubClientSecretSettingName = default(string), IList gitHubOAuthScopes = default(IList), string twitterConsumerKey = default(string), string twitterConsumerSecret = default(string), string twitterConsumerSecretSettingName = default(string), string microsoftAccountClientId = default(string), string microsoftAccountClientSecret = default(string), string microsoftAccountClientSecretSettingName = default(string), IList microsoftAccountOAuthScopes = default(IList), string isAuthFromFile = default(string), string authFilePath = default(string)) - : base(id, name, kind, type) + /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + /// + /// + /// The app setting name that contains the OAuth 1.0a consumer secret of the Twitter + /// application used for sign-in. + /// + /// + /// The OAuth 2.0 client ID that was created for the app used for authentication. + /// This setting is required for enabling Microsoft Account authentication. + /// Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + /// + /// + /// The OAuth 2.0 client secret that was created for the app used for authentication. + /// This setting is required for enabling Microsoft Account authentication. + /// Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + /// + /// + /// The app setting name containing the OAuth 2.0 client secret that was created for the + /// app used for authentication. + /// + /// + /// The OAuth 2.0 scopes that will be requested as part of Microsoft Account authentication. + /// This setting is optional. If not specified, "wl.basic" is used as the default scope. + /// Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en-us/library/dn631845.aspx. + /// + /// + /// "true" if the auth config settings should be read from a file, + /// "false" otherwise. + /// + /// + /// The path of the config file containing auth settings. + /// If the path is relative, base will the site's root directory. + /// + /// + /// The ConfigVersion of the Authentication / Authorization feature in use for the current app. + /// The setting in this value can control the behavior of the control plane for Authentication / Authorization. + /// + internal SiteAuthSettings(string id, string name, string kind, string type, bool? enabled, string runtimeVersion, UnauthenticatedClientAction? unauthenticatedClientAction, bool? tokenStoreEnabled, IList allowedExternalRedirectUrls, BuiltInAuthenticationProvider? defaultProvider, double? tokenRefreshExtensionHours, string clientId, string clientSecret, string clientSecretSettingName, string clientSecretCertificateThumbprint, string issuer, bool? validateIssuer, IList allowedAudiences, IList additionalLoginParams, string aadClaimsAuthorization, string googleClientId, string googleClientSecret, string googleClientSecretSettingName, IList googleOAuthScopes, string facebookAppId, string facebookAppSecret, string facebookAppSecretSettingName, IList facebookOAuthScopes, string gitHubClientId, string gitHubClientSecret, string gitHubClientSecretSettingName, IList gitHubOAuthScopes, string twitterConsumerKey, string twitterConsumerSecret, string twitterConsumerSecretSettingName, string microsoftAccountClientId, string microsoftAccountClientSecret, string microsoftAccountClientSecretSettingName, IList microsoftAccountOAuthScopes, string isAuthFromFile, string authFilePath, string configVersion) : base(id, name, kind, type) { Enabled = enabled; RuntimeVersion = runtimeVersion; @@ -245,354 +223,200 @@ public SiteAuthSettings() MicrosoftAccountOAuthScopes = microsoftAccountOAuthScopes; IsAuthFromFile = isAuthFromFile; AuthFilePath = authFilePath; - CustomInit(); + ConfigVersion = configVersion; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// Authentication / Authorization feature is enabled for the current - /// app; otherwise, &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// <code>true</code> if the Authentication / Authorization feature is enabled for the current app; otherwise, <code>false</code>. public bool? Enabled { get; set; } - /// - /// Gets or sets the RuntimeVersion of the Authentication / - /// Authorization feature in use for the current app. - /// The setting in this value can control the behavior of certain - /// features in the Authentication / Authorization module. + /// The RuntimeVersion of the Authentication / Authorization feature in use for the current app. + /// The setting in this value can control the behavior of certain features in the Authentication / Authorization module. /// - [JsonProperty(PropertyName = "properties.runtimeVersion")] public string RuntimeVersion { get; set; } - - /// - /// Gets or sets the action to take when an unauthenticated client - /// attempts to access the app. Possible values include: - /// 'RedirectToLoginPage', 'AllowAnonymous' - /// - [JsonProperty(PropertyName = "properties.unauthenticatedClientAction")] + /// The action to take when an unauthenticated client attempts to access the app. public UnauthenticatedClientAction? UnauthenticatedClientAction { get; set; } - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// durably store platform-specific security tokens that are obtained - /// during login flows; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// The default is &lt;code&gt;false&lt;/code&gt;. + /// <code>true</code> to durably store platform-specific security tokens that are obtained during login flows; otherwise, <code>false</code>. + /// The default is <code>false</code>. /// - [JsonProperty(PropertyName = "properties.tokenStoreEnabled")] public bool? TokenStoreEnabled { get; set; } - /// - /// Gets or sets external URLs that can be redirected to as part of - /// logging in or logging out of the app. Note that the query string - /// part of the URL is ignored. - /// This is an advanced setting typically only needed by Windows Store - /// application backends. - /// Note that URLs within the current domain are always implicitly - /// allowed. + /// External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. + /// This is an advanced setting typically only needed by Windows Store application backends. + /// Note that URLs within the current domain are always implicitly allowed. /// - [JsonProperty(PropertyName = "properties.allowedExternalRedirectUrls")] - public IList AllowedExternalRedirectUrls { get; set; } - + public IList AllowedExternalRedirectUrls { get; } /// - /// Gets or sets the default authentication provider to use when - /// multiple providers are configured. - /// This setting is only needed if multiple providers are configured - /// and the unauthenticated client - /// action is set to "RedirectToLoginPage". Possible values include: - /// 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', - /// 'Twitter', 'Github' + /// The default authentication provider to use when multiple providers are configured. + /// This setting is only needed if multiple providers are configured and the unauthenticated client + /// action is set to "RedirectToLoginPage". /// - [JsonProperty(PropertyName = "properties.defaultProvider")] public BuiltInAuthenticationProvider? DefaultProvider { get; set; } - /// - /// Gets or sets the number of hours after session token expiration - /// that a session token can be used to + /// The number of hours after session token expiration that a session token can be used to /// call the token refresh API. The default is 72 hours. /// - [JsonProperty(PropertyName = "properties.tokenRefreshExtensionHours")] public double? TokenRefreshExtensionHours { get; set; } - /// - /// Gets or sets the Client ID of this relying party application, known - /// as the client_id. - /// This setting is required for enabling OpenID Connection - /// authentication with Azure Active Directory or + /// The Client ID of this relying party application, known as the client_id. + /// This setting is required for enabling OpenID Connection authentication with Azure Active Directory or /// other 3rd party OpenID Connect providers. - /// More information on OpenID Connect: - /// http://openid.net/specs/openid-connect-core-1_0.html + /// More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. /// - [JsonProperty(PropertyName = "properties.clientId")] public string ClientId { get; set; } - /// - /// Gets or sets the Client Secret of this relying party application - /// (in Azure Active Directory, this is also referred to as the Key). - /// This setting is optional. If no client secret is configured, the - /// OpenID Connect implicit auth flow is used to authenticate end - /// users. - /// Otherwise, the OpenID Connect Authorization Code Flow is used to - /// authenticate end users. - /// More information on OpenID Connect: - /// http://openid.net/specs/openid-connect-core-1_0.html - /// - [JsonProperty(PropertyName = "properties.clientSecret")] - public string ClientSecret { get; set; } - - /// - /// Gets or sets the app setting name that contains the client secret - /// of the relying party application. + /// The Client Secret of this relying party application (in Azure Active Directory, this is also referred to as the Key). + /// This setting is optional. If no client secret is configured, the OpenID Connect implicit auth flow is used to authenticate end users. + /// Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. + /// More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. /// - [JsonProperty(PropertyName = "properties.clientSecretSettingName")] + public string ClientSecret { get; set; } + /// The app setting name that contains the client secret of the relying party application. public string ClientSecretSettingName { get; set; } - /// - /// Gets or sets an alternative to the client secret, that is the - /// thumbprint of a certificate used for signing purposes. This - /// property acts as + /// An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as /// a replacement for the Client Secret. It is also optional. /// - [JsonProperty(PropertyName = "properties.clientSecretCertificateThumbprint")] public string ClientSecretCertificateThumbprint { get; set; } - /// - /// Gets or sets the OpenID Connect Issuer URI that represents the - /// entity which issues access tokens for this application. - /// When using Azure Active Directory, this value is the URI of the - /// directory tenant, e.g. https://sts.windows.net/{tenant-guid}/. + /// The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. + /// When using Azure Active Directory, this value is the URI of the directory tenant, e.g. https://sts.windows.net/{tenant-guid}/. /// This URI is a case-sensitive identifier for the token issuer. - /// More information on OpenID Connect Discovery: - /// http://openid.net/specs/openid-connect-discovery-1_0.html + /// More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. /// - [JsonProperty(PropertyName = "properties.issuer")] public string Issuer { get; set; } - - /// - /// Gets a value indicating whether the issuer should be a valid HTTPS - /// url and be validated as such. - /// - [JsonProperty(PropertyName = "properties.validateIssuer")] + /// Gets a value indicating whether the issuer should be a valid HTTPS url and be validated as such. public bool? ValidateIssuer { get; set; } - /// - /// Gets or sets allowed audience values to consider when validating - /// JWTs issued by - /// Azure Active Directory. Note that the - /// &lt;code&gt;ClientID&lt;/code&gt; value is always - /// considered an + /// Allowed audience values to consider when validating JWTs issued by + /// Azure Active Directory. Note that the <code>ClientID</code> value is always considered an /// allowed audience, regardless of this setting. /// - [JsonProperty(PropertyName = "properties.allowedAudiences")] - public IList AllowedAudiences { get; set; } - - /// - /// Gets or sets login parameters to send to the OpenID Connect - /// authorization endpoint when - /// a user logs in. Each parameter must be in the form "key=value". - /// - [JsonProperty(PropertyName = "properties.additionalLoginParams")] - public IList AdditionalLoginParams { get; set; } - + public IList AllowedAudiences { get; } /// - /// Gets a JSON string containing the Azure AD Acl settings. + /// Login parameters to send to the OpenID Connect authorization endpoint when + /// a user logs in. Each parameter must be in the form "key=value". /// - [JsonProperty(PropertyName = "properties.aadClaimsAuthorization")] + public IList AdditionalLoginParams { get; } + /// Gets a JSON string containing the Azure AD Acl settings. public string AadClaimsAuthorization { get; set; } - /// - /// Gets or sets the OpenID Connect Client ID for the Google web - /// application. + /// The OpenID Connect Client ID for the Google web application. /// This setting is required for enabling Google Sign-In. - /// Google Sign-In documentation: - /// https://developers.google.com/identity/sign-in/web/ + /// Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. /// - [JsonProperty(PropertyName = "properties.googleClientId")] public string GoogleClientId { get; set; } - /// - /// Gets or sets the client secret associated with the Google web - /// application. + /// The client secret associated with the Google web application. /// This setting is required for enabling Google Sign-In. - /// Google Sign-In documentation: - /// https://developers.google.com/identity/sign-in/web/ + /// Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. /// - [JsonProperty(PropertyName = "properties.googleClientSecret")] public string GoogleClientSecret { get; set; } - /// - /// Gets or sets the app setting name that contains the client secret - /// associated with + /// The app setting name that contains the client secret associated with /// the Google web application. /// - [JsonProperty(PropertyName = "properties.googleClientSecretSettingName")] public string GoogleClientSecretSettingName { get; set; } - /// - /// Gets or sets the OAuth 2.0 scopes that will be requested as part of - /// Google Sign-In authentication. - /// This setting is optional. If not specified, "openid", "profile", - /// and "email" are used as default scopes. - /// Google Sign-In documentation: - /// https://developers.google.com/identity/sign-in/web/ + /// The OAuth 2.0 scopes that will be requested as part of Google Sign-In authentication. + /// This setting is optional. If not specified, "openid", "profile", and "email" are used as default scopes. + /// Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. /// - [JsonProperty(PropertyName = "properties.googleOAuthScopes")] - public IList GoogleOAuthScopes { get; set; } - + public IList GoogleOAuthScopes { get; } /// - /// Gets or sets the App ID of the Facebook app used for login. + /// The App ID of the Facebook app used for login. /// This setting is required for enabling Facebook Login. - /// Facebook Login documentation: - /// https://developers.facebook.com/docs/facebook-login + /// Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. /// - [JsonProperty(PropertyName = "properties.facebookAppId")] public string FacebookAppId { get; set; } - /// - /// Gets or sets the App Secret of the Facebook app used for Facebook - /// Login. + /// The App Secret of the Facebook app used for Facebook Login. /// This setting is required for enabling Facebook Login. - /// Facebook Login documentation: - /// https://developers.facebook.com/docs/facebook-login + /// Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. /// - [JsonProperty(PropertyName = "properties.facebookAppSecret")] public string FacebookAppSecret { get; set; } - - /// - /// Gets or sets the app setting name that contains the app secret used - /// for Facebook Login. - /// - [JsonProperty(PropertyName = "properties.facebookAppSecretSettingName")] + /// The app setting name that contains the app secret used for Facebook Login. public string FacebookAppSecretSettingName { get; set; } - /// - /// Gets or sets the OAuth 2.0 scopes that will be requested as part of - /// Facebook Login authentication. + /// The OAuth 2.0 scopes that will be requested as part of Facebook Login authentication. /// This setting is optional. - /// Facebook Login documentation: - /// https://developers.facebook.com/docs/facebook-login + /// Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. /// - [JsonProperty(PropertyName = "properties.facebookOAuthScopes")] - public IList FacebookOAuthScopes { get; set; } - + public IList FacebookOAuthScopes { get; } /// - /// Gets or sets the Client Id of the GitHub app used for login. - /// This setting is required for enabling Github login + /// The Client Id of the GitHub app used for login. + /// This setting is required for enabling Github login. /// - [JsonProperty(PropertyName = "properties.gitHubClientId")] public string GitHubClientId { get; set; } - /// - /// Gets or sets the Client Secret of the GitHub app used for Github - /// Login. + /// The Client Secret of the GitHub app used for Github Login. /// This setting is required for enabling Github login. /// - [JsonProperty(PropertyName = "properties.gitHubClientSecret")] public string GitHubClientSecret { get; set; } - /// - /// Gets or sets the app setting name that contains the client secret - /// of the Github + /// The app setting name that contains the client secret of the Github /// app used for GitHub Login. /// - [JsonProperty(PropertyName = "properties.gitHubClientSecretSettingName")] public string GitHubClientSecretSettingName { get; set; } - /// - /// Gets or sets the OAuth 2.0 scopes that will be requested as part of - /// GitHub Login authentication. - /// This setting is optional + /// The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. + /// This setting is optional. /// - [JsonProperty(PropertyName = "properties.gitHubOAuthScopes")] - public IList GitHubOAuthScopes { get; set; } - + public IList GitHubOAuthScopes { get; } /// - /// Gets or sets the OAuth 1.0a consumer key of the Twitter application - /// used for sign-in. + /// The OAuth 1.0a consumer key of the Twitter application used for sign-in. /// This setting is required for enabling Twitter Sign-In. - /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. /// - [JsonProperty(PropertyName = "properties.twitterConsumerKey")] public string TwitterConsumerKey { get; set; } - /// - /// Gets or sets the OAuth 1.0a consumer secret of the Twitter - /// application used for sign-in. + /// The OAuth 1.0a consumer secret of the Twitter application used for sign-in. /// This setting is required for enabling Twitter Sign-In. - /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. /// - [JsonProperty(PropertyName = "properties.twitterConsumerSecret")] public string TwitterConsumerSecret { get; set; } - /// - /// Gets or sets the app setting name that contains the OAuth 1.0a - /// consumer secret of the Twitter + /// The app setting name that contains the OAuth 1.0a consumer secret of the Twitter /// application used for sign-in. /// - [JsonProperty(PropertyName = "properties.twitterConsumerSecretSettingName")] public string TwitterConsumerSecretSettingName { get; set; } - /// - /// Gets or sets the OAuth 2.0 client ID that was created for the app - /// used for authentication. - /// This setting is required for enabling Microsoft Account - /// authentication. - /// Microsoft Account OAuth documentation: - /// https://dev.onedrive.com/auth/msa_oauth.htm + /// The OAuth 2.0 client ID that was created for the app used for authentication. + /// This setting is required for enabling Microsoft Account authentication. + /// Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. /// - [JsonProperty(PropertyName = "properties.microsoftAccountClientId")] public string MicrosoftAccountClientId { get; set; } - /// - /// Gets or sets the OAuth 2.0 client secret that was created for the - /// app used for authentication. - /// This setting is required for enabling Microsoft Account - /// authentication. - /// Microsoft Account OAuth documentation: - /// https://dev.onedrive.com/auth/msa_oauth.htm + /// The OAuth 2.0 client secret that was created for the app used for authentication. + /// This setting is required for enabling Microsoft Account authentication. + /// Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. /// - [JsonProperty(PropertyName = "properties.microsoftAccountClientSecret")] public string MicrosoftAccountClientSecret { get; set; } - /// - /// Gets or sets the app setting name containing the OAuth 2.0 client - /// secret that was created for the + /// The app setting name containing the OAuth 2.0 client secret that was created for the /// app used for authentication. /// - [JsonProperty(PropertyName = "properties.microsoftAccountClientSecretSettingName")] public string MicrosoftAccountClientSecretSettingName { get; set; } - /// - /// Gets or sets the OAuth 2.0 scopes that will be requested as part of - /// Microsoft Account authentication. - /// This setting is optional. If not specified, "wl.basic" is used as - /// the default scope. - /// Microsoft Account Scopes and permissions documentation: - /// https://msdn.microsoft.com/en-us/library/dn631845.aspx + /// The OAuth 2.0 scopes that will be requested as part of Microsoft Account authentication. + /// This setting is optional. If not specified, "wl.basic" is used as the default scope. + /// Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en-us/library/dn631845.aspx. /// - [JsonProperty(PropertyName = "properties.microsoftAccountOAuthScopes")] - public IList MicrosoftAccountOAuthScopes { get; set; } - + public IList MicrosoftAccountOAuthScopes { get; } /// - /// Gets or sets "true" if the auth config settings should be read from - /// a file, - /// "false" otherwise + /// "true" if the auth config settings should be read from a file, + /// "false" otherwise. /// - [JsonProperty(PropertyName = "properties.isAuthFromFile")] public string IsAuthFromFile { get; set; } - /// - /// Gets or sets the path of the config file containing auth settings. - /// If the path is relative, base will the site's root directory. + /// The path of the config file containing auth settings. + /// If the path is relative, base will the site's root directory. /// - [JsonProperty(PropertyName = "properties.authFilePath")] public string AuthFilePath { get; set; } - + /// + /// The ConfigVersion of the Authentication / Authorization feature in use for the current app. + /// The setting in this value can control the behavior of the control plane for Authentication / Authorization. + /// + public string ConfigVersion { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.Serialization.cs new file mode 100644 index 000000000000..d22c8503d8a9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteAuthSettingsV2 : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Platform)) + { + writer.WritePropertyName("platform"); + writer.WriteObjectValue(Platform); + } + if (Optional.IsDefined(GlobalValidation)) + { + writer.WritePropertyName("globalValidation"); + writer.WriteObjectValue(GlobalValidation); + } + if (Optional.IsDefined(IdentityProviders)) + { + writer.WritePropertyName("identityProviders"); + writer.WriteObjectValue(IdentityProviders); + } + if (Optional.IsDefined(Login)) + { + writer.WritePropertyName("login"); + writer.WriteObjectValue(Login); + } + if (Optional.IsDefined(HttpSettings)) + { + writer.WritePropertyName("httpSettings"); + writer.WriteObjectValue(HttpSettings); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SiteAuthSettingsV2 DeserializeSiteAuthSettingsV2(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional platform = default; + Optional globalValidation = default; + Optional identityProviders = default; + Optional login = default; + Optional httpSettings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("platform")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + platform = AuthPlatform.DeserializeAuthPlatform(property0.Value); + continue; + } + if (property0.NameEquals("globalValidation")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + globalValidation = GlobalValidation.DeserializeGlobalValidation(property0.Value); + continue; + } + if (property0.NameEquals("identityProviders")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + identityProviders = IdentityProviders.DeserializeIdentityProviders(property0.Value); + continue; + } + if (property0.NameEquals("login")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + login = Login.DeserializeLogin(property0.Value); + continue; + } + if (property0.NameEquals("httpSettings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + httpSettings = HttpSettings.DeserializeHttpSettings(property0.Value); + continue; + } + } + continue; + } + } + return new SiteAuthSettingsV2(id.Value, name.Value, kind.Value, type.Value, platform.Value, globalValidation.Value, identityProviders.Value, login.Value, httpSettings.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.cs index 5a587a3976c4..60c545410612 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.cs @@ -1,78 +1,48 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// Configuration settings for the Azure App Service Authentication / Authorization V2 feature. public partial class SiteAuthSettingsV2 : ProxyOnlyResource { - /// - /// Initializes a new instance of the SiteAuthSettingsV2 class. - /// + /// Initializes a new instance of SiteAuthSettingsV2. public SiteAuthSettingsV2() { - CustomInit(); } - /// - /// Initializes a new instance of the SiteAuthSettingsV2 class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public SiteAuthSettingsV2(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), AuthPlatform platform = default(AuthPlatform), GlobalValidation globalValidation = default(GlobalValidation), IdentityProviders identityProviders = default(IdentityProviders), Login login = default(Login), HttpSettings httpSettings = default(HttpSettings)) - : base(id, name, kind, type) + /// Initializes a new instance of SiteAuthSettingsV2. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The configuration settings of the platform of App Service Authentication/Authorization. + /// The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. + /// The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. + /// The configuration settings of the login flow of users using App Service Authentication/Authorization. + /// The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. + internal SiteAuthSettingsV2(string id, string name, string kind, string type, AuthPlatform platform, GlobalValidation globalValidation, IdentityProviders identityProviders, Login login, HttpSettings httpSettings) : base(id, name, kind, type) { Platform = platform; GlobalValidation = globalValidation; IdentityProviders = identityProviders; Login = login; HttpSettings = httpSettings; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.platform")] + /// The configuration settings of the platform of App Service Authentication/Authorization. public AuthPlatform Platform { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.globalValidation")] + /// The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. public GlobalValidation GlobalValidation { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.identityProviders")] + /// The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. public IdentityProviders IdentityProviders { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.login")] + /// The configuration settings of the login flow of users using App Service Authentication/Authorization. public Login Login { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.httpSettings")] + /// The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. public HttpSettings HttpSettings { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.Serialization.cs new file mode 100644 index 000000000000..37a381d67c3a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class SiteAvailabilityStateExtensions + { + public static string ToSerialString(this SiteAvailabilityState value) => value switch + { + SiteAvailabilityState.Normal => "Normal", + SiteAvailabilityState.Limited => "Limited", + SiteAvailabilityState.DisasterRecoveryMode => "DisasterRecoveryMode", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteAvailabilityState value.") + }; + + public static SiteAvailabilityState ToSiteAvailabilityState(this string value) + { + if (string.Equals(value, "Normal", StringComparison.InvariantCultureIgnoreCase)) return SiteAvailabilityState.Normal; + if (string.Equals(value, "Limited", StringComparison.InvariantCultureIgnoreCase)) return SiteAvailabilityState.Limited; + if (string.Equals(value, "DisasterRecoveryMode", StringComparison.InvariantCultureIgnoreCase)) return SiteAvailabilityState.DisasterRecoveryMode; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteAvailabilityState value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.cs index 022c239de27e..6518e2769952 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for SiteAvailabilityState. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Management information availability state for the app. public enum SiteAvailabilityState { - [EnumMember(Value = "Normal")] + /// Normal. Normal, - [EnumMember(Value = "Limited")] + /// Limited. Limited, - [EnumMember(Value = "DisasterRecoveryMode")] + /// DisasterRecoveryMode. DisasterRecoveryMode } - internal static class SiteAvailabilityStateEnumExtension - { - internal static string ToSerializedValue(this SiteAvailabilityState? value) - { - return value == null ? null : ((SiteAvailabilityState)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this SiteAvailabilityState value) - { - switch( value ) - { - case SiteAvailabilityState.Normal: - return "Normal"; - case SiteAvailabilityState.Limited: - return "Limited"; - case SiteAvailabilityState.DisasterRecoveryMode: - return "DisasterRecoveryMode"; - } - return null; - } - - internal static SiteAvailabilityState? ParseSiteAvailabilityState(this string value) - { - switch( value ) - { - case "Normal": - return SiteAvailabilityState.Normal; - case "Limited": - return SiteAvailabilityState.Limited; - case "DisasterRecoveryMode": - return SiteAvailabilityState.DisasterRecoveryMode; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.Serialization.cs new file mode 100644 index 000000000000..4f3b63a5a05d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.Serialization.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteCloneability + { + internal static SiteCloneability DeserializeSiteCloneability(JsonElement element) + { + Optional result = default; + Optional> blockingFeatures = default; + Optional> unsupportedFeatures = default; + Optional> blockingCharacteristics = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("result")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + result = property.Value.GetString().ToCloneAbilityResult(); + continue; + } + if (property.NameEquals("blockingFeatures")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SiteCloneabilityCriterion.DeserializeSiteCloneabilityCriterion(item)); + } + blockingFeatures = array; + continue; + } + if (property.NameEquals("unsupportedFeatures")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SiteCloneabilityCriterion.DeserializeSiteCloneabilityCriterion(item)); + } + unsupportedFeatures = array; + continue; + } + if (property.NameEquals("blockingCharacteristics")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SiteCloneabilityCriterion.DeserializeSiteCloneabilityCriterion(item)); + } + blockingCharacteristics = array; + continue; + } + } + return new SiteCloneability(Optional.ToNullable(result), Optional.ToList(blockingFeatures), Optional.ToList(unsupportedFeatures), Optional.ToList(blockingCharacteristics)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.cs index aceacabea031..a67bde43077c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.cs @@ -1,87 +1,52 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Represents whether or not an app is cloneable. - /// + /// Represents whether or not an app is cloneable. public partial class SiteCloneability { - /// - /// Initializes a new instance of the SiteCloneability class. - /// - public SiteCloneability() + /// Initializes a new instance of SiteCloneability. + internal SiteCloneability() { - CustomInit(); + BlockingFeatures = new ChangeTrackingList(); + UnsupportedFeatures = new ChangeTrackingList(); + BlockingCharacteristics = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the SiteCloneability class. - /// - /// Name of app. Possible values include: - /// 'Cloneable', 'PartiallyCloneable', 'NotCloneable' - /// List of features enabled on app that - /// prevent cloning. - /// List of features enabled on app - /// that are non-blocking but cannot be cloned. The app can still be - /// cloned - /// but the features in this list will not be set up on cloned - /// app. - /// List of blocking application - /// characteristics. - public SiteCloneability(CloneAbilityResult? result = default(CloneAbilityResult?), IList blockingFeatures = default(IList), IList unsupportedFeatures = default(IList), IList blockingCharacteristics = default(IList)) + /// Initializes a new instance of SiteCloneability. + /// Name of app. + /// List of features enabled on app that prevent cloning. + /// + /// List of features enabled on app that are non-blocking but cannot be cloned. The app can still be cloned + /// but the features in this list will not be set up on cloned app. + /// + /// List of blocking application characteristics. + internal SiteCloneability(CloneAbilityResult? result, IReadOnlyList blockingFeatures, IReadOnlyList unsupportedFeatures, IReadOnlyList blockingCharacteristics) { Result = result; BlockingFeatures = blockingFeatures; UnsupportedFeatures = unsupportedFeatures; BlockingCharacteristics = blockingCharacteristics; - CustomInit(); } + /// Name of app. + public CloneAbilityResult? Result { get; } + /// List of features enabled on app that prevent cloning. + public IReadOnlyList BlockingFeatures { get; } /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of app. Possible values include: 'Cloneable', - /// 'PartiallyCloneable', 'NotCloneable' - /// - [JsonProperty(PropertyName = "result")] - public CloneAbilityResult? Result { get; set; } - - /// - /// Gets or sets list of features enabled on app that prevent cloning. - /// - [JsonProperty(PropertyName = "blockingFeatures")] - public IList BlockingFeatures { get; set; } - - /// - /// Gets or sets list of features enabled on app that are non-blocking - /// but cannot be cloned. The app can still be cloned + /// List of features enabled on app that are non-blocking but cannot be cloned. The app can still be cloned /// but the features in this list will not be set up on cloned app. /// - [JsonProperty(PropertyName = "unsupportedFeatures")] - public IList UnsupportedFeatures { get; set; } - - /// - /// Gets or sets list of blocking application characteristics. - /// - [JsonProperty(PropertyName = "blockingCharacteristics")] - public IList BlockingCharacteristics { get; set; } - + public IReadOnlyList UnsupportedFeatures { get; } + /// List of blocking application characteristics. + public IReadOnlyList BlockingCharacteristics { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.Serialization.cs new file mode 100644 index 000000000000..1d912820208b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteCloneabilityCriterion + { + internal static SiteCloneabilityCriterion DeserializeSiteCloneabilityCriterion(JsonElement element) + { + Optional name = default; + Optional description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + } + return new SiteCloneabilityCriterion(name.Value, description.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.cs index eab80a8c1a0c..ced08085b3d6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// An app cloneability criterion. - /// + /// An app cloneability criterion. public partial class SiteCloneabilityCriterion { - /// - /// Initializes a new instance of the SiteCloneabilityCriterion class. - /// - public SiteCloneabilityCriterion() + /// Initializes a new instance of SiteCloneabilityCriterion. + internal SiteCloneabilityCriterion() { - CustomInit(); } - /// - /// Initializes a new instance of the SiteCloneabilityCriterion class. - /// - /// Name of criterion. - /// Description of criterion. - public SiteCloneabilityCriterion(string name = default(string), string description = default(string)) + /// Initializes a new instance of SiteCloneabilityCriterion. + /// Name of criterion. + /// Description of criterion. + internal SiteCloneabilityCriterion(string name, string description) { Name = name; Description = description; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of criterion. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets description of criterion. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + /// Name of criterion. + public string Name { get; } + /// Description of criterion. + public string Description { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.Serialization.cs new file mode 100644 index 000000000000..c895aa768bb8 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.Serialization.cs @@ -0,0 +1,1042 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(NumberOfWorkers)) + { + writer.WritePropertyName("numberOfWorkers"); + writer.WriteNumberValue(NumberOfWorkers.Value); + } + if (Optional.IsCollectionDefined(DefaultDocuments)) + { + writer.WritePropertyName("defaultDocuments"); + writer.WriteStartArray(); + foreach (var item in DefaultDocuments) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NetFrameworkVersion)) + { + writer.WritePropertyName("netFrameworkVersion"); + writer.WriteStringValue(NetFrameworkVersion); + } + if (Optional.IsDefined(PhpVersion)) + { + writer.WritePropertyName("phpVersion"); + writer.WriteStringValue(PhpVersion); + } + if (Optional.IsDefined(PythonVersion)) + { + writer.WritePropertyName("pythonVersion"); + writer.WriteStringValue(PythonVersion); + } + if (Optional.IsDefined(NodeVersion)) + { + writer.WritePropertyName("nodeVersion"); + writer.WriteStringValue(NodeVersion); + } + if (Optional.IsDefined(PowerShellVersion)) + { + writer.WritePropertyName("powerShellVersion"); + writer.WriteStringValue(PowerShellVersion); + } + if (Optional.IsDefined(LinuxFxVersion)) + { + writer.WritePropertyName("linuxFxVersion"); + writer.WriteStringValue(LinuxFxVersion); + } + if (Optional.IsDefined(WindowsFxVersion)) + { + writer.WritePropertyName("windowsFxVersion"); + writer.WriteStringValue(WindowsFxVersion); + } + if (Optional.IsDefined(RequestTracingEnabled)) + { + writer.WritePropertyName("requestTracingEnabled"); + writer.WriteBooleanValue(RequestTracingEnabled.Value); + } + if (Optional.IsDefined(RequestTracingExpirationTime)) + { + writer.WritePropertyName("requestTracingExpirationTime"); + writer.WriteStringValue(RequestTracingExpirationTime.Value, "O"); + } + if (Optional.IsDefined(RemoteDebuggingEnabled)) + { + writer.WritePropertyName("remoteDebuggingEnabled"); + writer.WriteBooleanValue(RemoteDebuggingEnabled.Value); + } + if (Optional.IsDefined(RemoteDebuggingVersion)) + { + writer.WritePropertyName("remoteDebuggingVersion"); + writer.WriteStringValue(RemoteDebuggingVersion); + } + if (Optional.IsDefined(HttpLoggingEnabled)) + { + writer.WritePropertyName("httpLoggingEnabled"); + writer.WriteBooleanValue(HttpLoggingEnabled.Value); + } + if (Optional.IsDefined(LogsDirectorySizeLimit)) + { + writer.WritePropertyName("logsDirectorySizeLimit"); + writer.WriteNumberValue(LogsDirectorySizeLimit.Value); + } + if (Optional.IsDefined(DetailedErrorLoggingEnabled)) + { + writer.WritePropertyName("detailedErrorLoggingEnabled"); + writer.WriteBooleanValue(DetailedErrorLoggingEnabled.Value); + } + if (Optional.IsDefined(PublishingUsername)) + { + writer.WritePropertyName("publishingUsername"); + writer.WriteStringValue(PublishingUsername); + } + if (Optional.IsCollectionDefined(AppSettings)) + { + writer.WritePropertyName("appSettings"); + writer.WriteStartArray(); + foreach (var item in AppSettings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ConnectionStrings)) + { + writer.WritePropertyName("connectionStrings"); + writer.WriteStartArray(); + foreach (var item in ConnectionStrings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(HandlerMappings)) + { + writer.WritePropertyName("handlerMappings"); + writer.WriteStartArray(); + foreach (var item in HandlerMappings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DocumentRoot)) + { + writer.WritePropertyName("documentRoot"); + writer.WriteStringValue(DocumentRoot); + } + if (Optional.IsDefined(ScmType)) + { + writer.WritePropertyName("scmType"); + writer.WriteStringValue(ScmType.Value.ToString()); + } + if (Optional.IsDefined(Use32BitWorkerProcess)) + { + writer.WritePropertyName("use32BitWorkerProcess"); + writer.WriteBooleanValue(Use32BitWorkerProcess.Value); + } + if (Optional.IsDefined(WebSocketsEnabled)) + { + writer.WritePropertyName("webSocketsEnabled"); + writer.WriteBooleanValue(WebSocketsEnabled.Value); + } + if (Optional.IsDefined(AlwaysOn)) + { + writer.WritePropertyName("alwaysOn"); + writer.WriteBooleanValue(AlwaysOn.Value); + } + if (Optional.IsDefined(JavaVersion)) + { + writer.WritePropertyName("javaVersion"); + writer.WriteStringValue(JavaVersion); + } + if (Optional.IsDefined(JavaContainer)) + { + writer.WritePropertyName("javaContainer"); + writer.WriteStringValue(JavaContainer); + } + if (Optional.IsDefined(JavaContainerVersion)) + { + writer.WritePropertyName("javaContainerVersion"); + writer.WriteStringValue(JavaContainerVersion); + } + if (Optional.IsDefined(AppCommandLine)) + { + writer.WritePropertyName("appCommandLine"); + writer.WriteStringValue(AppCommandLine); + } + if (Optional.IsDefined(ManagedPipelineMode)) + { + writer.WritePropertyName("managedPipelineMode"); + writer.WriteStringValue(ManagedPipelineMode.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(VirtualApplications)) + { + writer.WritePropertyName("virtualApplications"); + writer.WriteStartArray(); + foreach (var item in VirtualApplications) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(LoadBalancing)) + { + writer.WritePropertyName("loadBalancing"); + writer.WriteStringValue(LoadBalancing.Value.ToSerialString()); + } + if (Optional.IsDefined(Experiments)) + { + writer.WritePropertyName("experiments"); + writer.WriteObjectValue(Experiments); + } + if (Optional.IsDefined(Limits)) + { + writer.WritePropertyName("limits"); + writer.WriteObjectValue(Limits); + } + if (Optional.IsDefined(AutoHealEnabled)) + { + writer.WritePropertyName("autoHealEnabled"); + writer.WriteBooleanValue(AutoHealEnabled.Value); + } + if (Optional.IsDefined(AutoHealRules)) + { + writer.WritePropertyName("autoHealRules"); + writer.WriteObjectValue(AutoHealRules); + } + if (Optional.IsDefined(TracingOptions)) + { + writer.WritePropertyName("tracingOptions"); + writer.WriteStringValue(TracingOptions); + } + if (Optional.IsDefined(VnetName)) + { + writer.WritePropertyName("vnetName"); + writer.WriteStringValue(VnetName); + } + if (Optional.IsDefined(VnetRouteAllEnabled)) + { + writer.WritePropertyName("vnetRouteAllEnabled"); + writer.WriteBooleanValue(VnetRouteAllEnabled.Value); + } + if (Optional.IsDefined(VnetPrivatePortsCount)) + { + writer.WritePropertyName("vnetPrivatePortsCount"); + writer.WriteNumberValue(VnetPrivatePortsCount.Value); + } + if (Optional.IsDefined(Cors)) + { + writer.WritePropertyName("cors"); + writer.WriteObjectValue(Cors); + } + if (Optional.IsDefined(Push)) + { + writer.WritePropertyName("push"); + writer.WriteObjectValue(Push); + } + if (Optional.IsDefined(ApiDefinition)) + { + writer.WritePropertyName("apiDefinition"); + writer.WriteObjectValue(ApiDefinition); + } + if (Optional.IsDefined(ApiManagementConfig)) + { + writer.WritePropertyName("apiManagementConfig"); + writer.WriteObjectValue(ApiManagementConfig); + } + if (Optional.IsDefined(AutoSwapSlotName)) + { + writer.WritePropertyName("autoSwapSlotName"); + writer.WriteStringValue(AutoSwapSlotName); + } + if (Optional.IsDefined(LocalMySqlEnabled)) + { + writer.WritePropertyName("localMySqlEnabled"); + writer.WriteBooleanValue(LocalMySqlEnabled.Value); + } + if (Optional.IsDefined(ManagedServiceIdentityId)) + { + writer.WritePropertyName("managedServiceIdentityId"); + writer.WriteNumberValue(ManagedServiceIdentityId.Value); + } + if (Optional.IsDefined(XManagedServiceIdentityId)) + { + writer.WritePropertyName("xManagedServiceIdentityId"); + writer.WriteNumberValue(XManagedServiceIdentityId.Value); + } + if (Optional.IsDefined(KeyVaultReferenceIdentity)) + { + writer.WritePropertyName("keyVaultReferenceIdentity"); + writer.WriteStringValue(KeyVaultReferenceIdentity); + } + if (Optional.IsCollectionDefined(IpSecurityRestrictions)) + { + writer.WritePropertyName("ipSecurityRestrictions"); + writer.WriteStartArray(); + foreach (var item in IpSecurityRestrictions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ScmIpSecurityRestrictions)) + { + writer.WritePropertyName("scmIpSecurityRestrictions"); + writer.WriteStartArray(); + foreach (var item in ScmIpSecurityRestrictions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ScmIpSecurityRestrictionsUseMain)) + { + writer.WritePropertyName("scmIpSecurityRestrictionsUseMain"); + writer.WriteBooleanValue(ScmIpSecurityRestrictionsUseMain.Value); + } + if (Optional.IsDefined(Http20Enabled)) + { + writer.WritePropertyName("http20Enabled"); + writer.WriteBooleanValue(Http20Enabled.Value); + } + if (Optional.IsDefined(MinTlsVersion)) + { + writer.WritePropertyName("minTlsVersion"); + writer.WriteStringValue(MinTlsVersion.Value.ToString()); + } + if (Optional.IsDefined(ScmMinTlsVersion)) + { + writer.WritePropertyName("scmMinTlsVersion"); + writer.WriteStringValue(ScmMinTlsVersion.Value.ToString()); + } + if (Optional.IsDefined(FtpsState)) + { + writer.WritePropertyName("ftpsState"); + writer.WriteStringValue(FtpsState.Value.ToString()); + } + if (Optional.IsDefined(PreWarmedInstanceCount)) + { + writer.WritePropertyName("preWarmedInstanceCount"); + writer.WriteNumberValue(PreWarmedInstanceCount.Value); + } + if (Optional.IsDefined(FunctionAppScaleLimit)) + { + writer.WritePropertyName("functionAppScaleLimit"); + writer.WriteNumberValue(FunctionAppScaleLimit.Value); + } + if (Optional.IsDefined(HealthCheckPath)) + { + writer.WritePropertyName("healthCheckPath"); + writer.WriteStringValue(HealthCheckPath); + } + if (Optional.IsDefined(FunctionsRuntimeScaleMonitoringEnabled)) + { + writer.WritePropertyName("functionsRuntimeScaleMonitoringEnabled"); + writer.WriteBooleanValue(FunctionsRuntimeScaleMonitoringEnabled.Value); + } + if (Optional.IsDefined(WebsiteTimeZone)) + { + writer.WritePropertyName("websiteTimeZone"); + writer.WriteStringValue(WebsiteTimeZone); + } + if (Optional.IsDefined(MinimumElasticInstanceCount)) + { + writer.WritePropertyName("minimumElasticInstanceCount"); + writer.WriteNumberValue(MinimumElasticInstanceCount.Value); + } + if (Optional.IsCollectionDefined(AzureStorageAccounts)) + { + writer.WritePropertyName("azureStorageAccounts"); + writer.WriteStartObject(); + foreach (var item in AzureStorageAccounts) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"); + writer.WriteStringValue(PublicNetworkAccess); + } + writer.WriteEndObject(); + } + + internal static SiteConfig DeserializeSiteConfig(JsonElement element) + { + Optional numberOfWorkers = default; + Optional> defaultDocuments = default; + Optional netFrameworkVersion = default; + Optional phpVersion = default; + Optional pythonVersion = default; + Optional nodeVersion = default; + Optional powerShellVersion = default; + Optional linuxFxVersion = default; + Optional windowsFxVersion = default; + Optional requestTracingEnabled = default; + Optional requestTracingExpirationTime = default; + Optional remoteDebuggingEnabled = default; + Optional remoteDebuggingVersion = default; + Optional httpLoggingEnabled = default; + Optional logsDirectorySizeLimit = default; + Optional detailedErrorLoggingEnabled = default; + Optional publishingUsername = default; + Optional> appSettings = default; + Optional> connectionStrings = default; + Optional machineKey = default; + Optional> handlerMappings = default; + Optional documentRoot = default; + Optional scmType = default; + Optional use32BitWorkerProcess = default; + Optional webSocketsEnabled = default; + Optional alwaysOn = default; + Optional javaVersion = default; + Optional javaContainer = default; + Optional javaContainerVersion = default; + Optional appCommandLine = default; + Optional managedPipelineMode = default; + Optional> virtualApplications = default; + Optional loadBalancing = default; + Optional experiments = default; + Optional limits = default; + Optional autoHealEnabled = default; + Optional autoHealRules = default; + Optional tracingOptions = default; + Optional vnetName = default; + Optional vnetRouteAllEnabled = default; + Optional vnetPrivatePortsCount = default; + Optional cors = default; + Optional push = default; + Optional apiDefinition = default; + Optional apiManagementConfig = default; + Optional autoSwapSlotName = default; + Optional localMySqlEnabled = default; + Optional managedServiceIdentityId = default; + Optional xManagedServiceIdentityId = default; + Optional keyVaultReferenceIdentity = default; + Optional> ipSecurityRestrictions = default; + Optional> scmIpSecurityRestrictions = default; + Optional scmIpSecurityRestrictionsUseMain = default; + Optional http20Enabled = default; + Optional minTlsVersion = default; + Optional scmMinTlsVersion = default; + Optional ftpsState = default; + Optional preWarmedInstanceCount = default; + Optional functionAppScaleLimit = default; + Optional healthCheckPath = default; + Optional functionsRuntimeScaleMonitoringEnabled = default; + Optional websiteTimeZone = default; + Optional minimumElasticInstanceCount = default; + Optional> azureStorageAccounts = default; + Optional publicNetworkAccess = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numberOfWorkers")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfWorkers = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("defaultDocuments")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + defaultDocuments = array; + continue; + } + if (property.NameEquals("netFrameworkVersion")) + { + netFrameworkVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("phpVersion")) + { + phpVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("pythonVersion")) + { + pythonVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("nodeVersion")) + { + nodeVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("powerShellVersion")) + { + powerShellVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("linuxFxVersion")) + { + linuxFxVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("windowsFxVersion")) + { + windowsFxVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("requestTracingEnabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + requestTracingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("requestTracingExpirationTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + requestTracingExpirationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("remoteDebuggingEnabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + remoteDebuggingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("remoteDebuggingVersion")) + { + remoteDebuggingVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("httpLoggingEnabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + httpLoggingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("logsDirectorySizeLimit")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + logsDirectorySizeLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("detailedErrorLoggingEnabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + detailedErrorLoggingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("publishingUsername")) + { + publishingUsername = property.Value.GetString(); + continue; + } + if (property.NameEquals("appSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePair.DeserializeNameValuePair(item)); + } + appSettings = array; + continue; + } + if (property.NameEquals("connectionStrings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConnStringInfo.DeserializeConnStringInfo(item)); + } + connectionStrings = array; + continue; + } + if (property.NameEquals("machineKey")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + machineKey = SiteMachineKey.DeserializeSiteMachineKey(property.Value); + continue; + } + if (property.NameEquals("handlerMappings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HandlerMapping.DeserializeHandlerMapping(item)); + } + handlerMappings = array; + continue; + } + if (property.NameEquals("documentRoot")) + { + documentRoot = property.Value.GetString(); + continue; + } + if (property.NameEquals("scmType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + scmType = new ScmType(property.Value.GetString()); + continue; + } + if (property.NameEquals("use32BitWorkerProcess")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + use32BitWorkerProcess = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("webSocketsEnabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + webSocketsEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("alwaysOn")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + alwaysOn = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("javaVersion")) + { + javaVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("javaContainer")) + { + javaContainer = property.Value.GetString(); + continue; + } + if (property.NameEquals("javaContainerVersion")) + { + javaContainerVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("appCommandLine")) + { + appCommandLine = property.Value.GetString(); + continue; + } + if (property.NameEquals("managedPipelineMode")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + managedPipelineMode = property.Value.GetString().ToManagedPipelineMode(); + continue; + } + if (property.NameEquals("virtualApplications")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VirtualApplication.DeserializeVirtualApplication(item)); + } + virtualApplications = array; + continue; + } + if (property.NameEquals("loadBalancing")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + loadBalancing = property.Value.GetString().ToSiteLoadBalancing(); + continue; + } + if (property.NameEquals("experiments")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + experiments = Experiments.DeserializeExperiments(property.Value); + continue; + } + if (property.NameEquals("limits")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + limits = SiteLimits.DeserializeSiteLimits(property.Value); + continue; + } + if (property.NameEquals("autoHealEnabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + autoHealEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("autoHealRules")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + autoHealRules = AutoHealRules.DeserializeAutoHealRules(property.Value); + continue; + } + if (property.NameEquals("tracingOptions")) + { + tracingOptions = property.Value.GetString(); + continue; + } + if (property.NameEquals("vnetName")) + { + vnetName = property.Value.GetString(); + continue; + } + if (property.NameEquals("vnetRouteAllEnabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + vnetRouteAllEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("vnetPrivatePortsCount")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + vnetPrivatePortsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("cors")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + cors = CorsSettings.DeserializeCorsSettings(property.Value); + continue; + } + if (property.NameEquals("push")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + push = PushSettings.DeserializePushSettings(property.Value); + continue; + } + if (property.NameEquals("apiDefinition")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + apiDefinition = ApiDefinitionInfo.DeserializeApiDefinitionInfo(property.Value); + continue; + } + if (property.NameEquals("apiManagementConfig")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + apiManagementConfig = ApiManagementConfig.DeserializeApiManagementConfig(property.Value); + continue; + } + if (property.NameEquals("autoSwapSlotName")) + { + autoSwapSlotName = property.Value.GetString(); + continue; + } + if (property.NameEquals("localMySqlEnabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + localMySqlEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("managedServiceIdentityId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + managedServiceIdentityId = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("xManagedServiceIdentityId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + xManagedServiceIdentityId = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("keyVaultReferenceIdentity")) + { + keyVaultReferenceIdentity = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipSecurityRestrictions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IpSecurityRestriction.DeserializeIpSecurityRestriction(item)); + } + ipSecurityRestrictions = array; + continue; + } + if (property.NameEquals("scmIpSecurityRestrictions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IpSecurityRestriction.DeserializeIpSecurityRestriction(item)); + } + scmIpSecurityRestrictions = array; + continue; + } + if (property.NameEquals("scmIpSecurityRestrictionsUseMain")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + scmIpSecurityRestrictionsUseMain = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("http20Enabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + http20Enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("minTlsVersion")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + minTlsVersion = new SupportedTlsVersions(property.Value.GetString()); + continue; + } + if (property.NameEquals("scmMinTlsVersion")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + scmMinTlsVersion = new SupportedTlsVersions(property.Value.GetString()); + continue; + } + if (property.NameEquals("ftpsState")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + ftpsState = new FtpsState(property.Value.GetString()); + continue; + } + if (property.NameEquals("preWarmedInstanceCount")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + preWarmedInstanceCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("functionAppScaleLimit")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + functionAppScaleLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("healthCheckPath")) + { + healthCheckPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("functionsRuntimeScaleMonitoringEnabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + functionsRuntimeScaleMonitoringEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("websiteTimeZone")) + { + websiteTimeZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("minimumElasticInstanceCount")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + minimumElasticInstanceCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("azureStorageAccounts")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, AzureStorageInfoValue.DeserializeAzureStorageInfoValue(property0.Value)); + } + azureStorageAccounts = dictionary; + continue; + } + if (property.NameEquals("publicNetworkAccess")) + { + publicNetworkAccess = property.Value.GetString(); + continue; + } + } + return new SiteConfig(Optional.ToNullable(numberOfWorkers), Optional.ToList(defaultDocuments), netFrameworkVersion.Value, phpVersion.Value, pythonVersion.Value, nodeVersion.Value, powerShellVersion.Value, linuxFxVersion.Value, windowsFxVersion.Value, Optional.ToNullable(requestTracingEnabled), Optional.ToNullable(requestTracingExpirationTime), Optional.ToNullable(remoteDebuggingEnabled), remoteDebuggingVersion.Value, Optional.ToNullable(httpLoggingEnabled), Optional.ToNullable(logsDirectorySizeLimit), Optional.ToNullable(detailedErrorLoggingEnabled), publishingUsername.Value, Optional.ToList(appSettings), Optional.ToList(connectionStrings), machineKey.Value, Optional.ToList(handlerMappings), documentRoot.Value, Optional.ToNullable(scmType), Optional.ToNullable(use32BitWorkerProcess), Optional.ToNullable(webSocketsEnabled), Optional.ToNullable(alwaysOn), javaVersion.Value, javaContainer.Value, javaContainerVersion.Value, appCommandLine.Value, Optional.ToNullable(managedPipelineMode), Optional.ToList(virtualApplications), Optional.ToNullable(loadBalancing), experiments.Value, limits.Value, Optional.ToNullable(autoHealEnabled), autoHealRules.Value, tracingOptions.Value, vnetName.Value, Optional.ToNullable(vnetRouteAllEnabled), Optional.ToNullable(vnetPrivatePortsCount), cors.Value, push.Value, apiDefinition.Value, apiManagementConfig.Value, autoSwapSlotName.Value, Optional.ToNullable(localMySqlEnabled), Optional.ToNullable(managedServiceIdentityId), Optional.ToNullable(xManagedServiceIdentityId), keyVaultReferenceIdentity.Value, Optional.ToList(ipSecurityRestrictions), Optional.ToList(scmIpSecurityRestrictions), Optional.ToNullable(scmIpSecurityRestrictionsUseMain), Optional.ToNullable(http20Enabled), Optional.ToNullable(minTlsVersion), Optional.ToNullable(scmMinTlsVersion), Optional.ToNullable(ftpsState), Optional.ToNullable(preWarmedInstanceCount), Optional.ToNullable(functionAppScaleLimit), healthCheckPath.Value, Optional.ToNullable(functionsRuntimeScaleMonitoringEnabled), websiteTimeZone.Value, Optional.ToNullable(minimumElasticInstanceCount), Optional.ToDictionary(azureStorageAccounts), publicNetworkAccess.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs index 09a72225be37..89c4ac9f7114 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs @@ -1,136 +1,112 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Configuration of an App Service app. - /// + /// Configuration of an App Service app. public partial class SiteConfig { - /// - /// Initializes a new instance of the SiteConfig class. - /// + /// Initializes a new instance of SiteConfig. public SiteConfig() { - CustomInit(); + DefaultDocuments = new ChangeTrackingList(); + AppSettings = new ChangeTrackingList(); + ConnectionStrings = new ChangeTrackingList(); + HandlerMappings = new ChangeTrackingList(); + VirtualApplications = new ChangeTrackingList(); + IpSecurityRestrictions = new ChangeTrackingList(); + ScmIpSecurityRestrictions = new ChangeTrackingList(); + AzureStorageAccounts = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the SiteConfig class. - /// - /// Number of workers. - /// Default documents. - /// .NET Framework version. - /// Version of PHP. - /// Version of Python. - /// Version of Node.js. - /// Version of PowerShell. - /// Linux App Framework and - /// version - /// Xenon App Framework and - /// version - /// <code>true</code> - /// if request tracing is enabled; otherwise, - /// <code>false</code>. - /// Request tracing - /// expiration time. - /// <code>true</code> - /// if remote debugging is enabled; otherwise, - /// <code>false</code>. - /// Remote debugging - /// version. - /// <code>true</code> if - /// HTTP logging is enabled; otherwise, - /// <code>false</code>. - /// HTTP logs directory size - /// limit. - /// <code>true</code> if - /// detailed error logging is enabled; otherwise, - /// <code>false</code>. - /// Publishing user name. - /// Application settings. - /// Connection strings. - /// Site MachineKey. - /// Handler mappings. - /// Document root. - /// SCM type. Possible values include: 'None', - /// 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', - /// 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', - /// 'ExternalHg', 'OneDrive', 'VSO', 'VSTSRM' - /// <code>true</code> - /// to use 32-bit worker process; otherwise, - /// <code>false</code>. - /// <code>true</code> if - /// WebSocket is enabled; otherwise, - /// <code>false</code>. - /// <code>true</code> if Always On - /// is enabled; otherwise, <code>false</code>. - /// Java version. - /// Java container. - /// Java container version. - /// App command line to launch. - /// Managed pipeline mode. Possible - /// values include: 'Integrated', 'Classic' - /// Virtual applications. - /// Site load balancing. Possible values - /// include: 'WeightedRoundRobin', 'LeastRequests', - /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' - /// This is work around for polymorphic - /// types. - /// Site limits. - /// <code>true</code> if Auto - /// Heal is enabled; otherwise, <code>false</code>. - /// Auto Heal rules. - /// Tracing options. - /// Virtual Network name. - /// Cross-Origin Resource Sharing (CORS) - /// settings. - /// Push endpoint settings. - /// Information about the formal API - /// definition for the app. - /// Azure API management settings - /// linked to the app. - /// Auto-swap slot name. - /// <code>true</code> to - /// enable local MySQL; otherwise, - /// <code>false</code>. - /// Managed Service Identity - /// Id - /// Explicit Managed Service - /// Identity Id - /// IP security restrictions for - /// main. - /// IP security restrictions - /// for scm. - /// IP security - /// restrictions for scm to use main. - /// Http20Enabled: configures a web site to - /// allow clients to connect over http2.0 - /// MinTlsVersion: configures the minimum - /// version of TLS required for SSL requests. Possible values include: - /// '1.0', '1.1', '1.2' - /// State of FTP / FTPS service. Possible - /// values include: 'AllAllowed', 'FtpsOnly', 'Disabled' - /// Number of preWarmed instances. - /// This setting only applies to the Consumption and Elastic - /// Plans - /// Health check path - public SiteConfig(int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), string healthCheckPath = default(string)) + /// Initializes a new instance of SiteConfig. + /// Number of workers. + /// Default documents. + /// .NET Framework version. + /// Version of PHP. + /// Version of Python. + /// Version of Node.js. + /// Version of PowerShell. + /// Linux App Framework and version. + /// Xenon App Framework and version. + /// <code>true</code> if request tracing is enabled; otherwise, <code>false</code>. + /// Request tracing expiration time. + /// <code>true</code> if remote debugging is enabled; otherwise, <code>false</code>. + /// Remote debugging version. + /// <code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>. + /// HTTP logs directory size limit. + /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. + /// Publishing user name. + /// Application settings. + /// Connection strings. + /// Site MachineKey. + /// Handler mappings. + /// Document root. + /// SCM type. + /// <code>true</code> to use 32-bit worker process; otherwise, <code>false</code>. + /// <code>true</code> if WebSocket is enabled; otherwise, <code>false</code>. + /// <code>true</code> if Always On is enabled; otherwise, <code>false</code>. + /// Java version. + /// Java container. + /// Java container version. + /// App command line to launch. + /// Managed pipeline mode. + /// Virtual applications. + /// Site load balancing. + /// This is work around for polymorphic types. + /// Site limits. + /// <code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>. + /// Auto Heal rules. + /// Tracing options. + /// Virtual Network name. + /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. + /// The number of private ports assigned to this app. These will be assigned dynamically on runtime. + /// Cross-Origin Resource Sharing (CORS) settings. + /// Push endpoint settings. + /// Information about the formal API definition for the app. + /// Azure API management settings linked to the app. + /// Auto-swap slot name. + /// <code>true</code> to enable local MySQL; otherwise, <code>false</code>. + /// Managed Service Identity Id. + /// Explicit Managed Service Identity Id. + /// Identity to use for Key Vault Reference authentication. + /// IP security restrictions for main. + /// IP security restrictions for scm. + /// IP security restrictions for scm to use main. + /// Http20Enabled: configures a web site to allow clients to connect over http2.0. + /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. + /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. + /// State of FTP / FTPS service. + /// + /// Number of preWarmed instances. + /// This setting only applies to the Consumption and Elastic Plans. + /// + /// + /// Maximum number of workers that a site can scale out to. + /// This setting only applies to the Consumption and Elastic Premium Plans. + /// + /// Health check path. + /// + /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but will instead call to the + /// runtime to get scale status. + /// + /// Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + /// + /// Number of minimum instance count for a site + /// This setting only applies to the Elastic Plans. + /// + /// List of Azure Storage Accounts. + /// Property to allow or block all public traffic. + internal SiteConfig(int? numberOfWorkers, IList defaultDocuments, string netFrameworkVersion, string phpVersion, string pythonVersion, string nodeVersion, string powerShellVersion, string linuxFxVersion, string windowsFxVersion, bool? requestTracingEnabled, DateTimeOffset? requestTracingExpirationTime, bool? remoteDebuggingEnabled, string remoteDebuggingVersion, bool? httpLoggingEnabled, int? logsDirectorySizeLimit, bool? detailedErrorLoggingEnabled, string publishingUsername, IList appSettings, IList connectionStrings, SiteMachineKey machineKey, IList handlerMappings, string documentRoot, ScmType? scmType, bool? use32BitWorkerProcess, bool? webSocketsEnabled, bool? alwaysOn, string javaVersion, string javaContainer, string javaContainerVersion, string appCommandLine, ManagedPipelineMode? managedPipelineMode, IList virtualApplications, SiteLoadBalancing? loadBalancing, Experiments experiments, SiteLimits limits, bool? autoHealEnabled, AutoHealRules autoHealRules, string tracingOptions, string vnetName, bool? vnetRouteAllEnabled, int? vnetPrivatePortsCount, CorsSettings cors, PushSettings push, ApiDefinitionInfo apiDefinition, ApiManagementConfig apiManagementConfig, string autoSwapSlotName, bool? localMySqlEnabled, int? managedServiceIdentityId, int? xManagedServiceIdentityId, string keyVaultReferenceIdentity, IList ipSecurityRestrictions, IList scmIpSecurityRestrictions, bool? scmIpSecurityRestrictionsUseMain, bool? http20Enabled, SupportedTlsVersions? minTlsVersion, SupportedTlsVersions? scmMinTlsVersion, FtpsState? ftpsState, int? preWarmedInstanceCount, int? functionAppScaleLimit, string healthCheckPath, bool? functionsRuntimeScaleMonitoringEnabled, string websiteTimeZone, int? minimumElasticInstanceCount, IDictionary azureStorageAccounts, string publicNetworkAccess) { NumberOfWorkers = numberOfWorkers; DefaultDocuments = defaultDocuments; @@ -171,6 +147,8 @@ public SiteConfig() AutoHealRules = autoHealRules; TracingOptions = tracingOptions; VnetName = vnetName; + VnetRouteAllEnabled = vnetRouteAllEnabled; + VnetPrivatePortsCount = vnetPrivatePortsCount; Cors = cors; Push = push; ApiDefinition = apiDefinition; @@ -179,402 +157,166 @@ public SiteConfig() LocalMySqlEnabled = localMySqlEnabled; ManagedServiceIdentityId = managedServiceIdentityId; XManagedServiceIdentityId = xManagedServiceIdentityId; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; IpSecurityRestrictions = ipSecurityRestrictions; ScmIpSecurityRestrictions = scmIpSecurityRestrictions; ScmIpSecurityRestrictionsUseMain = scmIpSecurityRestrictionsUseMain; Http20Enabled = http20Enabled; MinTlsVersion = minTlsVersion; + ScmMinTlsVersion = scmMinTlsVersion; FtpsState = ftpsState; PreWarmedInstanceCount = preWarmedInstanceCount; + FunctionAppScaleLimit = functionAppScaleLimit; HealthCheckPath = healthCheckPath; - CustomInit(); + FunctionsRuntimeScaleMonitoringEnabled = functionsRuntimeScaleMonitoringEnabled; + WebsiteTimeZone = websiteTimeZone; + MinimumElasticInstanceCount = minimumElasticInstanceCount; + AzureStorageAccounts = azureStorageAccounts; + PublicNetworkAccess = publicNetworkAccess; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets number of workers. - /// - [JsonProperty(PropertyName = "numberOfWorkers")] + /// Number of workers. public int? NumberOfWorkers { get; set; } - - /// - /// Gets or sets default documents. - /// - [JsonProperty(PropertyName = "defaultDocuments")] - public IList DefaultDocuments { get; set; } - - /// - /// Gets or sets .NET Framework version. - /// - [JsonProperty(PropertyName = "netFrameworkVersion")] + /// Default documents. + public IList DefaultDocuments { get; } + /// .NET Framework version. public string NetFrameworkVersion { get; set; } - - /// - /// Gets or sets version of PHP. - /// - [JsonProperty(PropertyName = "phpVersion")] + /// Version of PHP. public string PhpVersion { get; set; } - - /// - /// Gets or sets version of Python. - /// - [JsonProperty(PropertyName = "pythonVersion")] + /// Version of Python. public string PythonVersion { get; set; } - - /// - /// Gets or sets version of Node.js. - /// - [JsonProperty(PropertyName = "nodeVersion")] + /// Version of Node.js. public string NodeVersion { get; set; } - - /// - /// Gets or sets version of PowerShell. - /// - [JsonProperty(PropertyName = "powerShellVersion")] + /// Version of PowerShell. public string PowerShellVersion { get; set; } - - /// - /// Gets or sets linux App Framework and version - /// - [JsonProperty(PropertyName = "linuxFxVersion")] + /// Linux App Framework and version. public string LinuxFxVersion { get; set; } - - /// - /// Gets or sets xenon App Framework and version - /// - [JsonProperty(PropertyName = "windowsFxVersion")] + /// Xenon App Framework and version. public string WindowsFxVersion { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// request tracing is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "requestTracingEnabled")] + /// <code>true</code> if request tracing is enabled; otherwise, <code>false</code>. public bool? RequestTracingEnabled { get; set; } - - /// - /// Gets or sets request tracing expiration time. - /// - [JsonProperty(PropertyName = "requestTracingExpirationTime")] - public System.DateTime? RequestTracingExpirationTime { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// remote debugging is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "remoteDebuggingEnabled")] + /// Request tracing expiration time. + public DateTimeOffset? RequestTracingExpirationTime { get; set; } + /// <code>true</code> if remote debugging is enabled; otherwise, <code>false</code>. public bool? RemoteDebuggingEnabled { get; set; } - - /// - /// Gets or sets remote debugging version. - /// - [JsonProperty(PropertyName = "remoteDebuggingVersion")] + /// Remote debugging version. public string RemoteDebuggingVersion { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if HTTP - /// logging is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "httpLoggingEnabled")] + /// <code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>. public bool? HttpLoggingEnabled { get; set; } - - /// - /// Gets or sets HTTP logs directory size limit. - /// - [JsonProperty(PropertyName = "logsDirectorySizeLimit")] + /// HTTP logs directory size limit. public int? LogsDirectorySizeLimit { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// detailed error logging is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "detailedErrorLoggingEnabled")] + /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. public bool? DetailedErrorLoggingEnabled { get; set; } - - /// - /// Gets or sets publishing user name. - /// - [JsonProperty(PropertyName = "publishingUsername")] + /// Publishing user name. public string PublishingUsername { get; set; } - - /// - /// Gets or sets application settings. - /// - [JsonProperty(PropertyName = "appSettings")] - public IList AppSettings { get; set; } - - /// - /// Gets or sets connection strings. - /// - [JsonProperty(PropertyName = "connectionStrings")] - public IList ConnectionStrings { get; set; } - - /// - /// Gets site MachineKey. - /// - [JsonProperty(PropertyName = "machineKey")] - public SiteMachineKey MachineKey { get; private set; } - - /// - /// Gets or sets handler mappings. - /// - [JsonProperty(PropertyName = "handlerMappings")] - public IList HandlerMappings { get; set; } - - /// - /// Gets or sets document root. - /// - [JsonProperty(PropertyName = "documentRoot")] + /// Application settings. + public IList AppSettings { get; } + /// Connection strings. + public IList ConnectionStrings { get; } + /// Site MachineKey. + public SiteMachineKey MachineKey { get; } + /// Handler mappings. + public IList HandlerMappings { get; } + /// Document root. public string DocumentRoot { get; set; } - - /// - /// Gets or sets SCM type. Possible values include: 'None', 'Dropbox', - /// 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', - /// 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', - /// 'OneDrive', 'VSO', 'VSTSRM' - /// - [JsonProperty(PropertyName = "scmType")] - public string ScmType { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to use - /// 32-bit worker process; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "use32BitWorkerProcess")] + /// SCM type. + public ScmType? ScmType { get; set; } + /// <code>true</code> to use 32-bit worker process; otherwise, <code>false</code>. public bool? Use32BitWorkerProcess { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// WebSocket is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "webSocketsEnabled")] + /// <code>true</code> if WebSocket is enabled; otherwise, <code>false</code>. public bool? WebSocketsEnabled { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// Always On is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "alwaysOn")] + /// <code>true</code> if Always On is enabled; otherwise, <code>false</code>. public bool? AlwaysOn { get; set; } - - /// - /// Gets or sets java version. - /// - [JsonProperty(PropertyName = "javaVersion")] + /// Java version. public string JavaVersion { get; set; } - - /// - /// Gets or sets java container. - /// - [JsonProperty(PropertyName = "javaContainer")] + /// Java container. public string JavaContainer { get; set; } - - /// - /// Gets or sets java container version. - /// - [JsonProperty(PropertyName = "javaContainerVersion")] + /// Java container version. public string JavaContainerVersion { get; set; } - - /// - /// Gets or sets app command line to launch. - /// - [JsonProperty(PropertyName = "appCommandLine")] + /// App command line to launch. public string AppCommandLine { get; set; } - - /// - /// Gets or sets managed pipeline mode. Possible values include: - /// 'Integrated', 'Classic' - /// - [JsonProperty(PropertyName = "managedPipelineMode")] + /// Managed pipeline mode. public ManagedPipelineMode? ManagedPipelineMode { get; set; } - - /// - /// Gets or sets virtual applications. - /// - [JsonProperty(PropertyName = "virtualApplications")] - public IList VirtualApplications { get; set; } - - /// - /// Gets or sets site load balancing. Possible values include: - /// 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - /// 'WeightedTotalTraffic', 'RequestHash' - /// - [JsonProperty(PropertyName = "loadBalancing")] + /// Virtual applications. + public IList VirtualApplications { get; } + /// Site load balancing. public SiteLoadBalancing? LoadBalancing { get; set; } - - /// - /// Gets or sets this is work around for polymorphic types. - /// - [JsonProperty(PropertyName = "experiments")] + /// This is work around for polymorphic types. public Experiments Experiments { get; set; } - - /// - /// Gets or sets site limits. - /// - [JsonProperty(PropertyName = "limits")] + /// Site limits. public SiteLimits Limits { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if Auto - /// Heal is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "autoHealEnabled")] + /// <code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>. public bool? AutoHealEnabled { get; set; } - - /// - /// Gets or sets auto Heal rules. - /// - [JsonProperty(PropertyName = "autoHealRules")] + /// Auto Heal rules. public AutoHealRules AutoHealRules { get; set; } - - /// - /// Gets or sets tracing options. - /// - [JsonProperty(PropertyName = "tracingOptions")] + /// Tracing options. public string TracingOptions { get; set; } - - /// - /// Gets or sets virtual Network name. - /// - [JsonProperty(PropertyName = "vnetName")] + /// Virtual Network name. public string VnetName { get; set; } - - /// - /// Gets or sets cross-Origin Resource Sharing (CORS) settings. - /// - [JsonProperty(PropertyName = "cors")] + /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. + public bool? VnetRouteAllEnabled { get; set; } + /// The number of private ports assigned to this app. These will be assigned dynamically on runtime. + public int? VnetPrivatePortsCount { get; set; } + /// Cross-Origin Resource Sharing (CORS) settings. public CorsSettings Cors { get; set; } - - /// - /// Gets or sets push endpoint settings. - /// - [JsonProperty(PropertyName = "push")] + /// Push endpoint settings. public PushSettings Push { get; set; } - - /// - /// Gets or sets information about the formal API definition for the - /// app. - /// - [JsonProperty(PropertyName = "apiDefinition")] + /// Information about the formal API definition for the app. public ApiDefinitionInfo ApiDefinition { get; set; } - - /// - /// Gets or sets azure API management settings linked to the app. - /// - [JsonProperty(PropertyName = "apiManagementConfig")] + /// Azure API management settings linked to the app. public ApiManagementConfig ApiManagementConfig { get; set; } - - /// - /// Gets or sets auto-swap slot name. - /// - [JsonProperty(PropertyName = "autoSwapSlotName")] + /// Auto-swap slot name. public string AutoSwapSlotName { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// enable local MySQL; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "localMySqlEnabled")] + /// <code>true</code> to enable local MySQL; otherwise, <code>false</code>. public bool? LocalMySqlEnabled { get; set; } - - /// - /// Gets or sets managed Service Identity Id - /// - [JsonProperty(PropertyName = "managedServiceIdentityId")] + /// Managed Service Identity Id. public int? ManagedServiceIdentityId { get; set; } - - /// - /// Gets or sets explicit Managed Service Identity Id - /// - [JsonProperty(PropertyName = "xManagedServiceIdentityId")] + /// Explicit Managed Service Identity Id. public int? XManagedServiceIdentityId { get; set; } - - /// - /// Gets or sets IP security restrictions for main. - /// - [JsonProperty(PropertyName = "ipSecurityRestrictions")] - public IList IpSecurityRestrictions { get; set; } - - /// - /// Gets or sets IP security restrictions for scm. - /// - [JsonProperty(PropertyName = "scmIpSecurityRestrictions")] - public IList ScmIpSecurityRestrictions { get; set; } - - /// - /// Gets or sets IP security restrictions for scm to use main. - /// - [JsonProperty(PropertyName = "scmIpSecurityRestrictionsUseMain")] + /// Identity to use for Key Vault Reference authentication. + public string KeyVaultReferenceIdentity { get; set; } + /// IP security restrictions for main. + public IList IpSecurityRestrictions { get; } + /// IP security restrictions for scm. + public IList ScmIpSecurityRestrictions { get; } + /// IP security restrictions for scm to use main. public bool? ScmIpSecurityRestrictionsUseMain { get; set; } - - /// - /// Gets or sets http20Enabled: configures a web site to allow clients - /// to connect over http2.0 - /// - [JsonProperty(PropertyName = "http20Enabled")] + /// Http20Enabled: configures a web site to allow clients to connect over http2.0. public bool? Http20Enabled { get; set; } - - /// - /// Gets or sets minTlsVersion: configures the minimum version of TLS - /// required for SSL requests. Possible values include: '1.0', '1.1', - /// '1.2' - /// - [JsonProperty(PropertyName = "minTlsVersion")] - public string MinTlsVersion { get; set; } - - /// - /// Gets or sets state of FTP / FTPS service. Possible values include: - /// 'AllAllowed', 'FtpsOnly', 'Disabled' - /// - [JsonProperty(PropertyName = "ftpsState")] - public string FtpsState { get; set; } - + /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. + public SupportedTlsVersions? MinTlsVersion { get; set; } + /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. + public SupportedTlsVersions? ScmMinTlsVersion { get; set; } + /// State of FTP / FTPS service. + public FtpsState? FtpsState { get; set; } /// - /// Gets or sets number of preWarmed instances. - /// This setting only applies to the Consumption and Elastic Plans + /// Number of preWarmed instances. + /// This setting only applies to the Consumption and Elastic Plans. /// - [JsonProperty(PropertyName = "preWarmedInstanceCount")] public int? PreWarmedInstanceCount { get; set; } - /// - /// Gets or sets health check path + /// Maximum number of workers that a site can scale out to. + /// This setting only applies to the Consumption and Elastic Premium Plans. /// - [JsonProperty(PropertyName = "healthCheckPath")] + public int? FunctionAppScaleLimit { get; set; } + /// Health check path. public string HealthCheckPath { get; set; } - /// - /// Validate the object. + /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but will instead call to the + /// runtime to get scale status. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Push != null) - { - Push.Validate(); - } - if (PreWarmedInstanceCount > 10) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PreWarmedInstanceCount", 10); - } - if (PreWarmedInstanceCount < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PreWarmedInstanceCount", 0); - } - } + public bool? FunctionsRuntimeScaleMonitoringEnabled { get; set; } + /// Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + public string WebsiteTimeZone { get; set; } + /// + /// Number of minimum instance count for a site + /// This setting only applies to the Elastic Plans. + /// + public int? MinimumElasticInstanceCount { get; set; } + /// List of Azure Storage Accounts. + public IDictionary AzureStorageAccounts { get; } + /// Property to allow or block all public traffic. + public string PublicNetworkAccess { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.Serialization.cs new file mode 100644 index 000000000000..bde4435a29a7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteConfigPropertiesDictionary + { + internal static SiteConfigPropertiesDictionary DeserializeSiteConfigPropertiesDictionary(JsonElement element) + { + Optional use32BitWorkerProcess = default; + Optional linuxFxVersion = default; + Optional javaVersion = default; + Optional powerShellVersion = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("use32BitWorkerProcess")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + use32BitWorkerProcess = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("linuxFxVersion")) + { + linuxFxVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("javaVersion")) + { + javaVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("powerShellVersion")) + { + powerShellVersion = property.Value.GetString(); + continue; + } + } + return new SiteConfigPropertiesDictionary(Optional.ToNullable(use32BitWorkerProcess), linuxFxVersion.Value, javaVersion.Value, powerShellVersion.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs new file mode 100644 index 000000000000..12358f470f1f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Site config properties dictionary. + public partial class SiteConfigPropertiesDictionary + { + /// Initializes a new instance of SiteConfigPropertiesDictionary. + internal SiteConfigPropertiesDictionary() + { + } + + /// Initializes a new instance of SiteConfigPropertiesDictionary. + /// <code>true</code> if use32BitWorkerProcess should be set to true for the stack; otherwise, <code>false</code>. + /// LinuxFxVersion configuration setting. + /// JavaVersion configuration setting. + /// PowerShellVersion configuration setting. + internal SiteConfigPropertiesDictionary(bool? use32BitWorkerProcess, string linuxFxVersion, string javaVersion, string powerShellVersion) + { + Use32BitWorkerProcess = use32BitWorkerProcess; + LinuxFxVersion = linuxFxVersion; + JavaVersion = javaVersion; + PowerShellVersion = powerShellVersion; + } + + /// <code>true</code> if use32BitWorkerProcess should be set to true for the stack; otherwise, <code>false</code>. + public bool? Use32BitWorkerProcess { get; } + /// LinuxFxVersion configuration setting. + public string LinuxFxVersion { get; } + /// JavaVersion configuration setting. + public string JavaVersion { get; } + /// PowerShellVersion configuration setting. + public string PowerShellVersion { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.Serialization.cs new file mode 100644 index 000000000000..0febe3afd474 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.Serialization.cs @@ -0,0 +1,1086 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteConfigResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(NumberOfWorkers)) + { + writer.WritePropertyName("numberOfWorkers"); + writer.WriteNumberValue(NumberOfWorkers.Value); + } + if (Optional.IsCollectionDefined(DefaultDocuments)) + { + writer.WritePropertyName("defaultDocuments"); + writer.WriteStartArray(); + foreach (var item in DefaultDocuments) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NetFrameworkVersion)) + { + writer.WritePropertyName("netFrameworkVersion"); + writer.WriteStringValue(NetFrameworkVersion); + } + if (Optional.IsDefined(PhpVersion)) + { + writer.WritePropertyName("phpVersion"); + writer.WriteStringValue(PhpVersion); + } + if (Optional.IsDefined(PythonVersion)) + { + writer.WritePropertyName("pythonVersion"); + writer.WriteStringValue(PythonVersion); + } + if (Optional.IsDefined(NodeVersion)) + { + writer.WritePropertyName("nodeVersion"); + writer.WriteStringValue(NodeVersion); + } + if (Optional.IsDefined(PowerShellVersion)) + { + writer.WritePropertyName("powerShellVersion"); + writer.WriteStringValue(PowerShellVersion); + } + if (Optional.IsDefined(LinuxFxVersion)) + { + writer.WritePropertyName("linuxFxVersion"); + writer.WriteStringValue(LinuxFxVersion); + } + if (Optional.IsDefined(WindowsFxVersion)) + { + writer.WritePropertyName("windowsFxVersion"); + writer.WriteStringValue(WindowsFxVersion); + } + if (Optional.IsDefined(RequestTracingEnabled)) + { + writer.WritePropertyName("requestTracingEnabled"); + writer.WriteBooleanValue(RequestTracingEnabled.Value); + } + if (Optional.IsDefined(RequestTracingExpirationTime)) + { + writer.WritePropertyName("requestTracingExpirationTime"); + writer.WriteStringValue(RequestTracingExpirationTime.Value, "O"); + } + if (Optional.IsDefined(RemoteDebuggingEnabled)) + { + writer.WritePropertyName("remoteDebuggingEnabled"); + writer.WriteBooleanValue(RemoteDebuggingEnabled.Value); + } + if (Optional.IsDefined(RemoteDebuggingVersion)) + { + writer.WritePropertyName("remoteDebuggingVersion"); + writer.WriteStringValue(RemoteDebuggingVersion); + } + if (Optional.IsDefined(HttpLoggingEnabled)) + { + writer.WritePropertyName("httpLoggingEnabled"); + writer.WriteBooleanValue(HttpLoggingEnabled.Value); + } + if (Optional.IsDefined(LogsDirectorySizeLimit)) + { + writer.WritePropertyName("logsDirectorySizeLimit"); + writer.WriteNumberValue(LogsDirectorySizeLimit.Value); + } + if (Optional.IsDefined(DetailedErrorLoggingEnabled)) + { + writer.WritePropertyName("detailedErrorLoggingEnabled"); + writer.WriteBooleanValue(DetailedErrorLoggingEnabled.Value); + } + if (Optional.IsDefined(PublishingUsername)) + { + writer.WritePropertyName("publishingUsername"); + writer.WriteStringValue(PublishingUsername); + } + if (Optional.IsCollectionDefined(AppSettings)) + { + writer.WritePropertyName("appSettings"); + writer.WriteStartArray(); + foreach (var item in AppSettings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ConnectionStrings)) + { + writer.WritePropertyName("connectionStrings"); + writer.WriteStartArray(); + foreach (var item in ConnectionStrings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(HandlerMappings)) + { + writer.WritePropertyName("handlerMappings"); + writer.WriteStartArray(); + foreach (var item in HandlerMappings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DocumentRoot)) + { + writer.WritePropertyName("documentRoot"); + writer.WriteStringValue(DocumentRoot); + } + if (Optional.IsDefined(ScmType)) + { + writer.WritePropertyName("scmType"); + writer.WriteStringValue(ScmType.Value.ToString()); + } + if (Optional.IsDefined(Use32BitWorkerProcess)) + { + writer.WritePropertyName("use32BitWorkerProcess"); + writer.WriteBooleanValue(Use32BitWorkerProcess.Value); + } + if (Optional.IsDefined(WebSocketsEnabled)) + { + writer.WritePropertyName("webSocketsEnabled"); + writer.WriteBooleanValue(WebSocketsEnabled.Value); + } + if (Optional.IsDefined(AlwaysOn)) + { + writer.WritePropertyName("alwaysOn"); + writer.WriteBooleanValue(AlwaysOn.Value); + } + if (Optional.IsDefined(JavaVersion)) + { + writer.WritePropertyName("javaVersion"); + writer.WriteStringValue(JavaVersion); + } + if (Optional.IsDefined(JavaContainer)) + { + writer.WritePropertyName("javaContainer"); + writer.WriteStringValue(JavaContainer); + } + if (Optional.IsDefined(JavaContainerVersion)) + { + writer.WritePropertyName("javaContainerVersion"); + writer.WriteStringValue(JavaContainerVersion); + } + if (Optional.IsDefined(AppCommandLine)) + { + writer.WritePropertyName("appCommandLine"); + writer.WriteStringValue(AppCommandLine); + } + if (Optional.IsDefined(ManagedPipelineMode)) + { + writer.WritePropertyName("managedPipelineMode"); + writer.WriteStringValue(ManagedPipelineMode.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(VirtualApplications)) + { + writer.WritePropertyName("virtualApplications"); + writer.WriteStartArray(); + foreach (var item in VirtualApplications) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(LoadBalancing)) + { + writer.WritePropertyName("loadBalancing"); + writer.WriteStringValue(LoadBalancing.Value.ToSerialString()); + } + if (Optional.IsDefined(Experiments)) + { + writer.WritePropertyName("experiments"); + writer.WriteObjectValue(Experiments); + } + if (Optional.IsDefined(Limits)) + { + writer.WritePropertyName("limits"); + writer.WriteObjectValue(Limits); + } + if (Optional.IsDefined(AutoHealEnabled)) + { + writer.WritePropertyName("autoHealEnabled"); + writer.WriteBooleanValue(AutoHealEnabled.Value); + } + if (Optional.IsDefined(AutoHealRules)) + { + writer.WritePropertyName("autoHealRules"); + writer.WriteObjectValue(AutoHealRules); + } + if (Optional.IsDefined(TracingOptions)) + { + writer.WritePropertyName("tracingOptions"); + writer.WriteStringValue(TracingOptions); + } + if (Optional.IsDefined(VnetName)) + { + writer.WritePropertyName("vnetName"); + writer.WriteStringValue(VnetName); + } + if (Optional.IsDefined(VnetRouteAllEnabled)) + { + writer.WritePropertyName("vnetRouteAllEnabled"); + writer.WriteBooleanValue(VnetRouteAllEnabled.Value); + } + if (Optional.IsDefined(VnetPrivatePortsCount)) + { + writer.WritePropertyName("vnetPrivatePortsCount"); + writer.WriteNumberValue(VnetPrivatePortsCount.Value); + } + if (Optional.IsDefined(Cors)) + { + writer.WritePropertyName("cors"); + writer.WriteObjectValue(Cors); + } + if (Optional.IsDefined(Push)) + { + writer.WritePropertyName("push"); + writer.WriteObjectValue(Push); + } + if (Optional.IsDefined(ApiDefinition)) + { + writer.WritePropertyName("apiDefinition"); + writer.WriteObjectValue(ApiDefinition); + } + if (Optional.IsDefined(ApiManagementConfig)) + { + writer.WritePropertyName("apiManagementConfig"); + writer.WriteObjectValue(ApiManagementConfig); + } + if (Optional.IsDefined(AutoSwapSlotName)) + { + writer.WritePropertyName("autoSwapSlotName"); + writer.WriteStringValue(AutoSwapSlotName); + } + if (Optional.IsDefined(LocalMySqlEnabled)) + { + writer.WritePropertyName("localMySqlEnabled"); + writer.WriteBooleanValue(LocalMySqlEnabled.Value); + } + if (Optional.IsDefined(ManagedServiceIdentityId)) + { + writer.WritePropertyName("managedServiceIdentityId"); + writer.WriteNumberValue(ManagedServiceIdentityId.Value); + } + if (Optional.IsDefined(XManagedServiceIdentityId)) + { + writer.WritePropertyName("xManagedServiceIdentityId"); + writer.WriteNumberValue(XManagedServiceIdentityId.Value); + } + if (Optional.IsDefined(KeyVaultReferenceIdentity)) + { + writer.WritePropertyName("keyVaultReferenceIdentity"); + writer.WriteStringValue(KeyVaultReferenceIdentity); + } + if (Optional.IsCollectionDefined(IpSecurityRestrictions)) + { + writer.WritePropertyName("ipSecurityRestrictions"); + writer.WriteStartArray(); + foreach (var item in IpSecurityRestrictions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ScmIpSecurityRestrictions)) + { + writer.WritePropertyName("scmIpSecurityRestrictions"); + writer.WriteStartArray(); + foreach (var item in ScmIpSecurityRestrictions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ScmIpSecurityRestrictionsUseMain)) + { + writer.WritePropertyName("scmIpSecurityRestrictionsUseMain"); + writer.WriteBooleanValue(ScmIpSecurityRestrictionsUseMain.Value); + } + if (Optional.IsDefined(Http20Enabled)) + { + writer.WritePropertyName("http20Enabled"); + writer.WriteBooleanValue(Http20Enabled.Value); + } + if (Optional.IsDefined(MinTlsVersion)) + { + writer.WritePropertyName("minTlsVersion"); + writer.WriteStringValue(MinTlsVersion.Value.ToString()); + } + if (Optional.IsDefined(ScmMinTlsVersion)) + { + writer.WritePropertyName("scmMinTlsVersion"); + writer.WriteStringValue(ScmMinTlsVersion.Value.ToString()); + } + if (Optional.IsDefined(FtpsState)) + { + writer.WritePropertyName("ftpsState"); + writer.WriteStringValue(FtpsState.Value.ToString()); + } + if (Optional.IsDefined(PreWarmedInstanceCount)) + { + writer.WritePropertyName("preWarmedInstanceCount"); + writer.WriteNumberValue(PreWarmedInstanceCount.Value); + } + if (Optional.IsDefined(FunctionAppScaleLimit)) + { + writer.WritePropertyName("functionAppScaleLimit"); + writer.WriteNumberValue(FunctionAppScaleLimit.Value); + } + if (Optional.IsDefined(HealthCheckPath)) + { + writer.WritePropertyName("healthCheckPath"); + writer.WriteStringValue(HealthCheckPath); + } + if (Optional.IsDefined(FunctionsRuntimeScaleMonitoringEnabled)) + { + writer.WritePropertyName("functionsRuntimeScaleMonitoringEnabled"); + writer.WriteBooleanValue(FunctionsRuntimeScaleMonitoringEnabled.Value); + } + if (Optional.IsDefined(WebsiteTimeZone)) + { + writer.WritePropertyName("websiteTimeZone"); + writer.WriteStringValue(WebsiteTimeZone); + } + if (Optional.IsDefined(MinimumElasticInstanceCount)) + { + writer.WritePropertyName("minimumElasticInstanceCount"); + writer.WriteNumberValue(MinimumElasticInstanceCount.Value); + } + if (Optional.IsCollectionDefined(AzureStorageAccounts)) + { + writer.WritePropertyName("azureStorageAccounts"); + writer.WriteStartObject(); + foreach (var item in AzureStorageAccounts) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"); + writer.WriteStringValue(PublicNetworkAccess); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SiteConfigResource DeserializeSiteConfigResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional numberOfWorkers = default; + Optional> defaultDocuments = default; + Optional netFrameworkVersion = default; + Optional phpVersion = default; + Optional pythonVersion = default; + Optional nodeVersion = default; + Optional powerShellVersion = default; + Optional linuxFxVersion = default; + Optional windowsFxVersion = default; + Optional requestTracingEnabled = default; + Optional requestTracingExpirationTime = default; + Optional remoteDebuggingEnabled = default; + Optional remoteDebuggingVersion = default; + Optional httpLoggingEnabled = default; + Optional logsDirectorySizeLimit = default; + Optional detailedErrorLoggingEnabled = default; + Optional publishingUsername = default; + Optional> appSettings = default; + Optional> connectionStrings = default; + Optional machineKey = default; + Optional> handlerMappings = default; + Optional documentRoot = default; + Optional scmType = default; + Optional use32BitWorkerProcess = default; + Optional webSocketsEnabled = default; + Optional alwaysOn = default; + Optional javaVersion = default; + Optional javaContainer = default; + Optional javaContainerVersion = default; + Optional appCommandLine = default; + Optional managedPipelineMode = default; + Optional> virtualApplications = default; + Optional loadBalancing = default; + Optional experiments = default; + Optional limits = default; + Optional autoHealEnabled = default; + Optional autoHealRules = default; + Optional tracingOptions = default; + Optional vnetName = default; + Optional vnetRouteAllEnabled = default; + Optional vnetPrivatePortsCount = default; + Optional cors = default; + Optional push = default; + Optional apiDefinition = default; + Optional apiManagementConfig = default; + Optional autoSwapSlotName = default; + Optional localMySqlEnabled = default; + Optional managedServiceIdentityId = default; + Optional xManagedServiceIdentityId = default; + Optional keyVaultReferenceIdentity = default; + Optional> ipSecurityRestrictions = default; + Optional> scmIpSecurityRestrictions = default; + Optional scmIpSecurityRestrictionsUseMain = default; + Optional http20Enabled = default; + Optional minTlsVersion = default; + Optional scmMinTlsVersion = default; + Optional ftpsState = default; + Optional preWarmedInstanceCount = default; + Optional functionAppScaleLimit = default; + Optional healthCheckPath = default; + Optional functionsRuntimeScaleMonitoringEnabled = default; + Optional websiteTimeZone = default; + Optional minimumElasticInstanceCount = default; + Optional> azureStorageAccounts = default; + Optional publicNetworkAccess = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("numberOfWorkers")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfWorkers = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("defaultDocuments")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + defaultDocuments = array; + continue; + } + if (property0.NameEquals("netFrameworkVersion")) + { + netFrameworkVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("phpVersion")) + { + phpVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("pythonVersion")) + { + pythonVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("nodeVersion")) + { + nodeVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("powerShellVersion")) + { + powerShellVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("linuxFxVersion")) + { + linuxFxVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("windowsFxVersion")) + { + windowsFxVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("requestTracingEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + requestTracingEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("requestTracingExpirationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + requestTracingExpirationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("remoteDebuggingEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + remoteDebuggingEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("remoteDebuggingVersion")) + { + remoteDebuggingVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("httpLoggingEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + httpLoggingEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("logsDirectorySizeLimit")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + logsDirectorySizeLimit = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("detailedErrorLoggingEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + detailedErrorLoggingEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("publishingUsername")) + { + publishingUsername = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("appSettings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(NameValuePair.DeserializeNameValuePair(item)); + } + appSettings = array; + continue; + } + if (property0.NameEquals("connectionStrings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ConnStringInfo.DeserializeConnStringInfo(item)); + } + connectionStrings = array; + continue; + } + if (property0.NameEquals("machineKey")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + machineKey = SiteMachineKey.DeserializeSiteMachineKey(property0.Value); + continue; + } + if (property0.NameEquals("handlerMappings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(HandlerMapping.DeserializeHandlerMapping(item)); + } + handlerMappings = array; + continue; + } + if (property0.NameEquals("documentRoot")) + { + documentRoot = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("scmType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + scmType = new ScmType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("use32BitWorkerProcess")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + use32BitWorkerProcess = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("webSocketsEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + webSocketsEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("alwaysOn")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + alwaysOn = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("javaVersion")) + { + javaVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("javaContainer")) + { + javaContainer = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("javaContainerVersion")) + { + javaContainerVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("appCommandLine")) + { + appCommandLine = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("managedPipelineMode")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + managedPipelineMode = property0.Value.GetString().ToManagedPipelineMode(); + continue; + } + if (property0.NameEquals("virtualApplications")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(VirtualApplication.DeserializeVirtualApplication(item)); + } + virtualApplications = array; + continue; + } + if (property0.NameEquals("loadBalancing")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + loadBalancing = property0.Value.GetString().ToSiteLoadBalancing(); + continue; + } + if (property0.NameEquals("experiments")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + experiments = Experiments.DeserializeExperiments(property0.Value); + continue; + } + if (property0.NameEquals("limits")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + limits = SiteLimits.DeserializeSiteLimits(property0.Value); + continue; + } + if (property0.NameEquals("autoHealEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + autoHealEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("autoHealRules")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + autoHealRules = AutoHealRules.DeserializeAutoHealRules(property0.Value); + continue; + } + if (property0.NameEquals("tracingOptions")) + { + tracingOptions = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vnetName")) + { + vnetName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vnetRouteAllEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + vnetRouteAllEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("vnetPrivatePortsCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + vnetPrivatePortsCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("cors")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + cors = CorsSettings.DeserializeCorsSettings(property0.Value); + continue; + } + if (property0.NameEquals("push")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + push = PushSettings.DeserializePushSettings(property0.Value); + continue; + } + if (property0.NameEquals("apiDefinition")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + apiDefinition = ApiDefinitionInfo.DeserializeApiDefinitionInfo(property0.Value); + continue; + } + if (property0.NameEquals("apiManagementConfig")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + apiManagementConfig = ApiManagementConfig.DeserializeApiManagementConfig(property0.Value); + continue; + } + if (property0.NameEquals("autoSwapSlotName")) + { + autoSwapSlotName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("localMySqlEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + localMySqlEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("managedServiceIdentityId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + managedServiceIdentityId = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("xManagedServiceIdentityId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + xManagedServiceIdentityId = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("keyVaultReferenceIdentity")) + { + keyVaultReferenceIdentity = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("ipSecurityRestrictions")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(IpSecurityRestriction.DeserializeIpSecurityRestriction(item)); + } + ipSecurityRestrictions = array; + continue; + } + if (property0.NameEquals("scmIpSecurityRestrictions")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(IpSecurityRestriction.DeserializeIpSecurityRestriction(item)); + } + scmIpSecurityRestrictions = array; + continue; + } + if (property0.NameEquals("scmIpSecurityRestrictionsUseMain")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + scmIpSecurityRestrictionsUseMain = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("http20Enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + http20Enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("minTlsVersion")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + minTlsVersion = new SupportedTlsVersions(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("scmMinTlsVersion")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + scmMinTlsVersion = new SupportedTlsVersions(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("ftpsState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + ftpsState = new FtpsState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("preWarmedInstanceCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + preWarmedInstanceCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("functionAppScaleLimit")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + functionAppScaleLimit = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("healthCheckPath")) + { + healthCheckPath = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("functionsRuntimeScaleMonitoringEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + functionsRuntimeScaleMonitoringEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("websiteTimeZone")) + { + websiteTimeZone = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("minimumElasticInstanceCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + minimumElasticInstanceCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("azureStorageAccounts")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, AzureStorageInfoValue.DeserializeAzureStorageInfoValue(property1.Value)); + } + azureStorageAccounts = dictionary; + continue; + } + if (property0.NameEquals("publicNetworkAccess")) + { + publicNetworkAccess = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new SiteConfigResource(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(numberOfWorkers), Optional.ToList(defaultDocuments), netFrameworkVersion.Value, phpVersion.Value, pythonVersion.Value, nodeVersion.Value, powerShellVersion.Value, linuxFxVersion.Value, windowsFxVersion.Value, Optional.ToNullable(requestTracingEnabled), Optional.ToNullable(requestTracingExpirationTime), Optional.ToNullable(remoteDebuggingEnabled), remoteDebuggingVersion.Value, Optional.ToNullable(httpLoggingEnabled), Optional.ToNullable(logsDirectorySizeLimit), Optional.ToNullable(detailedErrorLoggingEnabled), publishingUsername.Value, Optional.ToList(appSettings), Optional.ToList(connectionStrings), machineKey.Value, Optional.ToList(handlerMappings), documentRoot.Value, Optional.ToNullable(scmType), Optional.ToNullable(use32BitWorkerProcess), Optional.ToNullable(webSocketsEnabled), Optional.ToNullable(alwaysOn), javaVersion.Value, javaContainer.Value, javaContainerVersion.Value, appCommandLine.Value, Optional.ToNullable(managedPipelineMode), Optional.ToList(virtualApplications), Optional.ToNullable(loadBalancing), experiments.Value, limits.Value, Optional.ToNullable(autoHealEnabled), autoHealRules.Value, tracingOptions.Value, vnetName.Value, Optional.ToNullable(vnetRouteAllEnabled), Optional.ToNullable(vnetPrivatePortsCount), cors.Value, push.Value, apiDefinition.Value, apiManagementConfig.Value, autoSwapSlotName.Value, Optional.ToNullable(localMySqlEnabled), Optional.ToNullable(managedServiceIdentityId), Optional.ToNullable(xManagedServiceIdentityId), keyVaultReferenceIdentity.Value, Optional.ToList(ipSecurityRestrictions), Optional.ToList(scmIpSecurityRestrictions), Optional.ToNullable(scmIpSecurityRestrictionsUseMain), Optional.ToNullable(http20Enabled), Optional.ToNullable(minTlsVersion), Optional.ToNullable(scmMinTlsVersion), Optional.ToNullable(ftpsState), Optional.ToNullable(preWarmedInstanceCount), Optional.ToNullable(functionAppScaleLimit), healthCheckPath.Value, Optional.ToNullable(functionsRuntimeScaleMonitoringEnabled), websiteTimeZone.Value, Optional.ToNullable(minimumElasticInstanceCount), Optional.ToDictionary(azureStorageAccounts), publicNetworkAccess.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs index c51daa41c62e..0481298a9d6f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs @@ -1,143 +1,116 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Web app configuration ARM resource. - /// - [Rest.Serialization.JsonTransformation] + /// Web app configuration ARM resource. public partial class SiteConfigResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the SiteConfigResource class. - /// + /// Initializes a new instance of SiteConfigResource. public SiteConfigResource() { - CustomInit(); + DefaultDocuments = new ChangeTrackingList(); + AppSettings = new ChangeTrackingList(); + ConnectionStrings = new ChangeTrackingList(); + HandlerMappings = new ChangeTrackingList(); + VirtualApplications = new ChangeTrackingList(); + IpSecurityRestrictions = new ChangeTrackingList(); + ScmIpSecurityRestrictions = new ChangeTrackingList(); + AzureStorageAccounts = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the SiteConfigResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Number of workers. - /// Default documents. - /// .NET Framework version. - /// Version of PHP. - /// Version of Python. - /// Version of Node.js. - /// Version of PowerShell. - /// Linux App Framework and - /// version - /// Xenon App Framework and - /// version - /// <code>true</code> - /// if request tracing is enabled; otherwise, - /// <code>false</code>. - /// Request tracing - /// expiration time. - /// <code>true</code> - /// if remote debugging is enabled; otherwise, - /// <code>false</code>. - /// Remote debugging - /// version. - /// <code>true</code> if - /// HTTP logging is enabled; otherwise, - /// <code>false</code>. - /// HTTP logs directory size - /// limit. - /// <code>true</code> if - /// detailed error logging is enabled; otherwise, - /// <code>false</code>. - /// Publishing user name. - /// Application settings. - /// Connection strings. - /// Site MachineKey. - /// Handler mappings. - /// Document root. - /// SCM type. Possible values include: 'None', - /// 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', - /// 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', - /// 'ExternalHg', 'OneDrive', 'VSO', 'VSTSRM' - /// <code>true</code> - /// to use 32-bit worker process; otherwise, - /// <code>false</code>. - /// <code>true</code> if - /// WebSocket is enabled; otherwise, - /// <code>false</code>. - /// <code>true</code> if Always On - /// is enabled; otherwise, <code>false</code>. - /// Java version. - /// Java container. - /// Java container version. - /// App command line to launch. - /// Managed pipeline mode. Possible - /// values include: 'Integrated', 'Classic' - /// Virtual applications. - /// Site load balancing. Possible values - /// include: 'WeightedRoundRobin', 'LeastRequests', - /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' - /// This is work around for polymorphic - /// types. - /// Site limits. - /// <code>true</code> if Auto - /// Heal is enabled; otherwise, <code>false</code>. - /// Auto Heal rules. - /// Tracing options. - /// Virtual Network name. - /// Cross-Origin Resource Sharing (CORS) - /// settings. - /// Push endpoint settings. - /// Information about the formal API - /// definition for the app. - /// Azure API management settings - /// linked to the app. - /// Auto-swap slot name. - /// <code>true</code> to - /// enable local MySQL; otherwise, - /// <code>false</code>. - /// Managed Service Identity - /// Id - /// Explicit Managed Service - /// Identity Id - /// IP security restrictions for - /// main. - /// IP security restrictions - /// for scm. - /// IP security - /// restrictions for scm to use main. - /// Http20Enabled: configures a web site to - /// allow clients to connect over http2.0 - /// MinTlsVersion: configures the minimum - /// version of TLS required for SSL requests. Possible values include: - /// '1.0', '1.1', '1.2' - /// State of FTP / FTPS service. Possible - /// values include: 'AllAllowed', 'FtpsOnly', 'Disabled' - /// Number of preWarmed instances. - /// This setting only applies to the Consumption and Elastic - /// Plans - /// Health check path - public SiteConfigResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), string healthCheckPath = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of SiteConfigResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Number of workers. + /// Default documents. + /// .NET Framework version. + /// Version of PHP. + /// Version of Python. + /// Version of Node.js. + /// Version of PowerShell. + /// Linux App Framework and version. + /// Xenon App Framework and version. + /// <code>true</code> if request tracing is enabled; otherwise, <code>false</code>. + /// Request tracing expiration time. + /// <code>true</code> if remote debugging is enabled; otherwise, <code>false</code>. + /// Remote debugging version. + /// <code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>. + /// HTTP logs directory size limit. + /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. + /// Publishing user name. + /// Application settings. + /// Connection strings. + /// Site MachineKey. + /// Handler mappings. + /// Document root. + /// SCM type. + /// <code>true</code> to use 32-bit worker process; otherwise, <code>false</code>. + /// <code>true</code> if WebSocket is enabled; otherwise, <code>false</code>. + /// <code>true</code> if Always On is enabled; otherwise, <code>false</code>. + /// Java version. + /// Java container. + /// Java container version. + /// App command line to launch. + /// Managed pipeline mode. + /// Virtual applications. + /// Site load balancing. + /// This is work around for polymorphic types. + /// Site limits. + /// <code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>. + /// Auto Heal rules. + /// Tracing options. + /// Virtual Network name. + /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. + /// The number of private ports assigned to this app. These will be assigned dynamically on runtime. + /// Cross-Origin Resource Sharing (CORS) settings. + /// Push endpoint settings. + /// Information about the formal API definition for the app. + /// Azure API management settings linked to the app. + /// Auto-swap slot name. + /// <code>true</code> to enable local MySQL; otherwise, <code>false</code>. + /// Managed Service Identity Id. + /// Explicit Managed Service Identity Id. + /// Identity to use for Key Vault Reference authentication. + /// IP security restrictions for main. + /// IP security restrictions for scm. + /// IP security restrictions for scm to use main. + /// Http20Enabled: configures a web site to allow clients to connect over http2.0. + /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. + /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. + /// State of FTP / FTPS service. + /// + /// Number of preWarmed instances. + /// This setting only applies to the Consumption and Elastic Plans. + /// + /// + /// Maximum number of workers that a site can scale out to. + /// This setting only applies to the Consumption and Elastic Premium Plans. + /// + /// Health check path. + /// + /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but will instead call to the + /// runtime to get scale status. + /// + /// Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + /// + /// Number of minimum instance count for a site + /// This setting only applies to the Elastic Plans. + /// + /// List of Azure Storage Accounts. + /// Property to allow or block all public traffic. + internal SiteConfigResource(string id, string name, string kind, string type, int? numberOfWorkers, IList defaultDocuments, string netFrameworkVersion, string phpVersion, string pythonVersion, string nodeVersion, string powerShellVersion, string linuxFxVersion, string windowsFxVersion, bool? requestTracingEnabled, DateTimeOffset? requestTracingExpirationTime, bool? remoteDebuggingEnabled, string remoteDebuggingVersion, bool? httpLoggingEnabled, int? logsDirectorySizeLimit, bool? detailedErrorLoggingEnabled, string publishingUsername, IList appSettings, IList connectionStrings, SiteMachineKey machineKey, IList handlerMappings, string documentRoot, ScmType? scmType, bool? use32BitWorkerProcess, bool? webSocketsEnabled, bool? alwaysOn, string javaVersion, string javaContainer, string javaContainerVersion, string appCommandLine, ManagedPipelineMode? managedPipelineMode, IList virtualApplications, SiteLoadBalancing? loadBalancing, Experiments experiments, SiteLimits limits, bool? autoHealEnabled, AutoHealRules autoHealRules, string tracingOptions, string vnetName, bool? vnetRouteAllEnabled, int? vnetPrivatePortsCount, CorsSettings cors, PushSettings push, ApiDefinitionInfo apiDefinition, ApiManagementConfig apiManagementConfig, string autoSwapSlotName, bool? localMySqlEnabled, int? managedServiceIdentityId, int? xManagedServiceIdentityId, string keyVaultReferenceIdentity, IList ipSecurityRestrictions, IList scmIpSecurityRestrictions, bool? scmIpSecurityRestrictionsUseMain, bool? http20Enabled, SupportedTlsVersions? minTlsVersion, SupportedTlsVersions? scmMinTlsVersion, FtpsState? ftpsState, int? preWarmedInstanceCount, int? functionAppScaleLimit, string healthCheckPath, bool? functionsRuntimeScaleMonitoringEnabled, string websiteTimeZone, int? minimumElasticInstanceCount, IDictionary azureStorageAccounts, string publicNetworkAccess) : base(id, name, kind, type) { NumberOfWorkers = numberOfWorkers; DefaultDocuments = defaultDocuments; @@ -178,6 +151,8 @@ public SiteConfigResource() AutoHealRules = autoHealRules; TracingOptions = tracingOptions; VnetName = vnetName; + VnetRouteAllEnabled = vnetRouteAllEnabled; + VnetPrivatePortsCount = vnetPrivatePortsCount; Cors = cors; Push = push; ApiDefinition = apiDefinition; @@ -186,402 +161,166 @@ public SiteConfigResource() LocalMySqlEnabled = localMySqlEnabled; ManagedServiceIdentityId = managedServiceIdentityId; XManagedServiceIdentityId = xManagedServiceIdentityId; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; IpSecurityRestrictions = ipSecurityRestrictions; ScmIpSecurityRestrictions = scmIpSecurityRestrictions; ScmIpSecurityRestrictionsUseMain = scmIpSecurityRestrictionsUseMain; Http20Enabled = http20Enabled; MinTlsVersion = minTlsVersion; + ScmMinTlsVersion = scmMinTlsVersion; FtpsState = ftpsState; PreWarmedInstanceCount = preWarmedInstanceCount; + FunctionAppScaleLimit = functionAppScaleLimit; HealthCheckPath = healthCheckPath; - CustomInit(); + FunctionsRuntimeScaleMonitoringEnabled = functionsRuntimeScaleMonitoringEnabled; + WebsiteTimeZone = websiteTimeZone; + MinimumElasticInstanceCount = minimumElasticInstanceCount; + AzureStorageAccounts = azureStorageAccounts; + PublicNetworkAccess = publicNetworkAccess; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets number of workers. - /// - [JsonProperty(PropertyName = "properties.numberOfWorkers")] + /// Number of workers. public int? NumberOfWorkers { get; set; } - - /// - /// Gets or sets default documents. - /// - [JsonProperty(PropertyName = "properties.defaultDocuments")] - public IList DefaultDocuments { get; set; } - - /// - /// Gets or sets .NET Framework version. - /// - [JsonProperty(PropertyName = "properties.netFrameworkVersion")] + /// Default documents. + public IList DefaultDocuments { get; } + /// .NET Framework version. public string NetFrameworkVersion { get; set; } - - /// - /// Gets or sets version of PHP. - /// - [JsonProperty(PropertyName = "properties.phpVersion")] + /// Version of PHP. public string PhpVersion { get; set; } - - /// - /// Gets or sets version of Python. - /// - [JsonProperty(PropertyName = "properties.pythonVersion")] + /// Version of Python. public string PythonVersion { get; set; } - - /// - /// Gets or sets version of Node.js. - /// - [JsonProperty(PropertyName = "properties.nodeVersion")] + /// Version of Node.js. public string NodeVersion { get; set; } - - /// - /// Gets or sets version of PowerShell. - /// - [JsonProperty(PropertyName = "properties.powerShellVersion")] + /// Version of PowerShell. public string PowerShellVersion { get; set; } - - /// - /// Gets or sets linux App Framework and version - /// - [JsonProperty(PropertyName = "properties.linuxFxVersion")] + /// Linux App Framework and version. public string LinuxFxVersion { get; set; } - - /// - /// Gets or sets xenon App Framework and version - /// - [JsonProperty(PropertyName = "properties.windowsFxVersion")] + /// Xenon App Framework and version. public string WindowsFxVersion { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// request tracing is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.requestTracingEnabled")] + /// <code>true</code> if request tracing is enabled; otherwise, <code>false</code>. public bool? RequestTracingEnabled { get; set; } - - /// - /// Gets or sets request tracing expiration time. - /// - [JsonProperty(PropertyName = "properties.requestTracingExpirationTime")] - public System.DateTime? RequestTracingExpirationTime { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// remote debugging is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.remoteDebuggingEnabled")] + /// Request tracing expiration time. + public DateTimeOffset? RequestTracingExpirationTime { get; set; } + /// <code>true</code> if remote debugging is enabled; otherwise, <code>false</code>. public bool? RemoteDebuggingEnabled { get; set; } - - /// - /// Gets or sets remote debugging version. - /// - [JsonProperty(PropertyName = "properties.remoteDebuggingVersion")] + /// Remote debugging version. public string RemoteDebuggingVersion { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if HTTP - /// logging is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.httpLoggingEnabled")] + /// <code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>. public bool? HttpLoggingEnabled { get; set; } - - /// - /// Gets or sets HTTP logs directory size limit. - /// - [JsonProperty(PropertyName = "properties.logsDirectorySizeLimit")] + /// HTTP logs directory size limit. public int? LogsDirectorySizeLimit { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// detailed error logging is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.detailedErrorLoggingEnabled")] + /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. public bool? DetailedErrorLoggingEnabled { get; set; } - - /// - /// Gets or sets publishing user name. - /// - [JsonProperty(PropertyName = "properties.publishingUsername")] + /// Publishing user name. public string PublishingUsername { get; set; } - - /// - /// Gets or sets application settings. - /// - [JsonProperty(PropertyName = "properties.appSettings")] - public IList AppSettings { get; set; } - - /// - /// Gets or sets connection strings. - /// - [JsonProperty(PropertyName = "properties.connectionStrings")] - public IList ConnectionStrings { get; set; } - - /// - /// Gets site MachineKey. - /// - [JsonProperty(PropertyName = "properties.machineKey")] - public SiteMachineKey MachineKey { get; private set; } - - /// - /// Gets or sets handler mappings. - /// - [JsonProperty(PropertyName = "properties.handlerMappings")] - public IList HandlerMappings { get; set; } - - /// - /// Gets or sets document root. - /// - [JsonProperty(PropertyName = "properties.documentRoot")] + /// Application settings. + public IList AppSettings { get; } + /// Connection strings. + public IList ConnectionStrings { get; } + /// Site MachineKey. + public SiteMachineKey MachineKey { get; } + /// Handler mappings. + public IList HandlerMappings { get; } + /// Document root. public string DocumentRoot { get; set; } - - /// - /// Gets or sets SCM type. Possible values include: 'None', 'Dropbox', - /// 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', - /// 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', - /// 'OneDrive', 'VSO', 'VSTSRM' - /// - [JsonProperty(PropertyName = "properties.scmType")] - public string ScmType { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to use - /// 32-bit worker process; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.use32BitWorkerProcess")] + /// SCM type. + public ScmType? ScmType { get; set; } + /// <code>true</code> to use 32-bit worker process; otherwise, <code>false</code>. public bool? Use32BitWorkerProcess { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// WebSocket is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.webSocketsEnabled")] + /// <code>true</code> if WebSocket is enabled; otherwise, <code>false</code>. public bool? WebSocketsEnabled { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// Always On is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.alwaysOn")] + /// <code>true</code> if Always On is enabled; otherwise, <code>false</code>. public bool? AlwaysOn { get; set; } - - /// - /// Gets or sets java version. - /// - [JsonProperty(PropertyName = "properties.javaVersion")] + /// Java version. public string JavaVersion { get; set; } - - /// - /// Gets or sets java container. - /// - [JsonProperty(PropertyName = "properties.javaContainer")] + /// Java container. public string JavaContainer { get; set; } - - /// - /// Gets or sets java container version. - /// - [JsonProperty(PropertyName = "properties.javaContainerVersion")] + /// Java container version. public string JavaContainerVersion { get; set; } - - /// - /// Gets or sets app command line to launch. - /// - [JsonProperty(PropertyName = "properties.appCommandLine")] + /// App command line to launch. public string AppCommandLine { get; set; } - - /// - /// Gets or sets managed pipeline mode. Possible values include: - /// 'Integrated', 'Classic' - /// - [JsonProperty(PropertyName = "properties.managedPipelineMode")] + /// Managed pipeline mode. public ManagedPipelineMode? ManagedPipelineMode { get; set; } - - /// - /// Gets or sets virtual applications. - /// - [JsonProperty(PropertyName = "properties.virtualApplications")] - public IList VirtualApplications { get; set; } - - /// - /// Gets or sets site load balancing. Possible values include: - /// 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - /// 'WeightedTotalTraffic', 'RequestHash' - /// - [JsonProperty(PropertyName = "properties.loadBalancing")] + /// Virtual applications. + public IList VirtualApplications { get; } + /// Site load balancing. public SiteLoadBalancing? LoadBalancing { get; set; } - - /// - /// Gets or sets this is work around for polymorphic types. - /// - [JsonProperty(PropertyName = "properties.experiments")] + /// This is work around for polymorphic types. public Experiments Experiments { get; set; } - - /// - /// Gets or sets site limits. - /// - [JsonProperty(PropertyName = "properties.limits")] + /// Site limits. public SiteLimits Limits { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if Auto - /// Heal is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.autoHealEnabled")] + /// <code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>. public bool? AutoHealEnabled { get; set; } - - /// - /// Gets or sets auto Heal rules. - /// - [JsonProperty(PropertyName = "properties.autoHealRules")] + /// Auto Heal rules. public AutoHealRules AutoHealRules { get; set; } - - /// - /// Gets or sets tracing options. - /// - [JsonProperty(PropertyName = "properties.tracingOptions")] + /// Tracing options. public string TracingOptions { get; set; } - - /// - /// Gets or sets virtual Network name. - /// - [JsonProperty(PropertyName = "properties.vnetName")] + /// Virtual Network name. public string VnetName { get; set; } - - /// - /// Gets or sets cross-Origin Resource Sharing (CORS) settings. - /// - [JsonProperty(PropertyName = "properties.cors")] + /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. + public bool? VnetRouteAllEnabled { get; set; } + /// The number of private ports assigned to this app. These will be assigned dynamically on runtime. + public int? VnetPrivatePortsCount { get; set; } + /// Cross-Origin Resource Sharing (CORS) settings. public CorsSettings Cors { get; set; } - - /// - /// Gets or sets push endpoint settings. - /// - [JsonProperty(PropertyName = "properties.push")] + /// Push endpoint settings. public PushSettings Push { get; set; } - - /// - /// Gets or sets information about the formal API definition for the - /// app. - /// - [JsonProperty(PropertyName = "properties.apiDefinition")] + /// Information about the formal API definition for the app. public ApiDefinitionInfo ApiDefinition { get; set; } - - /// - /// Gets or sets azure API management settings linked to the app. - /// - [JsonProperty(PropertyName = "properties.apiManagementConfig")] + /// Azure API management settings linked to the app. public ApiManagementConfig ApiManagementConfig { get; set; } - - /// - /// Gets or sets auto-swap slot name. - /// - [JsonProperty(PropertyName = "properties.autoSwapSlotName")] + /// Auto-swap slot name. public string AutoSwapSlotName { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// enable local MySQL; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.localMySqlEnabled")] + /// <code>true</code> to enable local MySQL; otherwise, <code>false</code>. public bool? LocalMySqlEnabled { get; set; } - - /// - /// Gets or sets managed Service Identity Id - /// - [JsonProperty(PropertyName = "properties.managedServiceIdentityId")] + /// Managed Service Identity Id. public int? ManagedServiceIdentityId { get; set; } - - /// - /// Gets or sets explicit Managed Service Identity Id - /// - [JsonProperty(PropertyName = "properties.xManagedServiceIdentityId")] + /// Explicit Managed Service Identity Id. public int? XManagedServiceIdentityId { get; set; } - - /// - /// Gets or sets IP security restrictions for main. - /// - [JsonProperty(PropertyName = "properties.ipSecurityRestrictions")] - public IList IpSecurityRestrictions { get; set; } - - /// - /// Gets or sets IP security restrictions for scm. - /// - [JsonProperty(PropertyName = "properties.scmIpSecurityRestrictions")] - public IList ScmIpSecurityRestrictions { get; set; } - - /// - /// Gets or sets IP security restrictions for scm to use main. - /// - [JsonProperty(PropertyName = "properties.scmIpSecurityRestrictionsUseMain")] + /// Identity to use for Key Vault Reference authentication. + public string KeyVaultReferenceIdentity { get; set; } + /// IP security restrictions for main. + public IList IpSecurityRestrictions { get; } + /// IP security restrictions for scm. + public IList ScmIpSecurityRestrictions { get; } + /// IP security restrictions for scm to use main. public bool? ScmIpSecurityRestrictionsUseMain { get; set; } - - /// - /// Gets or sets http20Enabled: configures a web site to allow clients - /// to connect over http2.0 - /// - [JsonProperty(PropertyName = "properties.http20Enabled")] + /// Http20Enabled: configures a web site to allow clients to connect over http2.0. public bool? Http20Enabled { get; set; } - - /// - /// Gets or sets minTlsVersion: configures the minimum version of TLS - /// required for SSL requests. Possible values include: '1.0', '1.1', - /// '1.2' - /// - [JsonProperty(PropertyName = "properties.minTlsVersion")] - public string MinTlsVersion { get; set; } - - /// - /// Gets or sets state of FTP / FTPS service. Possible values include: - /// 'AllAllowed', 'FtpsOnly', 'Disabled' - /// - [JsonProperty(PropertyName = "properties.ftpsState")] - public string FtpsState { get; set; } - + /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. + public SupportedTlsVersions? MinTlsVersion { get; set; } + /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. + public SupportedTlsVersions? ScmMinTlsVersion { get; set; } + /// State of FTP / FTPS service. + public FtpsState? FtpsState { get; set; } /// - /// Gets or sets number of preWarmed instances. - /// This setting only applies to the Consumption and Elastic Plans + /// Number of preWarmed instances. + /// This setting only applies to the Consumption and Elastic Plans. /// - [JsonProperty(PropertyName = "properties.preWarmedInstanceCount")] public int? PreWarmedInstanceCount { get; set; } - /// - /// Gets or sets health check path + /// Maximum number of workers that a site can scale out to. + /// This setting only applies to the Consumption and Elastic Premium Plans. /// - [JsonProperty(PropertyName = "properties.healthCheckPath")] + public int? FunctionAppScaleLimit { get; set; } + /// Health check path. public string HealthCheckPath { get; set; } - /// - /// Validate the object. + /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but will instead call to the + /// runtime to get scale status. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Push != null) - { - Push.Validate(); - } - if (PreWarmedInstanceCount > 10) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PreWarmedInstanceCount", 10); - } - if (PreWarmedInstanceCount < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PreWarmedInstanceCount", 0); - } - } + public bool? FunctionsRuntimeScaleMonitoringEnabled { get; set; } + /// Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + public string WebsiteTimeZone { get; set; } + /// + /// Number of minimum instance count for a site + /// This setting only applies to the Elastic Plans. + /// + public int? MinimumElasticInstanceCount { get; set; } + /// List of Azure Storage Accounts. + public IDictionary AzureStorageAccounts { get; } + /// Property to allow or block all public traffic. + public string PublicNetworkAccess { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.Serialization.cs new file mode 100644 index 000000000000..256a52412710 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class SiteConfigResourceCollection + { + internal static SiteConfigResourceCollection DeserializeSiteConfigResourceCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SiteConfigResource.DeserializeSiteConfigResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new SiteConfigResourceCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.cs new file mode 100644 index 000000000000..111bebf697d2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of site configurations. + internal partial class SiteConfigResourceCollection + { + /// Initializes a new instance of SiteConfigResourceCollection. + /// Collection of resources. + /// is null. + internal SiteConfigResourceCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of SiteConfigResourceCollection. + /// Collection of resources. + /// Link to next page of resources. + internal SiteConfigResourceCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.Serialization.cs new file mode 100644 index 000000000000..922e8abe71f7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.Serialization.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteConfigurationSnapshotInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SiteConfigurationSnapshotInfo DeserializeSiteConfigurationSnapshotInfo(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional time = default; + Optional snapshotId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("time")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + time = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("snapshotId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + snapshotId = property0.Value.GetInt32(); + continue; + } + } + continue; + } + } + return new SiteConfigurationSnapshotInfo(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(time), Optional.ToNullable(snapshotId)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.cs index 8223f04b14fe..8f62027ab9be 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.cs @@ -1,69 +1,38 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A snapshot of a web app configuration. - /// - [Rest.Serialization.JsonTransformation] + /// A snapshot of a web app configuration. public partial class SiteConfigurationSnapshotInfo : ProxyOnlyResource { - /// - /// Initializes a new instance of the SiteConfigurationSnapshotInfo - /// class. - /// + /// Initializes a new instance of SiteConfigurationSnapshotInfo. public SiteConfigurationSnapshotInfo() { - CustomInit(); } - /// - /// Initializes a new instance of the SiteConfigurationSnapshotInfo - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The time the snapshot was taken. - /// The id of the snapshot - public SiteConfigurationSnapshotInfo(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), System.DateTime? time = default(System.DateTime?), int? snapshotId = default(int?)) - : base(id, name, kind, type) + /// Initializes a new instance of SiteConfigurationSnapshotInfo. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The time the snapshot was taken. + /// The id of the snapshot. + internal SiteConfigurationSnapshotInfo(string id, string name, string kind, string type, DateTimeOffset? time, int? snapshotId) : base(id, name, kind, type) { Time = time; SnapshotId = snapshotId; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the time the snapshot was taken. - /// - [JsonProperty(PropertyName = "properties.time")] - public System.DateTime? Time { get; private set; } - - /// - /// Gets the id of the snapshot - /// - [JsonProperty(PropertyName = "properties.snapshotId")] - public int? SnapshotId { get; private set; } - + /// The time the snapshot was taken. + public DateTimeOffset? Time { get; } + /// The id of the snapshot. + public int? SnapshotId { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.Serialization.cs new file mode 100644 index 000000000000..bd63a5f971a3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class SiteConfigurationSnapshotInfoCollection + { + internal static SiteConfigurationSnapshotInfoCollection DeserializeSiteConfigurationSnapshotInfoCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SiteConfigurationSnapshotInfo.DeserializeSiteConfigurationSnapshotInfo(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new SiteConfigurationSnapshotInfoCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.cs new file mode 100644 index 000000000000..d16563d6ca4b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of metadata for the app configuration snapshots that can be restored. + internal partial class SiteConfigurationSnapshotInfoCollection + { + /// Initializes a new instance of SiteConfigurationSnapshotInfoCollection. + /// Collection of resources. + /// is null. + internal SiteConfigurationSnapshotInfoCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of SiteConfigurationSnapshotInfoCollection. + /// Collection of resources. + /// Link to next page of resources. + internal SiteConfigurationSnapshotInfoCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.Serialization.cs new file mode 100644 index 000000000000..d43b3f8aacb1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.Serialization.cs @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteExtensionInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ExtensionId)) + { + writer.WritePropertyName("extension_id"); + writer.WriteStringValue(ExtensionId); + } + if (Optional.IsDefined(Title)) + { + writer.WritePropertyName("title"); + writer.WriteStringValue(Title); + } + if (Optional.IsDefined(ExtensionType)) + { + writer.WritePropertyName("extension_type"); + writer.WriteStringValue(ExtensionType.Value.ToSerialString()); + } + if (Optional.IsDefined(Summary)) + { + writer.WritePropertyName("summary"); + writer.WriteStringValue(Summary); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"); + writer.WriteStringValue(Version); + } + if (Optional.IsDefined(ExtensionUrl)) + { + writer.WritePropertyName("extension_url"); + writer.WriteStringValue(ExtensionUrl); + } + if (Optional.IsDefined(ProjectUrl)) + { + writer.WritePropertyName("project_url"); + writer.WriteStringValue(ProjectUrl); + } + if (Optional.IsDefined(IconUrl)) + { + writer.WritePropertyName("icon_url"); + writer.WriteStringValue(IconUrl); + } + if (Optional.IsDefined(LicenseUrl)) + { + writer.WritePropertyName("license_url"); + writer.WriteStringValue(LicenseUrl); + } + if (Optional.IsDefined(FeedUrl)) + { + writer.WritePropertyName("feed_url"); + writer.WriteStringValue(FeedUrl); + } + if (Optional.IsCollectionDefined(Authors)) + { + writer.WritePropertyName("authors"); + writer.WriteStartArray(); + foreach (var item in Authors) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(InstallerCommandLineParams)) + { + writer.WritePropertyName("installer_command_line_params"); + writer.WriteStringValue(InstallerCommandLineParams); + } + if (Optional.IsDefined(PublishedDateTime)) + { + writer.WritePropertyName("published_date_time"); + writer.WriteStringValue(PublishedDateTime.Value, "O"); + } + if (Optional.IsDefined(DownloadCount)) + { + writer.WritePropertyName("download_count"); + writer.WriteNumberValue(DownloadCount.Value); + } + if (Optional.IsDefined(LocalIsLatestVersion)) + { + writer.WritePropertyName("local_is_latest_version"); + writer.WriteBooleanValue(LocalIsLatestVersion.Value); + } + if (Optional.IsDefined(LocalPath)) + { + writer.WritePropertyName("local_path"); + writer.WriteStringValue(LocalPath); + } + if (Optional.IsDefined(InstalledDateTime)) + { + writer.WritePropertyName("installed_date_time"); + writer.WriteStringValue(InstalledDateTime.Value, "O"); + } + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"); + writer.WriteStringValue(ProvisioningState); + } + if (Optional.IsDefined(Comment)) + { + writer.WritePropertyName("comment"); + writer.WriteStringValue(Comment); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SiteExtensionInfo DeserializeSiteExtensionInfo(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional extensionId = default; + Optional title = default; + Optional extensionType = default; + Optional summary = default; + Optional description = default; + Optional version = default; + Optional extensionUrl = default; + Optional projectUrl = default; + Optional iconUrl = default; + Optional licenseUrl = default; + Optional feedUrl = default; + Optional> authors = default; + Optional installerCommandLineParams = default; + Optional publishedDateTime = default; + Optional downloadCount = default; + Optional localIsLatestVersion = default; + Optional localPath = default; + Optional installedDateTime = default; + Optional provisioningState = default; + Optional comment = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("extension_id")) + { + extensionId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("title")) + { + title = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("extension_type")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + extensionType = property0.Value.GetString().ToSiteExtensionType(); + continue; + } + if (property0.NameEquals("summary")) + { + summary = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("description")) + { + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("version")) + { + version = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("extension_url")) + { + extensionUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("project_url")) + { + projectUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("icon_url")) + { + iconUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("license_url")) + { + licenseUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("feed_url")) + { + feedUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("authors")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + authors = array; + continue; + } + if (property0.NameEquals("installer_command_line_params")) + { + installerCommandLineParams = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("published_date_time")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + publishedDateTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("download_count")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + downloadCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("local_is_latest_version")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + localIsLatestVersion = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("local_path")) + { + localPath = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("installed_date_time")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + installedDateTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("provisioningState")) + { + provisioningState = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("comment")) + { + comment = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new SiteExtensionInfo(id.Value, name.Value, kind.Value, type.Value, extensionId.Value, title.Value, Optional.ToNullable(extensionType), summary.Value, description.Value, version.Value, extensionUrl.Value, projectUrl.Value, iconUrl.Value, licenseUrl.Value, feedUrl.Value, Optional.ToList(authors), installerCommandLineParams.Value, Optional.ToNullable(publishedDateTime), Optional.ToNullable(downloadCount), Optional.ToNullable(localIsLatestVersion), localPath.Value, Optional.ToNullable(installedDateTime), provisioningState.Value, comment.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.cs index e7a3772cee59..cb5d86445a53 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.cs @@ -1,68 +1,51 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Site Extension Information. - /// - [Rest.Serialization.JsonTransformation] + /// Site Extension Information. public partial class SiteExtensionInfo : ProxyOnlyResource { - /// - /// Initializes a new instance of the SiteExtensionInfo class. - /// + /// Initializes a new instance of SiteExtensionInfo. public SiteExtensionInfo() { - CustomInit(); + Authors = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the SiteExtensionInfo class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Site extension ID. - /// Site extension type. Possible values - /// include: 'Gallery', 'WebRoot' - /// Summary description. - /// Detailed description. - /// Version information. - /// Extension URL. - /// Project URL. - /// Icon URL. - /// License URL. - /// Feed URL. - /// List of authors. - /// Installer command line - /// parameters. - /// Published timestamp. - /// Count of downloads. - /// <code>true</code> if - /// the local version is the latest version; - /// <code>false</code> otherwise. - /// Local path. - /// Installed timestamp. - /// Provisioning state. - /// Site Extension comment. - public SiteExtensionInfo(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string extensionId = default(string), string title = default(string), SiteExtensionType? extensionType = default(SiteExtensionType?), string summary = default(string), string description = default(string), string version = default(string), string extensionUrl = default(string), string projectUrl = default(string), string iconUrl = default(string), string licenseUrl = default(string), string feedUrl = default(string), IList authors = default(IList), string installerCommandLineParams = default(string), System.DateTime? publishedDateTime = default(System.DateTime?), int? downloadCount = default(int?), bool? localIsLatestVersion = default(bool?), string localPath = default(string), System.DateTime? installedDateTime = default(System.DateTime?), string provisioningState = default(string), string comment = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of SiteExtensionInfo. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Site extension ID. + /// . + /// Site extension type. + /// Summary description. + /// Detailed description. + /// Version information. + /// Extension URL. + /// Project URL. + /// Icon URL. + /// License URL. + /// Feed URL. + /// List of authors. + /// Installer command line parameters. + /// Published timestamp. + /// Count of downloads. + /// <code>true</code> if the local version is the latest version; <code>false</code> otherwise. + /// Local path. + /// Installed timestamp. + /// Provisioning state. + /// Site Extension comment. + internal SiteExtensionInfo(string id, string name, string kind, string type, string extensionId, string title, SiteExtensionType? extensionType, string summary, string description, string version, string extensionUrl, string projectUrl, string iconUrl, string licenseUrl, string feedUrl, IList authors, string installerCommandLineParams, DateTimeOffset? publishedDateTime, int? downloadCount, bool? localIsLatestVersion, string localPath, DateTimeOffset? installedDateTime, string provisioningState, string comment) : base(id, name, kind, type) { ExtensionId = extensionId; Title = title; @@ -84,135 +67,46 @@ public SiteExtensionInfo() InstalledDateTime = installedDateTime; ProvisioningState = provisioningState; Comment = comment; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets site extension ID. - /// - [JsonProperty(PropertyName = "properties.extension_id")] + /// Site extension ID. public string ExtensionId { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.title")] public string Title { get; set; } - - /// - /// Gets or sets site extension type. Possible values include: - /// 'Gallery', 'WebRoot' - /// - [JsonProperty(PropertyName = "properties.extension_type")] + /// Site extension type. public SiteExtensionType? ExtensionType { get; set; } - - /// - /// Gets or sets summary description. - /// - [JsonProperty(PropertyName = "properties.summary")] + /// Summary description. public string Summary { get; set; } - - /// - /// Gets or sets detailed description. - /// - [JsonProperty(PropertyName = "properties.description")] + /// Detailed description. public string Description { get; set; } - - /// - /// Gets or sets version information. - /// - [JsonProperty(PropertyName = "properties.version")] + /// Version information. public string Version { get; set; } - - /// - /// Gets or sets extension URL. - /// - [JsonProperty(PropertyName = "properties.extension_url")] + /// Extension URL. public string ExtensionUrl { get; set; } - - /// - /// Gets or sets project URL. - /// - [JsonProperty(PropertyName = "properties.project_url")] + /// Project URL. public string ProjectUrl { get; set; } - - /// - /// Gets or sets icon URL. - /// - [JsonProperty(PropertyName = "properties.icon_url")] + /// Icon URL. public string IconUrl { get; set; } - - /// - /// Gets or sets license URL. - /// - [JsonProperty(PropertyName = "properties.license_url")] + /// License URL. public string LicenseUrl { get; set; } - - /// - /// Gets or sets feed URL. - /// - [JsonProperty(PropertyName = "properties.feed_url")] + /// Feed URL. public string FeedUrl { get; set; } - - /// - /// Gets or sets list of authors. - /// - [JsonProperty(PropertyName = "properties.authors")] - public IList Authors { get; set; } - - /// - /// Gets or sets installer command line parameters. - /// - [JsonProperty(PropertyName = "properties.installer_command_line_params")] + /// List of authors. + public IList Authors { get; } + /// Installer command line parameters. public string InstallerCommandLineParams { get; set; } - - /// - /// Gets or sets published timestamp. - /// - [JsonProperty(PropertyName = "properties.published_date_time")] - public System.DateTime? PublishedDateTime { get; set; } - - /// - /// Gets or sets count of downloads. - /// - [JsonProperty(PropertyName = "properties.download_count")] + /// Published timestamp. + public DateTimeOffset? PublishedDateTime { get; set; } + /// Count of downloads. public int? DownloadCount { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// local version is the latest version; - /// &lt;code&gt;false&lt;/code&gt; otherwise. - /// - [JsonProperty(PropertyName = "properties.local_is_latest_version")] + /// <code>true</code> if the local version is the latest version; <code>false</code> otherwise. public bool? LocalIsLatestVersion { get; set; } - - /// - /// Gets or sets local path. - /// - [JsonProperty(PropertyName = "properties.local_path")] + /// Local path. public string LocalPath { get; set; } - - /// - /// Gets or sets installed timestamp. - /// - [JsonProperty(PropertyName = "properties.installed_date_time")] - public System.DateTime? InstalledDateTime { get; set; } - - /// - /// Gets or sets provisioning state. - /// - [JsonProperty(PropertyName = "properties.provisioningState")] + /// Installed timestamp. + public DateTimeOffset? InstalledDateTime { get; set; } + /// Provisioning state. public string ProvisioningState { get; set; } - - /// - /// Gets or sets site Extension comment. - /// - [JsonProperty(PropertyName = "properties.comment")] + /// Site Extension comment. public string Comment { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.Serialization.cs new file mode 100644 index 000000000000..c23a781aa1e9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class SiteExtensionInfoCollection + { + internal static SiteExtensionInfoCollection DeserializeSiteExtensionInfoCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SiteExtensionInfo.DeserializeSiteExtensionInfo(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new SiteExtensionInfoCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.cs new file mode 100644 index 000000000000..51e6593fada7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Kudu site extension information elements. + internal partial class SiteExtensionInfoCollection + { + /// Initializes a new instance of SiteExtensionInfoCollection. + /// Collection of resources. + /// is null. + internal SiteExtensionInfoCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of SiteExtensionInfoCollection. + /// Collection of resources. + /// Link to next page of resources. + internal SiteExtensionInfoCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.Serialization.cs new file mode 100644 index 000000000000..37fea7aaf785 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class SiteExtensionTypeExtensions + { + public static string ToSerialString(this SiteExtensionType value) => value switch + { + SiteExtensionType.Gallery => "Gallery", + SiteExtensionType.WebRoot => "WebRoot", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteExtensionType value.") + }; + + public static SiteExtensionType ToSiteExtensionType(this string value) + { + if (string.Equals(value, "Gallery", StringComparison.InvariantCultureIgnoreCase)) return SiteExtensionType.Gallery; + if (string.Equals(value, "WebRoot", StringComparison.InvariantCultureIgnoreCase)) return SiteExtensionType.WebRoot; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteExtensionType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.cs index 70c406c4d640..d83c49bc9642 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for SiteExtensionType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Site extension type. public enum SiteExtensionType { - [EnumMember(Value = "Gallery")] + /// Gallery. Gallery, - [EnumMember(Value = "WebRoot")] + /// WebRoot. WebRoot } - internal static class SiteExtensionTypeEnumExtension - { - internal static string ToSerializedValue(this SiteExtensionType? value) - { - return value == null ? null : ((SiteExtensionType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this SiteExtensionType value) - { - switch( value ) - { - case SiteExtensionType.Gallery: - return "Gallery"; - case SiteExtensionType.WebRoot: - return "WebRoot"; - } - return null; - } - - internal static SiteExtensionType? ParseSiteExtensionType(this string value) - { - switch( value ) - { - case "Gallery": - return SiteExtensionType.Gallery; - case "WebRoot": - return SiteExtensionType.WebRoot; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.Serialization.cs new file mode 100644 index 000000000000..6e51e73b2af3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.Serialization.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteLimits : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(MaxPercentageCpu)) + { + writer.WritePropertyName("maxPercentageCpu"); + writer.WriteNumberValue(MaxPercentageCpu.Value); + } + if (Optional.IsDefined(MaxMemoryInMb)) + { + writer.WritePropertyName("maxMemoryInMb"); + writer.WriteNumberValue(MaxMemoryInMb.Value); + } + if (Optional.IsDefined(MaxDiskSizeInMb)) + { + writer.WritePropertyName("maxDiskSizeInMb"); + writer.WriteNumberValue(MaxDiskSizeInMb.Value); + } + writer.WriteEndObject(); + } + + internal static SiteLimits DeserializeSiteLimits(JsonElement element) + { + Optional maxPercentageCpu = default; + Optional maxMemoryInMb = default; + Optional maxDiskSizeInMb = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxPercentageCpu")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + maxPercentageCpu = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("maxMemoryInMb")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + maxMemoryInMb = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("maxDiskSizeInMb")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + maxDiskSizeInMb = property.Value.GetInt64(); + continue; + } + } + return new SiteLimits(Optional.ToNullable(maxPercentageCpu), Optional.ToNullable(maxMemoryInMb), Optional.ToNullable(maxDiskSizeInMb)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.cs index 384ed21eb59f..c91e211d704c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.cs @@ -1,70 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Metric limits set on an app. - /// + /// Metric limits set on an app. public partial class SiteLimits { - /// - /// Initializes a new instance of the SiteLimits class. - /// + /// Initializes a new instance of SiteLimits. public SiteLimits() { - CustomInit(); } - /// - /// Initializes a new instance of the SiteLimits class. - /// - /// Maximum allowed CPU usage - /// percentage. - /// Maximum allowed memory usage in - /// MB. - /// Maximum allowed disk size usage in - /// MB. - public SiteLimits(double? maxPercentageCpu = default(double?), long? maxMemoryInMb = default(long?), long? maxDiskSizeInMb = default(long?)) + /// Initializes a new instance of SiteLimits. + /// Maximum allowed CPU usage percentage. + /// Maximum allowed memory usage in MB. + /// Maximum allowed disk size usage in MB. + internal SiteLimits(double? maxPercentageCpu, long? maxMemoryInMb, long? maxDiskSizeInMb) { MaxPercentageCpu = maxPercentageCpu; MaxMemoryInMb = maxMemoryInMb; MaxDiskSizeInMb = maxDiskSizeInMb; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets maximum allowed CPU usage percentage. - /// - [JsonProperty(PropertyName = "maxPercentageCpu")] + /// Maximum allowed CPU usage percentage. public double? MaxPercentageCpu { get; set; } - - /// - /// Gets or sets maximum allowed memory usage in MB. - /// - [JsonProperty(PropertyName = "maxMemoryInMb")] + /// Maximum allowed memory usage in MB. public long? MaxMemoryInMb { get; set; } - - /// - /// Gets or sets maximum allowed disk size usage in MB. - /// - [JsonProperty(PropertyName = "maxDiskSizeInMb")] + /// Maximum allowed disk size usage in MB. public long? MaxDiskSizeInMb { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.Serialization.cs new file mode 100644 index 000000000000..71fb8603f597 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.Serialization.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class SiteLoadBalancingExtensions + { + public static string ToSerialString(this SiteLoadBalancing value) => value switch + { + SiteLoadBalancing.WeightedRoundRobin => "WeightedRoundRobin", + SiteLoadBalancing.LeastRequests => "LeastRequests", + SiteLoadBalancing.LeastResponseTime => "LeastResponseTime", + SiteLoadBalancing.WeightedTotalTraffic => "WeightedTotalTraffic", + SiteLoadBalancing.RequestHash => "RequestHash", + SiteLoadBalancing.PerSiteRoundRobin => "PerSiteRoundRobin", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteLoadBalancing value.") + }; + + public static SiteLoadBalancing ToSiteLoadBalancing(this string value) + { + if (string.Equals(value, "WeightedRoundRobin", StringComparison.InvariantCultureIgnoreCase)) return SiteLoadBalancing.WeightedRoundRobin; + if (string.Equals(value, "LeastRequests", StringComparison.InvariantCultureIgnoreCase)) return SiteLoadBalancing.LeastRequests; + if (string.Equals(value, "LeastResponseTime", StringComparison.InvariantCultureIgnoreCase)) return SiteLoadBalancing.LeastResponseTime; + if (string.Equals(value, "WeightedTotalTraffic", StringComparison.InvariantCultureIgnoreCase)) return SiteLoadBalancing.WeightedTotalTraffic; + if (string.Equals(value, "RequestHash", StringComparison.InvariantCultureIgnoreCase)) return SiteLoadBalancing.RequestHash; + if (string.Equals(value, "PerSiteRoundRobin", StringComparison.InvariantCultureIgnoreCase)) return SiteLoadBalancing.PerSiteRoundRobin; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteLoadBalancing value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs index f7bae36f84b6..49196d582e58 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs @@ -1,78 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for SiteLoadBalancing. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Site load balancing. public enum SiteLoadBalancing { - [EnumMember(Value = "WeightedRoundRobin")] + /// WeightedRoundRobin. WeightedRoundRobin, - [EnumMember(Value = "LeastRequests")] + /// LeastRequests. LeastRequests, - [EnumMember(Value = "LeastResponseTime")] + /// LeastResponseTime. LeastResponseTime, - [EnumMember(Value = "WeightedTotalTraffic")] + /// WeightedTotalTraffic. WeightedTotalTraffic, - [EnumMember(Value = "RequestHash")] - RequestHash - } - internal static class SiteLoadBalancingEnumExtension - { - internal static string ToSerializedValue(this SiteLoadBalancing? value) - { - return value == null ? null : ((SiteLoadBalancing)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this SiteLoadBalancing value) - { - switch( value ) - { - case SiteLoadBalancing.WeightedRoundRobin: - return "WeightedRoundRobin"; - case SiteLoadBalancing.LeastRequests: - return "LeastRequests"; - case SiteLoadBalancing.LeastResponseTime: - return "LeastResponseTime"; - case SiteLoadBalancing.WeightedTotalTraffic: - return "WeightedTotalTraffic"; - case SiteLoadBalancing.RequestHash: - return "RequestHash"; - } - return null; - } - - internal static SiteLoadBalancing? ParseSiteLoadBalancing(this string value) - { - switch( value ) - { - case "WeightedRoundRobin": - return SiteLoadBalancing.WeightedRoundRobin; - case "LeastRequests": - return SiteLoadBalancing.LeastRequests; - case "LeastResponseTime": - return SiteLoadBalancing.LeastResponseTime; - case "WeightedTotalTraffic": - return SiteLoadBalancing.WeightedTotalTraffic; - case "RequestHash": - return SiteLoadBalancing.RequestHash; - } - return null; - } + /// RequestHash. + RequestHash, + /// PerSiteRoundRobin. + PerSiteRoundRobin } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.Serialization.cs new file mode 100644 index 000000000000..6fb27c5226a7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteLogsConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ApplicationLogs)) + { + writer.WritePropertyName("applicationLogs"); + writer.WriteObjectValue(ApplicationLogs); + } + if (Optional.IsDefined(HttpLogs)) + { + writer.WritePropertyName("httpLogs"); + writer.WriteObjectValue(HttpLogs); + } + if (Optional.IsDefined(FailedRequestsTracing)) + { + writer.WritePropertyName("failedRequestsTracing"); + writer.WriteObjectValue(FailedRequestsTracing); + } + if (Optional.IsDefined(DetailedErrorMessages)) + { + writer.WritePropertyName("detailedErrorMessages"); + writer.WriteObjectValue(DetailedErrorMessages); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SiteLogsConfig DeserializeSiteLogsConfig(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional applicationLogs = default; + Optional httpLogs = default; + Optional failedRequestsTracing = default; + Optional detailedErrorMessages = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("applicationLogs")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + applicationLogs = ApplicationLogsConfig.DeserializeApplicationLogsConfig(property0.Value); + continue; + } + if (property0.NameEquals("httpLogs")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + httpLogs = HttpLogsConfig.DeserializeHttpLogsConfig(property0.Value); + continue; + } + if (property0.NameEquals("failedRequestsTracing")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + failedRequestsTracing = EnabledConfig.DeserializeEnabledConfig(property0.Value); + continue; + } + if (property0.NameEquals("detailedErrorMessages")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + detailedErrorMessages = EnabledConfig.DeserializeEnabledConfig(property0.Value); + continue; + } + } + continue; + } + } + return new SiteLogsConfig(id.Value, name.Value, kind.Value, type.Value, applicationLogs.Value, httpLogs.Value, failedRequestsTracing.Value, detailedErrorMessages.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.cs index 79c82b86b0e1..839a01fcd912 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.cs @@ -1,103 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Configuration of App Service site logs. - /// - [Rest.Serialization.JsonTransformation] + /// Configuration of App Service site logs. public partial class SiteLogsConfig : ProxyOnlyResource { - /// - /// Initializes a new instance of the SiteLogsConfig class. - /// + /// Initializes a new instance of SiteLogsConfig. public SiteLogsConfig() { - CustomInit(); } - /// - /// Initializes a new instance of the SiteLogsConfig class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Application logs - /// configuration. - /// HTTP logs configuration. - /// Failed requests tracing - /// configuration. - /// Detailed error messages - /// configuration. - public SiteLogsConfig(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ApplicationLogsConfig applicationLogs = default(ApplicationLogsConfig), HttpLogsConfig httpLogs = default(HttpLogsConfig), EnabledConfig failedRequestsTracing = default(EnabledConfig), EnabledConfig detailedErrorMessages = default(EnabledConfig)) - : base(id, name, kind, type) + /// Initializes a new instance of SiteLogsConfig. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Application logs configuration. + /// HTTP logs configuration. + /// Failed requests tracing configuration. + /// Detailed error messages configuration. + internal SiteLogsConfig(string id, string name, string kind, string type, ApplicationLogsConfig applicationLogs, HttpLogsConfig httpLogs, EnabledConfig failedRequestsTracing, EnabledConfig detailedErrorMessages) : base(id, name, kind, type) { ApplicationLogs = applicationLogs; HttpLogs = httpLogs; FailedRequestsTracing = failedRequestsTracing; DetailedErrorMessages = detailedErrorMessages; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets application logs configuration. - /// - [JsonProperty(PropertyName = "properties.applicationLogs")] + /// Application logs configuration. public ApplicationLogsConfig ApplicationLogs { get; set; } - - /// - /// Gets or sets HTTP logs configuration. - /// - [JsonProperty(PropertyName = "properties.httpLogs")] + /// HTTP logs configuration. public HttpLogsConfig HttpLogs { get; set; } - - /// - /// Gets or sets failed requests tracing configuration. - /// - [JsonProperty(PropertyName = "properties.failedRequestsTracing")] + /// Failed requests tracing configuration. public EnabledConfig FailedRequestsTracing { get; set; } - - /// - /// Gets or sets detailed error messages configuration. - /// - [JsonProperty(PropertyName = "properties.detailedErrorMessages")] + /// Detailed error messages configuration. public EnabledConfig DetailedErrorMessages { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ApplicationLogs != null) - { - ApplicationLogs.Validate(); - } - if (HttpLogs != null) - { - HttpLogs.Validate(); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.Serialization.cs new file mode 100644 index 000000000000..357853af7a1b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteMachineKey + { + internal static SiteMachineKey DeserializeSiteMachineKey(JsonElement element) + { + Optional validation = default; + Optional validationKey = default; + Optional decryption = default; + Optional decryptionKey = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("validation")) + { + validation = property.Value.GetString(); + continue; + } + if (property.NameEquals("validationKey")) + { + validationKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("decryption")) + { + decryption = property.Value.GetString(); + continue; + } + if (property.NameEquals("decryptionKey")) + { + decryptionKey = property.Value.GetString(); + continue; + } + } + return new SiteMachineKey(validation.Value, validationKey.Value, decryption.Value, decryptionKey.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.cs index 5e6f9dc351cd..8018ee373b54 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.cs @@ -1,75 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// MachineKey of an app. - /// + /// MachineKey of an app. public partial class SiteMachineKey { - /// - /// Initializes a new instance of the SiteMachineKey class. - /// - public SiteMachineKey() + /// Initializes a new instance of SiteMachineKey. + internal SiteMachineKey() { - CustomInit(); } - /// - /// Initializes a new instance of the SiteMachineKey class. - /// - /// MachineKey validation. - /// Validation key. - /// Algorithm used for decryption. - /// Decryption key. - public SiteMachineKey(string validation = default(string), string validationKey = default(string), string decryption = default(string), string decryptionKey = default(string)) + /// Initializes a new instance of SiteMachineKey. + /// MachineKey validation. + /// Validation key. + /// Algorithm used for decryption. + /// Decryption key. + internal SiteMachineKey(string validation, string validationKey, string decryption, string decryptionKey) { Validation = validation; ValidationKey = validationKey; Decryption = decryption; DecryptionKey = decryptionKey; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets machineKey validation. - /// - [JsonProperty(PropertyName = "validation")] - public string Validation { get; set; } - - /// - /// Gets or sets validation key. - /// - [JsonProperty(PropertyName = "validationKey")] - public string ValidationKey { get; set; } - - /// - /// Gets or sets algorithm used for decryption. - /// - [JsonProperty(PropertyName = "decryption")] - public string Decryption { get; set; } - - /// - /// Gets or sets decryption key. - /// - [JsonProperty(PropertyName = "decryptionKey")] - public string DecryptionKey { get; set; } - + /// MachineKey validation. + public string Validation { get; } + /// Validation key. + public string ValidationKey { get; } + /// Algorithm used for decryption. + public string Decryption { get; } + /// Decryption key. + public string DecryptionKey { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.Serialization.cs new file mode 100644 index 000000000000..ceb4fd8203f2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.Serialization.cs @@ -0,0 +1,622 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SitePatchResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + writer.WriteObjectValue(Identity); + } + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsCollectionDefined(HostNameSslStates)) + { + writer.WritePropertyName("hostNameSslStates"); + writer.WriteStartArray(); + foreach (var item in HostNameSslStates) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ServerFarmId)) + { + writer.WritePropertyName("serverFarmId"); + writer.WriteStringValue(ServerFarmId); + } + if (Optional.IsDefined(Reserved)) + { + writer.WritePropertyName("reserved"); + writer.WriteBooleanValue(Reserved.Value); + } + if (Optional.IsDefined(IsXenon)) + { + writer.WritePropertyName("isXenon"); + writer.WriteBooleanValue(IsXenon.Value); + } + if (Optional.IsDefined(HyperV)) + { + writer.WritePropertyName("hyperV"); + writer.WriteBooleanValue(HyperV.Value); + } + if (Optional.IsDefined(SiteConfig)) + { + writer.WritePropertyName("siteConfig"); + writer.WriteObjectValue(SiteConfig); + } + if (Optional.IsDefined(ScmSiteAlsoStopped)) + { + writer.WritePropertyName("scmSiteAlsoStopped"); + writer.WriteBooleanValue(ScmSiteAlsoStopped.Value); + } + if (Optional.IsDefined(HostingEnvironmentProfile)) + { + writer.WritePropertyName("hostingEnvironmentProfile"); + writer.WriteObjectValue(HostingEnvironmentProfile); + } + if (Optional.IsDefined(ClientAffinityEnabled)) + { + writer.WritePropertyName("clientAffinityEnabled"); + writer.WriteBooleanValue(ClientAffinityEnabled.Value); + } + if (Optional.IsDefined(ClientCertEnabled)) + { + writer.WritePropertyName("clientCertEnabled"); + writer.WriteBooleanValue(ClientCertEnabled.Value); + } + if (Optional.IsDefined(ClientCertMode)) + { + writer.WritePropertyName("clientCertMode"); + writer.WriteStringValue(ClientCertMode.Value.ToSerialString()); + } + if (Optional.IsDefined(ClientCertExclusionPaths)) + { + writer.WritePropertyName("clientCertExclusionPaths"); + writer.WriteStringValue(ClientCertExclusionPaths); + } + if (Optional.IsDefined(HostNamesDisabled)) + { + writer.WritePropertyName("hostNamesDisabled"); + writer.WriteBooleanValue(HostNamesDisabled.Value); + } + if (Optional.IsDefined(CustomDomainVerificationId)) + { + writer.WritePropertyName("customDomainVerificationId"); + writer.WriteStringValue(CustomDomainVerificationId); + } + if (Optional.IsDefined(ContainerSize)) + { + writer.WritePropertyName("containerSize"); + writer.WriteNumberValue(ContainerSize.Value); + } + if (Optional.IsDefined(DailyMemoryTimeQuota)) + { + writer.WritePropertyName("dailyMemoryTimeQuota"); + writer.WriteNumberValue(DailyMemoryTimeQuota.Value); + } + if (Optional.IsDefined(CloningInfo)) + { + writer.WritePropertyName("cloningInfo"); + writer.WriteObjectValue(CloningInfo); + } + if (Optional.IsDefined(HttpsOnly)) + { + writer.WritePropertyName("httpsOnly"); + writer.WriteBooleanValue(HttpsOnly.Value); + } + if (Optional.IsDefined(RedundancyMode)) + { + writer.WritePropertyName("redundancyMode"); + writer.WriteStringValue(RedundancyMode.Value.ToSerialString()); + } + if (Optional.IsDefined(StorageAccountRequired)) + { + writer.WritePropertyName("storageAccountRequired"); + writer.WriteBooleanValue(StorageAccountRequired.Value); + } + if (Optional.IsDefined(KeyVaultReferenceIdentity)) + { + writer.WritePropertyName("keyVaultReferenceIdentity"); + writer.WriteStringValue(KeyVaultReferenceIdentity); + } + if (Optional.IsDefined(VirtualNetworkSubnetId)) + { + writer.WritePropertyName("virtualNetworkSubnetId"); + writer.WriteStringValue(VirtualNetworkSubnetId); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SitePatchResource DeserializeSitePatchResource(JsonElement element) + { + Optional identity = default; + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional state = default; + Optional> hostNames = default; + Optional repositorySiteName = default; + Optional usageState = default; + Optional enabled = default; + Optional> enabledHostNames = default; + Optional availabilityState = default; + Optional> hostNameSslStates = default; + Optional serverFarmId = default; + Optional reserved = default; + Optional isXenon = default; + Optional hyperV = default; + Optional lastModifiedTimeUtc = default; + Optional siteConfig = default; + Optional> trafficManagerHostNames = default; + Optional scmSiteAlsoStopped = default; + Optional targetSwapSlot = default; + Optional hostingEnvironmentProfile = default; + Optional clientAffinityEnabled = default; + Optional clientCertEnabled = default; + Optional clientCertMode = default; + Optional clientCertExclusionPaths = default; + Optional hostNamesDisabled = default; + Optional customDomainVerificationId = default; + Optional outboundIpAddresses = default; + Optional possibleOutboundIpAddresses = default; + Optional containerSize = default; + Optional dailyMemoryTimeQuota = default; + Optional suspendedTill = default; + Optional maxNumberOfWorkers = default; + Optional cloningInfo = default; + Optional resourceGroup = default; + Optional isDefaultContainer = default; + Optional defaultHostName = default; + Optional slotSwapStatus = default; + Optional httpsOnly = default; + Optional redundancyMode = default; + Optional inProgressOperationId = default; + Optional storageAccountRequired = default; + Optional keyVaultReferenceIdentity = default; + Optional virtualNetworkSubnetId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("state")) + { + state = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + hostNames = array; + continue; + } + if (property0.NameEquals("repositorySiteName")) + { + repositorySiteName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("usageState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + usageState = property0.Value.GetString().ToUsageState(); + continue; + } + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("enabledHostNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + enabledHostNames = array; + continue; + } + if (property0.NameEquals("availabilityState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + availabilityState = property0.Value.GetString().ToSiteAvailabilityState(); + continue; + } + if (property0.NameEquals("hostNameSslStates")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(HostNameSslState.DeserializeHostNameSslState(item)); + } + hostNameSslStates = array; + continue; + } + if (property0.NameEquals("serverFarmId")) + { + serverFarmId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("reserved")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + reserved = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("isXenon")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isXenon = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("hyperV")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hyperV = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("lastModifiedTimeUtc")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + lastModifiedTimeUtc = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("siteConfig")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + siteConfig = SiteConfig.DeserializeSiteConfig(property0.Value); + continue; + } + if (property0.NameEquals("trafficManagerHostNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + trafficManagerHostNames = array; + continue; + } + if (property0.NameEquals("scmSiteAlsoStopped")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + scmSiteAlsoStopped = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("targetSwapSlot")) + { + targetSwapSlot = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostingEnvironmentProfile")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); + continue; + } + if (property0.NameEquals("clientAffinityEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + clientAffinityEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("clientCertEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + clientCertEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("clientCertMode")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + clientCertMode = property0.Value.GetString().ToClientCertMode(); + continue; + } + if (property0.NameEquals("clientCertExclusionPaths")) + { + clientCertExclusionPaths = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostNamesDisabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hostNamesDisabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("customDomainVerificationId")) + { + customDomainVerificationId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("outboundIpAddresses")) + { + outboundIpAddresses = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("possibleOutboundIpAddresses")) + { + possibleOutboundIpAddresses = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("containerSize")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + containerSize = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("dailyMemoryTimeQuota")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + dailyMemoryTimeQuota = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("suspendedTill")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + suspendedTill = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("maxNumberOfWorkers")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + maxNumberOfWorkers = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("cloningInfo")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + cloningInfo = CloningInfo.DeserializeCloningInfo(property0.Value); + continue; + } + if (property0.NameEquals("resourceGroup")) + { + resourceGroup = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("isDefaultContainer")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isDefaultContainer = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("defaultHostName")) + { + defaultHostName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("slotSwapStatus")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + slotSwapStatus = SlotSwapStatus.DeserializeSlotSwapStatus(property0.Value); + continue; + } + if (property0.NameEquals("httpsOnly")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + httpsOnly = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("redundancyMode")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + redundancyMode = property0.Value.GetString().ToRedundancyMode(); + continue; + } + if (property0.NameEquals("inProgressOperationId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + inProgressOperationId = property0.Value.GetGuid(); + continue; + } + if (property0.NameEquals("storageAccountRequired")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + storageAccountRequired = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("keyVaultReferenceIdentity")) + { + keyVaultReferenceIdentity = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("virtualNetworkSubnetId")) + { + virtualNetworkSubnetId = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new SitePatchResource(id.Value, name.Value, kind.Value, type.Value, identity.Value, state.Value, Optional.ToList(hostNames), repositorySiteName.Value, Optional.ToNullable(usageState), Optional.ToNullable(enabled), Optional.ToList(enabledHostNames), Optional.ToNullable(availabilityState), Optional.ToList(hostNameSslStates), serverFarmId.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(lastModifiedTimeUtc), siteConfig.Value, Optional.ToList(trafficManagerHostNames), Optional.ToNullable(scmSiteAlsoStopped), targetSwapSlot.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(clientAffinityEnabled), Optional.ToNullable(clientCertEnabled), Optional.ToNullable(clientCertMode), clientCertExclusionPaths.Value, Optional.ToNullable(hostNamesDisabled), customDomainVerificationId.Value, outboundIpAddresses.Value, possibleOutboundIpAddresses.Value, Optional.ToNullable(containerSize), Optional.ToNullable(dailyMemoryTimeQuota), Optional.ToNullable(suspendedTill), Optional.ToNullable(maxNumberOfWorkers), cloningInfo.Value, resourceGroup.Value, Optional.ToNullable(isDefaultContainer), defaultHostName.Value, slotSwapStatus.Value, Optional.ToNullable(httpsOnly), Optional.ToNullable(redundancyMode), Optional.ToNullable(inProgressOperationId), Optional.ToNullable(storageAccountRequired), keyVaultReferenceIdentity.Value, virtualNetworkSubnetId.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs index 567a5fb54af7..b3f5cb562a80 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs @@ -1,146 +1,98 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// ARM resource for a site. - /// - [Rest.Serialization.JsonTransformation] + /// ARM resource for a site. public partial class SitePatchResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the SitePatchResource class. - /// + /// Initializes a new instance of SitePatchResource. public SitePatchResource() { - CustomInit(); + HostNames = new ChangeTrackingList(); + EnabledHostNames = new ChangeTrackingList(); + HostNameSslStates = new ChangeTrackingList(); + TrafficManagerHostNames = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the SitePatchResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Current state of the app. - /// Hostnames associated with the app. - /// Name of the repository - /// site. - /// State indicating whether the app has - /// exceeded its quota usage. Read-only. Possible values include: - /// 'Normal', 'Exceeded' - /// <code>true</code> if the app is - /// enabled; otherwise, <code>false</code>. Setting this - /// value to false disables the app (takes the app offline). - /// Enabled hostnames for the - /// app.Hostnames need to be assigned (see HostNames) AND enabled. - /// Otherwise, - /// the app is not served on those hostnames. - /// Management information availability - /// state for the app. Possible values include: 'Normal', 'Limited', - /// 'DisasterRecoveryMode' - /// Hostname SSL states are used to - /// manage the SSL bindings for app's hostnames. - /// Resource ID of the associated App - /// Service plan, formatted as: - /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - /// <code>true</code> if reserved; - /// otherwise, <code>false</code>. - /// Obsolete: Hyper-V sandbox. - /// Hyper-V sandbox. - /// Last time the app was modified, - /// in UTC. Read-only. - /// Configuration of the app. - /// Azure Traffic Manager - /// hostnames associated with the app. Read-only. - /// <code>true</code> to - /// stop SCM (KUDU) site when the app is stopped; otherwise, - /// <code>false</code>. The default is - /// <code>false</code>. - /// Specifies which deployment slot this - /// app will swap into. Read-only. - /// App Service Environment to - /// use for the app. - /// <code>true</code> - /// to enable client affinity; <code>false</code> to stop - /// sending session affinity cookies, which route client requests in - /// the same session to the same instance. Default is - /// <code>true</code>. - /// <code>true</code> to - /// enable client certificate authentication (TLS mutual - /// authentication); otherwise, <code>false</code>. Default - /// is <code>false</code>. - /// This composes with ClientCertEnabled - /// setting. + /// Initializes a new instance of SitePatchResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Managed service identity. + /// Current state of the app. + /// Hostnames associated with the app. + /// Name of the repository site. + /// State indicating whether the app has exceeded its quota usage. Read-only. + /// <code>true</code> if the app is enabled; otherwise, <code>false</code>. Setting this value to false disables the app (takes the app offline). + /// + /// Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, + /// the app is not served on those hostnames. + /// + /// Management information availability state for the app. + /// Hostname SSL states are used to manage the SSL bindings for app's hostnames. + /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + /// <code>true</code> if reserved; otherwise, <code>false</code>. + /// Obsolete: Hyper-V sandbox. + /// Hyper-V sandbox. + /// Last time the app was modified, in UTC. Read-only. + /// Configuration of the app. + /// Azure Traffic Manager hostnames associated with the app. Read-only. + /// <code>true</code> to stop SCM (KUDU) site when the app is stopped; otherwise, <code>false</code>. The default is <code>false</code>. + /// Specifies which deployment slot this app will swap into. Read-only. + /// App Service Environment to use for the app. + /// <code>true</code> to enable client affinity; <code>false</code> to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is <code>true</code>. + /// <code>true</code> to enable client certificate authentication (TLS mutual authentication); otherwise, <code>false</code>. Default is <code>false</code>. + /// + /// This composes with ClientCertEnabled setting. /// - ClientCertEnabled: false means ClientCert is ignored. - /// - ClientCertEnabled: true and ClientCertMode: Required means - /// ClientCert is required. - /// - ClientCertEnabled: true and ClientCertMode: Optional means - /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional' - /// client certificate - /// authentication comma-separated exclusion paths - /// <code>true</code> to - /// disable the public hostnames of the app; otherwise, - /// <code>false</code>. - /// If <code>true</code>, the app is only accessible via - /// API management process. - /// Unique identifier that - /// verifies the custom domains assigned to the app. Customer will add - /// this id to a txt record for verification. - /// List of IP addresses that the app - /// uses for outbound connections (e.g. database access). Includes VIPs - /// from tenants that site can be hosted with current settings. - /// Read-only. - /// List of IP addresses that - /// the app uses for outbound connections (e.g. database access). - /// Includes VIPs from all tenants except dataComponent. - /// Read-only. - /// Size of the function container. - /// Maximum allowed daily - /// memory-time quota (applicable on dynamic apps only). - /// App suspended till in case memory-time - /// quota is exceeded. - /// Maximum number of workers. - /// This only applies to Functions container. - /// If specified during app creation, the app - /// is cloned from a source app. - /// Name of the resource group the app - /// belongs to. Read-only. - /// <code>true</code> if - /// the app is a default container; otherwise, - /// <code>false</code>. - /// Default hostname of the app. - /// Read-only. - /// Status of the last deployment slot - /// swap operation. - /// HttpsOnly: configures a web site to accept - /// only https requests. Issues redirect for - /// http requests - /// Site redundancy mode. Possible values - /// include: 'None', 'Manual', 'Failover', 'ActiveActive', - /// 'GeoRedundant' - /// Specifies an operation id if - /// this site has a pending operation. - public SitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) - : base(id, name, kind, type) + /// - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + /// - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. + /// + /// client certificate authentication comma-separated exclusion paths. + /// + /// <code>true</code> to disable the public hostnames of the app; otherwise, <code>false</code>. + /// If <code>true</code>, the app is only accessible via API management process. + /// + /// Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. + /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. + /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. + /// Size of the function container. + /// Maximum allowed daily memory-time quota (applicable on dynamic apps only). + /// App suspended till in case memory-time quota is exceeded. + /// + /// Maximum number of workers. + /// This only applies to Functions container. + /// + /// If specified during app creation, the app is cloned from a source app. + /// Name of the resource group the app belongs to. Read-only. + /// <code>true</code> if the app is a default container; otherwise, <code>false</code>. + /// Default hostname of the app. Read-only. + /// Status of the last deployment slot swap operation. + /// + /// HttpsOnly: configures a web site to accept only https requests. Issues redirect for + /// http requests. + /// + /// Site redundancy mode. + /// Specifies an operation id if this site has a pending operation. + /// Checks if Customer provided storage account is required. + /// Identity to use for Key Vault Reference authentication. + /// + /// Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. + /// This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + /// + internal SitePatchResource(string id, string name, string kind, string type, ManagedServiceIdentity identity, string state, IReadOnlyList hostNames, string repositorySiteName, UsageState? usageState, bool? enabled, IReadOnlyList enabledHostNames, SiteAvailabilityState? availabilityState, IList hostNameSslStates, string serverFarmId, bool? reserved, bool? isXenon, bool? hyperV, DateTimeOffset? lastModifiedTimeUtc, SiteConfig siteConfig, IReadOnlyList trafficManagerHostNames, bool? scmSiteAlsoStopped, string targetSwapSlot, HostingEnvironmentProfile hostingEnvironmentProfile, bool? clientAffinityEnabled, bool? clientCertEnabled, ClientCertMode? clientCertMode, string clientCertExclusionPaths, bool? hostNamesDisabled, string customDomainVerificationId, string outboundIpAddresses, string possibleOutboundIpAddresses, int? containerSize, int? dailyMemoryTimeQuota, DateTimeOffset? suspendedTill, int? maxNumberOfWorkers, CloningInfo cloningInfo, string resourceGroup, bool? isDefaultContainer, string defaultHostName, SlotSwapStatus slotSwapStatus, bool? httpsOnly, RedundancyMode? redundancyMode, Guid? inProgressOperationId, bool? storageAccountRequired, string keyVaultReferenceIdentity, string virtualNetworkSubnetId) : base(id, name, kind, type) { + Identity = identity; State = state; HostNames = hostNames; RepositorySiteName = repositorySiteName; @@ -179,317 +131,114 @@ public SitePatchResource() HttpsOnly = httpsOnly; RedundancyMode = redundancyMode; InProgressOperationId = inProgressOperationId; - Identity = identity; - CustomInit(); + StorageAccountRequired = storageAccountRequired; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + VirtualNetworkSubnetId = virtualNetworkSubnetId; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets current state of the app. - /// - [JsonProperty(PropertyName = "properties.state")] - public string State { get; private set; } - - /// - /// Gets hostnames associated with the app. - /// - [JsonProperty(PropertyName = "properties.hostNames")] - public IList HostNames { get; private set; } - - /// - /// Gets name of the repository site. - /// - [JsonProperty(PropertyName = "properties.repositorySiteName")] - public string RepositorySiteName { get; private set; } - - /// - /// Gets state indicating whether the app has exceeded its quota usage. - /// Read-only. Possible values include: 'Normal', 'Exceeded' - /// - [JsonProperty(PropertyName = "properties.usageState")] - public UsageState? UsageState { get; private set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// app is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. Setting this value - /// to false disables the app (takes the app offline). - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// Managed service identity. + public ManagedServiceIdentity Identity { get; set; } + /// Current state of the app. + public string State { get; } + /// Hostnames associated with the app. + public IReadOnlyList HostNames { get; } + /// Name of the repository site. + public string RepositorySiteName { get; } + /// State indicating whether the app has exceeded its quota usage. Read-only. + public UsageState? UsageState { get; } + /// <code>true</code> if the app is enabled; otherwise, <code>false</code>. Setting this value to false disables the app (takes the app offline). public bool? Enabled { get; set; } - /// - /// Gets enabled hostnames for the app.Hostnames need to be assigned - /// (see HostNames) AND enabled. Otherwise, + /// Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, /// the app is not served on those hostnames. /// - [JsonProperty(PropertyName = "properties.enabledHostNames")] - public IList EnabledHostNames { get; private set; } - - /// - /// Gets management information availability state for the app. - /// Possible values include: 'Normal', 'Limited', - /// 'DisasterRecoveryMode' - /// - [JsonProperty(PropertyName = "properties.availabilityState")] - public SiteAvailabilityState? AvailabilityState { get; private set; } - - /// - /// Gets or sets hostname SSL states are used to manage the SSL - /// bindings for app's hostnames. - /// - [JsonProperty(PropertyName = "properties.hostNameSslStates")] - public IList HostNameSslStates { get; set; } - - /// - /// Gets or sets resource ID of the associated App Service plan, - /// formatted as: - /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - /// - [JsonProperty(PropertyName = "properties.serverFarmId")] + public IReadOnlyList EnabledHostNames { get; } + /// Management information availability state for the app. + public SiteAvailabilityState? AvailabilityState { get; } + /// Hostname SSL states are used to manage the SSL bindings for app's hostnames. + public IList HostNameSslStates { get; } + /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". public string ServerFarmId { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// reserved; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.reserved")] + /// <code>true</code> if reserved; otherwise, <code>false</code>. public bool? Reserved { get; set; } - - /// - /// Gets or sets obsolete: Hyper-V sandbox. - /// - [JsonProperty(PropertyName = "properties.isXenon")] + /// Obsolete: Hyper-V sandbox. public bool? IsXenon { get; set; } - - /// - /// Gets or sets hyper-V sandbox. - /// - [JsonProperty(PropertyName = "properties.hyperV")] + /// Hyper-V sandbox. public bool? HyperV { get; set; } - - /// - /// Gets last time the app was modified, in UTC. Read-only. - /// - [JsonProperty(PropertyName = "properties.lastModifiedTimeUtc")] - public System.DateTime? LastModifiedTimeUtc { get; private set; } - - /// - /// Gets or sets configuration of the app. - /// - [JsonProperty(PropertyName = "properties.siteConfig")] + /// Last time the app was modified, in UTC. Read-only. + public DateTimeOffset? LastModifiedTimeUtc { get; } + /// Configuration of the app. public SiteConfig SiteConfig { get; set; } - - /// - /// Gets azure Traffic Manager hostnames associated with the app. - /// Read-only. - /// - [JsonProperty(PropertyName = "properties.trafficManagerHostNames")] - public IList TrafficManagerHostNames { get; private set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to stop - /// SCM (KUDU) site when the app is stopped; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. The default is - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.scmSiteAlsoStopped")] + /// Azure Traffic Manager hostnames associated with the app. Read-only. + public IReadOnlyList TrafficManagerHostNames { get; } + /// <code>true</code> to stop SCM (KUDU) site when the app is stopped; otherwise, <code>false</code>. The default is <code>false</code>. public bool? ScmSiteAlsoStopped { get; set; } - - /// - /// Gets specifies which deployment slot this app will swap into. - /// Read-only. - /// - [JsonProperty(PropertyName = "properties.targetSwapSlot")] - public string TargetSwapSlot { get; private set; } - - /// - /// Gets or sets app Service Environment to use for the app. - /// - [JsonProperty(PropertyName = "properties.hostingEnvironmentProfile")] + /// Specifies which deployment slot this app will swap into. Read-only. + public string TargetSwapSlot { get; } + /// App Service Environment to use for the app. public HostingEnvironmentProfile HostingEnvironmentProfile { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// enable client affinity; - /// &lt;code&gt;false&lt;/code&gt; to stop sending - /// session affinity cookies, which route client requests in the same - /// session to the same instance. Default is - /// &lt;code&gt;true&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.clientAffinityEnabled")] + /// <code>true</code> to enable client affinity; <code>false</code> to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is <code>true</code>. public bool? ClientAffinityEnabled { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// enable client certificate authentication (TLS mutual - /// authentication); otherwise, - /// &lt;code&gt;false&lt;/code&gt;. Default is - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.clientCertEnabled")] + /// <code>true</code> to enable client certificate authentication (TLS mutual authentication); otherwise, <code>false</code>. Default is <code>false</code>. public bool? ClientCertEnabled { get; set; } - /// - /// Gets or sets this composes with ClientCertEnabled setting. + /// This composes with ClientCertEnabled setting. /// - ClientCertEnabled: false means ClientCert is ignored. - /// - ClientCertEnabled: true and ClientCertMode: Required means - /// ClientCert is required. - /// - ClientCertEnabled: true and ClientCertMode: Optional means - /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional' + /// - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + /// - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. /// - [JsonProperty(PropertyName = "properties.clientCertMode")] public ClientCertMode? ClientCertMode { get; set; } - - /// - /// Gets or sets client certificate authentication comma-separated - /// exclusion paths - /// - [JsonProperty(PropertyName = "properties.clientCertExclusionPaths")] + /// client certificate authentication comma-separated exclusion paths. public string ClientCertExclusionPaths { get; set; } - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// disable the public hostnames of the app; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// If &lt;code&gt;true&lt;/code&gt;, the app is only - /// accessible via API management process. + /// <code>true</code> to disable the public hostnames of the app; otherwise, <code>false</code>. + /// If <code>true</code>, the app is only accessible via API management process. /// - [JsonProperty(PropertyName = "properties.hostNamesDisabled")] public bool? HostNamesDisabled { get; set; } - - /// - /// Gets or sets unique identifier that verifies the custom domains - /// assigned to the app. Customer will add this id to a txt record for - /// verification. - /// - [JsonProperty(PropertyName = "properties.customDomainVerificationId")] + /// Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. public string CustomDomainVerificationId { get; set; } - - /// - /// Gets list of IP addresses that the app uses for outbound - /// connections (e.g. database access). Includes VIPs from tenants that - /// site can be hosted with current settings. Read-only. - /// - [JsonProperty(PropertyName = "properties.outboundIpAddresses")] - public string OutboundIpAddresses { get; private set; } - - /// - /// Gets list of IP addresses that the app uses for outbound - /// connections (e.g. database access). Includes VIPs from all tenants - /// except dataComponent. Read-only. - /// - [JsonProperty(PropertyName = "properties.possibleOutboundIpAddresses")] - public string PossibleOutboundIpAddresses { get; private set; } - - /// - /// Gets or sets size of the function container. - /// - [JsonProperty(PropertyName = "properties.containerSize")] + /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. + public string OutboundIpAddresses { get; } + /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. + public string PossibleOutboundIpAddresses { get; } + /// Size of the function container. public int? ContainerSize { get; set; } - - /// - /// Gets or sets maximum allowed daily memory-time quota (applicable on - /// dynamic apps only). - /// - [JsonProperty(PropertyName = "properties.dailyMemoryTimeQuota")] + /// Maximum allowed daily memory-time quota (applicable on dynamic apps only). public int? DailyMemoryTimeQuota { get; set; } - + /// App suspended till in case memory-time quota is exceeded. + public DateTimeOffset? SuspendedTill { get; } /// - /// Gets app suspended till in case memory-time quota is exceeded. - /// - [JsonProperty(PropertyName = "properties.suspendedTill")] - public System.DateTime? SuspendedTill { get; private set; } - - /// - /// Gets maximum number of workers. + /// Maximum number of workers. /// This only applies to Functions container. /// - [JsonProperty(PropertyName = "properties.maxNumberOfWorkers")] - public int? MaxNumberOfWorkers { get; private set; } - - /// - /// Gets or sets if specified during app creation, the app is cloned - /// from a source app. - /// - [JsonProperty(PropertyName = "properties.cloningInfo")] + public int? MaxNumberOfWorkers { get; } + /// If specified during app creation, the app is cloned from a source app. public CloningInfo CloningInfo { get; set; } - - /// - /// Gets name of the resource group the app belongs to. Read-only. - /// - [JsonProperty(PropertyName = "properties.resourceGroup")] - public string ResourceGroup { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if the app is a - /// default container; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.isDefaultContainer")] - public bool? IsDefaultContainer { get; private set; } - - /// - /// Gets default hostname of the app. Read-only. + /// Name of the resource group the app belongs to. Read-only. + public string ResourceGroup { get; } + /// <code>true</code> if the app is a default container; otherwise, <code>false</code>. + public bool? IsDefaultContainer { get; } + /// Default hostname of the app. Read-only. + public string DefaultHostName { get; } + /// Status of the last deployment slot swap operation. + public SlotSwapStatus SlotSwapStatus { get; } + /// + /// HttpsOnly: configures a web site to accept only https requests. Issues redirect for + /// http requests. /// - [JsonProperty(PropertyName = "properties.defaultHostName")] - public string DefaultHostName { get; private set; } - - /// - /// Gets status of the last deployment slot swap operation. - /// - [JsonProperty(PropertyName = "properties.slotSwapStatus")] - public SlotSwapStatus SlotSwapStatus { get; private set; } - - /// - /// Gets or sets httpsOnly: configures a web site to accept only https - /// requests. Issues redirect for - /// http requests - /// - [JsonProperty(PropertyName = "properties.httpsOnly")] public bool? HttpsOnly { get; set; } - - /// - /// Gets or sets site redundancy mode. Possible values include: 'None', - /// 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' - /// - [JsonProperty(PropertyName = "properties.redundancyMode")] + /// Site redundancy mode. public RedundancyMode? RedundancyMode { get; set; } - + /// Specifies an operation id if this site has a pending operation. + public Guid? InProgressOperationId { get; } + /// Checks if Customer provided storage account is required. + public bool? StorageAccountRequired { get; set; } + /// Identity to use for Key Vault Reference authentication. + public string KeyVaultReferenceIdentity { get; set; } /// - /// Gets specifies an operation id if this site has a pending - /// operation. + /// Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. + /// This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. /// - [JsonProperty(PropertyName = "properties.inProgressOperationId")] - public System.Guid? InProgressOperationId { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "identity")] - public ManagedServiceIdentity Identity { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (SiteConfig != null) - { - SiteConfig.Validate(); - } - if (CloningInfo != null) - { - CloningInfo.Validate(); - } - } + public string VirtualNetworkSubnetId { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.Serialization.cs new file mode 100644 index 000000000000..0067f529a258 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SitePhpErrorLogFlag : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(LocalLogErrors)) + { + writer.WritePropertyName("localLogErrors"); + writer.WriteStringValue(LocalLogErrors); + } + if (Optional.IsDefined(MasterLogErrors)) + { + writer.WritePropertyName("masterLogErrors"); + writer.WriteStringValue(MasterLogErrors); + } + if (Optional.IsDefined(LocalLogErrorsMaxLength)) + { + writer.WritePropertyName("localLogErrorsMaxLength"); + writer.WriteStringValue(LocalLogErrorsMaxLength); + } + if (Optional.IsDefined(MasterLogErrorsMaxLength)) + { + writer.WritePropertyName("masterLogErrorsMaxLength"); + writer.WriteStringValue(MasterLogErrorsMaxLength); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SitePhpErrorLogFlag DeserializeSitePhpErrorLogFlag(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional localLogErrors = default; + Optional masterLogErrors = default; + Optional localLogErrorsMaxLength = default; + Optional masterLogErrorsMaxLength = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("localLogErrors")) + { + localLogErrors = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("masterLogErrors")) + { + masterLogErrors = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("localLogErrorsMaxLength")) + { + localLogErrorsMaxLength = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("masterLogErrorsMaxLength")) + { + masterLogErrorsMaxLength = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new SitePhpErrorLogFlag(id.Value, name.Value, kind.Value, type.Value, localLogErrors.Value, masterLogErrors.Value, localLogErrorsMaxLength.Value, masterLogErrorsMaxLength.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.cs index 8d7fc1abb334..ca199b15a722 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.cs @@ -1,85 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Used for getting PHP error logging flag. - /// - [Rest.Serialization.JsonTransformation] + /// Used for getting PHP error logging flag. public partial class SitePhpErrorLogFlag : ProxyOnlyResource { - /// - /// Initializes a new instance of the SitePhpErrorLogFlag class. - /// + /// Initializes a new instance of SitePhpErrorLogFlag. public SitePhpErrorLogFlag() { - CustomInit(); } - /// - /// Initializes a new instance of the SitePhpErrorLogFlag class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Local log_errors setting. - /// Master log_errors setting. - /// Local log_errors_max_len - /// setting. - /// Master log_errors_max_len - /// setting. - public SitePhpErrorLogFlag(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string localLogErrors = default(string), string masterLogErrors = default(string), string localLogErrorsMaxLength = default(string), string masterLogErrorsMaxLength = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of SitePhpErrorLogFlag. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Local log_errors setting. + /// Master log_errors setting. + /// Local log_errors_max_len setting. + /// Master log_errors_max_len setting. + internal SitePhpErrorLogFlag(string id, string name, string kind, string type, string localLogErrors, string masterLogErrors, string localLogErrorsMaxLength, string masterLogErrorsMaxLength) : base(id, name, kind, type) { LocalLogErrors = localLogErrors; MasterLogErrors = masterLogErrors; LocalLogErrorsMaxLength = localLogErrorsMaxLength; MasterLogErrorsMaxLength = masterLogErrorsMaxLength; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets local log_errors setting. - /// - [JsonProperty(PropertyName = "properties.localLogErrors")] + /// Local log_errors setting. public string LocalLogErrors { get; set; } - - /// - /// Gets or sets master log_errors setting. - /// - [JsonProperty(PropertyName = "properties.masterLogErrors")] + /// Master log_errors setting. public string MasterLogErrors { get; set; } - - /// - /// Gets or sets local log_errors_max_len setting. - /// - [JsonProperty(PropertyName = "properties.localLogErrorsMaxLength")] + /// Local log_errors_max_len setting. public string LocalLogErrorsMaxLength { get; set; } - - /// - /// Gets or sets master log_errors_max_len setting. - /// - [JsonProperty(PropertyName = "properties.masterLogErrorsMaxLength")] + /// Master log_errors_max_len setting. public string MasterLogErrorsMaxLength { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.Serialization.cs new file mode 100644 index 000000000000..7dfb38f285f5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class SiteRuntimeStateExtensions + { + public static string ToSerialString(this SiteRuntimeState value) => value switch + { + SiteRuntimeState.Ready => "READY", + SiteRuntimeState.Stopped => "STOPPED", + SiteRuntimeState.Unknown => "UNKNOWN", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteRuntimeState value.") + }; + + public static SiteRuntimeState ToSiteRuntimeState(this string value) + { + if (string.Equals(value, "READY", StringComparison.InvariantCultureIgnoreCase)) return SiteRuntimeState.Ready; + if (string.Equals(value, "STOPPED", StringComparison.InvariantCultureIgnoreCase)) return SiteRuntimeState.Stopped; + if (string.Equals(value, "UNKNOWN", StringComparison.InvariantCultureIgnoreCase)) return SiteRuntimeState.Unknown; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteRuntimeState value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.cs index 06ddc43c58fe..789a50cea84b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for SiteRuntimeState. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// The SiteRuntimeState. public enum SiteRuntimeState { - [EnumMember(Value = "READY")] - READY, - [EnumMember(Value = "STOPPED")] - STOPPED, - [EnumMember(Value = "UNKNOWN")] - UNKNOWN - } - internal static class SiteRuntimeStateEnumExtension - { - internal static string ToSerializedValue(this SiteRuntimeState? value) - { - return value == null ? null : ((SiteRuntimeState)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this SiteRuntimeState value) - { - switch( value ) - { - case SiteRuntimeState.READY: - return "READY"; - case SiteRuntimeState.STOPPED: - return "STOPPED"; - case SiteRuntimeState.UNKNOWN: - return "UNKNOWN"; - } - return null; - } - - internal static SiteRuntimeState? ParseSiteRuntimeState(this string value) - { - switch( value ) - { - case "READY": - return SiteRuntimeState.READY; - case "STOPPED": - return SiteRuntimeState.STOPPED; - case "UNKNOWN": - return SiteRuntimeState.UNKNOWN; - } - return null; - } + /// READY. + Ready, + /// STOPPED. + Stopped, + /// UNKNOWN. + Unknown } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.Serialization.cs new file mode 100644 index 000000000000..9ddf8a89abe5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteSeal + { + internal static SiteSeal DeserializeSiteSeal(JsonElement element) + { + string html = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("html")) + { + html = property.Value.GetString(); + continue; + } + } + return new SiteSeal(html); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.cs index 01aa7283ffa6..e83623b66716 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.cs @@ -1,65 +1,31 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Site seal - /// + /// Site seal. public partial class SiteSeal { - /// - /// Initializes a new instance of the SiteSeal class. - /// - public SiteSeal() + /// Initializes a new instance of SiteSeal. + /// HTML snippet. + /// is null. + internal SiteSeal(string html) { - CustomInit(); - } + if (html == null) + { + throw new ArgumentNullException(nameof(html)); + } - /// - /// Initializes a new instance of the SiteSeal class. - /// - /// HTML snippet - public SiteSeal(string html) - { Html = html; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets HTML snippet - /// - [JsonProperty(PropertyName = "html")] - public string Html { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Html == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Html"); - } - } + /// HTML snippet. + public string Html { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.Serialization.cs new file mode 100644 index 000000000000..0caea3b63d24 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.Serialization.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteSealRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(LightTheme)) + { + writer.WritePropertyName("lightTheme"); + writer.WriteBooleanValue(LightTheme.Value); + } + if (Optional.IsDefined(Locale)) + { + writer.WritePropertyName("locale"); + writer.WriteStringValue(Locale); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.cs index e21b9e048ed2..fe2111dd4d2c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.cs @@ -1,63 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Site seal request. - /// + /// Site seal request. public partial class SiteSealRequest { - /// - /// Initializes a new instance of the SiteSealRequest class. - /// + /// Initializes a new instance of SiteSealRequest. public SiteSealRequest() { - CustomInit(); } - /// - /// Initializes a new instance of the SiteSealRequest class. - /// - /// If <code>true</code> use the - /// light color theme for site seal; otherwise, use the default color - /// theme. - /// Locale of site seal. - public SiteSealRequest(bool? lightTheme = default(bool?), string locale = default(string)) - { - LightTheme = lightTheme; - Locale = locale; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets if &lt;code&gt;true&lt;/code&gt; use - /// the light color theme for site seal; otherwise, use the default - /// color theme. - /// - [JsonProperty(PropertyName = "lightTheme")] + /// If <code>true</code> use the light color theme for site seal; otherwise, use the default color theme. public bool? LightTheme { get; set; } - - /// - /// Gets or sets locale of site seal. - /// - [JsonProperty(PropertyName = "locale")] + /// Locale of site seal. public string Locale { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.Serialization.cs new file mode 100644 index 000000000000..958d7683256b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SiteSourceControl : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RepoUrl)) + { + writer.WritePropertyName("repoUrl"); + writer.WriteStringValue(RepoUrl); + } + if (Optional.IsDefined(Branch)) + { + writer.WritePropertyName("branch"); + writer.WriteStringValue(Branch); + } + if (Optional.IsDefined(IsManualIntegration)) + { + writer.WritePropertyName("isManualIntegration"); + writer.WriteBooleanValue(IsManualIntegration.Value); + } + if (Optional.IsDefined(IsGitHubAction)) + { + writer.WritePropertyName("isGitHubAction"); + writer.WriteBooleanValue(IsGitHubAction.Value); + } + if (Optional.IsDefined(DeploymentRollbackEnabled)) + { + writer.WritePropertyName("deploymentRollbackEnabled"); + writer.WriteBooleanValue(DeploymentRollbackEnabled.Value); + } + if (Optional.IsDefined(IsMercurial)) + { + writer.WritePropertyName("isMercurial"); + writer.WriteBooleanValue(IsMercurial.Value); + } + if (Optional.IsDefined(GitHubActionConfiguration)) + { + writer.WritePropertyName("gitHubActionConfiguration"); + writer.WriteObjectValue(GitHubActionConfiguration); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SiteSourceControl DeserializeSiteSourceControl(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional repoUrl = default; + Optional branch = default; + Optional isManualIntegration = default; + Optional isGitHubAction = default; + Optional deploymentRollbackEnabled = default; + Optional isMercurial = default; + Optional gitHubActionConfiguration = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("repoUrl")) + { + repoUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("branch")) + { + branch = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("isManualIntegration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isManualIntegration = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("isGitHubAction")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isGitHubAction = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("deploymentRollbackEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + deploymentRollbackEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("isMercurial")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isMercurial = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("gitHubActionConfiguration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + gitHubActionConfiguration = GitHubActionConfiguration.DeserializeGitHubActionConfiguration(property0.Value); + continue; + } + } + continue; + } + } + return new SiteSourceControl(id.Value, name.Value, kind.Value, type.Value, repoUrl.Value, branch.Value, Optional.ToNullable(isManualIntegration), Optional.ToNullable(isGitHubAction), Optional.ToNullable(deploymentRollbackEnabled), Optional.ToNullable(isMercurial), gitHubActionConfiguration.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs index c2544d5f558f..791a1ebd4a28 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs @@ -1,58 +1,33 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Source control configuration for an app. - /// - [Rest.Serialization.JsonTransformation] + /// Source control configuration for an app. public partial class SiteSourceControl : ProxyOnlyResource { - /// - /// Initializes a new instance of the SiteSourceControl class. - /// + /// Initializes a new instance of SiteSourceControl. public SiteSourceControl() { - CustomInit(); } - /// - /// Initializes a new instance of the SiteSourceControl class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Repository or source control URL. - /// Name of branch to use for deployment. - /// <code>true</code> to - /// limit to manual integration; <code>false</code> to - /// enable continuous integration (which configures webhooks into - /// online repos like GitHub). - /// <code>true</code> if this - /// is deployed via GitHub action. - /// <code>true</code> to - /// enable deployment rollback; otherwise, - /// <code>false</code>. - /// <code>true</code> for a - /// Mercurial repository; <code>false</code> for a Git - /// repository. - public SiteSourceControl(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repoUrl = default(string), string branch = default(string), bool? isManualIntegration = default(bool?), bool? isGitHubAction = default(bool?), bool? deploymentRollbackEnabled = default(bool?), bool? isMercurial = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of SiteSourceControl. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Repository or source control URL. + /// Name of branch to use for deployment. + /// <code>true</code> to limit to manual integration; <code>false</code> to enable continuous integration (which configures webhooks into online repos like GitHub). + /// <code>true</code> if this is deployed via GitHub action. + /// <code>true</code> to enable deployment rollback; otherwise, <code>false</code>. + /// <code>true</code> for a Mercurial repository; <code>false</code> for a Git repository. + /// If GitHub Action is selected, than the associated configuration. + internal SiteSourceControl(string id, string name, string kind, string type, string repoUrl, string branch, bool? isManualIntegration, bool? isGitHubAction, bool? deploymentRollbackEnabled, bool? isMercurial, GitHubActionConfiguration gitHubActionConfiguration) : base(id, name, kind, type) { RepoUrl = repoUrl; Branch = branch; @@ -60,59 +35,22 @@ public SiteSourceControl() IsGitHubAction = isGitHubAction; DeploymentRollbackEnabled = deploymentRollbackEnabled; IsMercurial = isMercurial; - CustomInit(); + GitHubActionConfiguration = gitHubActionConfiguration; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets repository or source control URL. - /// - [JsonProperty(PropertyName = "properties.repoUrl")] + /// Repository or source control URL. public string RepoUrl { get; set; } - - /// - /// Gets or sets name of branch to use for deployment. - /// - [JsonProperty(PropertyName = "properties.branch")] + /// Name of branch to use for deployment. public string Branch { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to limit - /// to manual integration; - /// &lt;code&gt;false&lt;/code&gt; to enable continuous - /// integration (which configures webhooks into online repos like - /// GitHub). - /// - [JsonProperty(PropertyName = "properties.isManualIntegration")] + /// <code>true</code> to limit to manual integration; <code>false</code> to enable continuous integration (which configures webhooks into online repos like GitHub). public bool? IsManualIntegration { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this - /// is deployed via GitHub action. - /// - [JsonProperty(PropertyName = "properties.isGitHubAction")] + /// <code>true</code> if this is deployed via GitHub action. public bool? IsGitHubAction { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; to - /// enable deployment rollback; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.deploymentRollbackEnabled")] + /// <code>true</code> to enable deployment rollback; otherwise, <code>false</code>. public bool? DeploymentRollbackEnabled { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; for a - /// Mercurial repository; - /// &lt;code&gt;false&lt;/code&gt; for a Git - /// repository. - /// - [JsonProperty(PropertyName = "properties.isMercurial")] + /// <code>true</code> for a Mercurial repository; <code>false</code> for a Git repository. public bool? IsMercurial { get; set; } - + /// If GitHub Action is selected, than the associated configuration. + public GitHubActionConfiguration GitHubActionConfiguration { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.Serialization.cs new file mode 100644 index 000000000000..b8bdd44e96d2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.Serialization.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SkuCapacity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Minimum)) + { + writer.WritePropertyName("minimum"); + writer.WriteNumberValue(Minimum.Value); + } + if (Optional.IsDefined(Maximum)) + { + writer.WritePropertyName("maximum"); + writer.WriteNumberValue(Maximum.Value); + } + if (Optional.IsDefined(ElasticMaximum)) + { + writer.WritePropertyName("elasticMaximum"); + writer.WriteNumberValue(ElasticMaximum.Value); + } + if (Optional.IsDefined(Default)) + { + writer.WritePropertyName("default"); + writer.WriteNumberValue(Default.Value); + } + if (Optional.IsDefined(ScaleType)) + { + writer.WritePropertyName("scaleType"); + writer.WriteStringValue(ScaleType); + } + writer.WriteEndObject(); + } + + internal static SkuCapacity DeserializeSkuCapacity(JsonElement element) + { + Optional minimum = default; + Optional maximum = default; + Optional elasticMaximum = default; + Optional @default = default; + Optional scaleType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("minimum")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + minimum = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maximum")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + maximum = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("elasticMaximum")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + elasticMaximum = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("default")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + @default = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("scaleType")) + { + scaleType = property.Value.GetString(); + continue; + } + } + return new SkuCapacity(Optional.ToNullable(minimum), Optional.ToNullable(maximum), Optional.ToNullable(elasticMaximum), Optional.ToNullable(@default), scaleType.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs index 87d1de6bc667..e6915a5cfe1a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs @@ -1,83 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Description of the App Service plan scale options. - /// + /// Description of the App Service plan scale options. public partial class SkuCapacity { - /// - /// Initializes a new instance of the SkuCapacity class. - /// + /// Initializes a new instance of SkuCapacity. public SkuCapacity() { - CustomInit(); } - /// - /// Initializes a new instance of the SkuCapacity class. - /// - /// Minimum number of workers for this App - /// Service plan SKU. - /// Maximum number of workers for this App - /// Service plan SKU. - /// Default number of workers for this - /// App Service plan SKU. - /// Available scale configurations for an App - /// Service plan. - public SkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string)) + /// Initializes a new instance of SkuCapacity. + /// Minimum number of workers for this App Service plan SKU. + /// Maximum number of workers for this App Service plan SKU. + /// Maximum number of Elastic workers for this App Service plan SKU. + /// Default number of workers for this App Service plan SKU. + /// Available scale configurations for an App Service plan. + internal SkuCapacity(int? minimum, int? maximum, int? elasticMaximum, int? @default, string scaleType) { Minimum = minimum; Maximum = maximum; - DefaultProperty = defaultProperty; + ElasticMaximum = elasticMaximum; + Default = @default; ScaleType = scaleType; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets minimum number of workers for this App Service plan - /// SKU. - /// - [JsonProperty(PropertyName = "minimum")] + /// Minimum number of workers for this App Service plan SKU. public int? Minimum { get; set; } - - /// - /// Gets or sets maximum number of workers for this App Service plan - /// SKU. - /// - [JsonProperty(PropertyName = "maximum")] + /// Maximum number of workers for this App Service plan SKU. public int? Maximum { get; set; } - - /// - /// Gets or sets default number of workers for this App Service plan - /// SKU. - /// - [JsonProperty(PropertyName = "default")] - public int? DefaultProperty { get; set; } - - /// - /// Gets or sets available scale configurations for an App Service - /// plan. - /// - [JsonProperty(PropertyName = "scaleType")] + /// Maximum number of Elastic workers for this App Service plan SKU. + public int? ElasticMaximum { get; set; } + /// Default number of workers for this App Service plan SKU. + public int? Default { get; set; } + /// Available scale configurations for an App Service plan. public string ScaleType { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.Serialization.cs new file mode 100644 index 000000000000..1ef09d479463 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SkuDescription : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Tier)) + { + writer.WritePropertyName("tier"); + writer.WriteStringValue(Tier); + } + if (Optional.IsDefined(Size)) + { + writer.WritePropertyName("size"); + writer.WriteStringValue(Size); + } + if (Optional.IsDefined(Family)) + { + writer.WritePropertyName("family"); + writer.WriteStringValue(Family); + } + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"); + writer.WriteNumberValue(Capacity.Value); + } + if (Optional.IsDefined(SkuCapacity)) + { + writer.WritePropertyName("skuCapacity"); + writer.WriteObjectValue(SkuCapacity); + } + if (Optional.IsCollectionDefined(Locations)) + { + writer.WritePropertyName("locations"); + writer.WriteStartArray(); + foreach (var item in Locations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Capabilities)) + { + writer.WritePropertyName("capabilities"); + writer.WriteStartArray(); + foreach (var item in Capabilities) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static SkuDescription DeserializeSkuDescription(JsonElement element) + { + Optional name = default; + Optional tier = default; + Optional size = default; + Optional family = default; + Optional capacity = default; + Optional skuCapacity = default; + Optional> locations = default; + Optional> capabilities = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("tier")) + { + tier = property.Value.GetString(); + continue; + } + if (property.NameEquals("size")) + { + size = property.Value.GetString(); + continue; + } + if (property.NameEquals("family")) + { + family = property.Value.GetString(); + continue; + } + if (property.NameEquals("capacity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + capacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("skuCapacity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + skuCapacity = SkuCapacity.DeserializeSkuCapacity(property.Value); + continue; + } + if (property.NameEquals("locations")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + locations = array; + continue; + } + if (property.NameEquals("capabilities")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Capability.DeserializeCapability(item)); + } + capabilities = array; + continue; + } + } + return new SkuDescription(name.Value, tier.Value, size.Value, family.Value, Optional.ToNullable(capacity), skuCapacity.Value, Optional.ToList(locations), Optional.ToList(capabilities)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.cs index 9fc08123d409..0a9c4311e7c3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.cs @@ -1,48 +1,35 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Description of a SKU for a scalable resource. - /// + /// Description of a SKU for a scalable resource. public partial class SkuDescription { - /// - /// Initializes a new instance of the SkuDescription class. - /// + /// Initializes a new instance of SkuDescription. public SkuDescription() { - CustomInit(); + Locations = new ChangeTrackingList(); + Capabilities = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the SkuDescription class. - /// - /// Name of the resource SKU. - /// Service tier of the resource SKU. - /// Size specifier of the resource SKU. - /// Family code of the resource SKU. - /// Current number of instances assigned to the - /// resource. - /// Min, max, and default scale values of the - /// SKU. - /// Locations of the SKU. - /// Capabilities of the SKU, e.g., is - /// traffic manager enabled? - public SkuDescription(string name = default(string), string tier = default(string), string size = default(string), string family = default(string), int? capacity = default(int?), SkuCapacity skuCapacity = default(SkuCapacity), IList locations = default(IList), IList capabilities = default(IList)) + /// Initializes a new instance of SkuDescription. + /// Name of the resource SKU. + /// Service tier of the resource SKU. + /// Size specifier of the resource SKU. + /// Family code of the resource SKU. + /// Current number of instances assigned to the resource. + /// Min, max, and default scale values of the SKU. + /// Locations of the SKU. + /// Capabilities of the SKU, e.g., is traffic manager enabled?. + internal SkuDescription(string name, string tier, string size, string family, int? capacity, SkuCapacity skuCapacity, IList locations, IList capabilities) { Name = name; Tier = tier; @@ -52,62 +39,23 @@ public SkuDescription() SkuCapacity = skuCapacity; Locations = locations; Capabilities = capabilities; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the resource SKU. - /// - [JsonProperty(PropertyName = "name")] + /// Name of the resource SKU. public string Name { get; set; } - - /// - /// Gets or sets service tier of the resource SKU. - /// - [JsonProperty(PropertyName = "tier")] + /// Service tier of the resource SKU. public string Tier { get; set; } - - /// - /// Gets or sets size specifier of the resource SKU. - /// - [JsonProperty(PropertyName = "size")] + /// Size specifier of the resource SKU. public string Size { get; set; } - - /// - /// Gets or sets family code of the resource SKU. - /// - [JsonProperty(PropertyName = "family")] + /// Family code of the resource SKU. public string Family { get; set; } - - /// - /// Gets or sets current number of instances assigned to the resource. - /// - [JsonProperty(PropertyName = "capacity")] + /// Current number of instances assigned to the resource. public int? Capacity { get; set; } - - /// - /// Gets or sets min, max, and default scale values of the SKU. - /// - [JsonProperty(PropertyName = "skuCapacity")] + /// Min, max, and default scale values of the SKU. public SkuCapacity SkuCapacity { get; set; } - - /// - /// Gets or sets locations of the SKU. - /// - [JsonProperty(PropertyName = "locations")] - public IList Locations { get; set; } - - /// - /// Gets or sets capabilities of the SKU, e.g., is traffic manager - /// enabled? - /// - [JsonProperty(PropertyName = "capabilities")] - public IList Capabilities { get; set; } - + /// Locations of the SKU. + public IList Locations { get; } + /// Capabilities of the SKU, e.g., is traffic manager enabled?. + public IList Capabilities { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.Serialization.cs new file mode 100644 index 000000000000..f46e966c4425 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SkuInfo + { + internal static SkuInfo DeserializeSkuInfo(JsonElement element) + { + Optional resourceType = default; + Optional sku = default; + Optional capacity = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType")) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("sku")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + sku = SkuDescription.DeserializeSkuDescription(property.Value); + continue; + } + if (property.NameEquals("capacity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + capacity = SkuCapacity.DeserializeSkuCapacity(property.Value); + continue; + } + } + return new SkuInfo(resourceType.Value, sku.Value, capacity.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.cs index 1b9dd76cabad..c984169bc7ce 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.cs @@ -1,69 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// SKU discovery information. - /// + /// SKU discovery information. public partial class SkuInfo { - /// - /// Initializes a new instance of the SkuInfo class. - /// - public SkuInfo() + /// Initializes a new instance of SkuInfo. + internal SkuInfo() { - CustomInit(); } - /// - /// Initializes a new instance of the SkuInfo class. - /// - /// Resource type that this SKU applies - /// to. - /// Name and tier of the SKU. - /// Min, max, and default scale values of the - /// SKU. - public SkuInfo(string resourceType = default(string), SkuDescription sku = default(SkuDescription), SkuCapacity capacity = default(SkuCapacity)) + /// Initializes a new instance of SkuInfo. + /// Resource type that this SKU applies to. + /// Name and tier of the SKU. + /// Min, max, and default scale values of the SKU. + internal SkuInfo(string resourceType, SkuDescription sku, SkuCapacity capacity) { ResourceType = resourceType; Sku = sku; Capacity = capacity; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource type that this SKU applies to. - /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; set; } - - /// - /// Gets or sets name and tier of the SKU. - /// - [JsonProperty(PropertyName = "sku")] - public SkuDescription Sku { get; set; } - - /// - /// Gets or sets min, max, and default scale values of the SKU. - /// - [JsonProperty(PropertyName = "capacity")] - public SkuCapacity Capacity { get; set; } - + /// Resource type that this SKU applies to. + public string ResourceType { get; } + /// Name and tier of the SKU. + public SkuDescription Sku { get; } + /// Min, max, and default scale values of the SKU. + public SkuCapacity Capacity { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.Serialization.cs new file mode 100644 index 000000000000..1bc3b620ae25 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class SkuInfoCollection + { + internal static SkuInfoCollection DeserializeSkuInfoCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SkuInfo.DeserializeSkuInfo(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new SkuInfoCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.cs new file mode 100644 index 000000000000..1a8fce00a241 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of SKU information. + internal partial class SkuInfoCollection + { + /// Initializes a new instance of SkuInfoCollection. + /// Collection of resources. + /// is null. + internal SkuInfoCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of SkuInfoCollection. + /// Collection of resources. + /// Link to next page of resources. + internal SkuInfoCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.Serialization.cs new file mode 100644 index 000000000000..29616d7d3a42 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SkuInfos + { + internal static SkuInfos DeserializeSkuInfos(JsonElement element) + { + Optional resourceType = default; + Optional> skus = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType")) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("skus")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GlobalCsmSkuDescription.DeserializeGlobalCsmSkuDescription(item)); + } + skus = array; + continue; + } + } + return new SkuInfos(resourceType.Value, Optional.ToList(skus)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.cs index 43c105bcf20b..9bdb8674e441 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.cs @@ -1,63 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Collection of SKU information. - /// + /// Collection of SKU information. public partial class SkuInfos { - /// - /// Initializes a new instance of the SkuInfos class. - /// - public SkuInfos() + /// Initializes a new instance of SkuInfos. + internal SkuInfos() { - CustomInit(); + Skus = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the SkuInfos class. - /// - /// Resource type that this SKU applies - /// to. - /// List of SKUs the subscription is able to - /// use. - public SkuInfos(string resourceType = default(string), IList skus = default(IList)) + /// Initializes a new instance of SkuInfos. + /// Resource type that this SKU applies to. + /// List of SKUs the subscription is able to use. + internal SkuInfos(string resourceType, IReadOnlyList skus) { ResourceType = resourceType; Skus = skus; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource type that this SKU applies to. - /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; set; } - - /// - /// Gets or sets list of SKUs the subscription is able to use. - /// - [JsonProperty(PropertyName = "skus")] - public IList Skus { get; set; } - + /// Resource type that this SKU applies to. + public string ResourceType { get; } + /// List of SKUs the subscription is able to use. + public IReadOnlyList Skus { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs index a990199a9a26..4afa83336033 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs @@ -1,30 +1,84 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for SkuName. - /// - public static class SkuName + /// The SkuName. + public readonly partial struct SkuName : IEquatable { - public const string Free = "Free"; - public const string Shared = "Shared"; - public const string Basic = "Basic"; - public const string Standard = "Standard"; - public const string Premium = "Premium"; - public const string Dynamic = "Dynamic"; - public const string Isolated = "Isolated"; - public const string PremiumV2 = "PremiumV2"; - public const string ElasticPremium = "ElasticPremium"; - public const string ElasticIsolated = "ElasticIsolated"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public SkuName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FreeValue = "Free"; + private const string SharedValue = "Shared"; + private const string BasicValue = "Basic"; + private const string StandardValue = "Standard"; + private const string PremiumValue = "Premium"; + private const string DynamicValue = "Dynamic"; + private const string IsolatedValue = "Isolated"; + private const string IsolatedV2Value = "IsolatedV2"; + private const string PremiumV2Value = "PremiumV2"; + private const string PremiumV3Value = "PremiumV3"; + private const string PremiumContainerValue = "PremiumContainer"; + private const string ElasticPremiumValue = "ElasticPremium"; + private const string ElasticIsolatedValue = "ElasticIsolated"; + + /// Free. + public static SkuName Free { get; } = new SkuName(FreeValue); + /// Shared. + public static SkuName Shared { get; } = new SkuName(SharedValue); + /// Basic. + public static SkuName Basic { get; } = new SkuName(BasicValue); + /// Standard. + public static SkuName Standard { get; } = new SkuName(StandardValue); + /// Premium. + public static SkuName Premium { get; } = new SkuName(PremiumValue); + /// Dynamic. + public static SkuName Dynamic { get; } = new SkuName(DynamicValue); + /// Isolated. + public static SkuName Isolated { get; } = new SkuName(IsolatedValue); + /// IsolatedV2. + public static SkuName IsolatedV2 { get; } = new SkuName(IsolatedV2Value); + /// PremiumV2. + public static SkuName PremiumV2 { get; } = new SkuName(PremiumV2Value); + /// PremiumV3. + public static SkuName PremiumV3 { get; } = new SkuName(PremiumV3Value); + /// PremiumContainer. + public static SkuName PremiumContainer { get; } = new SkuName(PremiumContainerValue); + /// ElasticPremium. + public static SkuName ElasticPremium { get; } = new SkuName(ElasticPremiumValue); + /// ElasticIsolated. + public static SkuName ElasticIsolated { get; } = new SkuName(ElasticIsolatedValue); + /// Determines if two values are the same. + public static bool operator ==(SkuName left, SkuName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SkuName left, SkuName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SkuName(string value) => new SkuName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SkuName other && Equals(other); + /// + public bool Equals(SkuName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.Serialization.cs new file mode 100644 index 000000000000..cfcac0489bca --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SlotConfigNamesResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(ConnectionStringNames)) + { + writer.WritePropertyName("connectionStringNames"); + writer.WriteStartArray(); + foreach (var item in ConnectionStringNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AppSettingNames)) + { + writer.WritePropertyName("appSettingNames"); + writer.WriteStartArray(); + foreach (var item in AppSettingNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AzureStorageConfigNames)) + { + writer.WritePropertyName("azureStorageConfigNames"); + writer.WriteStartArray(); + foreach (var item in AzureStorageConfigNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SlotConfigNamesResource DeserializeSlotConfigNamesResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional> connectionStringNames = default; + Optional> appSettingNames = default; + Optional> azureStorageConfigNames = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("connectionStringNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + connectionStringNames = array; + continue; + } + if (property0.NameEquals("appSettingNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + appSettingNames = array; + continue; + } + if (property0.NameEquals("azureStorageConfigNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + azureStorageConfigNames = array; + continue; + } + } + continue; + } + } + return new SlotConfigNamesResource(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(connectionStringNames), Optional.ToList(appSettingNames), Optional.ToList(azureStorageConfigNames)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.cs index a994ab81d947..a4b623e35b63 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.cs @@ -1,80 +1,46 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Slot Config names azure resource. - /// - [Rest.Serialization.JsonTransformation] + /// Slot Config names azure resource. public partial class SlotConfigNamesResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the SlotConfigNamesResource class. - /// + /// Initializes a new instance of SlotConfigNamesResource. public SlotConfigNamesResource() { - CustomInit(); + ConnectionStringNames = new ChangeTrackingList(); + AppSettingNames = new ChangeTrackingList(); + AzureStorageConfigNames = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the SlotConfigNamesResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// List of connection string - /// names. - /// List of application settings - /// names. - /// List of external Azure - /// storage account identifiers. - public SlotConfigNamesResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList connectionStringNames = default(IList), IList appSettingNames = default(IList), IList azureStorageConfigNames = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of SlotConfigNamesResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// List of connection string names. + /// List of application settings names. + /// List of external Azure storage account identifiers. + internal SlotConfigNamesResource(string id, string name, string kind, string type, IList connectionStringNames, IList appSettingNames, IList azureStorageConfigNames) : base(id, name, kind, type) { ConnectionStringNames = connectionStringNames; AppSettingNames = appSettingNames; AzureStorageConfigNames = azureStorageConfigNames; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of connection string names. - /// - [JsonProperty(PropertyName = "properties.connectionStringNames")] - public IList ConnectionStringNames { get; set; } - - /// - /// Gets or sets list of application settings names. - /// - [JsonProperty(PropertyName = "properties.appSettingNames")] - public IList AppSettingNames { get; set; } - - /// - /// Gets or sets list of external Azure storage account identifiers. - /// - [JsonProperty(PropertyName = "properties.azureStorageConfigNames")] - public IList AzureStorageConfigNames { get; set; } - + /// List of connection string names. + public IList ConnectionStringNames { get; } + /// List of application settings names. + public IList AppSettingNames { get; } + /// List of external Azure storage account identifiers. + public IList AzureStorageConfigNames { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.Serialization.cs new file mode 100644 index 000000000000..9df9aa2732d9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.Serialization.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SlotDifference : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SlotDifference DeserializeSlotDifference(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional level = default; + Optional settingType = default; + Optional diffRule = default; + Optional settingName = default; + Optional valueInCurrentSlot = default; + Optional valueInTargetSlot = default; + Optional description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("level")) + { + level = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("settingType")) + { + settingType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("diffRule")) + { + diffRule = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("settingName")) + { + settingName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("valueInCurrentSlot")) + { + valueInCurrentSlot = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("valueInTargetSlot")) + { + valueInTargetSlot = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("description")) + { + description = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new SlotDifference(id.Value, name.Value, kind.Value, type.Value, level.Value, settingType.Value, diffRule.Value, settingName.Value, valueInCurrentSlot.Value, valueInTargetSlot.Value, description.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.cs index 247330959681..5bd375245270 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.cs @@ -1,56 +1,33 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A setting difference between two deployment slots of an app. - /// - [Rest.Serialization.JsonTransformation] + /// A setting difference between two deployment slots of an app. public partial class SlotDifference : ProxyOnlyResource { - /// - /// Initializes a new instance of the SlotDifference class. - /// + /// Initializes a new instance of SlotDifference. public SlotDifference() { - CustomInit(); } - /// - /// Initializes a new instance of the SlotDifference class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Level of the difference: Information, Warning - /// or Error. - /// The type of the setting: General, - /// AppSetting or ConnectionString. - /// Rule that describes how to process the - /// setting difference during a slot swap. - /// Name of the setting. - /// Value of the setting in the - /// current slot. - /// Value of the setting in the target - /// slot. - /// Description of the setting - /// difference. - public SlotDifference(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string level = default(string), string settingType = default(string), string diffRule = default(string), string settingName = default(string), string valueInCurrentSlot = default(string), string valueInTargetSlot = default(string), string description = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of SlotDifference. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Level of the difference: Information, Warning or Error. + /// The type of the setting: General, AppSetting or ConnectionString. + /// Rule that describes how to process the setting difference during a slot swap. + /// Name of the setting. + /// Value of the setting in the current slot. + /// Value of the setting in the target slot. + /// Description of the setting difference. + internal SlotDifference(string id, string name, string kind, string type, string level, string settingType, string diffRule, string settingName, string valueInCurrentSlot, string valueInTargetSlot, string description) : base(id, name, kind, type) { Level = level; SettingType = settingType; @@ -59,57 +36,21 @@ public SlotDifference() ValueInCurrentSlot = valueInCurrentSlot; ValueInTargetSlot = valueInTargetSlot; Description = description; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets level of the difference: Information, Warning or Error. - /// - [JsonProperty(PropertyName = "properties.level")] - public string Level { get; private set; } - - /// - /// Gets the type of the setting: General, AppSetting or - /// ConnectionString. - /// - [JsonProperty(PropertyName = "properties.settingType")] - public string SettingType { get; private set; } - - /// - /// Gets rule that describes how to process the setting difference - /// during a slot swap. - /// - [JsonProperty(PropertyName = "properties.diffRule")] - public string DiffRule { get; private set; } - - /// - /// Gets name of the setting. - /// - [JsonProperty(PropertyName = "properties.settingName")] - public string SettingName { get; private set; } - - /// - /// Gets value of the setting in the current slot. - /// - [JsonProperty(PropertyName = "properties.valueInCurrentSlot")] - public string ValueInCurrentSlot { get; private set; } - - /// - /// Gets value of the setting in the target slot. - /// - [JsonProperty(PropertyName = "properties.valueInTargetSlot")] - public string ValueInTargetSlot { get; private set; } - - /// - /// Gets description of the setting difference. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } - + /// Level of the difference: Information, Warning or Error. + public string Level { get; } + /// The type of the setting: General, AppSetting or ConnectionString. + public string SettingType { get; } + /// Rule that describes how to process the setting difference during a slot swap. + public string DiffRule { get; } + /// Name of the setting. + public string SettingName { get; } + /// Value of the setting in the current slot. + public string ValueInCurrentSlot { get; } + /// Value of the setting in the target slot. + public string ValueInTargetSlot { get; } + /// Description of the setting difference. + public string Description { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.Serialization.cs new file mode 100644 index 000000000000..943480d12041 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class SlotDifferenceCollection + { + internal static SlotDifferenceCollection DeserializeSlotDifferenceCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SlotDifference.DeserializeSlotDifference(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new SlotDifferenceCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.cs new file mode 100644 index 000000000000..eacd40a9cf33 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of slot differences. + internal partial class SlotDifferenceCollection + { + /// Initializes a new instance of SlotDifferenceCollection. + /// Collection of resources. + /// is null. + internal SlotDifferenceCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of SlotDifferenceCollection. + /// Collection of resources. + /// Link to next page of resources. + internal SlotDifferenceCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.Serialization.cs new file mode 100644 index 000000000000..e411892cdf6a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SlotSwapStatus + { + internal static SlotSwapStatus DeserializeSlotSwapStatus(JsonElement element) + { + Optional timestampUtc = default; + Optional sourceSlotName = default; + Optional destinationSlotName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timestampUtc")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + timestampUtc = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("sourceSlotName")) + { + sourceSlotName = property.Value.GetString(); + continue; + } + if (property.NameEquals("destinationSlotName")) + { + destinationSlotName = property.Value.GetString(); + continue; + } + } + return new SlotSwapStatus(Optional.ToNullable(timestampUtc), sourceSlotName.Value, destinationSlotName.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.cs index 10b3546ea071..caec69ea45b8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.cs @@ -1,70 +1,38 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// The status of the last successful slot swap operation. - /// + /// The status of the last successful slot swap operation. public partial class SlotSwapStatus { - /// - /// Initializes a new instance of the SlotSwapStatus class. - /// - public SlotSwapStatus() + /// Initializes a new instance of SlotSwapStatus. + internal SlotSwapStatus() { - CustomInit(); } - /// - /// Initializes a new instance of the SlotSwapStatus class. - /// - /// The time the last successful slot swap - /// completed. - /// The source slot of the last swap - /// operation. - /// The destination slot of the last - /// swap operation. - public SlotSwapStatus(System.DateTime? timestampUtc = default(System.DateTime?), string sourceSlotName = default(string), string destinationSlotName = default(string)) + /// Initializes a new instance of SlotSwapStatus. + /// The time the last successful slot swap completed. + /// The source slot of the last swap operation. + /// The destination slot of the last swap operation. + internal SlotSwapStatus(DateTimeOffset? timestampUtc, string sourceSlotName, string destinationSlotName) { TimestampUtc = timestampUtc; SourceSlotName = sourceSlotName; DestinationSlotName = destinationSlotName; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the time the last successful slot swap completed. - /// - [JsonProperty(PropertyName = "timestampUtc")] - public System.DateTime? TimestampUtc { get; private set; } - - /// - /// Gets the source slot of the last swap operation. - /// - [JsonProperty(PropertyName = "sourceSlotName")] - public string SourceSlotName { get; private set; } - - /// - /// Gets the destination slot of the last swap operation. - /// - [JsonProperty(PropertyName = "destinationSlotName")] - public string DestinationSlotName { get; private set; } - + /// The time the last successful slot swap completed. + public DateTimeOffset? TimestampUtc { get; } + /// The source slot of the last swap operation. + public string SourceSlotName { get; } + /// The destination slot of the last swap operation. + public string DestinationSlotName { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.Serialization.cs new file mode 100644 index 000000000000..6220904a34ce --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SlowRequestsBasedTrigger : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(TimeTaken)) + { + writer.WritePropertyName("timeTaken"); + writer.WriteStringValue(TimeTaken); + } + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"); + writer.WriteStringValue(Path); + } + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(TimeInterval)) + { + writer.WritePropertyName("timeInterval"); + writer.WriteStringValue(TimeInterval); + } + writer.WriteEndObject(); + } + + internal static SlowRequestsBasedTrigger DeserializeSlowRequestsBasedTrigger(JsonElement element) + { + Optional timeTaken = default; + Optional path = default; + Optional count = default; + Optional timeInterval = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timeTaken")) + { + timeTaken = property.Value.GetString(); + continue; + } + if (property.NameEquals("path")) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("count")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + count = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeInterval")) + { + timeInterval = property.Value.GetString(); + continue; + } + } + return new SlowRequestsBasedTrigger(timeTaken.Value, path.Value, Optional.ToNullable(count), timeInterval.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs index 72d2b4cc304e..b98d5268f453 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs @@ -1,67 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Trigger based on request execution time. - /// + /// Trigger based on request execution time. public partial class SlowRequestsBasedTrigger { - /// - /// Initializes a new instance of the SlowRequestsBasedTrigger class. - /// + /// Initializes a new instance of SlowRequestsBasedTrigger. public SlowRequestsBasedTrigger() { - CustomInit(); } - /// - /// Initializes a new instance of the SlowRequestsBasedTrigger class. - /// - /// Time taken. - /// Request Count. - /// Time interval. - public SlowRequestsBasedTrigger(string timeTaken = default(string), int? count = default(int?), string timeInterval = default(string)) + /// Initializes a new instance of SlowRequestsBasedTrigger. + /// Time taken. + /// Request Path. + /// Request Count. + /// Time interval. + internal SlowRequestsBasedTrigger(string timeTaken, string path, int? count, string timeInterval) { TimeTaken = timeTaken; + Path = path; Count = count; TimeInterval = timeInterval; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets time taken. - /// - [JsonProperty(PropertyName = "timeTaken")] + /// Time taken. public string TimeTaken { get; set; } - - /// - /// Gets or sets request Count. - /// - [JsonProperty(PropertyName = "count")] + /// Request Path. + public string Path { get; set; } + /// Request Count. public int? Count { get; set; } - - /// - /// Gets or sets time interval. - /// - [JsonProperty(PropertyName = "timeInterval")] + /// Time interval. public string TimeInterval { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.Serialization.cs new file mode 100644 index 000000000000..59f632daa9d4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.Serialization.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Snapshot : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Snapshot DeserializeSnapshot(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional time = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("time")) + { + time = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new Snapshot(id.Value, name.Value, kind.Value, type.Value, time.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.cs index c0bb80c070d2..5303d58447d1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A snapshot of an app. - /// - [Rest.Serialization.JsonTransformation] + /// A snapshot of an app. public partial class Snapshot : ProxyOnlyResource { - /// - /// Initializes a new instance of the Snapshot class. - /// + /// Initializes a new instance of Snapshot. public Snapshot() { - CustomInit(); } - /// - /// Initializes a new instance of the Snapshot class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The time the snapshot was taken. - public Snapshot(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string time = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of Snapshot. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The time the snapshot was taken. + internal Snapshot(string id, string name, string kind, string type, string time) : base(id, name, kind, type) { Time = time; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the time the snapshot was taken. - /// - [JsonProperty(PropertyName = "properties.time")] - public string Time { get; private set; } - + /// The time the snapshot was taken. + public string Time { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.Serialization.cs new file mode 100644 index 000000000000..930e6deddc72 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class SnapshotCollection + { + internal static SnapshotCollection DeserializeSnapshotCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Snapshot.DeserializeSnapshot(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new SnapshotCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.cs new file mode 100644 index 000000000000..1985c2637314 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of snapshots which can be used to revert an app to a previous time. + internal partial class SnapshotCollection + { + /// Initializes a new instance of SnapshotCollection. + /// Collection of resources. + /// is null. + internal SnapshotCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of SnapshotCollection. + /// Collection of resources. + /// Link to next page of resources. + internal SnapshotCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.Serialization.cs new file mode 100644 index 000000000000..b74969d75f9f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SnapshotRecoverySource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + } + writer.WriteEndObject(); + } + + internal static SnapshotRecoverySource DeserializeSnapshotRecoverySource(JsonElement element) + { + Optional location = default; + Optional id = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + } + return new SnapshotRecoverySource(location.Value, id.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.cs index 4353300da633..2682bfc3df6b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.cs @@ -1,69 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Specifies the web app that snapshot contents will be retrieved from. - /// + /// Specifies the web app that snapshot contents will be retrieved from. public partial class SnapshotRecoverySource { - /// - /// Initializes a new instance of the SnapshotRecoverySource class. - /// + /// Initializes a new instance of SnapshotRecoverySource. public SnapshotRecoverySource() { - CustomInit(); } - /// - /// Initializes a new instance of the SnapshotRecoverySource class. - /// - /// Geographical location of the source web app, - /// e.g. SouthEastAsia, SouthCentralUS - /// ARM resource ID of the source app. - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} - /// for production slots and - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} - /// for other slots. - public SnapshotRecoverySource(string location = default(string), string id = default(string)) + /// Initializes a new instance of SnapshotRecoverySource. + /// Geographical location of the source web app, e.g. SouthEastAsia, SouthCentralUS. + /// + /// ARM resource ID of the source app. + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. + /// + internal SnapshotRecoverySource(string location, string id) { Location = location; Id = id; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets geographical location of the source web app, e.g. - /// SouthEastAsia, SouthCentralUS - /// - [JsonProperty(PropertyName = "location")] + /// Geographical location of the source web app, e.g. SouthEastAsia, SouthCentralUS. public string Location { get; set; } - /// - /// Gets or sets ARM resource ID of the source app. - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} - /// for production slots and - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} - /// for other slots. + /// ARM resource ID of the source app. + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. /// - [JsonProperty(PropertyName = "id")] public string Id { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.Serialization.cs new file mode 100644 index 000000000000..ac224f0d936d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SnapshotRestoreRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(SnapshotTime)) + { + writer.WritePropertyName("snapshotTime"); + writer.WriteStringValue(SnapshotTime); + } + if (Optional.IsDefined(RecoverySource)) + { + writer.WritePropertyName("recoverySource"); + writer.WriteObjectValue(RecoverySource); + } + if (Optional.IsDefined(Overwrite)) + { + writer.WritePropertyName("overwrite"); + writer.WriteBooleanValue(Overwrite.Value); + } + if (Optional.IsDefined(RecoverConfiguration)) + { + writer.WritePropertyName("recoverConfiguration"); + writer.WriteBooleanValue(RecoverConfiguration.Value); + } + if (Optional.IsDefined(IgnoreConflictingHostNames)) + { + writer.WritePropertyName("ignoreConflictingHostNames"); + writer.WriteBooleanValue(IgnoreConflictingHostNames.Value); + } + if (Optional.IsDefined(UseDRSecondary)) + { + writer.WritePropertyName("useDRSecondary"); + writer.WriteBooleanValue(UseDRSecondary.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SnapshotRestoreRequest DeserializeSnapshotRestoreRequest(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional snapshotTime = default; + Optional recoverySource = default; + Optional overwrite = default; + Optional recoverConfiguration = default; + Optional ignoreConflictingHostNames = default; + Optional useDRSecondary = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("snapshotTime")) + { + snapshotTime = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("recoverySource")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + recoverySource = SnapshotRecoverySource.DeserializeSnapshotRecoverySource(property0.Value); + continue; + } + if (property0.NameEquals("overwrite")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + overwrite = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("recoverConfiguration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + recoverConfiguration = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("ignoreConflictingHostNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + ignoreConflictingHostNames = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("useDRSecondary")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + useDRSecondary = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new SnapshotRestoreRequest(id.Value, name.Value, kind.Value, type.Value, snapshotTime.Value, recoverySource.Value, Optional.ToNullable(overwrite), Optional.ToNullable(recoverConfiguration), Optional.ToNullable(ignoreConflictingHostNames), Optional.ToNullable(useDRSecondary)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.cs index 2b4e6097d617..b235ae042677 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.cs @@ -1,59 +1,38 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Details about app recovery operation. - /// - [Rest.Serialization.JsonTransformation] + /// Details about app recovery operation. public partial class SnapshotRestoreRequest : ProxyOnlyResource { - /// - /// Initializes a new instance of the SnapshotRestoreRequest class. - /// + /// Initializes a new instance of SnapshotRestoreRequest. public SnapshotRestoreRequest() { - CustomInit(); } - /// - /// Initializes a new instance of the SnapshotRestoreRequest class. - /// - /// If <code>true</code> the - /// restore operation can overwrite source app; otherwise, - /// <code>false</code>. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Point in time in which the app restore - /// should be done, formatted as a DateTime string. - /// Optional. Specifies the web app that - /// snapshot contents will be retrieved from. - /// If empty, the targeted web app will be used as the source. - /// If true, site configuration, in - /// addition to content, will be reverted. - /// If true, custom hostname - /// conflicts will be ignored when recovering to a target web app. - /// This setting is only necessary when RecoverConfiguration is - /// enabled. - /// If true, the snapshot is retrieved - /// from DRSecondary endpoint. - public SnapshotRestoreRequest(bool overwrite, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string snapshotTime = default(string), SnapshotRecoverySource recoverySource = default(SnapshotRecoverySource), bool? recoverConfiguration = default(bool?), bool? ignoreConflictingHostNames = default(bool?), bool? useDRSecondary = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of SnapshotRestoreRequest. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Point in time in which the app restore should be done, formatted as a DateTime string. + /// + /// Optional. Specifies the web app that snapshot contents will be retrieved from. + /// If empty, the targeted web app will be used as the source. + /// + /// If <code>true</code> the restore operation can overwrite source app; otherwise, <code>false</code>. + /// If true, site configuration, in addition to content, will be reverted. + /// + /// If true, custom hostname conflicts will be ignored when recovering to a target web app. + /// This setting is only necessary when RecoverConfiguration is enabled. + /// + /// If true, the snapshot is retrieved from DRSecondary endpoint. + internal SnapshotRestoreRequest(string id, string name, string kind, string type, string snapshotTime, SnapshotRecoverySource recoverySource, bool? overwrite, bool? recoverConfiguration, bool? ignoreConflictingHostNames, bool? useDRSecondary) : base(id, name, kind, type) { SnapshotTime = snapshotTime; RecoverySource = recoverySource; @@ -61,68 +40,25 @@ public SnapshotRestoreRequest() RecoverConfiguration = recoverConfiguration; IgnoreConflictingHostNames = ignoreConflictingHostNames; UseDRSecondary = useDRSecondary; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets point in time in which the app restore should be done, - /// formatted as a DateTime string. - /// - [JsonProperty(PropertyName = "properties.snapshotTime")] + /// Point in time in which the app restore should be done, formatted as a DateTime string. public string SnapshotTime { get; set; } - /// - /// Gets or sets optional. Specifies the web app that snapshot contents - /// will be retrieved from. + /// Optional. Specifies the web app that snapshot contents will be retrieved from. /// If empty, the targeted web app will be used as the source. /// - [JsonProperty(PropertyName = "properties.recoverySource")] public SnapshotRecoverySource RecoverySource { get; set; } - - /// - /// Gets or sets if &lt;code&gt;true&lt;/code&gt; the - /// restore operation can overwrite source app; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.overwrite")] - public bool Overwrite { get; set; } - - /// - /// Gets or sets if true, site configuration, in addition to content, - /// will be reverted. - /// - [JsonProperty(PropertyName = "properties.recoverConfiguration")] + /// If <code>true</code> the restore operation can overwrite source app; otherwise, <code>false</code>. + public bool? Overwrite { get; set; } + /// If true, site configuration, in addition to content, will be reverted. public bool? RecoverConfiguration { get; set; } - /// - /// Gets or sets if true, custom hostname conflicts will be ignored - /// when recovering to a target web app. - /// This setting is only necessary when RecoverConfiguration is - /// enabled. + /// If true, custom hostname conflicts will be ignored when recovering to a target web app. + /// This setting is only necessary when RecoverConfiguration is enabled. /// - [JsonProperty(PropertyName = "properties.ignoreConflictingHostNames")] public bool? IgnoreConflictingHostNames { get; set; } - - /// - /// Gets or sets if true, the snapshot is retrieved from DRSecondary - /// endpoint. - /// - [JsonProperty(PropertyName = "properties.useDRSecondary")] + /// If true, the snapshot is retrieved from DRSecondary endpoint. public bool? UseDRSecondary { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.Serialization.cs new file mode 100644 index 000000000000..872056b87f6b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Solution : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"); + writer.WriteNumberValue(Id.Value); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Order)) + { + writer.WritePropertyName("order"); + writer.WriteNumberValue(Order.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(Data)) + { + writer.WritePropertyName("data"); + writer.WriteStartArray(); + foreach (var item in Data) + { + writer.WriteStartArray(); + foreach (var item0 in item) + { + writer.WriteObjectValue(item0); + } + writer.WriteEndArray(); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteStartArray(); + foreach (var item0 in item) + { + writer.WriteObjectValue(item0); + } + writer.WriteEndArray(); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static Solution DeserializeSolution(JsonElement element) + { + Optional id = default; + Optional displayName = default; + Optional order = default; + Optional description = default; + Optional type = default; + Optional>> data = default; + Optional>> metadata = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + id = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("order")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + order = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + type = property.Value.GetString().ToSolutionType(); + continue; + } + if (property.NameEquals("data")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List> array = new List>(); + foreach (var item in property.Value.EnumerateArray()) + { + List array0 = new List(); + foreach (var item0 in item.EnumerateArray()) + { + array0.Add(NameValuePair.DeserializeNameValuePair(item0)); + } + array.Add(array0); + } + data = array; + continue; + } + if (property.NameEquals("metadata")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List> array = new List>(); + foreach (var item in property.Value.EnumerateArray()) + { + List array0 = new List(); + foreach (var item0 in item.EnumerateArray()) + { + array0.Add(NameValuePair.DeserializeNameValuePair(item0)); + } + array.Add(array0); + } + metadata = array; + continue; + } + } + return new Solution(Optional.ToNullable(id), displayName.Value, Optional.ToNullable(order), description.Value, Optional.ToNullable(type), Optional.ToList(data), Optional.ToList(metadata)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.cs index 99a1b4a7070c..c3a7a3fb9b8f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.cs @@ -1,45 +1,34 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Class Representing Solution for problems detected. - /// + /// Class Representing Solution for problems detected. public partial class Solution { - /// - /// Initializes a new instance of the Solution class. - /// + /// Initializes a new instance of Solution. public Solution() { - CustomInit(); + Data = new ChangeTrackingList>(); + Metadata = new ChangeTrackingList>(); } - /// - /// Initializes a new instance of the Solution class. - /// - /// Solution Id. - /// Display Name of the solution - /// Order of the solution. - /// Description of the solution - /// Type of Solution. Possible values include: - /// 'QuickSolution', 'DeepInvestigation', 'BestPractices' - /// Solution Data. - /// Solution Metadata. - public Solution(double? id = default(double?), string displayName = default(string), double? order = default(double?), string description = default(string), SolutionType? type = default(SolutionType?), IList> data = default(IList>), IList> metadata = default(IList>)) + /// Initializes a new instance of Solution. + /// Solution Id. + /// Display Name of the solution. + /// Order of the solution. + /// Description of the solution. + /// Type of Solution. + /// Solution Data. + /// Solution Metadata. + internal Solution(double? id, string displayName, double? order, string description, SolutionType? type, IList> data, IList> metadata) { Id = id; DisplayName = displayName; @@ -48,56 +37,21 @@ public Solution() Type = type; Data = data; Metadata = metadata; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets solution Id. - /// - [JsonProperty(PropertyName = "id")] + /// Solution Id. public double? Id { get; set; } - - /// - /// Gets or sets display Name of the solution - /// - [JsonProperty(PropertyName = "displayName")] + /// Display Name of the solution. public string DisplayName { get; set; } - - /// - /// Gets or sets order of the solution. - /// - [JsonProperty(PropertyName = "order")] + /// Order of the solution. public double? Order { get; set; } - - /// - /// Gets or sets description of the solution - /// - [JsonProperty(PropertyName = "description")] + /// Description of the solution. public string Description { get; set; } - - /// - /// Gets or sets type of Solution. Possible values include: - /// 'QuickSolution', 'DeepInvestigation', 'BestPractices' - /// - [JsonProperty(PropertyName = "type")] + /// Type of Solution. public SolutionType? Type { get; set; } - - /// - /// Gets or sets solution Data. - /// - [JsonProperty(PropertyName = "data")] - public IList> Data { get; set; } - - /// - /// Gets or sets solution Metadata. - /// - [JsonProperty(PropertyName = "metadata")] - public IList> Metadata { get; set; } - + /// Solution Data. + public IList> Data { get; } + /// Solution Metadata. + public IList> Metadata { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.Serialization.cs new file mode 100644 index 000000000000..ec51ffa199d6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class SolutionTypeExtensions + { + public static string ToSerialString(this SolutionType value) => value switch + { + SolutionType.QuickSolution => "QuickSolution", + SolutionType.DeepInvestigation => "DeepInvestigation", + SolutionType.BestPractices => "BestPractices", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SolutionType value.") + }; + + public static SolutionType ToSolutionType(this string value) + { + if (string.Equals(value, "QuickSolution", StringComparison.InvariantCultureIgnoreCase)) return SolutionType.QuickSolution; + if (string.Equals(value, "DeepInvestigation", StringComparison.InvariantCultureIgnoreCase)) return SolutionType.DeepInvestigation; + if (string.Equals(value, "BestPractices", StringComparison.InvariantCultureIgnoreCase)) return SolutionType.BestPractices; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SolutionType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.cs index 9ea01159dd10..72941290e7fb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for SolutionType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Type of Solution. public enum SolutionType { - [EnumMember(Value = "QuickSolution")] + /// QuickSolution. QuickSolution, - [EnumMember(Value = "DeepInvestigation")] + /// DeepInvestigation. DeepInvestigation, - [EnumMember(Value = "BestPractices")] + /// BestPractices. BestPractices } - internal static class SolutionTypeEnumExtension - { - internal static string ToSerializedValue(this SolutionType? value) - { - return value == null ? null : ((SolutionType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this SolutionType value) - { - switch( value ) - { - case SolutionType.QuickSolution: - return "QuickSolution"; - case SolutionType.DeepInvestigation: - return "DeepInvestigation"; - case SolutionType.BestPractices: - return "BestPractices"; - } - return null; - } - - internal static SolutionType? ParseSolutionType(this string value) - { - switch( value ) - { - case "QuickSolution": - return SolutionType.QuickSolution; - case "DeepInvestigation": - return SolutionType.DeepInvestigation; - case "BestPractices": - return SolutionType.BestPractices; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.Serialization.cs new file mode 100644 index 000000000000..2a132d96be0a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.Serialization.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SourceControl : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Token)) + { + writer.WritePropertyName("token"); + writer.WriteStringValue(Token); + } + if (Optional.IsDefined(TokenSecret)) + { + writer.WritePropertyName("tokenSecret"); + writer.WriteStringValue(TokenSecret); + } + if (Optional.IsDefined(RefreshToken)) + { + writer.WritePropertyName("refreshToken"); + writer.WriteStringValue(RefreshToken); + } + if (Optional.IsDefined(ExpirationTime)) + { + writer.WritePropertyName("expirationTime"); + writer.WriteStringValue(ExpirationTime.Value, "O"); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SourceControl DeserializeSourceControl(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional token = default; + Optional tokenSecret = default; + Optional refreshToken = default; + Optional expirationTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("token")) + { + token = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("tokenSecret")) + { + tokenSecret = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("refreshToken")) + { + refreshToken = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("expirationTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + expirationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + } + return new SourceControl(id.Value, name.Value, kind.Value, type.Value, token.Value, tokenSecret.Value, refreshToken.Value, Optional.ToNullable(expirationTime)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.cs index 6aed94a10774..6d9c9499b652 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.cs @@ -1,83 +1,46 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The source control OAuth token. - /// - [Rest.Serialization.JsonTransformation] + /// The source control OAuth token. public partial class SourceControl : ProxyOnlyResource { - /// - /// Initializes a new instance of the SourceControl class. - /// + /// Initializes a new instance of SourceControl. public SourceControl() { - CustomInit(); } - /// - /// Initializes a new instance of the SourceControl class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// OAuth access token. - /// OAuth access token secret. - /// OAuth refresh token. - /// OAuth token expiration. - public SourceControl(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string token = default(string), string tokenSecret = default(string), string refreshToken = default(string), System.DateTime? expirationTime = default(System.DateTime?)) - : base(id, name, kind, type) + /// Initializes a new instance of SourceControl. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// OAuth access token. + /// OAuth access token secret. + /// OAuth refresh token. + /// OAuth token expiration. + internal SourceControl(string id, string name, string kind, string type, string token, string tokenSecret, string refreshToken, DateTimeOffset? expirationTime) : base(id, name, kind, type) { Token = token; TokenSecret = tokenSecret; RefreshToken = refreshToken; ExpirationTime = expirationTime; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets oAuth access token. - /// - [JsonProperty(PropertyName = "properties.token")] + /// OAuth access token. public string Token { get; set; } - - /// - /// Gets or sets oAuth access token secret. - /// - [JsonProperty(PropertyName = "properties.tokenSecret")] + /// OAuth access token secret. public string TokenSecret { get; set; } - - /// - /// Gets or sets oAuth refresh token. - /// - [JsonProperty(PropertyName = "properties.refreshToken")] + /// OAuth refresh token. public string RefreshToken { get; set; } - - /// - /// Gets or sets oAuth token expiration. - /// - [JsonProperty(PropertyName = "properties.expirationTime")] - public System.DateTime? ExpirationTime { get; set; } - + /// OAuth token expiration. + public DateTimeOffset? ExpirationTime { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.Serialization.cs new file mode 100644 index 000000000000..bf4a6c8f05db --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class SourceControlCollection + { + internal static SourceControlCollection DeserializeSourceControlCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SourceControl.DeserializeSourceControl(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new SourceControlCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.cs new file mode 100644 index 000000000000..b22b29ed7611 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of source controls. + internal partial class SourceControlCollection + { + /// Initializes a new instance of SourceControlCollection. + /// Collection of resources. + /// is null. + internal SourceControlCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of SourceControlCollection. + /// Collection of resources. + /// Link to next page of resources. + internal SourceControlCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.Serialization.cs new file mode 100644 index 000000000000..71cf1b0b7220 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class SslStateExtensions + { + public static string ToSerialString(this SslState value) => value switch + { + SslState.Disabled => "Disabled", + SslState.SniEnabled => "SniEnabled", + SslState.IpBasedEnabled => "IpBasedEnabled", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SslState value.") + }; + + public static SslState ToSslState(this string value) + { + if (string.Equals(value, "Disabled", StringComparison.InvariantCultureIgnoreCase)) return SslState.Disabled; + if (string.Equals(value, "SniEnabled", StringComparison.InvariantCultureIgnoreCase)) return SslState.SniEnabled; + if (string.Equals(value, "IpBasedEnabled", StringComparison.InvariantCultureIgnoreCase)) return SslState.IpBasedEnabled; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SslState value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.cs index 70fae077e8e2..1a4af4ca74e3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for SslState. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// SSL type. public enum SslState { - [EnumMember(Value = "Disabled")] + /// Disabled. Disabled, - [EnumMember(Value = "SniEnabled")] + /// SniEnabled. SniEnabled, - [EnumMember(Value = "IpBasedEnabled")] + /// IpBasedEnabled. IpBasedEnabled } - internal static class SslStateEnumExtension - { - internal static string ToSerializedValue(this SslState? value) - { - return value == null ? null : ((SslState)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this SslState value) - { - switch( value ) - { - case SslState.Disabled: - return "Disabled"; - case SslState.SniEnabled: - return "SniEnabled"; - case SslState.IpBasedEnabled: - return "IpBasedEnabled"; - } - return null; - } - - internal static SslState? ParseSslState(this string value) - { - switch( value ) - { - case "Disabled": - return SslState.Disabled; - case "SniEnabled": - return SslState.SniEnabled; - case "IpBasedEnabled": - return SslState.IpBasedEnabled; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.Serialization.cs new file mode 100644 index 000000000000..211ef8f3dfd8 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StackMajorVersion : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(DisplayVersion)) + { + writer.WritePropertyName("displayVersion"); + writer.WriteStringValue(DisplayVersion); + } + if (Optional.IsDefined(RuntimeVersion)) + { + writer.WritePropertyName("runtimeVersion"); + writer.WriteStringValue(RuntimeVersion); + } + if (Optional.IsDefined(IsDefault)) + { + writer.WritePropertyName("isDefault"); + writer.WriteBooleanValue(IsDefault.Value); + } + if (Optional.IsCollectionDefined(MinorVersions)) + { + writer.WritePropertyName("minorVersions"); + writer.WriteStartArray(); + foreach (var item in MinorVersions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ApplicationInsights)) + { + writer.WritePropertyName("applicationInsights"); + writer.WriteBooleanValue(ApplicationInsights.Value); + } + if (Optional.IsDefined(IsPreview)) + { + writer.WritePropertyName("isPreview"); + writer.WriteBooleanValue(IsPreview.Value); + } + if (Optional.IsDefined(IsDeprecated)) + { + writer.WritePropertyName("isDeprecated"); + writer.WriteBooleanValue(IsDeprecated.Value); + } + if (Optional.IsDefined(IsHidden)) + { + writer.WritePropertyName("isHidden"); + writer.WriteBooleanValue(IsHidden.Value); + } + if (Optional.IsCollectionDefined(AppSettingsDictionary)) + { + writer.WritePropertyName("appSettingsDictionary"); + writer.WriteStartObject(); + foreach (var item in AppSettingsDictionary) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(SiteConfigPropertiesDictionary)) + { + writer.WritePropertyName("siteConfigPropertiesDictionary"); + writer.WriteStartObject(); + foreach (var item in SiteConfigPropertiesDictionary) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + } + + internal static StackMajorVersion DeserializeStackMajorVersion(JsonElement element) + { + Optional displayVersion = default; + Optional runtimeVersion = default; + Optional isDefault = default; + Optional> minorVersions = default; + Optional applicationInsights = default; + Optional isPreview = default; + Optional isDeprecated = default; + Optional isHidden = default; + Optional> appSettingsDictionary = default; + Optional> siteConfigPropertiesDictionary = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayVersion")) + { + displayVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("runtimeVersion")) + { + runtimeVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDefault")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isDefault = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("minorVersions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StackMinorVersion.DeserializeStackMinorVersion(item)); + } + minorVersions = array; + continue; + } + if (property.NameEquals("applicationInsights")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + applicationInsights = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isPreview")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isPreview = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isDeprecated")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isDeprecated = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isHidden")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isHidden = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("appSettingsDictionary")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetObject()); + } + appSettingsDictionary = dictionary; + continue; + } + if (property.NameEquals("siteConfigPropertiesDictionary")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetObject()); + } + siteConfigPropertiesDictionary = dictionary; + continue; + } + } + return new StackMajorVersion(displayVersion.Value, runtimeVersion.Value, Optional.ToNullable(isDefault), Optional.ToList(minorVersions), Optional.ToNullable(applicationInsights), Optional.ToNullable(isPreview), Optional.ToNullable(isDeprecated), Optional.ToNullable(isHidden), Optional.ToDictionary(appSettingsDictionary), Optional.ToDictionary(siteConfigPropertiesDictionary)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs index 4bc2716c9e59..811b2755530a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs @@ -1,57 +1,48 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Application stack major version. - /// + /// Application stack major version. public partial class StackMajorVersion { - /// - /// Initializes a new instance of the StackMajorVersion class. - /// + /// Initializes a new instance of StackMajorVersion. public StackMajorVersion() { - CustomInit(); + MinorVersions = new ChangeTrackingList(); + AppSettingsDictionary = new ChangeTrackingDictionary(); + SiteConfigPropertiesDictionary = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the StackMajorVersion class. - /// - /// Application stack major version - /// (display only). - /// Application stack major version - /// (runtime only). - /// <code>true</code> if this is - /// the default major version; otherwise, - /// <code>false</code>. - /// Minor versions associated with the - /// major version. - /// <code>true</code> if - /// this supports Application Insights; otherwise, - /// <code>false</code>. - /// <code>true</code> if this stack - /// is in Preview, otherwise <code>false</code>. - /// <code>true</code> if this - /// stack has been deprecated, otherwise - /// <code>false</code>. - /// <code>true</code> if this stack - /// should be hidden for new customers on portal, otherwise - /// <code>false</code>. - public StackMajorVersion(string displayVersion = default(string), string runtimeVersion = default(string), bool? isDefault = default(bool?), IList minorVersions = default(IList), bool? applicationInsights = default(bool?), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?)) + /// Initializes a new instance of StackMajorVersion. + /// Application stack major version (display only). + /// Application stack major version (runtime only). + /// <code>true</code> if this is the default major version; otherwise, <code>false</code>. + /// Minor versions associated with the major version. + /// <code>true</code> if this supports Application Insights; otherwise, <code>false</code>. + /// <code>true</code> if this stack is in Preview, otherwise <code>false</code>. + /// <code>true</code> if this stack has been deprecated, otherwise <code>false</code>. + /// <code>true</code> if this stack should be hidden for new customers on portal, otherwise <code>false</code>. + /// + /// <appSettings> + /// <appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" /> + /// </appSettings> + /// Example: All the function apps need AppSetting: "FUNCTIONS_WORKER_RUNTIME" to be set stack name. + /// + /// + /// <siteConfigProperties> + /// <siteConfigProperty name="Use32BitWorkerProcess" value="false" /> + /// </siteConfigProperties> + /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be set to 0. + /// + internal StackMajorVersion(string displayVersion, string runtimeVersion, bool? isDefault, IList minorVersions, bool? applicationInsights, bool? isPreview, bool? isDeprecated, bool? isHidden, IDictionary appSettingsDictionary, IDictionary siteConfigPropertiesDictionary) { DisplayVersion = displayVersion; RuntimeVersion = runtimeVersion; @@ -61,71 +52,39 @@ public StackMajorVersion() IsPreview = isPreview; IsDeprecated = isDeprecated; IsHidden = isHidden; - CustomInit(); + AppSettingsDictionary = appSettingsDictionary; + SiteConfigPropertiesDictionary = siteConfigPropertiesDictionary; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets application stack major version (display only). - /// - [JsonProperty(PropertyName = "displayVersion")] + /// Application stack major version (display only). public string DisplayVersion { get; set; } - - /// - /// Gets or sets application stack major version (runtime only). - /// - [JsonProperty(PropertyName = "runtimeVersion")] + /// Application stack major version (runtime only). public string RuntimeVersion { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this - /// is the default major version; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isDefault")] + /// <code>true</code> if this is the default major version; otherwise, <code>false</code>. public bool? IsDefault { get; set; } - - /// - /// Gets or sets minor versions associated with the major version. - /// - [JsonProperty(PropertyName = "minorVersions")] - public IList MinorVersions { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this - /// supports Application Insights; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "applicationInsights")] + /// Minor versions associated with the major version. + public IList MinorVersions { get; } + /// <code>true</code> if this supports Application Insights; otherwise, <code>false</code>. public bool? ApplicationInsights { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this - /// stack is in Preview, otherwise - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isPreview")] + /// <code>true</code> if this stack is in Preview, otherwise <code>false</code>. public bool? IsPreview { get; set; } - + /// <code>true</code> if this stack has been deprecated, otherwise <code>false</code>. + public bool? IsDeprecated { get; set; } + /// <code>true</code> if this stack should be hidden for new customers on portal, otherwise <code>false</code>. + public bool? IsHidden { get; set; } /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this - /// stack has been deprecated, otherwise - /// &lt;code&gt;false&lt;/code&gt;. + /// <appSettings> + /// <appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" /> + /// </appSettings> + /// Example: All the function apps need AppSetting: "FUNCTIONS_WORKER_RUNTIME" to be set stack name. /// - [JsonProperty(PropertyName = "isDeprecated")] - public bool? IsDeprecated { get; set; } - + public IDictionary AppSettingsDictionary { get; } /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this - /// stack should be hidden for new customers on portal, otherwise - /// &lt;code&gt;false&lt;/code&gt;. + /// <siteConfigProperties> + /// <siteConfigProperty name="Use32BitWorkerProcess" value="false" /> + /// </siteConfigProperties> + /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be set to 0. /// - [JsonProperty(PropertyName = "isHidden")] - public bool? IsHidden { get; set; } - + public IDictionary SiteConfigPropertiesDictionary { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.Serialization.cs new file mode 100644 index 000000000000..4ea6b51c615a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.Serialization.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StackMinorVersion : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(DisplayVersion)) + { + writer.WritePropertyName("displayVersion"); + writer.WriteStringValue(DisplayVersion); + } + if (Optional.IsDefined(RuntimeVersion)) + { + writer.WritePropertyName("runtimeVersion"); + writer.WriteStringValue(RuntimeVersion); + } + if (Optional.IsDefined(IsDefault)) + { + writer.WritePropertyName("isDefault"); + writer.WriteBooleanValue(IsDefault.Value); + } + if (Optional.IsDefined(IsRemoteDebuggingEnabled)) + { + writer.WritePropertyName("isRemoteDebuggingEnabled"); + writer.WriteBooleanValue(IsRemoteDebuggingEnabled.Value); + } + writer.WriteEndObject(); + } + + internal static StackMinorVersion DeserializeStackMinorVersion(JsonElement element) + { + Optional displayVersion = default; + Optional runtimeVersion = default; + Optional isDefault = default; + Optional isRemoteDebuggingEnabled = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayVersion")) + { + displayVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("runtimeVersion")) + { + runtimeVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDefault")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isDefault = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isRemoteDebuggingEnabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isRemoteDebuggingEnabled = property.Value.GetBoolean(); + continue; + } + } + return new StackMinorVersion(displayVersion.Value, runtimeVersion.Value, Optional.ToNullable(isDefault), Optional.ToNullable(isRemoteDebuggingEnabled)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.cs index a4671b857f50..15d211ff9809 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.cs @@ -1,86 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Application stack minor version. - /// + /// Application stack minor version. public partial class StackMinorVersion { - /// - /// Initializes a new instance of the StackMinorVersion class. - /// + /// Initializes a new instance of StackMinorVersion. public StackMinorVersion() { - CustomInit(); } - /// - /// Initializes a new instance of the StackMinorVersion class. - /// - /// Application stack minor version - /// (display only). - /// Application stack minor version - /// (runtime only). - /// <code>true</code> if this is - /// the default minor version; otherwise, - /// <code>false</code>. - /// <code>true</code> if - /// this supports Remote Debugging, otherwise - /// <code>false</code>. - public StackMinorVersion(string displayVersion = default(string), string runtimeVersion = default(string), bool? isDefault = default(bool?), bool? isRemoteDebuggingEnabled = default(bool?)) + /// Initializes a new instance of StackMinorVersion. + /// Application stack minor version (display only). + /// Application stack minor version (runtime only). + /// <code>true</code> if this is the default minor version; otherwise, <code>false</code>. + /// <code>true</code> if this supports Remote Debugging, otherwise <code>false</code>. + internal StackMinorVersion(string displayVersion, string runtimeVersion, bool? isDefault, bool? isRemoteDebuggingEnabled) { DisplayVersion = displayVersion; RuntimeVersion = runtimeVersion; IsDefault = isDefault; IsRemoteDebuggingEnabled = isRemoteDebuggingEnabled; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets application stack minor version (display only). - /// - [JsonProperty(PropertyName = "displayVersion")] + /// Application stack minor version (display only). public string DisplayVersion { get; set; } - - /// - /// Gets or sets application stack minor version (runtime only). - /// - [JsonProperty(PropertyName = "runtimeVersion")] + /// Application stack minor version (runtime only). public string RuntimeVersion { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this - /// is the default minor version; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isDefault")] + /// <code>true</code> if this is the default minor version; otherwise, <code>false</code>. public bool? IsDefault { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this - /// supports Remote Debugging, otherwise - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isRemoteDebuggingEnabled")] + /// <code>true</code> if this supports Remote Debugging, otherwise <code>false</code>. public bool? IsRemoteDebuggingEnabled { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.Serialization.cs new file mode 100644 index 000000000000..723c7a5bc333 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class StackPreferredOsExtensions + { + public static string ToSerialString(this StackPreferredOs value) => value switch + { + StackPreferredOs.Windows => "Windows", + StackPreferredOs.Linux => "Linux", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StackPreferredOs value.") + }; + + public static StackPreferredOs ToStackPreferredOs(this string value) + { + if (string.Equals(value, "Windows", StringComparison.InvariantCultureIgnoreCase)) return StackPreferredOs.Windows; + if (string.Equals(value, "Linux", StringComparison.InvariantCultureIgnoreCase)) return StackPreferredOs.Linux; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StackPreferredOs value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs new file mode 100644 index 000000000000..725794c9304c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Function App stack preferred OS. + public enum StackPreferredOs + { + /// Windows. + Windows, + /// Linux. + Linux + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.Serialization.cs new file mode 100644 index 000000000000..f6767cfc0f1d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class StagingEnvironmentPolicyExtensions + { + public static string ToSerialString(this StagingEnvironmentPolicy value) => value switch + { + StagingEnvironmentPolicy.Enabled => "Enabled", + StagingEnvironmentPolicy.Disabled => "Disabled", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StagingEnvironmentPolicy value.") + }; + + public static StagingEnvironmentPolicy ToStagingEnvironmentPolicy(this string value) + { + if (string.Equals(value, "Enabled", StringComparison.InvariantCultureIgnoreCase)) return StagingEnvironmentPolicy.Enabled; + if (string.Equals(value, "Disabled", StringComparison.InvariantCultureIgnoreCase)) return StagingEnvironmentPolicy.Disabled; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StagingEnvironmentPolicy value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.cs new file mode 100644 index 000000000000..95be687043b6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// State indicating whether staging environments are allowed or not allowed for a static web app. + public enum StagingEnvironmentPolicy + { + /// Enabled. + Enabled, + /// Disabled. + Disabled + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.Serialization.cs new file mode 100644 index 000000000000..b79fdec480da --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StampCapacity + { + internal static StampCapacity DeserializeStampCapacity(JsonElement element) + { + Optional name = default; + Optional availableCapacity = default; + Optional totalCapacity = default; + Optional unit = default; + Optional computeMode = default; + Optional workerSize = default; + Optional workerSizeId = default; + Optional excludeFromCapacityAllocation = default; + Optional isApplicableForAllComputeModes = default; + Optional siteMode = default; + Optional isLinux = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("availableCapacity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + availableCapacity = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("totalCapacity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + totalCapacity = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("unit")) + { + unit = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeMode")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + computeMode = property.Value.GetString().ToComputeModeOptions(); + continue; + } + if (property.NameEquals("workerSize")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + workerSize = property.Value.GetString().ToWorkerSizeOptions(); + continue; + } + if (property.NameEquals("workerSizeId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + workerSizeId = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("excludeFromCapacityAllocation")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + excludeFromCapacityAllocation = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isApplicableForAllComputeModes")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isApplicableForAllComputeModes = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("siteMode")) + { + siteMode = property.Value.GetString(); + continue; + } + if (property.NameEquals("isLinux")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isLinux = property.Value.GetBoolean(); + continue; + } + } + return new StampCapacity(name.Value, Optional.ToNullable(availableCapacity), Optional.ToNullable(totalCapacity), unit.Value, Optional.ToNullable(computeMode), Optional.ToNullable(workerSize), Optional.ToNullable(workerSizeId), Optional.ToNullable(excludeFromCapacityAllocation), Optional.ToNullable(isApplicableForAllComputeModes), siteMode.Value, Optional.ToNullable(isLinux)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs index c775cdc8eb11..c81c71e766bd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs @@ -1,59 +1,41 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Stamp capacity information. - /// + /// Stamp capacity information. public partial class StampCapacity { - /// - /// Initializes a new instance of the StampCapacity class. - /// - public StampCapacity() + /// Initializes a new instance of StampCapacity. + internal StampCapacity() { - CustomInit(); } - /// - /// Initializes a new instance of the StampCapacity class. - /// - /// Name of the stamp. - /// Available capacity (# of machines, - /// bytes of storage etc...). - /// Total capacity (# of machines, bytes of - /// storage etc...). - /// Name of the unit. - /// Shared/dedicated workers. Possible values - /// include: 'Shared', 'Dedicated', 'Dynamic' - /// Size of the machines. Possible values - /// include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', - /// 'NestedSmall', 'Default' - /// Size ID of machines: + /// Initializes a new instance of StampCapacity. + /// Name of the stamp. + /// Available capacity (# of machines, bytes of storage etc...). + /// Total capacity (# of machines, bytes of storage etc...). + /// Name of the unit. + /// Shared/dedicated workers. + /// Size of the machines. + /// + /// Size ID of machines: /// 0 - Small /// 1 - Medium - /// 2 - Large - /// If - /// <code>true</code>, it includes basic apps. - /// Basic apps are not used for capacity allocation. - /// <code>true</code> - /// if capacity is applicable for all apps; otherwise, - /// <code>false</code>. - /// Shared or Dedicated. - /// Is this a linux stamp capacity - public StampCapacity(string name = default(string), long? availableCapacity = default(long?), long? totalCapacity = default(long?), string unit = default(string), ComputeModeOptions? computeMode = default(ComputeModeOptions?), WorkerSizeOptions? workerSize = default(WorkerSizeOptions?), int? workerSizeId = default(int?), bool? excludeFromCapacityAllocation = default(bool?), bool? isApplicableForAllComputeModes = default(bool?), string siteMode = default(string), bool? isLinux = default(bool?)) + /// 2 - Large. + /// + /// + /// If <code>true</code>, it includes basic apps. + /// Basic apps are not used for capacity allocation. + /// + /// <code>true</code> if capacity is applicable for all apps; otherwise, <code>false</code>. + /// Shared or Dedicated. + /// Is this a linux stamp capacity. + internal StampCapacity(string name, long? availableCapacity, long? totalCapacity, string unit, ComputeModeOptions? computeMode, WorkerSizeOptions? workerSize, int? workerSizeId, bool? excludeFromCapacityAllocation, bool? isApplicableForAllComputeModes, string siteMode, bool? isLinux) { Name = name; AvailableCapacity = availableCapacity; @@ -66,91 +48,37 @@ public StampCapacity() IsApplicableForAllComputeModes = isApplicableForAllComputeModes; SiteMode = siteMode; IsLinux = isLinux; - CustomInit(); } + /// Name of the stamp. + public string Name { get; } + /// Available capacity (# of machines, bytes of storage etc...). + public long? AvailableCapacity { get; } + /// Total capacity (# of machines, bytes of storage etc...). + public long? TotalCapacity { get; } + /// Name of the unit. + public string Unit { get; } + /// Shared/dedicated workers. + public ComputeModeOptions? ComputeMode { get; } + /// Size of the machines. + public WorkerSizeOptions? WorkerSize { get; } /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the stamp. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets available capacity (# of machines, bytes of storage - /// etc...). - /// - [JsonProperty(PropertyName = "availableCapacity")] - public long? AvailableCapacity { get; set; } - - /// - /// Gets or sets total capacity (# of machines, bytes of storage - /// etc...). - /// - [JsonProperty(PropertyName = "totalCapacity")] - public long? TotalCapacity { get; set; } - - /// - /// Gets or sets name of the unit. - /// - [JsonProperty(PropertyName = "unit")] - public string Unit { get; set; } - - /// - /// Gets or sets shared/dedicated workers. Possible values include: - /// 'Shared', 'Dedicated', 'Dynamic' - /// - [JsonProperty(PropertyName = "computeMode")] - public ComputeModeOptions? ComputeMode { get; set; } - - /// - /// Gets or sets size of the machines. Possible values include: - /// 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'NestedSmall', - /// 'Default' - /// - [JsonProperty(PropertyName = "workerSize")] - public WorkerSizeOptions? WorkerSize { get; set; } - - /// - /// Gets or sets size ID of machines: + /// Size ID of machines: /// 0 - Small /// 1 - Medium - /// 2 - Large + /// 2 - Large. /// - [JsonProperty(PropertyName = "workerSizeId")] - public int? WorkerSizeId { get; set; } - + public int? WorkerSizeId { get; } /// - /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, it - /// includes basic apps. + /// If <code>true</code>, it includes basic apps. /// Basic apps are not used for capacity allocation. /// - [JsonProperty(PropertyName = "excludeFromCapacityAllocation")] - public bool? ExcludeFromCapacityAllocation { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// capacity is applicable for all apps; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "isApplicableForAllComputeModes")] - public bool? IsApplicableForAllComputeModes { get; set; } - - /// - /// Gets or sets shared or Dedicated. - /// - [JsonProperty(PropertyName = "siteMode")] - public string SiteMode { get; set; } - - /// - /// Gets or sets is this a linux stamp capacity - /// - [JsonProperty(PropertyName = "isLinux")] - public bool? IsLinux { get; set; } - + public bool? ExcludeFromCapacityAllocation { get; } + /// <code>true</code> if capacity is applicable for all apps; otherwise, <code>false</code>. + public bool? IsApplicableForAllComputeModes { get; } + /// Shared or Dedicated. + public string SiteMode { get; } + /// Is this a linux stamp capacity. + public bool? IsLinux { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.Serialization.cs new file mode 100644 index 000000000000..e1b915a18d78 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class StampCapacityCollection + { + internal static StampCapacityCollection DeserializeStampCapacityCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StampCapacity.DeserializeStampCapacity(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new StampCapacityCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.cs new file mode 100644 index 000000000000..09cb7dc9f83d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of stamp capacities. + internal partial class StampCapacityCollection + { + /// Initializes a new instance of StampCapacityCollection. + /// Collection of resources. + /// is null. + internal StampCapacityCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of StampCapacityCollection. + /// Collection of resources. + /// Link to next page of resources. + internal StampCapacityCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.Serialization.cs new file mode 100644 index 000000000000..b529acf121d4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.Serialization.cs @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteARMResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"); + writer.WriteObjectValue(Sku); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + writer.WriteObjectValue(Identity); + } + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RepositoryUrl)) + { + writer.WritePropertyName("repositoryUrl"); + writer.WriteStringValue(RepositoryUrl); + } + if (Optional.IsDefined(Branch)) + { + writer.WritePropertyName("branch"); + writer.WriteStringValue(Branch); + } + if (Optional.IsDefined(RepositoryToken)) + { + writer.WritePropertyName("repositoryToken"); + writer.WriteStringValue(RepositoryToken); + } + if (Optional.IsDefined(BuildProperties)) + { + writer.WritePropertyName("buildProperties"); + writer.WriteObjectValue(BuildProperties); + } + if (Optional.IsDefined(StagingEnvironmentPolicy)) + { + writer.WritePropertyName("stagingEnvironmentPolicy"); + writer.WriteStringValue(StagingEnvironmentPolicy.Value.ToSerialString()); + } + if (Optional.IsDefined(AllowConfigFileUpdates)) + { + writer.WritePropertyName("allowConfigFileUpdates"); + writer.WriteBooleanValue(AllowConfigFileUpdates.Value); + } + if (Optional.IsDefined(TemplateProperties)) + { + writer.WritePropertyName("templateProperties"); + writer.WriteObjectValue(TemplateProperties); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteARMResource DeserializeStaticSiteARMResource(JsonElement element) + { + Optional sku = default; + Optional identity = default; + Optional id = default; + Optional name = default; + Optional kind = default; + string location = default; + Optional type = default; + Optional> tags = default; + Optional defaultHostname = default; + Optional repositoryUrl = default; + Optional branch = default; + Optional> customDomains = default; + Optional repositoryToken = default; + Optional buildProperties = default; + Optional> privateEndpointConnections = default; + Optional stagingEnvironmentPolicy = default; + Optional allowConfigFileUpdates = default; + Optional templateProperties = default; + Optional contentDistributionEndpoint = default; + Optional keyVaultReferenceIdentity = default; + Optional> userProvidedFunctionApps = default; + Optional provider = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sku")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + sku = SkuDescription.DeserializeSkuDescription(property.Value); + continue; + } + if (property.NameEquals("identity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("defaultHostname")) + { + defaultHostname = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("repositoryUrl")) + { + repositoryUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("branch")) + { + branch = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("customDomains")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + customDomains = array; + continue; + } + if (property0.NameEquals("repositoryToken")) + { + repositoryToken = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("buildProperties")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + buildProperties = StaticSiteBuildProperties.DeserializeStaticSiteBuildProperties(property0.Value); + continue; + } + if (property0.NameEquals("privateEndpointConnections")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ResponseMessageEnvelopeRemotePrivateEndpointConnection.DeserializeResponseMessageEnvelopeRemotePrivateEndpointConnection(item)); + } + privateEndpointConnections = array; + continue; + } + if (property0.NameEquals("stagingEnvironmentPolicy")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + stagingEnvironmentPolicy = property0.Value.GetString().ToStagingEnvironmentPolicy(); + continue; + } + if (property0.NameEquals("allowConfigFileUpdates")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + allowConfigFileUpdates = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("templateProperties")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + templateProperties = StaticSiteTemplateOptions.DeserializeStaticSiteTemplateOptions(property0.Value); + continue; + } + if (property0.NameEquals("contentDistributionEndpoint")) + { + contentDistributionEndpoint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("keyVaultReferenceIdentity")) + { + keyVaultReferenceIdentity = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("userProvidedFunctionApps")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(StaticSiteUserProvidedFunctionApp.DeserializeStaticSiteUserProvidedFunctionApp(item)); + } + userProvidedFunctionApps = array; + continue; + } + if (property0.NameEquals("provider")) + { + provider = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new StaticSiteARMResource(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), sku.Value, identity.Value, defaultHostname.Value, repositoryUrl.Value, branch.Value, Optional.ToList(customDomains), repositoryToken.Value, buildProperties.Value, Optional.ToList(privateEndpointConnections), Optional.ToNullable(stagingEnvironmentPolicy), Optional.ToNullable(allowConfigFileUpdates), templateProperties.Value, contentDistributionEndpoint.Value, keyVaultReferenceIdentity.Value, Optional.ToList(userProvidedFunctionApps), provider.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs index 656ca9e54a50..321472445547 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs @@ -1,126 +1,108 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Static Site ARM resource. - /// - [Rest.Serialization.JsonTransformation] + /// Static Site ARM resource. public partial class StaticSiteARMResource : Resource { - /// - /// Initializes a new instance of the StaticSiteARMResource class. - /// - public StaticSiteARMResource() + /// Initializes a new instance of StaticSiteARMResource. + /// Resource Location. + /// is null. + public StaticSiteARMResource(string location) : base(location) { - CustomInit(); + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + CustomDomains = new ChangeTrackingList(); + PrivateEndpointConnections = new ChangeTrackingList(); + UserProvidedFunctionApps = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the StaticSiteARMResource class. - /// - /// Resource Location. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Resource tags. - /// The default autogenerated hostname - /// for the static site. - /// URL for the repository of the static - /// site. - /// The target branch in the repository. - /// The custom domains associated with this - /// static site. - /// A user's github repository token. - /// This is used to setup the Github Actions workflow file and API - /// secrets. - /// Build properties to configure on the - /// repository. - public StaticSiteARMResource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), SkuDescription sku = default(SkuDescription)) - : base(location, id, name, kind, type, tags) + /// Initializes a new instance of StaticSiteARMResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource Location. + /// Resource type. + /// Resource tags. + /// Description of a SKU for a scalable resource. + /// Managed service identity. + /// The default autogenerated hostname for the static site. + /// URL for the repository of the static site. + /// The target branch in the repository. + /// The custom domains associated with this static site. + /// A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. + /// Build properties to configure on the repository. + /// Private endpoint connections. + /// State indicating whether staging environments are allowed or not allowed for a static web app. + /// <code>false</code> if config file is locked for this static web app; otherwise, <code>true</code>. + /// Template options for generating a new repository. + /// The content distribution endpoint for the static site. + /// Identity to use for Key Vault Reference authentication. + /// User provided function apps registered with the static site. + /// The provider that submitted the last deployment to the primary environment of the static site. + internal StaticSiteARMResource(string id, string name, string kind, string location, string type, IDictionary tags, SkuDescription sku, ManagedServiceIdentity identity, string defaultHostname, string repositoryUrl, string branch, IReadOnlyList customDomains, string repositoryToken, StaticSiteBuildProperties buildProperties, IReadOnlyList privateEndpointConnections, StagingEnvironmentPolicy? stagingEnvironmentPolicy, bool? allowConfigFileUpdates, StaticSiteTemplateOptions templateProperties, string contentDistributionEndpoint, string keyVaultReferenceIdentity, IReadOnlyList userProvidedFunctionApps, string provider) : base(id, name, kind, location, type, tags) { + Sku = sku; + Identity = identity; DefaultHostname = defaultHostname; RepositoryUrl = repositoryUrl; Branch = branch; CustomDomains = customDomains; RepositoryToken = repositoryToken; BuildProperties = buildProperties; - Sku = sku; - CustomInit(); + PrivateEndpointConnections = privateEndpointConnections; + StagingEnvironmentPolicy = stagingEnvironmentPolicy; + AllowConfigFileUpdates = allowConfigFileUpdates; + TemplateProperties = templateProperties; + ContentDistributionEndpoint = contentDistributionEndpoint; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + UserProvidedFunctionApps = userProvidedFunctionApps; + Provider = provider; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the default autogenerated hostname for the static site. - /// - [JsonProperty(PropertyName = "properties.defaultHostname")] - public string DefaultHostname { get; private set; } - - /// - /// Gets or sets URL for the repository of the static site. - /// - [JsonProperty(PropertyName = "properties.repositoryUrl")] + /// Description of a SKU for a scalable resource. + public SkuDescription Sku { get; set; } + /// Managed service identity. + public ManagedServiceIdentity Identity { get; set; } + /// The default autogenerated hostname for the static site. + public string DefaultHostname { get; } + /// URL for the repository of the static site. public string RepositoryUrl { get; set; } - - /// - /// Gets or sets the target branch in the repository. - /// - [JsonProperty(PropertyName = "properties.branch")] + /// The target branch in the repository. public string Branch { get; set; } - - /// - /// Gets the custom domains associated with this static site. - /// - [JsonProperty(PropertyName = "properties.customDomains")] - public IList CustomDomains { get; private set; } - - /// - /// Gets or sets a user's github repository token. This is used to - /// setup the Github Actions workflow file and API secrets. - /// - [JsonProperty(PropertyName = "properties.repositoryToken")] + /// The custom domains associated with this static site. + public IReadOnlyList CustomDomains { get; } + /// A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. public string RepositoryToken { get; set; } - - /// - /// Gets or sets build properties to configure on the repository. - /// - [JsonProperty(PropertyName = "properties.buildProperties")] + /// Build properties to configure on the repository. public StaticSiteBuildProperties BuildProperties { get; set; } - - /// - /// - [JsonProperty(PropertyName = "sku")] - public SkuDescription Sku { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } + /// Private endpoint connections. + public IReadOnlyList PrivateEndpointConnections { get; } + /// State indicating whether staging environments are allowed or not allowed for a static web app. + public StagingEnvironmentPolicy? StagingEnvironmentPolicy { get; set; } + /// <code>false</code> if config file is locked for this static web app; otherwise, <code>true</code>. + public bool? AllowConfigFileUpdates { get; set; } + /// Template options for generating a new repository. + public StaticSiteTemplateOptions TemplateProperties { get; set; } + /// The content distribution endpoint for the static site. + public string ContentDistributionEndpoint { get; } + /// Identity to use for Key Vault Reference authentication. + public string KeyVaultReferenceIdentity { get; } + /// User provided function apps registered with the static site. + public IReadOnlyList UserProvidedFunctionApps { get; } + /// The provider that submitted the last deployment to the primary environment of the static site. + public string Provider { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.Serialization.cs new file mode 100644 index 000000000000..714d796eed3d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteBuildARMResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteBuildARMResource DeserializeStaticSiteBuildARMResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional buildId = default; + Optional sourceBranch = default; + Optional pullRequestTitle = default; + Optional hostname = default; + Optional createdTimeUtc = default; + Optional lastUpdatedOn = default; + Optional status = default; + Optional> userProvidedFunctionApps = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("buildId")) + { + buildId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("sourceBranch")) + { + sourceBranch = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("pullRequestTitle")) + { + pullRequestTitle = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("hostname")) + { + hostname = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createdTimeUtc")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + createdTimeUtc = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("lastUpdatedOn")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + lastUpdatedOn = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = new BuildStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("userProvidedFunctionApps")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(StaticSiteUserProvidedFunctionApp.DeserializeStaticSiteUserProvidedFunctionApp(item)); + } + userProvidedFunctionApps = array; + continue; + } + } + continue; + } + } + return new StaticSiteBuildARMResource(id.Value, name.Value, kind.Value, type.Value, buildId.Value, sourceBranch.Value, pullRequestTitle.Value, hostname.Value, Optional.ToNullable(createdTimeUtc), Optional.ToNullable(lastUpdatedOn), Optional.ToNullable(status), Optional.ToList(userProvidedFunctionApps)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs index b82f1efcf925..6eca514f8673 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs @@ -1,55 +1,39 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Static Site Build ARM resource. - /// - [Rest.Serialization.JsonTransformation] + /// Static Site Build ARM resource. public partial class StaticSiteBuildARMResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the StaticSiteBuildARMResource class. - /// + /// Initializes a new instance of StaticSiteBuildARMResource. public StaticSiteBuildARMResource() { - CustomInit(); + UserProvidedFunctionApps = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the StaticSiteBuildARMResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// An identifier for the static site - /// build. - /// The source branch. - /// The title of a pull request that a - /// static site build is related to. - /// The hostname for a static site - /// build. - /// When this build was created. - /// When this build was updated. - /// The status of the static site build. Possible - /// values include: 'WaitingForDeployment', 'Uploading', 'Deploying', - /// 'Ready', 'Failed', 'Deleting', 'Detached' - public StaticSiteBuildARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string buildId = default(string), string sourceBranch = default(string), string pullRequestTitle = default(string), string hostname = default(string), System.DateTime? createdTimeUtc = default(System.DateTime?), System.DateTime? lastUpdatedOn = default(System.DateTime?), string status = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of StaticSiteBuildARMResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// An identifier for the static site build. + /// The source branch. + /// The title of a pull request that a static site build is related to. + /// The hostname for a static site build. + /// When this build was created. + /// When this build was updated. + /// The status of the static site build. + /// User provided function apps registered with the static site build. + internal StaticSiteBuildARMResource(string id, string name, string kind, string type, string buildId, string sourceBranch, string pullRequestTitle, string hostname, DateTimeOffset? createdTimeUtc, DateTimeOffset? lastUpdatedOn, BuildStatus? status, IReadOnlyList userProvidedFunctionApps) : base(id, name, kind, type) { BuildId = buildId; SourceBranch = sourceBranch; @@ -58,58 +42,24 @@ public StaticSiteBuildARMResource() CreatedTimeUtc = createdTimeUtc; LastUpdatedOn = lastUpdatedOn; Status = status; - CustomInit(); + UserProvidedFunctionApps = userProvidedFunctionApps; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets an identifier for the static site build. - /// - [JsonProperty(PropertyName = "properties.buildId")] - public string BuildId { get; private set; } - - /// - /// Gets the source branch. - /// - [JsonProperty(PropertyName = "properties.sourceBranch")] - public string SourceBranch { get; private set; } - - /// - /// Gets the title of a pull request that a static site build is - /// related to. - /// - [JsonProperty(PropertyName = "properties.pullRequestTitle")] - public string PullRequestTitle { get; private set; } - - /// - /// Gets the hostname for a static site build. - /// - [JsonProperty(PropertyName = "properties.hostname")] - public string Hostname { get; private set; } - - /// - /// Gets when this build was created. - /// - [JsonProperty(PropertyName = "properties.createdTimeUtc")] - public System.DateTime? CreatedTimeUtc { get; private set; } - - /// - /// Gets when this build was updated. - /// - [JsonProperty(PropertyName = "properties.lastUpdatedOn")] - public System.DateTime? LastUpdatedOn { get; private set; } - - /// - /// Gets the status of the static site build. Possible values include: - /// 'WaitingForDeployment', 'Uploading', 'Deploying', 'Ready', - /// 'Failed', 'Deleting', 'Detached' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; private set; } - + /// An identifier for the static site build. + public string BuildId { get; } + /// The source branch. + public string SourceBranch { get; } + /// The title of a pull request that a static site build is related to. + public string PullRequestTitle { get; } + /// The hostname for a static site build. + public string Hostname { get; } + /// When this build was created. + public DateTimeOffset? CreatedTimeUtc { get; } + /// When this build was updated. + public DateTimeOffset? LastUpdatedOn { get; } + /// The status of the static site build. + public BuildStatus? Status { get; } + /// User provided function apps registered with the static site build. + public IReadOnlyList UserProvidedFunctionApps { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.Serialization.cs new file mode 100644 index 000000000000..8b0eb0a80046 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class StaticSiteBuildCollection + { + internal static StaticSiteBuildCollection DeserializeStaticSiteBuildCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticSiteBuildARMResource.DeserializeStaticSiteBuildARMResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new StaticSiteBuildCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.cs new file mode 100644 index 000000000000..ffe81f6dee66 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of static site builds. + internal partial class StaticSiteBuildCollection + { + /// Initializes a new instance of StaticSiteBuildCollection. + /// Collection of resources. + /// is null. + internal StaticSiteBuildCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of StaticSiteBuildCollection. + /// Collection of resources. + /// Link to next page of resources. + internal StaticSiteBuildCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.Serialization.cs new file mode 100644 index 000000000000..adea64d70e44 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.Serialization.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteBuildProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(AppLocation)) + { + writer.WritePropertyName("appLocation"); + writer.WriteStringValue(AppLocation); + } + if (Optional.IsDefined(ApiLocation)) + { + writer.WritePropertyName("apiLocation"); + writer.WriteStringValue(ApiLocation); + } + if (Optional.IsDefined(AppArtifactLocation)) + { + writer.WritePropertyName("appArtifactLocation"); + writer.WriteStringValue(AppArtifactLocation); + } + if (Optional.IsDefined(OutputLocation)) + { + writer.WritePropertyName("outputLocation"); + writer.WriteStringValue(OutputLocation); + } + if (Optional.IsDefined(AppBuildCommand)) + { + writer.WritePropertyName("appBuildCommand"); + writer.WriteStringValue(AppBuildCommand); + } + if (Optional.IsDefined(ApiBuildCommand)) + { + writer.WritePropertyName("apiBuildCommand"); + writer.WriteStringValue(ApiBuildCommand); + } + if (Optional.IsDefined(SkipGithubActionWorkflowGeneration)) + { + writer.WritePropertyName("skipGithubActionWorkflowGeneration"); + writer.WriteBooleanValue(SkipGithubActionWorkflowGeneration.Value); + } + if (Optional.IsDefined(GithubActionSecretNameOverride)) + { + writer.WritePropertyName("githubActionSecretNameOverride"); + writer.WriteStringValue(GithubActionSecretNameOverride); + } + writer.WriteEndObject(); + } + + internal static StaticSiteBuildProperties DeserializeStaticSiteBuildProperties(JsonElement element) + { + Optional appLocation = default; + Optional apiLocation = default; + Optional appArtifactLocation = default; + Optional outputLocation = default; + Optional appBuildCommand = default; + Optional apiBuildCommand = default; + Optional skipGithubActionWorkflowGeneration = default; + Optional githubActionSecretNameOverride = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation")) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("apiLocation")) + { + apiLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("appArtifactLocation")) + { + appArtifactLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("outputLocation")) + { + outputLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("appBuildCommand")) + { + appBuildCommand = property.Value.GetString(); + continue; + } + if (property.NameEquals("apiBuildCommand")) + { + apiBuildCommand = property.Value.GetString(); + continue; + } + if (property.NameEquals("skipGithubActionWorkflowGeneration")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + skipGithubActionWorkflowGeneration = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("githubActionSecretNameOverride")) + { + githubActionSecretNameOverride = property.Value.GetString(); + continue; + } + } + return new StaticSiteBuildProperties(appLocation.Value, apiLocation.Value, appArtifactLocation.Value, outputLocation.Value, appBuildCommand.Value, apiBuildCommand.Value, Optional.ToNullable(skipGithubActionWorkflowGeneration), githubActionSecretNameOverride.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs index be1c6117947d..363e4d68fc52 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs @@ -1,70 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Build properties for the static site. - /// + /// Build properties for the static site. public partial class StaticSiteBuildProperties { - /// - /// Initializes a new instance of the StaticSiteBuildProperties class. - /// + /// Initializes a new instance of StaticSiteBuildProperties. public StaticSiteBuildProperties() { - CustomInit(); } - /// - /// Initializes a new instance of the StaticSiteBuildProperties class. - /// - /// The path to the app code within the - /// repository. - /// The path to the api code within the - /// repository. - /// The path of the app artifacts - /// after building. - public StaticSiteBuildProperties(string appLocation = default(string), string apiLocation = default(string), string appArtifactLocation = default(string)) + /// Initializes a new instance of StaticSiteBuildProperties. + /// The path to the app code within the repository. + /// The path to the api code within the repository. + /// Deprecated: The path of the app artifacts after building (deprecated in favor of OutputLocation). + /// The output path of the app after building. + /// A custom command to run during deployment of the static content application. + /// A custom command to run during deployment of the Azure Functions API application. + /// Skip Github Action workflow generation. + /// Github Action secret name override. + internal StaticSiteBuildProperties(string appLocation, string apiLocation, string appArtifactLocation, string outputLocation, string appBuildCommand, string apiBuildCommand, bool? skipGithubActionWorkflowGeneration, string githubActionSecretNameOverride) { AppLocation = appLocation; ApiLocation = apiLocation; AppArtifactLocation = appArtifactLocation; - CustomInit(); + OutputLocation = outputLocation; + AppBuildCommand = appBuildCommand; + ApiBuildCommand = apiBuildCommand; + SkipGithubActionWorkflowGeneration = skipGithubActionWorkflowGeneration; + GithubActionSecretNameOverride = githubActionSecretNameOverride; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the path to the app code within the repository. - /// - [JsonProperty(PropertyName = "appLocation")] + /// The path to the app code within the repository. public string AppLocation { get; set; } - - /// - /// Gets or sets the path to the api code within the repository. - /// - [JsonProperty(PropertyName = "apiLocation")] + /// The path to the api code within the repository. public string ApiLocation { get; set; } - - /// - /// Gets or sets the path of the app artifacts after building. - /// - [JsonProperty(PropertyName = "appArtifactLocation")] + /// Deprecated: The path of the app artifacts after building (deprecated in favor of OutputLocation). public string AppArtifactLocation { get; set; } - + /// The output path of the app after building. + public string OutputLocation { get; set; } + /// A custom command to run during deployment of the static content application. + public string AppBuildCommand { get; set; } + /// A custom command to run during deployment of the Azure Functions API application. + public string ApiBuildCommand { get; set; } + /// Skip Github Action workflow generation. + public bool? SkipGithubActionWorkflowGeneration { get; set; } + /// Github Action secret name override. + public string GithubActionSecretNameOverride { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.Serialization.cs new file mode 100644 index 000000000000..54dd76de86f6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class StaticSiteCollection + { + internal static StaticSiteCollection DeserializeStaticSiteCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticSiteARMResource.DeserializeStaticSiteARMResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new StaticSiteCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.cs new file mode 100644 index 000000000000..c372436d424f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of static sites. + internal partial class StaticSiteCollection + { + /// Initializes a new instance of StaticSiteCollection. + /// Collection of resources. + /// is null. + internal StaticSiteCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of StaticSiteCollection. + /// Collection of resources. + /// Link to next page of resources. + internal StaticSiteCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.Serialization.cs new file mode 100644 index 000000000000..33985a82ac1a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.Serialization.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteCustomDomainOverviewARMResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteCustomDomainOverviewARMResource DeserializeStaticSiteCustomDomainOverviewARMResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional domainName = default; + Optional createdOn = default; + Optional status = default; + Optional validationToken = default; + Optional errorMessage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("domainName")) + { + domainName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createdOn")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + createdOn = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = new CustomDomainStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("validationToken")) + { + validationToken = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("errorMessage")) + { + errorMessage = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new StaticSiteCustomDomainOverviewARMResource(id.Value, name.Value, kind.Value, type.Value, domainName.Value, Optional.ToNullable(createdOn), Optional.ToNullable(status), validationToken.Value, errorMessage.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs index b2dca77065cf..3e7cc0b173d4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs @@ -1,72 +1,49 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Static Site Custom Domain Overview ARM resource. - /// - [Rest.Serialization.JsonTransformation] + /// Static Site Custom Domain Overview ARM resource. public partial class StaticSiteCustomDomainOverviewARMResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the - /// StaticSiteCustomDomainOverviewARMResource class. - /// + /// Initializes a new instance of StaticSiteCustomDomainOverviewARMResource. public StaticSiteCustomDomainOverviewARMResource() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// StaticSiteCustomDomainOverviewARMResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The domain name for the static site custom - /// domain. - /// The date and time on which the custom - /// domain was created for the static site. - public StaticSiteCustomDomainOverviewARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string domainName = default(string), System.DateTime? createdOn = default(System.DateTime?)) - : base(id, name, kind, type) + /// Initializes a new instance of StaticSiteCustomDomainOverviewARMResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The domain name for the static site custom domain. + /// The date and time on which the custom domain was created for the static site. + /// The status of the custom domain. + /// The TXT record validation token. + /// . + internal StaticSiteCustomDomainOverviewARMResource(string id, string name, string kind, string type, string domainName, DateTimeOffset? createdOn, CustomDomainStatus? status, string validationToken, string errorMessage) : base(id, name, kind, type) { DomainName = domainName; CreatedOn = createdOn; - CustomInit(); + Status = status; + ValidationToken = validationToken; + ErrorMessage = errorMessage; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the domain name for the static site custom domain. - /// - [JsonProperty(PropertyName = "properties.domainName")] - public string DomainName { get; private set; } - - /// - /// Gets the date and time on which the custom domain was created for - /// the static site. - /// - [JsonProperty(PropertyName = "properties.createdOn")] - public System.DateTime? CreatedOn { get; private set; } - + /// The domain name for the static site custom domain. + public string DomainName { get; } + /// The date and time on which the custom domain was created for the static site. + public DateTimeOffset? CreatedOn { get; } + /// The status of the custom domain. + public CustomDomainStatus? Status { get; } + /// The TXT record validation token. + public string ValidationToken { get; } + public string ErrorMessage { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.Serialization.cs new file mode 100644 index 000000000000..2ae7279b2b5e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class StaticSiteCustomDomainOverviewCollection + { + internal static StaticSiteCustomDomainOverviewCollection DeserializeStaticSiteCustomDomainOverviewCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticSiteCustomDomainOverviewARMResource.DeserializeStaticSiteCustomDomainOverviewARMResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new StaticSiteCustomDomainOverviewCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.cs new file mode 100644 index 000000000000..1038bd43b795 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of static site custom domains. + internal partial class StaticSiteCustomDomainOverviewCollection + { + /// Initializes a new instance of StaticSiteCustomDomainOverviewCollection. + /// Collection of resources. + /// is null. + internal StaticSiteCustomDomainOverviewCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of StaticSiteCustomDomainOverviewCollection. + /// Collection of resources. + /// Link to next page of resources. + internal StaticSiteCustomDomainOverviewCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.Serialization.cs new file mode 100644 index 000000000000..8841a96a7236 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteCustomDomainRequestPropertiesARMResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ValidationMethod)) + { + writer.WritePropertyName("validationMethod"); + writer.WriteStringValue(ValidationMethod); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteCustomDomainRequestPropertiesARMResource DeserializeStaticSiteCustomDomainRequestPropertiesARMResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional validationMethod = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("validationMethod")) + { + validationMethod = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new StaticSiteCustomDomainRequestPropertiesARMResource(id.Value, name.Value, kind.Value, type.Value, validationMethod.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs new file mode 100644 index 000000000000..a0dfa1d3477f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Static Site Custom Domain Request Properties ARM resource. + public partial class StaticSiteCustomDomainRequestPropertiesARMResource : ProxyOnlyResource + { + /// Initializes a new instance of StaticSiteCustomDomainRequestPropertiesARMResource. + public StaticSiteCustomDomainRequestPropertiesARMResource() + { + } + + /// Initializes a new instance of StaticSiteCustomDomainRequestPropertiesARMResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Validation method for adding a custom domain. + internal StaticSiteCustomDomainRequestPropertiesARMResource(string id, string name, string kind, string type, string validationMethod) : base(id, name, kind, type) + { + ValidationMethod = validationMethod; + } + + /// Validation method for adding a custom domain. + public string ValidationMethod { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.Serialization.cs new file mode 100644 index 000000000000..ce83bb607f33 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.Serialization.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteFunctionOverviewARMResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteFunctionOverviewARMResource DeserializeStaticSiteFunctionOverviewARMResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional functionName = default; + Optional triggerType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("functionName")) + { + functionName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("triggerType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + triggerType = new TriggerTypes(property0.Value.GetString()); + continue; + } + } + continue; + } + } + return new StaticSiteFunctionOverviewARMResource(id.Value, name.Value, kind.Value, type.Value, functionName.Value, Optional.ToNullable(triggerType)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.cs index 2e39a7c18f36..a5efa8c206da 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.cs @@ -1,71 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Static Site Function Overview ARM resource. - /// - [Rest.Serialization.JsonTransformation] + /// Static Site Function Overview ARM resource. public partial class StaticSiteFunctionOverviewARMResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the - /// StaticSiteFunctionOverviewARMResource class. - /// + /// Initializes a new instance of StaticSiteFunctionOverviewARMResource. public StaticSiteFunctionOverviewARMResource() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// StaticSiteFunctionOverviewARMResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The name for the function - /// The trigger type of the function. - /// Possible values include: 'HttpTrigger', 'Unknown' - public StaticSiteFunctionOverviewARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string functionName = default(string), string triggerType = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of StaticSiteFunctionOverviewARMResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The name for the function. + /// The trigger type of the function. + internal StaticSiteFunctionOverviewARMResource(string id, string name, string kind, string type, string functionName, TriggerTypes? triggerType) : base(id, name, kind, type) { FunctionName = functionName; TriggerType = triggerType; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the name for the function - /// - [JsonProperty(PropertyName = "properties.functionName")] - public string FunctionName { get; private set; } - - /// - /// Gets the trigger type of the function. Possible values include: - /// 'HttpTrigger', 'Unknown' - /// - [JsonProperty(PropertyName = "properties.triggerType")] - public string TriggerType { get; private set; } - + /// The name for the function. + public string FunctionName { get; } + /// The trigger type of the function. + public TriggerTypes? TriggerType { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.Serialization.cs new file mode 100644 index 000000000000..4de0bf500aef --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class StaticSiteFunctionOverviewCollection + { + internal static StaticSiteFunctionOverviewCollection DeserializeStaticSiteFunctionOverviewCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticSiteFunctionOverviewARMResource.DeserializeStaticSiteFunctionOverviewARMResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new StaticSiteFunctionOverviewCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.cs new file mode 100644 index 000000000000..966520ac7c43 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of static site functions. + internal partial class StaticSiteFunctionOverviewCollection + { + /// Initializes a new instance of StaticSiteFunctionOverviewCollection. + /// Collection of resources. + /// is null. + internal StaticSiteFunctionOverviewCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of StaticSiteFunctionOverviewCollection. + /// Collection of resources. + /// Link to next page of resources. + internal StaticSiteFunctionOverviewCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.Serialization.cs new file mode 100644 index 000000000000..a0043415ad1e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.Serialization.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSitePatchResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RepositoryUrl)) + { + writer.WritePropertyName("repositoryUrl"); + writer.WriteStringValue(RepositoryUrl); + } + if (Optional.IsDefined(Branch)) + { + writer.WritePropertyName("branch"); + writer.WriteStringValue(Branch); + } + if (Optional.IsDefined(RepositoryToken)) + { + writer.WritePropertyName("repositoryToken"); + writer.WriteStringValue(RepositoryToken); + } + if (Optional.IsDefined(BuildProperties)) + { + writer.WritePropertyName("buildProperties"); + writer.WriteObjectValue(BuildProperties); + } + if (Optional.IsDefined(StagingEnvironmentPolicy)) + { + writer.WritePropertyName("stagingEnvironmentPolicy"); + writer.WriteStringValue(StagingEnvironmentPolicy.Value.ToSerialString()); + } + if (Optional.IsDefined(AllowConfigFileUpdates)) + { + writer.WritePropertyName("allowConfigFileUpdates"); + writer.WriteBooleanValue(AllowConfigFileUpdates.Value); + } + if (Optional.IsDefined(TemplateProperties)) + { + writer.WritePropertyName("templateProperties"); + writer.WriteObjectValue(TemplateProperties); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSitePatchResource DeserializeStaticSitePatchResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional defaultHostname = default; + Optional repositoryUrl = default; + Optional branch = default; + Optional> customDomains = default; + Optional repositoryToken = default; + Optional buildProperties = default; + Optional> privateEndpointConnections = default; + Optional stagingEnvironmentPolicy = default; + Optional allowConfigFileUpdates = default; + Optional templateProperties = default; + Optional contentDistributionEndpoint = default; + Optional keyVaultReferenceIdentity = default; + Optional> userProvidedFunctionApps = default; + Optional provider = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("defaultHostname")) + { + defaultHostname = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("repositoryUrl")) + { + repositoryUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("branch")) + { + branch = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("customDomains")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + customDomains = array; + continue; + } + if (property0.NameEquals("repositoryToken")) + { + repositoryToken = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("buildProperties")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + buildProperties = StaticSiteBuildProperties.DeserializeStaticSiteBuildProperties(property0.Value); + continue; + } + if (property0.NameEquals("privateEndpointConnections")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ResponseMessageEnvelopeRemotePrivateEndpointConnection.DeserializeResponseMessageEnvelopeRemotePrivateEndpointConnection(item)); + } + privateEndpointConnections = array; + continue; + } + if (property0.NameEquals("stagingEnvironmentPolicy")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + stagingEnvironmentPolicy = property0.Value.GetString().ToStagingEnvironmentPolicy(); + continue; + } + if (property0.NameEquals("allowConfigFileUpdates")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + allowConfigFileUpdates = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("templateProperties")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + templateProperties = StaticSiteTemplateOptions.DeserializeStaticSiteTemplateOptions(property0.Value); + continue; + } + if (property0.NameEquals("contentDistributionEndpoint")) + { + contentDistributionEndpoint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("keyVaultReferenceIdentity")) + { + keyVaultReferenceIdentity = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("userProvidedFunctionApps")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(StaticSiteUserProvidedFunctionApp.DeserializeStaticSiteUserProvidedFunctionApp(item)); + } + userProvidedFunctionApps = array; + continue; + } + if (property0.NameEquals("provider")) + { + provider = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new StaticSitePatchResource(id.Value, name.Value, kind.Value, type.Value, defaultHostname.Value, repositoryUrl.Value, branch.Value, Optional.ToList(customDomains), repositoryToken.Value, buildProperties.Value, Optional.ToList(privateEndpointConnections), Optional.ToNullable(stagingEnvironmentPolicy), Optional.ToNullable(allowConfigFileUpdates), templateProperties.Value, contentDistributionEndpoint.Value, keyVaultReferenceIdentity.Value, Optional.ToList(userProvidedFunctionApps), provider.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs index a4de50863546..ed3c08001991 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs @@ -1,57 +1,46 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// ARM resource for a static site when patching - /// - [Rest.Serialization.JsonTransformation] + /// ARM resource for a static site when patching. public partial class StaticSitePatchResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the StaticSitePatchResource class. - /// + /// Initializes a new instance of StaticSitePatchResource. public StaticSitePatchResource() { - CustomInit(); + CustomDomains = new ChangeTrackingList(); + PrivateEndpointConnections = new ChangeTrackingList(); + UserProvidedFunctionApps = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the StaticSitePatchResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The default autogenerated hostname - /// for the static site. - /// URL for the repository of the static - /// site. - /// The target branch in the repository. - /// The custom domains associated with this - /// static site. - /// A user's github repository token. - /// This is used to setup the Github Actions workflow file and API - /// secrets. - /// Build properties to configure on the - /// repository. - public StaticSitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties)) - : base(id, name, kind, type) + /// Initializes a new instance of StaticSitePatchResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The default autogenerated hostname for the static site. + /// URL for the repository of the static site. + /// The target branch in the repository. + /// The custom domains associated with this static site. + /// A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. + /// Build properties to configure on the repository. + /// Private endpoint connections. + /// State indicating whether staging environments are allowed or not allowed for a static web app. + /// <code>false</code> if config file is locked for this static web app; otherwise, <code>true</code>. + /// Template options for generating a new repository. + /// The content distribution endpoint for the static site. + /// Identity to use for Key Vault Reference authentication. + /// User provided function apps registered with the static site. + /// The provider that submitted the last deployment to the primary environment of the static site. + internal StaticSitePatchResource(string id, string name, string kind, string type, string defaultHostname, string repositoryUrl, string branch, IReadOnlyList customDomains, string repositoryToken, StaticSiteBuildProperties buildProperties, IReadOnlyList privateEndpointConnections, StagingEnvironmentPolicy? stagingEnvironmentPolicy, bool? allowConfigFileUpdates, StaticSiteTemplateOptions templateProperties, string contentDistributionEndpoint, string keyVaultReferenceIdentity, IReadOnlyList userProvidedFunctionApps, string provider) : base(id, name, kind, type) { DefaultHostname = defaultHostname; RepositoryUrl = repositoryUrl; @@ -59,50 +48,43 @@ public StaticSitePatchResource() CustomDomains = customDomains; RepositoryToken = repositoryToken; BuildProperties = buildProperties; - CustomInit(); + PrivateEndpointConnections = privateEndpointConnections; + StagingEnvironmentPolicy = stagingEnvironmentPolicy; + AllowConfigFileUpdates = allowConfigFileUpdates; + TemplateProperties = templateProperties; + ContentDistributionEndpoint = contentDistributionEndpoint; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + UserProvidedFunctionApps = userProvidedFunctionApps; + Provider = provider; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the default autogenerated hostname for the static site. - /// - [JsonProperty(PropertyName = "properties.defaultHostname")] - public string DefaultHostname { get; private set; } - - /// - /// Gets or sets URL for the repository of the static site. - /// - [JsonProperty(PropertyName = "properties.repositoryUrl")] + /// The default autogenerated hostname for the static site. + public string DefaultHostname { get; } + /// URL for the repository of the static site. public string RepositoryUrl { get; set; } - - /// - /// Gets or sets the target branch in the repository. - /// - [JsonProperty(PropertyName = "properties.branch")] + /// The target branch in the repository. public string Branch { get; set; } - - /// - /// Gets the custom domains associated with this static site. - /// - [JsonProperty(PropertyName = "properties.customDomains")] - public IList CustomDomains { get; private set; } - - /// - /// Gets or sets a user's github repository token. This is used to - /// setup the Github Actions workflow file and API secrets. - /// - [JsonProperty(PropertyName = "properties.repositoryToken")] + /// The custom domains associated with this static site. + public IReadOnlyList CustomDomains { get; } + /// A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. public string RepositoryToken { get; set; } - - /// - /// Gets or sets build properties to configure on the repository. - /// - [JsonProperty(PropertyName = "properties.buildProperties")] + /// Build properties to configure on the repository. public StaticSiteBuildProperties BuildProperties { get; set; } - + /// Private endpoint connections. + public IReadOnlyList PrivateEndpointConnections { get; } + /// State indicating whether staging environments are allowed or not allowed for a static web app. + public StagingEnvironmentPolicy? StagingEnvironmentPolicy { get; set; } + /// <code>false</code> if config file is locked for this static web app; otherwise, <code>true</code>. + public bool? AllowConfigFileUpdates { get; set; } + /// Template options for generating a new repository. + public StaticSiteTemplateOptions TemplateProperties { get; set; } + /// The content distribution endpoint for the static site. + public string ContentDistributionEndpoint { get; } + /// Identity to use for Key Vault Reference authentication. + public string KeyVaultReferenceIdentity { get; } + /// User provided function apps registered with the static site. + public IReadOnlyList UserProvidedFunctionApps { get; } + /// The provider that submitted the last deployment to the primary environment of the static site. + public string Provider { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.Serialization.cs new file mode 100644 index 000000000000..33065f48684e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteResetPropertiesARMResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RepositoryToken)) + { + writer.WritePropertyName("repositoryToken"); + writer.WriteStringValue(RepositoryToken); + } + if (Optional.IsDefined(ShouldUpdateRepository)) + { + writer.WritePropertyName("shouldUpdateRepository"); + writer.WriteBooleanValue(ShouldUpdateRepository.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteResetPropertiesARMResource DeserializeStaticSiteResetPropertiesARMResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional repositoryToken = default; + Optional shouldUpdateRepository = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("repositoryToken")) + { + repositoryToken = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("shouldUpdateRepository")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + shouldUpdateRepository = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new StaticSiteResetPropertiesARMResource(id.Value, name.Value, kind.Value, type.Value, repositoryToken.Value, Optional.ToNullable(shouldUpdateRepository)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.cs index 337b9ceedcbb..4c2daac6a921 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.cs @@ -1,73 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Static Site Reset Properties ARM resource. - /// - [Rest.Serialization.JsonTransformation] + /// Static Site Reset Properties ARM resource. public partial class StaticSiteResetPropertiesARMResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the - /// StaticSiteResetPropertiesARMResource class. - /// + /// Initializes a new instance of StaticSiteResetPropertiesARMResource. public StaticSiteResetPropertiesARMResource() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// StaticSiteResetPropertiesARMResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The token which proves admin - /// privileges to the repository. - /// Determines whether the - /// repository should be updated with the new properties. - public StaticSiteResetPropertiesARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repositoryToken = default(string), bool? shouldUpdateRepository = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of StaticSiteResetPropertiesARMResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The token which proves admin privileges to the repository. + /// Determines whether the repository should be updated with the new properties. + internal StaticSiteResetPropertiesARMResource(string id, string name, string kind, string type, string repositoryToken, bool? shouldUpdateRepository) : base(id, name, kind, type) { RepositoryToken = repositoryToken; ShouldUpdateRepository = shouldUpdateRepository; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the token which proves admin privileges to the - /// repository. - /// - [JsonProperty(PropertyName = "properties.repositoryToken")] + /// The token which proves admin privileges to the repository. public string RepositoryToken { get; set; } - - /// - /// Gets or sets determines whether the repository should be updated - /// with the new properties. - /// - [JsonProperty(PropertyName = "properties.shouldUpdateRepository")] + /// Determines whether the repository should be updated with the new properties. public bool? ShouldUpdateRepository { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.Serialization.cs new file mode 100644 index 000000000000..34b2733cb303 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.Serialization.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteTemplateOptions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(TemplateRepositoryUrl)) + { + writer.WritePropertyName("templateRepositoryUrl"); + writer.WriteStringValue(TemplateRepositoryUrl); + } + if (Optional.IsDefined(Owner)) + { + writer.WritePropertyName("owner"); + writer.WriteStringValue(Owner); + } + if (Optional.IsDefined(RepositoryName)) + { + writer.WritePropertyName("repositoryName"); + writer.WriteStringValue(RepositoryName); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(IsPrivate)) + { + writer.WritePropertyName("isPrivate"); + writer.WriteBooleanValue(IsPrivate.Value); + } + writer.WriteEndObject(); + } + + internal static StaticSiteTemplateOptions DeserializeStaticSiteTemplateOptions(JsonElement element) + { + Optional templateRepositoryUrl = default; + Optional owner = default; + Optional repositoryName = default; + Optional description = default; + Optional isPrivate = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("templateRepositoryUrl")) + { + templateRepositoryUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("owner")) + { + owner = property.Value.GetString(); + continue; + } + if (property.NameEquals("repositoryName")) + { + repositoryName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("isPrivate")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isPrivate = property.Value.GetBoolean(); + continue; + } + } + return new StaticSiteTemplateOptions(templateRepositoryUrl.Value, owner.Value, repositoryName.Value, description.Value, Optional.ToNullable(isPrivate)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs new file mode 100644 index 000000000000..5d3fef51cbe3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Template Options for the static site. + public partial class StaticSiteTemplateOptions + { + /// Initializes a new instance of StaticSiteTemplateOptions. + public StaticSiteTemplateOptions() + { + } + + /// Initializes a new instance of StaticSiteTemplateOptions. + /// URL of the template repository. The newly generated repository will be based on this one. + /// Owner of the newly generated repository. + /// Name of the newly generated repository. + /// Description of the newly generated repository. + /// Whether or not the newly generated repository is a private repository. Defaults to false (i.e. public). + internal StaticSiteTemplateOptions(string templateRepositoryUrl, string owner, string repositoryName, string description, bool? isPrivate) + { + TemplateRepositoryUrl = templateRepositoryUrl; + Owner = owner; + RepositoryName = repositoryName; + Description = description; + IsPrivate = isPrivate; + } + + /// URL of the template repository. The newly generated repository will be based on this one. + public string TemplateRepositoryUrl { get; set; } + /// Owner of the newly generated repository. + public string Owner { get; set; } + /// Name of the newly generated repository. + public string RepositoryName { get; set; } + /// Description of the newly generated repository. + public string Description { get; set; } + /// Whether or not the newly generated repository is a private repository. Defaults to false (i.e. public). + public bool? IsPrivate { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.Serialization.cs new file mode 100644 index 000000000000..b5b82e3694a6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.Serialization.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteUserARMResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Roles)) + { + writer.WritePropertyName("roles"); + writer.WriteStringValue(Roles); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteUserARMResource DeserializeStaticSiteUserARMResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional provider = default; + Optional userId = default; + Optional displayName = default; + Optional roles = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provider")) + { + provider = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("userId")) + { + userId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("displayName")) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("roles")) + { + roles = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new StaticSiteUserARMResource(id.Value, name.Value, kind.Value, type.Value, provider.Value, userId.Value, displayName.Value, roles.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.cs index 4999de01981e..aa5d2712746a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.cs @@ -1,87 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Static Site User ARM resource. - /// - [Rest.Serialization.JsonTransformation] + /// Static Site User ARM resource. public partial class StaticSiteUserARMResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the StaticSiteUserARMResource class. - /// + /// Initializes a new instance of StaticSiteUserARMResource. public StaticSiteUserARMResource() { - CustomInit(); } - /// - /// Initializes a new instance of the StaticSiteUserARMResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The identity provider for the static site - /// user. - /// The user id for the static site user. - /// The display name for the static site - /// user. - /// The roles for the static site user, in - /// free-form string format - public StaticSiteUserARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string provider = default(string), string userId = default(string), string displayName = default(string), string roles = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of StaticSiteUserARMResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The identity provider for the static site user. + /// The user id for the static site user. + /// The display name for the static site user. + /// The roles for the static site user, in free-form string format. + internal StaticSiteUserARMResource(string id, string name, string kind, string type, string provider, string userId, string displayName, string roles) : base(id, name, kind, type) { Provider = provider; UserId = userId; DisplayName = displayName; Roles = roles; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the identity provider for the static site user. - /// - [JsonProperty(PropertyName = "properties.provider")] - public string Provider { get; private set; } - - /// - /// Gets the user id for the static site user. - /// - [JsonProperty(PropertyName = "properties.userId")] - public string UserId { get; private set; } - - /// - /// Gets the display name for the static site user. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets or sets the roles for the static site user, in free-form - /// string format - /// - [JsonProperty(PropertyName = "properties.roles")] + /// The identity provider for the static site user. + public string Provider { get; } + /// The user id for the static site user. + public string UserId { get; } + /// The display name for the static site user. + public string DisplayName { get; } + /// The roles for the static site user, in free-form string format. public string Roles { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.Serialization.cs new file mode 100644 index 000000000000..3624fc23d416 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class StaticSiteUserCollection + { + internal static StaticSiteUserCollection DeserializeStaticSiteUserCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticSiteUserARMResource.DeserializeStaticSiteUserARMResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new StaticSiteUserCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.cs new file mode 100644 index 000000000000..f59cf0057fb1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of static site custom users. + internal partial class StaticSiteUserCollection + { + /// Initializes a new instance of StaticSiteUserCollection. + /// Collection of resources. + /// is null. + internal StaticSiteUserCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of StaticSiteUserCollection. + /// Collection of resources. + /// Link to next page of resources. + internal StaticSiteUserCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.Serialization.cs new file mode 100644 index 000000000000..2a3f352db0da --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteUserInvitationRequestResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Domain)) + { + writer.WritePropertyName("domain"); + writer.WriteStringValue(Domain); + } + if (Optional.IsDefined(Provider)) + { + writer.WritePropertyName("provider"); + writer.WriteStringValue(Provider); + } + if (Optional.IsDefined(UserDetails)) + { + writer.WritePropertyName("userDetails"); + writer.WriteStringValue(UserDetails); + } + if (Optional.IsDefined(Roles)) + { + writer.WritePropertyName("roles"); + writer.WriteStringValue(Roles); + } + if (Optional.IsDefined(NumHoursToExpiration)) + { + writer.WritePropertyName("numHoursToExpiration"); + writer.WriteNumberValue(NumHoursToExpiration.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteUserInvitationRequestResource DeserializeStaticSiteUserInvitationRequestResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional domain = default; + Optional provider = default; + Optional userDetails = default; + Optional roles = default; + Optional numHoursToExpiration = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("domain")) + { + domain = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provider")) + { + provider = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("userDetails")) + { + userDetails = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("roles")) + { + roles = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("numHoursToExpiration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + numHoursToExpiration = property0.Value.GetInt32(); + continue; + } + } + continue; + } + } + return new StaticSiteUserInvitationRequestResource(id.Value, name.Value, kind.Value, type.Value, domain.Value, provider.Value, userDetails.Value, roles.Value, Optional.ToNullable(numHoursToExpiration)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.cs index 1d33056a11c8..12c8d0ca5cb9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.cs @@ -1,99 +1,48 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Static sites user roles invitation resource. - /// - [Rest.Serialization.JsonTransformation] + /// Static sites user roles invitation resource. public partial class StaticSiteUserInvitationRequestResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the - /// StaticSiteUserInvitationRequestResource class. - /// + /// Initializes a new instance of StaticSiteUserInvitationRequestResource. public StaticSiteUserInvitationRequestResource() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// StaticSiteUserInvitationRequestResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The domain name for the static site custom - /// domain. - /// The identity provider for the static site - /// user. - /// The user id for the static site - /// user. - /// The roles for the static site user, in - /// free-form string format - /// The number of hours the sas - /// token stays valid - public StaticSiteUserInvitationRequestResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string domain = default(string), string provider = default(string), string userDetails = default(string), string roles = default(string), int? numHoursToExpiration = default(int?)) - : base(id, name, kind, type) + /// Initializes a new instance of StaticSiteUserInvitationRequestResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The domain name for the static site custom domain. + /// The identity provider for the static site user. + /// The user id for the static site user. + /// The roles for the static site user, in free-form string format. + /// The number of hours the sas token stays valid. + internal StaticSiteUserInvitationRequestResource(string id, string name, string kind, string type, string domain, string provider, string userDetails, string roles, int? numHoursToExpiration) : base(id, name, kind, type) { Domain = domain; Provider = provider; UserDetails = userDetails; Roles = roles; NumHoursToExpiration = numHoursToExpiration; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the domain name for the static site custom domain. - /// - [JsonProperty(PropertyName = "properties.domain")] + /// The domain name for the static site custom domain. public string Domain { get; set; } - - /// - /// Gets or sets the identity provider for the static site user. - /// - [JsonProperty(PropertyName = "properties.provider")] + /// The identity provider for the static site user. public string Provider { get; set; } - - /// - /// Gets or sets the user id for the static site user. - /// - [JsonProperty(PropertyName = "properties.userDetails")] + /// The user id for the static site user. public string UserDetails { get; set; } - - /// - /// Gets or sets the roles for the static site user, in free-form - /// string format - /// - [JsonProperty(PropertyName = "properties.roles")] + /// The roles for the static site user, in free-form string format. public string Roles { get; set; } - - /// - /// Gets or sets the number of hours the sas token stays valid - /// - [JsonProperty(PropertyName = "properties.numHoursToExpiration")] + /// The number of hours the sas token stays valid. public int? NumHoursToExpiration { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.Serialization.cs new file mode 100644 index 000000000000..a55a5542a015 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.Serialization.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteUserInvitationResponseResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteUserInvitationResponseResource DeserializeStaticSiteUserInvitationResponseResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional expiresOn = default; + Optional invitationUrl = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("expiresOn")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + expiresOn = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("invitationUrl")) + { + invitationUrl = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new StaticSiteUserInvitationResponseResource(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(expiresOn), invitationUrl.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.cs index dfd32c63e2ce..e5d98d822eae 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.cs @@ -1,70 +1,38 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Static sites user roles invitation link resource. - /// - [Rest.Serialization.JsonTransformation] + /// Static sites user roles invitation link resource. public partial class StaticSiteUserInvitationResponseResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the - /// StaticSiteUserInvitationResponseResource class. - /// + /// Initializes a new instance of StaticSiteUserInvitationResponseResource. public StaticSiteUserInvitationResponseResource() { - CustomInit(); } - /// - /// Initializes a new instance of the - /// StaticSiteUserInvitationResponseResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The expiration time of the - /// invitation - /// The url for the invitation link - public StaticSiteUserInvitationResponseResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), System.DateTime? expiresOn = default(System.DateTime?), string invitationUrl = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of StaticSiteUserInvitationResponseResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The expiration time of the invitation. + /// The url for the invitation link. + internal StaticSiteUserInvitationResponseResource(string id, string name, string kind, string type, DateTimeOffset? expiresOn, string invitationUrl) : base(id, name, kind, type) { ExpiresOn = expiresOn; InvitationUrl = invitationUrl; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the expiration time of the invitation - /// - [JsonProperty(PropertyName = "properties.expiresOn")] - public System.DateTime? ExpiresOn { get; private set; } - - /// - /// Gets the url for the invitation link - /// - [JsonProperty(PropertyName = "properties.invitationUrl")] - public string InvitationUrl { get; private set; } - + /// The expiration time of the invitation. + public DateTimeOffset? ExpiresOn { get; } + /// The url for the invitation link. + public string InvitationUrl { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.Serialization.cs new file mode 100644 index 000000000000..921baeabce49 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.Serialization.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteUserProvidedFunctionApp : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(FunctionAppResourceId)) + { + writer.WritePropertyName("functionAppResourceId"); + writer.WriteStringValue(FunctionAppResourceId); + } + if (Optional.IsDefined(FunctionAppRegion)) + { + writer.WritePropertyName("functionAppRegion"); + writer.WriteStringValue(FunctionAppRegion); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteUserProvidedFunctionApp DeserializeStaticSiteUserProvidedFunctionApp(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional functionAppResourceId = default; + Optional functionAppRegion = default; + Optional createdOn = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("functionAppResourceId")) + { + functionAppResourceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("functionAppRegion")) + { + functionAppRegion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createdOn")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + createdOn = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + } + return new StaticSiteUserProvidedFunctionApp(id.Value, name.Value, kind.Value, type.Value, functionAppResourceId.Value, functionAppRegion.Value, Optional.ToNullable(createdOn)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs new file mode 100644 index 000000000000..2076860ef54a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// A static site user provided function. + public partial class StaticSiteUserProvidedFunctionApp : ProxyOnlyResource + { + /// Initializes a new instance of StaticSiteUserProvidedFunctionApp. + public StaticSiteUserProvidedFunctionApp() + { + } + + /// Initializes a new instance of StaticSiteUserProvidedFunctionApp. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The resource id of the function app registered with the static site. + /// The region of the function app registered with the static site. + /// The date and time on which the function app was registered with the static site. + internal StaticSiteUserProvidedFunctionApp(string id, string name, string kind, string type, string functionAppResourceId, string functionAppRegion, DateTimeOffset? createdOn) : base(id, name, kind, type) + { + FunctionAppResourceId = functionAppResourceId; + FunctionAppRegion = functionAppRegion; + CreatedOn = createdOn; + } + + /// The resource id of the function app registered with the static site. + public string FunctionAppResourceId { get; set; } + /// The region of the function app registered with the static site. + public string FunctionAppRegion { get; set; } + /// The date and time on which the function app was registered with the static site. + public DateTimeOffset? CreatedOn { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.Serialization.cs new file mode 100644 index 000000000000..97c5950fa37e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.Serialization.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteUserProvidedFunctionAppARMResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(FunctionAppResourceId)) + { + writer.WritePropertyName("functionAppResourceId"); + writer.WriteStringValue(FunctionAppResourceId); + } + if (Optional.IsDefined(FunctionAppRegion)) + { + writer.WritePropertyName("functionAppRegion"); + writer.WriteStringValue(FunctionAppRegion); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteUserProvidedFunctionAppARMResource DeserializeStaticSiteUserProvidedFunctionAppARMResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional functionAppResourceId = default; + Optional functionAppRegion = default; + Optional createdOn = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("functionAppResourceId")) + { + functionAppResourceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("functionAppRegion")) + { + functionAppRegion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createdOn")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + createdOn = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + } + return new StaticSiteUserProvidedFunctionAppARMResource(id.Value, name.Value, kind.Value, type.Value, functionAppResourceId.Value, functionAppRegion.Value, Optional.ToNullable(createdOn)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs new file mode 100644 index 000000000000..26cc516d9ee8 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Static Site User Provided Function App ARM resource. + public partial class StaticSiteUserProvidedFunctionAppARMResource : ProxyOnlyResource + { + /// Initializes a new instance of StaticSiteUserProvidedFunctionAppARMResource. + public StaticSiteUserProvidedFunctionAppARMResource() + { + } + + /// Initializes a new instance of StaticSiteUserProvidedFunctionAppARMResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The resource id of the function app registered with the static site. + /// The region of the function app registered with the static site. + /// The date and time on which the function app was registered with the static site. + internal StaticSiteUserProvidedFunctionAppARMResource(string id, string name, string kind, string type, string functionAppResourceId, string functionAppRegion, DateTimeOffset? createdOn) : base(id, name, kind, type) + { + FunctionAppResourceId = functionAppResourceId; + FunctionAppRegion = functionAppRegion; + CreatedOn = createdOn; + } + + /// The resource id of the function app registered with the static site. + public string FunctionAppResourceId { get; set; } + /// The region of the function app registered with the static site. + public string FunctionAppRegion { get; set; } + /// The date and time on which the function app was registered with the static site. + public DateTimeOffset? CreatedOn { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.Serialization.cs new file mode 100644 index 000000000000..70aaf95f38c5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class StaticSiteUserProvidedFunctionAppsCollection + { + internal static StaticSiteUserProvidedFunctionAppsCollection DeserializeStaticSiteUserProvidedFunctionAppsCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StaticSiteUserProvidedFunctionAppARMResource.DeserializeStaticSiteUserProvidedFunctionAppARMResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new StaticSiteUserProvidedFunctionAppsCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.cs new file mode 100644 index 000000000000..02eb549f178d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of static site user provided function apps. + internal partial class StaticSiteUserProvidedFunctionAppsCollection + { + /// Initializes a new instance of StaticSiteUserProvidedFunctionAppsCollection. + /// Collection of resources. + /// is null. + internal StaticSiteUserProvidedFunctionAppsCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of StaticSiteUserProvidedFunctionAppsCollection. + /// Collection of resources. + /// Link to next page of resources. + internal StaticSiteUserProvidedFunctionAppsCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.Serialization.cs new file mode 100644 index 000000000000..95008b3cdd7b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSiteZipDeploymentARMResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(AppZipUrl)) + { + writer.WritePropertyName("appZipUrl"); + writer.WriteStringValue(AppZipUrl); + } + if (Optional.IsDefined(ApiZipUrl)) + { + writer.WritePropertyName("apiZipUrl"); + writer.WriteStringValue(ApiZipUrl); + } + if (Optional.IsDefined(DeploymentTitle)) + { + writer.WritePropertyName("deploymentTitle"); + writer.WriteStringValue(DeploymentTitle); + } + if (Optional.IsDefined(Provider)) + { + writer.WritePropertyName("provider"); + writer.WriteStringValue(Provider); + } + if (Optional.IsDefined(FunctionLanguage)) + { + writer.WritePropertyName("functionLanguage"); + writer.WriteStringValue(FunctionLanguage); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSiteZipDeploymentARMResource DeserializeStaticSiteZipDeploymentARMResource(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional appZipUrl = default; + Optional apiZipUrl = default; + Optional deploymentTitle = default; + Optional provider = default; + Optional functionLanguage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("appZipUrl")) + { + appZipUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("apiZipUrl")) + { + apiZipUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("deploymentTitle")) + { + deploymentTitle = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provider")) + { + provider = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("functionLanguage")) + { + functionLanguage = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new StaticSiteZipDeploymentARMResource(id.Value, name.Value, kind.Value, type.Value, appZipUrl.Value, apiZipUrl.Value, deploymentTitle.Value, provider.Value, functionLanguage.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs new file mode 100644 index 000000000000..f5d27cb64938 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Static site zip deployment ARM resource. + public partial class StaticSiteZipDeploymentARMResource : ProxyOnlyResource + { + /// Initializes a new instance of StaticSiteZipDeploymentARMResource. + public StaticSiteZipDeploymentARMResource() + { + } + + /// Initializes a new instance of StaticSiteZipDeploymentARMResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// URL for the zipped app content. + /// URL for the zipped api content. + /// A title to label the deployment. + /// The provider submitting this deployment. + /// The language of the api content, if it exists. + internal StaticSiteZipDeploymentARMResource(string id, string name, string kind, string type, string appZipUrl, string apiZipUrl, string deploymentTitle, string provider, string functionLanguage) : base(id, name, kind, type) + { + AppZipUrl = appZipUrl; + ApiZipUrl = apiZipUrl; + DeploymentTitle = deploymentTitle; + Provider = provider; + FunctionLanguage = functionLanguage; + } + + /// URL for the zipped app content. + public string AppZipUrl { get; set; } + /// URL for the zipped api content. + public string ApiZipUrl { get; set; } + /// A title to label the deployment. + public string DeploymentTitle { get; set; } + /// The provider submitting this deployment. + public string Provider { get; set; } + /// The language of the api content, if it exists. + public string FunctionLanguage { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.Serialization.cs new file mode 100644 index 000000000000..744d281102ca --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.Serialization.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSitesWorkflowPreview : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSitesWorkflowPreview DeserializeStaticSitesWorkflowPreview(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional path = default; + Optional contents = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("path")) + { + path = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("contents")) + { + contents = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new StaticSitesWorkflowPreview(id.Value, name.Value, kind.Value, type.Value, path.Value, contents.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs new file mode 100644 index 000000000000..95415e4e85ee --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Preview for the Static Site Workflow to be generated. + public partial class StaticSitesWorkflowPreview : ProxyOnlyResource + { + /// Initializes a new instance of StaticSitesWorkflowPreview. + public StaticSitesWorkflowPreview() + { + } + + /// Initializes a new instance of StaticSitesWorkflowPreview. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The path for the workflow file to be generated. + /// The contents for the workflow file to be generated. + internal StaticSitesWorkflowPreview(string id, string name, string kind, string type, string path, string contents) : base(id, name, kind, type) + { + Path = path; + Contents = contents; + } + + /// The path for the workflow file to be generated. + public string Path { get; } + /// The contents for the workflow file to be generated. + public string Contents { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.Serialization.cs new file mode 100644 index 000000000000..fcbf28a17151 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.Serialization.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StaticSitesWorkflowPreviewRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RepositoryUrl)) + { + writer.WritePropertyName("repositoryUrl"); + writer.WriteStringValue(RepositoryUrl); + } + if (Optional.IsDefined(Branch)) + { + writer.WritePropertyName("branch"); + writer.WriteStringValue(Branch); + } + if (Optional.IsDefined(BuildProperties)) + { + writer.WritePropertyName("buildProperties"); + writer.WriteObjectValue(BuildProperties); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StaticSitesWorkflowPreviewRequest DeserializeStaticSitesWorkflowPreviewRequest(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional repositoryUrl = default; + Optional branch = default; + Optional buildProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("repositoryUrl")) + { + repositoryUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("branch")) + { + branch = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("buildProperties")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + buildProperties = StaticSiteBuildProperties.DeserializeStaticSiteBuildProperties(property0.Value); + continue; + } + } + continue; + } + } + return new StaticSitesWorkflowPreviewRequest(id.Value, name.Value, kind.Value, type.Value, repositoryUrl.Value, branch.Value, buildProperties.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs new file mode 100644 index 000000000000..fe3f3371fa0b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Request entity for previewing the Static Site workflow. + public partial class StaticSitesWorkflowPreviewRequest : ProxyOnlyResource + { + /// Initializes a new instance of StaticSitesWorkflowPreviewRequest. + public StaticSitesWorkflowPreviewRequest() + { + } + + /// Initializes a new instance of StaticSitesWorkflowPreviewRequest. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// URL for the repository of the static site. + /// The target branch in the repository. + /// Build properties to configure on the repository. + internal StaticSitesWorkflowPreviewRequest(string id, string name, string kind, string type, string repositoryUrl, string branch, StaticSiteBuildProperties buildProperties) : base(id, name, kind, type) + { + RepositoryUrl = repositoryUrl; + Branch = branch; + BuildProperties = buildProperties; + } + + /// URL for the repository of the static site. + public string RepositoryUrl { get; set; } + /// The target branch in the repository. + public string Branch { get; set; } + /// Build properties to configure on the repository. + public StaticSiteBuildProperties BuildProperties { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.Serialization.cs new file mode 100644 index 000000000000..9197782b8c93 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Status : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"); + writer.WriteStringValue(Message); + } + if (Optional.IsDefined(StatusId)) + { + writer.WritePropertyName("statusId"); + writer.WriteStringValue(StatusId.Value.ToSerialString()); + } + writer.WriteEndObject(); + } + + internal static Status DeserializeStatus(JsonElement element) + { + Optional message = default; + Optional statusId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("statusId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + statusId = property.Value.GetString().ToInsightStatus(); + continue; + } + } + return new Status(message.Value, Optional.ToNullable(statusId)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs new file mode 100644 index 000000000000..fb86a3551c8f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Identify the status of the most severe insight generated by the detector. + public partial class Status + { + /// Initializes a new instance of Status. + public Status() + { + } + + /// Initializes a new instance of Status. + /// Descriptive message. + /// Level of the most severe insight generated by the detector. + internal Status(string message, InsightStatus? statusId) + { + Message = message; + StatusId = statusId; + } + + /// Descriptive message. + public string Message { get; set; } + /// Level of the most severe insight generated by the detector. + public InsightStatus? StatusId { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.Serialization.cs new file mode 100644 index 000000000000..82bc2551eb10 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.Serialization.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StatusCodesBasedTrigger : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"); + writer.WriteNumberValue(Status.Value); + } + if (Optional.IsDefined(SubStatus)) + { + writer.WritePropertyName("subStatus"); + writer.WriteNumberValue(SubStatus.Value); + } + if (Optional.IsDefined(Win32Status)) + { + writer.WritePropertyName("win32Status"); + writer.WriteNumberValue(Win32Status.Value); + } + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(TimeInterval)) + { + writer.WritePropertyName("timeInterval"); + writer.WriteStringValue(TimeInterval); + } + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"); + writer.WriteStringValue(Path); + } + writer.WriteEndObject(); + } + + internal static StatusCodesBasedTrigger DeserializeStatusCodesBasedTrigger(JsonElement element) + { + Optional status = default; + Optional subStatus = default; + Optional win32Status = default; + Optional count = default; + Optional timeInterval = default; + Optional path = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("subStatus")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + subStatus = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("win32Status")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + win32Status = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("count")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + count = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeInterval")) + { + timeInterval = property.Value.GetString(); + continue; + } + if (property.NameEquals("path")) + { + path = property.Value.GetString(); + continue; + } + } + return new StatusCodesBasedTrigger(Optional.ToNullable(status), Optional.ToNullable(subStatus), Optional.ToNullable(win32Status), Optional.ToNullable(count), timeInterval.Value, path.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs index f5a0016591e9..88827a442542 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs @@ -1,83 +1,48 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Trigger based on status code. - /// + /// Trigger based on status code. public partial class StatusCodesBasedTrigger { - /// - /// Initializes a new instance of the StatusCodesBasedTrigger class. - /// + /// Initializes a new instance of StatusCodesBasedTrigger. public StatusCodesBasedTrigger() { - CustomInit(); } - /// - /// Initializes a new instance of the StatusCodesBasedTrigger class. - /// - /// HTTP status code. - /// Request Sub Status. - /// Win32 error code. - /// Request Count. - /// Time interval. - public StatusCodesBasedTrigger(int? status = default(int?), int? subStatus = default(int?), int? win32Status = default(int?), int? count = default(int?), string timeInterval = default(string)) + /// Initializes a new instance of StatusCodesBasedTrigger. + /// HTTP status code. + /// Request Sub Status. + /// Win32 error code. + /// Request Count. + /// Time interval. + /// Request Path. + internal StatusCodesBasedTrigger(int? status, int? subStatus, int? win32Status, int? count, string timeInterval, string path) { Status = status; SubStatus = subStatus; Win32Status = win32Status; Count = count; TimeInterval = timeInterval; - CustomInit(); + Path = path; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets HTTP status code. - /// - [JsonProperty(PropertyName = "status")] + /// HTTP status code. public int? Status { get; set; } - - /// - /// Gets or sets request Sub Status. - /// - [JsonProperty(PropertyName = "subStatus")] + /// Request Sub Status. public int? SubStatus { get; set; } - - /// - /// Gets or sets win32 error code. - /// - [JsonProperty(PropertyName = "win32Status")] + /// Win32 error code. public int? Win32Status { get; set; } - - /// - /// Gets or sets request Count. - /// - [JsonProperty(PropertyName = "count")] + /// Request Count. public int? Count { get; set; } - - /// - /// Gets or sets time interval. - /// - [JsonProperty(PropertyName = "timeInterval")] + /// Time interval. public string TimeInterval { get; set; } - + /// Request Path. + public string Path { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.Serialization.cs new file mode 100644 index 000000000000..e8ad71b1c171 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StatusCodesRangeBasedTrigger : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(StatusCodes)) + { + writer.WritePropertyName("statusCodes"); + writer.WriteStringValue(StatusCodes); + } + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"); + writer.WriteStringValue(Path); + } + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(TimeInterval)) + { + writer.WritePropertyName("timeInterval"); + writer.WriteStringValue(TimeInterval); + } + writer.WriteEndObject(); + } + + internal static StatusCodesRangeBasedTrigger DeserializeStatusCodesRangeBasedTrigger(JsonElement element) + { + Optional statusCodes = default; + Optional path = default; + Optional count = default; + Optional timeInterval = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("statusCodes")) + { + statusCodes = property.Value.GetString(); + continue; + } + if (property.NameEquals("path")) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("count")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + count = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeInterval")) + { + timeInterval = property.Value.GetString(); + continue; + } + } + return new StatusCodesRangeBasedTrigger(statusCodes.Value, path.Value, Optional.ToNullable(count), timeInterval.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs new file mode 100644 index 000000000000..414f94a7e25e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Trigger based on range of status codes. + public partial class StatusCodesRangeBasedTrigger + { + /// Initializes a new instance of StatusCodesRangeBasedTrigger. + public StatusCodesRangeBasedTrigger() + { + } + + /// Initializes a new instance of StatusCodesRangeBasedTrigger. + /// HTTP status code. + /// . + /// Request Count. + /// Time interval. + internal StatusCodesRangeBasedTrigger(string statusCodes, string path, int? count, string timeInterval) + { + StatusCodes = statusCodes; + Path = path; + Count = count; + TimeInterval = timeInterval; + } + + /// HTTP status code. + public string StatusCodes { get; set; } + public string Path { get; set; } + /// Request Count. + public int? Count { get; set; } + /// Time interval. + public string TimeInterval { get; set; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.Serialization.cs new file mode 100644 index 000000000000..10cd881303a9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class StatusOptionsExtensions + { + public static string ToSerialString(this StatusOptions value) => value switch + { + StatusOptions.Ready => "Ready", + StatusOptions.Pending => "Pending", + StatusOptions.Creating => "Creating", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StatusOptions value.") + }; + + public static StatusOptions ToStatusOptions(this string value) + { + if (string.Equals(value, "Ready", StringComparison.InvariantCultureIgnoreCase)) return StatusOptions.Ready; + if (string.Equals(value, "Pending", StringComparison.InvariantCultureIgnoreCase)) return StatusOptions.Pending; + if (string.Equals(value, "Creating", StringComparison.InvariantCultureIgnoreCase)) return StatusOptions.Creating; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StatusOptions value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.cs index 979f68191d86..9cadcf73d7e3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for StatusOptions. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// App Service plan status. public enum StatusOptions { - [EnumMember(Value = "Ready")] + /// Ready. Ready, - [EnumMember(Value = "Pending")] + /// Pending. Pending, - [EnumMember(Value = "Creating")] + /// Creating. Creating } - internal static class StatusOptionsEnumExtension - { - internal static string ToSerializedValue(this StatusOptions? value) - { - return value == null ? null : ((StatusOptions)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this StatusOptions value) - { - switch( value ) - { - case StatusOptions.Ready: - return "Ready"; - case StatusOptions.Pending: - return "Pending"; - case StatusOptions.Creating: - return "Creating"; - } - return null; - } - - internal static StatusOptions? ParseStatusOptions(this string value) - { - switch( value ) - { - case "Ready": - return StatusOptions.Ready; - case "Pending": - return StatusOptions.Pending; - case "Creating": - return StatusOptions.Creating; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.Serialization.cs new file mode 100644 index 000000000000..8a347a382339 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.Serialization.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StorageMigrationOptions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(AzurefilesConnectionString)) + { + writer.WritePropertyName("azurefilesConnectionString"); + writer.WriteStringValue(AzurefilesConnectionString); + } + if (Optional.IsDefined(AzurefilesShare)) + { + writer.WritePropertyName("azurefilesShare"); + writer.WriteStringValue(AzurefilesShare); + } + if (Optional.IsDefined(SwitchSiteAfterMigration)) + { + writer.WritePropertyName("switchSiteAfterMigration"); + writer.WriteBooleanValue(SwitchSiteAfterMigration.Value); + } + if (Optional.IsDefined(BlockWriteAccessToSite)) + { + writer.WritePropertyName("blockWriteAccessToSite"); + writer.WriteBooleanValue(BlockWriteAccessToSite.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StorageMigrationOptions DeserializeStorageMigrationOptions(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional azurefilesConnectionString = default; + Optional azurefilesShare = default; + Optional switchSiteAfterMigration = default; + Optional blockWriteAccessToSite = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("azurefilesConnectionString")) + { + azurefilesConnectionString = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("azurefilesShare")) + { + azurefilesShare = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("switchSiteAfterMigration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + switchSiteAfterMigration = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("blockWriteAccessToSite")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + blockWriteAccessToSite = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new StorageMigrationOptions(id.Value, name.Value, kind.Value, type.Value, azurefilesConnectionString.Value, azurefilesShare.Value, Optional.ToNullable(switchSiteAfterMigration), Optional.ToNullable(blockWriteAccessToSite)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.cs index 7b046b435230..0cfe6ff29093 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.cs @@ -1,110 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Options for app content migration. - /// - [Rest.Serialization.JsonTransformation] + /// Options for app content migration. public partial class StorageMigrationOptions : ProxyOnlyResource { - /// - /// Initializes a new instance of the StorageMigrationOptions class. - /// + /// Initializes a new instance of StorageMigrationOptions. public StorageMigrationOptions() { - CustomInit(); } - /// - /// Initializes a new instance of the StorageMigrationOptions class. - /// - /// AzureFiles connection - /// string. - /// AzureFiles share. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>true</code>if the - /// app should be switched over; otherwise, - /// <code>false</code>. - /// <code>true</code> - /// if the app should be read only during copy operation; otherwise, - /// <code>false</code>. - public StorageMigrationOptions(string azurefilesConnectionString, string azurefilesShare, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? switchSiteAfterMigration = default(bool?), bool? blockWriteAccessToSite = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of StorageMigrationOptions. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// AzureFiles connection string. + /// AzureFiles share. + /// <code>true</code>if the app should be switched over; otherwise, <code>false</code>. + /// <code>true</code> if the app should be read only during copy operation; otherwise, <code>false</code>. + internal StorageMigrationOptions(string id, string name, string kind, string type, string azurefilesConnectionString, string azurefilesShare, bool? switchSiteAfterMigration, bool? blockWriteAccessToSite) : base(id, name, kind, type) { AzurefilesConnectionString = azurefilesConnectionString; AzurefilesShare = azurefilesShare; SwitchSiteAfterMigration = switchSiteAfterMigration; BlockWriteAccessToSite = blockWriteAccessToSite; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets azureFiles connection string. - /// - [JsonProperty(PropertyName = "properties.azurefilesConnectionString")] + /// AzureFiles connection string. public string AzurefilesConnectionString { get; set; } - - /// - /// Gets or sets azureFiles share. - /// - [JsonProperty(PropertyName = "properties.azurefilesShare")] + /// AzureFiles share. public string AzurefilesShare { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt;if the - /// app should be switched over; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.switchSiteAfterMigration")] + /// <code>true</code>if the app should be switched over; otherwise, <code>false</code>. public bool? SwitchSiteAfterMigration { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// app should be read only during copy operation; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.blockWriteAccessToSite")] + /// <code>true</code> if the app should be read only during copy operation; otherwise, <code>false</code>. public bool? BlockWriteAccessToSite { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AzurefilesConnectionString == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AzurefilesConnectionString"); - } - if (AzurefilesShare == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AzurefilesShare"); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.Serialization.cs new file mode 100644 index 000000000000..8aa6f6787d24 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.Serialization.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StorageMigrationResponse : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static StorageMigrationResponse DeserializeStorageMigrationResponse(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional operationId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("operationId")) + { + operationId = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new StorageMigrationResponse(id.Value, name.Value, kind.Value, type.Value, operationId.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.cs index e40f907ac262..26b1df78e880 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.cs @@ -1,62 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Response for a migration of app content request. - /// - [Rest.Serialization.JsonTransformation] + /// Response for a migration of app content request. public partial class StorageMigrationResponse : ProxyOnlyResource { - /// - /// Initializes a new instance of the StorageMigrationResponse class. - /// + /// Initializes a new instance of StorageMigrationResponse. public StorageMigrationResponse() { - CustomInit(); } - /// - /// Initializes a new instance of the StorageMigrationResponse class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// When server starts the migration process, - /// it will return an operation ID identifying that particular - /// migration operation. - public StorageMigrationResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string operationId = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of StorageMigrationResponse. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// When server starts the migration process, it will return an operation ID identifying that particular migration operation. + internal StorageMigrationResponse(string id, string name, string kind, string type, string operationId) : base(id, name, kind, type) { OperationId = operationId; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets when server starts the migration process, it will return an - /// operation ID identifying that particular migration operation. - /// - [JsonProperty(PropertyName = "properties.operationId")] - public string OperationId { get; private set; } - + /// When server starts the migration process, it will return an operation ID identifying that particular migration operation. + public string OperationId { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.Serialization.cs new file mode 100644 index 000000000000..038b485b70d7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.Serialization.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StringDictionary : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + foreach (var item in Properties) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WriteEndObject(); + } + + internal static StringDictionary DeserializeStringDictionary(JsonElement element) + { + Optional> properties = default; + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + properties = dictionary; + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + } + return new StringDictionary(id.Value, name.Value, kind.Value, type.Value, Optional.ToDictionary(properties)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.cs index 99192936fc6d..34dd4fafee7c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.cs @@ -1,58 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// String dictionary resource. - /// + /// String dictionary resource. public partial class StringDictionary : ProxyOnlyResource { - /// - /// Initializes a new instance of the StringDictionary class. - /// + /// Initializes a new instance of StringDictionary. public StringDictionary() { - CustomInit(); + Properties = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the StringDictionary class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Settings. - public StringDictionary(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary properties = default(IDictionary)) - : base(id, name, kind, type) + /// Initializes a new instance of StringDictionary. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Settings. + internal StringDictionary(string id, string name, string kind, string type, IDictionary properties) : base(id, name, kind, type) { Properties = properties; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets settings. - /// - [JsonProperty(PropertyName = "properties")] - public IDictionary Properties { get; set; } - + /// Settings. + public IDictionary Properties { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.Serialization.cs new file mode 100644 index 000000000000..532f227681c7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.Serialization.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class StringList : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("properties"); + writer.WriteStartArray(); + foreach (var item in Properties) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WriteEndObject(); + } + + internal static StringList DeserializeStringList(JsonElement element) + { + Optional> properties = default; + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + properties = array; + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + } + return new StringList(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(properties)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs new file mode 100644 index 000000000000..23de588bc6bc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// String list resource. + public partial class StringList : ProxyOnlyResource + { + /// Initializes a new instance of StringList. + public StringList() + { + Properties = new ChangeTrackingList(); + } + + /// Initializes a new instance of StringList. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// List of string resources. + internal StringList(string id, string name, string kind, string type, IList properties) : base(id, name, kind, type) + { + Properties = properties; + } + + /// List of string resources. + public IList Properties { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.Serialization.cs new file mode 100644 index 000000000000..83cc3edc9d9f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SupportTopic + { + internal static SupportTopic DeserializeSupportTopic(JsonElement element) + { + Optional id = default; + Optional pesId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("pesId")) + { + pesId = property.Value.GetString(); + continue; + } + } + return new SupportTopic(id.Value, pesId.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs new file mode 100644 index 000000000000..f571ab899a45 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Defines a unique Support Topic. + public partial class SupportTopic + { + /// Initializes a new instance of SupportTopic. + internal SupportTopic() + { + } + + /// Initializes a new instance of SupportTopic. + /// Support Topic Id. + /// Unique resource Id. + internal SupportTopic(string id, string pesId) + { + Id = id; + PesId = pesId; + } + + /// Support Topic Id. + public string Id { get; } + /// Unique resource Id. + public string PesId { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportedTlsVersions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportedTlsVersions.cs index 2981b1a26125..c2db3d673121 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportedTlsVersions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportedTlsVersions.cs @@ -1,23 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for SupportedTlsVersions. - /// - public static class SupportedTlsVersions + /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. + public readonly partial struct SupportedTlsVersions : IEquatable { - public const string OneFullStopZero = "1.0"; - public const string OneFullStopOne = "1.1"; - public const string OneFullStopTwo = "1.2"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public SupportedTlsVersions(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string One0Value = "1.0"; + private const string One1Value = "1.1"; + private const string One2Value = "1.2"; + + /// 1.0. + public static SupportedTlsVersions One0 { get; } = new SupportedTlsVersions(One0Value); + /// 1.1. + public static SupportedTlsVersions One1 { get; } = new SupportedTlsVersions(One1Value); + /// 1.2. + public static SupportedTlsVersions One2 { get; } = new SupportedTlsVersions(One2Value); + /// Determines if two values are the same. + public static bool operator ==(SupportedTlsVersions left, SupportedTlsVersions right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SupportedTlsVersions left, SupportedTlsVersions right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SupportedTlsVersions(string value) => new SupportedTlsVersions(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SupportedTlsVersions other && Equals(other); + /// + public bool Equals(SupportedTlsVersions other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.Serialization.cs new file mode 100644 index 000000000000..1cf884105a80 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class SwiftVirtualNetwork : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(SubnetResourceId)) + { + writer.WritePropertyName("subnetResourceId"); + writer.WriteStringValue(SubnetResourceId); + } + if (Optional.IsDefined(SwiftSupported)) + { + writer.WritePropertyName("swiftSupported"); + writer.WriteBooleanValue(SwiftSupported.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static SwiftVirtualNetwork DeserializeSwiftVirtualNetwork(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional subnetResourceId = default; + Optional swiftSupported = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("subnetResourceId")) + { + subnetResourceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("swiftSupported")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + swiftSupported = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new SwiftVirtualNetwork(id.Value, name.Value, kind.Value, type.Value, subnetResourceId.Value, Optional.ToNullable(swiftSupported)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.cs index 6237c01beb53..0d2b1ca36818 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.cs @@ -1,75 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Swift Virtual Network Contract. This is used to enable the new Swift - /// way of doing virtual network integration. - /// - [Rest.Serialization.JsonTransformation] + /// Swift Virtual Network Contract. This is used to enable the new Swift way of doing virtual network integration. public partial class SwiftVirtualNetwork : ProxyOnlyResource { - /// - /// Initializes a new instance of the SwiftVirtualNetwork class. - /// + /// Initializes a new instance of SwiftVirtualNetwork. public SwiftVirtualNetwork() { - CustomInit(); } - /// - /// Initializes a new instance of the SwiftVirtualNetwork class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Virtual Network subnet's - /// resource ID. This is the subnet that this Web App will join. This - /// subnet must have a delegation to Microsoft.Web/serverFarms defined - /// first. - /// A flag that specifies if the scale - /// unit this Web App is on supports Swift integration. - public SwiftVirtualNetwork(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string subnetResourceId = default(string), bool? swiftSupported = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of SwiftVirtualNetwork. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Virtual Network subnet's resource ID. This is the subnet that this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined first. + /// A flag that specifies if the scale unit this Web App is on supports Swift integration. + internal SwiftVirtualNetwork(string id, string name, string kind, string type, string subnetResourceId, bool? swiftSupported) : base(id, name, kind, type) { SubnetResourceId = subnetResourceId; SwiftSupported = swiftSupported; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Virtual Network subnet's resource ID. This is the - /// subnet that this Web App will join. This subnet must have a - /// delegation to Microsoft.Web/serverFarms defined first. - /// - [JsonProperty(PropertyName = "properties.subnetResourceId")] + /// The Virtual Network subnet's resource ID. This is the subnet that this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined first. public string SubnetResourceId { get; set; } - - /// - /// Gets or sets a flag that specifies if the scale unit this Web App - /// is on supports Swift integration. - /// - [JsonProperty(PropertyName = "properties.swiftSupported")] + /// A flag that specifies if the scale unit this Web App is on supports Swift integration. public bool? SwiftSupported { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.Serialization.cs new file mode 100644 index 000000000000..e012ad85aace --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class TldLegalAgreement + { + internal static TldLegalAgreement DeserializeTldLegalAgreement(JsonElement element) + { + string agreementKey = default; + string title = default; + string content = default; + Optional url = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("agreementKey")) + { + agreementKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("title")) + { + title = property.Value.GetString(); + continue; + } + if (property.NameEquals("content")) + { + content = property.Value.GetString(); + continue; + } + if (property.NameEquals("url")) + { + url = property.Value.GetString(); + continue; + } + } + return new TldLegalAgreement(agreementKey, title, content, url.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.cs index c5e9fd72b89a..e578624585d8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.cs @@ -1,99 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Legal agreement for a top level domain. - /// + /// Legal agreement for a top level domain. public partial class TldLegalAgreement { - /// - /// Initializes a new instance of the TldLegalAgreement class. - /// - public TldLegalAgreement() + /// Initializes a new instance of TldLegalAgreement. + /// Unique identifier for the agreement. + /// Agreement title. + /// Agreement details. + /// , , or is null. + internal TldLegalAgreement(string agreementKey, string title, string content) { - CustomInit(); + if (agreementKey == null) + { + throw new ArgumentNullException(nameof(agreementKey)); + } + if (title == null) + { + throw new ArgumentNullException(nameof(title)); + } + if (content == null) + { + throw new ArgumentNullException(nameof(content)); + } + + AgreementKey = agreementKey; + Title = title; + Content = content; } - /// - /// Initializes a new instance of the TldLegalAgreement class. - /// - /// Unique identifier for the - /// agreement. - /// Agreement title. - /// Agreement details. - /// URL where a copy of the agreement details is - /// hosted. - public TldLegalAgreement(string agreementKey, string title, string content, string url = default(string)) + /// Initializes a new instance of TldLegalAgreement. + /// Unique identifier for the agreement. + /// Agreement title. + /// Agreement details. + /// URL where a copy of the agreement details is hosted. + internal TldLegalAgreement(string agreementKey, string title, string content, string url) { AgreementKey = agreementKey; Title = title; Content = content; Url = url; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets unique identifier for the agreement. - /// - [JsonProperty(PropertyName = "agreementKey")] - public string AgreementKey { get; set; } - - /// - /// Gets or sets agreement title. - /// - [JsonProperty(PropertyName = "title")] - public string Title { get; set; } - - /// - /// Gets or sets agreement details. - /// - [JsonProperty(PropertyName = "content")] - public string Content { get; set; } - - /// - /// Gets or sets URL where a copy of the agreement details is hosted. - /// - [JsonProperty(PropertyName = "url")] - public string Url { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AgreementKey == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AgreementKey"); - } - if (Title == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Title"); - } - if (Content == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Content"); - } - } + /// Unique identifier for the agreement. + public string AgreementKey { get; } + /// Agreement title. + public string Title { get; } + /// Agreement details. + public string Content { get; } + /// URL where a copy of the agreement details is hosted. + public string Url { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.Serialization.cs new file mode 100644 index 000000000000..db1c41b403a9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class TldLegalAgreementCollection + { + internal static TldLegalAgreementCollection DeserializeTldLegalAgreementCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TldLegalAgreement.DeserializeTldLegalAgreement(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new TldLegalAgreementCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.cs new file mode 100644 index 000000000000..233f473d9138 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of top-level domain legal agreements. + internal partial class TldLegalAgreementCollection + { + /// Initializes a new instance of TldLegalAgreementCollection. + /// Collection of resources. + /// is null. + internal TldLegalAgreementCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of TldLegalAgreementCollection. + /// Collection of resources. + /// Link to next page of resources. + internal TldLegalAgreementCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.Serialization.cs new file mode 100644 index 000000000000..22819023754d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class TokenStore : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(TokenRefreshExtensionHours)) + { + writer.WritePropertyName("tokenRefreshExtensionHours"); + writer.WriteNumberValue(TokenRefreshExtensionHours.Value); + } + if (Optional.IsDefined(FileSystem)) + { + writer.WritePropertyName("fileSystem"); + writer.WriteObjectValue(FileSystem); + } + if (Optional.IsDefined(AzureBlobStorage)) + { + writer.WritePropertyName("azureBlobStorage"); + writer.WriteObjectValue(AzureBlobStorage); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static TokenStore DeserializeTokenStore(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional tokenRefreshExtensionHours = default; + Optional fileSystem = default; + Optional azureBlobStorage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("tokenRefreshExtensionHours")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + tokenRefreshExtensionHours = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("fileSystem")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + fileSystem = FileSystemTokenStore.DeserializeFileSystemTokenStore(property0.Value); + continue; + } + if (property0.NameEquals("azureBlobStorage")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + azureBlobStorage = BlobStorageTokenStore.DeserializeBlobStorageTokenStore(property0.Value); + continue; + } + } + continue; + } + } + return new TokenStore(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), Optional.ToNullable(tokenRefreshExtensionHours), fileSystem.Value, azureBlobStorage.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.cs index ffe3edf35446..f711823d219d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.cs @@ -1,72 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the token store. public partial class TokenStore : ProxyOnlyResource { - /// - /// Initializes a new instance of the TokenStore class. - /// + /// Initializes a new instance of TokenStore. public TokenStore() { - CustomInit(); } - /// - /// Initializes a new instance of the TokenStore class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public TokenStore(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), double? tokenRefreshExtensionHours = default(double?), FileSystemTokenStore fileSystem = default(FileSystemTokenStore), BlobStorageTokenStore azureBlobStorage = default(BlobStorageTokenStore)) - : base(id, name, kind, type) + /// Initializes a new instance of TokenStore. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// + /// <code>true</code> to durably store platform-specific security tokens that are obtained during login flows; otherwise, <code>false</code>. + /// The default is <code>false</code>. + /// + /// + /// The number of hours after session token expiration that a session token can be used to + /// call the token refresh API. The default is 72 hours. + /// + /// The configuration settings of the storage of the tokens if a file system is used. + /// The configuration settings of the storage of the tokens if blob storage is used. + internal TokenStore(string id, string name, string kind, string type, bool? enabled, double? tokenRefreshExtensionHours, FileSystemTokenStore fileSystem, BlobStorageTokenStore azureBlobStorage) : base(id, name, kind, type) { Enabled = enabled; TokenRefreshExtensionHours = tokenRefreshExtensionHours; FileSystem = fileSystem; AzureBlobStorage = azureBlobStorage; - CustomInit(); } /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// + /// <code>true</code> to durably store platform-specific security tokens that are obtained during login flows; otherwise, <code>false</code>. + /// The default is <code>false</code>. /// - [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } - /// + /// The number of hours after session token expiration that a session token can be used to + /// call the token refresh API. The default is 72 hours. /// - [JsonProperty(PropertyName = "properties.tokenRefreshExtensionHours")] public double? TokenRefreshExtensionHours { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.fileSystem")] + /// The configuration settings of the storage of the tokens if a file system is used. public FileSystemTokenStore FileSystem { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.azureBlobStorage")] + /// The configuration settings of the storage of the tokens if blob storage is used. public BlobStorageTokenStore AzureBlobStorage { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.Serialization.cs new file mode 100644 index 000000000000..d21f64f034f6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.Serialization.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class TopLevelDomain : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Privacy)) + { + writer.WritePropertyName("privacy"); + writer.WriteBooleanValue(Privacy.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static TopLevelDomain DeserializeTopLevelDomain(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional privacy = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("privacy")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + privacy = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new TopLevelDomain(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(privacy)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.cs index 6dec6fc5f030..0b71866e4774 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.cs @@ -1,63 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A top level domain object. - /// - [Rest.Serialization.JsonTransformation] + /// A top level domain object. public partial class TopLevelDomain : ProxyOnlyResource { - /// - /// Initializes a new instance of the TopLevelDomain class. - /// + /// Initializes a new instance of TopLevelDomain. public TopLevelDomain() { - CustomInit(); } - /// - /// Initializes a new instance of the TopLevelDomain class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// If <code>true</code>, then the - /// top level domain supports domain privacy; otherwise, - /// <code>false</code>. - public TopLevelDomain(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? privacy = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of TopLevelDomain. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// If <code>true</code>, then the top level domain supports domain privacy; otherwise, <code>false</code>. + internal TopLevelDomain(string id, string name, string kind, string type, bool? privacy) : base(id, name, kind, type) { Privacy = privacy; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, then - /// the top level domain supports domain privacy; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.privacy")] + /// If <code>true</code>, then the top level domain supports domain privacy; otherwise, <code>false</code>. public bool? Privacy { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.Serialization.cs new file mode 100644 index 000000000000..a4315ad6cb3f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.Serialization.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class TopLevelDomainAgreementOption : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(IncludePrivacy)) + { + writer.WritePropertyName("includePrivacy"); + writer.WriteBooleanValue(IncludePrivacy.Value); + } + if (Optional.IsDefined(ForTransfer)) + { + writer.WritePropertyName("forTransfer"); + writer.WriteBooleanValue(ForTransfer.Value); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.cs index 668cbcf92351..019b490963b4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.cs @@ -1,69 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Options for retrieving the list of top level domain legal agreements. - /// + /// Options for retrieving the list of top level domain legal agreements. public partial class TopLevelDomainAgreementOption { - /// - /// Initializes a new instance of the TopLevelDomainAgreementOption - /// class. - /// + /// Initializes a new instance of TopLevelDomainAgreementOption. public TopLevelDomainAgreementOption() { - CustomInit(); } - /// - /// Initializes a new instance of the TopLevelDomainAgreementOption - /// class. - /// - /// If <code>true</code>, then - /// the list of agreements will include agreements for domain privacy - /// as well; otherwise, <code>false</code>. - /// If <code>true</code>, then - /// the list of agreements will include agreements for domain transfer - /// as well; otherwise, <code>false</code>. - public TopLevelDomainAgreementOption(bool? includePrivacy = default(bool?), bool? forTransfer = default(bool?)) - { - IncludePrivacy = includePrivacy; - ForTransfer = forTransfer; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, then - /// the list of agreements will include agreements for domain privacy - /// as well; otherwise, &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "includePrivacy")] + /// If <code>true</code>, then the list of agreements will include agreements for domain privacy as well; otherwise, <code>false</code>. public bool? IncludePrivacy { get; set; } - - /// - /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, then - /// the list of agreements will include agreements for domain transfer - /// as well; otherwise, &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "forTransfer")] + /// If <code>true</code>, then the list of agreements will include agreements for domain transfer as well; otherwise, <code>false</code>. public bool? ForTransfer { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.Serialization.cs new file mode 100644 index 000000000000..6e32272c6aac --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class TopLevelDomainCollection + { + internal static TopLevelDomainCollection DeserializeTopLevelDomainCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TopLevelDomain.DeserializeTopLevelDomain(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new TopLevelDomainCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.cs new file mode 100644 index 000000000000..8d5e53c37ff9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Top-level domains. + internal partial class TopLevelDomainCollection + { + /// Initializes a new instance of TopLevelDomainCollection. + /// Collection of resources. + /// is null. + internal TopLevelDomainCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of TopLevelDomainCollection. + /// Collection of resources. + /// Link to next page of resources. + internal TopLevelDomainCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggerTypes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggerTypes.cs index e957c41f46ed..0cf8331ce0c9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggerTypes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggerTypes.cs @@ -1,22 +1,51 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for TriggerTypes. - /// - public static class TriggerTypes + /// The trigger type of the function. + public readonly partial struct TriggerTypes : IEquatable { - public const string HttpTrigger = "HttpTrigger"; - public const string Unknown = "Unknown"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public TriggerTypes(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HttpTriggerValue = "HttpTrigger"; + private const string UnknownValue = "Unknown"; + + /// HttpTrigger. + public static TriggerTypes HttpTrigger { get; } = new TriggerTypes(HttpTriggerValue); + /// Unknown. + public static TriggerTypes Unknown { get; } = new TriggerTypes(UnknownValue); + /// Determines if two values are the same. + public static bool operator ==(TriggerTypes left, TriggerTypes right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TriggerTypes left, TriggerTypes right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TriggerTypes(string value) => new TriggerTypes(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TriggerTypes other && Equals(other); + /// + public bool Equals(TriggerTypes other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.Serialization.cs new file mode 100644 index 000000000000..fdf41774c593 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class TriggeredJobHistory : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Runs)) + { + writer.WritePropertyName("runs"); + writer.WriteStartArray(); + foreach (var item in Runs) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static TriggeredJobHistory DeserializeTriggeredJobHistory(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional> runs = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("runs")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(TriggeredJobRun.DeserializeTriggeredJobRun(item)); + } + runs = array; + continue; + } + } + continue; + } + } + return new TriggeredJobHistory(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(runs)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.cs index cb058d3cd9c3..3a91c572fe62 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.cs @@ -1,62 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Triggered Web Job History. List of Triggered Web Job Run Information - /// elements. - /// - [Rest.Serialization.JsonTransformation] + /// Triggered Web Job History. List of Triggered Web Job Run Information elements. public partial class TriggeredJobHistory : ProxyOnlyResource { - /// - /// Initializes a new instance of the TriggeredJobHistory class. - /// + /// Initializes a new instance of TriggeredJobHistory. public TriggeredJobHistory() { - CustomInit(); + Runs = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the TriggeredJobHistory class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// List of triggered web job runs. - public TriggeredJobHistory(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList runs = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of TriggeredJobHistory. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// List of triggered web job runs. + internal TriggeredJobHistory(string id, string name, string kind, string type, IList runs) : base(id, name, kind, type) { Runs = runs; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of triggered web job runs. - /// - [JsonProperty(PropertyName = "properties.runs")] - public IList Runs { get; set; } - + /// List of triggered web job runs. + public IList Runs { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.Serialization.cs new file mode 100644 index 000000000000..06e5c46c9ab1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class TriggeredJobHistoryCollection + { + internal static TriggeredJobHistoryCollection DeserializeTriggeredJobHistoryCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TriggeredJobHistory.DeserializeTriggeredJobHistory(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new TriggeredJobHistoryCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.cs new file mode 100644 index 000000000000..c23859f212bf --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Kudu continuous web job information elements. + internal partial class TriggeredJobHistoryCollection + { + /// Initializes a new instance of TriggeredJobHistoryCollection. + /// Collection of resources. + /// is null. + internal TriggeredJobHistoryCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of TriggeredJobHistoryCollection. + /// Collection of resources. + /// Link to next page of resources. + internal TriggeredJobHistoryCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.Serialization.cs new file mode 100644 index 000000000000..52a9f291dbb7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.Serialization.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class TriggeredJobRun : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(WebJobId)) + { + writer.WritePropertyName("web_job_id"); + writer.WriteStringValue(WebJobId); + } + if (Optional.IsDefined(WebJobName)) + { + writer.WritePropertyName("web_job_name"); + writer.WriteStringValue(WebJobName); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"); + writer.WriteStringValue(Status.Value.ToSerialString()); + } + if (Optional.IsDefined(StartTime)) + { + writer.WritePropertyName("start_time"); + writer.WriteStringValue(StartTime.Value, "O"); + } + if (Optional.IsDefined(EndTime)) + { + writer.WritePropertyName("end_time"); + writer.WriteStringValue(EndTime.Value, "O"); + } + if (Optional.IsDefined(Duration)) + { + writer.WritePropertyName("duration"); + writer.WriteStringValue(Duration); + } + if (Optional.IsDefined(OutputUrl)) + { + writer.WritePropertyName("output_url"); + writer.WriteStringValue(OutputUrl); + } + if (Optional.IsDefined(ErrorUrl)) + { + writer.WritePropertyName("error_url"); + writer.WriteStringValue(ErrorUrl); + } + if (Optional.IsDefined(Url)) + { + writer.WritePropertyName("url"); + writer.WriteStringValue(Url); + } + if (Optional.IsDefined(JobName)) + { + writer.WritePropertyName("job_name"); + writer.WriteStringValue(JobName); + } + if (Optional.IsDefined(Trigger)) + { + writer.WritePropertyName("trigger"); + writer.WriteStringValue(Trigger); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static TriggeredJobRun DeserializeTriggeredJobRun(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional webJobId = default; + Optional webJobName = default; + Optional status = default; + Optional startTime = default; + Optional endTime = default; + Optional duration = default; + Optional outputUrl = default; + Optional errorUrl = default; + Optional url = default; + Optional jobName = default; + Optional trigger = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("web_job_id")) + { + webJobId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("web_job_name")) + { + webJobName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = property0.Value.GetString().ToTriggeredWebJobStatus(); + continue; + } + if (property0.NameEquals("start_time")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + startTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("end_time")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + endTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("duration")) + { + duration = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("output_url")) + { + outputUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("error_url")) + { + errorUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("url")) + { + url = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("job_name")) + { + jobName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("trigger")) + { + trigger = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new TriggeredJobRun(id.Value, name.Value, kind.Value, type.Value, webJobId.Value, webJobName.Value, Optional.ToNullable(status), Optional.ToNullable(startTime), Optional.ToNullable(endTime), duration.Value, outputUrl.Value, errorUrl.Value, url.Value, jobName.Value, trigger.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.cs index 976e997acb80..db2f3b0a263f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.cs @@ -1,55 +1,39 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Triggered Web Job Run Information. - /// - [Rest.Serialization.JsonTransformation] + /// Triggered Web Job Run Information. public partial class TriggeredJobRun : ProxyOnlyResource { - /// - /// Initializes a new instance of the TriggeredJobRun class. - /// + /// Initializes a new instance of TriggeredJobRun. public TriggeredJobRun() { - CustomInit(); } - /// - /// Initializes a new instance of the TriggeredJobRun class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Job ID. - /// Job name. - /// Job status. Possible values include: - /// 'Success', 'Failed', 'Error' - /// Start time. - /// End time. - /// Job duration. - /// Output URL. - /// Error URL. - /// Job URL. - /// Job name. - /// Job trigger. - public TriggeredJobRun(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string webJobId = default(string), string webJobName = default(string), TriggeredWebJobStatus? status = default(TriggeredWebJobStatus?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string duration = default(string), string outputUrl = default(string), string errorUrl = default(string), string url = default(string), string jobName = default(string), string trigger = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of TriggeredJobRun. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Job ID. + /// Job name. + /// Job status. + /// Start time. + /// End time. + /// Job duration. + /// Output URL. + /// Error URL. + /// Job URL. + /// Job name. + /// Job trigger. + internal TriggeredJobRun(string id, string name, string kind, string type, string webJobId, string webJobName, TriggeredWebJobStatus? status, DateTimeOffset? startTime, DateTimeOffset? endTime, string duration, string outputUrl, string errorUrl, string url, string jobName, string trigger) : base(id, name, kind, type) { WebJobId = webJobId; WebJobName = webJobName; @@ -62,80 +46,29 @@ public TriggeredJobRun() Url = url; JobName = jobName; Trigger = trigger; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets job ID. - /// - [JsonProperty(PropertyName = "properties.web_job_id")] + /// Job ID. public string WebJobId { get; set; } - - /// - /// Gets or sets job name. - /// - [JsonProperty(PropertyName = "properties.web_job_name")] + /// Job name. public string WebJobName { get; set; } - - /// - /// Gets or sets job status. Possible values include: 'Success', - /// 'Failed', 'Error' - /// - [JsonProperty(PropertyName = "properties.status")] + /// Job status. public TriggeredWebJobStatus? Status { get; set; } - - /// - /// Gets or sets start time. - /// - [JsonProperty(PropertyName = "properties.start_time")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets end time. - /// - [JsonProperty(PropertyName = "properties.end_time")] - public System.DateTime? EndTime { get; set; } - - /// - /// Gets or sets job duration. - /// - [JsonProperty(PropertyName = "properties.duration")] + /// Start time. + public DateTimeOffset? StartTime { get; set; } + /// End time. + public DateTimeOffset? EndTime { get; set; } + /// Job duration. public string Duration { get; set; } - - /// - /// Gets or sets output URL. - /// - [JsonProperty(PropertyName = "properties.output_url")] + /// Output URL. public string OutputUrl { get; set; } - - /// - /// Gets or sets error URL. - /// - [JsonProperty(PropertyName = "properties.error_url")] + /// Error URL. public string ErrorUrl { get; set; } - - /// - /// Gets or sets job URL. - /// - [JsonProperty(PropertyName = "properties.url")] + /// Job URL. public string Url { get; set; } - - /// - /// Gets or sets job name. - /// - [JsonProperty(PropertyName = "properties.job_name")] + /// Job name. public string JobName { get; set; } - - /// - /// Gets or sets job trigger. - /// - [JsonProperty(PropertyName = "properties.trigger")] + /// Job trigger. public string Trigger { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.Serialization.cs new file mode 100644 index 000000000000..b72698b240b9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class TriggeredWebJob : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(LatestRun)) + { + writer.WritePropertyName("latest_run"); + writer.WriteObjectValue(LatestRun); + } + if (Optional.IsDefined(HistoryUrl)) + { + writer.WritePropertyName("history_url"); + writer.WriteStringValue(HistoryUrl); + } + if (Optional.IsDefined(SchedulerLogsUrl)) + { + writer.WritePropertyName("scheduler_logs_url"); + writer.WriteStringValue(SchedulerLogsUrl); + } + if (Optional.IsDefined(RunCommand)) + { + writer.WritePropertyName("run_command"); + writer.WriteStringValue(RunCommand); + } + if (Optional.IsDefined(Url)) + { + writer.WritePropertyName("url"); + writer.WriteStringValue(Url); + } + if (Optional.IsDefined(ExtraInfoUrl)) + { + writer.WritePropertyName("extra_info_url"); + writer.WriteStringValue(ExtraInfoUrl); + } + if (Optional.IsDefined(WebJobType)) + { + writer.WritePropertyName("web_job_type"); + writer.WriteStringValue(WebJobType.Value.ToSerialString()); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(UsingSdk)) + { + writer.WritePropertyName("using_sdk"); + writer.WriteBooleanValue(UsingSdk.Value); + } + if (Optional.IsCollectionDefined(Settings)) + { + writer.WritePropertyName("settings"); + writer.WriteStartObject(); + foreach (var item in Settings) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static TriggeredWebJob DeserializeTriggeredWebJob(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional latestRun = default; + Optional historyUrl = default; + Optional schedulerLogsUrl = default; + Optional runCommand = default; + Optional url = default; + Optional extraInfoUrl = default; + Optional webJobType = default; + Optional error = default; + Optional usingSdk = default; + Optional> settings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("latest_run")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + latestRun = TriggeredJobRun.DeserializeTriggeredJobRun(property0.Value); + continue; + } + if (property0.NameEquals("history_url")) + { + historyUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("scheduler_logs_url")) + { + schedulerLogsUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("run_command")) + { + runCommand = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("url")) + { + url = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("extra_info_url")) + { + extraInfoUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("web_job_type")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + webJobType = property0.Value.GetString().ToWebJobType(); + continue; + } + if (property0.NameEquals("error")) + { + error = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("using_sdk")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + usingSdk = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("settings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetObject()); + } + settings = dictionary; + continue; + } + } + continue; + } + } + return new TriggeredWebJob(id.Value, name.Value, kind.Value, type.Value, latestRun.Value, historyUrl.Value, schedulerLogsUrl.Value, runCommand.Value, url.Value, extraInfoUrl.Value, Optional.ToNullable(webJobType), error.Value, Optional.ToNullable(usingSdk), Optional.ToDictionary(settings)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.cs index e22db3b35e2e..400a54f47923 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.cs @@ -1,56 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Triggered Web Job Information. - /// - [Rest.Serialization.JsonTransformation] + /// Triggered Web Job Information. public partial class TriggeredWebJob : ProxyOnlyResource { - /// - /// Initializes a new instance of the TriggeredWebJob class. - /// + /// Initializes a new instance of TriggeredWebJob. public TriggeredWebJob() { - CustomInit(); + Settings = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the TriggeredWebJob class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Latest job run information. - /// History URL. - /// Scheduler Logs URL. - /// Run command. - /// Job URL. - /// Extra Info URL. - /// Job type. Possible values include: - /// 'Continuous', 'Triggered' - /// Error information. - /// Using SDK? - /// Job settings. - public TriggeredWebJob(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), TriggeredJobRun latestRun = default(TriggeredJobRun), string historyUrl = default(string), string schedulerLogsUrl = default(string), string runCommand = default(string), string url = default(string), string extraInfoUrl = default(string), WebJobType? webJobType = default(WebJobType?), string error = default(string), bool? usingSdk = default(bool?), IDictionary settings = default(IDictionary)) - : base(id, name, kind, type) + /// Initializes a new instance of TriggeredWebJob. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Latest job run information. + /// History URL. + /// Scheduler Logs URL. + /// Run command. + /// Job URL. + /// Extra Info URL. + /// Job type. + /// Error information. + /// Using SDK?. + /// Job settings. + internal TriggeredWebJob(string id, string name, string kind, string type, TriggeredJobRun latestRun, string historyUrl, string schedulerLogsUrl, string runCommand, string url, string extraInfoUrl, WebJobType? webJobType, string error, bool? usingSdk, IDictionary settings) : base(id, name, kind, type) { LatestRun = latestRun; HistoryUrl = historyUrl; @@ -62,74 +46,27 @@ public TriggeredWebJob() Error = error; UsingSdk = usingSdk; Settings = settings; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets latest job run information. - /// - [JsonProperty(PropertyName = "properties.latest_run")] + /// Latest job run information. public TriggeredJobRun LatestRun { get; set; } - - /// - /// Gets or sets history URL. - /// - [JsonProperty(PropertyName = "properties.history_url")] + /// History URL. public string HistoryUrl { get; set; } - - /// - /// Gets or sets scheduler Logs URL. - /// - [JsonProperty(PropertyName = "properties.scheduler_logs_url")] + /// Scheduler Logs URL. public string SchedulerLogsUrl { get; set; } - - /// - /// Gets or sets run command. - /// - [JsonProperty(PropertyName = "properties.run_command")] + /// Run command. public string RunCommand { get; set; } - - /// - /// Gets or sets job URL. - /// - [JsonProperty(PropertyName = "properties.url")] + /// Job URL. public string Url { get; set; } - - /// - /// Gets or sets extra Info URL. - /// - [JsonProperty(PropertyName = "properties.extra_info_url")] + /// Extra Info URL. public string ExtraInfoUrl { get; set; } - - /// - /// Gets or sets job type. Possible values include: 'Continuous', - /// 'Triggered' - /// - [JsonProperty(PropertyName = "properties.web_job_type")] + /// Job type. public WebJobType? WebJobType { get; set; } - - /// - /// Gets or sets error information. - /// - [JsonProperty(PropertyName = "properties.error")] + /// Error information. public string Error { get; set; } - - /// - /// Gets or sets using SDK? - /// - [JsonProperty(PropertyName = "properties.using_sdk")] + /// Using SDK?. public bool? UsingSdk { get; set; } - - /// - /// Gets or sets job settings. - /// - [JsonProperty(PropertyName = "properties.settings")] - public IDictionary Settings { get; set; } - + /// Job settings. + public IDictionary Settings { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.Serialization.cs new file mode 100644 index 000000000000..0370be720ced --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class TriggeredWebJobCollection + { + internal static TriggeredWebJobCollection DeserializeTriggeredWebJobCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TriggeredWebJob.DeserializeTriggeredWebJob(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new TriggeredWebJobCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.cs new file mode 100644 index 000000000000..74a0f5a38db3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Kudu continuous web job information elements. + internal partial class TriggeredWebJobCollection + { + /// Initializes a new instance of TriggeredWebJobCollection. + /// Collection of resources. + /// is null. + internal TriggeredWebJobCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of TriggeredWebJobCollection. + /// Collection of resources. + /// Link to next page of resources. + internal TriggeredWebJobCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.Serialization.cs new file mode 100644 index 000000000000..1867a800f757 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class TriggeredWebJobStatusExtensions + { + public static string ToSerialString(this TriggeredWebJobStatus value) => value switch + { + TriggeredWebJobStatus.Success => "Success", + TriggeredWebJobStatus.Failed => "Failed", + TriggeredWebJobStatus.Error => "Error", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TriggeredWebJobStatus value.") + }; + + public static TriggeredWebJobStatus ToTriggeredWebJobStatus(this string value) + { + if (string.Equals(value, "Success", StringComparison.InvariantCultureIgnoreCase)) return TriggeredWebJobStatus.Success; + if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return TriggeredWebJobStatus.Failed; + if (string.Equals(value, "Error", StringComparison.InvariantCultureIgnoreCase)) return TriggeredWebJobStatus.Error; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TriggeredWebJobStatus value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.cs index 9afa65b95772..82b71c0adf06 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.cs @@ -1,66 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for TriggeredWebJobStatus. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Job status. public enum TriggeredWebJobStatus { - [EnumMember(Value = "Success")] + /// Success. Success, - [EnumMember(Value = "Failed")] + /// Failed. Failed, - [EnumMember(Value = "Error")] + /// Error. Error } - internal static class TriggeredWebJobStatusEnumExtension - { - internal static string ToSerializedValue(this TriggeredWebJobStatus? value) - { - return value == null ? null : ((TriggeredWebJobStatus)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this TriggeredWebJobStatus value) - { - switch( value ) - { - case TriggeredWebJobStatus.Success: - return "Success"; - case TriggeredWebJobStatus.Failed: - return "Failed"; - case TriggeredWebJobStatus.Error: - return "Error"; - } - return null; - } - - internal static TriggeredWebJobStatus? ParseTriggeredWebJobStatus(this string value) - { - switch( value ) - { - case "Success": - return TriggeredWebJobStatus.Success; - case "Failed": - return TriggeredWebJobStatus.Failed; - case "Error": - return TriggeredWebJobStatus.Error; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.Serialization.cs new file mode 100644 index 000000000000..b8bf8690acd6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.Serialization.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Twitter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Registration)) + { + writer.WritePropertyName("registration"); + writer.WriteObjectValue(Registration); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Twitter DeserializeTwitter(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional enabled = default; + Optional registration = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("enabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("registration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + registration = TwitterRegistration.DeserializeTwitterRegistration(property0.Value); + continue; + } + } + continue; + } + } + return new Twitter(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.cs index c2c7bdf49b9c..20a1247a5adb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.cs @@ -1,60 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the Twitter provider. public partial class Twitter : ProxyOnlyResource { - /// - /// Initializes a new instance of the Twitter class. - /// + /// Initializes a new instance of Twitter. public Twitter() { - CustomInit(); } - /// - /// Initializes a new instance of the Twitter class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public Twitter(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), TwitterRegistration registration = default(TwitterRegistration)) - : base(id, name, kind, type) + /// Initializes a new instance of Twitter. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the Twitter provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// The configuration settings of the app registration for the Twitter provider. + internal Twitter(string id, string name, string kind, string type, bool? enabled, TwitterRegistration registration) : base(id, name, kind, type) { Enabled = enabled; Registration = registration; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties.enabled")] + /// <code>false</code> if the Twitter provider should not be enabled despite the set registration; otherwise, <code>true</code>. public bool? Enabled { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.registration")] + /// The configuration settings of the app registration for the Twitter provider. public TwitterRegistration Registration { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.Serialization.cs new file mode 100644 index 000000000000..9b03609323b4 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.Serialization.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class TwitterRegistration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ConsumerKey)) + { + writer.WritePropertyName("consumerKey"); + writer.WriteStringValue(ConsumerKey); + } + if (Optional.IsDefined(ConsumerSecretSettingName)) + { + writer.WritePropertyName("consumerSecretSettingName"); + writer.WriteStringValue(ConsumerSecretSettingName); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static TwitterRegistration DeserializeTwitterRegistration(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional consumerKey = default; + Optional consumerSecretSettingName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("consumerKey")) + { + consumerKey = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("consumerSecretSettingName")) + { + consumerSecretSettingName = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new TwitterRegistration(id.Value, name.Value, kind.Value, type.Value, consumerKey.Value, consumerSecretSettingName.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.cs index 92b77941cf02..7d6cc985d837 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.cs @@ -1,60 +1,50 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The configuration settings of the app registration for the Twitter provider. public partial class TwitterRegistration : ProxyOnlyResource { - /// - /// Initializes a new instance of the TwitterRegistration class. - /// + /// Initializes a new instance of TwitterRegistration. public TwitterRegistration() { - CustomInit(); } - /// - /// Initializes a new instance of the TwitterRegistration class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - public TwitterRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string consumerKey = default(string), string consumerSecretSettingName = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of TwitterRegistration. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// + /// The OAuth 1.0a consumer key of the Twitter application used for sign-in. + /// This setting is required for enabling Twitter Sign-In. + /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + /// + /// + /// The app setting name that contains the OAuth 1.0a consumer secret of the Twitter + /// application used for sign-in. + /// + internal TwitterRegistration(string id, string name, string kind, string type, string consumerKey, string consumerSecretSettingName) : base(id, name, kind, type) { ConsumerKey = consumerKey; ConsumerSecretSettingName = consumerSecretSettingName; - CustomInit(); } /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// + /// The OAuth 1.0a consumer key of the Twitter application used for sign-in. + /// This setting is required for enabling Twitter Sign-In. + /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. /// - [JsonProperty(PropertyName = "properties.consumerKey")] public string ConsumerKey { get; set; } - /// + /// The app setting name that contains the OAuth 1.0a consumer secret of the Twitter + /// application used for sign-in. /// - [JsonProperty(PropertyName = "properties.consumerSecretSettingName")] public string ConsumerSecretSettingName { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.Serialization.cs new file mode 100644 index 000000000000..a8dce821f942 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class UnauthenticatedClientActionExtensions + { + public static string ToSerialString(this UnauthenticatedClientAction value) => value switch + { + UnauthenticatedClientAction.RedirectToLoginPage => "RedirectToLoginPage", + UnauthenticatedClientAction.AllowAnonymous => "AllowAnonymous", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UnauthenticatedClientAction value.") + }; + + public static UnauthenticatedClientAction ToUnauthenticatedClientAction(this string value) + { + if (string.Equals(value, "RedirectToLoginPage", StringComparison.InvariantCultureIgnoreCase)) return UnauthenticatedClientAction.RedirectToLoginPage; + if (string.Equals(value, "AllowAnonymous", StringComparison.InvariantCultureIgnoreCase)) return UnauthenticatedClientAction.AllowAnonymous; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UnauthenticatedClientAction value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.cs index 631531f54026..7703e8bb2735 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for UnauthenticatedClientAction. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// The action to take when an unauthenticated client attempts to access the app. public enum UnauthenticatedClientAction { - [EnumMember(Value = "RedirectToLoginPage")] + /// RedirectToLoginPage. RedirectToLoginPage, - [EnumMember(Value = "AllowAnonymous")] + /// AllowAnonymous. AllowAnonymous } - internal static class UnauthenticatedClientActionEnumExtension - { - internal static string ToSerializedValue(this UnauthenticatedClientAction? value) - { - return value == null ? null : ((UnauthenticatedClientAction)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this UnauthenticatedClientAction value) - { - switch( value ) - { - case UnauthenticatedClientAction.RedirectToLoginPage: - return "RedirectToLoginPage"; - case UnauthenticatedClientAction.AllowAnonymous: - return "AllowAnonymous"; - } - return null; - } - - internal static UnauthenticatedClientAction? ParseUnauthenticatedClientAction(this string value) - { - switch( value ) - { - case "RedirectToLoginPage": - return UnauthenticatedClientAction.RedirectToLoginPage; - case "AllowAnonymous": - return UnauthenticatedClientAction.AllowAnonymous; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.Serialization.cs new file mode 100644 index 000000000000..cd0283626921 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class UnauthenticatedClientActionV2Extensions + { + public static string ToSerialString(this UnauthenticatedClientActionV2 value) => value switch + { + UnauthenticatedClientActionV2.RedirectToLoginPage => "RedirectToLoginPage", + UnauthenticatedClientActionV2.AllowAnonymous => "AllowAnonymous", + UnauthenticatedClientActionV2.Return401 => "Return401", + UnauthenticatedClientActionV2.Return403 => "Return403", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UnauthenticatedClientActionV2 value.") + }; + + public static UnauthenticatedClientActionV2 ToUnauthenticatedClientActionV2(this string value) + { + if (string.Equals(value, "RedirectToLoginPage", StringComparison.InvariantCultureIgnoreCase)) return UnauthenticatedClientActionV2.RedirectToLoginPage; + if (string.Equals(value, "AllowAnonymous", StringComparison.InvariantCultureIgnoreCase)) return UnauthenticatedClientActionV2.AllowAnonymous; + if (string.Equals(value, "Return401", StringComparison.InvariantCultureIgnoreCase)) return UnauthenticatedClientActionV2.Return401; + if (string.Equals(value, "Return403", StringComparison.InvariantCultureIgnoreCase)) return UnauthenticatedClientActionV2.Return403; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UnauthenticatedClientActionV2 value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.cs index c9ec41bec5ee..0e152de73fc1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.cs @@ -1,72 +1,22 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for UnauthenticatedClientActionV2. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// The action to take when an unauthenticated client attempts to access the app. public enum UnauthenticatedClientActionV2 { - [EnumMember(Value = "RedirectToLoginPage")] + /// RedirectToLoginPage. RedirectToLoginPage, - [EnumMember(Value = "AllowAnonymous")] + /// AllowAnonymous. AllowAnonymous, - [EnumMember(Value = "Return401")] + /// Return401. Return401, - [EnumMember(Value = "Return403")] + /// Return403. Return403 } - internal static class UnauthenticatedClientActionV2EnumExtension - { - internal static string ToSerializedValue(this UnauthenticatedClientActionV2? value) - { - return value == null ? null : ((UnauthenticatedClientActionV2)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this UnauthenticatedClientActionV2 value) - { - switch( value ) - { - case UnauthenticatedClientActionV2.RedirectToLoginPage: - return "RedirectToLoginPage"; - case UnauthenticatedClientActionV2.AllowAnonymous: - return "AllowAnonymous"; - case UnauthenticatedClientActionV2.Return401: - return "Return401"; - case UnauthenticatedClientActionV2.Return403: - return "Return403"; - } - return null; - } - - internal static UnauthenticatedClientActionV2? ParseUnauthenticatedClientActionV2(this string value) - { - switch( value ) - { - case "RedirectToLoginPage": - return UnauthenticatedClientActionV2.RedirectToLoginPage; - case "AllowAnonymous": - return UnauthenticatedClientActionV2.AllowAnonymous; - case "Return401": - return UnauthenticatedClientActionV2.Return401; - case "Return403": - return UnauthenticatedClientActionV2.Return403; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.Serialization.cs new file mode 100644 index 000000000000..0b5bfdf8144a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class Usage : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static Usage DeserializeUsage(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional displayName = default; + Optional resourceName = default; + Optional unit = default; + Optional currentValue = default; + Optional limit = default; + Optional nextResetTime = default; + Optional computeMode = default; + Optional siteMode = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("displayName")) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("resourceName")) + { + resourceName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("unit")) + { + unit = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("currentValue")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + currentValue = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("limit")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + limit = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("nextResetTime")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + nextResetTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("computeMode")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + computeMode = property0.Value.GetString().ToComputeModeOptions(); + continue; + } + if (property0.NameEquals("siteMode")) + { + siteMode = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new Usage(id.Value, name.Value, kind.Value, type.Value, displayName.Value, resourceName.Value, unit.Value, Optional.ToNullable(currentValue), Optional.ToNullable(limit), Optional.ToNullable(nextResetTime), Optional.ToNullable(computeMode), siteMode.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.cs index 3a3b84a8828b..8732299b0cbe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.cs @@ -1,55 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Usage of the quota resource. - /// - [Rest.Serialization.JsonTransformation] + /// Usage of the quota resource. public partial class Usage : ProxyOnlyResource { - /// - /// Initializes a new instance of the Usage class. - /// + /// Initializes a new instance of Usage. public Usage() { - CustomInit(); } - /// - /// Initializes a new instance of the Usage class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Friendly name shown in the UI. - /// Name of the quota resource. - /// Units of measurement for the quota - /// resource. - /// The current value of the resource - /// counter. - /// The resource limit. - /// Next reset time for the resource - /// counter. - /// Compute mode used for this usage. - /// Possible values include: 'Shared', 'Dedicated', 'Dynamic' - /// Site mode used for this usage. - public Usage(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string displayName = default(string), string resourceName = default(string), string unit = default(string), long? currentValue = default(long?), long? limit = default(long?), System.DateTime? nextResetTime = default(System.DateTime?), ComputeModeOptions? computeMode = default(ComputeModeOptions?), string siteMode = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of Usage. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Friendly name shown in the UI. + /// Name of the quota resource. + /// Units of measurement for the quota resource. + /// The current value of the resource counter. + /// The resource limit. + /// Next reset time for the resource counter. + /// Compute mode used for this usage. + /// Site mode used for this usage. + internal Usage(string id, string name, string kind, string type, string displayName, string resourceName, string unit, long? currentValue, long? limit, DateTimeOffset? nextResetTime, ComputeModeOptions? computeMode, string siteMode) : base(id, name, kind, type) { DisplayName = displayName; ResourceName = resourceName; @@ -59,62 +40,23 @@ public Usage() NextResetTime = nextResetTime; ComputeMode = computeMode; SiteMode = siteMode; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets friendly name shown in the UI. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets name of the quota resource. - /// - [JsonProperty(PropertyName = "properties.resourceName")] - public string ResourceName { get; private set; } - - /// - /// Gets units of measurement for the quota resource. - /// - [JsonProperty(PropertyName = "properties.unit")] - public string Unit { get; private set; } - - /// - /// Gets the current value of the resource counter. - /// - [JsonProperty(PropertyName = "properties.currentValue")] - public long? CurrentValue { get; private set; } - - /// - /// Gets the resource limit. - /// - [JsonProperty(PropertyName = "properties.limit")] - public long? Limit { get; private set; } - - /// - /// Gets next reset time for the resource counter. - /// - [JsonProperty(PropertyName = "properties.nextResetTime")] - public System.DateTime? NextResetTime { get; private set; } - - /// - /// Gets compute mode used for this usage. Possible values include: - /// 'Shared', 'Dedicated', 'Dynamic' - /// - [JsonProperty(PropertyName = "properties.computeMode")] - public ComputeModeOptions? ComputeMode { get; private set; } - - /// - /// Gets site mode used for this usage. - /// - [JsonProperty(PropertyName = "properties.siteMode")] - public string SiteMode { get; private set; } - + /// Friendly name shown in the UI. + public string DisplayName { get; } + /// Name of the quota resource. + public string ResourceName { get; } + /// Units of measurement for the quota resource. + public string Unit { get; } + /// The current value of the resource counter. + public long? CurrentValue { get; } + /// The resource limit. + public long? Limit { get; } + /// Next reset time for the resource counter. + public DateTimeOffset? NextResetTime { get; } + /// Compute mode used for this usage. + public ComputeModeOptions? ComputeMode { get; } + /// Site mode used for this usage. + public string SiteMode { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.Serialization.cs new file mode 100644 index 000000000000..b39a87577f9f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class UsageCollection + { + internal static UsageCollection DeserializeUsageCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Usage.DeserializeUsage(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new UsageCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.cs new file mode 100644 index 000000000000..74d2721c3d50 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of usages. + internal partial class UsageCollection + { + /// Initializes a new instance of UsageCollection. + /// Collection of resources. + /// is null. + internal UsageCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of UsageCollection. + /// Collection of resources. + /// Link to next page of resources. + internal UsageCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.Serialization.cs new file mode 100644 index 000000000000..b94340b0acdf --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class UsageStateExtensions + { + public static string ToSerialString(this UsageState value) => value switch + { + UsageState.Normal => "Normal", + UsageState.Exceeded => "Exceeded", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UsageState value.") + }; + + public static UsageState ToUsageState(this string value) + { + if (string.Equals(value, "Normal", StringComparison.InvariantCultureIgnoreCase)) return UsageState.Normal; + if (string.Equals(value, "Exceeded", StringComparison.InvariantCultureIgnoreCase)) return UsageState.Exceeded; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UsageState value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.cs index ec63bc2a7d9d..87547962ff42 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for UsageState. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// State indicating whether the app has exceeded its quota usage. Read-only. public enum UsageState { - [EnumMember(Value = "Normal")] + /// Normal. Normal, - [EnumMember(Value = "Exceeded")] + /// Exceeded. Exceeded } - internal static class UsageStateEnumExtension - { - internal static string ToSerializedValue(this UsageState? value) - { - return value == null ? null : ((UsageState)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this UsageState value) - { - switch( value ) - { - case UsageState.Normal: - return "Normal"; - case UsageState.Exceeded: - return "Exceeded"; - } - return null; - } - - internal static UsageState? ParseUsageState(this string value) - { - switch( value ) - { - case "Normal": - return UsageState.Normal; - case "Exceeded": - return UsageState.Exceeded; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.Serialization.cs new file mode 100644 index 000000000000..7904d0828b32 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class User : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(PublishingUserName)) + { + writer.WritePropertyName("publishingUserName"); + writer.WriteStringValue(PublishingUserName); + } + if (Optional.IsDefined(PublishingPassword)) + { + writer.WritePropertyName("publishingPassword"); + writer.WriteStringValue(PublishingPassword); + } + if (Optional.IsDefined(PublishingPasswordHash)) + { + writer.WritePropertyName("publishingPasswordHash"); + writer.WriteStringValue(PublishingPasswordHash); + } + if (Optional.IsDefined(PublishingPasswordHashSalt)) + { + writer.WritePropertyName("publishingPasswordHashSalt"); + writer.WriteStringValue(PublishingPasswordHashSalt); + } + if (Optional.IsDefined(ScmUri)) + { + writer.WritePropertyName("scmUri"); + writer.WriteStringValue(ScmUri); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static User DeserializeUser(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional publishingUserName = default; + Optional publishingPassword = default; + Optional publishingPasswordHash = default; + Optional publishingPasswordHashSalt = default; + Optional scmUri = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("publishingUserName")) + { + publishingUserName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("publishingPassword")) + { + publishingPassword = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("publishingPasswordHash")) + { + publishingPasswordHash = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("publishingPasswordHashSalt")) + { + publishingPasswordHashSalt = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("scmUri")) + { + scmUri = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new User(id.Value, name.Value, kind.Value, type.Value, publishingUserName.Value, publishingPassword.Value, publishingPasswordHash.Value, publishingPasswordHashSalt.Value, scmUri.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.cs index c35bdf513eca..73e4fe3f9bc9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.cs @@ -1,108 +1,48 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// User credentials used for publishing activity. - /// - [Rest.Serialization.JsonTransformation] + /// User credentials used for publishing activity. public partial class User : ProxyOnlyResource { - /// - /// Initializes a new instance of the User class. - /// + /// Initializes a new instance of User. public User() { - CustomInit(); } - /// - /// Initializes a new instance of the User class. - /// - /// Username used for - /// publishing. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Password used for - /// publishing. - /// Password hash used for - /// publishing. - /// Password hash salt used - /// for publishing. - /// Url of SCM site. - public User(string publishingUserName, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string publishingPassword = default(string), string publishingPasswordHash = default(string), string publishingPasswordHashSalt = default(string), string scmUri = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of User. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Username used for publishing. + /// Password used for publishing. + /// Password hash used for publishing. + /// Password hash salt used for publishing. + /// Url of SCM site. + internal User(string id, string name, string kind, string type, string publishingUserName, string publishingPassword, string publishingPasswordHash, string publishingPasswordHashSalt, string scmUri) : base(id, name, kind, type) { PublishingUserName = publishingUserName; PublishingPassword = publishingPassword; PublishingPasswordHash = publishingPasswordHash; PublishingPasswordHashSalt = publishingPasswordHashSalt; ScmUri = scmUri; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets username used for publishing. - /// - [JsonProperty(PropertyName = "properties.publishingUserName")] + /// Username used for publishing. public string PublishingUserName { get; set; } - - /// - /// Gets or sets password used for publishing. - /// - [JsonProperty(PropertyName = "properties.publishingPassword")] + /// Password used for publishing. public string PublishingPassword { get; set; } - - /// - /// Gets or sets password hash used for publishing. - /// - [JsonProperty(PropertyName = "properties.publishingPasswordHash")] + /// Password hash used for publishing. public string PublishingPasswordHash { get; set; } - - /// - /// Gets or sets password hash salt used for publishing. - /// - [JsonProperty(PropertyName = "properties.publishingPasswordHashSalt")] + /// Password hash salt used for publishing. public string PublishingPasswordHashSalt { get; set; } - - /// - /// Gets or sets url of SCM site. - /// - [JsonProperty(PropertyName = "properties.scmUri")] + /// Url of SCM site. public string ScmUri { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PublishingUserName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PublishingUserName"); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.Serialization.cs new file mode 100644 index 000000000000..955a98cf2e35 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ValidateRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.ToString()); + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ServerFarmId)) + { + writer.WritePropertyName("serverFarmId"); + writer.WriteStringValue(ServerFarmId); + } + if (Optional.IsDefined(SkuName)) + { + writer.WritePropertyName("skuName"); + writer.WriteStringValue(SkuName); + } + if (Optional.IsDefined(NeedLinuxWorkers)) + { + writer.WritePropertyName("needLinuxWorkers"); + writer.WriteBooleanValue(NeedLinuxWorkers.Value); + } + if (Optional.IsDefined(IsSpot)) + { + writer.WritePropertyName("isSpot"); + writer.WriteBooleanValue(IsSpot.Value); + } + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"); + writer.WriteNumberValue(Capacity.Value); + } + if (Optional.IsDefined(HostingEnvironment)) + { + writer.WritePropertyName("hostingEnvironment"); + writer.WriteStringValue(HostingEnvironment); + } + if (Optional.IsDefined(IsXenon)) + { + writer.WritePropertyName("isXenon"); + writer.WriteBooleanValue(IsXenon.Value); + } + if (Optional.IsDefined(ContainerRegistryBaseUrl)) + { + writer.WritePropertyName("containerRegistryBaseUrl"); + writer.WriteStringValue(ContainerRegistryBaseUrl); + } + if (Optional.IsDefined(ContainerRegistryUsername)) + { + writer.WritePropertyName("containerRegistryUsername"); + writer.WriteStringValue(ContainerRegistryUsername); + } + if (Optional.IsDefined(ContainerRegistryPassword)) + { + writer.WritePropertyName("containerRegistryPassword"); + writer.WriteStringValue(ContainerRegistryPassword); + } + if (Optional.IsDefined(ContainerImageRepository)) + { + writer.WritePropertyName("containerImageRepository"); + writer.WriteStringValue(ContainerImageRepository); + } + if (Optional.IsDefined(ContainerImageTag)) + { + writer.WritePropertyName("containerImageTag"); + writer.WriteStringValue(ContainerImageTag); + } + if (Optional.IsDefined(ContainerImagePlatform)) + { + writer.WritePropertyName("containerImagePlatform"); + writer.WriteStringValue(ContainerImagePlatform); + } + if (Optional.IsDefined(AppServiceEnvironment)) + { + writer.WritePropertyName("appServiceEnvironment"); + writer.WriteObjectValue(AppServiceEnvironment); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs index a582a0780b0e..4e5377b4b339 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs @@ -1,223 +1,71 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Resource validation request content. - /// - [Rest.Serialization.JsonTransformation] + /// Resource validation request content. public partial class ValidateRequest { - /// - /// Initializes a new instance of the ValidateRequest class. - /// - public ValidateRequest() + /// Initializes a new instance of ValidateRequest. + /// Resource name to verify. + /// Resource type used for verification. + /// Expected location of the resource. + /// or is null. + public ValidateRequest(string name, ValidateResourceTypes type, string location) { - CustomInit(); - } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } - /// - /// Initializes a new instance of the ValidateRequest class. - /// - /// Resource name to verify. - /// Resource type used for verification. Possible - /// values include: 'ServerFarm', 'Site' - /// Expected location of the resource. - /// ARM resource ID of an App Service plan - /// that would host the app. - /// Name of the target SKU for the App Service - /// plan. - /// <code>true</code> if App - /// Service plan is for Linux workers; otherwise, - /// <code>false</code>. - /// <code>true</code> if App Service - /// plan is for Spot instances; otherwise, - /// <code>false</code>. - /// Target capacity of the App Service plan - /// (number of VMs). - /// Name of App Service Environment - /// where app or App Service plan should be created. - /// <code>true</code> if App Service - /// plan is running as a windows container - /// Base URL of the container - /// registry - /// Username for to access the - /// container registry - /// Password for to access the - /// container registry - /// Repository name (image - /// name) - /// Image tag - /// Platform (windows or - /// linux) - public ValidateRequest(string name, string type, string location, string serverFarmId = default(string), string skuName = default(string), bool? needLinuxWorkers = default(bool?), bool? isSpot = default(bool?), int? capacity = default(int?), string hostingEnvironment = default(string), bool? isXenon = default(bool?), string containerRegistryBaseUrl = default(string), string containerRegistryUsername = default(string), string containerRegistryPassword = default(string), string containerImageRepository = default(string), string containerImageTag = default(string), string containerImagePlatform = default(string)) - { Name = name; Type = type; Location = location; - ServerFarmId = serverFarmId; - SkuName = skuName; - NeedLinuxWorkers = needLinuxWorkers; - IsSpot = isSpot; - Capacity = capacity; - HostingEnvironment = hostingEnvironment; - IsXenon = isXenon; - ContainerRegistryBaseUrl = containerRegistryBaseUrl; - ContainerRegistryUsername = containerRegistryUsername; - ContainerRegistryPassword = containerRegistryPassword; - ContainerImageRepository = containerImageRepository; - ContainerImageTag = containerImageTag; - ContainerImagePlatform = containerImagePlatform; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource name to verify. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets resource type used for verification. Possible values - /// include: 'ServerFarm', 'Site' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets expected location of the resource. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets ARM resource ID of an App Service plan that would host - /// the app. - /// - [JsonProperty(PropertyName = "properties.serverFarmId")] + /// Resource name to verify. + public string Name { get; } + /// Resource type used for verification. + public ValidateResourceTypes Type { get; } + /// Expected location of the resource. + public string Location { get; } + /// ARM resource ID of an App Service plan that would host the app. public string ServerFarmId { get; set; } - - /// - /// Gets or sets name of the target SKU for the App Service plan. - /// - [JsonProperty(PropertyName = "properties.skuName")] + /// Name of the target SKU for the App Service plan. public string SkuName { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if App - /// Service plan is for Linux workers; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.needLinuxWorkers")] + /// <code>true</code> if App Service plan is for Linux workers; otherwise, <code>false</code>. public bool? NeedLinuxWorkers { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if App - /// Service plan is for Spot instances; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.isSpot")] + /// <code>true</code> if App Service plan is for Spot instances; otherwise, <code>false</code>. public bool? IsSpot { get; set; } - - /// - /// Gets or sets target capacity of the App Service plan (number of - /// VMs). - /// - [JsonProperty(PropertyName = "properties.capacity")] + /// Target capacity of the App Service plan (number of VMs). public int? Capacity { get; set; } - - /// - /// Gets or sets name of App Service Environment where app or App - /// Service plan should be created. - /// - [JsonProperty(PropertyName = "properties.hostingEnvironment")] + /// Name of App Service Environment where app or App Service plan should be created. public string HostingEnvironment { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if App - /// Service plan is running as a windows container - /// - [JsonProperty(PropertyName = "properties.isXenon")] + /// <code>true</code> if App Service plan is running as a windows container. public bool? IsXenon { get; set; } - - /// - /// Gets or sets base URL of the container registry - /// - [JsonProperty(PropertyName = "properties.containerRegistryBaseUrl")] + /// Base URL of the container registry. public string ContainerRegistryBaseUrl { get; set; } - - /// - /// Gets or sets username for to access the container registry - /// - [JsonProperty(PropertyName = "properties.containerRegistryUsername")] + /// Username for to access the container registry. public string ContainerRegistryUsername { get; set; } - - /// - /// Gets or sets password for to access the container registry - /// - [JsonProperty(PropertyName = "properties.containerRegistryPassword")] + /// Password for to access the container registry. public string ContainerRegistryPassword { get; set; } - - /// - /// Gets or sets repository name (image name) - /// - [JsonProperty(PropertyName = "properties.containerImageRepository")] + /// Repository name (image name). public string ContainerImageRepository { get; set; } - - /// - /// Gets or sets image tag - /// - [JsonProperty(PropertyName = "properties.containerImageTag")] + /// Image tag. public string ContainerImageTag { get; set; } - - /// - /// Gets or sets platform (windows or linux) - /// - [JsonProperty(PropertyName = "properties.containerImagePlatform")] + /// Platform (windows or linux). public string ContainerImagePlatform { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Type == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Type"); - } - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - if (Capacity < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Capacity", 1); - } - } + /// App Service Environment Properties. + public AppServiceEnvironment AppServiceEnvironment { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs index 511049be371b..7f72e52a24f2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs @@ -1,22 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; namespace Microsoft.Azure.Management.WebSites.Models { - - /// - /// Defines values for ValidateResourceTypes. - /// - public static class ValidateResourceTypes + /// Resource type used for verification. + public readonly partial struct ValidateResourceTypes : IEquatable { - public const string ServerFarm = "ServerFarm"; - public const string Site = "Site"; + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public ValidateResourceTypes(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ServerFarmValue = "ServerFarm"; + private const string SiteValue = "Site"; + private const string MicrosoftWebHostingEnvironmentsValue = "Microsoft.Web/hostingEnvironments"; + + /// ServerFarm. + public static ValidateResourceTypes ServerFarm { get; } = new ValidateResourceTypes(ServerFarmValue); + /// Site. + public static ValidateResourceTypes Site { get; } = new ValidateResourceTypes(SiteValue); + /// Microsoft.Web/hostingEnvironments. + public static ValidateResourceTypes MicrosoftWebHostingEnvironments { get; } = new ValidateResourceTypes(MicrosoftWebHostingEnvironmentsValue); + /// Determines if two values are the same. + public static bool operator ==(ValidateResourceTypes left, ValidateResourceTypes right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ValidateResourceTypes left, ValidateResourceTypes right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ValidateResourceTypes(string value) => new ValidateResourceTypes(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ValidateResourceTypes other && Equals(other); + /// + public bool Equals(ValidateResourceTypes other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.Serialization.cs new file mode 100644 index 000000000000..ca07b0f2a129 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ValidateResponse + { + internal static ValidateResponse DeserializeValidateResponse(JsonElement element) + { + Optional status = default; + Optional error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status")) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("error")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + error = ValidateResponseError.DeserializeValidateResponseError(property.Value); + continue; + } + } + return new ValidateResponse(status.Value, error.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.cs index 303a58c68912..67c54ad1aec1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.cs @@ -1,60 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Describes the result of resource validation. - /// + /// Describes the result of resource validation. public partial class ValidateResponse { - /// - /// Initializes a new instance of the ValidateResponse class. - /// - public ValidateResponse() + /// Initializes a new instance of ValidateResponse. + internal ValidateResponse() { - CustomInit(); } - /// - /// Initializes a new instance of the ValidateResponse class. - /// - /// Result of validation. - /// Error details for the case when validation - /// fails. - public ValidateResponse(string status = default(string), ValidateResponseError error = default(ValidateResponseError)) + /// Initializes a new instance of ValidateResponse. + /// Result of validation. + /// Error details for the case when validation fails. + internal ValidateResponse(string status, ValidateResponseError error) { Status = status; Error = error; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets result of validation. - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets error details for the case when validation fails. - /// - [JsonProperty(PropertyName = "error")] - public ValidateResponseError Error { get; set; } - + /// Result of validation. + public string Status { get; } + /// Error details for the case when validation fails. + public ValidateResponseError Error { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.Serialization.cs new file mode 100644 index 000000000000..84c9d92e60ba --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class ValidateResponseError + { + internal static ValidateResponseError DeserializeValidateResponseError(JsonElement element) + { + Optional code = default; + Optional message = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code")) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + } + return new ValidateResponseError(code.Value, message.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.cs index 6833ce082cb9..6e59077e7d0d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Error details for when validation fails. - /// + /// Error details for when validation fails. public partial class ValidateResponseError { - /// - /// Initializes a new instance of the ValidateResponseError class. - /// - public ValidateResponseError() + /// Initializes a new instance of ValidateResponseError. + internal ValidateResponseError() { - CustomInit(); } - /// - /// Initializes a new instance of the ValidateResponseError class. - /// - /// Validation error code. - /// Validation error message. - public ValidateResponseError(string code = default(string), string message = default(string)) + /// Initializes a new instance of ValidateResponseError. + /// Validation error code. + /// Validation error message. + internal ValidateResponseError(string code, string message) { Code = code; Message = message; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets validation error code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets validation error message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - + /// Validation error code. + public string Code { get; } + /// Validation error message. + public string Message { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.Serialization.cs new file mode 100644 index 000000000000..2ef8f66b54fb --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.Serialization.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class VirtualApplication : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(VirtualPath)) + { + writer.WritePropertyName("virtualPath"); + writer.WriteStringValue(VirtualPath); + } + if (Optional.IsDefined(PhysicalPath)) + { + writer.WritePropertyName("physicalPath"); + writer.WriteStringValue(PhysicalPath); + } + if (Optional.IsDefined(PreloadEnabled)) + { + writer.WritePropertyName("preloadEnabled"); + writer.WriteBooleanValue(PreloadEnabled.Value); + } + if (Optional.IsCollectionDefined(VirtualDirectories)) + { + writer.WritePropertyName("virtualDirectories"); + writer.WriteStartArray(); + foreach (var item in VirtualDirectories) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static VirtualApplication DeserializeVirtualApplication(JsonElement element) + { + Optional virtualPath = default; + Optional physicalPath = default; + Optional preloadEnabled = default; + Optional> virtualDirectories = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualPath")) + { + virtualPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("physicalPath")) + { + physicalPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("preloadEnabled")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + preloadEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("virtualDirectories")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VirtualDirectory.DeserializeVirtualDirectory(item)); + } + virtualDirectories = array; + continue; + } + } + return new VirtualApplication(virtualPath.Value, physicalPath.Value, Optional.ToNullable(preloadEnabled), Optional.ToList(virtualDirectories)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.cs index d9c0900c3687..150961554bef 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.cs @@ -1,82 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Virtual application in an app. - /// + /// Virtual application in an app. public partial class VirtualApplication { - /// - /// Initializes a new instance of the VirtualApplication class. - /// + /// Initializes a new instance of VirtualApplication. public VirtualApplication() { - CustomInit(); + VirtualDirectories = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the VirtualApplication class. - /// - /// Virtual path. - /// Physical path. - /// <code>true</code> if - /// preloading is enabled; otherwise, - /// <code>false</code>. - /// Virtual directories for virtual - /// application. - public VirtualApplication(string virtualPath = default(string), string physicalPath = default(string), bool? preloadEnabled = default(bool?), IList virtualDirectories = default(IList)) + /// Initializes a new instance of VirtualApplication. + /// Virtual path. + /// Physical path. + /// <code>true</code> if preloading is enabled; otherwise, <code>false</code>. + /// Virtual directories for virtual application. + internal VirtualApplication(string virtualPath, string physicalPath, bool? preloadEnabled, IList virtualDirectories) { VirtualPath = virtualPath; PhysicalPath = physicalPath; PreloadEnabled = preloadEnabled; VirtualDirectories = virtualDirectories; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets virtual path. - /// - [JsonProperty(PropertyName = "virtualPath")] + /// Virtual path. public string VirtualPath { get; set; } - - /// - /// Gets or sets physical path. - /// - [JsonProperty(PropertyName = "physicalPath")] + /// Physical path. public string PhysicalPath { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if - /// preloading is enabled; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "preloadEnabled")] + /// <code>true</code> if preloading is enabled; otherwise, <code>false</code>. public bool? PreloadEnabled { get; set; } - - /// - /// Gets or sets virtual directories for virtual application. - /// - [JsonProperty(PropertyName = "virtualDirectories")] - public IList VirtualDirectories { get; set; } - + /// Virtual directories for virtual application. + public IList VirtualDirectories { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.Serialization.cs new file mode 100644 index 000000000000..fa8e1d179093 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class VirtualDirectory : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(VirtualPath)) + { + writer.WritePropertyName("virtualPath"); + writer.WriteStringValue(VirtualPath); + } + if (Optional.IsDefined(PhysicalPath)) + { + writer.WritePropertyName("physicalPath"); + writer.WriteStringValue(PhysicalPath); + } + writer.WriteEndObject(); + } + + internal static VirtualDirectory DeserializeVirtualDirectory(JsonElement element) + { + Optional virtualPath = default; + Optional physicalPath = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualPath")) + { + virtualPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("physicalPath")) + { + physicalPath = property.Value.GetString(); + continue; + } + } + return new VirtualDirectory(virtualPath.Value, physicalPath.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.cs index 16fbc5f1d8b9..ab1acfbdec53 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.cs @@ -1,59 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Directory for virtual application. - /// + /// Directory for virtual application. public partial class VirtualDirectory { - /// - /// Initializes a new instance of the VirtualDirectory class. - /// + /// Initializes a new instance of VirtualDirectory. public VirtualDirectory() { - CustomInit(); } - /// - /// Initializes a new instance of the VirtualDirectory class. - /// - /// Path to virtual application. - /// Physical path. - public VirtualDirectory(string virtualPath = default(string), string physicalPath = default(string)) + /// Initializes a new instance of VirtualDirectory. + /// Path to virtual application. + /// Physical path. + internal VirtualDirectory(string virtualPath, string physicalPath) { VirtualPath = virtualPath; PhysicalPath = physicalPath; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets path to virtual application. - /// - [JsonProperty(PropertyName = "virtualPath")] + /// Path to virtual application. public string VirtualPath { get; set; } - - /// - /// Gets or sets physical path. - /// - [JsonProperty(PropertyName = "physicalPath")] + /// Physical path. public string PhysicalPath { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.Serialization.cs new file mode 100644 index 000000000000..4c5984f5c4d6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.Serialization.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class VirtualIPMapping : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(VirtualIP)) + { + writer.WritePropertyName("virtualIP"); + writer.WriteStringValue(VirtualIP); + } + if (Optional.IsDefined(InternalHttpPort)) + { + writer.WritePropertyName("internalHttpPort"); + writer.WriteNumberValue(InternalHttpPort.Value); + } + if (Optional.IsDefined(InternalHttpsPort)) + { + writer.WritePropertyName("internalHttpsPort"); + writer.WriteNumberValue(InternalHttpsPort.Value); + } + if (Optional.IsDefined(InUse)) + { + writer.WritePropertyName("inUse"); + writer.WriteBooleanValue(InUse.Value); + } + if (Optional.IsDefined(ServiceName)) + { + writer.WritePropertyName("serviceName"); + writer.WriteStringValue(ServiceName); + } + writer.WriteEndObject(); + } + + internal static VirtualIPMapping DeserializeVirtualIPMapping(JsonElement element) + { + Optional virtualIP = default; + Optional internalHttpPort = default; + Optional internalHttpsPort = default; + Optional inUse = default; + Optional serviceName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualIP")) + { + virtualIP = property.Value.GetString(); + continue; + } + if (property.NameEquals("internalHttpPort")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + internalHttpPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("internalHttpsPort")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + internalHttpsPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("inUse")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + inUse = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("serviceName")) + { + serviceName = property.Value.GetString(); + continue; + } + } + return new VirtualIPMapping(virtualIP.Value, Optional.ToNullable(internalHttpPort), Optional.ToNullable(internalHttpsPort), Optional.ToNullable(inUse), serviceName.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.cs index c5d70ef7c71e..39ec150cf38b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.cs @@ -1,84 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Virtual IP mapping. - /// + /// Virtual IP mapping. public partial class VirtualIPMapping { - /// - /// Initializes a new instance of the VirtualIPMapping class. - /// + /// Initializes a new instance of VirtualIPMapping. public VirtualIPMapping() { - CustomInit(); } - /// - /// Initializes a new instance of the VirtualIPMapping class. - /// - /// Virtual IP address. - /// Internal HTTP port. - /// Internal HTTPS port. - /// Is virtual IP mapping in use. - /// name of the service that virtual IP is - /// assigned to - public VirtualIPMapping(string virtualIP = default(string), int? internalHttpPort = default(int?), int? internalHttpsPort = default(int?), bool? inUse = default(bool?), string serviceName = default(string)) + /// Initializes a new instance of VirtualIPMapping. + /// Virtual IP address. + /// Internal HTTP port. + /// Internal HTTPS port. + /// Is virtual IP mapping in use. + /// name of the service that virtual IP is assigned to. + internal VirtualIPMapping(string virtualIP, int? internalHttpPort, int? internalHttpsPort, bool? inUse, string serviceName) { VirtualIP = virtualIP; InternalHttpPort = internalHttpPort; InternalHttpsPort = internalHttpsPort; InUse = inUse; ServiceName = serviceName; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets virtual IP address. - /// - [JsonProperty(PropertyName = "virtualIP")] + /// Virtual IP address. public string VirtualIP { get; set; } - - /// - /// Gets or sets internal HTTP port. - /// - [JsonProperty(PropertyName = "internalHttpPort")] + /// Internal HTTP port. public int? InternalHttpPort { get; set; } - - /// - /// Gets or sets internal HTTPS port. - /// - [JsonProperty(PropertyName = "internalHttpsPort")] + /// Internal HTTPS port. public int? InternalHttpsPort { get; set; } - - /// - /// Gets or sets is virtual IP mapping in use. - /// - [JsonProperty(PropertyName = "inUse")] + /// Is virtual IP mapping in use. public bool? InUse { get; set; } - - /// - /// Gets or sets name of the service that virtual IP is assigned to - /// - [JsonProperty(PropertyName = "serviceName")] + /// name of the service that virtual IP is assigned to. public string ServiceName { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.Serialization.cs new file mode 100644 index 000000000000..4425e199cf41 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.Serialization.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class VirtualNetworkProfile : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + if (Optional.IsDefined(Subnet)) + { + writer.WritePropertyName("subnet"); + writer.WriteStringValue(Subnet); + } + writer.WriteEndObject(); + } + + internal static VirtualNetworkProfile DeserializeVirtualNetworkProfile(JsonElement element) + { + string id = default; + Optional name = default; + Optional type = default; + Optional subnet = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnet")) + { + subnet = property.Value.GetString(); + continue; + } + } + return new VirtualNetworkProfile(id, name.Value, type.Value, subnet.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs index a9162d3a1626..3bf66d3d73ca 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs @@ -1,76 +1,50 @@ -// // Copyright (c) Microsoft Corporation. All rights 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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System; namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using System.Linq; - - /// - /// Specification for using a Virtual Network. - /// + /// Specification for using a Virtual Network. public partial class VirtualNetworkProfile { - /// - /// Initializes a new instance of the VirtualNetworkProfile class. - /// - public VirtualNetworkProfile() + /// Initializes a new instance of VirtualNetworkProfile. + /// Resource id of the Virtual Network. + /// is null. + public VirtualNetworkProfile(string id) { - CustomInit(); + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + Id = id; } - /// - /// Initializes a new instance of the VirtualNetworkProfile class. - /// - /// Resource id of the Virtual Network. - /// Name of the Virtual Network (read-only). - /// Resource type of the Virtual Network - /// (read-only). - /// Subnet within the Virtual Network. - public VirtualNetworkProfile(string id = default(string), string name = default(string), string type = default(string), string subnet = default(string)) + /// Initializes a new instance of VirtualNetworkProfile. + /// Resource id of the Virtual Network. + /// Name of the Virtual Network (read-only). + /// Resource type of the Virtual Network (read-only). + /// Subnet within the Virtual Network. + internal VirtualNetworkProfile(string id, string name, string type, string subnet) { Id = id; Name = name; Type = type; Subnet = subnet; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource id of the Virtual Network. - /// - [JsonProperty(PropertyName = "id")] + /// Resource id of the Virtual Network. public string Id { get; set; } - - /// - /// Gets name of the Virtual Network (read-only). - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets resource type of the Virtual Network (read-only). - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets or sets subnet within the Virtual Network. - /// - [JsonProperty(PropertyName = "subnet")] + /// Name of the Virtual Network (read-only). + public string Name { get; } + /// Resource type of the Virtual Network (read-only). + public string Type { get; } + /// Subnet within the Virtual Network. public string Subnet { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.Serialization.cs new file mode 100644 index 000000000000..4f40dff1d962 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.Serialization.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class VnetGateway : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(VnetName)) + { + writer.WritePropertyName("vnetName"); + writer.WriteStringValue(VnetName); + } + if (Optional.IsDefined(VpnPackageUri)) + { + writer.WritePropertyName("vpnPackageUri"); + writer.WriteStringValue(VpnPackageUri); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static VnetGateway DeserializeVnetGateway(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional vnetName = default; + Optional vpnPackageUri = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("vnetName")) + { + vnetName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vpnPackageUri")) + { + vpnPackageUri = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new VnetGateway(id.Value, name.Value, kind.Value, type.Value, vnetName.Value, vpnPackageUri.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.cs index f1e125c9e20d..545140e6af99 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.cs @@ -1,82 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The Virtual Network gateway contract. This is used to give the Virtual - /// Network gateway access to the VPN package. - /// - [Rest.Serialization.JsonTransformation] + /// The Virtual Network gateway contract. This is used to give the Virtual Network gateway access to the VPN package. public partial class VnetGateway : ProxyOnlyResource { - /// - /// Initializes a new instance of the VnetGateway class. - /// + /// Initializes a new instance of VnetGateway. public VnetGateway() { - CustomInit(); } - /// - /// Initializes a new instance of the VnetGateway class. - /// - /// The URI where the VPN package can be - /// downloaded. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Virtual Network name. - public VnetGateway(string vpnPackageUri, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string vnetName = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of VnetGateway. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Virtual Network name. + /// The URI where the VPN package can be downloaded. + internal VnetGateway(string id, string name, string kind, string type, string vnetName, string vpnPackageUri) : base(id, name, kind, type) { VnetName = vnetName; VpnPackageUri = vpnPackageUri; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Virtual Network name. - /// - [JsonProperty(PropertyName = "properties.vnetName")] + /// The Virtual Network name. public string VnetName { get; set; } - - /// - /// Gets or sets the URI where the VPN package can be downloaded. - /// - [JsonProperty(PropertyName = "properties.vpnPackageUri")] + /// The URI where the VPN package can be downloaded. public string VpnPackageUri { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (VpnPackageUri == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VpnPackageUri"); - } - } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.Serialization.cs new file mode 100644 index 000000000000..3b264f85c43e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class VnetInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(VnetResourceId)) + { + writer.WritePropertyName("vnetResourceId"); + writer.WriteStringValue(VnetResourceId); + } + if (Optional.IsDefined(CertBlob)) + { + writer.WritePropertyName("certBlob"); + writer.WriteStringValue(CertBlob); + } + if (Optional.IsDefined(DnsServers)) + { + writer.WritePropertyName("dnsServers"); + writer.WriteStringValue(DnsServers); + } + if (Optional.IsDefined(IsSwift)) + { + writer.WritePropertyName("isSwift"); + writer.WriteBooleanValue(IsSwift.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static VnetInfo DeserializeVnetInfo(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional vnetResourceId = default; + Optional certThumbprint = default; + Optional certBlob = default; + Optional> routes = default; + Optional resyncRequired = default; + Optional dnsServers = default; + Optional isSwift = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("vnetResourceId")) + { + vnetResourceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("certThumbprint")) + { + certThumbprint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("certBlob")) + { + certBlob = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("routes")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(VnetRoute.DeserializeVnetRoute(item)); + } + routes = array; + continue; + } + if (property0.NameEquals("resyncRequired")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + resyncRequired = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("dnsServers")) + { + dnsServers = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("isSwift")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isSwift = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + } + return new VnetInfo(id.Value, name.Value, kind.Value, type.Value, vnetResourceId.Value, certThumbprint.Value, certBlob.Value, Optional.ToList(routes), Optional.ToNullable(resyncRequired), dnsServers.Value, Optional.ToNullable(isSwift)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.cs index 9105621d291e..9f5a9bb20361 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.cs @@ -1,62 +1,40 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Virtual Network information contract. - /// - [Rest.Serialization.JsonTransformation] + /// Virtual Network information contract. public partial class VnetInfo : ProxyOnlyResource { - /// - /// Initializes a new instance of the VnetInfo class. - /// + /// Initializes a new instance of VnetInfo. public VnetInfo() { - CustomInit(); + Routes = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the VnetInfo class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Virtual Network's resource - /// ID. - /// The client certificate - /// thumbprint. - /// A certificate file (.cer) blob containing - /// the public key of the private key used to authenticate a - /// Point-To-Site VPN connection. - /// The routes that this Virtual Network - /// connection uses. - /// <code>true</code> if a - /// resync is required; otherwise, - /// <code>false</code>. - /// DNS servers to be used by this Virtual - /// Network. This should be a comma-separated list of IP - /// addresses. - /// Flag that is used to denote if this is VNET - /// injection - public VnetInfo(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string vnetResourceId = default(string), string certThumbprint = default(string), string certBlob = default(string), IList routes = default(IList), bool? resyncRequired = default(bool?), string dnsServers = default(string), bool? isSwift = default(bool?)) - : base(id, name, kind, type) + /// Initializes a new instance of VnetInfo. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Virtual Network's resource ID. + /// The client certificate thumbprint. + /// + /// A certificate file (.cer) blob containing the public key of the private key used to authenticate a + /// Point-To-Site VPN connection. + /// + /// The routes that this Virtual Network connection uses. + /// <code>true</code> if a resync is required; otherwise, <code>false</code>. + /// DNS servers to be used by this Virtual Network. This should be a comma-separated list of IP addresses. + /// Flag that is used to denote if this is VNET injection. + internal VnetInfo(string id, string name, string kind, string type, string vnetResourceId, string certThumbprint, string certBlob, IReadOnlyList routes, bool? resyncRequired, string dnsServers, bool? isSwift) : base(id, name, kind, type) { VnetResourceId = vnetResourceId; CertThumbprint = certThumbprint; @@ -65,60 +43,24 @@ public VnetInfo() ResyncRequired = resyncRequired; DnsServers = dnsServers; IsSwift = isSwift; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Virtual Network's resource ID. - /// - [JsonProperty(PropertyName = "properties.vnetResourceId")] + /// The Virtual Network's resource ID. public string VnetResourceId { get; set; } - + /// The client certificate thumbprint. + public string CertThumbprint { get; } /// - /// Gets the client certificate thumbprint. - /// - [JsonProperty(PropertyName = "properties.certThumbprint")] - public string CertThumbprint { get; private set; } - - /// - /// Gets or sets a certificate file (.cer) blob containing the public - /// key of the private key used to authenticate a + /// A certificate file (.cer) blob containing the public key of the private key used to authenticate a /// Point-To-Site VPN connection. /// - [JsonProperty(PropertyName = "properties.certBlob")] public string CertBlob { get; set; } - - /// - /// Gets the routes that this Virtual Network connection uses. - /// - [JsonProperty(PropertyName = "properties.routes")] - public IList Routes { get; private set; } - - /// - /// Gets &lt;code&gt;true&lt;/code&gt; if a resync is - /// required; otherwise, - /// &lt;code&gt;false&lt;/code&gt;. - /// - [JsonProperty(PropertyName = "properties.resyncRequired")] - public bool? ResyncRequired { get; private set; } - - /// - /// Gets or sets DNS servers to be used by this Virtual Network. This - /// should be a comma-separated list of IP addresses. - /// - [JsonProperty(PropertyName = "properties.dnsServers")] + /// The routes that this Virtual Network connection uses. + public IReadOnlyList Routes { get; } + /// <code>true</code> if a resync is required; otherwise, <code>false</code>. + public bool? ResyncRequired { get; } + /// DNS servers to be used by this Virtual Network. This should be a comma-separated list of IP addresses. public string DnsServers { get; set; } - - /// - /// Gets or sets flag that is used to denote if this is VNET injection - /// - [JsonProperty(PropertyName = "properties.isSwift")] + /// Flag that is used to denote if this is VNET injection. public bool? IsSwift { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.Serialization.cs new file mode 100644 index 000000000000..5176a968bd44 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class VnetParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(VnetResourceGroup)) + { + writer.WritePropertyName("vnetResourceGroup"); + writer.WriteStringValue(VnetResourceGroup); + } + if (Optional.IsDefined(VnetName)) + { + writer.WritePropertyName("vnetName"); + writer.WriteStringValue(VnetName); + } + if (Optional.IsDefined(VnetSubnetName)) + { + writer.WritePropertyName("vnetSubnetName"); + writer.WriteStringValue(VnetSubnetName); + } + if (Optional.IsDefined(SubnetResourceId)) + { + writer.WritePropertyName("subnetResourceId"); + writer.WriteStringValue(SubnetResourceId); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static VnetParameters DeserializeVnetParameters(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional vnetResourceGroup = default; + Optional vnetName = default; + Optional vnetSubnetName = default; + Optional subnetResourceId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("vnetResourceGroup")) + { + vnetResourceGroup = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vnetName")) + { + vnetName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vnetSubnetName")) + { + vnetSubnetName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("subnetResourceId")) + { + subnetResourceId = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new VnetParameters(id.Value, name.Value, kind.Value, type.Value, vnetResourceGroup.Value, vnetName.Value, vnetSubnetName.Value, subnetResourceId.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs index 0afb85613b5f..533ed01355a0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs @@ -1,77 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The required set of inputs to validate a VNET - /// - [Rest.Serialization.JsonTransformation] + /// The required set of inputs to validate a VNET. public partial class VnetParameters : ProxyOnlyResource { - /// - /// Initializes a new instance of the VnetParameters class. - /// + /// Initializes a new instance of VnetParameters. public VnetParameters() { - CustomInit(); } - /// - /// Initializes a new instance of the VnetParameters class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Resource Group of the VNET to - /// be validated - /// The name of the VNET to be validated - /// The subnet name to be - /// validated - public VnetParameters(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string vnetResourceGroup = default(string), string vnetName = default(string), string vnetSubnetName = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of VnetParameters. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Resource Group of the VNET to be validated. + /// The name of the VNET to be validated. + /// The subnet name to be validated. + /// The ARM Resource ID of the subnet to validate. + internal VnetParameters(string id, string name, string kind, string type, string vnetResourceGroup, string vnetName, string vnetSubnetName, string subnetResourceId) : base(id, name, kind, type) { VnetResourceGroup = vnetResourceGroup; VnetName = vnetName; VnetSubnetName = vnetSubnetName; - CustomInit(); + SubnetResourceId = subnetResourceId; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Resource Group of the VNET to be validated - /// - [JsonProperty(PropertyName = "properties.vnetResourceGroup")] + /// The Resource Group of the VNET to be validated. public string VnetResourceGroup { get; set; } - - /// - /// Gets or sets the name of the VNET to be validated - /// - [JsonProperty(PropertyName = "properties.vnetName")] + /// The name of the VNET to be validated. public string VnetName { get; set; } - - /// - /// Gets or sets the subnet name to be validated - /// - [JsonProperty(PropertyName = "properties.vnetSubnetName")] + /// The subnet name to be validated. public string VnetSubnetName { get; set; } - + /// The ARM Resource ID of the subnet to validate. + public string SubnetResourceId { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.Serialization.cs new file mode 100644 index 000000000000..fca082a7abca --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.Serialization.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class VnetRoute : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(StartAddress)) + { + writer.WritePropertyName("startAddress"); + writer.WriteStringValue(StartAddress); + } + if (Optional.IsDefined(EndAddress)) + { + writer.WritePropertyName("endAddress"); + writer.WriteStringValue(EndAddress); + } + if (Optional.IsDefined(RouteType)) + { + writer.WritePropertyName("routeType"); + writer.WriteStringValue(RouteType.Value.ToString()); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static VnetRoute DeserializeVnetRoute(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional startAddress = default; + Optional endAddress = default; + Optional routeType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("startAddress")) + { + startAddress = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("endAddress")) + { + endAddress = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("routeType")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + routeType = new RouteType(property0.Value.GetString()); + continue; + } + } + continue; + } + } + return new VnetRoute(id.Value, name.Value, kind.Value, type.Value, startAddress.Value, endAddress.Value, Optional.ToNullable(routeType)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.cs index 5d89d8ccbcf9..f5f09fc8a0a7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.cs @@ -1,99 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Virtual Network route contract used to pass routing information for a - /// Virtual Network. - /// - [Rest.Serialization.JsonTransformation] + /// Virtual Network route contract used to pass routing information for a Virtual Network. public partial class VnetRoute : ProxyOnlyResource { - /// - /// Initializes a new instance of the VnetRoute class. - /// + /// Initializes a new instance of VnetRoute. public VnetRoute() { - CustomInit(); } - /// - /// Initializes a new instance of the VnetRoute class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The starting address for this route. - /// This may also include a CIDR notation, in which case the end - /// address must not be specified. - /// The ending address for this route. If the - /// start address is specified in CIDR notation, this must be - /// omitted. - /// The type of route this is: - /// DEFAULT - By default, every app has routes to the local address - /// ranges specified by RFC1918 + /// Initializes a new instance of VnetRoute. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The starting address for this route. This may also include a CIDR notation, in which case the end address must not be specified. + /// The ending address for this route. If the start address is specified in CIDR notation, this must be omitted. + /// + /// The type of route this is: + /// DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 /// INHERITED - Routes inherited from the real Virtual Network routes /// STATIC - Static route set on the app only - /// - /// These values will be used for syncing an app's routes with those - /// from a Virtual Network. Possible values include: 'DEFAULT', - /// 'INHERITED', 'STATIC' - public VnetRoute(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string startAddress = default(string), string endAddress = default(string), string routeType = default(string)) - : base(id, name, kind, type) + /// + /// These values will be used for syncing an app's routes with those from a Virtual Network. + /// + internal VnetRoute(string id, string name, string kind, string type, string startAddress, string endAddress, RouteType? routeType) : base(id, name, kind, type) { StartAddress = startAddress; EndAddress = endAddress; RouteType = routeType; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the starting address for this route. This may also - /// include a CIDR notation, in which case the end address must not be - /// specified. - /// - [JsonProperty(PropertyName = "properties.startAddress")] + /// The starting address for this route. This may also include a CIDR notation, in which case the end address must not be specified. public string StartAddress { get; set; } - - /// - /// Gets or sets the ending address for this route. If the start - /// address is specified in CIDR notation, this must be omitted. - /// - [JsonProperty(PropertyName = "properties.endAddress")] + /// The ending address for this route. If the start address is specified in CIDR notation, this must be omitted. public string EndAddress { get; set; } - /// - /// Gets or sets the type of route this is: - /// DEFAULT - By default, every app has routes to the local address - /// ranges specified by RFC1918 + /// The type of route this is: + /// DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 /// INHERITED - Routes inherited from the real Virtual Network routes /// STATIC - Static route set on the app only - /// - /// These values will be used for syncing an app's routes with those - /// from a Virtual Network. Possible values include: 'DEFAULT', - /// 'INHERITED', 'STATIC' + /// + /// These values will be used for syncing an app's routes with those from a Virtual Network. /// - [JsonProperty(PropertyName = "properties.routeType")] - public string RouteType { get; set; } - + public RouteType? RouteType { get; set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.Serialization.cs new file mode 100644 index 000000000000..83200ae7fe3c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class VnetValidationFailureDetails : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"); + writer.WriteStringValue(Message); + } + if (Optional.IsDefined(Failed)) + { + writer.WritePropertyName("failed"); + writer.WriteBooleanValue(Failed.Value); + } + if (Optional.IsCollectionDefined(FailedTests)) + { + writer.WritePropertyName("failedTests"); + writer.WriteStartArray(); + foreach (var item in FailedTests) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static VnetValidationFailureDetails DeserializeVnetValidationFailureDetails(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional message = default; + Optional failed = default; + Optional> failedTests = default; + Optional> warnings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("message")) + { + message = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("failed")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + failed = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("failedTests")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(VnetValidationTestFailure.DeserializeVnetValidationTestFailure(item)); + } + failedTests = array; + continue; + } + if (property0.NameEquals("warnings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(VnetValidationTestFailure.DeserializeVnetValidationTestFailure(item)); + } + warnings = array; + continue; + } + } + continue; + } + } + return new VnetValidationFailureDetails(id.Value, name.Value, kind.Value, type.Value, message.Value, Optional.ToNullable(failed), Optional.ToList(failedTests), Optional.ToList(warnings)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs index f72ab080b2cf..dcb6234ff5b5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs @@ -1,73 +1,49 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A class that describes the reason for a validation failure. - /// - [Rest.Serialization.JsonTransformation] + /// A class that describes the reason for a validation failure. public partial class VnetValidationFailureDetails : ProxyOnlyResource { - /// - /// Initializes a new instance of the VnetValidationFailureDetails - /// class. - /// + /// Initializes a new instance of VnetValidationFailureDetails. public VnetValidationFailureDetails() { - CustomInit(); + FailedTests = new ChangeTrackingList(); + Warnings = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the VnetValidationFailureDetails - /// class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// A flag describing whether or not validation - /// failed. - /// A list of tests that failed in the - /// validation. - public VnetValidationFailureDetails(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? failed = default(bool?), IList failedTests = default(IList)) - : base(id, name, kind, type) + /// Initializes a new instance of VnetValidationFailureDetails. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Text describing the validation outcome. + /// A flag describing whether or not validation failed. + /// A list of tests that failed in the validation. + /// A list of warnings generated during validation. + internal VnetValidationFailureDetails(string id, string name, string kind, string type, string message, bool? failed, IList failedTests, IList warnings) : base(id, name, kind, type) { + Message = message; Failed = failed; FailedTests = failedTests; - CustomInit(); + Warnings = warnings; } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a flag describing whether or not validation failed. - /// - [JsonProperty(PropertyName = "properties.failed")] + /// Text describing the validation outcome. + public string Message { get; set; } + /// A flag describing whether or not validation failed. public bool? Failed { get; set; } - - /// - /// Gets or sets a list of tests that failed in the validation. - /// - [JsonProperty(PropertyName = "properties.failedTests")] - public IList FailedTests { get; set; } - + /// A list of tests that failed in the validation. + public IList FailedTests { get; } + /// A list of warnings generated during validation. + public IList Warnings { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.Serialization.cs new file mode 100644 index 000000000000..6ac4b9925a91 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.Serialization.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class VnetValidationTestFailure : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(TestName)) + { + writer.WritePropertyName("testName"); + writer.WriteStringValue(TestName); + } + if (Optional.IsDefined(Details)) + { + writer.WritePropertyName("details"); + writer.WriteStringValue(Details); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static VnetValidationTestFailure DeserializeVnetValidationTestFailure(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional testName = default; + Optional details = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("testName")) + { + testName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("details")) + { + details = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new VnetValidationTestFailure(id.Value, name.Value, kind.Value, type.Value, testName.Value, details.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.cs index b0c504e4ebd9..d2f0febba963 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.cs @@ -1,70 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A class that describes a test that failed during NSG and UDR - /// validation. - /// - [Rest.Serialization.JsonTransformation] + /// A class that describes a test that failed during NSG and UDR validation. public partial class VnetValidationTestFailure : ProxyOnlyResource { - /// - /// Initializes a new instance of the VnetValidationTestFailure class. - /// + /// Initializes a new instance of VnetValidationTestFailure. public VnetValidationTestFailure() { - CustomInit(); } - /// - /// Initializes a new instance of the VnetValidationTestFailure class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The name of the test that failed. - /// The details of what caused the failure, e.g. - /// the blocking rule name, etc. - public VnetValidationTestFailure(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string testName = default(string), string details = default(string)) - : base(id, name, kind, type) + /// Initializes a new instance of VnetValidationTestFailure. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The name of the test that failed. + /// The details of what caused the failure, e.g. the blocking rule name, etc. + internal VnetValidationTestFailure(string id, string name, string kind, string type, string testName, string details) : base(id, name, kind, type) { TestName = testName; Details = details; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the test that failed. - /// - [JsonProperty(PropertyName = "properties.testName")] + /// The name of the test that failed. public string TestName { get; set; } - - /// - /// Gets or sets the details of what caused the failure, e.g. the - /// blocking rule name, etc. - /// - [JsonProperty(PropertyName = "properties.details")] + /// The details of what caused the failure, e.g. the blocking rule name, etc. public string Details { get; set; } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.Serialization.cs new file mode 100644 index 000000000000..6c8a5c116afc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class WebAppCollection + { + internal static WebAppCollection DeserializeWebAppCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Site.DeserializeSite(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new WebAppCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.cs new file mode 100644 index 000000000000..19b30d87c18e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of App Service apps. + internal partial class WebAppCollection + { + /// Initializes a new instance of WebAppCollection. + /// Collection of resources. + /// is null. + internal WebAppCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of WebAppCollection. + /// Collection of resources. + /// Link to next page of resources. + internal WebAppCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.Serialization.cs new file mode 100644 index 000000000000..0fb1bd6c0435 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class WebAppInstanceStatusCollection + { + internal static WebAppInstanceStatusCollection DeserializeWebAppInstanceStatusCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebSiteInstanceStatus.DeserializeWebSiteInstanceStatus(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new WebAppInstanceStatusCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.cs new file mode 100644 index 000000000000..a774393b9ea0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of app instances. + internal partial class WebAppInstanceStatusCollection + { + /// Initializes a new instance of WebAppInstanceStatusCollection. + /// Collection of resources. + /// is null. + internal WebAppInstanceStatusCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of WebAppInstanceStatusCollection. + /// Collection of resources. + /// Link to next page of resources. + internal WebAppInstanceStatusCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.Serialization.cs new file mode 100644 index 000000000000..66bddc2cd981 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class WebAppMajorVersion + { + internal static WebAppMajorVersion DeserializeWebAppMajorVersion(JsonElement element) + { + Optional displayText = default; + Optional value = default; + Optional> minorVersions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayText")) + { + displayText = property.Value.GetString(); + continue; + } + if (property.NameEquals("value")) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("minorVersions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebAppMinorVersion.DeserializeWebAppMinorVersion(item)); + } + minorVersions = array; + continue; + } + } + return new WebAppMajorVersion(displayText.Value, value.Value, Optional.ToList(minorVersions)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs new file mode 100644 index 000000000000..e0d0fdbef4a9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Web App stack major version. + public partial class WebAppMajorVersion + { + /// Initializes a new instance of WebAppMajorVersion. + internal WebAppMajorVersion() + { + MinorVersions = new ChangeTrackingList(); + } + + /// Initializes a new instance of WebAppMajorVersion. + /// Web App stack major version (display only). + /// Web App stack major version name. + /// Minor versions associated with the major version. + internal WebAppMajorVersion(string displayText, string value, IReadOnlyList minorVersions) + { + DisplayText = displayText; + Value = value; + MinorVersions = minorVersions; + } + + /// Web App stack major version (display only). + public string DisplayText { get; } + /// Web App stack major version name. + public string Value { get; } + /// Minor versions associated with the major version. + public IReadOnlyList MinorVersions { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.Serialization.cs new file mode 100644 index 000000000000..3cafbee51d13 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class WebAppMinorVersion + { + internal static WebAppMinorVersion DeserializeWebAppMinorVersion(JsonElement element) + { + Optional displayText = default; + Optional value = default; + Optional stackSettings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayText")) + { + displayText = property.Value.GetString(); + continue; + } + if (property.NameEquals("value")) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("stackSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + stackSettings = WebAppRuntimes.DeserializeWebAppRuntimes(property.Value); + continue; + } + } + return new WebAppMinorVersion(displayText.Value, value.Value, stackSettings.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs new file mode 100644 index 000000000000..24e0678d7351 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Web App stack minor version. + public partial class WebAppMinorVersion + { + /// Initializes a new instance of WebAppMinorVersion. + internal WebAppMinorVersion() + { + } + + /// Initializes a new instance of WebAppMinorVersion. + /// Web App stack minor version (display only). + /// Web App stack major version name. + /// Settings associated with the minor version. + internal WebAppMinorVersion(string displayText, string value, WebAppRuntimes stackSettings) + { + DisplayText = displayText; + Value = value; + StackSettings = stackSettings; + } + + /// Web App stack minor version (display only). + public string DisplayText { get; } + /// Web App stack major version name. + public string Value { get; } + /// Settings associated with the minor version. + public WebAppRuntimes StackSettings { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.Serialization.cs new file mode 100644 index 000000000000..9baa7b2b1318 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class WebAppRuntimeSettings + { + internal static WebAppRuntimeSettings DeserializeWebAppRuntimeSettings(JsonElement element) + { + Optional runtimeVersion = default; + Optional remoteDebuggingSupported = default; + Optional appInsightsSettings = default; + Optional gitHubActionSettings = default; + Optional isPreview = default; + Optional isDeprecated = default; + Optional isHidden = default; + Optional endOfLifeDate = default; + Optional isAutoUpdate = default; + Optional isEarlyAccess = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("runtimeVersion")) + { + runtimeVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("remoteDebuggingSupported")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + remoteDebuggingSupported = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("appInsightsSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + appInsightsSettings = AppInsightsWebAppStackSettings.DeserializeAppInsightsWebAppStackSettings(property.Value); + continue; + } + if (property.NameEquals("gitHubActionSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + gitHubActionSettings = GitHubActionWebAppStackSettings.DeserializeGitHubActionWebAppStackSettings(property.Value); + continue; + } + if (property.NameEquals("isPreview")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isPreview = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isDeprecated")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isDeprecated = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isHidden")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isHidden = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("endOfLifeDate")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + endOfLifeDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isAutoUpdate")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isAutoUpdate = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isEarlyAccess")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isEarlyAccess = property.Value.GetBoolean(); + continue; + } + } + return new WebAppRuntimeSettings(runtimeVersion.Value, Optional.ToNullable(remoteDebuggingSupported), appInsightsSettings.Value, gitHubActionSettings.Value, Optional.ToNullable(isPreview), Optional.ToNullable(isDeprecated), Optional.ToNullable(isHidden), Optional.ToNullable(endOfLifeDate), Optional.ToNullable(isAutoUpdate), Optional.ToNullable(isEarlyAccess)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs new file mode 100644 index 000000000000..55932dbe9e46 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Web App runtime settings. + public partial class WebAppRuntimeSettings + { + /// Initializes a new instance of WebAppRuntimeSettings. + internal WebAppRuntimeSettings() + { + } + + /// Initializes a new instance of WebAppRuntimeSettings. + /// Web App stack minor version (runtime only). + /// <code>true</code> if remote debugging is supported for the stack; otherwise, <code>false</code>. + /// Application Insights settings associated with the minor version. + /// GitHub Actions settings associated with the minor version. + /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. + /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. + /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. + /// End-of-life date for the minor version. + /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. + /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. + internal WebAppRuntimeSettings(string runtimeVersion, bool? remoteDebuggingSupported, AppInsightsWebAppStackSettings appInsightsSettings, GitHubActionWebAppStackSettings gitHubActionSettings, bool? isPreview, bool? isDeprecated, bool? isHidden, DateTimeOffset? endOfLifeDate, bool? isAutoUpdate, bool? isEarlyAccess) + { + RuntimeVersion = runtimeVersion; + RemoteDebuggingSupported = remoteDebuggingSupported; + AppInsightsSettings = appInsightsSettings; + GitHubActionSettings = gitHubActionSettings; + IsPreview = isPreview; + IsDeprecated = isDeprecated; + IsHidden = isHidden; + EndOfLifeDate = endOfLifeDate; + IsAutoUpdate = isAutoUpdate; + IsEarlyAccess = isEarlyAccess; + } + + /// Web App stack minor version (runtime only). + public string RuntimeVersion { get; } + /// <code>true</code> if remote debugging is supported for the stack; otherwise, <code>false</code>. + public bool? RemoteDebuggingSupported { get; } + /// Application Insights settings associated with the minor version. + public AppInsightsWebAppStackSettings AppInsightsSettings { get; } + /// GitHub Actions settings associated with the minor version. + public GitHubActionWebAppStackSettings GitHubActionSettings { get; } + /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. + public bool? IsPreview { get; } + /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. + public bool? IsDeprecated { get; } + /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. + public bool? IsHidden { get; } + /// End-of-life date for the minor version. + public DateTimeOffset? EndOfLifeDate { get; } + /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. + public bool? IsAutoUpdate { get; } + /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. + public bool? IsEarlyAccess { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.Serialization.cs new file mode 100644 index 000000000000..b938ebb848e7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.Serialization.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class WebAppRuntimes + { + internal static WebAppRuntimes DeserializeWebAppRuntimes(JsonElement element) + { + Optional linuxRuntimeSettings = default; + Optional windowsRuntimeSettings = default; + Optional linuxContainerSettings = default; + Optional windowsContainerSettings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("linuxRuntimeSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + linuxRuntimeSettings = WebAppRuntimeSettings.DeserializeWebAppRuntimeSettings(property.Value); + continue; + } + if (property.NameEquals("windowsRuntimeSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + windowsRuntimeSettings = WebAppRuntimeSettings.DeserializeWebAppRuntimeSettings(property.Value); + continue; + } + if (property.NameEquals("linuxContainerSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + linuxContainerSettings = LinuxJavaContainerSettings.DeserializeLinuxJavaContainerSettings(property.Value); + continue; + } + if (property.NameEquals("windowsContainerSettings")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + windowsContainerSettings = WindowsJavaContainerSettings.DeserializeWindowsJavaContainerSettings(property.Value); + continue; + } + } + return new WebAppRuntimes(linuxRuntimeSettings.Value, windowsRuntimeSettings.Value, linuxContainerSettings.Value, windowsContainerSettings.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs new file mode 100644 index 000000000000..63754660a688 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Web App stack runtimes. + public partial class WebAppRuntimes + { + /// Initializes a new instance of WebAppRuntimes. + internal WebAppRuntimes() + { + } + + /// Initializes a new instance of WebAppRuntimes. + /// Linux-specific settings associated with the minor version. + /// Windows-specific settings associated with the minor version. + /// Linux-specific settings associated with the Java container minor version. + /// Windows-specific settings associated with the Java container minor version. + internal WebAppRuntimes(WebAppRuntimeSettings linuxRuntimeSettings, WebAppRuntimeSettings windowsRuntimeSettings, LinuxJavaContainerSettings linuxContainerSettings, WindowsJavaContainerSettings windowsContainerSettings) + { + LinuxRuntimeSettings = linuxRuntimeSettings; + WindowsRuntimeSettings = windowsRuntimeSettings; + LinuxContainerSettings = linuxContainerSettings; + WindowsContainerSettings = windowsContainerSettings; + } + + /// Linux-specific settings associated with the minor version. + public WebAppRuntimeSettings LinuxRuntimeSettings { get; } + /// Windows-specific settings associated with the minor version. + public WebAppRuntimeSettings WindowsRuntimeSettings { get; } + /// Linux-specific settings associated with the Java container minor version. + public LinuxJavaContainerSettings LinuxContainerSettings { get; } + /// Windows-specific settings associated with the Java container minor version. + public WindowsJavaContainerSettings WindowsContainerSettings { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.Serialization.cs new file mode 100644 index 000000000000..fbe195f9d49b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class WebAppStack : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static WebAppStack DeserializeWebAppStack(JsonElement element) + { + Optional location = default; + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional displayText = default; + Optional value = default; + Optional> majorVersions = default; + Optional preferredOs = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("displayText")) + { + displayText = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("value")) + { + value = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("majorVersions")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(WebAppMajorVersion.DeserializeWebAppMajorVersion(item)); + } + majorVersions = array; + continue; + } + if (property0.NameEquals("preferredOs")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + preferredOs = property0.Value.GetString().ToStackPreferredOs(); + continue; + } + } + continue; + } + } + return new WebAppStack(id.Value, name.Value, kind.Value, type.Value, location.Value, displayText.Value, value.Value, Optional.ToList(majorVersions), Optional.ToNullable(preferredOs)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs new file mode 100644 index 000000000000..09d5925e0ae1 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Web App stack. + public partial class WebAppStack : ProxyOnlyResource + { + /// Initializes a new instance of WebAppStack. + public WebAppStack() + { + MajorVersions = new ChangeTrackingList(); + } + + /// Initializes a new instance of WebAppStack. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Web App stack location. + /// Web App stack (display only). + /// Web App stack name. + /// List of major versions available. + /// Web App stack preferred OS. + internal WebAppStack(string id, string name, string kind, string type, string location, string displayText, string value, IReadOnlyList majorVersions, StackPreferredOs? preferredOs) : base(id, name, kind, type) + { + Location = location; + DisplayText = displayText; + Value = value; + MajorVersions = majorVersions; + PreferredOs = preferredOs; + } + + /// Web App stack location. + public string Location { get; } + /// Web App stack (display only). + public string DisplayText { get; } + /// Web App stack name. + public string Value { get; } + /// List of major versions available. + public IReadOnlyList MajorVersions { get; } + /// Web App stack preferred OS. + public StackPreferredOs? PreferredOs { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.Serialization.cs new file mode 100644 index 000000000000..0a1394e999d6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class WebAppStackCollection + { + internal static WebAppStackCollection DeserializeWebAppStackCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebAppStack.DeserializeWebAppStack(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new WebAppStackCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.cs new file mode 100644 index 000000000000..afb062d40534 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Web app Stacks. + internal partial class WebAppStackCollection + { + /// Initializes a new instance of WebAppStackCollection. + /// Collection of resources. + /// is null. + internal WebAppStackCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of WebAppStackCollection. + /// Collection of resources. + /// Link to next page of resources. + internal WebAppStackCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.Serialization.cs new file mode 100644 index 000000000000..f5032cea715b --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class WebJob : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(RunCommand)) + { + writer.WritePropertyName("run_command"); + writer.WriteStringValue(RunCommand); + } + if (Optional.IsDefined(Url)) + { + writer.WritePropertyName("url"); + writer.WriteStringValue(Url); + } + if (Optional.IsDefined(ExtraInfoUrl)) + { + writer.WritePropertyName("extra_info_url"); + writer.WriteStringValue(ExtraInfoUrl); + } + if (Optional.IsDefined(WebJobType)) + { + writer.WritePropertyName("web_job_type"); + writer.WriteStringValue(WebJobType.Value.ToSerialString()); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(UsingSdk)) + { + writer.WritePropertyName("using_sdk"); + writer.WriteBooleanValue(UsingSdk.Value); + } + if (Optional.IsCollectionDefined(Settings)) + { + writer.WritePropertyName("settings"); + writer.WriteStartObject(); + foreach (var item in Settings) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static WebJob DeserializeWebJob(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional runCommand = default; + Optional url = default; + Optional extraInfoUrl = default; + Optional webJobType = default; + Optional error = default; + Optional usingSdk = default; + Optional> settings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("run_command")) + { + runCommand = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("url")) + { + url = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("extra_info_url")) + { + extraInfoUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("web_job_type")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + webJobType = property0.Value.GetString().ToWebJobType(); + continue; + } + if (property0.NameEquals("error")) + { + error = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("using_sdk")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + usingSdk = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("settings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetObject()); + } + settings = dictionary; + continue; + } + } + continue; + } + } + return new WebJob(id.Value, name.Value, kind.Value, type.Value, runCommand.Value, url.Value, extraInfoUrl.Value, Optional.ToNullable(webJobType), error.Value, Optional.ToNullable(usingSdk), Optional.ToDictionary(settings)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.cs index 588aa9240332..0b90766b1def 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.cs @@ -1,53 +1,37 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Web Job Information. - /// - [Rest.Serialization.JsonTransformation] + /// Web Job Information. public partial class WebJob : ProxyOnlyResource { - /// - /// Initializes a new instance of the WebJob class. - /// + /// Initializes a new instance of WebJob. public WebJob() { - CustomInit(); + Settings = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the WebJob class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Run command. - /// Job URL. - /// Extra Info URL. - /// Job type. Possible values include: - /// 'Continuous', 'Triggered' - /// Error information. - /// Using SDK? - /// Job settings. - public WebJob(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string runCommand = default(string), string url = default(string), string extraInfoUrl = default(string), WebJobType? webJobType = default(WebJobType?), string error = default(string), bool? usingSdk = default(bool?), IDictionary settings = default(IDictionary)) - : base(id, name, kind, type) + /// Initializes a new instance of WebJob. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Run command. + /// Job URL. + /// Extra Info URL. + /// Job type. + /// Error information. + /// Using SDK?. + /// Job settings. + internal WebJob(string id, string name, string kind, string type, string runCommand, string url, string extraInfoUrl, WebJobType? webJobType, string error, bool? usingSdk, IDictionary settings) : base(id, name, kind, type) { RunCommand = runCommand; Url = url; @@ -56,56 +40,21 @@ public WebJob() Error = error; UsingSdk = usingSdk; Settings = settings; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets run command. - /// - [JsonProperty(PropertyName = "properties.run_command")] + /// Run command. public string RunCommand { get; set; } - - /// - /// Gets or sets job URL. - /// - [JsonProperty(PropertyName = "properties.url")] + /// Job URL. public string Url { get; set; } - - /// - /// Gets or sets extra Info URL. - /// - [JsonProperty(PropertyName = "properties.extra_info_url")] + /// Extra Info URL. public string ExtraInfoUrl { get; set; } - - /// - /// Gets or sets job type. Possible values include: 'Continuous', - /// 'Triggered' - /// - [JsonProperty(PropertyName = "properties.web_job_type")] + /// Job type. public WebJobType? WebJobType { get; set; } - - /// - /// Gets or sets error information. - /// - [JsonProperty(PropertyName = "properties.error")] + /// Error information. public string Error { get; set; } - - /// - /// Gets or sets using SDK? - /// - [JsonProperty(PropertyName = "properties.using_sdk")] + /// Using SDK?. public bool? UsingSdk { get; set; } - - /// - /// Gets or sets job settings. - /// - [JsonProperty(PropertyName = "properties.settings")] - public IDictionary Settings { get; set; } - + /// Job settings. + public IDictionary Settings { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.Serialization.cs new file mode 100644 index 000000000000..766f0f6d6332 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class WebJobCollection + { + internal static WebJobCollection DeserializeWebJobCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebJob.DeserializeWebJob(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new WebJobCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.cs new file mode 100644 index 000000000000..4653eb18e865 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of Kudu web job information elements. + internal partial class WebJobCollection + { + /// Initializes a new instance of WebJobCollection. + /// Collection of resources. + /// is null. + internal WebJobCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of WebJobCollection. + /// Collection of resources. + /// Link to next page of resources. + internal WebJobCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.Serialization.cs new file mode 100644 index 000000000000..21cedd3a17df --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class WebJobTypeExtensions + { + public static string ToSerialString(this WebJobType value) => value switch + { + WebJobType.Continuous => "Continuous", + WebJobType.Triggered => "Triggered", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown WebJobType value.") + }; + + public static WebJobType ToWebJobType(this string value) + { + if (string.Equals(value, "Continuous", StringComparison.InvariantCultureIgnoreCase)) return WebJobType.Continuous; + if (string.Equals(value, "Triggered", StringComparison.InvariantCultureIgnoreCase)) return WebJobType.Triggered; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown WebJobType value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.cs index e8520fd920fe..018b1dd03102 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.cs @@ -1,60 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for WebJobType. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Job type. public enum WebJobType { - [EnumMember(Value = "Continuous")] + /// Continuous. Continuous, - [EnumMember(Value = "Triggered")] + /// Triggered. Triggered } - internal static class WebJobTypeEnumExtension - { - internal static string ToSerializedValue(this WebJobType? value) - { - return value == null ? null : ((WebJobType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this WebJobType value) - { - switch( value ) - { - case WebJobType.Continuous: - return "Continuous"; - case WebJobType.Triggered: - return "Triggered"; - } - return null; - } - - internal static WebJobType? ParseWebJobType(this string value) - { - switch( value ) - { - case "Continuous": - return WebJobType.Continuous; - case "Triggered": - return WebJobType.Triggered; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.Serialization.cs new file mode 100644 index 000000000000..8215032581fe --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.Serialization.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class WebSiteInstanceStatus : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"); + writer.WriteStringValue(State.Value.ToSerialString()); + } + if (Optional.IsDefined(StatusUrl)) + { + writer.WritePropertyName("statusUrl"); + writer.WriteStringValue(StatusUrl); + } + if (Optional.IsDefined(DetectorUrl)) + { + writer.WritePropertyName("detectorUrl"); + writer.WriteStringValue(DetectorUrl); + } + if (Optional.IsDefined(ConsoleUrl)) + { + writer.WritePropertyName("consoleUrl"); + writer.WriteStringValue(ConsoleUrl); + } + if (Optional.IsDefined(HealthCheckUrl)) + { + writer.WritePropertyName("healthCheckUrl"); + writer.WriteStringValue(HealthCheckUrl); + } + if (Optional.IsCollectionDefined(Containers)) + { + writer.WritePropertyName("containers"); + writer.WriteStartObject(); + foreach (var item in Containers) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static WebSiteInstanceStatus DeserializeWebSiteInstanceStatus(JsonElement element) + { + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional state = default; + Optional statusUrl = default; + Optional detectorUrl = default; + Optional consoleUrl = default; + Optional healthCheckUrl = default; + Optional> containers = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("state")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + state = property0.Value.GetString().ToSiteRuntimeState(); + continue; + } + if (property0.NameEquals("statusUrl")) + { + statusUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("detectorUrl")) + { + detectorUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("consoleUrl")) + { + consoleUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("healthCheckUrl")) + { + healthCheckUrl = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("containers")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, ContainerInfo.DeserializeContainerInfo(property1.Value)); + } + containers = dictionary; + continue; + } + } + continue; + } + } + return new WebSiteInstanceStatus(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(state), statusUrl.Value, detectorUrl.Value, consoleUrl.Value, healthCheckUrl.Value, Optional.ToDictionary(containers)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.cs index c9e91df2ae59..6b0a7b965842 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.cs @@ -1,51 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - [Rest.Serialization.JsonTransformation] + /// The WebSiteInstanceStatus. public partial class WebSiteInstanceStatus : ProxyOnlyResource { - /// - /// Initializes a new instance of the WebSiteInstanceStatus class. - /// + /// Initializes a new instance of WebSiteInstanceStatus. public WebSiteInstanceStatus() { - CustomInit(); + Containers = new ChangeTrackingDictionary(); } - /// - /// Initializes a new instance of the WebSiteInstanceStatus class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Possible values include: 'READY', 'STOPPED', - /// 'UNKNOWN' - /// Link to the GetStatusApi in Kudu - /// Link to the Diagnose and Solve - /// Portal - /// Link to the console to web app - /// instance - /// Link to the console to web app - /// instance - public WebSiteInstanceStatus(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), SiteRuntimeState? state = default(SiteRuntimeState?), string statusUrl = default(string), string detectorUrl = default(string), string consoleUrl = default(string), string healthCheckUrl = default(string), IDictionary containers = default(IDictionary)) - : base(id, name, kind, type) + /// Initializes a new instance of WebSiteInstanceStatus. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// . + /// Link to the GetStatusApi in Kudu. + /// Link to the Diagnose and Solve Portal. + /// Link to the console to web app instance. + /// Link to the console to web app instance. + /// Dictionary of <ContainerInfo>. + internal WebSiteInstanceStatus(string id, string name, string kind, string type, SiteRuntimeState? state, string statusUrl, string detectorUrl, string consoleUrl, string healthCheckUrl, IDictionary containers) : base(id, name, kind, type) { State = state; StatusUrl = statusUrl; @@ -53,48 +38,18 @@ public WebSiteInstanceStatus() ConsoleUrl = consoleUrl; HealthCheckUrl = healthCheckUrl; Containers = containers; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets possible values include: 'READY', 'STOPPED', 'UNKNOWN' - /// - [JsonProperty(PropertyName = "properties.state")] public SiteRuntimeState? State { get; set; } - - /// - /// Gets or sets link to the GetStatusApi in Kudu - /// - [JsonProperty(PropertyName = "properties.statusUrl")] + /// Link to the GetStatusApi in Kudu. public string StatusUrl { get; set; } - - /// - /// Gets or sets link to the Diagnose and Solve Portal - /// - [JsonProperty(PropertyName = "properties.detectorUrl")] + /// Link to the Diagnose and Solve Portal. public string DetectorUrl { get; set; } - - /// - /// Gets or sets link to the console to web app instance - /// - [JsonProperty(PropertyName = "properties.consoleUrl")] + /// Link to the console to web app instance. public string ConsoleUrl { get; set; } - - /// - /// Gets or sets link to the console to web app instance - /// - [JsonProperty(PropertyName = "properties.healthCheckUrl")] + /// Link to the console to web app instance. public string HealthCheckUrl { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.containers")] - public IDictionary Containers { get; set; } - + /// Dictionary of <ContainerInfo>. + public IDictionary Containers { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.Serialization.cs new file mode 100644 index 000000000000..2a97024f1110 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.Serialization.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class WindowsJavaContainerSettings + { + internal static WindowsJavaContainerSettings DeserializeWindowsJavaContainerSettings(JsonElement element) + { + Optional javaContainer = default; + Optional javaContainerVersion = default; + Optional isPreview = default; + Optional isDeprecated = default; + Optional isHidden = default; + Optional endOfLifeDate = default; + Optional isAutoUpdate = default; + Optional isEarlyAccess = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("javaContainer")) + { + javaContainer = property.Value.GetString(); + continue; + } + if (property.NameEquals("javaContainerVersion")) + { + javaContainerVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("isPreview")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isPreview = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isDeprecated")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isDeprecated = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isHidden")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isHidden = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("endOfLifeDate")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + endOfLifeDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isAutoUpdate")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isAutoUpdate = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isEarlyAccess")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isEarlyAccess = property.Value.GetBoolean(); + continue; + } + } + return new WindowsJavaContainerSettings(javaContainer.Value, javaContainerVersion.Value, Optional.ToNullable(isPreview), Optional.ToNullable(isDeprecated), Optional.ToNullable(isHidden), Optional.ToNullable(endOfLifeDate), Optional.ToNullable(isAutoUpdate), Optional.ToNullable(isEarlyAccess)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs new file mode 100644 index 000000000000..f3f61c18520d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Windows Java Container settings. + public partial class WindowsJavaContainerSettings + { + /// Initializes a new instance of WindowsJavaContainerSettings. + internal WindowsJavaContainerSettings() + { + } + + /// Initializes a new instance of WindowsJavaContainerSettings. + /// Java container (runtime only). + /// Java container version (runtime only). + /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. + /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. + /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. + /// End-of-life date for the minor version. + /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. + /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. + internal WindowsJavaContainerSettings(string javaContainer, string javaContainerVersion, bool? isPreview, bool? isDeprecated, bool? isHidden, DateTimeOffset? endOfLifeDate, bool? isAutoUpdate, bool? isEarlyAccess) + { + JavaContainer = javaContainer; + JavaContainerVersion = javaContainerVersion; + IsPreview = isPreview; + IsDeprecated = isDeprecated; + IsHidden = isHidden; + EndOfLifeDate = endOfLifeDate; + IsAutoUpdate = isAutoUpdate; + IsEarlyAccess = isEarlyAccess; + } + + /// Java container (runtime only). + public string JavaContainer { get; } + /// Java container version (runtime only). + public string JavaContainerVersion { get; } + /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. + public bool? IsPreview { get; } + /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. + public bool? IsDeprecated { get; } + /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. + public bool? IsHidden { get; } + /// End-of-life date for the minor version. + public DateTimeOffset? EndOfLifeDate { get; } + /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. + public bool? IsAutoUpdate { get; } + /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. + public bool? IsEarlyAccess { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.Serialization.cs new file mode 100644 index 000000000000..78b359c49039 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal partial class WorkerPoolCollection + { + internal static WorkerPoolCollection DeserializeWorkerPoolCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WorkerPoolResource.DeserializeWorkerPoolResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new WorkerPoolCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.cs new file mode 100644 index 000000000000..8bbef56fbdf5 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + /// Collection of worker pools. + internal partial class WorkerPoolCollection + { + /// Initializes a new instance of WorkerPoolCollection. + /// Collection of resources. + /// is null. + internal WorkerPoolCollection(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of WorkerPoolCollection. + /// Collection of resources. + /// Link to next page of resources. + internal WorkerPoolCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.Serialization.cs new file mode 100644 index 000000000000..d8307eb5bcc6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + public partial class WorkerPoolResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"); + writer.WriteObjectValue(Sku); + } + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(WorkerSizeId)) + { + writer.WritePropertyName("workerSizeId"); + writer.WriteNumberValue(WorkerSizeId.Value); + } + if (Optional.IsDefined(ComputeMode)) + { + writer.WritePropertyName("computeMode"); + writer.WriteStringValue(ComputeMode.Value.ToSerialString()); + } + if (Optional.IsDefined(WorkerSize)) + { + writer.WritePropertyName("workerSize"); + writer.WriteStringValue(WorkerSize); + } + if (Optional.IsDefined(WorkerCount)) + { + writer.WritePropertyName("workerCount"); + writer.WriteNumberValue(WorkerCount.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static WorkerPoolResource DeserializeWorkerPoolResource(JsonElement element) + { + Optional sku = default; + Optional id = default; + Optional name = default; + Optional kind = default; + Optional type = default; + Optional workerSizeId = default; + Optional computeMode = default; + Optional workerSize = default; + Optional workerCount = default; + Optional> instanceNames = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sku")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + sku = SkuDescription.DeserializeSkuDescription(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind")) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("workerSizeId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + workerSizeId = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("computeMode")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + computeMode = property0.Value.GetString().ToComputeModeOptions(); + continue; + } + if (property0.NameEquals("workerSize")) + { + workerSize = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("workerCount")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + workerCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("instanceNames")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + instanceNames = array; + continue; + } + } + continue; + } + } + return new WorkerPoolResource(id.Value, name.Value, kind.Value, type.Value, sku.Value, Optional.ToNullable(workerSizeId), Optional.ToNullable(computeMode), workerSize.Value, Optional.ToNullable(workerCount), Optional.ToList(instanceNames)); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.cs index 1fc210ba63f6..5d9de4d88cfb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.cs @@ -1,105 +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. -// +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; namespace Microsoft.Azure.Management.WebSites.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Worker pool of an App Service Environment ARM resource. - /// - [Rest.Serialization.JsonTransformation] + /// Worker pool of an App Service Environment ARM resource. public partial class WorkerPoolResource : ProxyOnlyResource { - /// - /// Initializes a new instance of the WorkerPoolResource class. - /// + /// Initializes a new instance of WorkerPoolResource. public WorkerPoolResource() { - CustomInit(); + InstanceNames = new ChangeTrackingList(); } - /// - /// Initializes a new instance of the WorkerPoolResource class. - /// - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Worker size ID for referencing this - /// worker pool. - /// Shared or dedicated app hosting. Possible - /// values include: 'Shared', 'Dedicated', 'Dynamic' - /// VM size of the worker pool - /// instances. - /// Number of instances in the worker - /// pool. - /// Names of all instances in the worker - /// pool (read only). - public WorkerPoolResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? workerSizeId = default(int?), ComputeModeOptions? computeMode = default(ComputeModeOptions?), string workerSize = default(string), int? workerCount = default(int?), IList instanceNames = default(IList), SkuDescription sku = default(SkuDescription)) - : base(id, name, kind, type) + /// Initializes a new instance of WorkerPoolResource. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Description of a SKU for a scalable resource. + /// Worker size ID for referencing this worker pool. + /// Shared or dedicated app hosting. + /// VM size of the worker pool instances. + /// Number of instances in the worker pool. + /// Names of all instances in the worker pool (read only). + internal WorkerPoolResource(string id, string name, string kind, string type, SkuDescription sku, int? workerSizeId, ComputeModeOptions? computeMode, string workerSize, int? workerCount, IReadOnlyList instanceNames) : base(id, name, kind, type) { + Sku = sku; WorkerSizeId = workerSizeId; ComputeMode = computeMode; WorkerSize = workerSize; WorkerCount = workerCount; InstanceNames = instanceNames; - Sku = sku; - CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets worker size ID for referencing this worker pool. - /// - [JsonProperty(PropertyName = "properties.workerSizeId")] + /// Description of a SKU for a scalable resource. + public SkuDescription Sku { get; set; } + /// Worker size ID for referencing this worker pool. public int? WorkerSizeId { get; set; } - - /// - /// Gets or sets shared or dedicated app hosting. Possible values - /// include: 'Shared', 'Dedicated', 'Dynamic' - /// - [JsonProperty(PropertyName = "properties.computeMode")] + /// Shared or dedicated app hosting. public ComputeModeOptions? ComputeMode { get; set; } - - /// - /// Gets or sets VM size of the worker pool instances. - /// - [JsonProperty(PropertyName = "properties.workerSize")] + /// VM size of the worker pool instances. public string WorkerSize { get; set; } - - /// - /// Gets or sets number of instances in the worker pool. - /// - [JsonProperty(PropertyName = "properties.workerCount")] + /// Number of instances in the worker pool. public int? WorkerCount { get; set; } - - /// - /// Gets names of all instances in the worker pool (read only). - /// - [JsonProperty(PropertyName = "properties.instanceNames")] - public IList InstanceNames { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "sku")] - public SkuDescription Sku { get; set; } - + /// Names of all instances in the worker pool (read only). + public IReadOnlyList InstanceNames { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.Serialization.cs new file mode 100644 index 000000000000..34c55f9e2868 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.Serialization.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.Azure.Management.WebSites.Models +{ + internal static partial class WorkerSizeOptionsExtensions + { + public static string ToSerialString(this WorkerSizeOptions value) => value switch + { + WorkerSizeOptions.Small => "Small", + WorkerSizeOptions.Medium => "Medium", + WorkerSizeOptions.Large => "Large", + WorkerSizeOptions.D1 => "D1", + WorkerSizeOptions.D2 => "D2", + WorkerSizeOptions.D3 => "D3", + WorkerSizeOptions.SmallV3 => "SmallV3", + WorkerSizeOptions.MediumV3 => "MediumV3", + WorkerSizeOptions.LargeV3 => "LargeV3", + WorkerSizeOptions.NestedSmall => "NestedSmall", + WorkerSizeOptions.NestedSmallLinux => "NestedSmallLinux", + WorkerSizeOptions.Default => "Default", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown WorkerSizeOptions value.") + }; + + public static WorkerSizeOptions ToWorkerSizeOptions(this string value) + { + if (string.Equals(value, "Small", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.Small; + if (string.Equals(value, "Medium", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.Medium; + if (string.Equals(value, "Large", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.Large; + if (string.Equals(value, "D1", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.D1; + if (string.Equals(value, "D2", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.D2; + if (string.Equals(value, "D3", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.D3; + if (string.Equals(value, "SmallV3", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.SmallV3; + if (string.Equals(value, "MediumV3", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.MediumV3; + if (string.Equals(value, "LargeV3", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.LargeV3; + if (string.Equals(value, "NestedSmall", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.NestedSmall; + if (string.Equals(value, "NestedSmallLinux", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.NestedSmallLinux; + if (string.Equals(value, "Default", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.Default; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown WorkerSizeOptions value."); + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs index 32d869df6f66..f2741121999d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs @@ -1,96 +1,38 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Licensed under the MIT License. + +// + +#nullable disable namespace Microsoft.Azure.Management.WebSites.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for WorkerSizeOptions. - /// - [JsonConverter(typeof(StringEnumConverter))] + /// Size of the machines. public enum WorkerSizeOptions { - [EnumMember(Value = "Small")] + /// Small. Small, - [EnumMember(Value = "Medium")] + /// Medium. Medium, - [EnumMember(Value = "Large")] + /// Large. Large, - [EnumMember(Value = "D1")] + /// D1. D1, - [EnumMember(Value = "D2")] + /// D2. D2, - [EnumMember(Value = "D3")] + /// D3. D3, - [EnumMember(Value = "NestedSmall")] + /// SmallV3. + SmallV3, + /// MediumV3. + MediumV3, + /// LargeV3. + LargeV3, + /// NestedSmall. NestedSmall, - [EnumMember(Value = "Default")] + /// NestedSmallLinux. + NestedSmallLinux, + /// Default. Default } - internal static class WorkerSizeOptionsEnumExtension - { - internal static string ToSerializedValue(this WorkerSizeOptions? value) - { - return value == null ? null : ((WorkerSizeOptions)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this WorkerSizeOptions value) - { - switch( value ) - { - case WorkerSizeOptions.Small: - return "Small"; - case WorkerSizeOptions.Medium: - return "Medium"; - case WorkerSizeOptions.Large: - return "Large"; - case WorkerSizeOptions.D1: - return "D1"; - case WorkerSizeOptions.D2: - return "D2"; - case WorkerSizeOptions.D3: - return "D3"; - case WorkerSizeOptions.NestedSmall: - return "NestedSmall"; - case WorkerSizeOptions.Default: - return "Default"; - } - return null; - } - - internal static WorkerSizeOptions? ParseWorkerSizeOptions(this string value) - { - switch( value ) - { - case "Small": - return WorkerSizeOptions.Small; - case "Medium": - return WorkerSizeOptions.Medium; - case "Large": - return WorkerSizeOptions.Large; - case "D1": - return WorkerSizeOptions.D1; - case "D2": - return WorkerSizeOptions.D2; - case "D3": - return WorkerSizeOptions.D3; - case "NestedSmall": - return WorkerSizeOptions.NestedSmall; - case "Default": - return WorkerSizeOptions.Default; - } - return null; - } - } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderRestClient.cs new file mode 100644 index 000000000000..18710db1fc38 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderRestClient.cs @@ -0,0 +1,1002 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class ProviderRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of ProviderRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public ProviderRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateGetAvailableStacksRequest(Enum4? osTypeSelected) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.Web/availableStacks", false); + if (osTypeSelected != null) + { + uri.AppendQuery("osTypeSelected", osTypeSelected.Value.ToString(), true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available application frameworks and their versions. + /// The Enum4 to use. + /// The cancellation token to use. + public async Task> GetAvailableStacksAsync(Enum4? osTypeSelected = null, CancellationToken cancellationToken = default) + { + using var message = CreateGetAvailableStacksRequest(osTypeSelected); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApplicationStackCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available application frameworks and their versions. + /// The Enum4 to use. + /// The cancellation token to use. + public Response GetAvailableStacks(Enum4? osTypeSelected = null, CancellationToken cancellationToken = default) + { + using var message = CreateGetAvailableStacksRequest(osTypeSelected); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApplicationStackCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetFunctionAppStacksRequest(Enum5? stackOsType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.Web/functionAppStacks", false); + if (stackOsType != null) + { + uri.AppendQuery("stackOsType", stackOsType.Value.ToString(), true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available Function app frameworks and their versions. + /// Stack OS Type. + /// The cancellation token to use. + public async Task> GetFunctionAppStacksAsync(Enum5? stackOsType = null, CancellationToken cancellationToken = default) + { + using var message = CreateGetFunctionAppStacksRequest(stackOsType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionAppStackCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available Function app frameworks and their versions. + /// Stack OS Type. + /// The cancellation token to use. + public Response GetFunctionAppStacks(Enum5? stackOsType = null, CancellationToken cancellationToken = default) + { + using var message = CreateGetFunctionAppStacksRequest(stackOsType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionAppStackCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetFunctionAppStacksForLocationRequest(string location, Enum6? stackOsType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.Web/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/functionAppStacks", false); + if (stackOsType != null) + { + uri.AppendQuery("stackOsType", stackOsType.Value.ToString(), true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available Function app frameworks and their versions for location. + /// Function App stack location. + /// Stack OS Type. + /// The cancellation token to use. + /// is null. + public async Task> GetFunctionAppStacksForLocationAsync(string location, Enum6? stackOsType = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateGetFunctionAppStacksForLocationRequest(location, stackOsType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionAppStackCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available Function app frameworks and their versions for location. + /// Function App stack location. + /// Stack OS Type. + /// The cancellation token to use. + /// is null. + public Response GetFunctionAppStacksForLocation(string location, Enum6? stackOsType = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateGetFunctionAppStacksForLocationRequest(location, stackOsType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionAppStackCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetWebAppStacksForLocationRequest(string location, Enum7? stackOsType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.Web/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/webAppStacks", false); + if (stackOsType != null) + { + uri.AppendQuery("stackOsType", stackOsType.Value.ToString(), true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available Web app frameworks and their versions for location. + /// Web App stack location. + /// Stack OS Type. + /// The cancellation token to use. + /// is null. + public async Task> GetWebAppStacksForLocationAsync(string location, Enum7? stackOsType = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateGetWebAppStacksForLocationRequest(location, stackOsType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppStackCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available Web app frameworks and their versions for location. + /// Web App stack location. + /// Stack OS Type. + /// The cancellation token to use. + /// is null. + public Response GetWebAppStacksForLocation(string location, Enum7? stackOsType = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateGetWebAppStacksForLocationRequest(location, stackOsType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppStackCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListOperationsRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.Web/operations", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. + /// The cancellation token to use. + public async Task> ListOperationsAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListOperationsRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmOperationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. + /// The cancellation token to use. + public Response ListOperations(CancellationToken cancellationToken = default) + { + using var message = CreateListOperationsRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmOperationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetWebAppStacksRequest(Enum8? stackOsType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.Web/webAppStacks", false); + if (stackOsType != null) + { + uri.AppendQuery("stackOsType", stackOsType.Value.ToString(), true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available Web app frameworks and their versions. + /// Stack OS Type. + /// The cancellation token to use. + public async Task> GetWebAppStacksAsync(Enum8? stackOsType = null, CancellationToken cancellationToken = default) + { + using var message = CreateGetWebAppStacksRequest(stackOsType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppStackCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available Web app frameworks and their versions. + /// Stack OS Type. + /// The cancellation token to use. + public Response GetWebAppStacks(Enum8? stackOsType = null, CancellationToken cancellationToken = default) + { + using var message = CreateGetWebAppStacksRequest(stackOsType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppStackCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAvailableStacksOnPremRequest(Enum9? osTypeSelected) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/availableStacks", false); + if (osTypeSelected != null) + { + uri.AppendQuery("osTypeSelected", osTypeSelected.Value.ToString(), true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available application frameworks and their versions. + /// The Enum9 to use. + /// The cancellation token to use. + public async Task> GetAvailableStacksOnPremAsync(Enum9? osTypeSelected = null, CancellationToken cancellationToken = default) + { + using var message = CreateGetAvailableStacksOnPremRequest(osTypeSelected); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApplicationStackCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available application frameworks and their versions. + /// The Enum9 to use. + /// The cancellation token to use. + public Response GetAvailableStacksOnPrem(Enum9? osTypeSelected = null, CancellationToken cancellationToken = default) + { + using var message = CreateGetAvailableStacksOnPremRequest(osTypeSelected); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApplicationStackCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAvailableStacksNextPageRequest(string nextLink, Enum4? osTypeSelected) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available application frameworks and their versions. + /// The URL to the next page of results. + /// The Enum4 to use. + /// The cancellation token to use. + /// is null. + public async Task> GetAvailableStacksNextPageAsync(string nextLink, Enum4? osTypeSelected = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateGetAvailableStacksNextPageRequest(nextLink, osTypeSelected); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApplicationStackCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available application frameworks and their versions. + /// The URL to the next page of results. + /// The Enum4 to use. + /// The cancellation token to use. + /// is null. + public Response GetAvailableStacksNextPage(string nextLink, Enum4? osTypeSelected = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateGetAvailableStacksNextPageRequest(nextLink, osTypeSelected); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApplicationStackCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetFunctionAppStacksNextPageRequest(string nextLink, Enum5? stackOsType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available Function app frameworks and their versions. + /// The URL to the next page of results. + /// Stack OS Type. + /// The cancellation token to use. + /// is null. + public async Task> GetFunctionAppStacksNextPageAsync(string nextLink, Enum5? stackOsType = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateGetFunctionAppStacksNextPageRequest(nextLink, stackOsType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionAppStackCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available Function app frameworks and their versions. + /// The URL to the next page of results. + /// Stack OS Type. + /// The cancellation token to use. + /// is null. + public Response GetFunctionAppStacksNextPage(string nextLink, Enum5? stackOsType = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateGetFunctionAppStacksNextPageRequest(nextLink, stackOsType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionAppStackCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetFunctionAppStacksForLocationNextPageRequest(string nextLink, string location, Enum6? stackOsType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available Function app frameworks and their versions for location. + /// The URL to the next page of results. + /// Function App stack location. + /// Stack OS Type. + /// The cancellation token to use. + /// or is null. + public async Task> GetFunctionAppStacksForLocationNextPageAsync(string nextLink, string location, Enum6? stackOsType = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateGetFunctionAppStacksForLocationNextPageRequest(nextLink, location, stackOsType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionAppStackCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available Function app frameworks and their versions for location. + /// The URL to the next page of results. + /// Function App stack location. + /// Stack OS Type. + /// The cancellation token to use. + /// or is null. + public Response GetFunctionAppStacksForLocationNextPage(string nextLink, string location, Enum6? stackOsType = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateGetFunctionAppStacksForLocationNextPageRequest(nextLink, location, stackOsType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionAppStackCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetWebAppStacksForLocationNextPageRequest(string nextLink, string location, Enum7? stackOsType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available Web app frameworks and their versions for location. + /// The URL to the next page of results. + /// Web App stack location. + /// Stack OS Type. + /// The cancellation token to use. + /// or is null. + public async Task> GetWebAppStacksForLocationNextPageAsync(string nextLink, string location, Enum7? stackOsType = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateGetWebAppStacksForLocationNextPageRequest(nextLink, location, stackOsType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppStackCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available Web app frameworks and their versions for location. + /// The URL to the next page of results. + /// Web App stack location. + /// Stack OS Type. + /// The cancellation token to use. + /// or is null. + public Response GetWebAppStacksForLocationNextPage(string nextLink, string location, Enum7? stackOsType = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + using var message = CreateGetWebAppStacksForLocationNextPageRequest(nextLink, location, stackOsType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppStackCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListOperationsNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListOperationsNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListOperationsNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmOperationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListOperationsNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListOperationsNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmOperationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetWebAppStacksNextPageRequest(string nextLink, Enum8? stackOsType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available Web app frameworks and their versions. + /// The URL to the next page of results. + /// Stack OS Type. + /// The cancellation token to use. + /// is null. + public async Task> GetWebAppStacksNextPageAsync(string nextLink, Enum8? stackOsType = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateGetWebAppStacksNextPageRequest(nextLink, stackOsType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppStackCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available Web app frameworks and their versions. + /// The URL to the next page of results. + /// Stack OS Type. + /// The cancellation token to use. + /// is null. + public Response GetWebAppStacksNextPage(string nextLink, Enum8? stackOsType = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateGetWebAppStacksNextPageRequest(nextLink, stackOsType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppStackCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAvailableStacksOnPremNextPageRequest(string nextLink, Enum9? osTypeSelected) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get available application frameworks and their versions. + /// The URL to the next page of results. + /// The Enum9 to use. + /// The cancellation token to use. + /// is null. + public async Task> GetAvailableStacksOnPremNextPageAsync(string nextLink, Enum9? osTypeSelected = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateGetAvailableStacksOnPremNextPageRequest(nextLink, osTypeSelected); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApplicationStackCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get available application frameworks and their versions. + /// The URL to the next page of results. + /// The Enum9 to use. + /// The cancellation token to use. + /// is null. + public Response GetAvailableStacksOnPremNextPage(string nextLink, Enum9? osTypeSelected = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateGetAvailableStacksOnPremNextPageRequest(nextLink, osTypeSelected); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApplicationStackCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/RecommendationsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/RecommendationsRestClient.cs new file mode 100644 index 000000000000..1bdf386dd54d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/RecommendationsRestClient.cs @@ -0,0 +1,1763 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class RecommendationsRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of RecommendationsRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public RecommendationsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest(bool? featured, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/recommendations", false); + if (featured != null) + { + uri.AppendQuery("featured", featured.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all recommendations for a subscription. + /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + /// The cancellation token to use. + public async Task> ListAsync(bool? featured = null, string filter = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(featured, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all recommendations for a subscription. + /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + /// The cancellation token to use. + public Response List(bool? featured = null, string filter = null, CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(featured, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateResetAllFiltersRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/recommendations/reset", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Reset all recommendation opt-out settings for a subscription. + /// The cancellation token to use. + public async Task ResetAllFiltersAsync(CancellationToken cancellationToken = default) + { + using var message = CreateResetAllFiltersRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Reset all recommendation opt-out settings for a subscription. + /// The cancellation token to use. + public Response ResetAllFilters(CancellationToken cancellationToken = default) + { + using var message = CreateResetAllFiltersRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDisableRecommendationForSubscriptionRequest(string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/recommendations/", false); + uri.AppendPath(name, true); + uri.AppendPath("/disable", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Disables the specified rule so it will not apply to a subscription in the future. + /// Rule name. + /// The cancellation token to use. + /// is null. + public async Task DisableRecommendationForSubscriptionAsync(string name, CancellationToken cancellationToken = default) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDisableRecommendationForSubscriptionRequest(name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Disables the specified rule so it will not apply to a subscription in the future. + /// Rule name. + /// The cancellation token to use. + /// is null. + public Response DisableRecommendationForSubscription(string name, CancellationToken cancellationToken = default) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDisableRecommendationForSubscriptionRequest(name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHistoryForHostingEnvironmentRequest(string resourceGroupName, string hostingEnvironmentName, bool? expiredOnly, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(hostingEnvironmentName, true); + uri.AppendPath("/recommendationHistory", false); + if (expiredOnly != null) + { + uri.AppendQuery("expiredOnly", expiredOnly.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get past recommendations for an app, optionally specified by the time range. + /// Name of the resource group to which the resource belongs. + /// Name of the hosting environment. + /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. + /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + /// The cancellation token to use. + /// or is null. + public async Task> ListHistoryForHostingEnvironmentAsync(string resourceGroupName, string hostingEnvironmentName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateListHistoryForHostingEnvironmentRequest(resourceGroupName, hostingEnvironmentName, expiredOnly, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get past recommendations for an app, optionally specified by the time range. + /// Name of the resource group to which the resource belongs. + /// Name of the hosting environment. + /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. + /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + /// The cancellation token to use. + /// or is null. + public Response ListHistoryForHostingEnvironment(string resourceGroupName, string hostingEnvironmentName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateListHistoryForHostingEnvironmentRequest(resourceGroupName, hostingEnvironmentName, expiredOnly, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRecommendedRulesForHostingEnvironmentRequest(string resourceGroupName, string hostingEnvironmentName, bool? featured, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(hostingEnvironmentName, true); + uri.AppendPath("/recommendations", false); + if (featured != null) + { + uri.AppendQuery("featured", featured.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all recommendations for a hosting environment. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + /// The cancellation token to use. + /// or is null. + public async Task> ListRecommendedRulesForHostingEnvironmentAsync(string resourceGroupName, string hostingEnvironmentName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateListRecommendedRulesForHostingEnvironmentRequest(resourceGroupName, hostingEnvironmentName, featured, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all recommendations for a hosting environment. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + /// The cancellation token to use. + /// or is null. + public Response ListRecommendedRulesForHostingEnvironment(string resourceGroupName, string hostingEnvironmentName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateListRecommendedRulesForHostingEnvironmentRequest(resourceGroupName, hostingEnvironmentName, featured, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDisableAllForHostingEnvironmentRequest(string resourceGroupName, string environmentName, string hostingEnvironmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(hostingEnvironmentName, true); + uri.AppendPath("/recommendations/disable", false); + uri.AppendQuery("environmentName", environmentName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Disable all recommendations for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task DisableAllForHostingEnvironmentAsync(string resourceGroupName, string environmentName, string hostingEnvironmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateDisableAllForHostingEnvironmentRequest(resourceGroupName, environmentName, hostingEnvironmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Disable all recommendations for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response DisableAllForHostingEnvironment(string resourceGroupName, string environmentName, string hostingEnvironmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateDisableAllForHostingEnvironmentRequest(resourceGroupName, environmentName, hostingEnvironmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateResetAllFiltersForHostingEnvironmentRequest(string resourceGroupName, string environmentName, string hostingEnvironmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(hostingEnvironmentName, true); + uri.AppendPath("/recommendations/reset", false); + uri.AppendQuery("environmentName", environmentName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Reset all recommendation opt-out settings for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task ResetAllFiltersForHostingEnvironmentAsync(string resourceGroupName, string environmentName, string hostingEnvironmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateResetAllFiltersForHostingEnvironmentRequest(resourceGroupName, environmentName, hostingEnvironmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Reset all recommendation opt-out settings for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response ResetAllFiltersForHostingEnvironment(string resourceGroupName, string environmentName, string hostingEnvironmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateResetAllFiltersForHostingEnvironmentRequest(resourceGroupName, environmentName, hostingEnvironmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRuleDetailsByHostingEnvironmentRequest(string resourceGroupName, string hostingEnvironmentName, string name, bool? updateSeen, string recommendationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(hostingEnvironmentName, true); + uri.AppendPath("/recommendations/", false); + uri.AppendPath(name, true); + if (updateSeen != null) + { + uri.AppendQuery("updateSeen", updateSeen.Value, true); + } + if (recommendationId != null) + { + uri.AppendQuery("recommendationId", recommendationId, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a recommendation rule for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the hosting environment. + /// Name of the recommendation. + /// Specify <code>true</code> to update the last-seen timestamp of the recommendation object. + /// The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetRuleDetailsByHostingEnvironmentAsync(string resourceGroupName, string hostingEnvironmentName, string name, bool? updateSeen = null, string recommendationId = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRuleDetailsByHostingEnvironmentRequest(resourceGroupName, hostingEnvironmentName, name, updateSeen, recommendationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecommendationRule value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecommendationRule.DeserializeRecommendationRule(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a recommendation rule for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the hosting environment. + /// Name of the recommendation. + /// Specify <code>true</code> to update the last-seen timestamp of the recommendation object. + /// The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. + /// The cancellation token to use. + /// , , or is null. + public Response GetRuleDetailsByHostingEnvironment(string resourceGroupName, string hostingEnvironmentName, string name, bool? updateSeen = null, string recommendationId = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRuleDetailsByHostingEnvironmentRequest(resourceGroupName, hostingEnvironmentName, name, updateSeen, recommendationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecommendationRule value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecommendationRule.DeserializeRecommendationRule(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDisableRecommendationForHostingEnvironmentRequest(string resourceGroupName, string environmentName, string name, string hostingEnvironmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); + uri.AppendPath(hostingEnvironmentName, true); + uri.AppendPath("/recommendations/", false); + uri.AppendPath(name, true); + uri.AppendPath("/disable", false); + uri.AppendQuery("environmentName", environmentName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Disables the specific rule for a web site permanently. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Rule name. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public async Task DisableRecommendationForHostingEnvironmentAsync(string resourceGroupName, string environmentName, string name, string hostingEnvironmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateDisableRecommendationForHostingEnvironmentRequest(resourceGroupName, environmentName, name, hostingEnvironmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Disables the specific rule for a web site permanently. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Rule name. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public Response DisableRecommendationForHostingEnvironment(string resourceGroupName, string environmentName, string name, string hostingEnvironmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateDisableRecommendationForHostingEnvironmentRequest(resourceGroupName, environmentName, name, hostingEnvironmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHistoryForWebAppRequest(string resourceGroupName, string siteName, bool? expiredOnly, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/recommendationHistory", false); + if (expiredOnly != null) + { + uri.AppendQuery("expiredOnly", expiredOnly.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get past recommendations for an app, optionally specified by the time range. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. + /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + /// The cancellation token to use. + /// or is null. + public async Task> ListHistoryForWebAppAsync(string resourceGroupName, string siteName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListHistoryForWebAppRequest(resourceGroupName, siteName, expiredOnly, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get past recommendations for an app, optionally specified by the time range. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. + /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + /// The cancellation token to use. + /// or is null. + public Response ListHistoryForWebApp(string resourceGroupName, string siteName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListHistoryForWebAppRequest(resourceGroupName, siteName, expiredOnly, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRecommendedRulesForWebAppRequest(string resourceGroupName, string siteName, bool? featured, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/recommendations", false); + if (featured != null) + { + uri.AppendQuery("featured", featured.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all recommendations for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + /// The cancellation token to use. + /// or is null. + public async Task> ListRecommendedRulesForWebAppAsync(string resourceGroupName, string siteName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListRecommendedRulesForWebAppRequest(resourceGroupName, siteName, featured, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all recommendations for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + /// The cancellation token to use. + /// or is null. + public Response ListRecommendedRulesForWebApp(string resourceGroupName, string siteName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListRecommendedRulesForWebAppRequest(resourceGroupName, siteName, featured, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDisableAllForWebAppRequest(string resourceGroupName, string siteName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/recommendations/disable", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Disable all recommendations for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task DisableAllForWebAppAsync(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateDisableAllForWebAppRequest(resourceGroupName, siteName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Disable all recommendations for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response DisableAllForWebApp(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateDisableAllForWebAppRequest(resourceGroupName, siteName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateResetAllFiltersForWebAppRequest(string resourceGroupName, string siteName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/recommendations/reset", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Reset all recommendation opt-out settings for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task ResetAllFiltersForWebAppAsync(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateResetAllFiltersForWebAppRequest(resourceGroupName, siteName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Reset all recommendation opt-out settings for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ResetAllFiltersForWebApp(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateResetAllFiltersForWebAppRequest(resourceGroupName, siteName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRuleDetailsByWebAppRequest(string resourceGroupName, string siteName, string name, bool? updateSeen, string recommendationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/recommendations/", false); + uri.AppendPath(name, true); + if (updateSeen != null) + { + uri.AppendQuery("updateSeen", updateSeen.Value, true); + } + if (recommendationId != null) + { + uri.AppendQuery("recommendationId", recommendationId, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a recommendation rule for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the recommendation. + /// Specify <code>true</code> to update the last-seen timestamp of the recommendation object. + /// The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetRuleDetailsByWebAppAsync(string resourceGroupName, string siteName, string name, bool? updateSeen = null, string recommendationId = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRuleDetailsByWebAppRequest(resourceGroupName, siteName, name, updateSeen, recommendationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecommendationRule value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecommendationRule.DeserializeRecommendationRule(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a recommendation rule for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the recommendation. + /// Specify <code>true</code> to update the last-seen timestamp of the recommendation object. + /// The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. + /// The cancellation token to use. + /// , , or is null. + public Response GetRuleDetailsByWebApp(string resourceGroupName, string siteName, string name, bool? updateSeen = null, string recommendationId = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRuleDetailsByWebAppRequest(resourceGroupName, siteName, name, updateSeen, recommendationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecommendationRule value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecommendationRule.DeserializeRecommendationRule(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDisableRecommendationForSiteRequest(string resourceGroupName, string siteName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(siteName, true); + uri.AppendPath("/recommendations/", false); + uri.AppendPath(name, true); + uri.AppendPath("/disable", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Disables the specific rule for a web site permanently. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Rule name. + /// The cancellation token to use. + /// , , or is null. + public async Task DisableRecommendationForSiteAsync(string resourceGroupName, string siteName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDisableRecommendationForSiteRequest(resourceGroupName, siteName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Disables the specific rule for a web site permanently. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Rule name. + /// The cancellation token to use. + /// , , or is null. + public Response DisableRecommendationForSite(string resourceGroupName, string siteName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDisableRecommendationForSiteRequest(resourceGroupName, siteName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, bool? featured, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all recommendations for a subscription. + /// The URL to the next page of results. + /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink, featured, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all recommendations for a subscription. + /// The URL to the next page of results. + /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink, featured, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHistoryForHostingEnvironmentNextPageRequest(string nextLink, string resourceGroupName, string hostingEnvironmentName, bool? expiredOnly, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get past recommendations for an app, optionally specified by the time range. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the hosting environment. + /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. + /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListHistoryForHostingEnvironmentNextPageAsync(string nextLink, string resourceGroupName, string hostingEnvironmentName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateListHistoryForHostingEnvironmentNextPageRequest(nextLink, resourceGroupName, hostingEnvironmentName, expiredOnly, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get past recommendations for an app, optionally specified by the time range. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the hosting environment. + /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. + /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + /// The cancellation token to use. + /// , , or is null. + public Response ListHistoryForHostingEnvironmentNextPage(string nextLink, string resourceGroupName, string hostingEnvironmentName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateListHistoryForHostingEnvironmentNextPageRequest(nextLink, resourceGroupName, hostingEnvironmentName, expiredOnly, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRecommendedRulesForHostingEnvironmentNextPageRequest(string nextLink, string resourceGroupName, string hostingEnvironmentName, bool? featured, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all recommendations for a hosting environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListRecommendedRulesForHostingEnvironmentNextPageAsync(string nextLink, string resourceGroupName, string hostingEnvironmentName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateListRecommendedRulesForHostingEnvironmentNextPageRequest(nextLink, resourceGroupName, hostingEnvironmentName, featured, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all recommendations for a hosting environment. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + /// The cancellation token to use. + /// , , or is null. + public Response ListRecommendedRulesForHostingEnvironmentNextPage(string nextLink, string resourceGroupName, string hostingEnvironmentName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostingEnvironmentName == null) + { + throw new ArgumentNullException(nameof(hostingEnvironmentName)); + } + + using var message = CreateListRecommendedRulesForHostingEnvironmentNextPageRequest(nextLink, resourceGroupName, hostingEnvironmentName, featured, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHistoryForWebAppNextPageRequest(string nextLink, string resourceGroupName, string siteName, bool? expiredOnly, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get past recommendations for an app, optionally specified by the time range. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. + /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListHistoryForWebAppNextPageAsync(string nextLink, string resourceGroupName, string siteName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListHistoryForWebAppNextPageRequest(nextLink, resourceGroupName, siteName, expiredOnly, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get past recommendations for an app, optionally specified by the time range. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. + /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + /// The cancellation token to use. + /// , , or is null. + public Response ListHistoryForWebAppNextPage(string nextLink, string resourceGroupName, string siteName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListHistoryForWebAppNextPageRequest(nextLink, resourceGroupName, siteName, expiredOnly, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRecommendedRulesForWebAppNextPageRequest(string nextLink, string resourceGroupName, string siteName, bool? featured, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all recommendations for an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListRecommendedRulesForWebAppNextPageAsync(string nextLink, string resourceGroupName, string siteName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListRecommendedRulesForWebAppNextPageRequest(nextLink, resourceGroupName, siteName, featured, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all recommendations for an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + /// The cancellation token to use. + /// , , or is null. + public Response ListRecommendedRulesForWebAppNextPage(string nextLink, string resourceGroupName, string siteName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (siteName == null) + { + throw new ArgumentNullException(nameof(siteName)); + } + + using var message = CreateListRecommendedRulesForWebAppNextPageRequest(nextLink, resourceGroupName, siteName, featured, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecommendationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ResourceHealthMetadataRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ResourceHealthMetadataRestClient.cs new file mode 100644 index 000000000000..c5447abb65c8 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ResourceHealthMetadataRestClient.cs @@ -0,0 +1,869 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class ResourceHealthMetadataRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of ResourceHealthMetadataRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public ResourceHealthMetadataRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/resourceHealthMetadata", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all ResourceHealthMetadata for all sites in the subscription. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all ResourceHealthMetadata for all sites in the subscription. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/resourceHealthMetadata", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all ResourceHealthMetadata for all sites in the resource group in the subscription. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all ResourceHealthMetadata for all sites in the resource group in the subscription. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySiteRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/resourceHealthMetadata", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public async Task> ListBySiteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListBySiteRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public Response ListBySite(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListBySiteRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetBySiteRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/resourceHealthMetadata/default", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the category of ResourceHealthMetadata to use for the given site. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public async Task> GetBySiteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetBySiteRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadata value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceHealthMetadata.DeserializeResourceHealthMetadata(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the category of ResourceHealthMetadata to use for the given site. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public Response GetBySite(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetBySiteRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadata value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceHealthMetadata.DeserializeResourceHealthMetadata(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySiteSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/resourceHealthMetadata", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListBySiteSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListBySiteSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListBySiteSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListBySiteSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetBySiteSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/resourceHealthMetadata/default", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the category of ResourceHealthMetadata to use for the given site. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetBySiteSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetBySiteSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadata value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceHealthMetadata.DeserializeResourceHealthMetadata(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the category of ResourceHealthMetadata to use for the given site. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetBySiteSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetBySiteSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadata value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceHealthMetadata.DeserializeResourceHealthMetadata(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all ResourceHealthMetadata for all sites in the subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all ResourceHealthMetadata for all sites in the subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all ResourceHealthMetadata for all sites in the resource group in the subscription. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all ResourceHealthMetadata for all sites in the resource group in the subscription. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySiteNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListBySiteNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListBySiteNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// , , or is null. + public Response ListBySiteNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListBySiteNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySiteSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListBySiteSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListBySiteSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListBySiteSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListBySiteSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceHealthMetadataCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesRestClient.cs new file mode 100644 index 000000000000..d4c7000b3222 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesRestClient.cs @@ -0,0 +1,5359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class StaticSitesRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of StaticSitesRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public StaticSitesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreatePreviewWorkflowRequest(string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/previewStaticSiteWorkflowFile", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(staticSitesWorkflowPreviewRequest); + request.Content = content; + return message; + } + + /// Description for Generates a preview workflow file for the static site. + /// Location where you plan to create the static site. + /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. See example. + /// The cancellation token to use. + /// or is null. + public async Task> PreviewWorkflowAsync(string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (staticSitesWorkflowPreviewRequest == null) + { + throw new ArgumentNullException(nameof(staticSitesWorkflowPreviewRequest)); + } + + using var message = CreatePreviewWorkflowRequest(location, staticSitesWorkflowPreviewRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSitesWorkflowPreview value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSitesWorkflowPreview.DeserializeStaticSitesWorkflowPreview(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Generates a preview workflow file for the static site. + /// Location where you plan to create the static site. + /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. See example. + /// The cancellation token to use. + /// or is null. + public Response PreviewWorkflow(string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (staticSitesWorkflowPreviewRequest == null) + { + throw new ArgumentNullException(nameof(staticSitesWorkflowPreviewRequest)); + } + + using var message = CreatePreviewWorkflowRequest(location, staticSitesWorkflowPreviewRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSitesWorkflowPreview value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSitesWorkflowPreview.DeserializeStaticSitesWorkflowPreview(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all Static Sites for a subscription. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all Static Sites for a subscription. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetStaticSitesByResourceGroupRequest(string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all static sites in the specified resource group. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public async Task> GetStaticSitesByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateGetStaticSitesByResourceGroupRequest(resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all static sites in the specified resource group. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// is null. + public Response GetStaticSitesByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateGetStaticSitesByResourceGroupRequest(resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetStaticSiteRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the details of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public async Task> GetStaticSiteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetStaticSiteRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteARMResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteARMResource.DeserializeStaticSiteARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the details of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public Response GetStaticSite(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetStaticSiteRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteARMResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteARMResource.DeserializeStaticSiteARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateStaticSiteRequest(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(staticSiteEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new static site in an existing resource group, or updates an existing static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site to create or update. + /// A JSON representation of the staticsite properties. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task CreateOrUpdateStaticSiteAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (staticSiteEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteEnvelope)); + } + + using var message = CreateCreateOrUpdateStaticSiteRequest(resourceGroupName, name, staticSiteEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new static site in an existing resource group, or updates an existing static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site to create or update. + /// A JSON representation of the staticsite properties. See example. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdateStaticSite(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (staticSiteEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteEnvelope)); + } + + using var message = CreateCreateOrUpdateStaticSiteRequest(resourceGroupName, name, staticSiteEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteStaticSiteRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site to delete. + /// The cancellation token to use. + /// or is null. + public async Task DeleteStaticSiteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteStaticSiteRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site to delete. + /// The cancellation token to use. + /// or is null. + public Response DeleteStaticSite(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteStaticSiteRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateStaticSiteRequest(string resourceGroupName, string name, StaticSitePatchResource staticSiteEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(staticSiteEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new static site in an existing resource group, or updates an existing static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site to create or update. + /// A JSON representation of the staticsite properties. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateStaticSiteAsync(string resourceGroupName, string name, StaticSitePatchResource staticSiteEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (staticSiteEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteEnvelope)); + } + + using var message = CreateUpdateStaticSiteRequest(resourceGroupName, name, staticSiteEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + { + StaticSiteARMResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteARMResource.DeserializeStaticSiteARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new static site in an existing resource group, or updates an existing static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site to create or update. + /// A JSON representation of the staticsite properties. See example. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateStaticSite(string resourceGroupName, string name, StaticSitePatchResource staticSiteEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (staticSiteEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteEnvelope)); + } + + using var message = CreateUpdateStaticSiteRequest(resourceGroupName, name, staticSiteEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + { + StaticSiteARMResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteARMResource.DeserializeStaticSiteARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteUsersRequest(string resourceGroupName, string name, string authprovider) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/authproviders/", false); + uri.AppendPath(authprovider, true); + uri.AppendPath("/listUsers", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the list of users of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The auth provider for the users. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListStaticSiteUsersAsync(string resourceGroupName, string name, string authprovider, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (authprovider == null) + { + throw new ArgumentNullException(nameof(authprovider)); + } + + using var message = CreateListStaticSiteUsersRequest(resourceGroupName, name, authprovider); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteUserCollection.DeserializeStaticSiteUserCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the list of users of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The auth provider for the users. + /// The cancellation token to use. + /// , , or is null. + public Response ListStaticSiteUsers(string resourceGroupName, string name, string authprovider, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (authprovider == null) + { + throw new ArgumentNullException(nameof(authprovider)); + } + + using var message = CreateListStaticSiteUsersRequest(resourceGroupName, name, authprovider); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteUserCollection.DeserializeStaticSiteUserCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteStaticSiteUserRequest(string resourceGroupName, string name, string authprovider, string userid) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/authproviders/", false); + uri.AppendPath(authprovider, true); + uri.AppendPath("/users/", false); + uri.AppendPath(userid, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes the user entry from the static site. + /// Name of the resource group to which the resource belongs. + /// Name of the staticsite. + /// The auth provider for this user. + /// The user id of the user. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteStaticSiteUserAsync(string resourceGroupName, string name, string authprovider, string userid, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (authprovider == null) + { + throw new ArgumentNullException(nameof(authprovider)); + } + if (userid == null) + { + throw new ArgumentNullException(nameof(userid)); + } + + using var message = CreateDeleteStaticSiteUserRequest(resourceGroupName, name, authprovider, userid); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes the user entry from the static site. + /// Name of the resource group to which the resource belongs. + /// Name of the staticsite. + /// The auth provider for this user. + /// The user id of the user. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteStaticSiteUser(string resourceGroupName, string name, string authprovider, string userid, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (authprovider == null) + { + throw new ArgumentNullException(nameof(authprovider)); + } + if (userid == null) + { + throw new ArgumentNullException(nameof(userid)); + } + + using var message = CreateDeleteStaticSiteUserRequest(resourceGroupName, name, authprovider, userid); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateStaticSiteUserRequest(string resourceGroupName, string name, string authprovider, string userid, StaticSiteUserARMResource staticSiteUserEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/authproviders/", false); + uri.AppendPath(authprovider, true); + uri.AppendPath("/users/", false); + uri.AppendPath(userid, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(staticSiteUserEnvelope); + request.Content = content; + return message; + } + + /// Description for Updates a user entry with the listed roles. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The auth provider for this user. + /// The user id of the user. + /// A JSON representation of the StaticSiteUser properties. See example. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> UpdateStaticSiteUserAsync(string resourceGroupName, string name, string authprovider, string userid, StaticSiteUserARMResource staticSiteUserEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (authprovider == null) + { + throw new ArgumentNullException(nameof(authprovider)); + } + if (userid == null) + { + throw new ArgumentNullException(nameof(userid)); + } + if (staticSiteUserEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteUserEnvelope)); + } + + using var message = CreateUpdateStaticSiteUserRequest(resourceGroupName, name, authprovider, userid, staticSiteUserEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserARMResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteUserARMResource.DeserializeStaticSiteUserARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates a user entry with the listed roles. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The auth provider for this user. + /// The user id of the user. + /// A JSON representation of the StaticSiteUser properties. See example. + /// The cancellation token to use. + /// , , , , or is null. + public Response UpdateStaticSiteUser(string resourceGroupName, string name, string authprovider, string userid, StaticSiteUserARMResource staticSiteUserEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (authprovider == null) + { + throw new ArgumentNullException(nameof(authprovider)); + } + if (userid == null) + { + throw new ArgumentNullException(nameof(userid)); + } + if (staticSiteUserEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteUserEnvelope)); + } + + using var message = CreateUpdateStaticSiteUserRequest(resourceGroupName, name, authprovider, userid, staticSiteUserEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserARMResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteUserARMResource.DeserializeStaticSiteUserARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetStaticSiteBuildsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all static site builds for a particular static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public async Task> GetStaticSiteBuildsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetStaticSiteBuildsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteBuildCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteBuildCollection.DeserializeStaticSiteBuildCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all static site builds for a particular static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public Response GetStaticSiteBuilds(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetStaticSiteBuildsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteBuildCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteBuildCollection.DeserializeStaticSiteBuildCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(environmentName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the details of a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateGetStaticSiteBuildRequest(resourceGroupName, name, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteBuildARMResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteBuildARMResource.DeserializeStaticSiteBuildARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the details of a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , or is null. + public Response GetStaticSiteBuild(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateGetStaticSiteBuildRequest(resourceGroupName, name, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteBuildARMResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteBuildARMResource.DeserializeStaticSiteBuildARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(environmentName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateDeleteStaticSiteBuildRequest(resourceGroupName, name, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteStaticSiteBuild(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateDeleteStaticSiteBuildRequest(resourceGroupName, name, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateStaticSiteBuildAppSettingsRequest(string resourceGroupName, string name, string environmentName, StringDictionary appSettings) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/config/appsettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(appSettings); + request.Content = content; + return message; + } + + /// Description for Creates or updates the app settings of a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The dictionary containing the static site app settings to update. + /// The cancellation token to use. + /// , , , or is null. + public async Task> CreateOrUpdateStaticSiteBuildAppSettingsAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (appSettings == null) + { + throw new ArgumentNullException(nameof(appSettings)); + } + + using var message = CreateCreateOrUpdateStaticSiteBuildAppSettingsRequest(resourceGroupName, name, environmentName, appSettings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates or updates the app settings of a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The dictionary containing the static site app settings to update. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateStaticSiteBuildAppSettings(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (appSettings == null) + { + throw new ArgumentNullException(nameof(appSettings)); + } + + using var message = CreateCreateOrUpdateStaticSiteBuildAppSettingsRequest(resourceGroupName, name, environmentName, appSettings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateStaticSiteBuildFunctionAppSettingsRequest(string resourceGroupName, string name, string environmentName, StringDictionary appSettings) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/config/functionappsettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(appSettings); + request.Content = content; + return message; + } + + /// Description for Creates or updates the function app settings of a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The dictionary containing the static site function app settings to update. + /// The cancellation token to use. + /// , , , or is null. + public async Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (appSettings == null) + { + throw new ArgumentNullException(nameof(appSettings)); + } + + using var message = CreateCreateOrUpdateStaticSiteBuildFunctionAppSettingsRequest(resourceGroupName, name, environmentName, appSettings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates or updates the function app settings of a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The dictionary containing the static site function app settings to update. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateStaticSiteBuildFunctionAppSettings(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (appSettings == null) + { + throw new ArgumentNullException(nameof(appSettings)); + } + + using var message = CreateCreateOrUpdateStaticSiteBuildFunctionAppSettingsRequest(resourceGroupName, name, environmentName, appSettings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteBuildFunctionsRequest(string resourceGroupName, string name, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/functions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the functions of a particular static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListStaticSiteBuildFunctionsAsync(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateListStaticSiteBuildFunctionsRequest(resourceGroupName, name, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteFunctionOverviewCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the functions of a particular static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , or is null. + public Response ListStaticSiteBuildFunctions(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateListStaticSiteBuildFunctionsRequest(resourceGroupName, name, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteFunctionOverviewCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteBuildAppSettingsRequest(string resourceGroupName, string name, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/listAppSettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the application settings of a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListStaticSiteBuildAppSettingsAsync(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateListStaticSiteBuildAppSettingsRequest(resourceGroupName, name, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the application settings of a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , or is null. + public Response ListStaticSiteBuildAppSettings(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateListStaticSiteBuildAppSettingsRequest(resourceGroupName, name, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteBuildFunctionAppSettingsRequest(string resourceGroupName, string name, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/listFunctionAppSettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the application settings of a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListStaticSiteBuildFunctionAppSettingsAsync(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateListStaticSiteBuildFunctionAppSettingsRequest(resourceGroupName, name, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the application settings of a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , or is null. + public Response ListStaticSiteBuildFunctionAppSettings(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateListStaticSiteBuildFunctionAppSettingsRequest(resourceGroupName, name, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetUserProvidedFunctionAppsForStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/userProvidedFunctionApps", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the details of the user provided function apps registered with a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetUserProvidedFunctionAppsForStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateGetUserProvidedFunctionAppsForStaticSiteBuildRequest(resourceGroupName, name, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserProvidedFunctionAppsCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the details of the user provided function apps registered with a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , or is null. + public Response GetUserProvidedFunctionAppsForStaticSiteBuild(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateGetUserProvidedFunctionAppsForStaticSiteBuildRequest(resourceGroupName, name, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserProvidedFunctionAppsCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetUserProvidedFunctionAppForStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName, string functionAppName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/userProvidedFunctionApps/", false); + uri.AppendPath(functionAppName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the details of the user provided function app registered with a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// Name of the function app registered with the static site build. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetUserProvidedFunctionAppForStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (functionAppName == null) + { + throw new ArgumentNullException(nameof(functionAppName)); + } + + using var message = CreateGetUserProvidedFunctionAppForStaticSiteBuildRequest(resourceGroupName, name, environmentName, functionAppName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserProvidedFunctionAppARMResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteUserProvidedFunctionAppARMResource.DeserializeStaticSiteUserProvidedFunctionAppARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the details of the user provided function app registered with a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// Name of the function app registered with the static site build. + /// The cancellation token to use. + /// , , , or is null. + public Response GetUserProvidedFunctionAppForStaticSiteBuild(string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (functionAppName == null) + { + throw new ArgumentNullException(nameof(functionAppName)); + } + + using var message = CreateGetUserProvidedFunctionAppForStaticSiteBuildRequest(resourceGroupName, name, environmentName, functionAppName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserProvidedFunctionAppARMResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteUserProvidedFunctionAppARMResource.DeserializeStaticSiteUserProvidedFunctionAppARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRegisterUserProvidedFunctionAppWithStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/userProvidedFunctionApps/", false); + uri.AppendPath(functionAppName, true); + if (isForced != null) + { + uri.AppendQuery("isForced", isForced.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(staticSiteUserProvidedFunctionEnvelope); + request.Content = content; + return message; + } + + /// Description for Register a user provided function app with a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// Name of the function app to register with the static site build. + /// A JSON representation of the user provided function app properties. See example. + /// Specify <code>true</code> to force the update of the auth configuration on the function app even if an AzureStaticWebApps provider is already configured on the function app. The default is <code>false</code>. + /// The cancellation token to use. + /// , , , , or is null. + public async Task RegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (functionAppName == null) + { + throw new ArgumentNullException(nameof(functionAppName)); + } + if (staticSiteUserProvidedFunctionEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteUserProvidedFunctionEnvelope)); + } + + using var message = CreateRegisterUserProvidedFunctionAppWithStaticSiteBuildRequest(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Register a user provided function app with a static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// Name of the function app to register with the static site build. + /// A JSON representation of the user provided function app properties. See example. + /// Specify <code>true</code> to force the update of the auth configuration on the function app even if an AzureStaticWebApps provider is already configured on the function app. The default is <code>false</code>. + /// The cancellation token to use. + /// , , , , or is null. + public Response RegisterUserProvidedFunctionAppWithStaticSiteBuild(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (functionAppName == null) + { + throw new ArgumentNullException(nameof(functionAppName)); + } + if (staticSiteUserProvidedFunctionEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteUserProvidedFunctionEnvelope)); + } + + using var message = CreateRegisterUserProvidedFunctionAppWithStaticSiteBuildRequest(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDetachUserProvidedFunctionAppFromStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName, string functionAppName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/userProvidedFunctionApps/", false); + uri.AppendPath(functionAppName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Detach the user provided function app from the static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// Name of the function app registered with the static site build. + /// The cancellation token to use. + /// , , , or is null. + public async Task DetachUserProvidedFunctionAppFromStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (functionAppName == null) + { + throw new ArgumentNullException(nameof(functionAppName)); + } + + using var message = CreateDetachUserProvidedFunctionAppFromStaticSiteBuildRequest(resourceGroupName, name, environmentName, functionAppName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Detach the user provided function app from the static site build. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// Name of the function app registered with the static site build. + /// The cancellation token to use. + /// , , , or is null. + public Response DetachUserProvidedFunctionAppFromStaticSiteBuild(string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (functionAppName == null) + { + throw new ArgumentNullException(nameof(functionAppName)); + } + + using var message = CreateDetachUserProvidedFunctionAppFromStaticSiteBuildRequest(resourceGroupName, name, environmentName, functionAppName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateZipDeploymentForStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/zipdeploy", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(staticSiteZipDeploymentEnvelope); + request.Content = content; + return message; + } + + /// Description for Deploys zipped content to a specific environment of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the environment. + /// A JSON representation of the StaticSiteZipDeployment properties. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task CreateZipDeploymentForStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (staticSiteZipDeploymentEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteZipDeploymentEnvelope)); + } + + using var message = CreateCreateZipDeploymentForStaticSiteBuildRequest(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deploys zipped content to a specific environment of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the environment. + /// A JSON representation of the StaticSiteZipDeployment properties. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateZipDeploymentForStaticSiteBuild(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + if (staticSiteZipDeploymentEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteZipDeploymentEnvelope)); + } + + using var message = CreateCreateZipDeploymentForStaticSiteBuildRequest(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateStaticSiteAppSettingsRequest(string resourceGroupName, string name, StringDictionary appSettings) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/appsettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(appSettings); + request.Content = content; + return message; + } + + /// Description for Creates or updates the app settings of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The dictionary containing the static site app settings to update. + /// The cancellation token to use. + /// , , or is null. + public async Task> CreateOrUpdateStaticSiteAppSettingsAsync(string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appSettings == null) + { + throw new ArgumentNullException(nameof(appSettings)); + } + + using var message = CreateCreateOrUpdateStaticSiteAppSettingsRequest(resourceGroupName, name, appSettings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates or updates the app settings of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The dictionary containing the static site app settings to update. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdateStaticSiteAppSettings(string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appSettings == null) + { + throw new ArgumentNullException(nameof(appSettings)); + } + + using var message = CreateCreateOrUpdateStaticSiteAppSettingsRequest(resourceGroupName, name, appSettings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateStaticSiteFunctionAppSettingsRequest(string resourceGroupName, string name, StringDictionary appSettings) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/functionappsettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(appSettings); + request.Content = content; + return message; + } + + /// Description for Creates or updates the function app settings of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The dictionary containing the static site function app settings to update. + /// The cancellation token to use. + /// , , or is null. + public async Task> CreateOrUpdateStaticSiteFunctionAppSettingsAsync(string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appSettings == null) + { + throw new ArgumentNullException(nameof(appSettings)); + } + + using var message = CreateCreateOrUpdateStaticSiteFunctionAppSettingsRequest(resourceGroupName, name, appSettings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates or updates the function app settings of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The dictionary containing the static site function app settings to update. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdateStaticSiteFunctionAppSettings(string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appSettings == null) + { + throw new ArgumentNullException(nameof(appSettings)); + } + + using var message = CreateCreateOrUpdateStaticSiteFunctionAppSettingsRequest(resourceGroupName, name, appSettings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateUserRolesInvitationLinkRequest(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/createUserInvitation", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(staticSiteUserRolesInvitationEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates an invitation link for a user with the role. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The StaticSiteUserInvitationRequestResource to use. + /// The cancellation token to use. + /// , , or is null. + public async Task> CreateUserRolesInvitationLinkAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (staticSiteUserRolesInvitationEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteUserRolesInvitationEnvelope)); + } + + using var message = CreateCreateUserRolesInvitationLinkRequest(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserInvitationResponseResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteUserInvitationResponseResource.DeserializeStaticSiteUserInvitationResponseResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates an invitation link for a user with the role. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The StaticSiteUserInvitationRequestResource to use. + /// The cancellation token to use. + /// , , or is null. + public Response CreateUserRolesInvitationLink(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (staticSiteUserRolesInvitationEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteUserRolesInvitationEnvelope)); + } + + using var message = CreateCreateUserRolesInvitationLinkRequest(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserInvitationResponseResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteUserInvitationResponseResource.DeserializeStaticSiteUserInvitationResponseResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteCustomDomainsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/customDomains", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all static site custom domains for a particular static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site resource to search in. + /// The cancellation token to use. + /// or is null. + public async Task> ListStaticSiteCustomDomainsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteCustomDomainsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCustomDomainOverviewCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteCustomDomainOverviewCollection.DeserializeStaticSiteCustomDomainOverviewCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all static site custom domains for a particular static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site resource to search in. + /// The cancellation token to use. + /// or is null. + public Response ListStaticSiteCustomDomains(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteCustomDomainsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCustomDomainOverviewCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteCustomDomainOverviewCollection.DeserializeStaticSiteCustomDomainOverviewCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetStaticSiteCustomDomainRequest(string resourceGroupName, string name, string domainName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/customDomains/", false); + uri.AppendPath(domainName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets an existing custom domain for a particular static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site resource to search in. + /// The custom domain name. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetStaticSiteCustomDomainAsync(string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateGetStaticSiteCustomDomainRequest(resourceGroupName, name, domainName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCustomDomainOverviewARMResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteCustomDomainOverviewARMResource.DeserializeStaticSiteCustomDomainOverviewARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets an existing custom domain for a particular static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site resource to search in. + /// The custom domain name. + /// The cancellation token to use. + /// , , or is null. + public Response GetStaticSiteCustomDomain(string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateGetStaticSiteCustomDomainRequest(resourceGroupName, name, domainName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCustomDomainOverviewARMResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteCustomDomainOverviewARMResource.DeserializeStaticSiteCustomDomainOverviewARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateStaticSiteCustomDomainRequest(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/customDomains/", false); + uri.AppendPath(domainName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(staticSiteCustomDomainRequestPropertiesEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new static site custom domain in an existing resource group and static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The custom domain to create. + /// A JSON representation of the static site custom domain request properties. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task CreateOrUpdateStaticSiteCustomDomainAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (staticSiteCustomDomainRequestPropertiesEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteCustomDomainRequestPropertiesEnvelope)); + } + + using var message = CreateCreateOrUpdateStaticSiteCustomDomainRequest(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new static site custom domain in an existing resource group and static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The custom domain to create. + /// A JSON representation of the static site custom domain request properties. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateStaticSiteCustomDomain(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (staticSiteCustomDomainRequestPropertiesEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteCustomDomainRequestPropertiesEnvelope)); + } + + using var message = CreateCreateOrUpdateStaticSiteCustomDomainRequest(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteStaticSiteCustomDomainRequest(string resourceGroupName, string name, string domainName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/customDomains/", false); + uri.AppendPath(domainName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a custom domain. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The custom domain to delete. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteStaticSiteCustomDomainAsync(string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateDeleteStaticSiteCustomDomainRequest(resourceGroupName, name, domainName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a custom domain. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The custom domain to delete. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteStaticSiteCustomDomain(string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + + using var message = CreateDeleteStaticSiteCustomDomainRequest(resourceGroupName, name, domainName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateValidateCustomDomainCanBeAddedToStaticSiteRequest(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/customDomains/", false); + uri.AppendPath(domainName, true); + uri.AppendPath("/validate", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(staticSiteCustomDomainRequestPropertiesEnvelope); + request.Content = content; + return message; + } + + /// Description for Validates a particular custom domain can be added to a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The custom domain to validate. + /// A JSON representation of the static site custom domain request properties. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task ValidateCustomDomainCanBeAddedToStaticSiteAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (staticSiteCustomDomainRequestPropertiesEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteCustomDomainRequestPropertiesEnvelope)); + } + + using var message = CreateValidateCustomDomainCanBeAddedToStaticSiteRequest(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Validates a particular custom domain can be added to a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The custom domain to validate. + /// A JSON representation of the static site custom domain request properties. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response ValidateCustomDomainCanBeAddedToStaticSite(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainName == null) + { + throw new ArgumentNullException(nameof(domainName)); + } + if (staticSiteCustomDomainRequestPropertiesEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteCustomDomainRequestPropertiesEnvelope)); + } + + using var message = CreateValidateCustomDomainCanBeAddedToStaticSiteRequest(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDetachStaticSiteRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/detach", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Detaches a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site to detach. + /// The cancellation token to use. + /// or is null. + public async Task DetachStaticSiteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDetachStaticSiteRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Detaches a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site to detach. + /// The cancellation token to use. + /// or is null. + public Response DetachStaticSite(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDetachStaticSiteRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteFunctionsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/functions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the functions of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public async Task> ListStaticSiteFunctionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteFunctionsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteFunctionOverviewCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the functions of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public Response ListStaticSiteFunctions(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteFunctionsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteFunctionOverviewCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteAppSettingsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/listAppSettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the application settings of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public async Task> ListStaticSiteAppSettingsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteAppSettingsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the application settings of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public Response ListStaticSiteAppSettings(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteAppSettingsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteConfiguredRolesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/listConfiguredRoles", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Lists the roles configured for the static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public async Task> ListStaticSiteConfiguredRolesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteConfiguredRolesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringList.DeserializeStringList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Lists the roles configured for the static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public Response ListStaticSiteConfiguredRoles(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteConfiguredRolesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringList.DeserializeStringList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteFunctionAppSettingsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/listFunctionAppSettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the application settings of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public async Task> ListStaticSiteFunctionAppSettingsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteFunctionAppSettingsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the application settings of a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public Response ListStaticSiteFunctionAppSettings(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteFunctionAppSettingsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteSecretsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/listSecrets", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Lists the secrets for an existing static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public async Task> ListStaticSiteSecretsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteSecretsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Lists the secrets for an existing static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public Response ListStaticSiteSecrets(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteSecretsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateEndpointConnectionListRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the list of private endpoint connections associated with a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public async Task> GetPrivateEndpointConnectionListAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateEndpointConnectionListRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the list of private endpoint connections associated with a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public Response GetPrivateEndpointConnectionList(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateEndpointConnectionListRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the private endpoint connection. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetPrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RemotePrivateEndpointConnectionARMResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the private endpoint connection. + /// The cancellation token to use. + /// , , or is null. + public Response GetPrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RemotePrivateEndpointConnectionARMResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateApproveOrRejectPrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(privateEndpointWrapper); + request.Content = content; + return message; + } + + /// Description for Approves or rejects a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the private endpoint connection. + /// Request body. + /// The cancellation token to use. + /// , , , or is null. + public async Task ApproveOrRejectPrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (privateEndpointWrapper == null) + { + throw new ArgumentNullException(nameof(privateEndpointWrapper)); + } + + using var message = CreateApproveOrRejectPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Approves or rejects a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the private endpoint connection. + /// Request body. + /// The cancellation token to use. + /// , , , or is null. + public Response ApproveOrRejectPrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (privateEndpointWrapper == null) + { + throw new ArgumentNullException(nameof(privateEndpointWrapper)); + } + + using var message = CreateApproveOrRejectPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeletePrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the private endpoint connection. + /// The cancellation token to use. + /// , , or is null. + public async Task DeletePrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the private endpoint connection. + /// The cancellation token to use. + /// , , or is null. + public Response DeletePrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateLinkResourcesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the private link resources. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The cancellation token to use. + /// or is null. + public async Task> GetPrivateLinkResourcesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateLinkResourcesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourcesWrapper value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the private link resources. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The cancellation token to use. + /// or is null. + public Response GetPrivateLinkResources(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateLinkResourcesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourcesWrapper value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateResetStaticSiteApiKeyRequest(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/resetapikey", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(resetPropertiesEnvelope); + request.Content = content; + return message; + } + + /// Description for Resets the api key for an existing static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The StaticSiteResetPropertiesARMResource to use. + /// The cancellation token to use. + /// , , or is null. + public async Task ResetStaticSiteApiKeyAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (resetPropertiesEnvelope == null) + { + throw new ArgumentNullException(nameof(resetPropertiesEnvelope)); + } + + using var message = CreateResetStaticSiteApiKeyRequest(resourceGroupName, name, resetPropertiesEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Resets the api key for an existing static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The StaticSiteResetPropertiesARMResource to use. + /// The cancellation token to use. + /// , , or is null. + public Response ResetStaticSiteApiKey(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (resetPropertiesEnvelope == null) + { + throw new ArgumentNullException(nameof(resetPropertiesEnvelope)); + } + + using var message = CreateResetStaticSiteApiKeyRequest(resourceGroupName, name, resetPropertiesEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetUserProvidedFunctionAppsForStaticSiteRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/userProvidedFunctionApps", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the details of the user provided function apps registered with a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public async Task> GetUserProvidedFunctionAppsForStaticSiteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetUserProvidedFunctionAppsForStaticSiteRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserProvidedFunctionAppsCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the details of the user provided function apps registered with a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// or is null. + public Response GetUserProvidedFunctionAppsForStaticSite(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetUserProvidedFunctionAppsForStaticSiteRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserProvidedFunctionAppsCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetUserProvidedFunctionAppForStaticSiteRequest(string resourceGroupName, string name, string functionAppName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/userProvidedFunctionApps/", false); + uri.AppendPath(functionAppName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the details of the user provided function app registered with a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the function app registered with the static site. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetUserProvidedFunctionAppForStaticSiteAsync(string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionAppName == null) + { + throw new ArgumentNullException(nameof(functionAppName)); + } + + using var message = CreateGetUserProvidedFunctionAppForStaticSiteRequest(resourceGroupName, name, functionAppName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserProvidedFunctionAppARMResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteUserProvidedFunctionAppARMResource.DeserializeStaticSiteUserProvidedFunctionAppARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the details of the user provided function app registered with a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the function app registered with the static site. + /// The cancellation token to use. + /// , , or is null. + public Response GetUserProvidedFunctionAppForStaticSite(string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionAppName == null) + { + throw new ArgumentNullException(nameof(functionAppName)); + } + + using var message = CreateGetUserProvidedFunctionAppForStaticSiteRequest(resourceGroupName, name, functionAppName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserProvidedFunctionAppARMResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteUserProvidedFunctionAppARMResource.DeserializeStaticSiteUserProvidedFunctionAppARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRegisterUserProvidedFunctionAppWithStaticSiteRequest(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/userProvidedFunctionApps/", false); + uri.AppendPath(functionAppName, true); + if (isForced != null) + { + uri.AppendQuery("isForced", isForced.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(staticSiteUserProvidedFunctionEnvelope); + request.Content = content; + return message; + } + + /// Description for Register a user provided function app with a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the function app to register with the static site. + /// A JSON representation of the user provided function app properties. See example. + /// Specify <code>true</code> to force the update of the auth configuration on the function app even if an AzureStaticWebApps provider is already configured on the function app. The default is <code>false</code>. + /// The cancellation token to use. + /// , , , or is null. + public async Task RegisterUserProvidedFunctionAppWithStaticSiteAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionAppName == null) + { + throw new ArgumentNullException(nameof(functionAppName)); + } + if (staticSiteUserProvidedFunctionEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteUserProvidedFunctionEnvelope)); + } + + using var message = CreateRegisterUserProvidedFunctionAppWithStaticSiteRequest(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Register a user provided function app with a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the function app to register with the static site. + /// A JSON representation of the user provided function app properties. See example. + /// Specify <code>true</code> to force the update of the auth configuration on the function app even if an AzureStaticWebApps provider is already configured on the function app. The default is <code>false</code>. + /// The cancellation token to use. + /// , , , or is null. + public Response RegisterUserProvidedFunctionAppWithStaticSite(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionAppName == null) + { + throw new ArgumentNullException(nameof(functionAppName)); + } + if (staticSiteUserProvidedFunctionEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteUserProvidedFunctionEnvelope)); + } + + using var message = CreateRegisterUserProvidedFunctionAppWithStaticSiteRequest(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDetachUserProvidedFunctionAppFromStaticSiteRequest(string resourceGroupName, string name, string functionAppName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/userProvidedFunctionApps/", false); + uri.AppendPath(functionAppName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Detach the user provided function app from the static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the function app registered with the static site. + /// The cancellation token to use. + /// , , or is null. + public async Task DetachUserProvidedFunctionAppFromStaticSiteAsync(string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionAppName == null) + { + throw new ArgumentNullException(nameof(functionAppName)); + } + + using var message = CreateDetachUserProvidedFunctionAppFromStaticSiteRequest(resourceGroupName, name, functionAppName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Detach the user provided function app from the static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// Name of the function app registered with the static site. + /// The cancellation token to use. + /// , , or is null. + public Response DetachUserProvidedFunctionAppFromStaticSite(string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionAppName == null) + { + throw new ArgumentNullException(nameof(functionAppName)); + } + + using var message = CreateDetachUserProvidedFunctionAppFromStaticSiteRequest(resourceGroupName, name, functionAppName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateZipDeploymentForStaticSiteRequest(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/zipdeploy", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(staticSiteZipDeploymentEnvelope); + request.Content = content; + return message; + } + + /// Description for Deploys zipped content to a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// A JSON representation of the StaticSiteZipDeployment properties. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task CreateZipDeploymentForStaticSiteAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (staticSiteZipDeploymentEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteZipDeploymentEnvelope)); + } + + using var message = CreateCreateZipDeploymentForStaticSiteRequest(resourceGroupName, name, staticSiteZipDeploymentEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deploys zipped content to a static site. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// A JSON representation of the StaticSiteZipDeployment properties. See example. + /// The cancellation token to use. + /// , , or is null. + public Response CreateZipDeploymentForStaticSite(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (staticSiteZipDeploymentEnvelope == null) + { + throw new ArgumentNullException(nameof(staticSiteZipDeploymentEnvelope)); + } + + using var message = CreateCreateZipDeploymentForStaticSiteRequest(resourceGroupName, name, staticSiteZipDeploymentEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all Static Sites for a subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all Static Sites for a subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetStaticSitesByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all static sites in the specified resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public async Task> GetStaticSitesByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateGetStaticSitesByResourceGroupNextPageRequest(nextLink, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all static sites in the specified resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// The cancellation token to use. + /// or is null. + public Response GetStaticSitesByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateGetStaticSitesByResourceGroupNextPageRequest(nextLink, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteUsersNextPageRequest(string nextLink, string resourceGroupName, string name, string authprovider) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the list of users of a static site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The auth provider for the users. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListStaticSiteUsersNextPageAsync(string nextLink, string resourceGroupName, string name, string authprovider, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (authprovider == null) + { + throw new ArgumentNullException(nameof(authprovider)); + } + + using var message = CreateListStaticSiteUsersNextPageRequest(nextLink, resourceGroupName, name, authprovider); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteUserCollection.DeserializeStaticSiteUserCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the list of users of a static site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The auth provider for the users. + /// The cancellation token to use. + /// , , , or is null. + public Response ListStaticSiteUsersNextPage(string nextLink, string resourceGroupName, string name, string authprovider, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (authprovider == null) + { + throw new ArgumentNullException(nameof(authprovider)); + } + + using var message = CreateListStaticSiteUsersNextPageRequest(nextLink, resourceGroupName, name, authprovider); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteUserCollection.DeserializeStaticSiteUserCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetStaticSiteBuildsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all static site builds for a particular static site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetStaticSiteBuildsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetStaticSiteBuildsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteBuildCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteBuildCollection.DeserializeStaticSiteBuildCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all static site builds for a particular static site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// , , or is null. + public Response GetStaticSiteBuildsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetStaticSiteBuildsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteBuildCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteBuildCollection.DeserializeStaticSiteBuildCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteBuildFunctionsNextPageRequest(string nextLink, string resourceGroupName, string name, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the functions of a particular static site build. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListStaticSiteBuildFunctionsNextPageAsync(string nextLink, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateListStaticSiteBuildFunctionsNextPageRequest(nextLink, resourceGroupName, name, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteFunctionOverviewCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the functions of a particular static site build. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , , or is null. + public Response ListStaticSiteBuildFunctionsNextPage(string nextLink, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateListStaticSiteBuildFunctionsNextPageRequest(nextLink, resourceGroupName, name, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteFunctionOverviewCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetUserProvidedFunctionAppsForStaticSiteBuildNextPageRequest(string nextLink, string resourceGroupName, string name, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the details of the user provided function apps registered with a static site build. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetUserProvidedFunctionAppsForStaticSiteBuildNextPageAsync(string nextLink, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateGetUserProvidedFunctionAppsForStaticSiteBuildNextPageRequest(nextLink, resourceGroupName, name, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserProvidedFunctionAppsCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the details of the user provided function apps registered with a static site build. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The stage site identifier. + /// The cancellation token to use. + /// , , , or is null. + public Response GetUserProvidedFunctionAppsForStaticSiteBuildNextPage(string nextLink, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (environmentName == null) + { + throw new ArgumentNullException(nameof(environmentName)); + } + + using var message = CreateGetUserProvidedFunctionAppsForStaticSiteBuildNextPageRequest(nextLink, resourceGroupName, name, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserProvidedFunctionAppsCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteCustomDomainsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all static site custom domains for a particular static site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site resource to search in. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListStaticSiteCustomDomainsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteCustomDomainsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCustomDomainOverviewCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteCustomDomainOverviewCollection.DeserializeStaticSiteCustomDomainOverviewCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all static site custom domains for a particular static site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site resource to search in. + /// The cancellation token to use. + /// , , or is null. + public Response ListStaticSiteCustomDomainsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteCustomDomainsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteCustomDomainOverviewCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteCustomDomainOverviewCollection.DeserializeStaticSiteCustomDomainOverviewCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListStaticSiteFunctionsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the functions of a static site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListStaticSiteFunctionsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteFunctionsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteFunctionOverviewCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the functions of a static site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// , , or is null. + public Response ListStaticSiteFunctionsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListStaticSiteFunctionsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteFunctionOverviewCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateEndpointConnectionListNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the list of private endpoint connections associated with a static site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetPrivateEndpointConnectionListNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateEndpointConnectionListNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the list of private endpoint connections associated with a static site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// , , or is null. + public Response GetPrivateEndpointConnectionListNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateEndpointConnectionListNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetUserProvidedFunctionAppsForStaticSiteNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the details of the user provided function apps registered with a static site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetUserProvidedFunctionAppsForStaticSiteNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetUserProvidedFunctionAppsForStaticSiteNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserProvidedFunctionAppsCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the details of the user provided function apps registered with a static site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the static site. + /// The cancellation token to use. + /// , , or is null. + public Response GetUserProvidedFunctionAppsForStaticSiteNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetUserProvidedFunctionAppsForStaticSiteNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StaticSiteUserProvidedFunctionAppsCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/TopLevelDomainsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/TopLevelDomainsRestClient.cs new file mode 100644 index 000000000000..d301ad14ee43 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/TopLevelDomainsRestClient.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class TopLevelDomainsRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of TopLevelDomainsRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public TopLevelDomainsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/topLevelDomains", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all top-level domains supported for registration. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TopLevelDomainCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TopLevelDomainCollection.DeserializeTopLevelDomainCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all top-level domains supported for registration. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TopLevelDomainCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TopLevelDomainCollection.DeserializeTopLevelDomainCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/topLevelDomains/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get details of a top-level domain. + /// Name of the top-level domain. + /// The cancellation token to use. + /// is null. + public async Task> GetAsync(string name, CancellationToken cancellationToken = default) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRequest(name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TopLevelDomain value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TopLevelDomain.DeserializeTopLevelDomain(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get details of a top-level domain. + /// Name of the top-level domain. + /// The cancellation token to use. + /// is null. + public Response Get(string name, CancellationToken cancellationToken = default) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRequest(name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TopLevelDomain value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TopLevelDomain.DeserializeTopLevelDomain(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListAgreementsRequest(string name, TopLevelDomainAgreementOption agreementOption) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DomainRegistration/topLevelDomains/", false); + uri.AppendPath(name, true); + uri.AppendPath("/listAgreements", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(agreementOption); + request.Content = content; + return message; + } + + /// Description for Gets all legal agreements that user needs to accept before purchasing a domain. + /// Name of the top-level domain. + /// Domain agreement options. + /// The cancellation token to use. + /// or is null. + public async Task> ListAgreementsAsync(string name, TopLevelDomainAgreementOption agreementOption, CancellationToken cancellationToken = default) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (agreementOption == null) + { + throw new ArgumentNullException(nameof(agreementOption)); + } + + using var message = CreateListAgreementsRequest(name, agreementOption); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TldLegalAgreementCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TldLegalAgreementCollection.DeserializeTldLegalAgreementCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all legal agreements that user needs to accept before purchasing a domain. + /// Name of the top-level domain. + /// Domain agreement options. + /// The cancellation token to use. + /// or is null. + public Response ListAgreements(string name, TopLevelDomainAgreementOption agreementOption, CancellationToken cancellationToken = default) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (agreementOption == null) + { + throw new ArgumentNullException(nameof(agreementOption)); + } + + using var message = CreateListAgreementsRequest(name, agreementOption); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TldLegalAgreementCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TldLegalAgreementCollection.DeserializeTldLegalAgreementCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all top-level domains supported for registration. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TopLevelDomainCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TopLevelDomainCollection.DeserializeTopLevelDomainCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all top-level domains supported for registration. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TopLevelDomainCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TopLevelDomainCollection.DeserializeTopLevelDomainCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListAgreementsNextPageRequest(string nextLink, string name, TopLevelDomainAgreementOption agreementOption) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all legal agreements that user needs to accept before purchasing a domain. + /// The URL to the next page of results. + /// Name of the top-level domain. + /// Domain agreement options. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListAgreementsNextPageAsync(string nextLink, string name, TopLevelDomainAgreementOption agreementOption, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (agreementOption == null) + { + throw new ArgumentNullException(nameof(agreementOption)); + } + + using var message = CreateListAgreementsNextPageRequest(nextLink, name, agreementOption); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TldLegalAgreementCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TldLegalAgreementCollection.DeserializeTldLegalAgreementCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all legal agreements that user needs to accept before purchasing a domain. + /// The URL to the next page of results. + /// Name of the top-level domain. + /// Domain agreement options. + /// The cancellation token to use. + /// , , or is null. + public Response ListAgreementsNextPage(string nextLink, string name, TopLevelDomainAgreementOption agreementOption, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (agreementOption == null) + { + throw new ArgumentNullException(nameof(agreementOption)); + } + + using var message = CreateListAgreementsNextPageRequest(nextLink, name, agreementOption); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TldLegalAgreementCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TldLegalAgreementCollection.DeserializeTldLegalAgreementCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsRestClient.cs new file mode 100644 index 000000000000..b15a8aec7e77 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsRestClient.cs @@ -0,0 +1,44343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class WebAppsRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of WebAppsRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public WebAppsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/sites", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all apps for a subscription. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all apps for a subscription. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName, bool? includeSlots) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites", false); + if (includeSlots != null) + { + uri.AppendQuery("includeSlots", includeSlots.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all web, mobile, and API apps in the specified resource group. + /// Name of the resource group to which the resource belongs. + /// Specify <strong>true</strong> to include deployment slots in results. The default is false, which only gives you the production slot of all apps. + /// The cancellation token to use. + /// is null. + public async Task> ListByResourceGroupAsync(string resourceGroupName, bool? includeSlots = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName, includeSlots); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all web, mobile, and API apps in the specified resource group. + /// Name of the resource group to which the resource belongs. + /// Specify <strong>true</strong> to include deployment slots in results. The default is false, which only gives you the production slot of all apps. + /// The cancellation token to use. + /// is null. + public Response ListByResourceGroup(string resourceGroupName, bool? includeSlots = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupRequest(resourceGroupName, includeSlots); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the details of a web, mobile, or API app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Site value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Site.DeserializeSite(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((Site)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the details of a web, mobile, or API app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response Get(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Site value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Site.DeserializeSite(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((Site)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string name, Site siteEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + /// Name of the resource group to which the resource belongs. + /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. + /// A JSON representation of the app properties. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task CreateOrUpdateAsync(string resourceGroupName, string name, Site siteEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteEnvelope == null) + { + throw new ArgumentNullException(nameof(siteEnvelope)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, siteEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + /// Name of the resource group to which the resource belongs. + /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. + /// A JSON representation of the app properties. See example. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdate(string resourceGroupName, string name, Site siteEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteEnvelope == null) + { + throw new ArgumentNullException(nameof(siteEnvelope)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, siteEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string name, bool? deleteMetrics, bool? deleteEmptyServerFarm) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + if (deleteMetrics != null) + { + uri.AppendQuery("deleteMetrics", deleteMetrics.Value, true); + } + if (deleteEmptyServerFarm != null) + { + uri.AppendQuery("deleteEmptyServerFarm", deleteEmptyServerFarm.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a web, mobile, or API app, or one of the deployment slots. + /// Name of the resource group to which the resource belongs. + /// Name of the app to delete. + /// If true, web app metrics are also deleted. + /// Specify false if you want to keep empty App Service plan. By default, empty App Service plan is deleted. + /// The cancellation token to use. + /// or is null. + public async Task DeleteAsync(string resourceGroupName, string name, bool? deleteMetrics = null, bool? deleteEmptyServerFarm = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteRequest(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a web, mobile, or API app, or one of the deployment slots. + /// Name of the resource group to which the resource belongs. + /// Name of the app to delete. + /// If true, web app metrics are also deleted. + /// Specify false if you want to keep empty App Service plan. By default, empty App Service plan is deleted. + /// The cancellation token to use. + /// or is null. + public Response Delete(string resourceGroupName, string name, bool? deleteMetrics = null, bool? deleteEmptyServerFarm = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteRequest(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string resourceGroupName, string name, SitePatchResource siteEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + /// Name of the resource group to which the resource belongs. + /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. + /// A JSON representation of the app properties. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateAsync(string resourceGroupName, string name, SitePatchResource siteEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteEnvelope == null) + { + throw new ArgumentNullException(nameof(siteEnvelope)); + } + + using var message = CreateUpdateRequest(resourceGroupName, name, siteEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + { + Site value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Site.DeserializeSite(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + /// Name of the resource group to which the resource belongs. + /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. + /// A JSON representation of the app properties. See example. + /// The cancellation token to use. + /// , , or is null. + public Response Update(string resourceGroupName, string name, SitePatchResource siteEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteEnvelope == null) + { + throw new ArgumentNullException(nameof(siteEnvelope)); + } + + using var message = CreateUpdateRequest(resourceGroupName, name, siteEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + { + Site value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Site.DeserializeSite(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateAnalyzeCustomHostnameRequest(string resourceGroupName, string name, string hostName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/analyzeCustomHostname", false); + if (hostName != null) + { + uri.AppendQuery("hostName", hostName, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Analyze a custom hostname. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Custom hostname. + /// The cancellation token to use. + /// or is null. + public async Task> AnalyzeCustomHostnameAsync(string resourceGroupName, string name, string hostName = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateAnalyzeCustomHostnameRequest(resourceGroupName, name, hostName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CustomHostnameAnalysisResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CustomHostnameAnalysisResult.DeserializeCustomHostnameAnalysisResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Analyze a custom hostname. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Custom hostname. + /// The cancellation token to use. + /// or is null. + public Response AnalyzeCustomHostname(string resourceGroupName, string name, string hostName = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateAnalyzeCustomHostnameRequest(resourceGroupName, name, hostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CustomHostnameAnalysisResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CustomHostnameAnalysisResult.DeserializeCustomHostnameAnalysisResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateApplySlotConfigToProductionRequest(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/applySlotConfig", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(slotSwapEntity); + request.Content = content; + return message; + } + + /// Description for Applies the configuration settings from the target slot onto the current slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task ApplySlotConfigToProductionAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateApplySlotConfigToProductionRequest(resourceGroupName, name, slotSwapEntity); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Applies the configuration settings from the target slot onto the current slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , or is null. + public Response ApplySlotConfigToProduction(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateApplySlotConfigToProductionRequest(resourceGroupName, name, slotSwapEntity); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateBackupRequest(string resourceGroupName, string name, BackupRequest request) + { + var message = _pipeline.CreateMessage(); + var request0 = message.Request; + request0.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/backup", false); + uri.AppendQuery("api-version", apiVersion, true); + request0.Uri = uri; + request0.Headers.Add("Accept", "application/json"); + request0.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(request); + request0.Content = content; + return message; + } + + /// Description for Creates a backup of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Backup configuration. You can use the JSON response from the POST action as input here. + /// The cancellation token to use. + /// , , or is null. + public async Task> BackupAsync(string resourceGroupName, string name, BackupRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateBackupRequest(resourceGroupName, name, request); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItem value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItem.DeserializeBackupItem(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a backup of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Backup configuration. You can use the JSON response from the POST action as input here. + /// The cancellation token to use. + /// , , or is null. + public Response Backup(string resourceGroupName, string name, BackupRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateBackupRequest(resourceGroupName, name, request); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItem value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItem.DeserializeBackupItem(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBackupsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/backups", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets existing backups of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListBackupsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListBackupsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets existing backups of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListBackups(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListBackupsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetBackupStatusRequest(string resourceGroupName, string name, string backupId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/backups/", false); + uri.AppendPath(backupId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a backup of an app by its ID. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of the backup. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetBackupStatusAsync(string resourceGroupName, string name, string backupId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + + using var message = CreateGetBackupStatusRequest(resourceGroupName, name, backupId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItem value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItem.DeserializeBackupItem(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a backup of an app by its ID. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of the backup. + /// The cancellation token to use. + /// , , or is null. + public Response GetBackupStatus(string resourceGroupName, string name, string backupId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + + using var message = CreateGetBackupStatusRequest(resourceGroupName, name, backupId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItem value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItem.DeserializeBackupItem(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteBackupRequest(string resourceGroupName, string name, string backupId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/backups/", false); + uri.AppendPath(backupId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a backup of an app by its ID. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of the backup. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteBackupAsync(string resourceGroupName, string name, string backupId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + + using var message = CreateDeleteBackupRequest(resourceGroupName, name, backupId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a backup of an app by its ID. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of the backup. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteBackup(string resourceGroupName, string name, string backupId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + + using var message = CreateDeleteBackupRequest(resourceGroupName, name, backupId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBackupStatusSecretsRequest(string resourceGroupName, string name, string backupId, BackupRequest request) + { + var message = _pipeline.CreateMessage(); + var request0 = message.Request; + request0.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/backups/", false); + uri.AppendPath(backupId, true); + uri.AppendPath("/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request0.Uri = uri; + request0.Headers.Add("Accept", "application/json"); + request0.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(request); + request0.Content = content; + return message; + } + + /// Description for Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// ID of backup. + /// Information on backup request. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListBackupStatusSecretsAsync(string resourceGroupName, string name, string backupId, BackupRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateListBackupStatusSecretsRequest(resourceGroupName, name, backupId, request); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItem value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItem.DeserializeBackupItem(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// ID of backup. + /// Information on backup request. + /// The cancellation token to use. + /// , , , or is null. + public Response ListBackupStatusSecrets(string resourceGroupName, string name, string backupId, BackupRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateListBackupStatusSecretsRequest(resourceGroupName, name, backupId, request); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItem value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItem.DeserializeBackupItem(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRestoreRequest(string resourceGroupName, string name, string backupId, RestoreRequest request) + { + var message = _pipeline.CreateMessage(); + var request0 = message.Request; + request0.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/backups/", false); + uri.AppendPath(backupId, true); + uri.AppendPath("/restore", false); + uri.AppendQuery("api-version", apiVersion, true); + request0.Uri = uri; + request0.Headers.Add("Accept", "application/json"); + request0.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(request); + request0.Content = content; + return message; + } + + /// Description for Restores a specific backup to another app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of the backup. + /// Information on restore request . + /// The cancellation token to use. + /// , , , or is null. + public async Task RestoreAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateRestoreRequest(resourceGroupName, name, backupId, request); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Restores a specific backup to another app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of the backup. + /// Information on restore request . + /// The cancellation token to use. + /// , , , or is null. + public Response Restore(string resourceGroupName, string name, string backupId, RestoreRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateRestoreRequest(resourceGroupName, name, backupId, request); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetBasicPublishingCredentialsPoliciesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/basicPublishingCredentialsPolicies", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetBasicPublishingCredentialsPoliciesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetBasicPublishingCredentialsPoliciesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmPublishingCredentialsPoliciesCollection.DeserializeCsmPublishingCredentialsPoliciesCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GetBasicPublishingCredentialsPolicies(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetBasicPublishingCredentialsPoliciesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmPublishingCredentialsPoliciesCollection.DeserializeCsmPublishingCredentialsPoliciesCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetFtpAllowedRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/basicPublishingCredentialsPolicies/ftp", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns whether FTP is allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetFtpAllowedAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetFtpAllowedRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns whether FTP is allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GetFtpAllowed(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetFtpAllowedRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateFtpAllowedRequest(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/basicPublishingCredentialsPolicies/ftp", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(csmPublishingAccessPoliciesEntity); + request.Content = content; + return message; + } + + /// Description for Updates whether FTP is allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The CsmPublishingCredentialsPoliciesEntity to use. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateFtpAllowedAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (csmPublishingAccessPoliciesEntity == null) + { + throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); + } + + using var message = CreateUpdateFtpAllowedRequest(resourceGroupName, name, csmPublishingAccessPoliciesEntity); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates whether FTP is allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The CsmPublishingCredentialsPoliciesEntity to use. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateFtpAllowed(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (csmPublishingAccessPoliciesEntity == null) + { + throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); + } + + using var message = CreateUpdateFtpAllowedRequest(resourceGroupName, name, csmPublishingAccessPoliciesEntity); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetScmAllowedRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/basicPublishingCredentialsPolicies/scm", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns whether Scm basic auth is allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetScmAllowedAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetScmAllowedRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns whether Scm basic auth is allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GetScmAllowed(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetScmAllowedRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateScmAllowedRequest(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/basicPublishingCredentialsPolicies/scm", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(csmPublishingAccessPoliciesEntity); + request.Content = content; + return message; + } + + /// Description for Updates whether user publishing credentials are allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The CsmPublishingCredentialsPoliciesEntity to use. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateScmAllowedAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (csmPublishingAccessPoliciesEntity == null) + { + throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); + } + + using var message = CreateUpdateScmAllowedRequest(resourceGroupName, name, csmPublishingAccessPoliciesEntity); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates whether user publishing credentials are allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The CsmPublishingCredentialsPoliciesEntity to use. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateScmAllowed(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (csmPublishingAccessPoliciesEntity == null) + { + throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); + } + + using var message = CreateUpdateScmAllowedRequest(resourceGroupName, name, csmPublishingAccessPoliciesEntity); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConfigurationsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the configurations of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListConfigurationsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListConfigurationsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResourceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the configurations of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListConfigurations(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListConfigurationsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResourceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateApplicationSettingsRequest(string resourceGroupName, string name, StringDictionary appSettings) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/appsettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(appSettings); + request.Content = content; + return message; + } + + /// Description for Replaces the application settings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Application settings of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateApplicationSettingsAsync(string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appSettings == null) + { + throw new ArgumentNullException(nameof(appSettings)); + } + + using var message = CreateUpdateApplicationSettingsRequest(resourceGroupName, name, appSettings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Replaces the application settings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Application settings of the app. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateApplicationSettings(string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appSettings == null) + { + throw new ArgumentNullException(nameof(appSettings)); + } + + using var message = CreateUpdateApplicationSettingsRequest(resourceGroupName, name, appSettings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListApplicationSettingsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/appsettings/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the application settings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListApplicationSettingsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListApplicationSettingsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the application settings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListApplicationSettings(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListApplicationSettingsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateAuthSettingsRequest(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/authsettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteAuthSettings); + request.Content = content; + return message; + } + + /// Description for Updates the Authentication / Authorization settings associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateAuthSettingsAsync(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteAuthSettings == null) + { + throw new ArgumentNullException(nameof(siteAuthSettings)); + } + + using var message = CreateUpdateAuthSettingsRequest(resourceGroupName, name, siteAuthSettings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettings value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the Authentication / Authorization settings associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateAuthSettings(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteAuthSettings == null) + { + throw new ArgumentNullException(nameof(siteAuthSettings)); + } + + using var message = CreateUpdateAuthSettingsRequest(resourceGroupName, name, siteAuthSettings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettings value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAuthSettingsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/authsettings/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the Authentication/Authorization settings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetAuthSettingsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetAuthSettingsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettings value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the Authentication/Authorization settings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GetAuthSettings(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetAuthSettingsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettings value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateAuthSettingsV2Request(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/authsettingsV2", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteAuthSettingsV2); + request.Content = content; + return message; + } + + /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateAuthSettingsV2Async(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteAuthSettingsV2 == null) + { + throw new ArgumentNullException(nameof(siteAuthSettingsV2)); + } + + using var message = CreateUpdateAuthSettingsV2Request(resourceGroupName, name, siteAuthSettingsV2); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettingsV2 value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateAuthSettingsV2(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteAuthSettingsV2 == null) + { + throw new ArgumentNullException(nameof(siteAuthSettingsV2)); + } + + using var message = CreateUpdateAuthSettingsV2Request(resourceGroupName, name, siteAuthSettingsV2); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettingsV2 value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAuthSettingsV2Request(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/authsettingsV2/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetAuthSettingsV2Async(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetAuthSettingsV2Request(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettingsV2 value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GetAuthSettingsV2(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetAuthSettingsV2Request(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettingsV2 value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateAzureStorageAccountsRequest(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/azurestorageaccounts", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(azureStorageAccounts); + request.Content = content; + return message; + } + + /// Description for Updates the Azure storage account configurations of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Azure storage accounts of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateAzureStorageAccountsAsync(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (azureStorageAccounts == null) + { + throw new ArgumentNullException(nameof(azureStorageAccounts)); + } + + using var message = CreateUpdateAzureStorageAccountsRequest(resourceGroupName, name, azureStorageAccounts); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AzureStoragePropertyDictionaryResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the Azure storage account configurations of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Azure storage accounts of the app. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateAzureStorageAccounts(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (azureStorageAccounts == null) + { + throw new ArgumentNullException(nameof(azureStorageAccounts)); + } + + using var message = CreateUpdateAzureStorageAccountsRequest(resourceGroupName, name, azureStorageAccounts); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AzureStoragePropertyDictionaryResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListAzureStorageAccountsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/azurestorageaccounts/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the Azure storage account configurations of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListAzureStorageAccountsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListAzureStorageAccountsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AzureStoragePropertyDictionaryResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the Azure storage account configurations of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListAzureStorageAccounts(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListAzureStorageAccountsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AzureStoragePropertyDictionaryResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateBackupConfigurationRequest(string resourceGroupName, string name, BackupRequest request) + { + var message = _pipeline.CreateMessage(); + var request0 = message.Request; + request0.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/backup", false); + uri.AppendQuery("api-version", apiVersion, true); + request0.Uri = uri; + request0.Headers.Add("Accept", "application/json"); + request0.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(request); + request0.Content = content; + return message; + } + + /// Description for Updates the backup configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Edited backup configuration. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateBackupConfigurationAsync(string resourceGroupName, string name, BackupRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateUpdateBackupConfigurationRequest(resourceGroupName, name, request); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupRequest value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupRequest.DeserializeBackupRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the backup configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Edited backup configuration. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateBackupConfiguration(string resourceGroupName, string name, BackupRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateUpdateBackupConfigurationRequest(resourceGroupName, name, request); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupRequest value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupRequest.DeserializeBackupRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteBackupConfigurationRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/backup", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes the backup configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task DeleteBackupConfigurationAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteBackupConfigurationRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes the backup configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response DeleteBackupConfiguration(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteBackupConfigurationRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetBackupConfigurationRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/backup/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the backup configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetBackupConfigurationAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetBackupConfigurationRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupRequest value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupRequest.DeserializeBackupRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the backup configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GetBackupConfiguration(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetBackupConfigurationRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupRequest value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupRequest.DeserializeBackupRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAppSettingsKeyVaultReferencesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/configreferences/appsettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the config reference app settings and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetAppSettingsKeyVaultReferencesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetAppSettingsKeyVaultReferencesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the config reference app settings and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GetAppSettingsKeyVaultReferences(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetAppSettingsKeyVaultReferencesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAppSettingKeyVaultReferenceRequest(string resourceGroupName, string name, string appSettingKey) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/configreferences/appsettings/", false); + uri.AppendPath(appSettingKey, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the config reference and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// App Setting key name. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetAppSettingKeyVaultReferenceAsync(string resourceGroupName, string name, string appSettingKey, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appSettingKey == null) + { + throw new ArgumentNullException(nameof(appSettingKey)); + } + + using var message = CreateGetAppSettingKeyVaultReferenceRequest(resourceGroupName, name, appSettingKey); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKVReference value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApiKVReference.DeserializeApiKVReference(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the config reference and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// App Setting key name. + /// The cancellation token to use. + /// , , or is null. + public Response GetAppSettingKeyVaultReference(string resourceGroupName, string name, string appSettingKey, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appSettingKey == null) + { + throw new ArgumentNullException(nameof(appSettingKey)); + } + + using var message = CreateGetAppSettingKeyVaultReferenceRequest(resourceGroupName, name, appSettingKey); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKVReference value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApiKVReference.DeserializeApiKVReference(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteConnectionStringKeyVaultReferencesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/configreferences/connectionstrings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the config reference app settings and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetSiteConnectionStringKeyVaultReferencesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetSiteConnectionStringKeyVaultReferencesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the config reference app settings and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GetSiteConnectionStringKeyVaultReferences(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetSiteConnectionStringKeyVaultReferencesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteConnectionStringKeyVaultReferenceRequest(string resourceGroupName, string name, string connectionStringKey) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/configreferences/connectionstrings/", false); + uri.AppendPath(connectionStringKey, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the config reference and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetSiteConnectionStringKeyVaultReferenceAsync(string resourceGroupName, string name, string connectionStringKey, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (connectionStringKey == null) + { + throw new ArgumentNullException(nameof(connectionStringKey)); + } + + using var message = CreateGetSiteConnectionStringKeyVaultReferenceRequest(resourceGroupName, name, connectionStringKey); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKVReference value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApiKVReference.DeserializeApiKVReference(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the config reference and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response GetSiteConnectionStringKeyVaultReference(string resourceGroupName, string name, string connectionStringKey, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (connectionStringKey == null) + { + throw new ArgumentNullException(nameof(connectionStringKey)); + } + + using var message = CreateGetSiteConnectionStringKeyVaultReferenceRequest(resourceGroupName, name, connectionStringKey); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKVReference value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApiKVReference.DeserializeApiKVReference(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateConnectionStringsRequest(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/connectionstrings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionStrings); + request.Content = content; + return message; + } + + /// Description for Replaces the connection strings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Connection strings of the app or deployment slot. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateConnectionStringsAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (connectionStrings == null) + { + throw new ArgumentNullException(nameof(connectionStrings)); + } + + using var message = CreateUpdateConnectionStringsRequest(resourceGroupName, name, connectionStrings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionStringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Replaces the connection strings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Connection strings of the app or deployment slot. See example. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateConnectionStrings(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (connectionStrings == null) + { + throw new ArgumentNullException(nameof(connectionStrings)); + } + + using var message = CreateUpdateConnectionStringsRequest(resourceGroupName, name, connectionStrings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionStringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConnectionStringsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/connectionstrings/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the connection strings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListConnectionStringsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListConnectionStringsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionStringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the connection strings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListConnectionStrings(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListConnectionStringsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionStringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetDiagnosticLogsConfigurationRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/logs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the logging configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetDiagnosticLogsConfigurationAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetDiagnosticLogsConfigurationRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteLogsConfig value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the logging configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GetDiagnosticLogsConfiguration(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetDiagnosticLogsConfigurationRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteLogsConfig value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateDiagnosticLogsConfigRequest(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/logs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteLogsConfig); + request.Content = content; + return message; + } + + /// Description for Updates the logging configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// A SiteLogsConfig JSON object that contains the logging configuration to change in the "properties" property. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateDiagnosticLogsConfigAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteLogsConfig == null) + { + throw new ArgumentNullException(nameof(siteLogsConfig)); + } + + using var message = CreateUpdateDiagnosticLogsConfigRequest(resourceGroupName, name, siteLogsConfig); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteLogsConfig value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the logging configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// A SiteLogsConfig JSON object that contains the logging configuration to change in the "properties" property. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateDiagnosticLogsConfig(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteLogsConfig == null) + { + throw new ArgumentNullException(nameof(siteLogsConfig)); + } + + using var message = CreateUpdateDiagnosticLogsConfigRequest(resourceGroupName, name, siteLogsConfig); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteLogsConfig value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateMetadataRequest(string resourceGroupName, string name, StringDictionary metadata) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/metadata", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(metadata); + request.Content = content; + return message; + } + + /// Description for Replaces the metadata of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Edited metadata of the app or deployment slot. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateMetadataAsync(string resourceGroupName, string name, StringDictionary metadata, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (metadata == null) + { + throw new ArgumentNullException(nameof(metadata)); + } + + using var message = CreateUpdateMetadataRequest(resourceGroupName, name, metadata); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Replaces the metadata of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Edited metadata of the app or deployment slot. See example. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateMetadata(string resourceGroupName, string name, StringDictionary metadata, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (metadata == null) + { + throw new ArgumentNullException(nameof(metadata)); + } + + using var message = CreateUpdateMetadataRequest(resourceGroupName, name, metadata); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListMetadataRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/metadata/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the metadata of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListMetadataAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMetadataRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the metadata of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListMetadata(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListMetadataRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPublishingCredentialsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/publishingcredentials/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the Git/FTP publishing credentials of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task ListPublishingCredentialsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListPublishingCredentialsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the Git/FTP publishing credentials of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListPublishingCredentials(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListPublishingCredentialsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateSitePushSettingsRequest(string resourceGroupName, string name, PushSettings pushSettings) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/pushsettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(pushSettings); + request.Content = content; + return message; + } + + /// Description for Updates the Push settings associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Push settings associated with web app. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateSitePushSettingsAsync(string resourceGroupName, string name, PushSettings pushSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (pushSettings == null) + { + throw new ArgumentNullException(nameof(pushSettings)); + } + + using var message = CreateUpdateSitePushSettingsRequest(resourceGroupName, name, pushSettings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PushSettings value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PushSettings.DeserializePushSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the Push settings associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Push settings associated with web app. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateSitePushSettings(string resourceGroupName, string name, PushSettings pushSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (pushSettings == null) + { + throw new ArgumentNullException(nameof(pushSettings)); + } + + using var message = CreateUpdateSitePushSettingsRequest(resourceGroupName, name, pushSettings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PushSettings value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PushSettings.DeserializePushSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSitePushSettingsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/pushsettings/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the Push settings associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public async Task> ListSitePushSettingsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSitePushSettingsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PushSettings value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PushSettings.DeserializePushSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the Push settings associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public Response ListSitePushSettings(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSitePushSettingsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PushSettings value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PushSettings.DeserializePushSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSlotConfigurationNamesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/slotConfigNames", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the names of app settings and connection strings that stick to the slot (not swapped). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListSlotConfigurationNamesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSlotConfigurationNamesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SlotConfigNamesResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SlotConfigNamesResource.DeserializeSlotConfigNamesResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the names of app settings and connection strings that stick to the slot (not swapped). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListSlotConfigurationNames(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSlotConfigurationNamesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SlotConfigNamesResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SlotConfigNamesResource.DeserializeSlotConfigNamesResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateSlotConfigurationNamesRequest(string resourceGroupName, string name, SlotConfigNamesResource slotConfigNames) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/slotConfigNames", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(slotConfigNames); + request.Content = content; + return message; + } + + /// Description for Updates the names of application settings and connection string that remain with the slot during swap operation. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Names of application settings and connection strings. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateSlotConfigurationNamesAsync(string resourceGroupName, string name, SlotConfigNamesResource slotConfigNames, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slotConfigNames == null) + { + throw new ArgumentNullException(nameof(slotConfigNames)); + } + + using var message = CreateUpdateSlotConfigurationNamesRequest(resourceGroupName, name, slotConfigNames); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SlotConfigNamesResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SlotConfigNamesResource.DeserializeSlotConfigNamesResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the names of application settings and connection string that remain with the slot during swap operation. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Names of application settings and connection strings. See example. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateSlotConfigurationNames(string resourceGroupName, string name, SlotConfigNamesResource slotConfigNames, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slotConfigNames == null) + { + throw new ArgumentNullException(nameof(slotConfigNames)); + } + + using var message = CreateUpdateSlotConfigurationNamesRequest(resourceGroupName, name, slotConfigNames); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SlotConfigNamesResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SlotConfigNamesResource.DeserializeSlotConfigNamesResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetConfigurationRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetConfigurationAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetConfigurationRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GetConfiguration(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetConfigurationRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateConfigurationRequest(string resourceGroupName, string name, SiteConfigResource siteConfig) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteConfig); + request.Content = content; + return message; + } + + /// Description for Updates the configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON representation of a SiteConfig object. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task> CreateOrUpdateConfigurationAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteConfig == null) + { + throw new ArgumentNullException(nameof(siteConfig)); + } + + using var message = CreateCreateOrUpdateConfigurationRequest(resourceGroupName, name, siteConfig); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON representation of a SiteConfig object. See example. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdateConfiguration(string resourceGroupName, string name, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteConfig == null) + { + throw new ArgumentNullException(nameof(siteConfig)); + } + + using var message = CreateCreateOrUpdateConfigurationRequest(resourceGroupName, name, siteConfig); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateConfigurationRequest(string resourceGroupName, string name, SiteConfigResource siteConfig) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteConfig); + request.Content = content; + return message; + } + + /// Description for Updates the configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON representation of a SiteConfig object. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateConfigurationAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteConfig == null) + { + throw new ArgumentNullException(nameof(siteConfig)); + } + + using var message = CreateUpdateConfigurationRequest(resourceGroupName, name, siteConfig); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON representation of a SiteConfig object. See example. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateConfiguration(string resourceGroupName, string name, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteConfig == null) + { + throw new ArgumentNullException(nameof(siteConfig)); + } + + using var message = CreateUpdateConfigurationRequest(resourceGroupName, name, siteConfig); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConfigurationSnapshotInfoRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/web/snapshots", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListConfigurationSnapshotInfoAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListConfigurationSnapshotInfoRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigurationSnapshotInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListConfigurationSnapshotInfo(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListConfigurationSnapshotInfoRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigurationSnapshotInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetConfigurationSnapshotRequest(string resourceGroupName, string name, string snapshotId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/web/snapshots/", false); + uri.AppendPath(snapshotId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a snapshot of the configuration of an app at a previous point in time. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The ID of the snapshot to read. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetConfigurationSnapshotAsync(string resourceGroupName, string name, string snapshotId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (snapshotId == null) + { + throw new ArgumentNullException(nameof(snapshotId)); + } + + using var message = CreateGetConfigurationSnapshotRequest(resourceGroupName, name, snapshotId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a snapshot of the configuration of an app at a previous point in time. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The ID of the snapshot to read. + /// The cancellation token to use. + /// , , or is null. + public Response GetConfigurationSnapshot(string resourceGroupName, string name, string snapshotId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (snapshotId == null) + { + throw new ArgumentNullException(nameof(snapshotId)); + } + + using var message = CreateGetConfigurationSnapshotRequest(resourceGroupName, name, snapshotId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRecoverSiteConfigurationSnapshotRequest(string resourceGroupName, string name, string snapshotId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/config/web/snapshots/", false); + uri.AppendPath(snapshotId, true); + uri.AppendPath("/recover", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Reverts the configuration of an app to a previous snapshot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The ID of the snapshot to read. + /// The cancellation token to use. + /// , , or is null. + public async Task RecoverSiteConfigurationSnapshotAsync(string resourceGroupName, string name, string snapshotId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (snapshotId == null) + { + throw new ArgumentNullException(nameof(snapshotId)); + } + + using var message = CreateRecoverSiteConfigurationSnapshotRequest(resourceGroupName, name, snapshotId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Reverts the configuration of an app to a previous snapshot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The ID of the snapshot to read. + /// The cancellation token to use. + /// , , or is null. + public Response RecoverSiteConfigurationSnapshot(string resourceGroupName, string name, string snapshotId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (snapshotId == null) + { + throw new ArgumentNullException(nameof(snapshotId)); + } + + using var message = CreateRecoverSiteConfigurationSnapshotRequest(resourceGroupName, name, snapshotId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetWebSiteContainerLogsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/containerlogs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/octet-stream"); + return message; + } + + /// Description for Gets the last lines of docker logs for the given site. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public async Task> GetWebSiteContainerLogsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetWebSiteContainerLogsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 204: + return Response.FromValue((Stream)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the last lines of docker logs for the given site. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public Response GetWebSiteContainerLogs(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetWebSiteContainerLogsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 204: + return Response.FromValue((Stream)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetContainerLogsZipRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/containerlogs/zip/download", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/zip"); + return message; + } + + /// Description for Gets the ZIP archived docker log files for the given site. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public async Task> GetContainerLogsZipAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetContainerLogsZipRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 204: + return Response.FromValue((Stream)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the ZIP archived docker log files for the given site. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public Response GetContainerLogsZip(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetContainerLogsZipRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 204: + return Response.FromValue((Stream)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListContinuousWebJobsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/continuouswebjobs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List continuous web jobs for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public async Task> ListContinuousWebJobsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListContinuousWebJobsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContinuousWebJobCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List continuous web jobs for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public Response ListContinuousWebJobs(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListContinuousWebJobsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContinuousWebJobCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetContinuousWebJobRequest(string resourceGroupName, string name, string webJobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/continuouswebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a continuous web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetContinuousWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateGetContinuousWebJobRequest(resourceGroupName, name, webJobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContinuousWebJob value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContinuousWebJob.DeserializeContinuousWebJob(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContinuousWebJob)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a continuous web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public Response GetContinuousWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateGetContinuousWebJobRequest(resourceGroupName, name, webJobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContinuousWebJob value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContinuousWebJob.DeserializeContinuousWebJob(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContinuousWebJob)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteContinuousWebJobRequest(string resourceGroupName, string name, string webJobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/continuouswebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a continuous web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteContinuousWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateDeleteContinuousWebJobRequest(resourceGroupName, name, webJobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a continuous web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteContinuousWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateDeleteContinuousWebJobRequest(resourceGroupName, name, webJobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStartContinuousWebJobRequest(string resourceGroupName, string name, string webJobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/continuouswebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Start a continuous web job for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public async Task StartContinuousWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateStartContinuousWebJobRequest(resourceGroupName, name, webJobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Start a continuous web job for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public Response StartContinuousWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateStartContinuousWebJobRequest(resourceGroupName, name, webJobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStopContinuousWebJobRequest(string resourceGroupName, string name, string webJobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/continuouswebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Stop a continuous web job for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public async Task StopContinuousWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateStopContinuousWebJobRequest(resourceGroupName, name, webJobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Stop a continuous web job for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public Response StopContinuousWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateStopContinuousWebJobRequest(resourceGroupName, name, webJobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListDeploymentsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List deployments for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListDeploymentsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListDeploymentsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List deployments for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListDeployments(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListDeploymentsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetDeploymentRequest(string resourceGroupName, string name, string id) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(id, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a deployment by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Deployment ID. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetDeploymentAsync(string resourceGroupName, string name, string id, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + using var message = CreateGetDeploymentRequest(resourceGroupName, name, id); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Deployment value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Deployment.DeserializeDeployment(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a deployment by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Deployment ID. + /// The cancellation token to use. + /// , , or is null. + public Response GetDeployment(string resourceGroupName, string name, string id, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + using var message = CreateGetDeploymentRequest(resourceGroupName, name, id); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Deployment value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Deployment.DeserializeDeployment(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateDeploymentRequest(string resourceGroupName, string name, string id, Deployment deployment) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(id, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(deployment); + request.Content = content; + return message; + } + + /// Description for Create a deployment for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of an existing deployment. + /// Deployment details. + /// The cancellation token to use. + /// , , , or is null. + public async Task> CreateDeploymentAsync(string resourceGroupName, string name, string id, Deployment deployment, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (deployment == null) + { + throw new ArgumentNullException(nameof(deployment)); + } + + using var message = CreateCreateDeploymentRequest(resourceGroupName, name, id, deployment); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Deployment value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Deployment.DeserializeDeployment(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create a deployment for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of an existing deployment. + /// Deployment details. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateDeployment(string resourceGroupName, string name, string id, Deployment deployment, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (deployment == null) + { + throw new ArgumentNullException(nameof(deployment)); + } + + using var message = CreateCreateDeploymentRequest(resourceGroupName, name, id, deployment); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Deployment value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Deployment.DeserializeDeployment(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteDeploymentRequest(string resourceGroupName, string name, string id) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(id, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a deployment by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Deployment ID. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteDeploymentAsync(string resourceGroupName, string name, string id, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + using var message = CreateDeleteDeploymentRequest(resourceGroupName, name, id); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a deployment by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Deployment ID. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteDeployment(string resourceGroupName, string name, string id, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + using var message = CreateDeleteDeploymentRequest(resourceGroupName, name, id); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListDeploymentLogRequest(string resourceGroupName, string name, string id) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(id, true); + uri.AppendPath("/log", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List deployment log for specific deployment for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The ID of a specific deployment. This is the value of the name property in the JSON response from "GET /api/sites/{siteName}/deployments". + /// The cancellation token to use. + /// , , or is null. + public async Task> ListDeploymentLogAsync(string resourceGroupName, string name, string id, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + using var message = CreateListDeploymentLogRequest(resourceGroupName, name, id); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Deployment value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Deployment.DeserializeDeployment(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List deployment log for specific deployment for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The ID of a specific deployment. This is the value of the name property in the JSON response from "GET /api/sites/{siteName}/deployments". + /// The cancellation token to use. + /// , , or is null. + public Response ListDeploymentLog(string resourceGroupName, string name, string id, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + using var message = CreateListDeploymentLogRequest(resourceGroupName, name, id); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Deployment value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Deployment.DeserializeDeployment(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDiscoverBackupRequest(string resourceGroupName, string name, RestoreRequest request) + { + var message = _pipeline.CreateMessage(); + var request0 = message.Request; + request0.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/discoverbackup", false); + uri.AppendQuery("api-version", apiVersion, true); + request0.Uri = uri; + request0.Headers.Add("Accept", "application/json"); + request0.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(request); + request0.Content = content; + return message; + } + + /// Description for Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. + /// The cancellation token to use. + /// , , or is null. + public async Task> DiscoverBackupAsync(string resourceGroupName, string name, RestoreRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateDiscoverBackupRequest(resourceGroupName, name, request); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RestoreRequest value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RestoreRequest.DeserializeRestoreRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. + /// The cancellation token to use. + /// , , or is null. + public Response DiscoverBackup(string resourceGroupName, string name, RestoreRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateDiscoverBackupRequest(resourceGroupName, name, request); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RestoreRequest value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RestoreRequest.DeserializeRestoreRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListDomainOwnershipIdentifiersRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/domainOwnershipIdentifiers", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Lists ownership identifiers for domain associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListDomainOwnershipIdentifiersAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListDomainOwnershipIdentifiersRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IdentifierCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Lists ownership identifiers for domain associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListDomainOwnershipIdentifiers(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListDomainOwnershipIdentifiersRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IdentifierCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetDomainOwnershipIdentifierRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/domainOwnershipIdentifiers/", false); + uri.AppendPath(domainOwnershipIdentifierName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get domain ownership identifier for web app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetDomainOwnershipIdentifierAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + + using var message = CreateGetDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Identifier value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Identifier.DeserializeIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get domain ownership identifier for web app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// The cancellation token to use. + /// , , or is null. + public Response GetDomainOwnershipIdentifier(string resourceGroupName, string name, string domainOwnershipIdentifierName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + + using var message = CreateGetDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Identifier value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Identifier.DeserializeIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateDomainOwnershipIdentifierRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/domainOwnershipIdentifiers/", false); + uri.AppendPath(domainOwnershipIdentifierName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(domainOwnershipIdentifier); + request.Content = content; + return message; + } + + /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// A JSON representation of the domain ownership properties. + /// The cancellation token to use. + /// , , , or is null. + public async Task> CreateOrUpdateDomainOwnershipIdentifierAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + if (domainOwnershipIdentifier == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); + } + + using var message = CreateCreateOrUpdateDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Identifier value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Identifier.DeserializeIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// A JSON representation of the domain ownership properties. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateDomainOwnershipIdentifier(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + if (domainOwnershipIdentifier == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); + } + + using var message = CreateCreateOrUpdateDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Identifier value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Identifier.DeserializeIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteDomainOwnershipIdentifierRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/domainOwnershipIdentifiers/", false); + uri.AppendPath(domainOwnershipIdentifierName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a domain ownership identifier for a web app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteDomainOwnershipIdentifierAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + + using var message = CreateDeleteDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a domain ownership identifier for a web app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteDomainOwnershipIdentifier(string resourceGroupName, string name, string domainOwnershipIdentifierName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + + using var message = CreateDeleteDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateDomainOwnershipIdentifierRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/domainOwnershipIdentifiers/", false); + uri.AppendPath(domainOwnershipIdentifierName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(domainOwnershipIdentifier); + request.Content = content; + return message; + } + + /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// A JSON representation of the domain ownership properties. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateDomainOwnershipIdentifierAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + if (domainOwnershipIdentifier == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); + } + + using var message = CreateUpdateDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Identifier value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Identifier.DeserializeIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// A JSON representation of the domain ownership properties. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateDomainOwnershipIdentifier(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + if (domainOwnershipIdentifier == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); + } + + using var message = CreateUpdateDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Identifier value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Identifier.DeserializeIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetMSDeployStatusRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/extensions/MSDeploy", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the status of the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public async Task> GetMSDeployStatusAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetMSDeployStatusRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MSDeployStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the status of the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public Response GetMSDeployStatus(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetMSDeployStatusRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MSDeployStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateMSDeployOperationRequest(string resourceGroupName, string name, MSDeploy mSDeploy) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/extensions/MSDeploy", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(mSDeploy); + request.Content = content; + return message; + } + + /// Description for Invoke the MSDeploy web app extension. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Details of MSDeploy operation. + /// The cancellation token to use. + /// , , or is null. + public async Task CreateMSDeployOperationAsync(string resourceGroupName, string name, MSDeploy mSDeploy, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (mSDeploy == null) + { + throw new ArgumentNullException(nameof(mSDeploy)); + } + + using var message = CreateCreateMSDeployOperationRequest(resourceGroupName, name, mSDeploy); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 201: + case 409: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Invoke the MSDeploy web app extension. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Details of MSDeploy operation. + /// The cancellation token to use. + /// , , or is null. + public Response CreateMSDeployOperation(string resourceGroupName, string name, MSDeploy mSDeploy, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (mSDeploy == null) + { + throw new ArgumentNullException(nameof(mSDeploy)); + } + + using var message = CreateCreateMSDeployOperationRequest(resourceGroupName, name, mSDeploy); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 201: + case 409: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetMSDeployLogRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/extensions/MSDeploy/log", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public async Task> GetMSDeployLogAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetMSDeployLogRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MSDeployLog value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MSDeployLog)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public Response GetMSDeployLog(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetMSDeployLogRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MSDeployLog value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MSDeployLog)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListFunctionsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/functions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the functions for a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public async Task> ListFunctionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListFunctionsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionEnvelopeCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the functions for a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public Response ListFunctions(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListFunctionsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionEnvelopeCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetFunctionsAdminTokenRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/functions/admin/token", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Fetch a short lived token that can be exchanged for a master key. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public async Task> GetFunctionsAdminTokenAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetFunctionsAdminTokenRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + string value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = document.RootElement.GetString(); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Fetch a short lived token that can be exchanged for a master key. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public Response GetFunctionsAdminToken(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetFunctionsAdminTokenRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + string value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = document.RootElement.GetString(); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetFunctionRequest(string resourceGroupName, string name, string functionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get function information by its ID for web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetFunctionAsync(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + + using var message = CreateGetFunctionRequest(resourceGroupName, name, functionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionEnvelope value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionEnvelope.DeserializeFunctionEnvelope(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FunctionEnvelope)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get function information by its ID for web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// The cancellation token to use. + /// , , or is null. + public Response GetFunction(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + + using var message = CreateGetFunctionRequest(resourceGroupName, name, functionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionEnvelope value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionEnvelope.DeserializeFunctionEnvelope(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FunctionEnvelope)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateFunctionRequest(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(functionEnvelope); + request.Content = content; + return message; + } + + /// Description for Create function for web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// Function details. + /// The cancellation token to use. + /// , , , or is null. + public async Task CreateFunctionAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (functionEnvelope == null) + { + throw new ArgumentNullException(nameof(functionEnvelope)); + } + + using var message = CreateCreateFunctionRequest(resourceGroupName, name, functionName, functionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 201: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create function for web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// Function details. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateFunction(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (functionEnvelope == null) + { + throw new ArgumentNullException(nameof(functionEnvelope)); + } + + using var message = CreateCreateFunctionRequest(resourceGroupName, name, functionName, functionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 201: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteFunctionRequest(string resourceGroupName, string name, string functionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a function for web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteFunctionAsync(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + + using var message = CreateDeleteFunctionRequest(resourceGroupName, name, functionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a function for web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteFunction(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + + using var message = CreateDeleteFunctionRequest(resourceGroupName, name, functionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateFunctionSecretRequest(string resourceGroupName, string name, string functionName, string keyName, KeyInfo key) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendPath("/keys/", false); + uri.AppendPath(keyName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(key); + request.Content = content; + return message; + } + + /// Description for Add or update a function secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The name of the function. + /// The name of the key. + /// The key to create or update. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> CreateOrUpdateFunctionSecretAsync(string resourceGroupName, string name, string functionName, string keyName, KeyInfo key, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + using var message = CreateCreateOrUpdateFunctionSecretRequest(resourceGroupName, name, functionName, keyName, key); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + KeyInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = KeyInfo.DeserializeKeyInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Add or update a function secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The name of the function. + /// The name of the key. + /// The key to create or update. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateOrUpdateFunctionSecret(string resourceGroupName, string name, string functionName, string keyName, KeyInfo key, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + using var message = CreateCreateOrUpdateFunctionSecretRequest(resourceGroupName, name, functionName, keyName, key); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + KeyInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = KeyInfo.DeserializeKeyInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteFunctionSecretRequest(string resourceGroupName, string name, string functionName, string keyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendPath("/keys/", false); + uri.AppendPath(keyName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a function secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The name of the function. + /// The name of the key. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteFunctionSecretAsync(string resourceGroupName, string name, string functionName, string keyName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + + using var message = CreateDeleteFunctionSecretRequest(resourceGroupName, name, functionName, keyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a function secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The name of the function. + /// The name of the key. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteFunctionSecret(string resourceGroupName, string name, string functionName, string keyName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + + using var message = CreateDeleteFunctionSecretRequest(resourceGroupName, name, functionName, keyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListFunctionKeysRequest(string resourceGroupName, string name, string functionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendPath("/listkeys", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get function keys for a function in a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListFunctionKeysAsync(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + + using var message = CreateListFunctionKeysRequest(resourceGroupName, name, functionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get function keys for a function in a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// The cancellation token to use. + /// , , or is null. + public Response ListFunctionKeys(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + + using var message = CreateListFunctionKeysRequest(resourceGroupName, name, functionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListFunctionSecretsRequest(string resourceGroupName, string name, string functionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendPath("/listsecrets", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get function secrets for a function in a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListFunctionSecretsAsync(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + + using var message = CreateListFunctionSecretsRequest(resourceGroupName, name, functionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionSecrets value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get function secrets for a function in a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// The cancellation token to use. + /// , , or is null. + public Response ListFunctionSecrets(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + + using var message = CreateListFunctionSecretsRequest(resourceGroupName, name, functionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionSecrets value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHostKeysRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/host/default/listkeys", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get host secrets for a function app. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public async Task> ListHostKeysAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHostKeysRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HostKeys value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HostKeys.DeserializeHostKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get host secrets for a function app. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public Response ListHostKeys(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHostKeysRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HostKeys value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HostKeys.DeserializeHostKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSyncStatusRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/host/default/listsyncstatus", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for This is to allow calling via powershell and ARM template. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task ListSyncStatusAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSyncStatusRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for This is to allow calling via powershell and ARM template. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListSyncStatus(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSyncStatusRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateSyncFunctionsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/host/default/sync", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Syncs function trigger metadata to the management database. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task SyncFunctionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateSyncFunctionsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Syncs function trigger metadata to the management database. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response SyncFunctions(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateSyncFunctionsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateHostSecretRequest(string resourceGroupName, string name, string keyType, string keyName, KeyInfo key) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/host/default/", false); + uri.AppendPath(keyType, true); + uri.AppendPath("/", false); + uri.AppendPath(keyName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(key); + request.Content = content; + return message; + } + + /// Description for Add or update a host level secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The type of host key. + /// The name of the key. + /// The key to create or update. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> CreateOrUpdateHostSecretAsync(string resourceGroupName, string name, string keyType, string keyName, KeyInfo key, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (keyType == null) + { + throw new ArgumentNullException(nameof(keyType)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + using var message = CreateCreateOrUpdateHostSecretRequest(resourceGroupName, name, keyType, keyName, key); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + KeyInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = KeyInfo.DeserializeKeyInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Add or update a host level secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The type of host key. + /// The name of the key. + /// The key to create or update. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateOrUpdateHostSecret(string resourceGroupName, string name, string keyType, string keyName, KeyInfo key, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (keyType == null) + { + throw new ArgumentNullException(nameof(keyType)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + using var message = CreateCreateOrUpdateHostSecretRequest(resourceGroupName, name, keyType, keyName, key); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + KeyInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = KeyInfo.DeserializeKeyInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteHostSecretRequest(string resourceGroupName, string name, string keyType, string keyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/host/default/", false); + uri.AppendPath(keyType, true); + uri.AppendPath("/", false); + uri.AppendPath(keyName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a host level secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The type of host key. + /// The name of the key. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteHostSecretAsync(string resourceGroupName, string name, string keyType, string keyName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (keyType == null) + { + throw new ArgumentNullException(nameof(keyType)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + + using var message = CreateDeleteHostSecretRequest(resourceGroupName, name, keyType, keyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a host level secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The type of host key. + /// The name of the key. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteHostSecret(string resourceGroupName, string name, string keyType, string keyName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (keyType == null) + { + throw new ArgumentNullException(nameof(keyType)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + + using var message = CreateDeleteHostSecretRequest(resourceGroupName, name, keyType, keyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHostNameBindingsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hostNameBindings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get hostname bindings for an app or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListHostNameBindingsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHostNameBindingsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HostNameBindingCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get hostname bindings for an app or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListHostNameBindings(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHostNameBindingsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HostNameBindingCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetHostNameBindingRequest(string resourceGroupName, string name, string hostName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hostNameBindings/", false); + uri.AppendPath(hostName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the named hostname binding for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Hostname in the hostname binding. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetHostNameBindingAsync(string resourceGroupName, string name, string hostName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateGetHostNameBindingRequest(resourceGroupName, name, hostName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HostNameBinding value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the named hostname binding for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Hostname in the hostname binding. + /// The cancellation token to use. + /// , , or is null. + public Response GetHostNameBinding(string resourceGroupName, string name, string hostName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateGetHostNameBindingRequest(resourceGroupName, name, hostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HostNameBinding value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateHostNameBindingRequest(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hostNameBindings/", false); + uri.AppendPath(hostName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(hostNameBinding); + request.Content = content; + return message; + } + + /// Description for Creates a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Hostname in the hostname binding. + /// Binding details. This is the JSON representation of a HostNameBinding object. + /// The cancellation token to use. + /// , , , or is null. + public async Task> CreateOrUpdateHostNameBindingAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + if (hostNameBinding == null) + { + throw new ArgumentNullException(nameof(hostNameBinding)); + } + + using var message = CreateCreateOrUpdateHostNameBindingRequest(resourceGroupName, name, hostName, hostNameBinding); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HostNameBinding value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Hostname in the hostname binding. + /// Binding details. This is the JSON representation of a HostNameBinding object. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateHostNameBinding(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + if (hostNameBinding == null) + { + throw new ArgumentNullException(nameof(hostNameBinding)); + } + + using var message = CreateCreateOrUpdateHostNameBindingRequest(resourceGroupName, name, hostName, hostNameBinding); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HostNameBinding value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteHostNameBindingRequest(string resourceGroupName, string name, string hostName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hostNameBindings/", false); + uri.AppendPath(hostName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Hostname in the hostname binding. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteHostNameBindingAsync(string resourceGroupName, string name, string hostName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateDeleteHostNameBindingRequest(resourceGroupName, name, hostName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Hostname in the hostname binding. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteHostNameBinding(string resourceGroupName, string name, string hostName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateDeleteHostNameBindingRequest(resourceGroupName, name, hostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridConnectionNamespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/relays/", false); + uri.AppendPath(relayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateGetHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The cancellation token to use. + /// , , , or is null. + public Response GetHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateGetHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridConnectionNamespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/relays/", false); + uri.AppendPath(relayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The details of the hybrid connection. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> CreateOrUpdateHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The details of the hybrid connection. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateOrUpdateHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridConnectionNamespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/relays/", false); + uri.AppendPath(relayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Removes a Hybrid Connection from this site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateDeleteHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Removes a Hybrid Connection from this site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + + using var message = CreateDeleteHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridConnectionNamespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/relays/", false); + uri.AppendPath(relayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The details of the hybrid connection. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> UpdateHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The details of the hybrid connection. + /// The cancellation token to use. + /// , , , , or is null. + public Response UpdateHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHybridConnectionsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridConnectionRelays", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The cancellation token to use. + /// or is null. + public async Task> ListHybridConnectionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHybridConnectionsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The cancellation token to use. + /// or is null. + public Response ListHybridConnections(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHybridConnectionsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRelayServiceConnectionsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridconnection", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets hybrid connections configured for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListRelayServiceConnectionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListRelayServiceConnectionsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets hybrid connections configured for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListRelayServiceConnections(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListRelayServiceConnectionsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRelayServiceConnectionRequest(string resourceGroupName, string name, string entityName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridconnection/", false); + uri.AppendPath(entityName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a hybrid connection configuration by its name. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetRelayServiceConnectionAsync(string resourceGroupName, string name, string entityName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + + using var message = CreateGetRelayServiceConnectionRequest(resourceGroupName, name, entityName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a hybrid connection configuration by its name. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection. + /// The cancellation token to use. + /// , , or is null. + public Response GetRelayServiceConnection(string resourceGroupName, string name, string entityName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + + using var message = CreateGetRelayServiceConnectionRequest(resourceGroupName, name, entityName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRelayServiceConnectionRequest(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridconnection/", false); + uri.AppendPath(entityName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection configuration. + /// Details of the hybrid connection configuration. + /// The cancellation token to use. + /// , , , or is null. + public async Task> CreateOrUpdateRelayServiceConnectionAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateRelayServiceConnectionRequest(resourceGroupName, name, entityName, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection configuration. + /// Details of the hybrid connection configuration. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateRelayServiceConnection(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateRelayServiceConnectionRequest(resourceGroupName, name, entityName, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRelayServiceConnectionRequest(string resourceGroupName, string name, string entityName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridconnection/", false); + uri.AppendPath(entityName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a relay service connection by its name. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection configuration. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteRelayServiceConnectionAsync(string resourceGroupName, string name, string entityName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + + using var message = CreateDeleteRelayServiceConnectionRequest(resourceGroupName, name, entityName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a relay service connection by its name. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection configuration. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteRelayServiceConnection(string resourceGroupName, string name, string entityName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + + using var message = CreateDeleteRelayServiceConnectionRequest(resourceGroupName, name, entityName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRelayServiceConnectionRequest(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridconnection/", false); + uri.AppendPath(entityName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection configuration. + /// Details of the hybrid connection configuration. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateRelayServiceConnectionAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateRelayServiceConnectionRequest(resourceGroupName, name, entityName, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection configuration. + /// Details of the hybrid connection configuration. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateRelayServiceConnection(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateRelayServiceConnectionRequest(resourceGroupName, name, entityName, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceIdentifiersRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/instances", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all scale-out instances of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListInstanceIdentifiersAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListInstanceIdentifiersRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppInstanceStatusCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all scale-out instances of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListInstanceIdentifiers(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListInstanceIdentifiersRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppInstanceStatusCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceInfoRequest(string resourceGroupName, string name, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all scale-out instances of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetInstanceInfoAsync(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceInfoRequest(resourceGroupName, name, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebSiteInstanceStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebSiteInstanceStatus.DeserializeWebSiteInstanceStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all scale-out instances of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response GetInstanceInfo(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceInfoRequest(resourceGroupName, name, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebSiteInstanceStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebSiteInstanceStatus.DeserializeWebSiteInstanceStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceMsDeployStatusRequest(string resourceGroupName, string name, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/extensions/MSDeploy", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the status of the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// ID of web app instance. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetInstanceMsDeployStatusAsync(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceMsDeployStatusRequest(resourceGroupName, name, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MSDeployStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the status of the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// ID of web app instance. + /// The cancellation token to use. + /// , , or is null. + public Response GetInstanceMsDeployStatus(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceMsDeployStatusRequest(resourceGroupName, name, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MSDeployStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateInstanceMSDeployOperationRequest(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/extensions/MSDeploy", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(mSDeploy); + request.Content = content; + return message; + } + + /// Description for Invoke the MSDeploy web app extension. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// ID of web app instance. + /// Details of MSDeploy operation. + /// The cancellation token to use. + /// , , , or is null. + public async Task CreateInstanceMSDeployOperationAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + if (mSDeploy == null) + { + throw new ArgumentNullException(nameof(mSDeploy)); + } + + using var message = CreateCreateInstanceMSDeployOperationRequest(resourceGroupName, name, instanceId, mSDeploy); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 201: + case 409: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Invoke the MSDeploy web app extension. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// ID of web app instance. + /// Details of MSDeploy operation. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateInstanceMSDeployOperation(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + if (mSDeploy == null) + { + throw new ArgumentNullException(nameof(mSDeploy)); + } + + using var message = CreateCreateInstanceMSDeployOperationRequest(resourceGroupName, name, instanceId, mSDeploy); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 201: + case 409: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceMSDeployLogRequest(string resourceGroupName, string name, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/extensions/MSDeploy/log", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// ID of web app instance. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetInstanceMSDeployLogAsync(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceMSDeployLogRequest(resourceGroupName, name, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MSDeployLog value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MSDeployLog)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// ID of web app instance. + /// The cancellation token to use. + /// , , or is null. + public Response GetInstanceMSDeployLog(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceMSDeployLogRequest(resourceGroupName, name, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MSDeployLog value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MSDeployLog)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceProcessesRequest(string resourceGroupName, string name, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , or is null. + public async Task> ListInstanceProcessesAsync(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessesRequest(resourceGroupName, name, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , or is null. + public Response ListInstanceProcesses(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessesRequest(resourceGroupName, name, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceProcessRequest(string resourceGroupName, string name, string processId, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetInstanceProcessAsync(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceProcessRequest(resourceGroupName, name, processId, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessInfo.DeserializeProcessInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfo)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public Response GetInstanceProcess(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceProcessRequest(resourceGroupName, name, processId, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessInfo.DeserializeProcessInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfo)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteInstanceProcessRequest(string resourceGroupName, string name, string processId, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteInstanceProcessAsync(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateDeleteInstanceProcessRequest(resourceGroupName, name, processId, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteInstanceProcess(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateDeleteInstanceProcessRequest(resourceGroupName, name, processId, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceProcessDumpRequest(string resourceGroupName, string name, string processId, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/dump", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetInstanceProcessDumpAsync(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceProcessDumpRequest(resourceGroupName, name, processId, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((Stream)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public Response GetInstanceProcessDump(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceProcessDumpRequest(resourceGroupName, name, processId, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((Stream)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceProcessModulesRequest(string resourceGroupName, string name, string processId, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/modules", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListInstanceProcessModulesAsync(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessModulesRequest(resourceGroupName, name, processId, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public Response ListInstanceProcessModules(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessModulesRequest(resourceGroupName, name, processId, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceProcessModuleRequest(string resourceGroupName, string name, string processId, string baseAddress, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/modules/", false); + uri.AppendPath(baseAddress, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Module base address. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public async Task> GetInstanceProcessModuleAsync(string resourceGroupName, string name, string processId, string baseAddress, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (baseAddress == null) + { + throw new ArgumentNullException(nameof(baseAddress)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceProcessModuleRequest(resourceGroupName, name, processId, baseAddress, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfo)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Module base address. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public Response GetInstanceProcessModule(string resourceGroupName, string name, string processId, string baseAddress, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (baseAddress == null) + { + throw new ArgumentNullException(nameof(baseAddress)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceProcessModuleRequest(resourceGroupName, name, processId, baseAddress, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfo)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceProcessThreadsRequest(string resourceGroupName, string name, string processId, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/threads", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListInstanceProcessThreadsAsync(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessThreadsRequest(resourceGroupName, name, processId, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public Response ListInstanceProcessThreads(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessThreadsRequest(resourceGroupName, name, processId, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateIsCloneableRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/iscloneable", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Shows whether an app can be cloned to another resource group or subscription. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> IsCloneableAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateIsCloneableRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteCloneability value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteCloneability.DeserializeSiteCloneability(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Shows whether an app can be cloned to another resource group or subscription. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response IsCloneable(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateIsCloneableRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteCloneability value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteCloneability.DeserializeSiteCloneability(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteBackupsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/listbackups", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets existing backups of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListSiteBackupsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSiteBackupsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets existing backups of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListSiteBackups(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSiteBackupsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSyncFunctionTriggersRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/listsyncfunctiontriggerstatus", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for This is to allow calling via powershell and ARM template. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListSyncFunctionTriggersAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSyncFunctionTriggersRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionSecrets value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for This is to allow calling via powershell and ARM template. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListSyncFunctionTriggers(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSyncFunctionTriggersRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionSecrets value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateMigrateStorageRequest(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/migrate", false); + uri.AppendQuery("subscriptionName", subscriptionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(migrationOptions); + request.Content = content; + return message; + } + + /// Description for Restores a web app. + /// Azure subscription. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Migration migrationOptions. + /// The cancellation token to use. + /// , , , or is null. + public async Task MigrateStorageAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, CancellationToken cancellationToken = default) + { + if (subscriptionName == null) + { + throw new ArgumentNullException(nameof(subscriptionName)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (migrationOptions == null) + { + throw new ArgumentNullException(nameof(migrationOptions)); + } + + using var message = CreateMigrateStorageRequest(subscriptionName, resourceGroupName, name, migrationOptions); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Restores a web app. + /// Azure subscription. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Migration migrationOptions. + /// The cancellation token to use. + /// , , , or is null. + public Response MigrateStorage(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, CancellationToken cancellationToken = default) + { + if (subscriptionName == null) + { + throw new ArgumentNullException(nameof(subscriptionName)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (migrationOptions == null) + { + throw new ArgumentNullException(nameof(migrationOptions)); + } + + using var message = CreateMigrateStorageRequest(subscriptionName, resourceGroupName, name, migrationOptions); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateMigrateMySqlRequest(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/migratemysql", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(migrationRequestEnvelope); + request.Content = content; + return message; + } + + /// Description for Migrates a local (in-app) MySql database to a remote MySql database. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// MySql migration options. + /// The cancellation token to use. + /// , , or is null. + public async Task MigrateMySqlAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (migrationRequestEnvelope == null) + { + throw new ArgumentNullException(nameof(migrationRequestEnvelope)); + } + + using var message = CreateMigrateMySqlRequest(resourceGroupName, name, migrationRequestEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Migrates a local (in-app) MySql database to a remote MySql database. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// MySql migration options. + /// The cancellation token to use. + /// , , or is null. + public Response MigrateMySql(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (migrationRequestEnvelope == null) + { + throw new ArgumentNullException(nameof(migrationRequestEnvelope)); + } + + using var message = CreateMigrateMySqlRequest(resourceGroupName, name, migrationRequestEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetMigrateMySqlStatusRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/migratemysql/status", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public async Task> GetMigrateMySqlStatusAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetMigrateMySqlStatusRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrateMySqlStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrateMySqlStatus.DeserializeMigrateMySqlStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public Response GetMigrateMySqlStatus(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetMigrateMySqlStatusRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrateMySqlStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrateMySqlStatus.DeserializeMigrateMySqlStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSwiftVirtualNetworkConnectionRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/networkConfig/virtualNetwork", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a Swift Virtual Network connection. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetSwiftVirtualNetworkConnectionAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetSwiftVirtualNetworkConnectionRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SwiftVirtualNetwork value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SwiftVirtualNetwork.DeserializeSwiftVirtualNetwork(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a Swift Virtual Network connection. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GetSwiftVirtualNetworkConnection(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetSwiftVirtualNetworkConnectionRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SwiftVirtualNetwork value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SwiftVirtualNetwork.DeserializeSwiftVirtualNetwork(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckRequest(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/networkConfig/virtualNetwork", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// + /// Description for Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. + /// + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Properties of the Virtual Network connection. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task> CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckRequest(resourceGroupName, name, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SwiftVirtualNetwork value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SwiftVirtualNetwork.DeserializeSwiftVirtualNetwork(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// + /// Description for Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. + /// + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Properties of the Virtual Network connection. See example. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckRequest(resourceGroupName, name, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SwiftVirtualNetwork value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SwiftVirtualNetwork.DeserializeSwiftVirtualNetwork(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteSwiftVirtualNetworkRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/networkConfig/virtualNetwork", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task DeleteSwiftVirtualNetworkAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteSwiftVirtualNetworkRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response DeleteSwiftVirtualNetwork(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteSwiftVirtualNetworkRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNetworkFeaturesRequest(string resourceGroupName, string name, string view) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/networkFeatures/", false); + uri.AppendPath(view, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all network features used by the app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The type of view. Only "summary" is supported at this time. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListNetworkFeaturesAsync(string resourceGroupName, string name, string view, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (view == null) + { + throw new ArgumentNullException(nameof(view)); + } + + using var message = CreateListNetworkFeaturesRequest(resourceGroupName, name, view); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkFeatures value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = NetworkFeatures.DeserializeNetworkFeatures(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkFeatures)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all network features used by the app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The type of view. Only "summary" is supported at this time. + /// The cancellation token to use. + /// , , or is null. + public Response ListNetworkFeatures(string resourceGroupName, string name, string view, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (view == null) + { + throw new ArgumentNullException(nameof(view)); + } + + using var message = CreateListNetworkFeaturesRequest(resourceGroupName, name, view); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkFeatures value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = NetworkFeatures.DeserializeNetworkFeatures(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkFeatures)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetNetworkTraceOperationRequest(string resourceGroupName, string name, string operationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/networkTrace/operationresults/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetNetworkTraceOperationAsync(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + + using var message = CreateGetNetworkTraceOperationRequest(resourceGroupName, name, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + case 202: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// The cancellation token to use. + /// , , or is null. + public Response GetNetworkTraceOperation(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + + using var message = CreateGetNetworkTraceOperationRequest(resourceGroupName, name, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + case 202: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStartWebSiteNetworkTraceRequest(string resourceGroupName, string name, int? durationInSeconds, int? maxFrameLength, string sasUrl) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/networkTrace/start", false); + if (durationInSeconds != null) + { + uri.AppendQuery("durationInSeconds", durationInSeconds.Value, true); + } + if (maxFrameLength != null) + { + uri.AppendQuery("maxFrameLength", maxFrameLength.Value, true); + } + if (sasUrl != null) + { + uri.AppendQuery("sasUrl", sasUrl, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Start capturing network packets for the site (To be deprecated). + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The duration to keep capturing in seconds. + /// The maximum frame length in bytes (Optional). + /// The Blob URL to store capture file. + /// The cancellation token to use. + /// or is null. + public async Task> StartWebSiteNetworkTraceAsync(string resourceGroupName, string name, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStartWebSiteNetworkTraceRequest(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + string value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = document.RootElement.GetString(); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Start capturing network packets for the site (To be deprecated). + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The duration to keep capturing in seconds. + /// The maximum frame length in bytes (Optional). + /// The Blob URL to store capture file. + /// The cancellation token to use. + /// or is null. + public Response StartWebSiteNetworkTrace(string resourceGroupName, string name, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStartWebSiteNetworkTraceRequest(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + string value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = document.RootElement.GetString(); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStartWebSiteNetworkTraceOperationRequest(string resourceGroupName, string name, int? durationInSeconds, int? maxFrameLength, string sasUrl) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/networkTrace/startOperation", false); + if (durationInSeconds != null) + { + uri.AppendQuery("durationInSeconds", durationInSeconds.Value, true); + } + if (maxFrameLength != null) + { + uri.AppendQuery("maxFrameLength", maxFrameLength.Value, true); + } + if (sasUrl != null) + { + uri.AppendQuery("sasUrl", sasUrl, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Start capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The duration to keep capturing in seconds. + /// The maximum frame length in bytes (Optional). + /// The Blob URL to store capture file. + /// The cancellation token to use. + /// or is null. + public async Task StartWebSiteNetworkTraceOperationAsync(string resourceGroupName, string name, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStartWebSiteNetworkTraceOperationRequest(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Start capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The duration to keep capturing in seconds. + /// The maximum frame length in bytes (Optional). + /// The Blob URL to store capture file. + /// The cancellation token to use. + /// or is null. + public Response StartWebSiteNetworkTraceOperation(string resourceGroupName, string name, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStartWebSiteNetworkTraceOperationRequest(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStopWebSiteNetworkTraceRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/networkTrace/stop", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Stop ongoing capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The cancellation token to use. + /// or is null. + public async Task StopWebSiteNetworkTraceAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStopWebSiteNetworkTraceRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Stop ongoing capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The cancellation token to use. + /// or is null. + public Response StopWebSiteNetworkTrace(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStopWebSiteNetworkTraceRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetNetworkTracesRequest(string resourceGroupName, string name, string operationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/networkTrace/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// The cancellation token to use. + /// , , or is null. + public async Task>> GetNetworkTracesAsync(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + + using var message = CreateGetNetworkTracesRequest(resourceGroupName, name, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// The cancellation token to use. + /// , , or is null. + public Response> GetNetworkTraces(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + + using var message = CreateGetNetworkTracesRequest(resourceGroupName, name, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetNetworkTraceOperationV2Request(string resourceGroupName, string name, string operationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/networkTraces/current/operationresults/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetNetworkTraceOperationV2Async(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + + using var message = CreateGetNetworkTraceOperationV2Request(resourceGroupName, name, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + case 202: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// The cancellation token to use. + /// , , or is null. + public Response GetNetworkTraceOperationV2(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + + using var message = CreateGetNetworkTraceOperationV2Request(resourceGroupName, name, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + case 202: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetNetworkTracesV2Request(string resourceGroupName, string name, string operationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/networkTraces/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// The cancellation token to use. + /// , , or is null. + public async Task>> GetNetworkTracesV2Async(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + + using var message = CreateGetNetworkTracesV2Request(resourceGroupName, name, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// The cancellation token to use. + /// , , or is null. + public Response> GetNetworkTracesV2(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + + using var message = CreateGetNetworkTracesV2Request(resourceGroupName, name, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGenerateNewSitePublishingPasswordRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/newpassword", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Generates a new publishing password for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task GenerateNewSitePublishingPasswordAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGenerateNewSitePublishingPasswordRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Generates a new publishing password for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GenerateNewSitePublishingPassword(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGenerateNewSitePublishingPasswordRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPerfMonCountersRequest(string resourceGroupName, string name, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/perfcounters", false); + uri.AppendQuery("api-version", apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets perfmon counters for web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// or is null. + public async Task> ListPerfMonCountersAsync(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListPerfMonCountersRequest(resourceGroupName, name, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PerfMonCounterCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets perfmon counters for web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// or is null. + public Response ListPerfMonCounters(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListPerfMonCountersRequest(resourceGroupName, name, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PerfMonCounterCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSitePhpErrorLogFlagRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/phplogging", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets web app's event logs. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public async Task> GetSitePhpErrorLogFlagAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetSitePhpErrorLogFlagRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SitePhpErrorLogFlag value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SitePhpErrorLogFlag.DeserializeSitePhpErrorLogFlag(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets web app's event logs. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public Response GetSitePhpErrorLogFlag(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetSitePhpErrorLogFlagRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SitePhpErrorLogFlag value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SitePhpErrorLogFlag.DeserializeSitePhpErrorLogFlag(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPremierAddOnsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/premieraddons", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the premier add-ons of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListPremierAddOnsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListPremierAddOnsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the premier add-ons of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListPremierAddOns(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListPremierAddOnsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPremierAddOnRequest(string resourceGroupName, string name, string premierAddOnName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/premieraddons/", false); + uri.AppendPath(premierAddOnName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a named add-on of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetPremierAddOnAsync(string resourceGroupName, string name, string premierAddOnName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + + using var message = CreateGetPremierAddOnRequest(resourceGroupName, name, premierAddOnName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a named add-on of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// The cancellation token to use. + /// , , or is null. + public Response GetPremierAddOn(string resourceGroupName, string name, string premierAddOnName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + + using var message = CreateGetPremierAddOnRequest(resourceGroupName, name, premierAddOnName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateAddPremierAddOnRequest(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/premieraddons/", false); + uri.AppendPath(premierAddOnName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(premierAddOn); + request.Content = content; + return message; + } + + /// Description for Updates a named add-on of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// A JSON representation of the edited premier add-on. + /// The cancellation token to use. + /// , , , or is null. + public async Task> AddPremierAddOnAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + if (premierAddOn == null) + { + throw new ArgumentNullException(nameof(premierAddOn)); + } + + using var message = CreateAddPremierAddOnRequest(resourceGroupName, name, premierAddOnName, premierAddOn); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates a named add-on of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// A JSON representation of the edited premier add-on. + /// The cancellation token to use. + /// , , , or is null. + public Response AddPremierAddOn(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + if (premierAddOn == null) + { + throw new ArgumentNullException(nameof(premierAddOn)); + } + + using var message = CreateAddPremierAddOnRequest(resourceGroupName, name, premierAddOnName, premierAddOn); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeletePremierAddOnRequest(string resourceGroupName, string name, string premierAddOnName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/premieraddons/", false); + uri.AppendPath(premierAddOnName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a premier add-on from an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// The cancellation token to use. + /// , , or is null. + public async Task DeletePremierAddOnAsync(string resourceGroupName, string name, string premierAddOnName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + + using var message = CreateDeletePremierAddOnRequest(resourceGroupName, name, premierAddOnName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a premier add-on from an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// The cancellation token to use. + /// , , or is null. + public Response DeletePremierAddOn(string resourceGroupName, string name, string premierAddOnName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + + using var message = CreateDeletePremierAddOnRequest(resourceGroupName, name, premierAddOnName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdatePremierAddOnRequest(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/premieraddons/", false); + uri.AppendPath(premierAddOnName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(premierAddOn); + request.Content = content; + return message; + } + + /// Description for Updates a named add-on of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// A JSON representation of the edited premier add-on. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdatePremierAddOnAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + if (premierAddOn == null) + { + throw new ArgumentNullException(nameof(premierAddOn)); + } + + using var message = CreateUpdatePremierAddOnRequest(resourceGroupName, name, premierAddOnName, premierAddOn); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates a named add-on of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// A JSON representation of the edited premier add-on. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdatePremierAddOn(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + if (premierAddOn == null) + { + throw new ArgumentNullException(nameof(premierAddOn)); + } + + using var message = CreateUpdatePremierAddOnRequest(resourceGroupName, name, premierAddOnName, premierAddOn); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateAccessRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateAccess/virtualNetworks", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets data around private site access enablement and authorized Virtual Networks that can access the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The cancellation token to use. + /// or is null. + public async Task> GetPrivateAccessAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateAccessRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateAccess value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateAccess.DeserializePrivateAccess(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets data around private site access enablement and authorized Virtual Networks that can access the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The cancellation token to use. + /// or is null. + public Response GetPrivateAccess(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateAccessRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateAccess value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateAccess.DeserializePrivateAccess(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreatePutPrivateAccessVnetRequest(string resourceGroupName, string name, PrivateAccess access) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateAccess/virtualNetworks", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(access); + request.Content = content; + return message; + } + + /// Description for Sets data around private site access enablement and authorized Virtual Networks that can access the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The information for the private access. + /// The cancellation token to use. + /// , , or is null. + public async Task> PutPrivateAccessVnetAsync(string resourceGroupName, string name, PrivateAccess access, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (access == null) + { + throw new ArgumentNullException(nameof(access)); + } + + using var message = CreatePutPrivateAccessVnetRequest(resourceGroupName, name, access); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateAccess value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateAccess.DeserializePrivateAccess(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Sets data around private site access enablement and authorized Virtual Networks that can access the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The information for the private access. + /// The cancellation token to use. + /// , , or is null. + public Response PutPrivateAccessVnet(string resourceGroupName, string name, PrivateAccess access, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (access == null) + { + throw new ArgumentNullException(nameof(access)); + } + + using var message = CreatePutPrivateAccessVnetRequest(resourceGroupName, name, access); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateAccess value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateAccess.DeserializePrivateAccess(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateEndpointConnectionListRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the list of private endpoint connections associated with a site. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The cancellation token to use. + /// or is null. + public async Task> GetPrivateEndpointConnectionListAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateEndpointConnectionListRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the list of private endpoint connections associated with a site. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The cancellation token to use. + /// or is null. + public Response GetPrivateEndpointConnectionList(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateEndpointConnectionListRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// Name of the private endpoint connection. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetPrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RemotePrivateEndpointConnectionARMResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// Name of the private endpoint connection. + /// The cancellation token to use. + /// , , or is null. + public Response GetPrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RemotePrivateEndpointConnectionARMResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateApproveOrRejectPrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(privateEndpointWrapper); + request.Content = content; + return message; + } + + /// Description for Approves or rejects a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The String to use. + /// The PrivateLinkConnectionApprovalRequestResource to use. + /// The cancellation token to use. + /// , , , or is null. + public async Task ApproveOrRejectPrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (privateEndpointWrapper == null) + { + throw new ArgumentNullException(nameof(privateEndpointWrapper)); + } + + using var message = CreateApproveOrRejectPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Approves or rejects a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The String to use. + /// The PrivateLinkConnectionApprovalRequestResource to use. + /// The cancellation token to use. + /// , , , or is null. + public Response ApproveOrRejectPrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (privateEndpointWrapper == null) + { + throw new ArgumentNullException(nameof(privateEndpointWrapper)); + } + + using var message = CreateApproveOrRejectPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeletePrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task DeletePrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response DeletePrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + + using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateLinkResourcesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the private link resources. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The cancellation token to use. + /// or is null. + public async Task> GetPrivateLinkResourcesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateLinkResourcesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourcesWrapper value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the private link resources. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The cancellation token to use. + /// or is null. + public Response GetPrivateLinkResources(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateLinkResourcesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourcesWrapper value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProcessesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/processes", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public async Task> ListProcessesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListProcessesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public Response ListProcesses(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListProcessesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetProcessRequest(string resourceGroupName, string name, string processId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetProcessAsync(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateGetProcessRequest(resourceGroupName, name, processId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessInfo.DeserializeProcessInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfo)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , or is null. + public Response GetProcess(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateGetProcessRequest(resourceGroupName, name, processId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessInfo.DeserializeProcessInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfo)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteProcessRequest(string resourceGroupName, string name, string processId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteProcessAsync(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateDeleteProcessRequest(resourceGroupName, name, processId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteProcess(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateDeleteProcessRequest(resourceGroupName, name, processId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetProcessDumpRequest(string resourceGroupName, string name, string processId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/dump", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetProcessDumpAsync(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateGetProcessDumpRequest(resourceGroupName, name, processId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((Stream)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , or is null. + public Response GetProcessDump(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateGetProcessDumpRequest(resourceGroupName, name, processId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((Stream)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProcessModulesRequest(string resourceGroupName, string name, string processId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/modules", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListProcessModulesAsync(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateListProcessModulesRequest(resourceGroupName, name, processId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , or is null. + public Response ListProcessModules(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateListProcessModulesRequest(resourceGroupName, name, processId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetProcessModuleRequest(string resourceGroupName, string name, string processId, string baseAddress) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/modules/", false); + uri.AppendPath(baseAddress, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Module base address. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetProcessModuleAsync(string resourceGroupName, string name, string processId, string baseAddress, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (baseAddress == null) + { + throw new ArgumentNullException(nameof(baseAddress)); + } + + using var message = CreateGetProcessModuleRequest(resourceGroupName, name, processId, baseAddress); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfo)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Module base address. + /// The cancellation token to use. + /// , , , or is null. + public Response GetProcessModule(string resourceGroupName, string name, string processId, string baseAddress, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (baseAddress == null) + { + throw new ArgumentNullException(nameof(baseAddress)); + } + + using var message = CreateGetProcessModuleRequest(resourceGroupName, name, processId, baseAddress); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfo)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProcessThreadsRequest(string resourceGroupName, string name, string processId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/threads", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListProcessThreadsAsync(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateListProcessThreadsRequest(resourceGroupName, name, processId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , or is null. + public Response ListProcessThreads(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateListProcessThreadsRequest(resourceGroupName, name, processId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPublicCertificatesRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/publicCertificates", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get public certificates for an app or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListPublicCertificatesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListPublicCertificatesRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCertificateCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get public certificates for an app or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListPublicCertificates(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListPublicCertificatesRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCertificateCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPublicCertificateRequest(string resourceGroupName, string name, string publicCertificateName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/publicCertificates/", false); + uri.AppendPath(publicCertificateName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the named public certificate for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Public certificate name. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetPublicCertificateAsync(string resourceGroupName, string name, string publicCertificateName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (publicCertificateName == null) + { + throw new ArgumentNullException(nameof(publicCertificateName)); + } + + using var message = CreateGetPublicCertificateRequest(resourceGroupName, name, publicCertificateName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCertificate value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCertificate.DeserializePublicCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the named public certificate for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Public certificate name. + /// The cancellation token to use. + /// , , or is null. + public Response GetPublicCertificate(string resourceGroupName, string name, string publicCertificateName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (publicCertificateName == null) + { + throw new ArgumentNullException(nameof(publicCertificateName)); + } + + using var message = CreateGetPublicCertificateRequest(resourceGroupName, name, publicCertificateName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCertificate value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCertificate.DeserializePublicCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdatePublicCertificateRequest(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/publicCertificates/", false); + uri.AppendPath(publicCertificateName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(publicCertificate); + request.Content = content; + return message; + } + + /// Description for Creates a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Public certificate name. + /// Public certificate details. This is the JSON representation of a PublicCertificate object. + /// The cancellation token to use. + /// , , , or is null. + public async Task> CreateOrUpdatePublicCertificateAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (publicCertificateName == null) + { + throw new ArgumentNullException(nameof(publicCertificateName)); + } + if (publicCertificate == null) + { + throw new ArgumentNullException(nameof(publicCertificate)); + } + + using var message = CreateCreateOrUpdatePublicCertificateRequest(resourceGroupName, name, publicCertificateName, publicCertificate); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCertificate value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCertificate.DeserializePublicCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Public certificate name. + /// Public certificate details. This is the JSON representation of a PublicCertificate object. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdatePublicCertificate(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (publicCertificateName == null) + { + throw new ArgumentNullException(nameof(publicCertificateName)); + } + if (publicCertificate == null) + { + throw new ArgumentNullException(nameof(publicCertificate)); + } + + using var message = CreateCreateOrUpdatePublicCertificateRequest(resourceGroupName, name, publicCertificateName, publicCertificate); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCertificate value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCertificate.DeserializePublicCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeletePublicCertificateRequest(string resourceGroupName, string name, string publicCertificateName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/publicCertificates/", false); + uri.AppendPath(publicCertificateName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Public certificate name. + /// The cancellation token to use. + /// , , or is null. + public async Task DeletePublicCertificateAsync(string resourceGroupName, string name, string publicCertificateName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (publicCertificateName == null) + { + throw new ArgumentNullException(nameof(publicCertificateName)); + } + + using var message = CreateDeletePublicCertificateRequest(resourceGroupName, name, publicCertificateName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Public certificate name. + /// The cancellation token to use. + /// , , or is null. + public Response DeletePublicCertificate(string resourceGroupName, string name, string publicCertificateName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (publicCertificateName == null) + { + throw new ArgumentNullException(nameof(publicCertificateName)); + } + + using var message = CreateDeletePublicCertificateRequest(resourceGroupName, name, publicCertificateName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPublishingProfileXmlWithSecretsRequest(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/publishxml", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/xml"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(publishingProfileOptions); + request.Content = content; + return message; + } + + /// Description for Gets the publishing profile for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specifies publishingProfileOptions for publishing profile. For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListPublishingProfileXmlWithSecretsAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (publishingProfileOptions == null) + { + throw new ArgumentNullException(nameof(publishingProfileOptions)); + } + + using var message = CreateListPublishingProfileXmlWithSecretsRequest(resourceGroupName, name, publishingProfileOptions); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the publishing profile for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specifies publishingProfileOptions for publishing profile. For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + /// The cancellation token to use. + /// , , or is null. + public Response ListPublishingProfileXmlWithSecrets(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (publishingProfileOptions == null) + { + throw new ArgumentNullException(nameof(publishingProfileOptions)); + } + + using var message = CreateListPublishingProfileXmlWithSecretsRequest(resourceGroupName, name, publishingProfileOptions); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateResetProductionSlotConfigRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/resetSlotConfig", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task ResetProductionSlotConfigAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateResetProductionSlotConfigRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ResetProductionSlotConfig(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateResetProductionSlotConfigRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRestartRequest(string resourceGroupName, string name, bool? softRestart, bool? synchronous) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/restart", false); + if (softRestart != null) + { + uri.AppendQuery("softRestart", softRestart.Value, true); + } + if (synchronous != null) + { + uri.AppendQuery("synchronous", synchronous.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Restarts an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify true to apply the configuration settings and restarts the app only if necessary. By default, the API always restarts and reprovisions the app. + /// Specify true to block until the app is restarted. By default, it is set to false, and the API responds immediately (asynchronous). + /// The cancellation token to use. + /// or is null. + public async Task RestartAsync(string resourceGroupName, string name, bool? softRestart = null, bool? synchronous = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateRestartRequest(resourceGroupName, name, softRestart, synchronous); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Restarts an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Specify true to apply the configuration settings and restarts the app only if necessary. By default, the API always restarts and reprovisions the app. + /// Specify true to block until the app is restarted. By default, it is set to false, and the API responds immediately (asynchronous). + /// The cancellation token to use. + /// or is null. + public Response Restart(string resourceGroupName, string name, bool? softRestart = null, bool? synchronous = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateRestartRequest(resourceGroupName, name, softRestart, synchronous); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRestoreFromBackupBlobRequest(string resourceGroupName, string name, RestoreRequest request) + { + var message = _pipeline.CreateMessage(); + var request0 = message.Request; + request0.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/restoreFromBackupBlob", false); + uri.AppendQuery("api-version", apiVersion, true); + request0.Uri = uri; + request0.Headers.Add("Accept", "application/json"); + request0.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(request); + request0.Content = content; + return message; + } + + /// Description for Restores an app from a backup blob in Azure Storage. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Information on restore request . + /// The cancellation token to use. + /// , , or is null. + public async Task RestoreFromBackupBlobAsync(string resourceGroupName, string name, RestoreRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateRestoreFromBackupBlobRequest(resourceGroupName, name, request); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Restores an app from a backup blob in Azure Storage. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Information on restore request . + /// The cancellation token to use. + /// , , or is null. + public Response RestoreFromBackupBlob(string resourceGroupName, string name, RestoreRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateRestoreFromBackupBlobRequest(resourceGroupName, name, request); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRestoreFromDeletedAppRequest(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/restoreFromDeletedApp", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(restoreRequest); + request.Content = content; + return message; + } + + /// Description for Restores a deleted web app to this web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Deleted web app restore information. + /// The cancellation token to use. + /// , , or is null. + public async Task RestoreFromDeletedAppAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (restoreRequest == null) + { + throw new ArgumentNullException(nameof(restoreRequest)); + } + + using var message = CreateRestoreFromDeletedAppRequest(resourceGroupName, name, restoreRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Restores a deleted web app to this web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Deleted web app restore information. + /// The cancellation token to use. + /// , , or is null. + public Response RestoreFromDeletedApp(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (restoreRequest == null) + { + throw new ArgumentNullException(nameof(restoreRequest)); + } + + using var message = CreateRestoreFromDeletedAppRequest(resourceGroupName, name, restoreRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRestoreSnapshotRequest(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/restoreSnapshot", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(restoreRequest); + request.Content = content; + return message; + } + + /// Description for Restores a web app from a snapshot. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. + /// The cancellation token to use. + /// , , or is null. + public async Task RestoreSnapshotAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (restoreRequest == null) + { + throw new ArgumentNullException(nameof(restoreRequest)); + } + + using var message = CreateRestoreSnapshotRequest(resourceGroupName, name, restoreRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Restores a web app from a snapshot. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. + /// The cancellation token to use. + /// , , or is null. + public Response RestoreSnapshot(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (restoreRequest == null) + { + throw new ArgumentNullException(nameof(restoreRequest)); + } + + using var message = CreateRestoreSnapshotRequest(resourceGroupName, name, restoreRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteExtensionsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/siteextensions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get list of siteextensions for a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public async Task> ListSiteExtensionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSiteExtensionsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteExtensionInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get list of siteextensions for a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public Response ListSiteExtensions(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSiteExtensionsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteExtensionInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteExtensionRequest(string resourceGroupName, string name, string siteExtensionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/siteextensions/", false); + uri.AppendPath(siteExtensionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get site extension information by its ID for a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Site extension name. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetSiteExtensionAsync(string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteExtensionId == null) + { + throw new ArgumentNullException(nameof(siteExtensionId)); + } + + using var message = CreateGetSiteExtensionRequest(resourceGroupName, name, siteExtensionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteExtensionInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteExtensionInfo.DeserializeSiteExtensionInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SiteExtensionInfo)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get site extension information by its ID for a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Site extension name. + /// The cancellation token to use. + /// , , or is null. + public Response GetSiteExtension(string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteExtensionId == null) + { + throw new ArgumentNullException(nameof(siteExtensionId)); + } + + using var message = CreateGetSiteExtensionRequest(resourceGroupName, name, siteExtensionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteExtensionInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteExtensionInfo.DeserializeSiteExtensionInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SiteExtensionInfo)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateInstallSiteExtensionRequest(string resourceGroupName, string name, string siteExtensionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/siteextensions/", false); + uri.AppendPath(siteExtensionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Install site extension on a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Site extension name. + /// The cancellation token to use. + /// , , or is null. + public async Task InstallSiteExtensionAsync(string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteExtensionId == null) + { + throw new ArgumentNullException(nameof(siteExtensionId)); + } + + using var message = CreateInstallSiteExtensionRequest(resourceGroupName, name, siteExtensionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 429: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Install site extension on a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Site extension name. + /// The cancellation token to use. + /// , , or is null. + public Response InstallSiteExtension(string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteExtensionId == null) + { + throw new ArgumentNullException(nameof(siteExtensionId)); + } + + using var message = CreateInstallSiteExtensionRequest(resourceGroupName, name, siteExtensionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 429: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteSiteExtensionRequest(string resourceGroupName, string name, string siteExtensionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/siteextensions/", false); + uri.AppendPath(siteExtensionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Remove a site extension from a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Site extension name. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteSiteExtensionAsync(string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteExtensionId == null) + { + throw new ArgumentNullException(nameof(siteExtensionId)); + } + + using var message = CreateDeleteSiteExtensionRequest(resourceGroupName, name, siteExtensionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Remove a site extension from a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Site extension name. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteSiteExtension(string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteExtensionId == null) + { + throw new ArgumentNullException(nameof(siteExtensionId)); + } + + using var message = CreateDeleteSiteExtensionRequest(resourceGroupName, name, siteExtensionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSlotsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets an app's deployment slots. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> ListSlotsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSlotsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets an app's deployment slots. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response ListSlots(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSlotsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the details of a web, mobile, or API app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. By default, this API returns the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Site value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Site.DeserializeSite(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((Site)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the details of a web, mobile, or API app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. By default, this API returns the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Site value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Site.DeserializeSite(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((Site)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateSlotRequest(string resourceGroupName, string name, string slot, Site siteEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + /// Name of the resource group to which the resource belongs. + /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. + /// Name of the deployment slot to create or update. By default, this API attempts to create or modify the production slot. + /// A JSON representation of the app properties. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task CreateOrUpdateSlotAsync(string resourceGroupName, string name, string slot, Site siteEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteEnvelope == null) + { + throw new ArgumentNullException(nameof(siteEnvelope)); + } + + using var message = CreateCreateOrUpdateSlotRequest(resourceGroupName, name, slot, siteEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + /// Name of the resource group to which the resource belongs. + /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. + /// Name of the deployment slot to create or update. By default, this API attempts to create or modify the production slot. + /// A JSON representation of the app properties. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateSlot(string resourceGroupName, string name, string slot, Site siteEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteEnvelope == null) + { + throw new ArgumentNullException(nameof(siteEnvelope)); + } + + using var message = CreateCreateOrUpdateSlotRequest(resourceGroupName, name, slot, siteEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteSlotRequest(string resourceGroupName, string name, string slot, bool? deleteMetrics, bool? deleteEmptyServerFarm) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + if (deleteMetrics != null) + { + uri.AppendQuery("deleteMetrics", deleteMetrics.Value, true); + } + if (deleteEmptyServerFarm != null) + { + uri.AppendQuery("deleteEmptyServerFarm", deleteEmptyServerFarm.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a web, mobile, or API app, or one of the deployment slots. + /// Name of the resource group to which the resource belongs. + /// Name of the app to delete. + /// Name of the deployment slot to delete. By default, the API deletes the production slot. + /// If true, web app metrics are also deleted. + /// Specify false if you want to keep empty App Service plan. By default, empty App Service plan is deleted. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteSlotAsync(string resourceGroupName, string name, string slot, bool? deleteMetrics = null, bool? deleteEmptyServerFarm = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteSlotRequest(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a web, mobile, or API app, or one of the deployment slots. + /// Name of the resource group to which the resource belongs. + /// Name of the app to delete. + /// Name of the deployment slot to delete. By default, the API deletes the production slot. + /// If true, web app metrics are also deleted. + /// Specify false if you want to keep empty App Service plan. By default, empty App Service plan is deleted. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteSlot(string resourceGroupName, string name, string slot, bool? deleteMetrics = null, bool? deleteEmptyServerFarm = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteSlotRequest(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateSlotRequest(string resourceGroupName, string name, string slot, SitePatchResource siteEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + /// Name of the resource group to which the resource belongs. + /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. + /// Name of the deployment slot to create or update. By default, this API attempts to create or modify the production slot. + /// A JSON representation of the app properties. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateSlotAsync(string resourceGroupName, string name, string slot, SitePatchResource siteEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteEnvelope == null) + { + throw new ArgumentNullException(nameof(siteEnvelope)); + } + + using var message = CreateUpdateSlotRequest(resourceGroupName, name, slot, siteEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + { + Site value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Site.DeserializeSite(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + /// Name of the resource group to which the resource belongs. + /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. + /// Name of the deployment slot to create or update. By default, this API attempts to create or modify the production slot. + /// A JSON representation of the app properties. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateSlot(string resourceGroupName, string name, string slot, SitePatchResource siteEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteEnvelope == null) + { + throw new ArgumentNullException(nameof(siteEnvelope)); + } + + using var message = CreateUpdateSlotRequest(resourceGroupName, name, slot, siteEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + { + Site value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Site.DeserializeSite(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateAnalyzeCustomHostnameSlotRequest(string resourceGroupName, string name, string slot, string hostName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/analyzeCustomHostname", false); + if (hostName != null) + { + uri.AppendQuery("hostName", hostName, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Analyze a custom hostname. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Custom hostname. + /// The cancellation token to use. + /// , , or is null. + public async Task> AnalyzeCustomHostnameSlotAsync(string resourceGroupName, string name, string slot, string hostName = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateAnalyzeCustomHostnameSlotRequest(resourceGroupName, name, slot, hostName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CustomHostnameAnalysisResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CustomHostnameAnalysisResult.DeserializeCustomHostnameAnalysisResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Analyze a custom hostname. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Custom hostname. + /// The cancellation token to use. + /// , , or is null. + public Response AnalyzeCustomHostnameSlot(string resourceGroupName, string name, string slot, string hostName = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateAnalyzeCustomHostnameSlotRequest(resourceGroupName, name, slot, hostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CustomHostnameAnalysisResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CustomHostnameAnalysisResult.DeserializeCustomHostnameAnalysisResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateApplySlotConfigurationSlotRequest(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/applySlotConfig", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(slotSwapEntity); + request.Content = content; + return message; + } + + /// Description for Applies the configuration settings from the target slot onto the current slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task ApplySlotConfigurationSlotAsync(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateApplySlotConfigurationSlotRequest(resourceGroupName, name, slot, slotSwapEntity); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Applies the configuration settings from the target slot onto the current slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response ApplySlotConfigurationSlot(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateApplySlotConfigurationSlotRequest(resourceGroupName, name, slot, slotSwapEntity); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateBackupSlotRequest(string resourceGroupName, string name, string slot, BackupRequest request) + { + var message = _pipeline.CreateMessage(); + var request0 = message.Request; + request0.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/backup", false); + uri.AppendQuery("api-version", apiVersion, true); + request0.Uri = uri; + request0.Headers.Add("Accept", "application/json"); + request0.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(request); + request0.Content = content; + return message; + } + + /// Description for Creates a backup of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will create a backup for the production slot. + /// Backup configuration. You can use the JSON response from the POST action as input here. + /// The cancellation token to use. + /// , , , or is null. + public async Task> BackupSlotAsync(string resourceGroupName, string name, string slot, BackupRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateBackupSlotRequest(resourceGroupName, name, slot, request); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItem value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItem.DeserializeBackupItem(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a backup of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will create a backup for the production slot. + /// Backup configuration. You can use the JSON response from the POST action as input here. + /// The cancellation token to use. + /// , , , or is null. + public Response BackupSlot(string resourceGroupName, string name, string slot, BackupRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateBackupSlotRequest(resourceGroupName, name, slot, request); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItem value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItem.DeserializeBackupItem(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBackupsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/backups", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets existing backups of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListBackupsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListBackupsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets existing backups of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListBackupsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListBackupsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetBackupStatusSlotRequest(string resourceGroupName, string name, string backupId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/backups/", false); + uri.AppendPath(backupId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a backup of an app by its ID. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of the backup. + /// Name of the deployment slot. If a slot is not specified, the API will get a backup of the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetBackupStatusSlotAsync(string resourceGroupName, string name, string backupId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetBackupStatusSlotRequest(resourceGroupName, name, backupId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItem value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItem.DeserializeBackupItem(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a backup of an app by its ID. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of the backup. + /// Name of the deployment slot. If a slot is not specified, the API will get a backup of the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetBackupStatusSlot(string resourceGroupName, string name, string backupId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetBackupStatusSlotRequest(resourceGroupName, name, backupId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItem value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItem.DeserializeBackupItem(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteBackupSlotRequest(string resourceGroupName, string name, string backupId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/backups/", false); + uri.AppendPath(backupId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a backup of an app by its ID. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of the backup. + /// Name of the deployment slot. If a slot is not specified, the API will delete a backup of the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteBackupSlotAsync(string resourceGroupName, string name, string backupId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteBackupSlotRequest(resourceGroupName, name, backupId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a backup of an app by its ID. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of the backup. + /// Name of the deployment slot. If a slot is not specified, the API will delete a backup of the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteBackupSlot(string resourceGroupName, string name, string backupId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteBackupSlotRequest(resourceGroupName, name, backupId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBackupStatusSecretsSlotRequest(string resourceGroupName, string name, string backupId, string slot, BackupRequest request) + { + var message = _pipeline.CreateMessage(); + var request0 = message.Request; + request0.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/backups/", false); + uri.AppendPath(backupId, true); + uri.AppendPath("/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request0.Uri = uri; + request0.Headers.Add("Accept", "application/json"); + request0.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(request); + request0.Content = content; + return message; + } + + /// Description for Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// ID of backup. + /// Name of web app slot. If not specified then will default to production slot. + /// Information on backup request. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListBackupStatusSecretsSlotAsync(string resourceGroupName, string name, string backupId, string slot, BackupRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateListBackupStatusSecretsSlotRequest(resourceGroupName, name, backupId, slot, request); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItem value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItem.DeserializeBackupItem(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// ID of backup. + /// Name of web app slot. If not specified then will default to production slot. + /// Information on backup request. + /// The cancellation token to use. + /// , , , , or is null. + public Response ListBackupStatusSecretsSlot(string resourceGroupName, string name, string backupId, string slot, BackupRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateListBackupStatusSecretsSlotRequest(resourceGroupName, name, backupId, slot, request); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItem value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItem.DeserializeBackupItem(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRestoreSlotRequest(string resourceGroupName, string name, string backupId, string slot, RestoreRequest request) + { + var message = _pipeline.CreateMessage(); + var request0 = message.Request; + request0.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/backups/", false); + uri.AppendPath(backupId, true); + uri.AppendPath("/restore", false); + uri.AppendQuery("api-version", apiVersion, true); + request0.Uri = uri; + request0.Headers.Add("Accept", "application/json"); + request0.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(request); + request0.Content = content; + return message; + } + + /// Description for Restores a specific backup to another app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of the backup. + /// Name of the deployment slot. If a slot is not specified, the API will restore a backup of the production slot. + /// Information on restore request . + /// The cancellation token to use. + /// , , , , or is null. + public async Task RestoreSlotAsync(string resourceGroupName, string name, string backupId, string slot, RestoreRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateRestoreSlotRequest(resourceGroupName, name, backupId, slot, request); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Restores a specific backup to another app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of the backup. + /// Name of the deployment slot. If a slot is not specified, the API will restore a backup of the production slot. + /// Information on restore request . + /// The cancellation token to use. + /// , , , , or is null. + public Response RestoreSlot(string resourceGroupName, string name, string backupId, string slot, RestoreRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (backupId == null) + { + throw new ArgumentNullException(nameof(backupId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateRestoreSlotRequest(resourceGroupName, name, backupId, slot, request); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetBasicPublishingCredentialsPoliciesSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/basicPublishingCredentialsPolicies", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetBasicPublishingCredentialsPoliciesSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetBasicPublishingCredentialsPoliciesSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmPublishingCredentialsPoliciesCollection.DeserializeCsmPublishingCredentialsPoliciesCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response GetBasicPublishingCredentialsPoliciesSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetBasicPublishingCredentialsPoliciesSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmPublishingCredentialsPoliciesCollection.DeserializeCsmPublishingCredentialsPoliciesCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetFtpAllowedSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/basicPublishingCredentialsPolicies/ftp", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns whether FTP is allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetFtpAllowedSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetFtpAllowedSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns whether FTP is allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response GetFtpAllowedSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetFtpAllowedSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateFtpAllowedSlotRequest(string resourceGroupName, string name, string slot, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/basicPublishingCredentialsPolicies/ftp", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(csmPublishingAccessPoliciesEntity); + request.Content = content; + return message; + } + + /// Description for Updates whether FTP is allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The CsmPublishingCredentialsPoliciesEntity to use. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateFtpAllowedSlotAsync(string resourceGroupName, string name, string slot, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (csmPublishingAccessPoliciesEntity == null) + { + throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); + } + + using var message = CreateUpdateFtpAllowedSlotRequest(resourceGroupName, name, slot, csmPublishingAccessPoliciesEntity); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates whether FTP is allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The CsmPublishingCredentialsPoliciesEntity to use. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateFtpAllowedSlot(string resourceGroupName, string name, string slot, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (csmPublishingAccessPoliciesEntity == null) + { + throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); + } + + using var message = CreateUpdateFtpAllowedSlotRequest(resourceGroupName, name, slot, csmPublishingAccessPoliciesEntity); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetScmAllowedSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/basicPublishingCredentialsPolicies/scm", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns whether Scm basic auth is allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetScmAllowedSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetScmAllowedSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns whether Scm basic auth is allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response GetScmAllowedSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetScmAllowedSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateScmAllowedSlotRequest(string resourceGroupName, string name, string slot, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/basicPublishingCredentialsPolicies/scm", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(csmPublishingAccessPoliciesEntity); + request.Content = content; + return message; + } + + /// Description for Updates whether user publishing credentials are allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The CsmPublishingCredentialsPoliciesEntity to use. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateScmAllowedSlotAsync(string resourceGroupName, string name, string slot, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (csmPublishingAccessPoliciesEntity == null) + { + throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); + } + + using var message = CreateUpdateScmAllowedSlotRequest(resourceGroupName, name, slot, csmPublishingAccessPoliciesEntity); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates whether user publishing credentials are allowed on the site or not. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The CsmPublishingCredentialsPoliciesEntity to use. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateScmAllowedSlot(string resourceGroupName, string name, string slot, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (csmPublishingAccessPoliciesEntity == null) + { + throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); + } + + using var message = CreateUpdateScmAllowedSlotRequest(resourceGroupName, name, slot, csmPublishingAccessPoliciesEntity); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmPublishingCredentialsPoliciesEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConfigurationsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the configurations of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListConfigurationsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListConfigurationsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResourceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the configurations of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListConfigurationsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListConfigurationsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResourceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateApplicationSettingsSlotRequest(string resourceGroupName, string name, string slot, StringDictionary appSettings) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/appsettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(appSettings); + request.Content = content; + return message; + } + + /// Description for Replaces the application settings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the application settings for the production slot. + /// Application settings of the app. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateApplicationSettingsSlotAsync(string resourceGroupName, string name, string slot, StringDictionary appSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (appSettings == null) + { + throw new ArgumentNullException(nameof(appSettings)); + } + + using var message = CreateUpdateApplicationSettingsSlotRequest(resourceGroupName, name, slot, appSettings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Replaces the application settings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the application settings for the production slot. + /// Application settings of the app. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateApplicationSettingsSlot(string resourceGroupName, string name, string slot, StringDictionary appSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (appSettings == null) + { + throw new ArgumentNullException(nameof(appSettings)); + } + + using var message = CreateUpdateApplicationSettingsSlotRequest(resourceGroupName, name, slot, appSettings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListApplicationSettingsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/appsettings/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the application settings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the application settings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListApplicationSettingsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListApplicationSettingsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the application settings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the application settings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListApplicationSettingsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListApplicationSettingsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateAuthSettingsSlotRequest(string resourceGroupName, string name, string slot, SiteAuthSettings siteAuthSettings) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/authsettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteAuthSettings); + request.Content = content; + return message; + } + + /// Description for Updates the Authentication / Authorization settings associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateAuthSettingsSlotAsync(string resourceGroupName, string name, string slot, SiteAuthSettings siteAuthSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteAuthSettings == null) + { + throw new ArgumentNullException(nameof(siteAuthSettings)); + } + + using var message = CreateUpdateAuthSettingsSlotRequest(resourceGroupName, name, slot, siteAuthSettings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettings value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the Authentication / Authorization settings associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateAuthSettingsSlot(string resourceGroupName, string name, string slot, SiteAuthSettings siteAuthSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteAuthSettings == null) + { + throw new ArgumentNullException(nameof(siteAuthSettings)); + } + + using var message = CreateUpdateAuthSettingsSlotRequest(resourceGroupName, name, slot, siteAuthSettings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettings value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAuthSettingsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/authsettings/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the Authentication/Authorization settings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the settings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetAuthSettingsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetAuthSettingsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettings value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the Authentication/Authorization settings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the settings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetAuthSettingsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetAuthSettingsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettings value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateAuthSettingsV2SlotRequest(string resourceGroupName, string name, string slot, SiteAuthSettingsV2 siteAuthSettingsV2) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/authsettingsV2", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteAuthSettingsV2); + request.Content = content; + return message; + } + + /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateAuthSettingsV2SlotAsync(string resourceGroupName, string name, string slot, SiteAuthSettingsV2 siteAuthSettingsV2, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteAuthSettingsV2 == null) + { + throw new ArgumentNullException(nameof(siteAuthSettingsV2)); + } + + using var message = CreateUpdateAuthSettingsV2SlotRequest(resourceGroupName, name, slot, siteAuthSettingsV2); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettingsV2 value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateAuthSettingsV2Slot(string resourceGroupName, string name, string slot, SiteAuthSettingsV2 siteAuthSettingsV2, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteAuthSettingsV2 == null) + { + throw new ArgumentNullException(nameof(siteAuthSettingsV2)); + } + + using var message = CreateUpdateAuthSettingsV2SlotRequest(resourceGroupName, name, slot, siteAuthSettingsV2); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettingsV2 value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAuthSettingsV2SlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/authsettingsV2/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the settings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetAuthSettingsV2SlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetAuthSettingsV2SlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettingsV2 value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the settings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetAuthSettingsV2Slot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetAuthSettingsV2SlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteAuthSettingsV2 value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateAzureStorageAccountsSlotRequest(string resourceGroupName, string name, string slot, AzureStoragePropertyDictionaryResource azureStorageAccounts) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/azurestorageaccounts", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(azureStorageAccounts); + request.Content = content; + return message; + } + + /// Description for Updates the Azure storage account configurations of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the Azure storage account configurations for the production slot. + /// Azure storage accounts of the app. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateAzureStorageAccountsSlotAsync(string resourceGroupName, string name, string slot, AzureStoragePropertyDictionaryResource azureStorageAccounts, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (azureStorageAccounts == null) + { + throw new ArgumentNullException(nameof(azureStorageAccounts)); + } + + using var message = CreateUpdateAzureStorageAccountsSlotRequest(resourceGroupName, name, slot, azureStorageAccounts); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AzureStoragePropertyDictionaryResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the Azure storage account configurations of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the Azure storage account configurations for the production slot. + /// Azure storage accounts of the app. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateAzureStorageAccountsSlot(string resourceGroupName, string name, string slot, AzureStoragePropertyDictionaryResource azureStorageAccounts, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (azureStorageAccounts == null) + { + throw new ArgumentNullException(nameof(azureStorageAccounts)); + } + + using var message = CreateUpdateAzureStorageAccountsSlotRequest(resourceGroupName, name, slot, azureStorageAccounts); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AzureStoragePropertyDictionaryResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListAzureStorageAccountsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/azurestorageaccounts/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the Azure storage account configurations of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the Azure storage account configurations for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListAzureStorageAccountsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListAzureStorageAccountsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AzureStoragePropertyDictionaryResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the Azure storage account configurations of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the Azure storage account configurations for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListAzureStorageAccountsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListAzureStorageAccountsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AzureStoragePropertyDictionaryResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateBackupConfigurationSlotRequest(string resourceGroupName, string name, string slot, BackupRequest request) + { + var message = _pipeline.CreateMessage(); + var request0 = message.Request; + request0.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/backup", false); + uri.AppendQuery("api-version", apiVersion, true); + request0.Uri = uri; + request0.Headers.Add("Accept", "application/json"); + request0.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(request); + request0.Content = content; + return message; + } + + /// Description for Updates the backup configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the backup configuration for the production slot. + /// Edited backup configuration. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateBackupConfigurationSlotAsync(string resourceGroupName, string name, string slot, BackupRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateUpdateBackupConfigurationSlotRequest(resourceGroupName, name, slot, request); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupRequest value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupRequest.DeserializeBackupRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the backup configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the backup configuration for the production slot. + /// Edited backup configuration. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateBackupConfigurationSlot(string resourceGroupName, string name, string slot, BackupRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateUpdateBackupConfigurationSlotRequest(resourceGroupName, name, slot, request); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupRequest value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupRequest.DeserializeBackupRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteBackupConfigurationSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/backup", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes the backup configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteBackupConfigurationSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteBackupConfigurationSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes the backup configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteBackupConfigurationSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteBackupConfigurationSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetBackupConfigurationSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/backup/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the backup configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the backup configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetBackupConfigurationSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetBackupConfigurationSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupRequest value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupRequest.DeserializeBackupRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the backup configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the backup configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetBackupConfigurationSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetBackupConfigurationSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupRequest value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupRequest.DeserializeBackupRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAppSettingsKeyVaultReferencesSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/configreferences/appsettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the config reference app settings and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetAppSettingsKeyVaultReferencesSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetAppSettingsKeyVaultReferencesSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the config reference app settings and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response GetAppSettingsKeyVaultReferencesSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetAppSettingsKeyVaultReferencesSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAppSettingKeyVaultReferenceSlotRequest(string resourceGroupName, string name, string appSettingKey, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/configreferences/appsettings/", false); + uri.AppendPath(appSettingKey, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the config reference and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// App Setting key name. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetAppSettingKeyVaultReferenceSlotAsync(string resourceGroupName, string name, string appSettingKey, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appSettingKey == null) + { + throw new ArgumentNullException(nameof(appSettingKey)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetAppSettingKeyVaultReferenceSlotRequest(resourceGroupName, name, appSettingKey, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKVReference value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApiKVReference.DeserializeApiKVReference(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the config reference and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// App Setting key name. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public Response GetAppSettingKeyVaultReferenceSlot(string resourceGroupName, string name, string appSettingKey, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (appSettingKey == null) + { + throw new ArgumentNullException(nameof(appSettingKey)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetAppSettingKeyVaultReferenceSlotRequest(resourceGroupName, name, appSettingKey, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKVReference value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApiKVReference.DeserializeApiKVReference(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteConnectionStringKeyVaultReferencesSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/configreferences/connectionstrings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the config reference app settings and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetSiteConnectionStringKeyVaultReferencesSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteConnectionStringKeyVaultReferencesSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the config reference app settings and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response GetSiteConnectionStringKeyVaultReferencesSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteConnectionStringKeyVaultReferencesSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteConnectionStringKeyVaultReferenceSlotRequest(string resourceGroupName, string name, string connectionStringKey, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/configreferences/connectionstrings/", false); + uri.AppendPath(connectionStringKey, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the config reference and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetSiteConnectionStringKeyVaultReferenceSlotAsync(string resourceGroupName, string name, string connectionStringKey, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (connectionStringKey == null) + { + throw new ArgumentNullException(nameof(connectionStringKey)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteConnectionStringKeyVaultReferenceSlotRequest(resourceGroupName, name, connectionStringKey, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKVReference value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApiKVReference.DeserializeApiKVReference(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the config reference and status of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public Response GetSiteConnectionStringKeyVaultReferenceSlot(string resourceGroupName, string name, string connectionStringKey, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (connectionStringKey == null) + { + throw new ArgumentNullException(nameof(connectionStringKey)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteConnectionStringKeyVaultReferenceSlotRequest(resourceGroupName, name, connectionStringKey, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKVReference value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApiKVReference.DeserializeApiKVReference(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateConnectionStringsSlotRequest(string resourceGroupName, string name, string slot, ConnectionStringDictionary connectionStrings) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/connectionstrings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionStrings); + request.Content = content; + return message; + } + + /// Description for Replaces the connection strings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the connection settings for the production slot. + /// Connection strings of the app or deployment slot. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateConnectionStringsSlotAsync(string resourceGroupName, string name, string slot, ConnectionStringDictionary connectionStrings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionStrings == null) + { + throw new ArgumentNullException(nameof(connectionStrings)); + } + + using var message = CreateUpdateConnectionStringsSlotRequest(resourceGroupName, name, slot, connectionStrings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionStringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Replaces the connection strings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the connection settings for the production slot. + /// Connection strings of the app or deployment slot. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateConnectionStringsSlot(string resourceGroupName, string name, string slot, ConnectionStringDictionary connectionStrings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionStrings == null) + { + throw new ArgumentNullException(nameof(connectionStrings)); + } + + using var message = CreateUpdateConnectionStringsSlotRequest(resourceGroupName, name, slot, connectionStrings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionStringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConnectionStringsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/connectionstrings/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the connection strings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the connection settings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListConnectionStringsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListConnectionStringsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionStringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the connection strings of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the connection settings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListConnectionStringsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListConnectionStringsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionStringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetDiagnosticLogsConfigurationSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/logs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the logging configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the logging configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetDiagnosticLogsConfigurationSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetDiagnosticLogsConfigurationSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteLogsConfig value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the logging configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the logging configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetDiagnosticLogsConfigurationSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetDiagnosticLogsConfigurationSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteLogsConfig value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateDiagnosticLogsConfigSlotRequest(string resourceGroupName, string name, string slot, SiteLogsConfig siteLogsConfig) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/logs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteLogsConfig); + request.Content = content; + return message; + } + + /// Description for Updates the logging configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the logging configuration for the production slot. + /// A SiteLogsConfig JSON object that contains the logging configuration to change in the "properties" property. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateDiagnosticLogsConfigSlotAsync(string resourceGroupName, string name, string slot, SiteLogsConfig siteLogsConfig, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteLogsConfig == null) + { + throw new ArgumentNullException(nameof(siteLogsConfig)); + } + + using var message = CreateUpdateDiagnosticLogsConfigSlotRequest(resourceGroupName, name, slot, siteLogsConfig); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteLogsConfig value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the logging configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the logging configuration for the production slot. + /// A SiteLogsConfig JSON object that contains the logging configuration to change in the "properties" property. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateDiagnosticLogsConfigSlot(string resourceGroupName, string name, string slot, SiteLogsConfig siteLogsConfig, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteLogsConfig == null) + { + throw new ArgumentNullException(nameof(siteLogsConfig)); + } + + using var message = CreateUpdateDiagnosticLogsConfigSlotRequest(resourceGroupName, name, slot, siteLogsConfig); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteLogsConfig value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateMetadataSlotRequest(string resourceGroupName, string name, string slot, StringDictionary metadata) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/metadata", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(metadata); + request.Content = content; + return message; + } + + /// Description for Replaces the metadata of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the metadata for the production slot. + /// Edited metadata of the app or deployment slot. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateMetadataSlotAsync(string resourceGroupName, string name, string slot, StringDictionary metadata, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (metadata == null) + { + throw new ArgumentNullException(nameof(metadata)); + } + + using var message = CreateUpdateMetadataSlotRequest(resourceGroupName, name, slot, metadata); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Replaces the metadata of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the metadata for the production slot. + /// Edited metadata of the app or deployment slot. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateMetadataSlot(string resourceGroupName, string name, string slot, StringDictionary metadata, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (metadata == null) + { + throw new ArgumentNullException(nameof(metadata)); + } + + using var message = CreateUpdateMetadataSlotRequest(resourceGroupName, name, slot, metadata); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListMetadataSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/metadata/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the metadata of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the metadata for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListMetadataSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListMetadataSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the metadata of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the metadata for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListMetadataSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListMetadataSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPublishingCredentialsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/publishingcredentials/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the Git/FTP publishing credentials of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task ListPublishingCredentialsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListPublishingCredentialsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the Git/FTP publishing credentials of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListPublishingCredentialsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListPublishingCredentialsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateSitePushSettingsSlotRequest(string resourceGroupName, string name, string slot, PushSettings pushSettings) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/pushsettings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(pushSettings); + request.Content = content; + return message; + } + + /// Description for Updates the Push settings associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Push settings associated with web app. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateSitePushSettingsSlotAsync(string resourceGroupName, string name, string slot, PushSettings pushSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (pushSettings == null) + { + throw new ArgumentNullException(nameof(pushSettings)); + } + + using var message = CreateUpdateSitePushSettingsSlotRequest(resourceGroupName, name, slot, pushSettings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PushSettings value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PushSettings.DeserializePushSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the Push settings associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Push settings associated with web app. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateSitePushSettingsSlot(string resourceGroupName, string name, string slot, PushSettings pushSettings, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (pushSettings == null) + { + throw new ArgumentNullException(nameof(pushSettings)); + } + + using var message = CreateUpdateSitePushSettingsSlotRequest(resourceGroupName, name, slot, pushSettings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PushSettings value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PushSettings.DeserializePushSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSitePushSettingsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/pushsettings/list", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the Push settings associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSitePushSettingsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSitePushSettingsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PushSettings value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PushSettings.DeserializePushSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the Push settings associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListSitePushSettingsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSitePushSettingsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PushSettings value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PushSettings.DeserializePushSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetConfigurationSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetConfigurationSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetConfigurationSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetConfigurationSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetConfigurationSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateConfigurationSlotRequest(string resourceGroupName, string name, string slot, SiteConfigResource siteConfig) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteConfig); + request.Content = content; + return message; + } + + /// Description for Updates the configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update configuration for the production slot. + /// JSON representation of a SiteConfig object. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task> CreateOrUpdateConfigurationSlotAsync(string resourceGroupName, string name, string slot, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteConfig == null) + { + throw new ArgumentNullException(nameof(siteConfig)); + } + + using var message = CreateCreateOrUpdateConfigurationSlotRequest(resourceGroupName, name, slot, siteConfig); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update configuration for the production slot. + /// JSON representation of a SiteConfig object. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateConfigurationSlot(string resourceGroupName, string name, string slot, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteConfig == null) + { + throw new ArgumentNullException(nameof(siteConfig)); + } + + using var message = CreateCreateOrUpdateConfigurationSlotRequest(resourceGroupName, name, slot, siteConfig); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateConfigurationSlotRequest(string resourceGroupName, string name, string slot, SiteConfigResource siteConfig) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteConfig); + request.Content = content; + return message; + } + + /// Description for Updates the configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update configuration for the production slot. + /// JSON representation of a SiteConfig object. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateConfigurationSlotAsync(string resourceGroupName, string name, string slot, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteConfig == null) + { + throw new ArgumentNullException(nameof(siteConfig)); + } + + using var message = CreateUpdateConfigurationSlotRequest(resourceGroupName, name, slot, siteConfig); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update configuration for the production slot. + /// JSON representation of a SiteConfig object. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateConfigurationSlot(string resourceGroupName, string name, string slot, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteConfig == null) + { + throw new ArgumentNullException(nameof(siteConfig)); + } + + using var message = CreateUpdateConfigurationSlotRequest(resourceGroupName, name, slot, siteConfig); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConfigurationSnapshotInfoSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/web/snapshots", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListConfigurationSnapshotInfoSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListConfigurationSnapshotInfoSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigurationSnapshotInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListConfigurationSnapshotInfoSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListConfigurationSnapshotInfoSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigurationSnapshotInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetConfigurationSnapshotSlotRequest(string resourceGroupName, string name, string snapshotId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/web/snapshots/", false); + uri.AppendPath(snapshotId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a snapshot of the configuration of an app at a previous point in time. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The ID of the snapshot to read. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetConfigurationSnapshotSlotAsync(string resourceGroupName, string name, string snapshotId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (snapshotId == null) + { + throw new ArgumentNullException(nameof(snapshotId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetConfigurationSnapshotSlotRequest(resourceGroupName, name, snapshotId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a snapshot of the configuration of an app at a previous point in time. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The ID of the snapshot to read. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetConfigurationSnapshotSlot(string resourceGroupName, string name, string snapshotId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (snapshotId == null) + { + throw new ArgumentNullException(nameof(snapshotId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetConfigurationSnapshotSlotRequest(resourceGroupName, name, snapshotId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRecoverSiteConfigurationSnapshotSlotRequest(string resourceGroupName, string name, string snapshotId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/config/web/snapshots/", false); + uri.AppendPath(snapshotId, true); + uri.AppendPath("/recover", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Reverts the configuration of an app to a previous snapshot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The ID of the snapshot to read. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task RecoverSiteConfigurationSnapshotSlotAsync(string resourceGroupName, string name, string snapshotId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (snapshotId == null) + { + throw new ArgumentNullException(nameof(snapshotId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateRecoverSiteConfigurationSnapshotSlotRequest(resourceGroupName, name, snapshotId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Reverts the configuration of an app to a previous snapshot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The ID of the snapshot to read. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response RecoverSiteConfigurationSnapshotSlot(string resourceGroupName, string name, string snapshotId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (snapshotId == null) + { + throw new ArgumentNullException(nameof(snapshotId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateRecoverSiteConfigurationSnapshotSlotRequest(resourceGroupName, name, snapshotId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetWebSiteContainerLogsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/containerlogs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/octet-stream"); + return message; + } + + /// Description for Gets the last lines of docker logs for the given site. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetWebSiteContainerLogsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetWebSiteContainerLogsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 204: + return Response.FromValue((Stream)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the last lines of docker logs for the given site. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetWebSiteContainerLogsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetWebSiteContainerLogsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 204: + return Response.FromValue((Stream)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetContainerLogsZipSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/containerlogs/zip/download", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/zip"); + return message; + } + + /// Description for Gets the ZIP archived docker log files for the given site. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetContainerLogsZipSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetContainerLogsZipSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 204: + return Response.FromValue((Stream)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the ZIP archived docker log files for the given site. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetContainerLogsZipSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetContainerLogsZipSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 204: + return Response.FromValue((Stream)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListContinuousWebJobsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/continuouswebjobs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List continuous web jobs for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListContinuousWebJobsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListContinuousWebJobsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContinuousWebJobCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List continuous web jobs for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListContinuousWebJobsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListContinuousWebJobsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContinuousWebJobCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetContinuousWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/continuouswebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a continuous web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetContinuousWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContinuousWebJob value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContinuousWebJob.DeserializeContinuousWebJob(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContinuousWebJob)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a continuous web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetContinuousWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContinuousWebJob value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContinuousWebJob.DeserializeContinuousWebJob(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContinuousWebJob)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteContinuousWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/continuouswebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a continuous web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteContinuousWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a continuous web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteContinuousWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStartContinuousWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/continuouswebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Start a continuous web job for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task StartContinuousWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStartContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Start a continuous web job for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response StartContinuousWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStartContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStopContinuousWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/continuouswebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Stop a continuous web job for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task StopContinuousWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStopContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Stop a continuous web job for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response StopContinuousWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStopContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListDeploymentsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List deployments for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListDeploymentsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListDeploymentsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List deployments for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListDeploymentsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListDeploymentsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetDeploymentSlotRequest(string resourceGroupName, string name, string id, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(id, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a deployment by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Deployment ID. + /// Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetDeploymentSlotAsync(string resourceGroupName, string name, string id, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetDeploymentSlotRequest(resourceGroupName, name, id, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Deployment value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Deployment.DeserializeDeployment(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a deployment by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Deployment ID. + /// Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetDeploymentSlot(string resourceGroupName, string name, string id, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetDeploymentSlotRequest(resourceGroupName, name, id, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Deployment value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Deployment.DeserializeDeployment(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateDeploymentSlotRequest(string resourceGroupName, string name, string id, string slot, Deployment deployment) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(id, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(deployment); + request.Content = content; + return message; + } + + /// Description for Create a deployment for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of an existing deployment. + /// Name of the deployment slot. If a slot is not specified, the API creates a deployment for the production slot. + /// Deployment details. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> CreateDeploymentSlotAsync(string resourceGroupName, string name, string id, string slot, Deployment deployment, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (deployment == null) + { + throw new ArgumentNullException(nameof(deployment)); + } + + using var message = CreateCreateDeploymentSlotRequest(resourceGroupName, name, id, slot, deployment); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Deployment value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Deployment.DeserializeDeployment(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create a deployment for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// ID of an existing deployment. + /// Name of the deployment slot. If a slot is not specified, the API creates a deployment for the production slot. + /// Deployment details. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateDeploymentSlot(string resourceGroupName, string name, string id, string slot, Deployment deployment, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (deployment == null) + { + throw new ArgumentNullException(nameof(deployment)); + } + + using var message = CreateCreateDeploymentSlotRequest(resourceGroupName, name, id, slot, deployment); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Deployment value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Deployment.DeserializeDeployment(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteDeploymentSlotRequest(string resourceGroupName, string name, string id, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(id, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a deployment by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Deployment ID. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteDeploymentSlotAsync(string resourceGroupName, string name, string id, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteDeploymentSlotRequest(resourceGroupName, name, id, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a deployment by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Deployment ID. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteDeploymentSlot(string resourceGroupName, string name, string id, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteDeploymentSlotRequest(resourceGroupName, name, id, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListDeploymentLogSlotRequest(string resourceGroupName, string name, string id, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(id, true); + uri.AppendPath("/log", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List deployment log for specific deployment for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The ID of a specific deployment. This is the value of the name property in the JSON response from "GET /api/sites/{siteName}/deployments". + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListDeploymentLogSlotAsync(string resourceGroupName, string name, string id, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListDeploymentLogSlotRequest(resourceGroupName, name, id, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Deployment value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Deployment.DeserializeDeployment(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List deployment log for specific deployment for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The ID of a specific deployment. This is the value of the name property in the JSON response from "GET /api/sites/{siteName}/deployments". + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListDeploymentLogSlot(string resourceGroupName, string name, string id, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListDeploymentLogSlotRequest(resourceGroupName, name, id, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Deployment value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Deployment.DeserializeDeployment(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDiscoverBackupSlotRequest(string resourceGroupName, string name, string slot, RestoreRequest request) + { + var message = _pipeline.CreateMessage(); + var request0 = message.Request; + request0.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/discoverbackup", false); + uri.AppendQuery("api-version", apiVersion, true); + request0.Uri = uri; + request0.Headers.Add("Accept", "application/json"); + request0.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(request); + request0.Content = content; + return message; + } + + /// Description for Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will perform discovery for the production slot. + /// A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. + /// The cancellation token to use. + /// , , , or is null. + public async Task> DiscoverBackupSlotAsync(string resourceGroupName, string name, string slot, RestoreRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateDiscoverBackupSlotRequest(resourceGroupName, name, slot, request); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RestoreRequest value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RestoreRequest.DeserializeRestoreRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will perform discovery for the production slot. + /// A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. + /// The cancellation token to use. + /// , , , or is null. + public Response DiscoverBackupSlot(string resourceGroupName, string name, string slot, RestoreRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateDiscoverBackupSlotRequest(resourceGroupName, name, slot, request); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RestoreRequest value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RestoreRequest.DeserializeRestoreRequest(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListDomainOwnershipIdentifiersSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/domainOwnershipIdentifiers", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Lists ownership identifiers for domain associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListDomainOwnershipIdentifiersSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListDomainOwnershipIdentifiersSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IdentifierCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Lists ownership identifiers for domain associated with web app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListDomainOwnershipIdentifiersSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListDomainOwnershipIdentifiersSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IdentifierCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetDomainOwnershipIdentifierSlotRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/domainOwnershipIdentifiers/", false); + uri.AppendPath(domainOwnershipIdentifierName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get domain ownership identifier for web app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetDomainOwnershipIdentifierSlotAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Identifier value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Identifier.DeserializeIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get domain ownership identifier for web app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetDomainOwnershipIdentifierSlot(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Identifier value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Identifier.DeserializeIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateDomainOwnershipIdentifierSlotRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Identifier domainOwnershipIdentifier) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/domainOwnershipIdentifiers/", false); + uri.AppendPath(domainOwnershipIdentifierName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(domainOwnershipIdentifier); + request.Content = content; + return message; + } + + /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// A JSON representation of the domain ownership properties. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> CreateOrUpdateDomainOwnershipIdentifierSlotAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (domainOwnershipIdentifier == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); + } + + using var message = CreateCreateOrUpdateDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Identifier value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Identifier.DeserializeIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// A JSON representation of the domain ownership properties. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateOrUpdateDomainOwnershipIdentifierSlot(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (domainOwnershipIdentifier == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); + } + + using var message = CreateCreateOrUpdateDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Identifier value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Identifier.DeserializeIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteDomainOwnershipIdentifierSlotRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/domainOwnershipIdentifiers/", false); + uri.AppendPath(domainOwnershipIdentifierName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a domain ownership identifier for a web app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteDomainOwnershipIdentifierSlotAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a domain ownership identifier for a web app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteDomainOwnershipIdentifierSlot(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateDomainOwnershipIdentifierSlotRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Identifier domainOwnershipIdentifier) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/domainOwnershipIdentifiers/", false); + uri.AppendPath(domainOwnershipIdentifierName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(domainOwnershipIdentifier); + request.Content = content; + return message; + } + + /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// A JSON representation of the domain ownership properties. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> UpdateDomainOwnershipIdentifierSlotAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (domainOwnershipIdentifier == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); + } + + using var message = CreateUpdateDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Identifier value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Identifier.DeserializeIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of domain ownership identifier. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// A JSON representation of the domain ownership properties. + /// The cancellation token to use. + /// , , , , or is null. + public Response UpdateDomainOwnershipIdentifierSlot(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (domainOwnershipIdentifierName == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (domainOwnershipIdentifier == null) + { + throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); + } + + using var message = CreateUpdateDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Identifier value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Identifier.DeserializeIdentifier(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetMSDeployStatusSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/extensions/MSDeploy", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the status of the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetMSDeployStatusSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetMSDeployStatusSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MSDeployStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the status of the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetMSDeployStatusSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetMSDeployStatusSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MSDeployStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateMSDeployOperationSlotRequest(string resourceGroupName, string name, string slot, MSDeploy mSDeploy) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/extensions/MSDeploy", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(mSDeploy); + request.Content = content; + return message; + } + + /// Description for Invoke the MSDeploy web app extension. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Details of MSDeploy operation. + /// The cancellation token to use. + /// , , , or is null. + public async Task CreateMSDeployOperationSlotAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (mSDeploy == null) + { + throw new ArgumentNullException(nameof(mSDeploy)); + } + + using var message = CreateCreateMSDeployOperationSlotRequest(resourceGroupName, name, slot, mSDeploy); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 201: + case 409: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Invoke the MSDeploy web app extension. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Details of MSDeploy operation. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateMSDeployOperationSlot(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (mSDeploy == null) + { + throw new ArgumentNullException(nameof(mSDeploy)); + } + + using var message = CreateCreateMSDeployOperationSlotRequest(resourceGroupName, name, slot, mSDeploy); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 201: + case 409: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetMSDeployLogSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/extensions/MSDeploy/log", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetMSDeployLogSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetMSDeployLogSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MSDeployLog value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MSDeployLog)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetMSDeployLogSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetMSDeployLogSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MSDeployLog value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MSDeployLog)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceFunctionsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/functions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the functions for a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListInstanceFunctionsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListInstanceFunctionsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionEnvelopeCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the functions for a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListInstanceFunctionsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListInstanceFunctionsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionEnvelopeCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetFunctionsAdminTokenSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/functions/admin/token", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Fetch a short lived token that can be exchanged for a master key. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetFunctionsAdminTokenSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetFunctionsAdminTokenSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + string value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = document.RootElement.GetString(); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Fetch a short lived token that can be exchanged for a master key. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetFunctionsAdminTokenSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetFunctionsAdminTokenSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + string value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = document.RootElement.GetString(); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceFunctionSlotRequest(string resourceGroupName, string name, string functionName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get function information by its ID for web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetInstanceFunctionSlotAsync(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetInstanceFunctionSlotRequest(resourceGroupName, name, functionName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionEnvelope value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionEnvelope.DeserializeFunctionEnvelope(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FunctionEnvelope)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get function information by its ID for web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetInstanceFunctionSlot(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetInstanceFunctionSlotRequest(resourceGroupName, name, functionName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionEnvelope value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionEnvelope.DeserializeFunctionEnvelope(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FunctionEnvelope)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateInstanceFunctionSlotRequest(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(functionEnvelope); + request.Content = content; + return message; + } + + /// Description for Create function for web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// Name of the deployment slot. + /// Function details. + /// The cancellation token to use. + /// , , , , or is null. + public async Task CreateInstanceFunctionSlotAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (functionEnvelope == null) + { + throw new ArgumentNullException(nameof(functionEnvelope)); + } + + using var message = CreateCreateInstanceFunctionSlotRequest(resourceGroupName, name, functionName, slot, functionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 201: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Create function for web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// Name of the deployment slot. + /// Function details. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateInstanceFunctionSlot(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (functionEnvelope == null) + { + throw new ArgumentNullException(nameof(functionEnvelope)); + } + + using var message = CreateCreateInstanceFunctionSlotRequest(resourceGroupName, name, functionName, slot, functionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 201: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteInstanceFunctionSlotRequest(string resourceGroupName, string name, string functionName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a function for web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteInstanceFunctionSlotAsync(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteInstanceFunctionSlotRequest(resourceGroupName, name, functionName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a function for web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteInstanceFunctionSlot(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteInstanceFunctionSlotRequest(resourceGroupName, name, functionName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateFunctionSecretSlotRequest(string resourceGroupName, string name, string functionName, string keyName, string slot, KeyInfo key) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendPath("/keys/", false); + uri.AppendPath(keyName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(key); + request.Content = content; + return message; + } + + /// Description for Add or update a function secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The name of the function. + /// The name of the key. + /// Name of the deployment slot. + /// The key to create or update. + /// The cancellation token to use. + /// , , , , , or is null. + public async Task> CreateOrUpdateFunctionSecretSlotAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, KeyInfo key, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + using var message = CreateCreateOrUpdateFunctionSecretSlotRequest(resourceGroupName, name, functionName, keyName, slot, key); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + KeyInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = KeyInfo.DeserializeKeyInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Add or update a function secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The name of the function. + /// The name of the key. + /// Name of the deployment slot. + /// The key to create or update. + /// The cancellation token to use. + /// , , , , , or is null. + public Response CreateOrUpdateFunctionSecretSlot(string resourceGroupName, string name, string functionName, string keyName, string slot, KeyInfo key, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + using var message = CreateCreateOrUpdateFunctionSecretSlotRequest(resourceGroupName, name, functionName, keyName, slot, key); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + KeyInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = KeyInfo.DeserializeKeyInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteFunctionSecretSlotRequest(string resourceGroupName, string name, string functionName, string keyName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendPath("/keys/", false); + uri.AppendPath(keyName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a function secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The name of the function. + /// The name of the key. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , , or is null. + public async Task DeleteFunctionSecretSlotAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteFunctionSecretSlotRequest(resourceGroupName, name, functionName, keyName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a function secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The name of the function. + /// The name of the key. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , , or is null. + public Response DeleteFunctionSecretSlot(string resourceGroupName, string name, string functionName, string keyName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteFunctionSecretSlotRequest(resourceGroupName, name, functionName, keyName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListFunctionKeysSlotRequest(string resourceGroupName, string name, string functionName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendPath("/listkeys", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get function keys for a function in a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListFunctionKeysSlotAsync(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListFunctionKeysSlotRequest(resourceGroupName, name, functionName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get function keys for a function in a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListFunctionKeysSlot(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListFunctionKeysSlotRequest(resourceGroupName, name, functionName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + StringDictionary value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StringDictionary.DeserializeStringDictionary(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListFunctionSecretsSlotRequest(string resourceGroupName, string name, string functionName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/functions/", false); + uri.AppendPath(functionName, true); + uri.AppendPath("/listsecrets", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get function secrets for a function in a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListFunctionSecretsSlotAsync(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListFunctionSecretsSlotRequest(resourceGroupName, name, functionName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionSecrets value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get function secrets for a function in a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Function name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListFunctionSecretsSlot(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (functionName == null) + { + throw new ArgumentNullException(nameof(functionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListFunctionSecretsSlotRequest(resourceGroupName, name, functionName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionSecrets value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHostKeysSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/host/default/listkeys", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get host secrets for a function app. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListHostKeysSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListHostKeysSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HostKeys value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HostKeys.DeserializeHostKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get host secrets for a function app. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListHostKeysSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListHostKeysSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HostKeys value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HostKeys.DeserializeHostKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSyncStatusSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/host/default/listsyncstatus", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for This is to allow calling via powershell and ARM template. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public async Task ListSyncStatusSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSyncStatusSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for This is to allow calling via powershell and ARM template. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListSyncStatusSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSyncStatusSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateSyncFunctionsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/host/default/sync", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Syncs function trigger metadata to the management database. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public async Task SyncFunctionsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateSyncFunctionsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Syncs function trigger metadata to the management database. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public Response SyncFunctionsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateSyncFunctionsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateHostSecretSlotRequest(string resourceGroupName, string name, string keyType, string keyName, string slot, KeyInfo key) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/host/default/", false); + uri.AppendPath(keyType, true); + uri.AppendPath("/", false); + uri.AppendPath(keyName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(key); + request.Content = content; + return message; + } + + /// Description for Add or update a host level secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The type of host key. + /// The name of the key. + /// Name of the deployment slot. + /// The key to create or update. + /// The cancellation token to use. + /// , , , , , or is null. + public async Task> CreateOrUpdateHostSecretSlotAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, KeyInfo key, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (keyType == null) + { + throw new ArgumentNullException(nameof(keyType)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + using var message = CreateCreateOrUpdateHostSecretSlotRequest(resourceGroupName, name, keyType, keyName, slot, key); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + KeyInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = KeyInfo.DeserializeKeyInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Add or update a host level secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The type of host key. + /// The name of the key. + /// Name of the deployment slot. + /// The key to create or update. + /// The cancellation token to use. + /// , , , , , or is null. + public Response CreateOrUpdateHostSecretSlot(string resourceGroupName, string name, string keyType, string keyName, string slot, KeyInfo key, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (keyType == null) + { + throw new ArgumentNullException(nameof(keyType)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + using var message = CreateCreateOrUpdateHostSecretSlotRequest(resourceGroupName, name, keyType, keyName, slot, key); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + KeyInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = KeyInfo.DeserializeKeyInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteHostSecretSlotRequest(string resourceGroupName, string name, string keyType, string keyName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/host/default/", false); + uri.AppendPath(keyType, true); + uri.AppendPath("/", false); + uri.AppendPath(keyName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a host level secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The type of host key. + /// The name of the key. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , , or is null. + public async Task DeleteHostSecretSlotAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (keyType == null) + { + throw new ArgumentNullException(nameof(keyType)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteHostSecretSlotRequest(resourceGroupName, name, keyType, keyName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a host level secret. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The type of host key. + /// The name of the key. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , , or is null. + public Response DeleteHostSecretSlot(string resourceGroupName, string name, string keyType, string keyName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (keyType == null) + { + throw new ArgumentNullException(nameof(keyType)); + } + if (keyName == null) + { + throw new ArgumentNullException(nameof(keyName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteHostSecretSlotRequest(resourceGroupName, name, keyType, keyName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHostNameBindingsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hostNameBindings", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get hostname bindings for an app or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListHostNameBindingsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListHostNameBindingsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HostNameBindingCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get hostname bindings for an app or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListHostNameBindingsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListHostNameBindingsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HostNameBindingCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetHostNameBindingSlotRequest(string resourceGroupName, string name, string slot, string hostName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hostNameBindings/", false); + uri.AppendPath(hostName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the named hostname binding for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API the named binding for the production slot. + /// Hostname in the hostname binding. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetHostNameBindingSlotAsync(string resourceGroupName, string name, string slot, string hostName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateGetHostNameBindingSlotRequest(resourceGroupName, name, slot, hostName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HostNameBinding value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the named hostname binding for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API the named binding for the production slot. + /// Hostname in the hostname binding. + /// The cancellation token to use. + /// , , , or is null. + public Response GetHostNameBindingSlot(string resourceGroupName, string name, string slot, string hostName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateGetHostNameBindingSlotRequest(resourceGroupName, name, slot, hostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HostNameBinding value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateHostNameBindingSlotRequest(string resourceGroupName, string name, string hostName, string slot, HostNameBinding hostNameBinding) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hostNameBindings/", false); + uri.AppendPath(hostName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(hostNameBinding); + request.Content = content; + return message; + } + + /// Description for Creates a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Hostname in the hostname binding. + /// Name of the deployment slot. If a slot is not specified, the API will create a binding for the production slot. + /// Binding details. This is the JSON representation of a HostNameBinding object. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> CreateOrUpdateHostNameBindingSlotAsync(string resourceGroupName, string name, string hostName, string slot, HostNameBinding hostNameBinding, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (hostNameBinding == null) + { + throw new ArgumentNullException(nameof(hostNameBinding)); + } + + using var message = CreateCreateOrUpdateHostNameBindingSlotRequest(resourceGroupName, name, hostName, slot, hostNameBinding); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HostNameBinding value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Hostname in the hostname binding. + /// Name of the deployment slot. If a slot is not specified, the API will create a binding for the production slot. + /// Binding details. This is the JSON representation of a HostNameBinding object. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateOrUpdateHostNameBindingSlot(string resourceGroupName, string name, string hostName, string slot, HostNameBinding hostNameBinding, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (hostNameBinding == null) + { + throw new ArgumentNullException(nameof(hostNameBinding)); + } + + using var message = CreateCreateOrUpdateHostNameBindingSlotRequest(resourceGroupName, name, hostName, slot, hostNameBinding); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HostNameBinding value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteHostNameBindingSlotRequest(string resourceGroupName, string name, string slot, string hostName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hostNameBindings/", false); + uri.AppendPath(hostName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// Hostname in the hostname binding. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteHostNameBindingSlotAsync(string resourceGroupName, string name, string slot, string hostName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateDeleteHostNameBindingSlotRequest(resourceGroupName, name, slot, hostName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// Hostname in the hostname binding. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteHostNameBindingSlot(string resourceGroupName, string name, string slot, string hostName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateDeleteHostNameBindingSlotRequest(resourceGroupName, name, slot, hostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetHybridConnectionSlotRequest(string resourceGroupName, string name, string namespaceName, string relayName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hybridConnectionNamespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/relays/", false); + uri.AppendPath(relayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The name of the slot for the web app. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> GetHybridConnectionSlotAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The name of the slot for the web app. + /// The cancellation token to use. + /// , , , , or is null. + public Response GetHybridConnectionSlot(string resourceGroupName, string name, string namespaceName, string relayName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateHybridConnectionSlotRequest(string resourceGroupName, string name, string namespaceName, string relayName, string slot, HybridConnection connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hybridConnectionNamespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/relays/", false); + uri.AppendPath(relayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The name of the slot for the web app. + /// The details of the hybrid connection. + /// The cancellation token to use. + /// , , , , , or is null. + public async Task> CreateOrUpdateHybridConnectionSlotAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The name of the slot for the web app. + /// The details of the hybrid connection. + /// The cancellation token to use. + /// , , , , , or is null. + public Response CreateOrUpdateHybridConnectionSlot(string resourceGroupName, string name, string namespaceName, string relayName, string slot, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteHybridConnectionSlotRequest(string resourceGroupName, string name, string namespaceName, string relayName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hybridConnectionNamespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/relays/", false); + uri.AppendPath(relayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Removes a Hybrid Connection from this site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The name of the slot for the web app. + /// The cancellation token to use. + /// , , , , or is null. + public async Task DeleteHybridConnectionSlotAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Removes a Hybrid Connection from this site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The name of the slot for the web app. + /// The cancellation token to use. + /// , , , , or is null. + public Response DeleteHybridConnectionSlot(string resourceGroupName, string name, string namespaceName, string relayName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateHybridConnectionSlotRequest(string resourceGroupName, string name, string namespaceName, string relayName, string slot, HybridConnection connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hybridConnectionNamespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/relays/", false); + uri.AppendPath(relayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The name of the slot for the web app. + /// The details of the hybrid connection. + /// The cancellation token to use. + /// , , , , , or is null. + public async Task> UpdateHybridConnectionSlotAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The namespace for this hybrid connection. + /// The relay name for this hybrid connection. + /// The name of the slot for the web app. + /// The details of the hybrid connection. + /// The cancellation token to use. + /// , , , , , or is null. + public Response UpdateHybridConnectionSlot(string resourceGroupName, string name, string namespaceName, string relayName, string slot, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (namespaceName == null) + { + throw new ArgumentNullException(nameof(namespaceName)); + } + if (relayName == null) + { + throw new ArgumentNullException(nameof(relayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHybridConnectionsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hybridConnectionRelays", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for the web app. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListHybridConnectionsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListHybridConnectionsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for the web app. + /// The cancellation token to use. + /// , , or is null. + public Response ListHybridConnectionsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListHybridConnectionsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnection.DeserializeHybridConnection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRelayServiceConnectionsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hybridconnection", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets hybrid connections configured for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListRelayServiceConnectionsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListRelayServiceConnectionsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets hybrid connections configured for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListRelayServiceConnectionsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListRelayServiceConnectionsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRelayServiceConnectionSlotRequest(string resourceGroupName, string name, string entityName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hybridconnection/", false); + uri.AppendPath(entityName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a hybrid connection configuration by its name. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection. + /// Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetRelayServiceConnectionSlotAsync(string resourceGroupName, string name, string entityName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a hybrid connection configuration by its name. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection. + /// Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetRelayServiceConnectionSlot(string resourceGroupName, string name, string entityName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRelayServiceConnectionSlotRequest(string resourceGroupName, string name, string entityName, string slot, RelayServiceConnectionEntity connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hybridconnection/", false); + uri.AppendPath(entityName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection configuration. + /// Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid connection for the production slot. + /// Details of the hybrid connection configuration. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> CreateOrUpdateRelayServiceConnectionSlotAsync(string resourceGroupName, string name, string entityName, string slot, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection configuration. + /// Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid connection for the production slot. + /// Details of the hybrid connection configuration. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateOrUpdateRelayServiceConnectionSlot(string resourceGroupName, string name, string entityName, string slot, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRelayServiceConnectionSlotRequest(string resourceGroupName, string name, string entityName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hybridconnection/", false); + uri.AppendPath(entityName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a relay service connection by its name. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection configuration. + /// Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteRelayServiceConnectionSlotAsync(string resourceGroupName, string name, string entityName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a relay service connection by its name. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection configuration. + /// Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteRelayServiceConnectionSlot(string resourceGroupName, string name, string entityName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRelayServiceConnectionSlotRequest(string resourceGroupName, string name, string entityName, string slot, RelayServiceConnectionEntity connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hybridconnection/", false); + uri.AppendPath(entityName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection configuration. + /// Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid connection for the production slot. + /// Details of the hybrid connection configuration. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> UpdateRelayServiceConnectionSlotAsync(string resourceGroupName, string name, string entityName, string slot, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the hybrid connection configuration. + /// Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid connection for the production slot. + /// Details of the hybrid connection configuration. + /// The cancellation token to use. + /// , , , , or is null. + public Response UpdateRelayServiceConnectionSlot(string resourceGroupName, string name, string entityName, string slot, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (entityName == null) + { + throw new ArgumentNullException(nameof(entityName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RelayServiceConnectionEntity value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceIdentifiersSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/instances", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all scale-out instances of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListInstanceIdentifiersSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListInstanceIdentifiersSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppInstanceStatusCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all scale-out instances of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. + /// The cancellation token to use. + /// , , or is null. + public Response ListInstanceIdentifiersSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListInstanceIdentifiersSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppInstanceStatusCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceInfoSlotRequest(string resourceGroupName, string name, string instanceId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all scale-out instances of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetInstanceInfoSlotAsync(string resourceGroupName, string name, string instanceId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetInstanceInfoSlotRequest(resourceGroupName, name, instanceId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebSiteInstanceStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebSiteInstanceStatus.DeserializeWebSiteInstanceStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all scale-out instances of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. + /// The cancellation token to use. + /// , , , or is null. + public Response GetInstanceInfoSlot(string resourceGroupName, string name, string instanceId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetInstanceInfoSlotRequest(resourceGroupName, name, instanceId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebSiteInstanceStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebSiteInstanceStatus.DeserializeWebSiteInstanceStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceMsDeployStatusSlotRequest(string resourceGroupName, string name, string slot, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/extensions/MSDeploy", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the status of the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// ID of web app instance. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetInstanceMsDeployStatusSlotAsync(string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceMsDeployStatusSlotRequest(resourceGroupName, name, slot, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MSDeployStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the status of the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// ID of web app instance. + /// The cancellation token to use. + /// , , , or is null. + public Response GetInstanceMsDeployStatusSlot(string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceMsDeployStatusSlotRequest(resourceGroupName, name, slot, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MSDeployStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateInstanceMSDeployOperationSlotRequest(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/extensions/MSDeploy", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(mSDeploy); + request.Content = content; + return message; + } + + /// Description for Invoke the MSDeploy web app extension. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// ID of web app instance. + /// Details of MSDeploy operation. + /// The cancellation token to use. + /// , , , , or is null. + public async Task CreateInstanceMSDeployOperationSlotAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + if (mSDeploy == null) + { + throw new ArgumentNullException(nameof(mSDeploy)); + } + + using var message = CreateCreateInstanceMSDeployOperationSlotRequest(resourceGroupName, name, slot, instanceId, mSDeploy); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 201: + case 409: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Invoke the MSDeploy web app extension. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// ID of web app instance. + /// Details of MSDeploy operation. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateInstanceMSDeployOperationSlot(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + if (mSDeploy == null) + { + throw new ArgumentNullException(nameof(mSDeploy)); + } + + using var message = CreateCreateInstanceMSDeployOperationSlotRequest(resourceGroupName, name, slot, instanceId, mSDeploy); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 201: + case 409: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceMSDeployLogSlotRequest(string resourceGroupName, string name, string slot, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/extensions/MSDeploy/log", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// ID of web app instance. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetInstanceMSDeployLogSlotAsync(string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceMSDeployLogSlotRequest(resourceGroupName, name, slot, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MSDeployLog value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MSDeployLog)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// ID of web app instance. + /// The cancellation token to use. + /// , , , or is null. + public Response GetInstanceMSDeployLogSlot(string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceMSDeployLogSlotRequest(resourceGroupName, name, slot, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MSDeployLog value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MSDeployLog)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceProcessesSlotRequest(string resourceGroupName, string name, string slot, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListInstanceProcessesSlotAsync(string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessesSlotRequest(resourceGroupName, name, slot, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public Response ListInstanceProcessesSlot(string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessesSlotRequest(resourceGroupName, name, slot, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceProcessSlotRequest(string resourceGroupName, string name, string processId, string slot, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public async Task> GetInstanceProcessSlotAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceProcessSlotRequest(resourceGroupName, name, processId, slot, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessInfo.DeserializeProcessInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfo)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public Response GetInstanceProcessSlot(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceProcessSlotRequest(resourceGroupName, name, processId, slot, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessInfo.DeserializeProcessInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfo)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteInstanceProcessSlotRequest(string resourceGroupName, string name, string processId, string slot, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public async Task DeleteInstanceProcessSlotAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateDeleteInstanceProcessSlotRequest(resourceGroupName, name, processId, slot, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public Response DeleteInstanceProcessSlot(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateDeleteInstanceProcessSlotRequest(resourceGroupName, name, processId, slot, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceProcessDumpSlotRequest(string resourceGroupName, string name, string processId, string slot, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/dump", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public async Task> GetInstanceProcessDumpSlotAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceProcessDumpSlotRequest(resourceGroupName, name, processId, slot, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((Stream)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public Response GetInstanceProcessDumpSlot(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceProcessDumpSlotRequest(resourceGroupName, name, processId, slot, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((Stream)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceProcessModulesSlotRequest(string resourceGroupName, string name, string processId, string slot, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/modules", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListInstanceProcessModulesSlotAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessModulesSlotRequest(resourceGroupName, name, processId, slot, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public Response ListInstanceProcessModulesSlot(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessModulesSlotRequest(resourceGroupName, name, processId, slot, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetInstanceProcessModuleSlotRequest(string resourceGroupName, string name, string processId, string baseAddress, string slot, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/modules/", false); + uri.AppendPath(baseAddress, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Module base address. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , , or is null. + public async Task> GetInstanceProcessModuleSlotAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (baseAddress == null) + { + throw new ArgumentNullException(nameof(baseAddress)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceProcessModuleSlotRequest(resourceGroupName, name, processId, baseAddress, slot, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfo)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Module base address. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , , or is null. + public Response GetInstanceProcessModuleSlot(string resourceGroupName, string name, string processId, string baseAddress, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (baseAddress == null) + { + throw new ArgumentNullException(nameof(baseAddress)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateGetInstanceProcessModuleSlotRequest(resourceGroupName, name, processId, baseAddress, slot, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfo)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceProcessThreadsSlotRequest(string resourceGroupName, string name, string processId, string slot, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/instances/", false); + uri.AppendPath(instanceId, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/threads", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListInstanceProcessThreadsSlotAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessThreadsSlotRequest(resourceGroupName, name, processId, slot, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public Response ListInstanceProcessThreadsSlot(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessThreadsSlotRequest(resourceGroupName, name, processId, slot, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateIsCloneableSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/iscloneable", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Shows whether an app can be cloned to another resource group or subscription. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. By default, this API returns information on the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> IsCloneableSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateIsCloneableSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteCloneability value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteCloneability.DeserializeSiteCloneability(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Shows whether an app can be cloned to another resource group or subscription. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. By default, this API returns information on the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response IsCloneableSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateIsCloneableSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteCloneability value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteCloneability.DeserializeSiteCloneability(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteBackupsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/listbackups", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets existing backups of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSiteBackupsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteBackupsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets existing backups of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListSiteBackupsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteBackupsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSyncFunctionTriggersSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/listsyncfunctiontriggerstatus", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for This is to allow calling via powershell and ARM template. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSyncFunctionTriggersSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSyncFunctionTriggersSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionSecrets value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for This is to allow calling via powershell and ARM template. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListSyncFunctionTriggersSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSyncFunctionTriggersSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionSecrets value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetMigrateMySqlStatusSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/migratemysql/status", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetMigrateMySqlStatusSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetMigrateMySqlStatusSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrateMySqlStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrateMySqlStatus.DeserializeMigrateMySqlStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetMigrateMySqlStatusSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetMigrateMySqlStatusSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrateMySqlStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrateMySqlStatus.DeserializeMigrateMySqlStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSwiftVirtualNetworkConnectionSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/networkConfig/virtualNetwork", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a Swift Virtual Network connection. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get a gateway for the production slot's Virtual Network. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetSwiftVirtualNetworkConnectionSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSwiftVirtualNetworkConnectionSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SwiftVirtualNetwork value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SwiftVirtualNetwork.DeserializeSwiftVirtualNetwork(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a Swift Virtual Network connection. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get a gateway for the production slot's Virtual Network. + /// The cancellation token to use. + /// , , or is null. + public Response GetSwiftVirtualNetworkConnectionSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSwiftVirtualNetworkConnectionSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SwiftVirtualNetwork value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SwiftVirtualNetwork.DeserializeSwiftVirtualNetwork(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteSwiftVirtualNetworkSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/networkConfig/virtualNetwork", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the connection for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteSwiftVirtualNetworkSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteSwiftVirtualNetworkSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the connection for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteSwiftVirtualNetworkSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteSwiftVirtualNetworkSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNetworkFeaturesSlotRequest(string resourceGroupName, string name, string view, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/networkFeatures/", false); + uri.AppendPath(view, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all network features used by the app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The type of view. Only "summary" is supported at this time. + /// Name of the deployment slot. If a slot is not specified, the API will get network features for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListNetworkFeaturesSlotAsync(string resourceGroupName, string name, string view, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (view == null) + { + throw new ArgumentNullException(nameof(view)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListNetworkFeaturesSlotRequest(resourceGroupName, name, view, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkFeatures value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = NetworkFeatures.DeserializeNetworkFeatures(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkFeatures)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all network features used by the app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The type of view. Only "summary" is supported at this time. + /// Name of the deployment slot. If a slot is not specified, the API will get network features for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListNetworkFeaturesSlot(string resourceGroupName, string name, string view, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (view == null) + { + throw new ArgumentNullException(nameof(view)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListNetworkFeaturesSlotRequest(resourceGroupName, name, view, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkFeatures value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = NetworkFeatures.DeserializeNetworkFeatures(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkFeatures)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetNetworkTraceOperationSlotRequest(string resourceGroupName, string name, string operationId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/networkTrace/operationresults/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetNetworkTraceOperationSlotAsync(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetNetworkTraceOperationSlotRequest(resourceGroupName, name, operationId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + case 202: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetNetworkTraceOperationSlot(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetNetworkTraceOperationSlotRequest(resourceGroupName, name, operationId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + case 202: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStartWebSiteNetworkTraceSlotRequest(string resourceGroupName, string name, string slot, int? durationInSeconds, int? maxFrameLength, string sasUrl) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/networkTrace/start", false); + if (durationInSeconds != null) + { + uri.AppendQuery("durationInSeconds", durationInSeconds.Value, true); + } + if (maxFrameLength != null) + { + uri.AppendQuery("maxFrameLength", maxFrameLength.Value, true); + } + if (sasUrl != null) + { + uri.AppendQuery("sasUrl", sasUrl, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Start capturing network packets for the site (To be deprecated). + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for this web app. + /// The duration to keep capturing in seconds. + /// The maximum frame length in bytes (Optional). + /// The Blob URL to store capture file. + /// The cancellation token to use. + /// , , or is null. + public async Task> StartWebSiteNetworkTraceSlotAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStartWebSiteNetworkTraceSlotRequest(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + string value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = document.RootElement.GetString(); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Start capturing network packets for the site (To be deprecated). + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for this web app. + /// The duration to keep capturing in seconds. + /// The maximum frame length in bytes (Optional). + /// The Blob URL to store capture file. + /// The cancellation token to use. + /// , , or is null. + public Response StartWebSiteNetworkTraceSlot(string resourceGroupName, string name, string slot, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStartWebSiteNetworkTraceSlotRequest(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + string value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = document.RootElement.GetString(); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStartWebSiteNetworkTraceOperationSlotRequest(string resourceGroupName, string name, string slot, int? durationInSeconds, int? maxFrameLength, string sasUrl) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/networkTrace/startOperation", false); + if (durationInSeconds != null) + { + uri.AppendQuery("durationInSeconds", durationInSeconds.Value, true); + } + if (maxFrameLength != null) + { + uri.AppendQuery("maxFrameLength", maxFrameLength.Value, true); + } + if (sasUrl != null) + { + uri.AppendQuery("sasUrl", sasUrl, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Start capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for this web app. + /// The duration to keep capturing in seconds. + /// The maximum frame length in bytes (Optional). + /// The Blob URL to store capture file. + /// The cancellation token to use. + /// , , or is null. + public async Task StartWebSiteNetworkTraceOperationSlotAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStartWebSiteNetworkTraceOperationSlotRequest(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Start capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for this web app. + /// The duration to keep capturing in seconds. + /// The maximum frame length in bytes (Optional). + /// The Blob URL to store capture file. + /// The cancellation token to use. + /// , , or is null. + public Response StartWebSiteNetworkTraceOperationSlot(string resourceGroupName, string name, string slot, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStartWebSiteNetworkTraceOperationSlotRequest(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStopWebSiteNetworkTraceSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/networkTrace/stop", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Stop ongoing capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for this web app. + /// The cancellation token to use. + /// , , or is null. + public async Task StopWebSiteNetworkTraceSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStopWebSiteNetworkTraceSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Stop ongoing capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for this web app. + /// The cancellation token to use. + /// , , or is null. + public Response StopWebSiteNetworkTraceSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStopWebSiteNetworkTraceSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetNetworkTracesSlotRequest(string resourceGroupName, string name, string operationId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/networkTrace/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task>> GetNetworkTracesSlotAsync(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetNetworkTracesSlotRequest(resourceGroupName, name, operationId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response> GetNetworkTracesSlot(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetNetworkTracesSlotRequest(resourceGroupName, name, operationId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetNetworkTraceOperationSlotV2Request(string resourceGroupName, string name, string operationId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/networkTraces/current/operationresults/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetNetworkTraceOperationSlotV2Async(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetNetworkTraceOperationSlotV2Request(resourceGroupName, name, operationId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + case 202: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetNetworkTraceOperationSlotV2(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetNetworkTraceOperationSlotV2Request(resourceGroupName, name, operationId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + case 202: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetNetworkTracesSlotV2Request(string resourceGroupName, string name, string operationId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/networkTraces/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task>> GetNetworkTracesSlotV2Async(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetNetworkTracesSlotV2Request(resourceGroupName, name, operationId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// GUID of the operation. + /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response> GetNetworkTracesSlotV2(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (operationId == null) + { + throw new ArgumentNullException(nameof(operationId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetNetworkTracesSlotV2Request(resourceGroupName, name, operationId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(NetworkTrace.DeserializeNetworkTrace(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGenerateNewSitePublishingPasswordSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/newpassword", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Generates a new publishing password for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API generate a new publishing password for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task GenerateNewSitePublishingPasswordSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGenerateNewSitePublishingPasswordSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Generates a new publishing password for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API generate a new publishing password for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GenerateNewSitePublishingPasswordSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGenerateNewSitePublishingPasswordSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPerfMonCountersSlotRequest(string resourceGroupName, string name, string slot, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/perfcounters", false); + uri.AppendQuery("api-version", apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets perfmon counters for web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListPerfMonCountersSlotAsync(string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListPerfMonCountersSlotRequest(resourceGroupName, name, slot, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PerfMonCounterCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets perfmon counters for web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , or is null. + public Response ListPerfMonCountersSlot(string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListPerfMonCountersSlotRequest(resourceGroupName, name, slot, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PerfMonCounterCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSitePhpErrorLogFlagSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/phplogging", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets web app's event logs. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetSitePhpErrorLogFlagSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSitePhpErrorLogFlagSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SitePhpErrorLogFlag value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SitePhpErrorLogFlag.DeserializeSitePhpErrorLogFlag(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets web app's event logs. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetSitePhpErrorLogFlagSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSitePhpErrorLogFlagSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SitePhpErrorLogFlag value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SitePhpErrorLogFlag.DeserializeSitePhpErrorLogFlag(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPremierAddOnsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/premieraddons", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the premier add-ons of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListPremierAddOnsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListPremierAddOnsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the premier add-ons of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListPremierAddOnsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListPremierAddOnsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPremierAddOnSlotRequest(string resourceGroupName, string name, string premierAddOnName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/premieraddons/", false); + uri.AppendPath(premierAddOnName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a named add-on of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetPremierAddOnSlotAsync(string resourceGroupName, string name, string premierAddOnName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetPremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a named add-on of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetPremierAddOnSlot(string resourceGroupName, string name, string premierAddOnName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetPremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateAddPremierAddOnSlotRequest(string resourceGroupName, string name, string premierAddOnName, string slot, PremierAddOn premierAddOn) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/premieraddons/", false); + uri.AppendPath(premierAddOnName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(premierAddOn); + request.Content = content; + return message; + } + + /// Description for Updates a named add-on of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the production slot. + /// A JSON representation of the edited premier add-on. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> AddPremierAddOnSlotAsync(string resourceGroupName, string name, string premierAddOnName, string slot, PremierAddOn premierAddOn, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (premierAddOn == null) + { + throw new ArgumentNullException(nameof(premierAddOn)); + } + + using var message = CreateAddPremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot, premierAddOn); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates a named add-on of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the production slot. + /// A JSON representation of the edited premier add-on. + /// The cancellation token to use. + /// , , , , or is null. + public Response AddPremierAddOnSlot(string resourceGroupName, string name, string premierAddOnName, string slot, PremierAddOn premierAddOn, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (premierAddOn == null) + { + throw new ArgumentNullException(nameof(premierAddOn)); + } + + using var message = CreateAddPremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot, premierAddOn); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeletePremierAddOnSlotRequest(string resourceGroupName, string name, string premierAddOnName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/premieraddons/", false); + uri.AppendPath(premierAddOnName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a premier add-on from an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeletePremierAddOnSlotAsync(string resourceGroupName, string name, string premierAddOnName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeletePremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a premier add-on from an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response DeletePremierAddOnSlot(string resourceGroupName, string name, string premierAddOnName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeletePremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdatePremierAddOnSlotRequest(string resourceGroupName, string name, string premierAddOnName, string slot, PremierAddOnPatchResource premierAddOn) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/premieraddons/", false); + uri.AppendPath(premierAddOnName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(premierAddOn); + request.Content = content; + return message; + } + + /// Description for Updates a named add-on of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the production slot. + /// A JSON representation of the edited premier add-on. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> UpdatePremierAddOnSlotAsync(string resourceGroupName, string name, string premierAddOnName, string slot, PremierAddOnPatchResource premierAddOn, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (premierAddOn == null) + { + throw new ArgumentNullException(nameof(premierAddOn)); + } + + using var message = CreateUpdatePremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot, premierAddOn); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates a named add-on of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Add-on name. + /// Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the production slot. + /// A JSON representation of the edited premier add-on. + /// The cancellation token to use. + /// , , , , or is null. + public Response UpdatePremierAddOnSlot(string resourceGroupName, string name, string premierAddOnName, string slot, PremierAddOnPatchResource premierAddOn, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (premierAddOnName == null) + { + throw new ArgumentNullException(nameof(premierAddOnName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (premierAddOn == null) + { + throw new ArgumentNullException(nameof(premierAddOn)); + } + + using var message = CreateUpdatePremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot, premierAddOn); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PremierAddOn value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PremierAddOn.DeserializePremierAddOn(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateAccessSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/privateAccess/virtualNetworks", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets data around private site access enablement and authorized Virtual Networks that can access the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for the web app. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetPrivateAccessSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetPrivateAccessSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateAccess value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateAccess.DeserializePrivateAccess(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets data around private site access enablement and authorized Virtual Networks that can access the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for the web app. + /// The cancellation token to use. + /// , , or is null. + public Response GetPrivateAccessSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetPrivateAccessSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateAccess value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateAccess.DeserializePrivateAccess(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreatePutPrivateAccessVnetSlotRequest(string resourceGroupName, string name, string slot, PrivateAccess access) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/privateAccess/virtualNetworks", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(access); + request.Content = content; + return message; + } + + /// Description for Sets data around private site access enablement and authorized Virtual Networks that can access the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for the web app. + /// The information for the private access. + /// The cancellation token to use. + /// , , , or is null. + public async Task> PutPrivateAccessVnetSlotAsync(string resourceGroupName, string name, string slot, PrivateAccess access, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (access == null) + { + throw new ArgumentNullException(nameof(access)); + } + + using var message = CreatePutPrivateAccessVnetSlotRequest(resourceGroupName, name, slot, access); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateAccess value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateAccess.DeserializePrivateAccess(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Sets data around private site access enablement and authorized Virtual Networks that can access the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for the web app. + /// The information for the private access. + /// The cancellation token to use. + /// , , , or is null. + public Response PutPrivateAccessVnetSlot(string resourceGroupName, string name, string slot, PrivateAccess access, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (access == null) + { + throw new ArgumentNullException(nameof(access)); + } + + using var message = CreatePutPrivateAccessVnetSlotRequest(resourceGroupName, name, slot, access); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateAccess value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateAccess.DeserializePrivateAccess(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateEndpointConnectionListSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the list of private endpoint connections associated with a site. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// Name of the site deployment slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetPrivateEndpointConnectionListSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetPrivateEndpointConnectionListSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the list of private endpoint connections associated with a site. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// Name of the site deployment slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetPrivateEndpointConnectionListSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetPrivateEndpointConnectionListSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateEndpointConnectionSlotRequest(string resourceGroupName, string name, string privateEndpointConnectionName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// Name of the private endpoint connection. + /// Name of the site deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetPrivateEndpointConnectionSlotAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetPrivateEndpointConnectionSlotRequest(resourceGroupName, name, privateEndpointConnectionName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RemotePrivateEndpointConnectionARMResource value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// Name of the private endpoint connection. + /// Name of the site deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetPrivateEndpointConnectionSlot(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetPrivateEndpointConnectionSlotRequest(resourceGroupName, name, privateEndpointConnectionName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RemotePrivateEndpointConnectionARMResource value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateApproveOrRejectPrivateEndpointConnectionSlotRequest(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(privateEndpointWrapper); + request.Content = content; + return message; + } + + /// Description for Approves or rejects a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The String to use. + /// The String to use. + /// The PrivateLinkConnectionApprovalRequestResource to use. + /// The cancellation token to use. + /// , , , , or is null. + public async Task ApproveOrRejectPrivateEndpointConnectionSlotAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (privateEndpointWrapper == null) + { + throw new ArgumentNullException(nameof(privateEndpointWrapper)); + } + + using var message = CreateApproveOrRejectPrivateEndpointConnectionSlotRequest(resourceGroupName, name, privateEndpointConnectionName, slot, privateEndpointWrapper); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Approves or rejects a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The String to use. + /// The String to use. + /// The PrivateLinkConnectionApprovalRequestResource to use. + /// The cancellation token to use. + /// , , , , or is null. + public Response ApproveOrRejectPrivateEndpointConnectionSlot(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (privateEndpointWrapper == null) + { + throw new ArgumentNullException(nameof(privateEndpointWrapper)); + } + + using var message = CreateApproveOrRejectPrivateEndpointConnectionSlotRequest(resourceGroupName, name, privateEndpointConnectionName, slot, privateEndpointWrapper); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeletePrivateEndpointConnectionSlotRequest(string resourceGroupName, string name, string privateEndpointConnectionName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The String to use. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeletePrivateEndpointConnectionSlotAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeletePrivateEndpointConnectionSlotRequest(resourceGroupName, name, privateEndpointConnectionName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a private endpoint connection. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The String to use. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public Response DeletePrivateEndpointConnectionSlot(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (privateEndpointConnectionName == null) + { + throw new ArgumentNullException(nameof(privateEndpointConnectionName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeletePrivateEndpointConnectionSlotRequest(resourceGroupName, name, privateEndpointConnectionName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateLinkResourcesSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the private link resources. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetPrivateLinkResourcesSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetPrivateLinkResourcesSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourcesWrapper value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the private link resources. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response GetPrivateLinkResourcesSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetPrivateLinkResourcesSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourcesWrapper value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProcessesSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/processes", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListProcessesSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListProcessesSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListProcessesSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListProcessesSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetProcessSlotRequest(string resourceGroupName, string name, string processId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetProcessSlotAsync(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetProcessSlotRequest(resourceGroupName, name, processId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessInfo.DeserializeProcessInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfo)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetProcessSlot(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetProcessSlotRequest(resourceGroupName, name, processId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessInfo.DeserializeProcessInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfo)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteProcessSlotRequest(string resourceGroupName, string name, string processId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteProcessSlotAsync(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteProcessSlotRequest(resourceGroupName, name, processId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteProcessSlot(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteProcessSlotRequest(resourceGroupName, name, processId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetProcessDumpSlotRequest(string resourceGroupName, string name, string processId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/dump", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetProcessDumpSlotAsync(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetProcessDumpSlotRequest(resourceGroupName, name, processId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((Stream)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetProcessDumpSlot(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetProcessDumpSlotRequest(resourceGroupName, name, processId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((Stream)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProcessModulesSlotRequest(string resourceGroupName, string name, string processId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/modules", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListProcessModulesSlotAsync(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListProcessModulesSlotRequest(resourceGroupName, name, processId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListProcessModulesSlot(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListProcessModulesSlotRequest(resourceGroupName, name, processId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetProcessModuleSlotRequest(string resourceGroupName, string name, string processId, string baseAddress, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/modules/", false); + uri.AppendPath(baseAddress, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Module base address. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> GetProcessModuleSlotAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (baseAddress == null) + { + throw new ArgumentNullException(nameof(baseAddress)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetProcessModuleSlotRequest(resourceGroupName, name, processId, baseAddress, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfo)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get process information by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Module base address. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , , or is null. + public Response GetProcessModuleSlot(string resourceGroupName, string name, string processId, string baseAddress, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (baseAddress == null) + { + throw new ArgumentNullException(nameof(baseAddress)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetProcessModuleSlotRequest(resourceGroupName, name, processId, baseAddress, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfo)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProcessThreadsSlotRequest(string resourceGroupName, string name, string processId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/processes/", false); + uri.AppendPath(processId, true); + uri.AppendPath("/threads", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListProcessThreadsSlotAsync(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListProcessThreadsSlotRequest(resourceGroupName, name, processId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListProcessThreadsSlot(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListProcessThreadsSlotRequest(resourceGroupName, name, processId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPublicCertificatesSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/publicCertificates", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get public certificates for an app or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListPublicCertificatesSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListPublicCertificatesSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCertificateCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get public certificates for an app or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListPublicCertificatesSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListPublicCertificatesSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCertificateCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPublicCertificateSlotRequest(string resourceGroupName, string name, string slot, string publicCertificateName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/publicCertificates/", false); + uri.AppendPath(publicCertificateName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the named public certificate for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API the named binding for the production slot. + /// Public certificate name. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetPublicCertificateSlotAsync(string resourceGroupName, string name, string slot, string publicCertificateName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (publicCertificateName == null) + { + throw new ArgumentNullException(nameof(publicCertificateName)); + } + + using var message = CreateGetPublicCertificateSlotRequest(resourceGroupName, name, slot, publicCertificateName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCertificate value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCertificate.DeserializePublicCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the named public certificate for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API the named binding for the production slot. + /// Public certificate name. + /// The cancellation token to use. + /// , , , or is null. + public Response GetPublicCertificateSlot(string resourceGroupName, string name, string slot, string publicCertificateName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (publicCertificateName == null) + { + throw new ArgumentNullException(nameof(publicCertificateName)); + } + + using var message = CreateGetPublicCertificateSlotRequest(resourceGroupName, name, slot, publicCertificateName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCertificate value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCertificate.DeserializePublicCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdatePublicCertificateSlotRequest(string resourceGroupName, string name, string publicCertificateName, string slot, PublicCertificate publicCertificate) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/publicCertificates/", false); + uri.AppendPath(publicCertificateName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(publicCertificate); + request.Content = content; + return message; + } + + /// Description for Creates a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Public certificate name. + /// Name of the deployment slot. If a slot is not specified, the API will create a binding for the production slot. + /// Public certificate details. This is the JSON representation of a PublicCertificate object. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> CreateOrUpdatePublicCertificateSlotAsync(string resourceGroupName, string name, string publicCertificateName, string slot, PublicCertificate publicCertificate, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (publicCertificateName == null) + { + throw new ArgumentNullException(nameof(publicCertificateName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (publicCertificate == null) + { + throw new ArgumentNullException(nameof(publicCertificate)); + } + + using var message = CreateCreateOrUpdatePublicCertificateSlotRequest(resourceGroupName, name, publicCertificateName, slot, publicCertificate); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCertificate value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCertificate.DeserializePublicCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Creates a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Public certificate name. + /// Name of the deployment slot. If a slot is not specified, the API will create a binding for the production slot. + /// Public certificate details. This is the JSON representation of a PublicCertificate object. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateOrUpdatePublicCertificateSlot(string resourceGroupName, string name, string publicCertificateName, string slot, PublicCertificate publicCertificate, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (publicCertificateName == null) + { + throw new ArgumentNullException(nameof(publicCertificateName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (publicCertificate == null) + { + throw new ArgumentNullException(nameof(publicCertificate)); + } + + using var message = CreateCreateOrUpdatePublicCertificateSlotRequest(resourceGroupName, name, publicCertificateName, slot, publicCertificate); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCertificate value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCertificate.DeserializePublicCertificate(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeletePublicCertificateSlotRequest(string resourceGroupName, string name, string slot, string publicCertificateName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/publicCertificates/", false); + uri.AppendPath(publicCertificateName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// Public certificate name. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeletePublicCertificateSlotAsync(string resourceGroupName, string name, string slot, string publicCertificateName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (publicCertificateName == null) + { + throw new ArgumentNullException(nameof(publicCertificateName)); + } + + using var message = CreateDeletePublicCertificateSlotRequest(resourceGroupName, name, slot, publicCertificateName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a hostname binding for an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// Public certificate name. + /// The cancellation token to use. + /// , , , or is null. + public Response DeletePublicCertificateSlot(string resourceGroupName, string name, string slot, string publicCertificateName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (publicCertificateName == null) + { + throw new ArgumentNullException(nameof(publicCertificateName)); + } + + using var message = CreateDeletePublicCertificateSlotRequest(resourceGroupName, name, slot, publicCertificateName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPublishingProfileXmlWithSecretsSlotRequest(string resourceGroupName, string name, string slot, CsmPublishingProfileOptions publishingProfileOptions) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/publishxml", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/xml"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(publishingProfileOptions); + request.Content = content; + return message; + } + + /// Description for Gets the publishing profile for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for the production slot. + /// Specifies publishingProfileOptions for publishing profile. For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListPublishingProfileXmlWithSecretsSlotAsync(string resourceGroupName, string name, string slot, CsmPublishingProfileOptions publishingProfileOptions, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (publishingProfileOptions == null) + { + throw new ArgumentNullException(nameof(publishingProfileOptions)); + } + + using var message = CreateListPublishingProfileXmlWithSecretsSlotRequest(resourceGroupName, name, slot, publishingProfileOptions); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the publishing profile for an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for the production slot. + /// Specifies publishingProfileOptions for publishing profile. For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + /// The cancellation token to use. + /// , , , or is null. + public Response ListPublishingProfileXmlWithSecretsSlot(string resourceGroupName, string name, string slot, CsmPublishingProfileOptions publishingProfileOptions, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (publishingProfileOptions == null) + { + throw new ArgumentNullException(nameof(publishingProfileOptions)); + } + + using var message = CreateListPublishingProfileXmlWithSecretsSlotRequest(resourceGroupName, name, slot, publishingProfileOptions); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + var value = message.ExtractResponseContent(); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateResetSlotConfigurationSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/resetSlotConfig", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API resets configuration settings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task ResetSlotConfigurationSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateResetSlotConfigurationSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API resets configuration settings for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ResetSlotConfigurationSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateResetSlotConfigurationSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRestartSlotRequest(string resourceGroupName, string name, string slot, bool? softRestart, bool? synchronous) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/restart", false); + if (softRestart != null) + { + uri.AppendQuery("softRestart", softRestart.Value, true); + } + if (synchronous != null) + { + uri.AppendQuery("synchronous", synchronous.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Restarts an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will restart the production slot. + /// Specify true to apply the configuration settings and restarts the app only if necessary. By default, the API always restarts and reprovisions the app. + /// Specify true to block until the app is restarted. By default, it is set to false, and the API responds immediately (asynchronous). + /// The cancellation token to use. + /// , , or is null. + public async Task RestartSlotAsync(string resourceGroupName, string name, string slot, bool? softRestart = null, bool? synchronous = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateRestartSlotRequest(resourceGroupName, name, slot, softRestart, synchronous); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Restarts an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will restart the production slot. + /// Specify true to apply the configuration settings and restarts the app only if necessary. By default, the API always restarts and reprovisions the app. + /// Specify true to block until the app is restarted. By default, it is set to false, and the API responds immediately (asynchronous). + /// The cancellation token to use. + /// , , or is null. + public Response RestartSlot(string resourceGroupName, string name, string slot, bool? softRestart = null, bool? synchronous = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateRestartSlotRequest(resourceGroupName, name, slot, softRestart, synchronous); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRestoreFromBackupBlobSlotRequest(string resourceGroupName, string name, string slot, RestoreRequest request) + { + var message = _pipeline.CreateMessage(); + var request0 = message.Request; + request0.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/restoreFromBackupBlob", false); + uri.AppendQuery("api-version", apiVersion, true); + request0.Uri = uri; + request0.Headers.Add("Accept", "application/json"); + request0.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(request); + request0.Content = content; + return message; + } + + /// Description for Restores an app from a backup blob in Azure Storage. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will restore a backup of the production slot. + /// Information on restore request . + /// The cancellation token to use. + /// , , , or is null. + public async Task RestoreFromBackupBlobSlotAsync(string resourceGroupName, string name, string slot, RestoreRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateRestoreFromBackupBlobSlotRequest(resourceGroupName, name, slot, request); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Restores an app from a backup blob in Azure Storage. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will restore a backup of the production slot. + /// Information on restore request . + /// The cancellation token to use. + /// , , , or is null. + public Response RestoreFromBackupBlobSlot(string resourceGroupName, string name, string slot, RestoreRequest request, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + using var message = CreateRestoreFromBackupBlobSlotRequest(resourceGroupName, name, slot, request); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRestoreFromDeletedAppSlotRequest(string resourceGroupName, string name, string slot, DeletedAppRestoreRequest restoreRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/restoreFromDeletedApp", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(restoreRequest); + request.Content = content; + return message; + } + + /// Description for Restores a deleted web app to this web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Deleted web app restore information. + /// The cancellation token to use. + /// , , , or is null. + public async Task RestoreFromDeletedAppSlotAsync(string resourceGroupName, string name, string slot, DeletedAppRestoreRequest restoreRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (restoreRequest == null) + { + throw new ArgumentNullException(nameof(restoreRequest)); + } + + using var message = CreateRestoreFromDeletedAppSlotRequest(resourceGroupName, name, slot, restoreRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Restores a deleted web app to this web app. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Deleted web app restore information. + /// The cancellation token to use. + /// , , , or is null. + public Response RestoreFromDeletedAppSlot(string resourceGroupName, string name, string slot, DeletedAppRestoreRequest restoreRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (restoreRequest == null) + { + throw new ArgumentNullException(nameof(restoreRequest)); + } + + using var message = CreateRestoreFromDeletedAppSlotRequest(resourceGroupName, name, slot, restoreRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRestoreSnapshotSlotRequest(string resourceGroupName, string name, string slot, SnapshotRestoreRequest restoreRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/restoreSnapshot", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(restoreRequest); + request.Content = content; + return message; + } + + /// Description for Restores a web app from a snapshot. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. + /// The cancellation token to use. + /// , , , or is null. + public async Task RestoreSnapshotSlotAsync(string resourceGroupName, string name, string slot, SnapshotRestoreRequest restoreRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (restoreRequest == null) + { + throw new ArgumentNullException(nameof(restoreRequest)); + } + + using var message = CreateRestoreSnapshotSlotRequest(resourceGroupName, name, slot, restoreRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Restores a web app from a snapshot. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. + /// The cancellation token to use. + /// , , , or is null. + public Response RestoreSnapshotSlot(string resourceGroupName, string name, string slot, SnapshotRestoreRequest restoreRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (restoreRequest == null) + { + throw new ArgumentNullException(nameof(restoreRequest)); + } + + using var message = CreateRestoreSnapshotSlotRequest(resourceGroupName, name, slot, restoreRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteExtensionsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/siteextensions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get list of siteextensions for a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSiteExtensionsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteExtensionsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteExtensionInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get list of siteextensions for a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListSiteExtensionsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteExtensionsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteExtensionInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteExtensionSlotRequest(string resourceGroupName, string name, string siteExtensionId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/siteextensions/", false); + uri.AppendPath(siteExtensionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get site extension information by its ID for a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Site extension name. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetSiteExtensionSlotAsync(string resourceGroupName, string name, string siteExtensionId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteExtensionId == null) + { + throw new ArgumentNullException(nameof(siteExtensionId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteExtensionSlotRequest(resourceGroupName, name, siteExtensionId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteExtensionInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteExtensionInfo.DeserializeSiteExtensionInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SiteExtensionInfo)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get site extension information by its ID for a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Site extension name. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetSiteExtensionSlot(string resourceGroupName, string name, string siteExtensionId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteExtensionId == null) + { + throw new ArgumentNullException(nameof(siteExtensionId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteExtensionSlotRequest(resourceGroupName, name, siteExtensionId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteExtensionInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteExtensionInfo.DeserializeSiteExtensionInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SiteExtensionInfo)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateInstallSiteExtensionSlotRequest(string resourceGroupName, string name, string siteExtensionId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/siteextensions/", false); + uri.AppendPath(siteExtensionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Install site extension on a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Site extension name. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task InstallSiteExtensionSlotAsync(string resourceGroupName, string name, string siteExtensionId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteExtensionId == null) + { + throw new ArgumentNullException(nameof(siteExtensionId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateInstallSiteExtensionSlotRequest(resourceGroupName, name, siteExtensionId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 429: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Install site extension on a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Site extension name. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response InstallSiteExtensionSlot(string resourceGroupName, string name, string siteExtensionId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteExtensionId == null) + { + throw new ArgumentNullException(nameof(siteExtensionId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateInstallSiteExtensionSlotRequest(resourceGroupName, name, siteExtensionId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 429: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteSiteExtensionSlotRequest(string resourceGroupName, string name, string siteExtensionId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/siteextensions/", false); + uri.AppendPath(siteExtensionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Remove a site extension from a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Site extension name. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteSiteExtensionSlotAsync(string resourceGroupName, string name, string siteExtensionId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteExtensionId == null) + { + throw new ArgumentNullException(nameof(siteExtensionId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteSiteExtensionSlotRequest(resourceGroupName, name, siteExtensionId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Remove a site extension from a web site, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Site extension name. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteSiteExtensionSlot(string resourceGroupName, string name, string siteExtensionId, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteExtensionId == null) + { + throw new ArgumentNullException(nameof(siteExtensionId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteSiteExtensionSlotRequest(resourceGroupName, name, siteExtensionId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSlotDifferencesSlotRequest(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/slotsdiffs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(slotSwapEntity); + request.Content = content; + return message; + } + + /// Description for Get the difference in configuration settings between two web app slots. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListSlotDifferencesSlotAsync(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateListSlotDifferencesSlotRequest(resourceGroupName, name, slot, slotSwapEntity); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SlotDifferenceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the difference in configuration settings between two web app slots. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response ListSlotDifferencesSlot(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateListSlotDifferencesSlotRequest(resourceGroupName, name, slot, slotSwapEntity); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SlotDifferenceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateSwapSlotRequest(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/slotsswap", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(slotSwapEntity); + request.Content = content; + return message; + } + + /// Description for Swaps two deployment slots of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task SwapSlotAsync(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateSwapSlotRequest(resourceGroupName, name, slot, slotSwapEntity); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Swaps two deployment slots of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response SwapSlot(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateSwapSlotRequest(resourceGroupName, name, slot, slotSwapEntity); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSnapshotsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/snapshots", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns all Snapshots to the user. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// Website Slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSnapshotsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSnapshotsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns all Snapshots to the user. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// Website Slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListSnapshotsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSnapshotsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSnapshotsFromDRSecondarySlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/snapshotsdr", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns all Snapshots to the user from DRSecondary endpoint. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// Website Slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSnapshotsFromDRSecondarySlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSnapshotsFromDRSecondarySlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns all Snapshots to the user from DRSecondary endpoint. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// Website Slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListSnapshotsFromDRSecondarySlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSnapshotsFromDRSecondarySlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSourceControlSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/sourcecontrols/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the source control configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetSourceControlSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSourceControlSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + { + SiteSourceControl value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get the source control configuration for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response GetSourceControlSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSourceControlSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + { + SiteSourceControl value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateSourceControlSlotRequest(string resourceGroupName, string name, string slot, SiteSourceControl siteSourceControl) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/sourcecontrols/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteSourceControl); + request.Content = content; + return message; + } + + /// Description for Updates the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the source control configuration for the production slot. + /// JSON representation of a SiteSourceControl object. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task CreateOrUpdateSourceControlSlotAsync(string resourceGroupName, string name, string slot, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteSourceControl == null) + { + throw new ArgumentNullException(nameof(siteSourceControl)); + } + + using var message = CreateCreateOrUpdateSourceControlSlotRequest(resourceGroupName, name, slot, siteSourceControl); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the source control configuration for the production slot. + /// JSON representation of a SiteSourceControl object. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateSourceControlSlot(string resourceGroupName, string name, string slot, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteSourceControl == null) + { + throw new ArgumentNullException(nameof(siteSourceControl)); + } + + using var message = CreateCreateOrUpdateSourceControlSlotRequest(resourceGroupName, name, slot, siteSourceControl); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteSourceControlSlotRequest(string resourceGroupName, string name, string slot, string additionalFlags) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/sourcecontrols/web", false); + if (additionalFlags != null) + { + uri.AppendQuery("additionalFlags", additionalFlags, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the source control configuration for the production slot. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteSourceControlSlotAsync(string resourceGroupName, string name, string slot, string additionalFlags = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteSourceControlSlotRequest(resourceGroupName, name, slot, additionalFlags); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the source control configuration for the production slot. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteSourceControlSlot(string resourceGroupName, string name, string slot, string additionalFlags = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteSourceControlSlotRequest(resourceGroupName, name, slot, additionalFlags); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateSourceControlSlotRequest(string resourceGroupName, string name, string slot, SiteSourceControl siteSourceControl) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/sourcecontrols/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteSourceControl); + request.Content = content; + return message; + } + + /// Description for Updates the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the source control configuration for the production slot. + /// JSON representation of a SiteSourceControl object. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateSourceControlSlotAsync(string resourceGroupName, string name, string slot, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteSourceControl == null) + { + throw new ArgumentNullException(nameof(siteSourceControl)); + } + + using var message = CreateUpdateSourceControlSlotRequest(resourceGroupName, name, slot, siteSourceControl); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + { + SiteSourceControl value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will update the source control configuration for the production slot. + /// JSON representation of a SiteSourceControl object. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateSourceControlSlot(string resourceGroupName, string name, string slot, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (siteSourceControl == null) + { + throw new ArgumentNullException(nameof(siteSourceControl)); + } + + using var message = CreateUpdateSourceControlSlotRequest(resourceGroupName, name, slot, siteSourceControl); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + { + SiteSourceControl value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStartSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Starts an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will start the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task StartSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStartSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Starts an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will start the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response StartSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStartSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStartNetworkTraceSlotRequest(string resourceGroupName, string name, string slot, int? durationInSeconds, int? maxFrameLength, string sasUrl) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/startNetworkTrace", false); + if (durationInSeconds != null) + { + uri.AppendQuery("durationInSeconds", durationInSeconds.Value, true); + } + if (maxFrameLength != null) + { + uri.AppendQuery("maxFrameLength", maxFrameLength.Value, true); + } + if (sasUrl != null) + { + uri.AppendQuery("sasUrl", sasUrl, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Start capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for this web app. + /// The duration to keep capturing in seconds. + /// The maximum frame length in bytes (Optional). + /// The Blob URL to store capture file. + /// The cancellation token to use. + /// , , or is null. + public async Task StartNetworkTraceSlotAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStartNetworkTraceSlotRequest(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Start capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for this web app. + /// The duration to keep capturing in seconds. + /// The maximum frame length in bytes (Optional). + /// The Blob URL to store capture file. + /// The cancellation token to use. + /// , , or is null. + public Response StartNetworkTraceSlot(string resourceGroupName, string name, string slot, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStartNetworkTraceSlotRequest(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStopSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Stops an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will stop the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task StopSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStopSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Stops an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will stop the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response StopSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStopSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStopNetworkTraceSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/stopNetworkTrace", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Stop ongoing capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for this web app. + /// The cancellation token to use. + /// , , or is null. + public async Task StopNetworkTraceSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStopNetworkTraceSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Stop ongoing capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for this web app. + /// The cancellation token to use. + /// , , or is null. + public Response StopNetworkTraceSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateStopNetworkTraceSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateSyncRepositorySlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/sync", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Sync web app repository. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task SyncRepositorySlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateSyncRepositorySlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Sync web app repository. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// The cancellation token to use. + /// , , or is null. + public Response SyncRepositorySlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateSyncRepositorySlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateSyncFunctionTriggersSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/syncfunctiontriggers", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Syncs function trigger metadata to the management database. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public async Task SyncFunctionTriggersSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateSyncFunctionTriggersSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Syncs function trigger metadata to the management database. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , or is null. + public Response SyncFunctionTriggersSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateSyncFunctionTriggersSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListTriggeredWebJobsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/triggeredwebjobs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List triggered web jobs for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListTriggeredWebJobsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListTriggeredWebJobsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TriggeredWebJobCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List triggered web jobs for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListTriggeredWebJobsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListTriggeredWebJobsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TriggeredWebJobCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetTriggeredWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/triggeredwebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a triggered web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetTriggeredWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetTriggeredWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TriggeredWebJob value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TriggeredWebJob.DeserializeTriggeredWebJob(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredWebJob)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a triggered web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetTriggeredWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetTriggeredWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TriggeredWebJob value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TriggeredWebJob.DeserializeTriggeredWebJob(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredWebJob)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteTriggeredWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/triggeredwebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a triggered web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API deletes web job for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteTriggeredWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteTriggeredWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a triggered web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API deletes web job for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteTriggeredWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteTriggeredWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListTriggeredWebJobHistorySlotRequest(string resourceGroupName, string name, string webJobName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/triggeredwebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendPath("/history", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List a triggered web job's history for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListTriggeredWebJobHistorySlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListTriggeredWebJobHistorySlotRequest(resourceGroupName, name, webJobName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TriggeredJobHistoryCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List a triggered web job's history for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListTriggeredWebJobHistorySlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListTriggeredWebJobHistorySlotRequest(resourceGroupName, name, webJobName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TriggeredJobHistoryCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetTriggeredWebJobHistorySlotRequest(string resourceGroupName, string name, string webJobName, string id, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/triggeredwebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendPath("/history/", false); + uri.AppendPath(id, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a triggered web job's history by its ID for an app, , or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// History ID. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> GetTriggeredWebJobHistorySlotAsync(string resourceGroupName, string name, string webJobName, string id, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetTriggeredWebJobHistorySlotRequest(resourceGroupName, name, webJobName, id, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TriggeredJobHistory value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TriggeredJobHistory.DeserializeTriggeredJobHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredJobHistory)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a triggered web job's history by its ID for an app, , or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// History ID. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , , or is null. + public Response GetTriggeredWebJobHistorySlot(string resourceGroupName, string name, string webJobName, string id, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetTriggeredWebJobHistorySlotRequest(resourceGroupName, name, webJobName, id, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TriggeredJobHistory value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TriggeredJobHistory.DeserializeTriggeredJobHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredJobHistory)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRunTriggeredWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/triggeredwebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendPath("/run", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Run a triggered web job for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task RunTriggeredWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateRunTriggeredWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Run a triggered web job for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response RunTriggeredWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateRunTriggeredWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListUsagesSlotRequest(string resourceGroupName, string name, string slot, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/usages", false); + uri.AppendQuery("api-version", apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the quota usage information of an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get quota information of the production slot. + /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListUsagesSlotAsync(string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListUsagesSlotRequest(resourceGroupName, name, slot, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the quota usage information of an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get quota information of the production slot. + /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , or is null. + public Response ListUsagesSlot(string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListUsagesSlotRequest(resourceGroupName, name, slot, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListVnetConnectionsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/virtualNetworkConnections", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the virtual networks the app (or deployment slot) is connected to. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get virtual network connections for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task>> ListVnetConnectionsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListVnetConnectionsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VnetInfo.DeserializeVnetInfo(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the virtual networks the app (or deployment slot) is connected to. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get virtual network connections for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response> ListVnetConnectionsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListVnetConnectionsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VnetInfo.DeserializeVnetInfo(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetVnetConnectionSlotRequest(string resourceGroupName, string name, string vnetName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a virtual network the app (or deployment slot) is connected to by name. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the virtual network. + /// Name of the deployment slot. If a slot is not specified, the API will get the named virtual network for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetVnetConnectionSlotAsync(string resourceGroupName, string name, string vnetName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a virtual network the app (or deployment slot) is connected to by name. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the virtual network. + /// Name of the deployment slot. If a slot is not specified, the API will get the named virtual network for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetVnetConnectionSlot(string resourceGroupName, string name, string vnetName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateVnetConnectionSlotRequest(string resourceGroupName, string name, string vnetName, string slot, VnetInfo connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of an existing Virtual Network. + /// Name of the deployment slot. If a slot is not specified, the API will add or update connections for the production slot. + /// Properties of the Virtual Network connection. See example. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> CreateOrUpdateVnetConnectionSlotAsync(string resourceGroupName, string name, string vnetName, string slot, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of an existing Virtual Network. + /// Name of the deployment slot. If a slot is not specified, the API will add or update connections for the production slot. + /// Properties of the Virtual Network connection. See example. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateOrUpdateVnetConnectionSlot(string resourceGroupName, string name, string vnetName, string slot, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteVnetConnectionSlotRequest(string resourceGroupName, string name, string vnetName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a connection from an app (or deployment slot to a named virtual network. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the virtual network. + /// Name of the deployment slot. If a slot is not specified, the API will delete the connection for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task DeleteVnetConnectionSlotAsync(string resourceGroupName, string name, string vnetName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a connection from an app (or deployment slot to a named virtual network. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the virtual network. + /// Name of the deployment slot. If a slot is not specified, the API will delete the connection for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response DeleteVnetConnectionSlot(string resourceGroupName, string name, string vnetName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateDeleteVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateVnetConnectionSlotRequest(string resourceGroupName, string name, string vnetName, string slot, VnetInfo connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of an existing Virtual Network. + /// Name of the deployment slot. If a slot is not specified, the API will add or update connections for the production slot. + /// Properties of the Virtual Network connection. See example. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> UpdateVnetConnectionSlotAsync(string resourceGroupName, string name, string vnetName, string slot, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of an existing Virtual Network. + /// Name of the deployment slot. If a slot is not specified, the API will add or update connections for the production slot. + /// Properties of the Virtual Network connection. See example. + /// The cancellation token to use. + /// , , , , or is null. + public Response UpdateVnetConnectionSlot(string resourceGroupName, string name, string vnetName, string slot, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetVnetConnectionGatewaySlotRequest(string resourceGroupName, string name, string vnetName, string gatewayName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets an app's Virtual Network gateway. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the Virtual Network. + /// Name of the gateway. Currently, the only supported string is "primary". + /// Name of the deployment slot. If a slot is not specified, the API will get a gateway for the production slot's Virtual Network. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> GetVnetConnectionGatewaySlotAsync(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetVnetConnectionGatewaySlotRequest(resourceGroupName, name, vnetName, gatewayName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VnetGateway)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets an app's Virtual Network gateway. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the Virtual Network. + /// Name of the gateway. Currently, the only supported string is "primary". + /// Name of the deployment slot. If a slot is not specified, the API will get a gateway for the production slot's Virtual Network. + /// The cancellation token to use. + /// , , , , or is null. + public Response GetVnetConnectionGatewaySlot(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetVnetConnectionGatewaySlotRequest(resourceGroupName, name, vnetName, gatewayName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VnetGateway)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateVnetConnectionGatewaySlotRequest(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, VnetGateway connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the Virtual Network. + /// Name of the gateway. Currently, the only supported string is "primary". + /// Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the production slot's Virtual Network. + /// The properties to update this gateway with. + /// The cancellation token to use. + /// , , , , , or is null. + public async Task> CreateOrUpdateVnetConnectionGatewaySlotAsync(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateVnetConnectionGatewaySlotRequest(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the Virtual Network. + /// Name of the gateway. Currently, the only supported string is "primary". + /// Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the production slot's Virtual Network. + /// The properties to update this gateway with. + /// The cancellation token to use. + /// , , , , , or is null. + public Response CreateOrUpdateVnetConnectionGatewaySlot(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateVnetConnectionGatewaySlotRequest(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateVnetConnectionGatewaySlotRequest(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, VnetGateway connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the Virtual Network. + /// Name of the gateway. Currently, the only supported string is "primary". + /// Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the production slot's Virtual Network. + /// The properties to update this gateway with. + /// The cancellation token to use. + /// , , , , , or is null. + public async Task> UpdateVnetConnectionGatewaySlotAsync(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateVnetConnectionGatewaySlotRequest(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the Virtual Network. + /// Name of the gateway. Currently, the only supported string is "primary". + /// Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the production slot's Virtual Network. + /// The properties to update this gateway with. + /// The cancellation token to use. + /// , , , , , or is null. + public Response UpdateVnetConnectionGatewaySlot(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateVnetConnectionGatewaySlotRequest(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebJobsSlotRequest(string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/webjobs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List webjobs for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListWebJobsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListWebJobsSlotRequest(resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebJobCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List webjobs for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , or is null. + public Response ListWebJobsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListWebJobsSlotRequest(resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebJobCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/webjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get webjob information for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the web job. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebJob value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebJob.DeserializeWebJob(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get webjob information for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the web job. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetWebJobSlotRequest(resourceGroupName, name, webJobName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebJob value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebJob.DeserializeWebJob(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSlotDifferencesFromProductionRequest(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slotsdiffs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(slotSwapEntity); + request.Content = content; + return message; + } + + /// Description for Get the difference in configuration settings between two web app slots. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSlotDifferencesFromProductionAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateListSlotDifferencesFromProductionRequest(resourceGroupName, name, slotSwapEntity); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SlotDifferenceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the difference in configuration settings between two web app slots. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , or is null. + public Response ListSlotDifferencesFromProduction(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateListSlotDifferencesFromProductionRequest(resourceGroupName, name, slotSwapEntity); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SlotDifferenceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateSwapSlotWithProductionRequest(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slotsswap", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(slotSwapEntity); + request.Content = content; + return message; + } + + /// Description for Swaps two deployment slots of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task SwapSlotWithProductionAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateSwapSlotWithProductionRequest(resourceGroupName, name, slotSwapEntity); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Swaps two deployment slots of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , or is null. + public Response SwapSlotWithProduction(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateSwapSlotWithProductionRequest(resourceGroupName, name, slotSwapEntity); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSnapshotsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/snapshots", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns all Snapshots to the user. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// The cancellation token to use. + /// or is null. + public async Task> ListSnapshotsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSnapshotsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns all Snapshots to the user. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// The cancellation token to use. + /// or is null. + public Response ListSnapshots(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSnapshotsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSnapshotsFromDRSecondaryRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/snapshotsdr", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns all Snapshots to the user from DRSecondary endpoint. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// The cancellation token to use. + /// or is null. + public async Task> ListSnapshotsFromDRSecondaryAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSnapshotsFromDRSecondaryRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns all Snapshots to the user from DRSecondary endpoint. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// The cancellation token to use. + /// or is null. + public Response ListSnapshotsFromDRSecondary(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSnapshotsFromDRSecondaryRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSourceControlRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/sourcecontrols/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task> GetSourceControlAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetSourceControlRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + { + SiteSourceControl value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response GetSourceControl(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetSourceControlRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + { + SiteSourceControl value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateSourceControlRequest(string resourceGroupName, string name, SiteSourceControl siteSourceControl) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/sourcecontrols/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteSourceControl); + request.Content = content; + return message; + } + + /// Description for Updates the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON representation of a SiteSourceControl object. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task CreateOrUpdateSourceControlAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteSourceControl == null) + { + throw new ArgumentNullException(nameof(siteSourceControl)); + } + + using var message = CreateCreateOrUpdateSourceControlRequest(resourceGroupName, name, siteSourceControl); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON representation of a SiteSourceControl object. See example. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdateSourceControl(string resourceGroupName, string name, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteSourceControl == null) + { + throw new ArgumentNullException(nameof(siteSourceControl)); + } + + using var message = CreateCreateOrUpdateSourceControlRequest(resourceGroupName, name, siteSourceControl); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteSourceControlRequest(string resourceGroupName, string name, string additionalFlags) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/sourcecontrols/web", false); + if (additionalFlags != null) + { + uri.AppendQuery("additionalFlags", additionalFlags, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// or is null. + public async Task DeleteSourceControlAsync(string resourceGroupName, string name, string additionalFlags = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteSourceControlRequest(resourceGroupName, name, additionalFlags); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// or is null. + public Response DeleteSourceControl(string resourceGroupName, string name, string additionalFlags = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateDeleteSourceControlRequest(resourceGroupName, name, additionalFlags); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateSourceControlRequest(string resourceGroupName, string name, SiteSourceControl siteSourceControl) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/sourcecontrols/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(siteSourceControl); + request.Content = content; + return message; + } + + /// Description for Updates the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON representation of a SiteSourceControl object. See example. + /// The cancellation token to use. + /// , , or is null. + public async Task> UpdateSourceControlAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteSourceControl == null) + { + throw new ArgumentNullException(nameof(siteSourceControl)); + } + + using var message = CreateUpdateSourceControlRequest(resourceGroupName, name, siteSourceControl); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + { + SiteSourceControl value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates the source control configuration of an app. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON representation of a SiteSourceControl object. See example. + /// The cancellation token to use. + /// , , or is null. + public Response UpdateSourceControl(string resourceGroupName, string name, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (siteSourceControl == null) + { + throw new ArgumentNullException(nameof(siteSourceControl)); + } + + using var message = CreateUpdateSourceControlRequest(resourceGroupName, name, siteSourceControl); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + { + SiteSourceControl value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStartRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Starts an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task StartAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStartRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Starts an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response Start(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStartRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStartNetworkTraceRequest(string resourceGroupName, string name, int? durationInSeconds, int? maxFrameLength, string sasUrl) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/startNetworkTrace", false); + if (durationInSeconds != null) + { + uri.AppendQuery("durationInSeconds", durationInSeconds.Value, true); + } + if (maxFrameLength != null) + { + uri.AppendQuery("maxFrameLength", maxFrameLength.Value, true); + } + if (sasUrl != null) + { + uri.AppendQuery("sasUrl", sasUrl, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Start capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The duration to keep capturing in seconds. + /// The maximum frame length in bytes (Optional). + /// The Blob URL to store capture file. + /// The cancellation token to use. + /// or is null. + public async Task StartNetworkTraceAsync(string resourceGroupName, string name, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStartNetworkTraceRequest(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Start capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The duration to keep capturing in seconds. + /// The maximum frame length in bytes (Optional). + /// The Blob URL to store capture file. + /// The cancellation token to use. + /// or is null. + public Response StartNetworkTrace(string resourceGroupName, string name, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStartNetworkTraceRequest(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStopRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Stops an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task StopAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStopRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Stops an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response Stop(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStopRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStopNetworkTraceRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/stopNetworkTrace", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Stop ongoing capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The cancellation token to use. + /// or is null. + public async Task StopNetworkTraceAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStopNetworkTraceRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Stop ongoing capturing network packets for the site. + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The cancellation token to use. + /// or is null. + public Response StopNetworkTrace(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateStopNetworkTraceRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateSyncRepositoryRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/sync", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Sync web app repository. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public async Task SyncRepositoryAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateSyncRepositoryRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Sync web app repository. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// The cancellation token to use. + /// or is null. + public Response SyncRepository(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateSyncRepositoryRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateSyncFunctionTriggersRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/syncfunctiontriggers", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Syncs function trigger metadata to the management database. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task SyncFunctionTriggersAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateSyncFunctionTriggersRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Syncs function trigger metadata to the management database. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response SyncFunctionTriggers(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateSyncFunctionTriggersRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListTriggeredWebJobsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/triggeredwebjobs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List triggered web jobs for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public async Task> ListTriggeredWebJobsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListTriggeredWebJobsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TriggeredWebJobCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List triggered web jobs for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public Response ListTriggeredWebJobs(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListTriggeredWebJobsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TriggeredWebJobCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetTriggeredWebJobRequest(string resourceGroupName, string name, string webJobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/triggeredwebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a triggered web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetTriggeredWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateGetTriggeredWebJobRequest(resourceGroupName, name, webJobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TriggeredWebJob value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TriggeredWebJob.DeserializeTriggeredWebJob(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredWebJob)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a triggered web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public Response GetTriggeredWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateGetTriggeredWebJobRequest(resourceGroupName, name, webJobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TriggeredWebJob value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TriggeredWebJob.DeserializeTriggeredWebJob(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredWebJob)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteTriggeredWebJobRequest(string resourceGroupName, string name, string webJobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/triggeredwebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Delete a triggered web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteTriggeredWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateDeleteTriggeredWebJobRequest(resourceGroupName, name, webJobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Delete a triggered web job by its ID for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteTriggeredWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateDeleteTriggeredWebJobRequest(resourceGroupName, name, webJobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListTriggeredWebJobHistoryRequest(string resourceGroupName, string name, string webJobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/triggeredwebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendPath("/history", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List a triggered web job's history for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListTriggeredWebJobHistoryAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateListTriggeredWebJobHistoryRequest(resourceGroupName, name, webJobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TriggeredJobHistoryCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List a triggered web job's history for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public Response ListTriggeredWebJobHistory(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateListTriggeredWebJobHistoryRequest(resourceGroupName, name, webJobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TriggeredJobHistoryCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetTriggeredWebJobHistoryRequest(string resourceGroupName, string name, string webJobName, string id) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/triggeredwebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendPath("/history/", false); + uri.AppendPath(id, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a triggered web job's history by its ID for an app, , or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// History ID. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetTriggeredWebJobHistoryAsync(string resourceGroupName, string name, string webJobName, string id, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + using var message = CreateGetTriggeredWebJobHistoryRequest(resourceGroupName, name, webJobName, id); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TriggeredJobHistory value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TriggeredJobHistory.DeserializeTriggeredJobHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredJobHistory)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a triggered web job's history by its ID for an app, , or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// History ID. + /// The cancellation token to use. + /// , , , or is null. + public Response GetTriggeredWebJobHistory(string resourceGroupName, string name, string webJobName, string id, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + using var message = CreateGetTriggeredWebJobHistoryRequest(resourceGroupName, name, webJobName, id); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TriggeredJobHistory value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TriggeredJobHistory.DeserializeTriggeredJobHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredJobHistory)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateRunTriggeredWebJobRequest(string resourceGroupName, string name, string webJobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/triggeredwebjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendPath("/run", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Run a triggered web job for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public async Task RunTriggeredWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateRunTriggeredWebJobRequest(resourceGroupName, name, webJobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Run a triggered web job for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , or is null. + public Response RunTriggeredWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateRunTriggeredWebJobRequest(resourceGroupName, name, webJobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string name, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/usages", false); + uri.AppendQuery("api-version", apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, false); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the quota usage information of an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// or is null. + public async Task> ListUsagesAsync(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListUsagesRequest(resourceGroupName, name, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the quota usage information of an app (or deployment slot, if specified). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// or is null. + public Response ListUsages(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListUsagesRequest(resourceGroupName, name, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListVnetConnectionsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the virtual networks the app (or deployment slot) is connected to. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public async Task>> ListVnetConnectionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListVnetConnectionsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VnetInfo.DeserializeVnetInfo(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the virtual networks the app (or deployment slot) is connected to. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// or is null. + public Response> ListVnetConnections(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListVnetConnectionsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VnetInfo.DeserializeVnetInfo(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetVnetConnectionRequest(string resourceGroupName, string name, string vnetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a virtual network the app (or deployment slot) is connected to by name. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the virtual network. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetVnetConnectionAsync(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + + using var message = CreateGetVnetConnectionRequest(resourceGroupName, name, vnetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a virtual network the app (or deployment slot) is connected to by name. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the virtual network. + /// The cancellation token to use. + /// , , or is null. + public Response GetVnetConnection(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + + using var message = CreateGetVnetConnectionRequest(resourceGroupName, name, vnetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateVnetConnectionRequest(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of an existing Virtual Network. + /// Properties of the Virtual Network connection. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task> CreateOrUpdateVnetConnectionAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateVnetConnectionRequest(resourceGroupName, name, vnetName, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of an existing Virtual Network. + /// Properties of the Virtual Network connection. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response CreateOrUpdateVnetConnection(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateVnetConnectionRequest(resourceGroupName, name, vnetName, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteVnetConnectionRequest(string resourceGroupName, string name, string vnetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Deletes a connection from an app (or deployment slot to a named virtual network. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the virtual network. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteVnetConnectionAsync(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + + using var message = CreateDeleteVnetConnectionRequest(resourceGroupName, name, vnetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Deletes a connection from an app (or deployment slot to a named virtual network. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the virtual network. + /// The cancellation token to use. + /// , , or is null. + public Response DeleteVnetConnection(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + + using var message = CreateDeleteVnetConnectionRequest(resourceGroupName, name, vnetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 404: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateVnetConnectionRequest(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of an existing Virtual Network. + /// Properties of the Virtual Network connection. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task> UpdateVnetConnectionAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateVnetConnectionRequest(resourceGroupName, name, vnetName, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of an existing Virtual Network. + /// Properties of the Virtual Network connection. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response UpdateVnetConnection(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateVnetConnectionRequest(resourceGroupName, name, vnetName, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetInfo.DeserializeVnetInfo(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetVnetConnectionGatewayRequest(string resourceGroupName, string name, string vnetName, string gatewayName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets an app's Virtual Network gateway. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the Virtual Network. + /// Name of the gateway. Currently, the only supported string is "primary". + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetVnetConnectionGatewayAsync(string resourceGroupName, string name, string vnetName, string gatewayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + + using var message = CreateGetVnetConnectionGatewayRequest(resourceGroupName, name, vnetName, gatewayName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VnetGateway)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets an app's Virtual Network gateway. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the Virtual Network. + /// Name of the gateway. Currently, the only supported string is "primary". + /// The cancellation token to use. + /// , , , or is null. + public Response GetVnetConnectionGateway(string resourceGroupName, string name, string vnetName, string gatewayName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + + using var message = CreateGetVnetConnectionGatewayRequest(resourceGroupName, name, vnetName, gatewayName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VnetGateway)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateVnetConnectionGatewayRequest(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the Virtual Network. + /// Name of the gateway. Currently, the only supported string is "primary". + /// The properties to update this gateway with. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> CreateOrUpdateVnetConnectionGatewayAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateVnetConnectionGatewayRequest(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the Virtual Network. + /// Name of the gateway. Currently, the only supported string is "primary". + /// The properties to update this gateway with. + /// The cancellation token to use. + /// , , , , or is null. + public Response CreateOrUpdateVnetConnectionGateway(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateCreateOrUpdateVnetConnectionGatewayRequest(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateVnetConnectionGatewayRequest(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualNetworkConnections/", false); + uri.AppendPath(vnetName, true); + uri.AppendPath("/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connectionEnvelope); + request.Content = content; + return message; + } + + /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the Virtual Network. + /// Name of the gateway. Currently, the only supported string is "primary". + /// The properties to update this gateway with. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> UpdateVnetConnectionGatewayAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateVnetConnectionGatewayRequest(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the Virtual Network. + /// Name of the gateway. Currently, the only supported string is "primary". + /// The properties to update this gateway with. + /// The cancellation token to use. + /// , , , , or is null. + public Response UpdateVnetConnectionGateway(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (vnetName == null) + { + throw new ArgumentNullException(nameof(vnetName)); + } + if (gatewayName == null) + { + throw new ArgumentNullException(nameof(gatewayName)); + } + if (connectionEnvelope == null) + { + throw new ArgumentNullException(nameof(connectionEnvelope)); + } + + using var message = CreateUpdateVnetConnectionGatewayRequest(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetGateway value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetGateway.DeserializeVnetGateway(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebJobsRequest(string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/webjobs", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List webjobs for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public async Task> ListWebJobsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWebJobsRequest(resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebJobCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List webjobs for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// or is null. + public Response ListWebJobs(string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWebJobsRequest(resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebJobCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetWebJobRequest(string resourceGroupName, string name, string webJobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/webjobs/", false); + uri.AppendPath(webJobName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get webjob information for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the web job. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateGetWebJobRequest(resourceGroupName, name, webJobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebJob value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebJob.DeserializeWebJob(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get webjob information for an app, or a deployment slot. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the web job. + /// The cancellation token to use. + /// , , or is null. + public Response GetWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateGetWebJobRequest(resourceGroupName, name, webJobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebJob value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebJob.DeserializeWebJob(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get all apps for a subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get all apps for a subscription. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName, bool? includeSlots) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all web, mobile, and API apps in the specified resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Specify <strong>true</strong> to include deployment slots in results. The default is false, which only gives you the production slot of all apps. + /// The cancellation token to use. + /// or is null. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, bool? includeSlots = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName, includeSlots); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all web, mobile, and API apps in the specified resource group. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Specify <strong>true</strong> to include deployment slots in results. The default is false, which only gives you the production slot of all apps. + /// The cancellation token to use. + /// or is null. + public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, bool? includeSlots = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName, includeSlots); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBackupsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets existing backups of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListBackupsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListBackupsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets existing backups of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public Response ListBackupsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListBackupsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConfigurationsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the configurations of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListConfigurationsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListConfigurationsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResourceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the configurations of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public Response ListConfigurationsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListConfigurationsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResourceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAppSettingsKeyVaultReferencesNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the config reference app settings and status of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetAppSettingsKeyVaultReferencesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetAppSettingsKeyVaultReferencesNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the config reference app settings and status of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public Response GetAppSettingsKeyVaultReferencesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetAppSettingsKeyVaultReferencesNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteConnectionStringKeyVaultReferencesNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the config reference app settings and status of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetSiteConnectionStringKeyVaultReferencesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetSiteConnectionStringKeyVaultReferencesNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the config reference app settings and status of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public Response GetSiteConnectionStringKeyVaultReferencesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetSiteConnectionStringKeyVaultReferencesNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConfigurationSnapshotInfoNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListConfigurationSnapshotInfoNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListConfigurationSnapshotInfoNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigurationSnapshotInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public Response ListConfigurationSnapshotInfoNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListConfigurationSnapshotInfoNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigurationSnapshotInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListContinuousWebJobsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List continuous web jobs for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListContinuousWebJobsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListContinuousWebJobsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContinuousWebJobCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List continuous web jobs for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// , , or is null. + public Response ListContinuousWebJobsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListContinuousWebJobsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContinuousWebJobCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListDeploymentsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List deployments for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListDeploymentsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListDeploymentsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List deployments for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public Response ListDeploymentsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListDeploymentsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListDomainOwnershipIdentifiersNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Lists ownership identifiers for domain associated with web app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListDomainOwnershipIdentifiersNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListDomainOwnershipIdentifiersNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IdentifierCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Lists ownership identifiers for domain associated with web app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public Response ListDomainOwnershipIdentifiersNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListDomainOwnershipIdentifiersNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IdentifierCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListFunctionsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the functions for a web site, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListFunctionsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListFunctionsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionEnvelopeCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the functions for a web site, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// , , or is null. + public Response ListFunctionsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListFunctionsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionEnvelopeCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHostNameBindingsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get hostname bindings for an app or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListHostNameBindingsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHostNameBindingsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HostNameBindingCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get hostname bindings for an app or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public Response ListHostNameBindingsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListHostNameBindingsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HostNameBindingCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceIdentifiersNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all scale-out instances of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListInstanceIdentifiersNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListInstanceIdentifiersNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppInstanceStatusCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all scale-out instances of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public Response ListInstanceIdentifiersNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListInstanceIdentifiersNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppInstanceStatusCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceProcessesNextPageRequest(string nextLink, string resourceGroupName, string name, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListInstanceProcessesNextPageAsync(string nextLink, string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessesNextPageRequest(nextLink, resourceGroupName, name, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , or is null. + public Response ListInstanceProcessesNextPage(string nextLink, string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessesNextPageRequest(nextLink, resourceGroupName, name, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceProcessModulesNextPageRequest(string nextLink, string resourceGroupName, string name, string processId, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListInstanceProcessModulesNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessModulesNextPageRequest(nextLink, resourceGroupName, name, processId, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public Response ListInstanceProcessModulesNextPage(string nextLink, string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessModulesNextPageRequest(nextLink, resourceGroupName, name, processId, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceProcessThreadsNextPageRequest(string nextLink, string resourceGroupName, string name, string processId, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListInstanceProcessThreadsNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessThreadsNextPageRequest(nextLink, resourceGroupName, name, processId, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public Response ListInstanceProcessThreadsNextPage(string nextLink, string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessThreadsNextPageRequest(nextLink, resourceGroupName, name, processId, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteBackupsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets existing backups of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSiteBackupsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSiteBackupsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets existing backups of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public Response ListSiteBackupsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSiteBackupsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPerfMonCountersNextPageRequest(string nextLink, string resourceGroupName, string name, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets perfmon counters for web app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListPerfMonCountersNextPageAsync(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListPerfMonCountersNextPageRequest(nextLink, resourceGroupName, name, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PerfMonCounterCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets perfmon counters for web app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , or is null. + public Response ListPerfMonCountersNextPage(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListPerfMonCountersNextPageRequest(nextLink, resourceGroupName, name, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PerfMonCounterCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateEndpointConnectionListNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the list of private endpoint connections associated with a site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetPrivateEndpointConnectionListNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateEndpointConnectionListNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the list of private endpoint connections associated with a site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// The cancellation token to use. + /// , , or is null. + public Response GetPrivateEndpointConnectionListNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateGetPrivateEndpointConnectionListNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProcessesNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListProcessesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListProcessesNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// , , or is null. + public Response ListProcessesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListProcessesNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProcessModulesNextPageRequest(string nextLink, string resourceGroupName, string name, string processId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListProcessModulesNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateListProcessModulesNextPageRequest(nextLink, resourceGroupName, name, processId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , , or is null. + public Response ListProcessModulesNextPage(string nextLink, string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateListProcessModulesNextPageRequest(nextLink, resourceGroupName, name, processId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProcessThreadsNextPageRequest(string nextLink, string resourceGroupName, string name, string processId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListProcessThreadsNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateListProcessThreadsNextPageRequest(nextLink, resourceGroupName, name, processId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// The cancellation token to use. + /// , , , or is null. + public Response ListProcessThreadsNextPage(string nextLink, string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + + using var message = CreateListProcessThreadsNextPageRequest(nextLink, resourceGroupName, name, processId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPublicCertificatesNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get public certificates for an app or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListPublicCertificatesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListPublicCertificatesNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCertificateCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get public certificates for an app or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public Response ListPublicCertificatesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListPublicCertificatesNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCertificateCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteExtensionsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get list of siteextensions for a web site, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSiteExtensionsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSiteExtensionsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteExtensionInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get list of siteextensions for a web site, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// , , or is null. + public Response ListSiteExtensionsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSiteExtensionsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteExtensionInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSlotsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets an app's deployment slots. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSlotsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSlotsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets an app's deployment slots. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The cancellation token to use. + /// , , or is null. + public Response ListSlotsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSlotsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBackupsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets existing backups of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListBackupsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListBackupsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets existing backups of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListBackupsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListBackupsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConfigurationsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the configurations of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListConfigurationsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListConfigurationsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResourceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the configurations of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListConfigurationsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListConfigurationsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigResourceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetAppSettingsKeyVaultReferencesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the config reference app settings and status of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetAppSettingsKeyVaultReferencesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetAppSettingsKeyVaultReferencesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the config reference app settings and status of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public Response GetAppSettingsKeyVaultReferencesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetAppSettingsKeyVaultReferencesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSiteConnectionStringKeyVaultReferencesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the config reference app settings and status of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetSiteConnectionStringKeyVaultReferencesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteConnectionStringKeyVaultReferencesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the config reference app settings and status of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public Response GetSiteConnectionStringKeyVaultReferencesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetSiteConnectionStringKeyVaultReferencesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApiKVReferenceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConfigurationSnapshotInfoSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListConfigurationSnapshotInfoSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListConfigurationSnapshotInfoSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteConfigurationSnapshotInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListConfigurationSnapshotInfoSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListConfigurationSnapshotInfoSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteConfigurationSnapshotInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListContinuousWebJobsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List continuous web jobs for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListContinuousWebJobsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListContinuousWebJobsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContinuousWebJobCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List continuous web jobs for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListContinuousWebJobsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListContinuousWebJobsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContinuousWebJobCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListDeploymentsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List deployments for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListDeploymentsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListDeploymentsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List deployments for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListDeploymentsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListDeploymentsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListDomainOwnershipIdentifiersSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Lists ownership identifiers for domain associated with web app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListDomainOwnershipIdentifiersSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListDomainOwnershipIdentifiersSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IdentifierCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Lists ownership identifiers for domain associated with web app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListDomainOwnershipIdentifiersSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListDomainOwnershipIdentifiersSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IdentifierCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceFunctionsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the functions for a web site, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListInstanceFunctionsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListInstanceFunctionsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FunctionEnvelopeCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the functions for a web site, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListInstanceFunctionsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListInstanceFunctionsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FunctionEnvelopeCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListHostNameBindingsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get hostname bindings for an app or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListHostNameBindingsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListHostNameBindingsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HostNameBindingCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get hostname bindings for an app or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListHostNameBindingsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListHostNameBindingsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HostNameBindingCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceIdentifiersSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets all scale-out instances of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListInstanceIdentifiersSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListInstanceIdentifiersSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppInstanceStatusCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets all scale-out instances of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. + /// The cancellation token to use. + /// , , , or is null. + public Response ListInstanceIdentifiersSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListInstanceIdentifiersSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppInstanceStatusCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceProcessesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListInstanceProcessesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessesSlotNextPageRequest(nextLink, resourceGroupName, name, slot, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , or is null. + public Response ListInstanceProcessesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessesSlotNextPageRequest(nextLink, resourceGroupName, name, slot, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceProcessModulesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string processId, string slot, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , , or is null. + public async Task> ListInstanceProcessModulesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessModulesSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , , or is null. + public Response ListInstanceProcessModulesSlotNextPage(string nextLink, string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessModulesSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListInstanceProcessThreadsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string processId, string slot, string instanceId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , , or is null. + public async Task> ListInstanceProcessThreadsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessThreadsSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot, instanceId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". + /// The cancellation token to use. + /// , , , , , or is null. + public Response ListInstanceProcessThreadsSlotNextPage(string nextLink, string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (instanceId == null) + { + throw new ArgumentNullException(nameof(instanceId)); + } + + using var message = CreateListInstanceProcessThreadsSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot, instanceId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteBackupsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets existing backups of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListSiteBackupsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteBackupsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets existing backups of an app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListSiteBackupsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteBackupsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BackupItemCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPerfMonCountersSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets perfmon counters for web app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListPerfMonCountersSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListPerfMonCountersSlotNextPageRequest(nextLink, resourceGroupName, name, slot, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PerfMonCounterCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets perfmon counters for web app. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of web app. + /// Name of web app slot. If not specified then will default to production slot. + /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , , or is null. + public Response ListPerfMonCountersSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListPerfMonCountersSlotNextPageRequest(nextLink, resourceGroupName, name, slot, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PerfMonCounterCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPrivateEndpointConnectionListSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the list of private endpoint connections associated with a site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// Name of the site deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetPrivateEndpointConnectionListSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetPrivateEndpointConnectionListSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the list of private endpoint connections associated with a site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the site. + /// Name of the site deployment slot. + /// The cancellation token to use. + /// , , , or is null. + public Response GetPrivateEndpointConnectionListSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateGetPrivateEndpointConnectionListSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProcessesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListProcessesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListProcessesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListProcessesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListProcessesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProcessModulesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string processId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListProcessModulesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListProcessModulesSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , , or is null. + public Response ListProcessModulesSlotNextPage(string nextLink, string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListProcessModulesSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessModuleInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProcessThreadsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string processId, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListProcessThreadsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListProcessThreadsSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// PID. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , , or is null. + public Response ListProcessThreadsSlotNextPage(string nextLink, string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (processId == null) + { + throw new ArgumentNullException(nameof(processId)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListProcessThreadsSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProcessThreadInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPublicCertificatesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get public certificates for an app or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListPublicCertificatesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListPublicCertificatesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PublicCertificateCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get public certificates for an app or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListPublicCertificatesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListPublicCertificatesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PublicCertificateCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteExtensionsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get list of siteextensions for a web site, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListSiteExtensionsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteExtensionsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SiteExtensionInfoCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get list of siteextensions for a web site, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListSiteExtensionsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSiteExtensionsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SiteExtensionInfoCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSlotDifferencesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the difference in configuration settings between two web app slots. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListSlotDifferencesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateListSlotDifferencesSlotNextPageRequest(nextLink, resourceGroupName, name, slot, slotSwapEntity); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SlotDifferenceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the difference in configuration settings between two web app slots. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , , , or is null. + public Response ListSlotDifferencesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateListSlotDifferencesSlotNextPageRequest(nextLink, resourceGroupName, name, slot, slotSwapEntity); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SlotDifferenceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSnapshotsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns all Snapshots to the user. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// Website Slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListSnapshotsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSnapshotsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns all Snapshots to the user. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// Website Slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListSnapshotsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSnapshotsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSnapshotsFromDRSecondarySlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns all Snapshots to the user from DRSecondary endpoint. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// Website Slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListSnapshotsFromDRSecondarySlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSnapshotsFromDRSecondarySlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns all Snapshots to the user from DRSecondary endpoint. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// Website Slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListSnapshotsFromDRSecondarySlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListSnapshotsFromDRSecondarySlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListTriggeredWebJobsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List triggered web jobs for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListTriggeredWebJobsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListTriggeredWebJobsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TriggeredWebJobCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List triggered web jobs for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListTriggeredWebJobsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListTriggeredWebJobsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TriggeredWebJobCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListTriggeredWebJobHistorySlotNextPageRequest(string nextLink, string resourceGroupName, string name, string webJobName, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List a triggered web job's history for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , , or is null. + public async Task> ListTriggeredWebJobHistorySlotNextPageAsync(string nextLink, string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListTriggeredWebJobHistorySlotNextPageRequest(nextLink, resourceGroupName, name, webJobName, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TriggeredJobHistoryCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List a triggered web job's history for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. + /// The cancellation token to use. + /// , , , , or is null. + public Response ListTriggeredWebJobHistorySlotNextPage(string nextLink, string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListTriggeredWebJobHistorySlotNextPageRequest(nextLink, resourceGroupName, name, webJobName, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TriggeredJobHistoryCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListUsagesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the quota usage information of an app (or deployment slot, if specified). + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get quota information of the production slot. + /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListUsagesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListUsagesSlotNextPageRequest(nextLink, resourceGroupName, name, slot, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the quota usage information of an app (or deployment slot, if specified). + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Name of the deployment slot. If a slot is not specified, the API will get quota information of the production slot. + /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , , or is null. + public Response ListUsagesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListUsagesSlotNextPageRequest(nextLink, resourceGroupName, name, slot, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebJobsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List webjobs for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListWebJobsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListWebJobsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebJobCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List webjobs for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. + /// The cancellation token to use. + /// , , , or is null. + public Response ListWebJobsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slot == null) + { + throw new ArgumentNullException(nameof(slot)); + } + + using var message = CreateListWebJobsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebJobCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSlotDifferencesFromProductionNextPageRequest(string nextLink, string resourceGroupName, string name, CsmSlotEntity slotSwapEntity) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get the difference in configuration settings between two web app slots. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListSlotDifferencesFromProductionNextPageAsync(string nextLink, string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateListSlotDifferencesFromProductionNextPageRequest(nextLink, resourceGroupName, name, slotSwapEntity); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SlotDifferenceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get the difference in configuration settings between two web app slots. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// JSON object that contains the target slot name. See example. + /// The cancellation token to use. + /// , , , or is null. + public Response ListSlotDifferencesFromProductionNextPage(string nextLink, string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (slotSwapEntity == null) + { + throw new ArgumentNullException(nameof(slotSwapEntity)); + } + + using var message = CreateListSlotDifferencesFromProductionNextPageRequest(nextLink, resourceGroupName, name, slotSwapEntity); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SlotDifferenceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSnapshotsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns all Snapshots to the user. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSnapshotsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSnapshotsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns all Snapshots to the user. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// The cancellation token to use. + /// , , or is null. + public Response ListSnapshotsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSnapshotsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSnapshotsFromDRSecondaryNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Returns all Snapshots to the user from DRSecondary endpoint. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListSnapshotsFromDRSecondaryNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSnapshotsFromDRSecondaryNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Returns all Snapshots to the user from DRSecondary endpoint. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Website Name. + /// The cancellation token to use. + /// , , or is null. + public Response ListSnapshotsFromDRSecondaryNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListSnapshotsFromDRSecondaryNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SnapshotCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListTriggeredWebJobsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List triggered web jobs for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListTriggeredWebJobsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListTriggeredWebJobsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TriggeredWebJobCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List triggered web jobs for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// , , or is null. + public Response ListTriggeredWebJobsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListTriggeredWebJobsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TriggeredWebJobCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListTriggeredWebJobHistoryNextPageRequest(string nextLink, string resourceGroupName, string name, string webJobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List a triggered web job's history for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , , or is null. + public async Task> ListTriggeredWebJobHistoryNextPageAsync(string nextLink, string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateListTriggeredWebJobHistoryNextPageRequest(nextLink, resourceGroupName, name, webJobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TriggeredJobHistoryCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List a triggered web job's history for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// Name of Web Job. + /// The cancellation token to use. + /// , , , or is null. + public Response ListTriggeredWebJobHistoryNextPage(string nextLink, string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (webJobName == null) + { + throw new ArgumentNullException(nameof(webJobName)); + } + + using var message = CreateListTriggeredWebJobHistoryNextPageRequest(nextLink, resourceGroupName, name, webJobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TriggeredJobHistoryCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListUsagesNextPageRequest(string nextLink, string resourceGroupName, string name, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the quota usage information of an app (or deployment slot, if specified). + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListUsagesNextPageAsync(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListUsagesNextPageRequest(nextLink, resourceGroupName, name, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the quota usage information of an app (or deployment slot, if specified). + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Name of the app. + /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// The cancellation token to use. + /// , , or is null. + public Response ListUsagesNextPage(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListUsagesNextPageRequest(nextLink, resourceGroupName, name, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CsmUsageQuotaCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListWebJobsNextPageRequest(string nextLink, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List webjobs for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListWebJobsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWebJobsNextPageRequest(nextLink, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebJobCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List webjobs for an app, or a deployment slot. + /// The URL to the next page of results. + /// Name of the resource group to which the resource belongs. + /// Site name. + /// The cancellation token to use. + /// , , or is null. + public Response ListWebJobsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateListWebJobsNextPageRequest(nextLink, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebJobCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementRestClient.cs new file mode 100644 index 000000000000..43bfc547188a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementRestClient.cs @@ -0,0 +1,1609 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Microsoft.Azure.Management.WebSites.Models; + +namespace Microsoft.Azure.Management.WebSites +{ + internal partial class WebSiteManagementRestClient + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of WebSiteManagementRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// server parameter. + /// Api Version. + /// or is null. + public WebSiteManagementRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateGenerateGithubAccessTokenForAppserviceCLIAsyncRequest(string code, string state) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.Web/generateGithubAccessTokenForAppserviceCLI", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var model = new AppserviceGithubTokenRequest(code, state); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(model); + request.Content = content; + return message; + } + + /// Description for Exchange code for GitHub access token for AppService CLI. + /// Code string to exchange for Github Access token. + /// State string used for verification. + /// The cancellation token to use. + /// or is null. + public async Task> GenerateGithubAccessTokenForAppserviceCLIAsyncAsync(string code, string state, CancellationToken cancellationToken = default) + { + if (code == null) + { + throw new ArgumentNullException(nameof(code)); + } + if (state == null) + { + throw new ArgumentNullException(nameof(state)); + } + + using var message = CreateGenerateGithubAccessTokenForAppserviceCLIAsyncRequest(code, state); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppserviceGithubToken value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AppserviceGithubToken.DeserializeAppserviceGithubToken(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Exchange code for GitHub access token for AppService CLI. + /// Code string to exchange for Github Access token. + /// State string used for verification. + /// The cancellation token to use. + /// or is null. + public Response GenerateGithubAccessTokenForAppserviceCLIAsync(string code, string state, CancellationToken cancellationToken = default) + { + if (code == null) + { + throw new ArgumentNullException(nameof(code)); + } + if (state == null) + { + throw new ArgumentNullException(nameof(state)); + } + + using var message = CreateGenerateGithubAccessTokenForAppserviceCLIAsyncRequest(code, state); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppserviceGithubToken value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AppserviceGithubToken.DeserializeAppserviceGithubToken(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetPublishingUserRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.Web/publishingUsers/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets publishing user. + /// The cancellation token to use. + public async Task> GetPublishingUserAsync(CancellationToken cancellationToken = default) + { + using var message = CreateGetPublishingUserRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + User value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = User.DeserializeUser(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets publishing user. + /// The cancellation token to use. + public Response GetPublishingUser(CancellationToken cancellationToken = default) + { + using var message = CreateGetPublishingUserRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + User value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = User.DeserializeUser(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdatePublishingUserRequest(User userDetails) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.Web/publishingUsers/web", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(userDetails); + request.Content = content; + return message; + } + + /// Description for Updates publishing user. + /// Details of publishing user. + /// The cancellation token to use. + /// is null. + public async Task> UpdatePublishingUserAsync(User userDetails, CancellationToken cancellationToken = default) + { + if (userDetails == null) + { + throw new ArgumentNullException(nameof(userDetails)); + } + + using var message = CreateUpdatePublishingUserRequest(userDetails); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + User value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = User.DeserializeUser(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates publishing user. + /// Details of publishing user. + /// The cancellation token to use. + /// is null. + public Response UpdatePublishingUser(User userDetails, CancellationToken cancellationToken = default) + { + if (userDetails == null) + { + throw new ArgumentNullException(nameof(userDetails)); + } + + using var message = CreateUpdatePublishingUserRequest(userDetails); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + User value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = User.DeserializeUser(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSourceControlsRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.Web/sourcecontrols", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the source controls available for Azure websites. + /// The cancellation token to use. + public async Task> ListSourceControlsAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListSourceControlsRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SourceControlCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SourceControlCollection.DeserializeSourceControlCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the source controls available for Azure websites. + /// The cancellation token to use. + public Response ListSourceControls(CancellationToken cancellationToken = default) + { + using var message = CreateListSourceControlsRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SourceControlCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SourceControlCollection.DeserializeSourceControlCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSourceControlRequest(string sourceControlType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.Web/sourcecontrols/", false); + uri.AppendPath(sourceControlType, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets source control token. + /// Type of source control. + /// The cancellation token to use. + /// is null. + public async Task> GetSourceControlAsync(string sourceControlType, CancellationToken cancellationToken = default) + { + if (sourceControlType == null) + { + throw new ArgumentNullException(nameof(sourceControlType)); + } + + using var message = CreateGetSourceControlRequest(sourceControlType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SourceControl value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SourceControl.DeserializeSourceControl(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets source control token. + /// Type of source control. + /// The cancellation token to use. + /// is null. + public Response GetSourceControl(string sourceControlType, CancellationToken cancellationToken = default) + { + if (sourceControlType == null) + { + throw new ArgumentNullException(nameof(sourceControlType)); + } + + using var message = CreateGetSourceControlRequest(sourceControlType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SourceControl value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SourceControl.DeserializeSourceControl(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateSourceControlRequest(string sourceControlType, SourceControl requestMessage) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/providers/Microsoft.Web/sourcecontrols/", false); + uri.AppendPath(sourceControlType, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(requestMessage); + request.Content = content; + return message; + } + + /// Description for Updates source control token. + /// Type of source control. + /// Source control token information. + /// The cancellation token to use. + /// or is null. + public async Task> UpdateSourceControlAsync(string sourceControlType, SourceControl requestMessage, CancellationToken cancellationToken = default) + { + if (sourceControlType == null) + { + throw new ArgumentNullException(nameof(sourceControlType)); + } + if (requestMessage == null) + { + throw new ArgumentNullException(nameof(requestMessage)); + } + + using var message = CreateUpdateSourceControlRequest(sourceControlType, requestMessage); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SourceControl value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SourceControl.DeserializeSourceControl(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Updates source control token. + /// Type of source control. + /// Source control token information. + /// The cancellation token to use. + /// or is null. + public Response UpdateSourceControl(string sourceControlType, SourceControl requestMessage, CancellationToken cancellationToken = default) + { + if (sourceControlType == null) + { + throw new ArgumentNullException(nameof(sourceControlType)); + } + if (requestMessage == null) + { + throw new ArgumentNullException(nameof(requestMessage)); + } + + using var message = CreateUpdateSourceControlRequest(sourceControlType, requestMessage); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SourceControl value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SourceControl.DeserializeSourceControl(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBillingMetersRequest(string billingLocation, string osType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/billingMeters", false); + if (billingLocation != null) + { + uri.AppendQuery("billingLocation", billingLocation, true); + } + if (osType != null) + { + uri.AppendQuery("osType", osType, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a list of meters for a given location. + /// Azure Location of billable resource. + /// App Service OS type meters used for. + /// The cancellation token to use. + public async Task> ListBillingMetersAsync(string billingLocation = null, string osType = null, CancellationToken cancellationToken = default) + { + using var message = CreateListBillingMetersRequest(billingLocation, osType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BillingMeterCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BillingMeterCollection.DeserializeBillingMeterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a list of meters for a given location. + /// Azure Location of billable resource. + /// App Service OS type meters used for. + /// The cancellation token to use. + public Response ListBillingMeters(string billingLocation = null, string osType = null, CancellationToken cancellationToken = default) + { + using var message = CreateListBillingMetersRequest(billingLocation, osType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BillingMeterCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BillingMeterCollection.DeserializeBillingMeterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCheckNameAvailabilityRequest(string name, CheckNameResourceTypes type, bool? isFqdn) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/checknameavailability", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var model = new ResourceNameAvailabilityRequest(name, type) + { + IsFqdn = isFqdn + }; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(model); + request.Content = content; + return message; + } + + /// Description for Check if a resource name is available. + /// Resource name to verify. + /// Resource type used for verification. + /// Is fully qualified domain name. + /// The cancellation token to use. + /// is null. + public async Task> CheckNameAvailabilityAsync(string name, CheckNameResourceTypes type, bool? isFqdn = null, CancellationToken cancellationToken = default) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateCheckNameAvailabilityRequest(name, type, isFqdn); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ResourceNameAvailability value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ResourceNameAvailability.DeserializeResourceNameAvailability(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Check if a resource name is available. + /// Resource name to verify. + /// Resource type used for verification. + /// Is fully qualified domain name. + /// The cancellation token to use. + /// is null. + public Response CheckNameAvailability(string name, CheckNameResourceTypes type, bool? isFqdn = null, CancellationToken cancellationToken = default) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + using var message = CreateCheckNameAvailabilityRequest(name, type, isFqdn); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ResourceNameAvailability value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ResourceNameAvailability.DeserializeResourceNameAvailability(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSubscriptionDeploymentLocationsRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/deploymentLocations", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets list of available geo regions plus ministamps. + /// The cancellation token to use. + public async Task> GetSubscriptionDeploymentLocationsAsync(CancellationToken cancellationToken = default) + { + using var message = CreateGetSubscriptionDeploymentLocationsRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentLocations value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeploymentLocations.DeserializeDeploymentLocations(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets list of available geo regions plus ministamps. + /// The cancellation token to use. + public Response GetSubscriptionDeploymentLocations(CancellationToken cancellationToken = default) + { + using var message = CreateGetSubscriptionDeploymentLocationsRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentLocations value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeploymentLocations.DeserializeDeploymentLocations(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListGeoRegionsRequest(SkuName? sku, bool? linuxWorkersEnabled, bool? xenonWorkersEnabled, bool? linuxDynamicWorkersEnabled) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/geoRegions", false); + if (sku != null) + { + uri.AppendQuery("sku", sku.Value.ToString(), true); + } + if (linuxWorkersEnabled != null) + { + uri.AppendQuery("linuxWorkersEnabled", linuxWorkersEnabled.Value, true); + } + if (xenonWorkersEnabled != null) + { + uri.AppendQuery("xenonWorkersEnabled", xenonWorkersEnabled.Value, true); + } + if (linuxDynamicWorkersEnabled != null) + { + uri.AppendQuery("linuxDynamicWorkersEnabled", linuxDynamicWorkersEnabled.Value, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a list of available geographical regions. + /// Name of SKU used to filter the regions. + /// Specify <code>true</code> if you want to filter to only regions that support Linux workers. + /// Specify <code>true</code> if you want to filter to only regions that support Xenon workers. + /// Specify <code>true</code> if you want to filter to only regions that support Linux Consumption Workers. + /// The cancellation token to use. + public async Task> ListGeoRegionsAsync(SkuName? sku = null, bool? linuxWorkersEnabled = null, bool? xenonWorkersEnabled = null, bool? linuxDynamicWorkersEnabled = null, CancellationToken cancellationToken = default) + { + using var message = CreateListGeoRegionsRequest(sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GeoRegionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GeoRegionCollection.DeserializeGeoRegionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a list of available geographical regions. + /// Name of SKU used to filter the regions. + /// Specify <code>true</code> if you want to filter to only regions that support Linux workers. + /// Specify <code>true</code> if you want to filter to only regions that support Xenon workers. + /// Specify <code>true</code> if you want to filter to only regions that support Linux Consumption Workers. + /// The cancellation token to use. + public Response ListGeoRegions(SkuName? sku = null, bool? linuxWorkersEnabled = null, bool? xenonWorkersEnabled = null, bool? linuxDynamicWorkersEnabled = null, CancellationToken cancellationToken = default) + { + using var message = CreateListGeoRegionsRequest(sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GeoRegionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GeoRegionCollection.DeserializeGeoRegionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteIdentifiersAssignedToHostNameRequest(NameIdentifier nameIdentifier) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/listSitesAssignedToHostName", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(nameIdentifier); + request.Content = content; + return message; + } + + /// Description for List all apps that are assigned to a hostname. + /// Hostname information. + /// The cancellation token to use. + /// is null. + public async Task> ListSiteIdentifiersAssignedToHostNameAsync(NameIdentifier nameIdentifier, CancellationToken cancellationToken = default) + { + if (nameIdentifier == null) + { + throw new ArgumentNullException(nameof(nameIdentifier)); + } + + using var message = CreateListSiteIdentifiersAssignedToHostNameRequest(nameIdentifier); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IdentifierCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all apps that are assigned to a hostname. + /// Hostname information. + /// The cancellation token to use. + /// is null. + public Response ListSiteIdentifiersAssignedToHostName(NameIdentifier nameIdentifier, CancellationToken cancellationToken = default) + { + if (nameIdentifier == null) + { + throw new ArgumentNullException(nameof(nameIdentifier)); + } + + using var message = CreateListSiteIdentifiersAssignedToHostNameRequest(nameIdentifier); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IdentifierCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPremierAddOnOffersRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/premieraddonoffers", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all premier add-on offers. + /// The cancellation token to use. + public async Task> ListPremierAddOnOffersAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListPremierAddOnOffersRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PremierAddOnOfferCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PremierAddOnOfferCollection.DeserializePremierAddOnOfferCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all premier add-on offers. + /// The cancellation token to use. + public Response ListPremierAddOnOffers(CancellationToken cancellationToken = default) + { + using var message = CreateListPremierAddOnOffersRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PremierAddOnOfferCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PremierAddOnOfferCollection.DeserializePremierAddOnOfferCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSkusRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/skus", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all SKUs. + /// The cancellation token to use. + public async Task> ListSkusAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListSkusRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SkuInfos value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SkuInfos.DeserializeSkuInfos(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all SKUs. + /// The cancellation token to use. + public Response ListSkus(CancellationToken cancellationToken = default) + { + using var message = CreateListSkusRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SkuInfos value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SkuInfos.DeserializeSkuInfos(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateVerifyHostingEnvironmentVnetRequest(VnetParameters parameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Web/verifyHostingEnvironmentVnet", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(parameters); + request.Content = content; + return message; + } + + /// Description for Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. + /// VNET information. + /// The cancellation token to use. + /// is null. + public async Task> VerifyHostingEnvironmentVnetAsync(VnetParameters parameters, CancellationToken cancellationToken = default) + { + if (parameters == null) + { + throw new ArgumentNullException(nameof(parameters)); + } + + using var message = CreateVerifyHostingEnvironmentVnetRequest(parameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VnetValidationFailureDetails value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VnetValidationFailureDetails.DeserializeVnetValidationFailureDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. + /// VNET information. + /// The cancellation token to use. + /// is null. + public Response VerifyHostingEnvironmentVnet(VnetParameters parameters, CancellationToken cancellationToken = default) + { + if (parameters == null) + { + throw new ArgumentNullException(nameof(parameters)); + } + + using var message = CreateVerifyHostingEnvironmentVnetRequest(parameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VnetValidationFailureDetails value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VnetValidationFailureDetails.DeserializeVnetValidationFailureDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateMoveRequest(string resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/moveResources", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(moveResourceEnvelope); + request.Content = content; + return message; + } + + /// Description for Move resources between resource groups. + /// Name of the resource group to which the resource belongs. + /// Object that represents the resource to move. + /// The cancellation token to use. + /// or is null. + public async Task MoveAsync(string resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (moveResourceEnvelope == null) + { + throw new ArgumentNullException(nameof(moveResourceEnvelope)); + } + + using var message = CreateMoveRequest(resourceGroupName, moveResourceEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Move resources between resource groups. + /// Name of the resource group to which the resource belongs. + /// Object that represents the resource to move. + /// The cancellation token to use. + /// or is null. + public Response Move(string resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (moveResourceEnvelope == null) + { + throw new ArgumentNullException(nameof(moveResourceEnvelope)); + } + + using var message = CreateMoveRequest(resourceGroupName, moveResourceEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateValidateRequest(string resourceGroupName, ValidateRequest validateRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/validate", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(validateRequest); + request.Content = content; + return message; + } + + /// Description for Validate if a resource can be created. + /// Name of the resource group to which the resource belongs. + /// Request with the resources to validate. + /// The cancellation token to use. + /// or is null. + public async Task> ValidateAsync(string resourceGroupName, ValidateRequest validateRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (validateRequest == null) + { + throw new ArgumentNullException(nameof(validateRequest)); + } + + using var message = CreateValidateRequest(resourceGroupName, validateRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ValidateResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ValidateResponse.DeserializeValidateResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Validate if a resource can be created. + /// Name of the resource group to which the resource belongs. + /// Request with the resources to validate. + /// The cancellation token to use. + /// or is null. + public Response Validate(string resourceGroupName, ValidateRequest validateRequest, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (validateRequest == null) + { + throw new ArgumentNullException(nameof(validateRequest)); + } + + using var message = CreateValidateRequest(resourceGroupName, validateRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ValidateResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ValidateResponse.DeserializeValidateResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateValidateMoveRequest(string resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/validateMoveResources", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(moveResourceEnvelope); + request.Content = content; + return message; + } + + /// Description for Validate whether a resource can be moved. + /// Name of the resource group to which the resource belongs. + /// Object that represents the resource to move. + /// The cancellation token to use. + /// or is null. + public async Task ValidateMoveAsync(string resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (moveResourceEnvelope == null) + { + throw new ArgumentNullException(nameof(moveResourceEnvelope)); + } + + using var message = CreateValidateMoveRequest(resourceGroupName, moveResourceEnvelope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Validate whether a resource can be moved. + /// Name of the resource group to which the resource belongs. + /// Object that represents the resource to move. + /// The cancellation token to use. + /// or is null. + public Response ValidateMove(string resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (moveResourceEnvelope == null) + { + throw new ArgumentNullException(nameof(moveResourceEnvelope)); + } + + using var message = CreateValidateMoveRequest(resourceGroupName, moveResourceEnvelope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSourceControlsNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets the source controls available for Azure websites. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListSourceControlsNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListSourceControlsNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SourceControlCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SourceControlCollection.DeserializeSourceControlCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets the source controls available for Azure websites. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListSourceControlsNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListSourceControlsNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SourceControlCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SourceControlCollection.DeserializeSourceControlCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBillingMetersNextPageRequest(string nextLink, string billingLocation, string osType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Gets a list of meters for a given location. + /// The URL to the next page of results. + /// Azure Location of billable resource. + /// App Service OS type meters used for. + /// The cancellation token to use. + /// is null. + public async Task> ListBillingMetersNextPageAsync(string nextLink, string billingLocation = null, string osType = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListBillingMetersNextPageRequest(nextLink, billingLocation, osType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BillingMeterCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = BillingMeterCollection.DeserializeBillingMeterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Gets a list of meters for a given location. + /// The URL to the next page of results. + /// Azure Location of billable resource. + /// App Service OS type meters used for. + /// The cancellation token to use. + /// is null. + public Response ListBillingMetersNextPage(string nextLink, string billingLocation = null, string osType = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListBillingMetersNextPageRequest(nextLink, billingLocation, osType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BillingMeterCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = BillingMeterCollection.DeserializeBillingMeterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListGeoRegionsNextPageRequest(string nextLink, SkuName? sku, bool? linuxWorkersEnabled, bool? xenonWorkersEnabled, bool? linuxDynamicWorkersEnabled) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for Get a list of available geographical regions. + /// The URL to the next page of results. + /// Name of SKU used to filter the regions. + /// Specify <code>true</code> if you want to filter to only regions that support Linux workers. + /// Specify <code>true</code> if you want to filter to only regions that support Xenon workers. + /// Specify <code>true</code> if you want to filter to only regions that support Linux Consumption Workers. + /// The cancellation token to use. + /// is null. + public async Task> ListGeoRegionsNextPageAsync(string nextLink, SkuName? sku = null, bool? linuxWorkersEnabled = null, bool? xenonWorkersEnabled = null, bool? linuxDynamicWorkersEnabled = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListGeoRegionsNextPageRequest(nextLink, sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GeoRegionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GeoRegionCollection.DeserializeGeoRegionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for Get a list of available geographical regions. + /// The URL to the next page of results. + /// Name of SKU used to filter the regions. + /// Specify <code>true</code> if you want to filter to only regions that support Linux workers. + /// Specify <code>true</code> if you want to filter to only regions that support Xenon workers. + /// Specify <code>true</code> if you want to filter to only regions that support Linux Consumption Workers. + /// The cancellation token to use. + /// is null. + public Response ListGeoRegionsNextPage(string nextLink, SkuName? sku = null, bool? linuxWorkersEnabled = null, bool? xenonWorkersEnabled = null, bool? linuxDynamicWorkersEnabled = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListGeoRegionsNextPageRequest(nextLink, sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GeoRegionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GeoRegionCollection.DeserializeGeoRegionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSiteIdentifiersAssignedToHostNameNextPageRequest(string nextLink, NameIdentifier nameIdentifier) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all apps that are assigned to a hostname. + /// The URL to the next page of results. + /// Hostname information. + /// The cancellation token to use. + /// or is null. + public async Task> ListSiteIdentifiersAssignedToHostNameNextPageAsync(string nextLink, NameIdentifier nameIdentifier, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (nameIdentifier == null) + { + throw new ArgumentNullException(nameof(nameIdentifier)); + } + + using var message = CreateListSiteIdentifiersAssignedToHostNameNextPageRequest(nextLink, nameIdentifier); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IdentifierCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all apps that are assigned to a hostname. + /// The URL to the next page of results. + /// Hostname information. + /// The cancellation token to use. + /// or is null. + public Response ListSiteIdentifiersAssignedToHostNameNextPage(string nextLink, NameIdentifier nameIdentifier, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (nameIdentifier == null) + { + throw new ArgumentNullException(nameof(nameIdentifier)); + } + + using var message = CreateListSiteIdentifiersAssignedToHostNameNextPageRequest(nextLink, nameIdentifier); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IdentifierCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListPremierAddOnOffersNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Description for List all premier add-on offers. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListPremierAddOnOffersNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListPremierAddOnOffersNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PremierAddOnOfferCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PremierAddOnOfferCollection.DeserializePremierAddOnOfferCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Description for List all premier add-on offers. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListPremierAddOnOffersNextPage(string nextLink, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListPremierAddOnOffersNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PremierAddOnOfferCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PremierAddOnOfferCollection.DeserializePremierAddOnOfferCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj index 6746aec79a70..a71fb40a259f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj @@ -1,24 +1,23 @@ - - - - + - - Microsoft.Azure.Management.Websites - Provides website management capabilities for Microsoft Azure. - Microsoft.Azure.Management.Websites - 3.1.0 - Microsoft Azure website management;website management; - - - - $(SdkTargetFx) - + + netstandard2.0 + true + annotations + - - - - - - - \ No newline at end of file + + 8.0 + true + https://azuresdkartifacts.blob.core.windows.net/azure-sdk-tools/index.json + + + + + + + + + + + diff --git a/src/SDKs/_metadata/web_resource-manager.txt b/src/SDKs/_metadata/web_resource-manager.txt new file mode 100644 index 000000000000..38b42a0e7b6d --- /dev/null +++ b/src/SDKs/_metadata/web_resource-manager.txt @@ -0,0 +1,11 @@ +2021-05-06 15:51:44 UTC + +1) azure-rest-api-specs repository information +GitHub user: Azure +Branch: master +Commit: e401e457b5e95941f241f5c71bc56d42d431a4e0 + +2) AutoRest information +Requested version: latest +Bootstrapper version: C:\Program Files\nodejs `-- autorest@3.2.0 +Latest installed version: From dd6d8949c8542110d14b28f54b207f0d4cc4fb44 Mon Sep 17 00:00:00 2001 From: Kota Sudhakar Reddy <60102891+Kotasudhakarreddy@users.noreply.github.com> Date: Mon, 10 May 2021 17:25:37 +0530 Subject: [PATCH 5/7] Revert "Generated with 2020-12 version" This reverts commit e6178a7cb54aec24d7b9547cd6752b4d4978d41d. --- .../AppServiceCertificateOrdersRestClient.cs | 1999 - .../AppServiceEnvironmentsRestClient.cs | 5793 -- .../Generated/AppServicePlansRestClient.cs | 3199 -- .../CertificateOrdersDiagnosticsRestClient.cs | 337 - ...rtificateRegistrationProviderRestClient.cs | 167 - .../src/Generated/CertificatesRestClient.cs | 685 - .../src/Generated/DeletedWebAppsRestClient.cs | 408 - .../src/Generated/DiagnosticsRestClient.cs | 3301 -- .../DomainRegistrationProviderRestClient.cs | 167 - .../src/Generated/DomainsRestClient.cs | 1607 - .../src/Generated/GlobalRestClient.cs | 280 - .../AbnormalTimePeriod.Serialization.cs | 115 - .../Generated/Models/AbnormalTimePeriod.cs | 85 +- .../Generated/Models/Address.Serialization.cs | 80 - .../src/Generated/Models/Address.cs | 152 +- .../Models/AddressResponse.Serialization.cs | 148 - .../src/Generated/Models/AddressResponse.cs | 96 +- ...llowedAudiencesValidation.Serialization.cs | 100 - .../Models/AllowedAudiencesValidation.cs | 59 +- .../Models/AnalysisData.Serialization.cs | 135 - .../src/Generated/Models/AnalysisData.cs | 88 +- .../AnalysisDefinition.Serialization.cs | 79 - .../Generated/Models/AnalysisDefinition.cs | 59 +- .../Models/ApiDefinitionInfo.Serialization.cs | 40 - .../src/Generated/Models/ApiDefinitionInfo.cs | 45 +- .../Models/ApiKVReference.Serialization.cs | 182 - .../src/Generated/Models/ApiKVReference.cs | 57 - .../ApiKVReferenceCollection.Serialization.cs | 41 - .../Models/ApiKVReferenceCollection.cs | 44 - .../ApiManagementConfig.Serialization.cs | 40 - .../Generated/Models/ApiManagementConfig.cs | 45 +- ...sightsWebAppStackSettings.Serialization.cs | 45 - .../Models/AppInsightsWebAppStackSettings.cs | 32 - .../Models/AppRegistration.Serialization.cs | 95 - .../src/Generated/Models/AppRegistration.cs | 58 +- .../AppServiceCertificate.Serialization.cs | 62 - .../Generated/Models/AppServiceCertificate.cs | 74 +- ...viceCertificateCollection.Serialization.cs | 41 - .../Models/AppServiceCertificateCollection.cs | 44 - ...ppServiceCertificateOrder.Serialization.cs | 361 - .../Models/AppServiceCertificateOrder.cs | 301 +- ...ertificateOrderCollection.Serialization.cs | 41 - .../AppServiceCertificateOrderCollection.cs | 44 - ...ificateOrderPatchResource.Serialization.cs | 326 - ...AppServiceCertificateOrderPatchResource.cs | 289 +- ...rviceCertificateNotRenewableReasonsItem.cs | 54 - ...rviceCertificateNotRenewableReasonsItem.cs | 54 - ...eCertificatePatchResource.Serialization.cs | 106 - .../AppServiceCertificatePatchResource.cs | 89 +- ...erviceCertificateResource.Serialization.cs | 142 - .../Models/AppServiceCertificateResource.cs | 116 +- .../AppServiceEnvironment.Serialization.cs | 237 - .../Generated/Models/AppServiceEnvironment.cs | 495 +- ...viceEnvironmentCollection.Serialization.cs | 41 - .../Models/AppServiceEnvironmentCollection.cs | 44 - ...eEnvironmentPatchResource.Serialization.cs | 289 - .../AppServiceEnvironmentPatchResource.cs | 498 +- ...erviceEnvironmentResource.Serialization.cs | 324 - .../Models/AppServiceEnvironmentResource.cs | 513 +- .../Models/AppServicePlan.Serialization.cs | 391 - .../src/Generated/Models/AppServicePlan.cs | 302 +- .../AppServicePlanCollection.Serialization.cs | 41 - .../Models/AppServicePlanCollection.cs | 44 - ...pServicePlanPatchResource.Serialization.cs | 339 - .../Models/AppServicePlanPatchResource.cs | 274 +- ...ppServicePlanRestrictions.Serialization.cs | 36 - .../Models/AppServicePlanRestrictions.cs | 82 +- .../Generated/Models/Apple.Serialization.cs | 121 - .../src/Generated/Models/Apple.cs | 40 - .../Models/AppleRegistration.Serialization.cs | 95 - .../src/Generated/Models/AppleRegistration.cs | 36 - .../ApplicationLogsConfig.Serialization.cs | 77 - .../Generated/Models/ApplicationLogsConfig.cs | 77 +- .../Models/ApplicationStack.Serialization.cs | 141 - .../src/Generated/Models/ApplicationStack.cs | 95 +- ...pplicationStackCollection.Serialization.cs | 41 - .../Models/ApplicationStackCollection.cs | 44 - .../ApplicationStackResource.Serialization.cs | 185 - .../Models/ApplicationStackResource.cs | 112 +- .../AppserviceGithubToken.Serialization.cs | 58 - .../Generated/Models/AppserviceGithubToken.cs | 44 - ...serviceGithubTokenRequest.Serialization.cs | 25 - .../Models/AppserviceGithubTokenRequest.cs | 39 - .../Models/ArmIdWrapper.Serialization.cs | 35 - .../src/Generated/Models/ArmIdWrapper.cs | 44 +- .../Generated/Models/ArmPlan.Serialization.cs | 53 - .../src/Generated/Models/ArmPlan.cs | 44 - ...V3NetworkingConfiguration.Serialization.cs | 122 - .../Models/AseV3NetworkingConfiguration.cs | 43 - .../Models/AuthPlatform.Serialization.cs | 111 - .../src/Generated/Models/AuthPlatform.cs | 68 +- .../AutoHealActionType.Serialization.cs | 30 - .../Generated/Models/AutoHealActionType.cs | 64 +- .../Models/AutoHealActions.Serialization.cs | 72 - .../src/Generated/Models/AutoHealActions.cs | 68 +- .../AutoHealCustomAction.Serialization.cs | 51 - .../Generated/Models/AutoHealCustomAction.cs | 49 +- .../Models/AutoHealRules.Serialization.cs | 61 - .../src/Generated/Models/AutoHealRules.cs | 56 +- .../Models/AutoHealTriggers.Serialization.cs | 156 - .../src/Generated/Models/AutoHealTriggers.cs | 89 +- .../AzureActiveDirectory.Serialization.cs | 153 - .../Generated/Models/AzureActiveDirectory.cs | 80 +- ...AzureActiveDirectoryLogin.Serialization.cs | 116 - .../Models/AzureActiveDirectoryLogin.cs | 67 +- ...tiveDirectoryRegistration.Serialization.cs | 117 - .../AzureActiveDirectoryRegistration.cs | 86 +- ...ActiveDirectoryValidation.Serialization.cs | 116 - .../Models/AzureActiveDirectoryValidation.cs | 68 +- ...rageApplicationLogsConfig.Serialization.cs | 72 - .../AzureBlobStorageApplicationLogsConfig.cs | 69 +- ...BlobStorageHttpLogsConfig.Serialization.cs | 72 - .../Models/AzureBlobStorageHttpLogsConfig.cs | 69 +- .../Models/AzureResourceType.Serialization.cs | 28 - .../src/Generated/Models/AzureResourceType.cs | 58 +- .../AzureStaticWebApps.Serialization.cs | 105 - .../Generated/Models/AzureStaticWebApps.cs | 36 - ...StaticWebAppsRegistration.Serialization.cs | 84 - .../Models/AzureStaticWebAppsRegistration.cs | 32 - .../AzureStorageInfoValue.Serialization.cs | 100 - .../Generated/Models/AzureStorageInfoValue.cs | 96 +- ...ropertyDictionaryResource.Serialization.cs | 86 - .../AzureStoragePropertyDictionaryResource.cs | 64 +- .../Models/AzureStorageState.Serialization.cs | 32 - .../src/Generated/Models/AzureStorageState.cs | 68 +- .../Models/AzureStorageType.Serialization.cs | 28 - .../src/Generated/Models/AzureStorageType.cs | 58 +- ...rageApplicationLogsConfig.Serialization.cs | 53 - .../AzureTableStorageApplicationLogsConfig.cs | 85 +- .../Models/BackupItem.Serialization.cs | 209 - .../src/Generated/Models/BackupItem.cs | 216 +- .../BackupItemCollection.Serialization.cs | 41 - .../Generated/Models/BackupItemCollection.cs | 44 - .../Models/BackupItemStatus.Serialization.cs | 44 - .../src/Generated/Models/BackupItemStatus.cs | 106 +- .../Models/BackupRequest.Serialization.cs | 154 - .../src/Generated/Models/BackupRequest.cs | 130 +- ...ackupRestoreOperationType.Serialization.cs | 34 - .../Models/BackupRestoreOperationType.cs | 76 +- .../Models/BackupSchedule.Serialization.cs | 89 - .../src/Generated/Models/BackupSchedule.cs | 128 +- .../Models/BillingMeter.Serialization.cs | 155 - .../src/Generated/Models/BillingMeter.cs | 105 +- .../BillingMeterCollection.Serialization.cs | 41 - .../Models/BillingMeterCollection.cs | 44 - .../BlobStorageTokenStore.Serialization.cs | 84 - .../Generated/Models/BlobStorageTokenStore.cs | 52 +- .../src/Generated/Models/BuildStatus.cs | 79 +- ...tInAuthenticationProvider.Serialization.cs | 36 - .../Models/BuiltInAuthenticationProvider.cs | 82 +- .../Models/Capability.Serialization.cs | 62 - .../src/Generated/Models/Capability.cs | 61 +- .../Models/Certificate.Serialization.cs | 326 - .../src/Generated/Models/Certificate.cs | 300 +- .../CertificateCollection.Serialization.cs | 41 - .../Generated/Models/CertificateCollection.cs | 44 - .../CertificateDetails.Serialization.cs | 93 - .../Generated/Models/CertificateDetails.cs | 132 +- .../Models/CertificateEmail.Serialization.cs | 101 - .../src/Generated/Models/CertificateEmail.cs | 69 +- .../CertificateOrderAction.Serialization.cs | 96 - .../Models/CertificateOrderAction.cs | 84 +- ...ertificateOrderActionType.Serialization.cs | 52 - .../Models/CertificateOrderActionType.cs | 130 +- .../CertificateOrderContact.Serialization.cs | 47 - .../Models/CertificateOrderContact.cs | 36 - .../CertificateOrderStatus.Serialization.cs | 44 - .../Models/CertificateOrderStatus.cs | 106 +- .../CertificatePatchResource.Serialization.cs | 291 - .../Models/CertificatePatchResource.cs | 286 +- .../CertificateProductType.Serialization.cs | 28 - .../Models/CertificateProductType.cs | 58 +- .../Models/Channels.Serialization.cs | 34 - .../src/Generated/Models/Channels.cs | 76 +- .../Models/CheckNameResourceTypes.cs | 83 +- .../Models/ClientCertMode.Serialization.cs | 30 - .../src/Generated/Models/ClientCertMode.cs | 63 +- .../ClientRegistration.Serialization.cs | 95 - .../Generated/Models/ClientRegistration.cs | 58 +- .../CloneAbilityResult.Serialization.cs | 30 - .../Generated/Models/CloneAbilityResult.cs | 64 +- .../Models/CloningInfo.Serialization.cs | 190 - .../src/Generated/Models/CloningInfo.cs | 213 +- ...itiesAdditionalproperties.Serialization.cs | 41 - ...rassignedidentitiesAdditionalproperties.cs | 32 - .../ComputeModeOptions.Serialization.cs | 30 - .../Generated/Models/ComputeModeOptions.cs | 64 +- .../Models/ConnStringInfo.Serialization.cs | 67 - .../src/Generated/Models/ConnStringInfo.cs | 66 +- .../ConnStringValueTypePair.Serialization.cs | 45 - .../Models/ConnStringValueTypePair.cs | 81 +- ...onnectionStringDictionary.Serialization.cs | 86 - .../Models/ConnectionStringDictionary.cs | 62 +- .../ConnectionStringType.Serialization.cs | 46 - .../Generated/Models/ConnectionStringType.cs | 112 +- .../Generated/Models/Contact.Serialization.cs | 121 - .../src/Generated/Models/Contact.cs | 169 +- .../ContainerCpuStatistics.Serialization.cs | 93 - .../Models/ContainerCpuStatistics.cs | 54 +- .../Models/ContainerCpuUsage.Serialization.cs | 104 - .../src/Generated/Models/ContainerCpuUsage.cs | 62 +- .../Models/ContainerInfo.Serialization.cs | 148 - .../src/Generated/Models/ContainerInfo.cs | 80 +- ...ContainerMemoryStatistics.Serialization.cs | 77 - .../Models/ContainerMemoryStatistics.cs | 49 +- ...etworkInterfaceStatistics.Serialization.cs | 157 - .../ContainerNetworkInterfaceStatistics.cs | 76 +- .../ContainerThrottlingData.Serialization.cs | 77 - .../Models/ContainerThrottlingData.cs | 49 +- .../Models/ContinuousWebJob.Serialization.cs | 215 - .../src/Generated/Models/ContinuousWebJob.cs | 142 +- ...ontinuousWebJobCollection.Serialization.cs | 41 - .../Models/ContinuousWebJobCollection.cs | 44 - .../ContinuousWebJobStatus.Serialization.cs | 34 - .../Models/ContinuousWebJobStatus.cs | 76 +- .../Models/CookieExpiration.Serialization.cs | 100 - .../src/Generated/Models/CookieExpiration.cs | 62 +- ...ookieExpirationConvention.Serialization.cs | 28 - .../Models/CookieExpirationConvention.cs | 58 +- .../Models/CorsSettings.Serialization.cs | 72 - .../src/Generated/Models/CorsSettings.cs | 73 +- .../CsmMoveResourceEnvelope.Serialization.cs | 36 - .../Models/CsmMoveResourceEnvelope.cs | 82 +- .../CsmOperationCollection.Serialization.cs | 41 - .../Models/CsmOperationCollection.cs | 44 - .../CsmOperationDescription.Serialization.cs | 57 - .../Models/CsmOperationDescription.cs | 70 +- ...tionDescriptionProperties.Serialization.cs | 34 - .../CsmOperationDescriptionProperties.cs | 49 +- .../CsmOperationDisplay.Serialization.cs | 47 - .../Generated/Models/CsmOperationDisplay.cs | 67 +- ...entialsPoliciesCollection.Serialization.cs | 105 - ...PublishingCredentialsPoliciesCollection.cs | 92 +- ...CredentialsPoliciesEntity.Serialization.cs | 89 - .../CsmPublishingCredentialsPoliciesEntity.cs | 75 +- ...mPublishingProfileOptions.Serialization.cs | 31 - .../Models/CsmPublishingProfileOptions.cs | 63 +- .../Models/CsmSlotEntity.Serialization.cs | 25 - .../src/Generated/Models/CsmSlotEntity.cs | 85 +- .../Models/CsmUsageQuota.Serialization.cs | 74 - .../src/Generated/Models/CsmUsageQuota.cs | 94 +- .../CsmUsageQuotaCollection.Serialization.cs | 41 - .../Models/CsmUsageQuotaCollection.cs | 44 - .../Generated/Models/CustomDomainStatus.cs | 63 - ...stomHostNameDnsRecordType.Serialization.cs | 28 - .../Models/CustomHostNameDnsRecordType.cs | 58 +- ...tomHostnameAnalysisResult.Serialization.cs | 265 - .../Models/CustomHostnameAnalysisResult.cs | 198 +- ...stomOpenIdConnectProvider.Serialization.cs | 121 - .../Models/CustomOpenIdConnectProvider.cs | 66 +- .../DataProviderMetadata.Serialization.cs | 57 - .../Generated/Models/DataProviderMetadata.cs | 35 - .../Models/DataSource.Serialization.cs | 82 - .../src/Generated/Models/DataSource.cs | 65 +- .../DataTableResponseColumn.Serialization.cs | 62 - .../Models/DataTableResponseColumn.cs | 62 +- .../DataTableResponseObject.Serialization.cs | 103 - .../Models/DataTableResponseObject.cs | 72 +- .../DatabaseBackupSetting.Serialization.cs | 70 - .../Generated/Models/DatabaseBackupSetting.cs | 102 +- .../src/Generated/Models/DatabaseType.cs | 67 +- .../DefaultErrorResponse.Serialization.cs | 45 - .../Generated/Models/DefaultErrorResponse.cs | 51 +- ...DefaultErrorResponseError.Serialization.cs | 97 - .../Models/DefaultErrorResponseError.cs | 97 +- ...rResponseErrorDetailsItem.Serialization.cs | 62 - .../DefaultErrorResponseErrorDetailsItem.cs | 76 +- .../DeletedAppRestoreRequest.Serialization.cs | 127 - .../Models/DeletedAppRestoreRequest.cs | 95 +- .../Models/DeletedSite.Serialization.cs | 126 - .../src/Generated/Models/DeletedSite.cs | 134 +- .../DeletedWebAppCollection.Serialization.cs | 41 - .../Models/DeletedWebAppCollection.cs | 44 - .../Models/Deployment.Serialization.cs | 193 - .../src/Generated/Models/Deployment.cs | 129 +- .../DeploymentCollection.Serialization.cs | 41 - .../Generated/Models/DeploymentCollection.cs | 44 - .../DeploymentLocations.Serialization.cs | 72 - .../Generated/Models/DeploymentLocations.cs | 77 +- ...etectorAbnormalTimePeriod.Serialization.cs | 179 - .../Models/DetectorAbnormalTimePeriod.cs | 123 +- .../DetectorDefinition.Serialization.cs | 107 - .../Generated/Models/DetectorDefinition.cs | 90 +- .../Models/DetectorInfo.Serialization.cs | 114 - .../src/Generated/Models/DetectorInfo.cs | 107 +- .../Models/DetectorResponse.Serialization.cs | 174 - .../src/Generated/Models/DetectorResponse.cs | 86 +- ...etectorResponseCollection.Serialization.cs | 41 - .../Models/DetectorResponseCollection.cs | 44 - .../Models/DetectorType.Serialization.cs | 30 - .../src/Generated/Models/DetectorType.cs | 20 - .../DiagnosticAnalysis.Serialization.cs | 185 - .../Generated/Models/DiagnosticAnalysis.cs | 110 +- ...gnosticAnalysisCollection.Serialization.cs | 41 - .../Models/DiagnosticAnalysisCollection.cs | 44 - .../DiagnosticCategory.Serialization.cs | 79 - .../Generated/Models/DiagnosticCategory.cs | 60 +- ...gnosticCategoryCollection.Serialization.cs | 41 - .../Models/DiagnosticCategoryCollection.cs | 44 - .../Models/DiagnosticData.Serialization.cs | 61 - .../src/Generated/Models/DiagnosticData.cs | 55 +- ...gnosticDetectorCollection.Serialization.cs | 41 - .../Models/DiagnosticDetectorCollection.cs | 44 - ...iagnosticDetectorResponse.Serialization.cs | 243 - .../Models/DiagnosticDetectorResponse.cs | 135 +- .../DiagnosticMetricSample.Serialization.cs | 121 - .../Models/DiagnosticMetricSample.cs | 109 +- .../DiagnosticMetricSet.Serialization.cs | 122 - .../Generated/Models/DiagnosticMetricSet.cs | 104 +- .../Models/Dimension.Serialization.cs | 52 - .../src/Generated/Models/Dimension.cs | 68 +- .../Generated/Models/DnsType.Serialization.cs | 28 - .../src/Generated/Models/DnsType.cs | 58 +- ...DnsVerificationTestResult.Serialization.cs | 30 - .../Models/DnsVerificationTestResult.cs | 64 +- .../Generated/Models/Domain.Serialization.cs | 390 - .../src/Generated/Models/Domain.cs | 335 +- ...inAvailabilityCheckResult.Serialization.cs | 51 - .../Models/DomainAvailabilityCheckResult.cs | 82 +- .../Models/DomainCollection.Serialization.cs | 41 - .../src/Generated/Models/DomainCollection.cs | 44 - ...inControlCenterSsoRequest.Serialization.cs | 41 - .../Models/DomainControlCenterSsoRequest.cs | 75 +- ...DomainOwnershipIdentifier.Serialization.cs | 84 - .../Models/DomainOwnershipIdentifier.cs | 57 +- ...rshipIdentifierCollection.Serialization.cs | 41 - .../DomainOwnershipIdentifierCollection.cs | 44 - .../DomainPatchResource.Serialization.cs | 355 - .../Generated/Models/DomainPatchResource.cs | 321 +- ...PropertiesDomainNotRenewableReasonsItem.cs | 54 - ...PropertiesDomainNotRenewableReasonsItem.cs | 54 - .../DomainPurchaseConsent.Serialization.cs | 84 - .../Generated/Models/DomainPurchaseConsent.cs | 78 +- ...mendationSearchParameters.Serialization.cs | 31 - .../DomainRecommendationSearchParameters.cs | 59 +- .../Models/DomainStatus.Serialization.cs | 66 - .../src/Generated/Models/DomainStatus.cs | 172 +- .../Models/DomainType.Serialization.cs | 28 - .../src/Generated/Models/DomainType.cs | 58 +- .../Models/EnabledConfig.Serialization.cs | 45 - .../src/Generated/Models/EnabledConfig.cs | 47 +- .../EndpointDependency.Serialization.cs | 46 - .../Generated/Models/EndpointDependency.cs | 68 +- .../Models/EndpointDetail.Serialization.cs | 62 - .../src/Generated/Models/EndpointDetail.cs | 88 +- .../src/Generated/Models/Enum4.cs | 60 - .../src/Generated/Models/Enum5.cs | 54 - .../src/Generated/Models/Enum6.cs | 54 - .../src/Generated/Models/Enum7.cs | 54 - .../src/Generated/Models/Enum8.cs | 54 - .../src/Generated/Models/Enum9.cs | 60 - .../Models/ErrorEntity.Serialization.cs | 80 - .../src/Generated/Models/ErrorEntity.cs | 106 +- .../Models/Experiments.Serialization.cs | 56 - .../src/Generated/Models/Experiments.cs | 53 +- .../Models/Facebook.Serialization.cs | 132 - .../src/Generated/Models/Facebook.cs | 70 +- ...stemApplicationLogsConfig.Serialization.cs | 45 - .../Models/FileSystemApplicationLogsConfig.cs | 49 +- .../FileSystemHttpLogsConfig.Serialization.cs | 77 - .../Models/FileSystemHttpLogsConfig.cs | 92 +- .../FileSystemTokenStore.Serialization.cs | 84 - .../Generated/Models/FileSystemTokenStore.cs | 52 +- .../Models/ForwardProxy.Serialization.cs | 111 - .../src/Generated/Models/ForwardProxy.cs | 68 +- .../ForwardProxyConvention.Serialization.cs | 30 - .../Models/ForwardProxyConvention.cs | 64 +- .../Models/FrequencyUnit.Serialization.cs | 28 - .../src/Generated/Models/FrequencyUnit.cs | 58 +- .../src/Generated/Models/FtpsState.cs | 63 +- .../FunctionAppMajorVersion.Serialization.cs | 52 - .../Models/FunctionAppMajorVersion.cs | 40 - .../FunctionAppMinorVersion.Serialization.cs | 46 - .../Models/FunctionAppMinorVersion.cs | 36 - ...unctionAppRuntimeSettings.Serialization.cs | 184 - .../Models/FunctionAppRuntimeSettings.cs | 86 - .../FunctionAppRuntimes.Serialization.cs | 45 - .../Generated/Models/FunctionAppRuntimes.cs | 32 - .../Models/FunctionAppStack.Serialization.cs | 119 - .../src/Generated/Models/FunctionAppStack.cs | 52 - ...unctionAppStackCollection.Serialization.cs | 41 - .../Models/FunctionAppStackCollection.cs | 44 - .../Models/FunctionEnvelope.Serialization.cs | 243 - .../src/Generated/Models/FunctionEnvelope.cs | 163 +- ...unctionEnvelopeCollection.Serialization.cs | 41 - .../Models/FunctionEnvelopeCollection.cs | 44 - .../Models/FunctionSecrets.Serialization.cs | 35 - .../src/Generated/Models/FunctionSecrets.cs | 59 +- .../Models/GeoRegion.Serialization.cs | 91 - .../src/Generated/Models/GeoRegion.cs | 79 +- .../GeoRegionCollection.Serialization.cs | 41 - .../Generated/Models/GeoRegionCollection.cs | 44 - .../Generated/Models/GitHub.Serialization.cs | 121 - .../src/Generated/Models/GitHub.cs | 64 +- ...ubActionCodeConfiguration.Serialization.cs | 51 - .../Models/GitHubActionCodeConfiguration.cs | 32 - ...GitHubActionConfiguration.Serialization.cs | 93 - .../Models/GitHubActionConfiguration.cs | 40 - ...ionContainerConfiguration.Serialization.cs | 73 - .../GitHubActionContainerConfiguration.cs | 40 - ...ActionWebAppStackSettings.Serialization.cs | 40 - .../Models/GitHubActionWebAppStackSettings.cs | 32 - .../GlobalCsmSkuDescription.Serialization.cs | 91 - .../Models/GlobalCsmSkuDescription.cs | 119 +- .../Models/GlobalValidation.Serialization.cs | 143 - .../src/Generated/Models/GlobalValidation.cs | 87 +- .../Generated/Models/Google.Serialization.cs | 137 - .../src/Generated/Models/Google.cs | 70 +- .../Models/HandlerMapping.Serialization.cs | 62 - .../src/Generated/Models/HandlerMapping.cs | 68 +- .../Models/HostKeys.Serialization.cs | 62 - .../src/Generated/Models/HostKeys.cs | 76 +- .../Models/HostName.Serialization.cs | 85 - .../src/Generated/Models/HostName.cs | 121 +- .../Models/HostNameBinding.Serialization.cs | 187 - .../src/Generated/Models/HostNameBinding.cs | 134 +- ...HostNameBindingCollection.Serialization.cs | 41 - .../Models/HostNameBindingCollection.cs | 44 - .../Models/HostNameSslState.Serialization.cs | 110 - .../src/Generated/Models/HostNameSslState.cs | 95 +- .../Models/HostNameType.Serialization.cs | 28 - .../src/Generated/Models/HostNameType.cs | 58 +- .../Models/HostType.Serialization.cs | 28 - .../src/Generated/Models/HostType.cs | 58 +- ...EnvironmentDeploymentInfo.Serialization.cs | 35 - .../HostingEnvironmentDeploymentInfo.cs | 62 +- ...ingEnvironmentDiagnostics.Serialization.cs | 35 - .../Models/HostingEnvironmentDiagnostics.cs | 61 +- ...HostingEnvironmentProfile.Serialization.cs | 52 - .../Models/HostingEnvironmentProfile.cs | 67 +- .../HostingEnvironmentStatus.Serialization.cs | 32 - .../Models/HostingEnvironmentStatus.cs | 70 +- .../Models/HttpLogsConfig.Serialization.cs | 61 - .../src/Generated/Models/HttpLogsConfig.cs | 68 +- .../Models/HttpSettings.Serialization.cs | 121 - .../src/Generated/Models/HttpSettings.cs | 64 +- .../HttpSettingsRoutes.Serialization.cs | 84 - .../Generated/Models/HttpSettingsRoutes.cs | 52 +- .../Models/HybridConnection.Serialization.cs | 166 - .../src/Generated/Models/HybridConnection.cs | 126 +- ...ybridConnectionCollection.Serialization.cs | 41 - .../Models/HybridConnectionCollection.cs | 44 - .../HybridConnectionKey.Serialization.cs | 85 - .../Generated/Models/HybridConnectionKey.cs | 70 +- .../HybridConnectionLimits.Serialization.cs | 95 - .../Models/HybridConnectionLimits.cs | 72 +- .../Models/Identifier.Serialization.cs | 84 - .../src/Generated/Models/Identifier.cs | 57 +- .../IdentifierCollection.Serialization.cs | 41 - .../Generated/Models/IdentifierCollection.cs | 44 - .../Models/IdentityProviders.Serialization.cs | 229 - .../src/Generated/Models/IdentityProviders.cs | 104 +- .../Models/InAvailabilityReasonType.cs | 59 +- ...nboundEnvironmentEndpoint.Serialization.cs | 62 - .../Models/InboundEnvironmentEndpoint.cs | 83 +- ...ronmentEndpointCollection.Serialization.cs | 41 - .../InboundEnvironmentEndpointCollection.cs | 44 - .../Models/InsightStatus.Serialization.cs | 34 - .../src/Generated/Models/InsightStatus.cs | 24 - .../src/Generated/Models/IpFilterTag.cs | 63 +- .../IpSecurityRestriction.Serialization.cs | 197 - .../Generated/Models/IpSecurityRestriction.cs | 219 +- .../Models/IssueType.Serialization.cs | 40 - .../src/Generated/Models/IssueType.cs | 94 +- .../Models/JwtClaimChecks.Serialization.cs | 126 - .../src/Generated/Models/JwtClaimChecks.cs | 69 +- .../Generated/Models/KeyInfo.Serialization.cs | 51 - .../src/Generated/Models/KeyInfo.cs | 53 +- .../KeyValuePairStringObject.Serialization.cs | 40 - .../Models/KeyValuePairStringObject.cs | 31 - .../KeyVaultSecretStatus.Serialization.cs | 46 - .../Generated/Models/KeyVaultSecretStatus.cs | 112 +- .../KubeEnvironmentProfile.Serialization.cs | 52 - .../Models/KubeEnvironmentProfile.cs | 36 - .../LegacyMicrosoftAccount.Serialization.cs | 137 - .../Models/LegacyMicrosoftAccount.cs | 44 - ...inuxJavaContainerSettings.Serialization.cs | 102 - .../Models/LinuxJavaContainerSettings.cs | 58 - .../src/Generated/Models/LoadBalancingMode.cs | 67 +- .../Models/LocalizableString.Serialization.cs | 35 - .../src/Generated/Models/LocalizableString.cs | 59 +- .../Models/LogLevel.Serialization.cs | 34 - .../src/Generated/Models/LogLevel.cs | 76 +- .../Models/LogSpecification.Serialization.cs | 47 - .../src/Generated/Models/LogSpecification.cs | 67 +- .../Generated/Models/Login.Serialization.cs | 180 - .../src/Generated/Models/Login.cs | 94 +- .../Models/LoginRoutes.Serialization.cs | 84 - .../src/Generated/Models/LoginRoutes.cs | 52 +- .../Models/LoginScopes.Serialization.cs | 100 - .../src/Generated/Models/LoginScopes.cs | 60 +- .../Models/MSDeploy.Serialization.cs | 177 - .../src/Generated/Models/MSDeploy.cs | 143 +- .../Models/MSDeployLog.Serialization.cs | 90 - .../src/Generated/Models/MSDeployLog.cs | 65 +- .../Models/MSDeployLogEntry.Serialization.cs | 52 - .../src/Generated/Models/MSDeployLogEntry.cs | 73 +- .../MSDeployLogEntryType.Serialization.cs | 30 - .../Generated/Models/MSDeployLogEntryType.cs | 64 +- ...MSDeployProvisioningState.Serialization.cs | 34 - .../Models/MSDeployProvisioningState.cs | 76 +- .../Models/MSDeployStatus.Serialization.cs | 124 - .../src/Generated/Models/MSDeployStatus.cs | 105 +- .../ManagedPipelineMode.Serialization.cs | 28 - .../Generated/Models/ManagedPipelineMode.cs | 58 +- .../ManagedServiceIdentity.Serialization.cs | 85 - .../Models/ManagedServiceIdentity.cs | 92 +- ...anagedServiceIdentityType.Serialization.cs | 32 - .../Models/ManagedServiceIdentityType.cs | 70 +- .../MetricAvailability.Serialization.cs | 35 - .../Generated/Models/MetricAvailability.cs | 53 +- .../MetricSpecification.Serialization.cs | 186 - .../Generated/Models/MetricSpecification.cs | 167 +- .../MigrateMySqlRequest.Serialization.cs | 100 - .../Generated/Models/MigrateMySqlRequest.cs | 84 +- .../MigrateMySqlStatus.Serialization.cs | 101 - .../Generated/Models/MigrateMySqlStatus.cs | 84 +- .../MySqlMigrationType.Serialization.cs | 28 - .../Generated/Models/MySqlMigrationType.cs | 58 +- .../Models/NameIdentifier.Serialization.cs | 40 - .../src/Generated/Models/NameIdentifier.cs | 45 +- .../NameIdentifierCollection.Serialization.cs | 41 - .../Models/NameIdentifierCollection.cs | 44 - .../Models/NameValuePair.Serialization.cs | 51 - .../src/Generated/Models/NameValuePair.cs | 53 +- .../Models/NetworkFeatures.Serialization.cs | 123 - .../src/Generated/Models/NetworkFeatures.cs | 100 +- .../Models/NetworkTrace.Serialization.cs | 41 - .../src/Generated/Models/NetworkTrace.cs | 74 +- .../Generated/Models/Nonce.Serialization.cs | 100 - .../src/Generated/Models/Nonce.cs | 58 +- .../Models/NotificationLevel.Serialization.cs | 32 - .../src/Generated/Models/NotificationLevel.cs | 70 +- ...IdConnectClientCredential.Serialization.cs | 95 - .../Models/OpenIdConnectClientCredential.cs | 66 +- .../OpenIdConnectConfig.Serialization.cs | 128 - .../Generated/Models/OpenIdConnectConfig.cs | 76 +- .../OpenIdConnectLogin.Serialization.cs | 111 - .../Generated/Models/OpenIdConnectLogin.cs | 66 +- ...OpenIdConnectRegistration.Serialization.cs | 116 - .../Models/OpenIdConnectRegistration.cs | 64 +- .../Models/Operation.Serialization.cs | 108 - .../src/Generated/Models/Operation.cs | 133 +- .../Models/OperationStatus.Serialization.cs | 34 - .../src/Generated/Models/OperationStatus.cs | 76 +- ...tboundEnvironmentEndpoint.Serialization.cs | 46 - .../Models/OutboundEnvironmentEndpoint.cs | 74 +- ...ronmentEndpointCollection.Serialization.cs | 41 - .../OutboundEnvironmentEndpointCollection.cs | 44 - .../PerfMonCounterCollection.Serialization.cs | 41 - .../Models/PerfMonCounterCollection.cs | 44 - .../Models/PerfMonResponse.Serialization.cs | 46 - .../src/Generated/Models/PerfMonResponse.cs | 69 +- .../Models/PerfMonSample.Serialization.cs | 52 - .../src/Generated/Models/PerfMonSample.cs | 73 +- .../Models/PerfMonSet.Serialization.cs | 75 - .../src/Generated/Models/PerfMonSet.cs | 98 +- .../Models/PremierAddOn.Serialization.cs | 164 - .../src/Generated/Models/PremierAddOn.cs | 118 +- .../Models/PremierAddOnOffer.Serialization.cs | 198 - .../src/Generated/Models/PremierAddOnOffer.cs | 137 +- ...emierAddOnOfferCollection.Serialization.cs | 41 - .../Models/PremierAddOnOfferCollection.cs | 44 - ...PremierAddOnPatchResource.Serialization.cs | 128 - .../Models/PremierAddOnPatchResource.cs | 91 +- .../Models/PrivateAccess.Serialization.cs | 116 - .../src/Generated/Models/PrivateAccess.cs | 76 +- .../PrivateAccessSubnet.Serialization.cs | 56 - .../Generated/Models/PrivateAccessSubnet.cs | 54 +- ...ivateAccessVirtualNetwork.Serialization.cs | 94 - .../Models/PrivateAccessVirtualNetwork.cs | 85 +- ...pointConnectionCollection.Serialization.cs | 41 - .../PrivateEndpointConnectionCollection.cs | 44 - ...onApprovalRequestResource.Serialization.cs | 89 - ...teLinkConnectionApprovalRequestResource.cs | 57 +- ...rivateLinkConnectionState.Serialization.cs | 62 - .../Models/PrivateLinkConnectionState.cs | 63 +- .../PrivateLinkResource.Serialization.cs | 47 - .../Generated/Models/PrivateLinkResource.cs | 115 +- ...ateLinkResourceProperties.Serialization.cs | 62 - .../Models/PrivateLinkResourceProperties.cs | 80 +- ...ivateLinkResourcesWrapper.Serialization.cs | 35 - .../Models/PrivateLinkResourcesWrapper.cs | 86 +- .../Models/ProcessInfo.Serialization.cs | 642 - .../src/Generated/Models/ProcessInfo.cs | 367 +- .../ProcessInfoCollection.Serialization.cs | 41 - .../Generated/Models/ProcessInfoCollection.cs | 44 - .../Models/ProcessModuleInfo.Serialization.cs | 204 - .../src/Generated/Models/ProcessModuleInfo.cs | 139 +- ...ocessModuleInfoCollection.Serialization.cs | 41 - .../Models/ProcessModuleInfoCollection.cs | 44 - .../Models/ProcessThreadInfo.Serialization.cs | 221 - .../src/Generated/Models/ProcessThreadInfo.cs | 151 +- ...ocessThreadInfoCollection.Serialization.cs | 41 - .../Models/ProcessThreadInfoCollection.cs | 44 - .../Models/ProvisioningState.Serialization.cs | 34 - .../src/Generated/Models/ProvisioningState.cs | 76 +- .../Models/ProxyOnlyResource.Serialization.cs | 58 - .../src/Generated/Models/ProxyOnlyResource.cs | 80 +- .../Models/PublicCertificate.Serialization.cs | 112 - .../src/Generated/Models/PublicCertificate.cs | 80 +- ...blicCertificateCollection.Serialization.cs | 41 - .../Models/PublicCertificateCollection.cs | 44 - ...PublicCertificateLocation.Serialization.cs | 30 - .../Models/PublicCertificateLocation.cs | 64 +- .../Models/PublishingProfileFormat.cs | 64 +- .../Models/PushSettings.Serialization.cs | 122 - .../src/Generated/Models/PushSettings.cs | 111 +- .../QueryUtterancesResult.Serialization.cs | 61 - .../Generated/Models/QueryUtterancesResult.cs | 32 - .../QueryUtterancesResults.Serialization.cs | 67 - .../Models/QueryUtterancesResults.cs | 36 - .../Models/RampUpRule.Serialization.cs | 142 - .../src/Generated/Models/RampUpRule.cs | 152 +- .../Models/Recommendation.Serialization.cs | 413 - .../src/Generated/Models/Recommendation.cs | 304 +- .../RecommendationCollection.Serialization.cs | 41 - .../Models/RecommendationCollection.cs | 44 - .../RecommendationRule.Serialization.cs | 243 - .../Generated/Models/RecommendationRule.cs | 193 +- .../Models/RedundancyMode.Serialization.cs | 34 - .../src/Generated/Models/RedundancyMode.cs | 76 +- ...ueCertificateOrderRequest.Serialization.cs | 132 - .../Models/ReissueCertificateOrderRequest.cs | 88 +- ...ayServiceConnectionEntity.Serialization.cs | 155 - .../Models/RelayServiceConnectionEntity.cs | 86 +- ...PrivateEndpointConnection.Serialization.cs | 138 - .../Models/RemotePrivateEndpointConnection.cs | 47 - ...ointConnectionARMResource.Serialization.cs | 138 - ...otePrivateEndpointConnectionARMResource.cs | 47 - .../Models/Rendering.Serialization.cs | 67 - .../src/Generated/Models/Rendering.cs | 65 +- .../Models/RenderingType.Serialization.cs | 74 - .../src/Generated/Models/RenderingType.cs | 114 +- ...ewCertificateOrderRequest.Serialization.cs | 116 - .../Models/RenewCertificateOrderRequest.cs | 78 +- .../RequestsBasedTrigger.Serialization.cs | 56 - .../Generated/Models/RequestsBasedTrigger.cs | 53 +- .../Models/ResolveStatus.Serialization.cs | 46 - .../src/Generated/Models/ResolveStatus.cs | 36 - .../Models/Resource.Serialization.cs | 94 - .../src/Generated/Models/Resource.cs | 127 +- .../ResourceCollection.Serialization.cs | 41 - .../Generated/Models/ResourceCollection.cs | 44 - .../ResourceHealthMetadata.Serialization.cs | 100 - .../Models/ResourceHealthMetadata.cs | 68 +- ...eHealthMetadataCollection.Serialization.cs | 41 - .../ResourceHealthMetadataCollection.cs | 44 - ...esourceMetricAvailability.Serialization.cs | 35 - .../Models/ResourceMetricAvailability.cs | 60 +- .../ResourceMetricDefinition.Serialization.cs | 124 - .../Models/ResourceMetricDefinition.cs | 110 +- ...etricDefinitionCollection.Serialization.cs | 41 - .../ResourceMetricDefinitionCollection.cs | 44 - .../ResourceNameAvailability.Serialization.cs | 51 - .../Models/ResourceNameAvailability.cs | 91 +- ...ceNameAvailabilityRequest.Serialization.cs | 30 - .../Models/ResourceNameAvailabilityRequest.cs | 104 +- .../src/Generated/Models/ResourceScopeType.cs | 63 +- ...PrivateEndpointConnection.Serialization.cs | 141 - ...EnvelopeRemotePrivateEndpointConnection.cs | 85 - .../Models/ResponseMetaData.Serialization.cs | 45 - .../src/Generated/Models/ResponseMetaData.cs | 42 +- .../Models/RestoreRequest.Serialization.cs | 235 - .../src/Generated/Models/RestoreRequest.cs | 206 +- .../src/Generated/Models/RouteType.cs | 66 +- .../Models/SampleUtterance.Serialization.cs | 78 - .../src/Generated/Models/SampleUtterance.cs | 40 - .../src/Generated/Models/ScmType.cs | 107 +- .../ServiceSpecification.Serialization.cs | 56 - .../Generated/Models/ServiceSpecification.cs | 61 +- .../Generated/Models/Site.Serialization.cs | 657 - .../src/Generated/Models/Site.cs | 579 +- .../Models/SiteAuthSettings.Serialization.cs | 627 - .../src/Generated/Models/SiteAuthSettings.cs | 682 +- .../SiteAuthSettingsV2.Serialization.cs | 153 - .../Generated/Models/SiteAuthSettingsV2.cs | 76 +- .../SiteAvailabilityState.Serialization.cs | 30 - .../Generated/Models/SiteAvailabilityState.cs | 64 +- .../Models/SiteCloneability.Serialization.cs | 83 - .../src/Generated/Models/SiteCloneability.cs | 97 +- ...SiteCloneabilityCriterion.Serialization.cs | 35 - .../Models/SiteCloneabilityCriterion.cs | 59 +- .../Models/SiteConfig.Serialization.cs | 1042 - .../src/Generated/Models/SiteConfig.cs | 664 +- ...onfigPropertiesDictionary.Serialization.cs | 52 - .../Models/SiteConfigPropertiesDictionary.cs | 40 - .../SiteConfigResource.Serialization.cs | 1086 - .../Generated/Models/SiteConfigResource.cs | 675 +- ...eConfigResourceCollection.Serialization.cs | 41 - .../Models/SiteConfigResourceCollection.cs | 44 - ...ConfigurationSnapshotInfo.Serialization.cs | 96 - .../Models/SiteConfigurationSnapshotInfo.cs | 73 +- ...ionSnapshotInfoCollection.Serialization.cs | 41 - ...SiteConfigurationSnapshotInfoCollection.cs | 44 - .../Models/SiteExtensionInfo.Serialization.cs | 335 - .../src/Generated/Models/SiteExtensionInfo.cs | 226 +- ...teExtensionInfoCollection.Serialization.cs | 41 - .../Models/SiteExtensionInfoCollection.cs | 44 - .../Models/SiteExtensionType.Serialization.cs | 28 - .../src/Generated/Models/SiteExtensionType.cs | 58 +- .../Models/SiteLimits.Serialization.cs | 77 - .../src/Generated/Models/SiteLimits.cs | 64 +- .../Models/SiteLoadBalancing.Serialization.cs | 36 - .../src/Generated/Models/SiteLoadBalancing.cs | 80 +- .../Models/SiteLogsConfig.Serialization.cs | 137 - .../src/Generated/Models/SiteLogsConfig.cs | 101 +- .../Models/SiteMachineKey.Serialization.cs | 47 - .../src/Generated/Models/SiteMachineKey.cs | 79 +- .../Models/SitePatchResource.Serialization.cs | 622 - .../src/Generated/Models/SitePatchResource.cs | 565 +- .../SitePhpErrorLogFlag.Serialization.cs | 117 - .../Generated/Models/SitePhpErrorLogFlag.cs | 83 +- .../Models/SiteRuntimeState.Serialization.cs | 30 - .../src/Generated/Models/SiteRuntimeState.cs | 70 +- .../Models/SiteSeal.Serialization.cs | 29 - .../src/Generated/Models/SiteSeal.cs | 70 +- .../Models/SiteSealRequest.Serialization.cs | 31 - .../src/Generated/Models/SiteSealRequest.cs | 58 +- .../Models/SiteSourceControl.Serialization.cs | 175 - .../src/Generated/Models/SiteSourceControl.cs | 120 +- .../Models/SkuCapacity.Serialization.cs | 104 - .../src/Generated/Models/SkuCapacity.cs | 85 +- .../Models/SkuDescription.Serialization.cs | 158 - .../src/Generated/Models/SkuDescription.cs | 116 +- .../Generated/Models/SkuInfo.Serialization.cs | 51 - .../src/Generated/Models/SkuInfo.cs | 71 +- .../Models/SkuInfoCollection.Serialization.cs | 41 - .../src/Generated/Models/SkuInfoCollection.cs | 44 - .../Models/SkuInfos.Serialization.cs | 46 - .../src/Generated/Models/SkuInfos.cs | 67 +- .../src/Generated/Models/SkuName.cs | 100 +- .../SlotConfigNamesResource.Serialization.cs | 152 - .../Models/SlotConfigNamesResource.cs | 90 +- .../Models/SlotDifference.Serialization.cs | 115 - .../src/Generated/Models/SlotDifference.cs | 127 +- .../SlotDifferenceCollection.Serialization.cs | 41 - .../Models/SlotDifferenceCollection.cs | 44 - .../Models/SlotSwapStatus.Serialization.cs | 47 - .../src/Generated/Models/SlotSwapStatus.cs | 74 +- .../SlowRequestsBasedTrigger.Serialization.cs | 78 - .../Models/SlowRequestsBasedTrigger.cs | 65 +- .../Models/Snapshot.Serialization.cs | 79 - .../src/Generated/Models/Snapshot.cs | 59 +- .../SnapshotCollection.Serialization.cs | 41 - .../Generated/Models/SnapshotCollection.cs | 44 - .../SnapshotRecoverySource.Serialization.cs | 51 - .../Models/SnapshotRecoverySource.cs | 67 +- .../SnapshotRestoreRequest.Serialization.cs | 164 - .../Models/SnapshotRestoreRequest.cs | 130 +- .../Models/Solution.Serialization.cs | 172 - .../src/Generated/Models/Solution.cs | 106 +- .../Models/SolutionType.Serialization.cs | 30 - .../src/Generated/Models/SolutionType.cs | 64 +- .../Models/SourceControl.Serialization.cs | 123 - .../src/Generated/Models/SourceControl.cs | 85 +- .../SourceControlCollection.Serialization.cs | 41 - .../Models/SourceControlCollection.cs | 44 - .../Models/SslState.Serialization.cs | 30 - .../src/Generated/Models/SslState.cs | 64 +- .../Models/StackMajorVersion.Serialization.cs | 212 - .../src/Generated/Models/StackMajorVersion.cs | 157 +- .../Models/StackMinorVersion.Serialization.cs | 83 - .../src/Generated/Models/StackMinorVersion.cs | 80 +- .../Models/StackPreferredOs.Serialization.cs | 28 - .../src/Generated/Models/StackPreferredOs.cs | 18 - .../StagingEnvironmentPolicy.Serialization.cs | 28 - .../Models/StagingEnvironmentPolicy.cs | 18 - .../Models/StampCapacity.Serialization.cs | 129 - .../src/Generated/Models/StampCapacity.cs | 172 +- .../StampCapacityCollection.Serialization.cs | 41 - .../Models/StampCapacityCollection.cs | 44 - .../StaticSiteARMResource.Serialization.cs | 310 - .../Generated/Models/StaticSiteARMResource.cs | 186 +- ...taticSiteBuildARMResource.Serialization.cs | 148 - .../Models/StaticSiteBuildARMResource.cs | 136 +- ...StaticSiteBuildCollection.Serialization.cs | 41 - .../Models/StaticSiteBuildCollection.cs | 44 - ...StaticSiteBuildProperties.Serialization.cs | 122 - .../Models/StaticSiteBuildProperties.cs | 84 +- .../StaticSiteCollection.Serialization.cs | 41 - .../Generated/Models/StaticSiteCollection.cs | 44 - ...DomainOverviewARMResource.Serialization.cs | 114 - ...aticSiteCustomDomainOverviewARMResource.cs | 87 +- ...mDomainOverviewCollection.Serialization.cs | 41 - ...taticSiteCustomDomainOverviewCollection.cs | 44 - ...uestPropertiesARMResource.Serialization.cs | 84 - ...ustomDomainRequestPropertiesARMResource.cs | 32 - ...nctionOverviewARMResource.Serialization.cs | 90 - .../StaticSiteFunctionOverviewARMResource.cs | 73 +- ...unctionOverviewCollection.Serialization.cs | 41 - .../StaticSiteFunctionOverviewCollection.cs | 44 - .../StaticSitePatchResource.Serialization.cs | 243 - .../Models/StaticSitePatchResource.cs | 148 +- ...esetPropertiesARMResource.Serialization.cs | 100 - .../StaticSiteResetPropertiesARMResource.cs | 71 +- ...StaticSiteTemplateOptions.Serialization.cs | 89 - .../Models/StaticSiteTemplateOptions.cs | 44 - ...StaticSiteUserARMResource.Serialization.cs | 102 - .../Models/StaticSiteUserARMResource.cs | 91 +- .../StaticSiteUserCollection.Serialization.cs | 41 - .../Models/StaticSiteUserCollection.cs | 44 - ...InvitationRequestResource.Serialization.cs | 133 - ...StaticSiteUserInvitationRequestResource.cs | 97 +- ...nvitationResponseResource.Serialization.cs | 91 - ...taticSiteUserInvitationResponseResource.cs | 74 +- ...teUserProvidedFunctionApp.Serialization.cs | 107 - .../StaticSiteUserProvidedFunctionApp.cs | 42 - ...dedFunctionAppARMResource.Serialization.cs | 107 - ...cSiteUserProvidedFunctionAppARMResource.cs | 42 - ...dedFunctionAppsCollection.Serialization.cs | 41 - ...cSiteUserProvidedFunctionAppsCollection.cs | 44 - ...eZipDeploymentARMResource.Serialization.cs | 128 - .../StaticSiteZipDeploymentARMResource.cs | 48 - ...taticSitesWorkflowPreview.Serialization.cs | 85 - .../Models/StaticSitesWorkflowPreview.cs | 36 - ...tesWorkflowPreviewRequest.Serialization.cs | 111 - .../StaticSitesWorkflowPreviewRequest.cs | 40 - .../Generated/Models/Status.Serialization.cs | 56 - .../src/Generated/Models/Status.cs | 32 - .../StatusCodesBasedTrigger.Serialization.cs | 115 - .../Models/StatusCodesBasedTrigger.cs | 81 +- ...tusCodesRangeBasedTrigger.Serialization.cs | 78 - .../Models/StatusCodesRangeBasedTrigger.cs | 39 - .../Models/StatusOptions.Serialization.cs | 30 - .../src/Generated/Models/StatusOptions.cs | 64 +- .../StorageMigrationOptions.Serialization.cs | 127 - .../Models/StorageMigrationOptions.cs | 108 +- .../StorageMigrationResponse.Serialization.cs | 79 - .../Models/StorageMigrationResponse.cs | 62 +- .../Models/StringDictionary.Serialization.cs | 86 - .../src/Generated/Models/StringDictionary.cs | 62 +- .../Models/StringList.Serialization.cs | 85 - .../src/Generated/Models/StringList.cs | 36 - .../Models/SupportTopic.Serialization.cs | 35 - .../src/Generated/Models/SupportTopic.cs | 32 - .../Generated/Models/SupportedTlsVersions.cs | 63 +- .../SwiftVirtualNetwork.Serialization.cs | 100 - .../Generated/Models/SwiftVirtualNetwork.cs | 73 +- .../Models/TldLegalAgreement.Serialization.cs | 47 - .../src/Generated/Models/TldLegalAgreement.cs | 125 +- ...dLegalAgreementCollection.Serialization.cs | 41 - .../Models/TldLegalAgreementCollection.cs | 44 - .../Models/TokenStore.Serialization.cs | 137 - .../src/Generated/Models/TokenStore.cs | 74 +- .../Models/TopLevelDomain.Serialization.cs | 89 - .../src/Generated/Models/TopLevelDomain.cs | 61 +- ...evelDomainAgreementOption.Serialization.cs | 31 - .../Models/TopLevelDomainAgreementOption.cs | 64 +- .../TopLevelDomainCollection.Serialization.cs | 41 - .../Models/TopLevelDomainCollection.cs | 44 - .../src/Generated/Models/TriggerTypes.cs | 59 +- .../TriggeredJobHistory.Serialization.cs | 100 - .../Generated/Models/TriggeredJobHistory.cs | 66 +- ...geredJobHistoryCollection.Serialization.cs | 41 - .../Models/TriggeredJobHistoryCollection.cs | 44 - .../Models/TriggeredJobRun.Serialization.cs | 210 - .../src/Generated/Models/TriggeredJobRun.cs | 145 +- .../Models/TriggeredWebJob.Serialization.cs | 215 - .../src/Generated/Models/TriggeredWebJob.cs | 139 +- ...TriggeredWebJobCollection.Serialization.cs | 41 - .../Models/TriggeredWebJobCollection.cs | 44 - .../TriggeredWebJobStatus.Serialization.cs | 30 - .../Generated/Models/TriggeredWebJobStatus.cs | 64 +- .../Generated/Models/Twitter.Serialization.cs | 105 - .../src/Generated/Models/Twitter.cs | 58 +- .../TwitterRegistration.Serialization.cs | 95 - .../Generated/Models/TwitterRegistration.cs | 64 +- ...authenticatedClientAction.Serialization.cs | 28 - .../Models/UnauthenticatedClientAction.cs | 58 +- ...thenticatedClientActionV2.Serialization.cs | 32 - .../Models/UnauthenticatedClientActionV2.cs | 70 +- .../Generated/Models/Usage.Serialization.cs | 142 - .../src/Generated/Models/Usage.cs | 136 +- .../Models/UsageCollection.Serialization.cs | 41 - .../src/Generated/Models/UsageCollection.cs | 44 - .../Models/UsageState.Serialization.cs | 28 - .../src/Generated/Models/UsageState.cs | 58 +- .../Generated/Models/User.Serialization.cs | 128 - .../src/Generated/Models/User.cs | 106 +- .../Models/ValidateRequest.Serialization.cs | 100 - .../src/Generated/Models/ValidateRequest.cs | 238 +- .../Generated/Models/ValidateResourceTypes.cs | 62 +- .../Models/ValidateResponse.Serialization.cs | 40 - .../src/Generated/Models/ValidateResponse.cs | 60 +- .../ValidateResponseError.Serialization.cs | 35 - .../Generated/Models/ValidateResponseError.cs | 59 +- .../VirtualApplication.Serialization.cs | 94 - .../Generated/Models/VirtualApplication.cs | 82 +- .../Models/VirtualDirectory.Serialization.cs | 51 - .../src/Generated/Models/VirtualDirectory.cs | 53 +- .../Models/VirtualIPMapping.Serialization.cs | 99 - .../src/Generated/Models/VirtualIPMapping.cs | 78 +- .../VirtualNetworkProfile.Serialization.cs | 60 - .../Generated/Models/VirtualNetworkProfile.cs | 86 +- .../Models/VnetGateway.Serialization.cs | 95 - .../src/Generated/Models/VnetGateway.cs | 80 +- .../Models/VnetInfo.Serialization.cs | 156 - .../src/Generated/Models/VnetInfo.cs | 132 +- .../Models/VnetParameters.Serialization.cs | 117 - .../src/Generated/Models/VnetParameters.cs | 79 +- .../Models/VnetRoute.Serialization.cs | 111 - .../src/Generated/Models/VnetRoute.cs | 101 +- ...tValidationFailureDetails.Serialization.cs | 153 - .../Models/VnetValidationFailureDetails.cs | 86 +- ...VnetValidationTestFailure.Serialization.cs | 95 - .../Models/VnetValidationTestFailure.cs | 68 +- .../Models/WebAppCollection.Serialization.cs | 41 - .../src/Generated/Models/WebAppCollection.cs | 44 - ...pInstanceStatusCollection.Serialization.cs | 41 - .../Models/WebAppInstanceStatusCollection.cs | 44 - .../WebAppMajorVersion.Serialization.cs | 52 - .../Generated/Models/WebAppMajorVersion.cs | 40 - .../WebAppMinorVersion.Serialization.cs | 46 - .../Generated/Models/WebAppMinorVersion.cs | 36 - .../WebAppRuntimeSettings.Serialization.cs | 129 - .../Generated/Models/WebAppRuntimeSettings.cs | 66 - .../Models/WebAppRuntimes.Serialization.cs | 67 - .../src/Generated/Models/WebAppRuntimes.cs | 40 - .../Models/WebAppStack.Serialization.cs | 119 - .../src/Generated/Models/WebAppStack.cs | 52 - .../WebAppStackCollection.Serialization.cs | 41 - .../Generated/Models/WebAppStackCollection.cs | 44 - .../Generated/Models/WebJob.Serialization.cs | 177 - .../src/Generated/Models/WebJob.cs | 115 +- .../Models/WebJobCollection.Serialization.cs | 41 - .../src/Generated/Models/WebJobCollection.cs | 44 - .../Models/WebJobType.Serialization.cs | 28 - .../src/Generated/Models/WebJobType.cs | 58 +- .../WebSiteInstanceStatus.Serialization.cs | 161 - .../Generated/Models/WebSiteInstanceStatus.cs | 103 +- ...dowsJavaContainerSettings.Serialization.cs | 102 - .../Models/WindowsJavaContainerSettings.cs | 58 - .../WorkerPoolCollection.Serialization.cs | 41 - .../Generated/Models/WorkerPoolCollection.cs | 44 - .../WorkerPoolResource.Serialization.cs | 165 - .../Generated/Models/WorkerPoolResource.cs | 113 +- .../Models/WorkerSizeOptions.Serialization.cs | 48 - .../src/Generated/Models/WorkerSizeOptions.cs | 102 +- .../src/Generated/ProviderRestClient.cs | 1002 - .../Generated/RecommendationsRestClient.cs | 1763 - .../ResourceHealthMetadataRestClient.cs | 869 - .../src/Generated/StaticSitesRestClient.cs | 5359 -- .../Generated/TopLevelDomainsRestClient.cs | 420 - .../src/Generated/WebAppsRestClient.cs | 44343 ---------------- .../Generated/WebSiteManagementRestClient.cs | 1609 - ...Microsoft.Azure.Management.Websites.csproj | 43 +- src/SDKs/_metadata/web_resource-manager.txt | 11 - 948 files changed, 25970 insertions(+), 133357 deletions(-) delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceCertificateOrdersRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServicePlansRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateRegistrationProviderRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DeletedWebAppsRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DiagnosticsRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainRegistrationProviderRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPropertiesDomainNotRenewableReasonsItem.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum4.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum5.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum6.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum7.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum8.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum9.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.Serialization.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/RecommendationsRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ResourceHealthMetadataRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/TopLevelDomainsRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsRestClient.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementRestClient.cs delete mode 100644 src/SDKs/_metadata/web_resource-manager.txt diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceCertificateOrdersRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceCertificateOrdersRestClient.cs deleted file mode 100644 index 1c32c7ba3c6f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceCertificateOrdersRestClient.cs +++ /dev/null @@ -1,1999 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class AppServiceCertificateOrdersRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of AppServiceCertificateOrdersRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public AppServiceCertificateOrdersRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all certificate orders in a subscription. - /// The cancellation token to use. - public async Task> ListAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateOrderCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all certificate orders in a subscription. - /// The cancellation token to use. - public Response List(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateOrderCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateValidatePurchaseInformationRequest(AppServiceCertificateOrder appServiceCertificateOrder) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(appServiceCertificateOrder); - request.Content = content; - return message; - } - - /// Description for Validate information for a certificate order. - /// Information for a certificate order. - /// The cancellation token to use. - /// is null. - public async Task ValidatePurchaseInformationAsync(AppServiceCertificateOrder appServiceCertificateOrder, CancellationToken cancellationToken = default) - { - if (appServiceCertificateOrder == null) - { - throw new ArgumentNullException(nameof(appServiceCertificateOrder)); - } - - using var message = CreateValidatePurchaseInformationRequest(appServiceCertificateOrder); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Validate information for a certificate order. - /// Information for a certificate order. - /// The cancellation token to use. - /// is null. - public Response ValidatePurchaseInformation(AppServiceCertificateOrder appServiceCertificateOrder, CancellationToken cancellationToken = default) - { - if (appServiceCertificateOrder == null) - { - throw new ArgumentNullException(nameof(appServiceCertificateOrder)); - } - - using var message = CreateValidatePurchaseInformationRequest(appServiceCertificateOrder); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get certificate orders in a resource group. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateOrderCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get certificate orders in a resource group. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateOrderCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string resourceGroupName, string certificateOrderName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order.. - /// The cancellation token to use. - /// or is null. - public async Task> GetAsync(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateGetRequest(resourceGroupName, certificateOrderName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateOrder value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceCertificateOrder.DeserializeAppServiceCertificateOrder(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order.. - /// The cancellation token to use. - /// or is null. - public Response Get(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateGetRequest(resourceGroupName, certificateOrderName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateOrder value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceCertificateOrder.DeserializeAppServiceCertificateOrder(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string certificateOrderName, AppServiceCertificateOrder certificateDistinguishedName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(certificateDistinguishedName); - request.Content = content; - return message; - } - - /// Description for Create or update a certificate purchase order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Distinguished name to use for the certificate order. - /// The cancellation token to use. - /// , , or is null. - public async Task CreateOrUpdateAsync(string resourceGroupName, string certificateOrderName, AppServiceCertificateOrder certificateDistinguishedName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (certificateDistinguishedName == null) - { - throw new ArgumentNullException(nameof(certificateDistinguishedName)); - } - - using var message = CreateCreateOrUpdateRequest(resourceGroupName, certificateOrderName, certificateDistinguishedName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create or update a certificate purchase order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Distinguished name to use for the certificate order. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdate(string resourceGroupName, string certificateOrderName, AppServiceCertificateOrder certificateDistinguishedName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (certificateDistinguishedName == null) - { - throw new ArgumentNullException(nameof(certificateDistinguishedName)); - } - - using var message = CreateCreateOrUpdateRequest(resourceGroupName, certificateOrderName, certificateDistinguishedName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string resourceGroupName, string certificateOrderName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete an existing certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// or is null. - public async Task DeleteAsync(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateDeleteRequest(resourceGroupName, certificateOrderName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete an existing certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// or is null. - public Response Delete(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateDeleteRequest(resourceGroupName, certificateOrderName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string resourceGroupName, string certificateOrderName, AppServiceCertificateOrderPatchResource certificateDistinguishedName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(certificateDistinguishedName); - request.Content = content; - return message; - } - - /// Description for Create or update a certificate purchase order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Distinguished name to use for the certificate order. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateAsync(string resourceGroupName, string certificateOrderName, AppServiceCertificateOrderPatchResource certificateDistinguishedName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (certificateDistinguishedName == null) - { - throw new ArgumentNullException(nameof(certificateDistinguishedName)); - } - - using var message = CreateUpdateRequest(resourceGroupName, certificateOrderName, certificateDistinguishedName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - AppServiceCertificateOrder value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceCertificateOrder.DeserializeAppServiceCertificateOrder(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create or update a certificate purchase order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Distinguished name to use for the certificate order. - /// The cancellation token to use. - /// , , or is null. - public Response Update(string resourceGroupName, string certificateOrderName, AppServiceCertificateOrderPatchResource certificateDistinguishedName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (certificateDistinguishedName == null) - { - throw new ArgumentNullException(nameof(certificateDistinguishedName)); - } - - using var message = CreateUpdateRequest(resourceGroupName, certificateOrderName, certificateDistinguishedName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - AppServiceCertificateOrder value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceCertificateOrder.DeserializeAppServiceCertificateOrder(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListCertificatesRequest(string resourceGroupName, string certificateOrderName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/certificates", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all certificates associated with a certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// or is null. - public async Task> ListCertificatesAsync(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateListCertificatesRequest(resourceGroupName, certificateOrderName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceCertificateCollection.DeserializeAppServiceCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all certificates associated with a certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// or is null. - public Response ListCertificates(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateListCertificatesRequest(resourceGroupName, certificateOrderName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceCertificateCollection.DeserializeAppServiceCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetCertificateRequest(string resourceGroupName, string certificateOrderName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/certificates/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the certificate associated with a certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Name of the certificate. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetCertificateAsync(string resourceGroupName, string certificateOrderName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetCertificateRequest(resourceGroupName, certificateOrderName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceCertificateResource.DeserializeAppServiceCertificateResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the certificate associated with a certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Name of the certificate. - /// The cancellation token to use. - /// , , or is null. - public Response GetCertificate(string resourceGroupName, string certificateOrderName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetCertificateRequest(resourceGroupName, certificateOrderName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceCertificateResource.DeserializeAppServiceCertificateResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateCertificateRequest(string resourceGroupName, string certificateOrderName, string name, AppServiceCertificateResource keyVaultCertificate) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/certificates/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(keyVaultCertificate); - request.Content = content; - return message; - } - - /// Description for Creates or updates a certificate and associates with key vault secret. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Name of the certificate. - /// Key vault certificate resource Id. - /// The cancellation token to use. - /// , , , or is null. - public async Task CreateOrUpdateCertificateAsync(string resourceGroupName, string certificateOrderName, string name, AppServiceCertificateResource keyVaultCertificate, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (keyVaultCertificate == null) - { - throw new ArgumentNullException(nameof(keyVaultCertificate)); - } - - using var message = CreateCreateOrUpdateCertificateRequest(resourceGroupName, certificateOrderName, name, keyVaultCertificate); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates or updates a certificate and associates with key vault secret. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Name of the certificate. - /// Key vault certificate resource Id. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateCertificate(string resourceGroupName, string certificateOrderName, string name, AppServiceCertificateResource keyVaultCertificate, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (keyVaultCertificate == null) - { - throw new ArgumentNullException(nameof(keyVaultCertificate)); - } - - using var message = CreateCreateOrUpdateCertificateRequest(resourceGroupName, certificateOrderName, name, keyVaultCertificate); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteCertificateRequest(string resourceGroupName, string certificateOrderName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/certificates/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete the certificate associated with a certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Name of the certificate. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteCertificateAsync(string resourceGroupName, string certificateOrderName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteCertificateRequest(resourceGroupName, certificateOrderName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete the certificate associated with a certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Name of the certificate. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteCertificate(string resourceGroupName, string certificateOrderName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteCertificateRequest(resourceGroupName, certificateOrderName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateCertificateRequest(string resourceGroupName, string certificateOrderName, string name, AppServiceCertificatePatchResource keyVaultCertificate) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/certificates/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(keyVaultCertificate); - request.Content = content; - return message; - } - - /// Description for Creates or updates a certificate and associates with key vault secret. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Name of the certificate. - /// Key vault certificate resource Id. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateCertificateAsync(string resourceGroupName, string certificateOrderName, string name, AppServiceCertificatePatchResource keyVaultCertificate, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (keyVaultCertificate == null) - { - throw new ArgumentNullException(nameof(keyVaultCertificate)); - } - - using var message = CreateUpdateCertificateRequest(resourceGroupName, certificateOrderName, name, keyVaultCertificate); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - AppServiceCertificateResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceCertificateResource.DeserializeAppServiceCertificateResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates or updates a certificate and associates with key vault secret. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Name of the certificate. - /// Key vault certificate resource Id. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateCertificate(string resourceGroupName, string certificateOrderName, string name, AppServiceCertificatePatchResource keyVaultCertificate, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (keyVaultCertificate == null) - { - throw new ArgumentNullException(nameof(keyVaultCertificate)); - } - - using var message = CreateUpdateCertificateRequest(resourceGroupName, certificateOrderName, name, keyVaultCertificate); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - AppServiceCertificateResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceCertificateResource.DeserializeAppServiceCertificateResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateReissueRequest(string resourceGroupName, string certificateOrderName, ReissueCertificateOrderRequest reissueCertificateOrderRequest) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/reissue", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(reissueCertificateOrderRequest); - request.Content = content; - return message; - } - - /// Description for Reissue an existing certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Parameters for the reissue. - /// The cancellation token to use. - /// , , or is null. - public async Task ReissueAsync(string resourceGroupName, string certificateOrderName, ReissueCertificateOrderRequest reissueCertificateOrderRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (reissueCertificateOrderRequest == null) - { - throw new ArgumentNullException(nameof(reissueCertificateOrderRequest)); - } - - using var message = CreateReissueRequest(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Reissue an existing certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Parameters for the reissue. - /// The cancellation token to use. - /// , , or is null. - public Response Reissue(string resourceGroupName, string certificateOrderName, ReissueCertificateOrderRequest reissueCertificateOrderRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (reissueCertificateOrderRequest == null) - { - throw new ArgumentNullException(nameof(reissueCertificateOrderRequest)); - } - - using var message = CreateReissueRequest(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRenewRequest(string resourceGroupName, string certificateOrderName, RenewCertificateOrderRequest renewCertificateOrderRequest) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/renew", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(renewCertificateOrderRequest); - request.Content = content; - return message; - } - - /// Description for Renew an existing certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Renew parameters. - /// The cancellation token to use. - /// , , or is null. - public async Task RenewAsync(string resourceGroupName, string certificateOrderName, RenewCertificateOrderRequest renewCertificateOrderRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (renewCertificateOrderRequest == null) - { - throw new ArgumentNullException(nameof(renewCertificateOrderRequest)); - } - - using var message = CreateRenewRequest(resourceGroupName, certificateOrderName, renewCertificateOrderRequest); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Renew an existing certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Renew parameters. - /// The cancellation token to use. - /// , , or is null. - public Response Renew(string resourceGroupName, string certificateOrderName, RenewCertificateOrderRequest renewCertificateOrderRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (renewCertificateOrderRequest == null) - { - throw new ArgumentNullException(nameof(renewCertificateOrderRequest)); - } - - using var message = CreateRenewRequest(resourceGroupName, certificateOrderName, renewCertificateOrderRequest); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResendEmailRequest(string resourceGroupName, string certificateOrderName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/resendEmail", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Resend certificate email. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// or is null. - public async Task ResendEmailAsync(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateResendEmailRequest(resourceGroupName, certificateOrderName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Resend certificate email. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// or is null. - public Response ResendEmail(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateResendEmailRequest(resourceGroupName, certificateOrderName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResendRequestEmailsRequest(string resourceGroupName, string certificateOrderName, NameIdentifier nameIdentifier) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/resendRequestEmails", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(nameIdentifier); - request.Content = content; - return message; - } - - /// Description for Verify domain ownership for this certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Email address. - /// The cancellation token to use. - /// , , or is null. - public async Task ResendRequestEmailsAsync(string resourceGroupName, string certificateOrderName, NameIdentifier nameIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (nameIdentifier == null) - { - throw new ArgumentNullException(nameof(nameIdentifier)); - } - - using var message = CreateResendRequestEmailsRequest(resourceGroupName, certificateOrderName, nameIdentifier); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Verify domain ownership for this certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Email address. - /// The cancellation token to use. - /// , , or is null. - public Response ResendRequestEmails(string resourceGroupName, string certificateOrderName, NameIdentifier nameIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (nameIdentifier == null) - { - throw new ArgumentNullException(nameof(nameIdentifier)); - } - - using var message = CreateResendRequestEmailsRequest(resourceGroupName, certificateOrderName, nameIdentifier); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRetrieveSiteSealRequest(string resourceGroupName, string certificateOrderName, SiteSealRequest siteSealRequest) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/retrieveSiteSeal", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteSealRequest); - request.Content = content; - return message; - } - - /// Description for Verify domain ownership for this certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Site seal request. - /// The cancellation token to use. - /// , , or is null. - public async Task> RetrieveSiteSealAsync(string resourceGroupName, string certificateOrderName, SiteSealRequest siteSealRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (siteSealRequest == null) - { - throw new ArgumentNullException(nameof(siteSealRequest)); - } - - using var message = CreateRetrieveSiteSealRequest(resourceGroupName, certificateOrderName, siteSealRequest); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteSeal value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteSeal.DeserializeSiteSeal(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Verify domain ownership for this certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// Site seal request. - /// The cancellation token to use. - /// , , or is null. - public Response RetrieveSiteSeal(string resourceGroupName, string certificateOrderName, SiteSealRequest siteSealRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (siteSealRequest == null) - { - throw new ArgumentNullException(nameof(siteSealRequest)); - } - - using var message = CreateRetrieveSiteSealRequest(resourceGroupName, certificateOrderName, siteSealRequest); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteSeal value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteSeal.DeserializeSiteSeal(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateVerifyDomainOwnershipRequest(string resourceGroupName, string certificateOrderName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/verifyDomainOwnership", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Verify domain ownership for this certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// or is null. - public async Task VerifyDomainOwnershipAsync(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateVerifyDomainOwnershipRequest(resourceGroupName, certificateOrderName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Verify domain ownership for this certificate order. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// or is null. - public Response VerifyDomainOwnership(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateVerifyDomainOwnershipRequest(resourceGroupName, certificateOrderName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRetrieveCertificateActionsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(name, true); - uri.AppendPath("/retrieveCertificateActions", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Retrieve the list of certificate actions. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// or is null. - public async Task>> RetrieveCertificateActionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateRetrieveCertificateActionsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(CertificateOrderAction.DeserializeCertificateOrderAction(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Retrieve the list of certificate actions. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// or is null. - public Response> RetrieveCertificateActions(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateRetrieveCertificateActionsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(CertificateOrderAction.DeserializeCertificateOrderAction(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRetrieveCertificateEmailHistoryRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(name, true); - uri.AppendPath("/retrieveEmailHistory", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Retrieve email history. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// or is null. - public async Task>> RetrieveCertificateEmailHistoryAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateRetrieveCertificateEmailHistoryRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(CertificateEmail.DeserializeCertificateEmail(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Retrieve email history. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// or is null. - public Response> RetrieveCertificateEmailHistory(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateRetrieveCertificateEmailHistoryRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(CertificateEmail.DeserializeCertificateEmail(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all certificate orders in a subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateOrderCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all certificate orders in a subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateOrderCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get certificate orders in a resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateOrderCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get certificate orders in a resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateOrderCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceCertificateOrderCollection.DeserializeAppServiceCertificateOrderCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListCertificatesNextPageRequest(string nextLink, string resourceGroupName, string certificateOrderName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all certificates associated with a certificate order. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListCertificatesNextPageAsync(string nextLink, string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateListCertificatesNextPageRequest(nextLink, resourceGroupName, certificateOrderName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceCertificateCollection.DeserializeAppServiceCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all certificates associated with a certificate order. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate order. - /// The cancellation token to use. - /// , , or is null. - public Response ListCertificatesNextPage(string nextLink, string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateListCertificatesNextPageRequest(nextLink, resourceGroupName, certificateOrderName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceCertificateCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceCertificateCollection.DeserializeAppServiceCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsRestClient.cs deleted file mode 100644 index 4d262cd1dbc3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsRestClient.cs +++ /dev/null @@ -1,5793 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class AppServiceEnvironmentsRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of AppServiceEnvironmentsRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public AppServiceEnvironmentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all App Service Environments for a subscription. - /// The cancellation token to use. - public async Task> ListAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceEnvironmentCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all App Service Environments for a subscription. - /// The cancellation token to use. - public Response List(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceEnvironmentCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all App Service Environments in a resource group. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceEnvironmentCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all App Service Environments in a resource group. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceEnvironmentCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the properties of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> GetAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceEnvironmentResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceEnvironmentResource.DeserializeAppServiceEnvironmentResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the properties of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response Get(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceEnvironmentResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceEnvironmentResource.DeserializeAppServiceEnvironmentResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string name, AppServiceEnvironmentResource hostingEnvironmentEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(hostingEnvironmentEnvelope); - request.Content = content; - return message; - } - - /// Description for Create or update an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Configuration details of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task CreateOrUpdateAsync(string resourceGroupName, string name, AppServiceEnvironmentResource hostingEnvironmentEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostingEnvironmentEnvelope == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentEnvelope)); - } - - using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, hostingEnvironmentEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create or update an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Configuration details of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdate(string resourceGroupName, string name, AppServiceEnvironmentResource hostingEnvironmentEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostingEnvironmentEnvelope == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentEnvelope)); - } - - using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, hostingEnvironmentEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string resourceGroupName, string name, bool? forceDelete) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - if (forceDelete != null) - { - uri.AppendQuery("forceDelete", forceDelete.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Specify <code>true</code> to force the deletion even if the App Service Environment contains resources. The default is <code>false</code>. - /// The cancellation token to use. - /// or is null. - public async Task DeleteAsync(string resourceGroupName, string name, bool? forceDelete = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteRequest(resourceGroupName, name, forceDelete); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Specify <code>true</code> to force the deletion even if the App Service Environment contains resources. The default is <code>false</code>. - /// The cancellation token to use. - /// or is null. - public Response Delete(string resourceGroupName, string name, bool? forceDelete = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteRequest(resourceGroupName, name, forceDelete); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string resourceGroupName, string name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(hostingEnvironmentEnvelope); - request.Content = content; - return message; - } - - /// Description for Create or update an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Configuration details of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateAsync(string resourceGroupName, string name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostingEnvironmentEnvelope == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentEnvelope)); - } - - using var message = CreateUpdateRequest(resourceGroupName, name, hostingEnvironmentEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - { - AppServiceEnvironmentResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceEnvironmentResource.DeserializeAppServiceEnvironmentResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create or update an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Configuration details of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response Update(string resourceGroupName, string name, AppServiceEnvironmentPatchResource hostingEnvironmentEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostingEnvironmentEnvelope == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentEnvelope)); - } - - using var message = CreateUpdateRequest(resourceGroupName, name, hostingEnvironmentEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - { - AppServiceEnvironmentResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceEnvironmentResource.DeserializeAppServiceEnvironmentResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListCapacitiesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/capacities/compute", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the used, available, and total worker capacity an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> ListCapacitiesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListCapacitiesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StampCapacityCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StampCapacityCollection.DeserializeStampCapacityCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the used, available, and total worker capacity an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response ListCapacities(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListCapacitiesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StampCapacityCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StampCapacityCollection.DeserializeStampCapacityCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetVipInfoRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/capacities/virtualip", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get IP addresses assigned to an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> GetVipInfoAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetVipInfoRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AddressResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AddressResponse.DeserializeAddressResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get IP addresses assigned to an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response GetVipInfo(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetVipInfoRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AddressResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AddressResponse.DeserializeAddressResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateChangeVnetRequest(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/changeVirtualNetwork", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(vnetInfo); - request.Content = content; - return message; - } - - /// Description for Move an App Service Environment to a different VNET. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Details for the new virtual network. - /// The cancellation token to use. - /// , , or is null. - public async Task ChangeVnetAsync(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetInfo == null) - { - throw new ArgumentNullException(nameof(vnetInfo)); - } - - using var message = CreateChangeVnetRequest(resourceGroupName, name, vnetInfo); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Move an App Service Environment to a different VNET. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Details for the new virtual network. - /// The cancellation token to use. - /// , , or is null. - public Response ChangeVnet(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetInfo == null) - { - throw new ArgumentNullException(nameof(vnetInfo)); - } - - using var message = CreateChangeVnetRequest(resourceGroupName, name, vnetInfo); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAseV3NetworkingConfigurationRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/configurations/networking", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get networking configuration of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> GetAseV3NetworkingConfigurationAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetAseV3NetworkingConfigurationRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AseV3NetworkingConfiguration value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AseV3NetworkingConfiguration.DeserializeAseV3NetworkingConfiguration(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get networking configuration of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response GetAseV3NetworkingConfiguration(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetAseV3NetworkingConfigurationRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AseV3NetworkingConfiguration value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AseV3NetworkingConfiguration.DeserializeAseV3NetworkingConfiguration(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateAseNetworkingConfigurationRequest(string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/configurations/networking", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(aseNetworkingConfiguration); - request.Content = content; - return message; - } - - /// Description for Update networking configuration of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The AseV3NetworkingConfiguration to use. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateAseNetworkingConfigurationAsync(string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (aseNetworkingConfiguration == null) - { - throw new ArgumentNullException(nameof(aseNetworkingConfiguration)); - } - - using var message = CreateUpdateAseNetworkingConfigurationRequest(resourceGroupName, name, aseNetworkingConfiguration); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AseV3NetworkingConfiguration value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AseV3NetworkingConfiguration.DeserializeAseV3NetworkingConfiguration(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Update networking configuration of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The AseV3NetworkingConfiguration to use. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateAseNetworkingConfiguration(string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (aseNetworkingConfiguration == null) - { - throw new ArgumentNullException(nameof(aseNetworkingConfiguration)); - } - - using var message = CreateUpdateAseNetworkingConfigurationRequest(resourceGroupName, name, aseNetworkingConfiguration); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AseV3NetworkingConfiguration value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AseV3NetworkingConfiguration.DeserializeAseV3NetworkingConfiguration(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListDiagnosticsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/diagnostics", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get diagnostic information for an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task>> ListDiagnosticsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListDiagnosticsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(HostingEnvironmentDiagnostics.DeserializeHostingEnvironmentDiagnostics(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get diagnostic information for an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response> ListDiagnostics(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListDiagnosticsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(HostingEnvironmentDiagnostics.DeserializeHostingEnvironmentDiagnostics(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetDiagnosticsItemRequest(string resourceGroupName, string name, string diagnosticsName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticsName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a diagnostics item for an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the diagnostics item. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetDiagnosticsItemAsync(string resourceGroupName, string name, string diagnosticsName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (diagnosticsName == null) - { - throw new ArgumentNullException(nameof(diagnosticsName)); - } - - using var message = CreateGetDiagnosticsItemRequest(resourceGroupName, name, diagnosticsName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HostingEnvironmentDiagnostics value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HostingEnvironmentDiagnostics.DeserializeHostingEnvironmentDiagnostics(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a diagnostics item for an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the diagnostics item. - /// The cancellation token to use. - /// , , or is null. - public Response GetDiagnosticsItem(string resourceGroupName, string name, string diagnosticsName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (diagnosticsName == null) - { - throw new ArgumentNullException(nameof(diagnosticsName)); - } - - using var message = CreateGetDiagnosticsItemRequest(resourceGroupName, name, diagnosticsName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HostingEnvironmentDiagnostics value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HostingEnvironmentDiagnostics.DeserializeHostingEnvironmentDiagnostics(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInboundNetworkDependenciesEndpointsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/inboundNetworkDependenciesEndpoints", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the network endpoints of all inbound dependencies of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> GetInboundNetworkDependenciesEndpointsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetInboundNetworkDependenciesEndpointsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - InboundEnvironmentEndpointCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = InboundEnvironmentEndpointCollection.DeserializeInboundEnvironmentEndpointCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the network endpoints of all inbound dependencies of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response GetInboundNetworkDependenciesEndpoints(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetInboundNetworkDependenciesEndpointsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - InboundEnvironmentEndpointCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = InboundEnvironmentEndpointCollection.DeserializeInboundEnvironmentEndpointCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMultiRolePoolsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/multiRolePools", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all multi-role pools. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> ListMultiRolePoolsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRolePoolsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkerPoolCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all multi-role pools. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response ListMultiRolePools(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRolePoolsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkerPoolCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetMultiRolePoolRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/multiRolePools/default", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get properties of a multi-role pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> GetMultiRolePoolAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetMultiRolePoolRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkerPoolResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get properties of a multi-role pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response GetMultiRolePool(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetMultiRolePoolRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkerPoolResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateMultiRolePoolRequest(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/multiRolePools/default", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(multiRolePoolEnvelope); - request.Content = content; - return message; - } - - /// Description for Create or update a multi-role pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Properties of the multi-role pool. - /// The cancellation token to use. - /// , , or is null. - public async Task CreateOrUpdateMultiRolePoolAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (multiRolePoolEnvelope == null) - { - throw new ArgumentNullException(nameof(multiRolePoolEnvelope)); - } - - using var message = CreateCreateOrUpdateMultiRolePoolRequest(resourceGroupName, name, multiRolePoolEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create or update a multi-role pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Properties of the multi-role pool. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdateMultiRolePool(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (multiRolePoolEnvelope == null) - { - throw new ArgumentNullException(nameof(multiRolePoolEnvelope)); - } - - using var message = CreateCreateOrUpdateMultiRolePoolRequest(resourceGroupName, name, multiRolePoolEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateMultiRolePoolRequest(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/multiRolePools/default", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(multiRolePoolEnvelope); - request.Content = content; - return message; - } - - /// Description for Create or update a multi-role pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Properties of the multi-role pool. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateMultiRolePoolAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (multiRolePoolEnvelope == null) - { - throw new ArgumentNullException(nameof(multiRolePoolEnvelope)); - } - - using var message = CreateUpdateMultiRolePoolRequest(resourceGroupName, name, multiRolePoolEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - { - WorkerPoolResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create or update a multi-role pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Properties of the multi-role pool. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateMultiRolePool(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (multiRolePoolEnvelope == null) - { - throw new ArgumentNullException(nameof(multiRolePoolEnvelope)); - } - - using var message = CreateUpdateMultiRolePoolRequest(resourceGroupName, name, multiRolePoolEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - { - WorkerPoolResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMultiRolePoolInstanceMetricDefinitionsRequest(string resourceGroupName, string name, string instance) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/multiRolePools/default/instances/", false); - uri.AppendPath(instance, true); - uri.AppendPath("/metricdefinitions", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the instance in the multi-role pool. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListMultiRolePoolInstanceMetricDefinitionsAsync(string resourceGroupName, string name, string instance, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instance == null) - { - throw new ArgumentNullException(nameof(instance)); - } - - using var message = CreateListMultiRolePoolInstanceMetricDefinitionsRequest(resourceGroupName, name, instance); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the instance in the multi-role pool. - /// The cancellation token to use. - /// , , or is null. - public Response ListMultiRolePoolInstanceMetricDefinitions(string resourceGroupName, string name, string instance, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instance == null) - { - throw new ArgumentNullException(nameof(instance)); - } - - using var message = CreateListMultiRolePoolInstanceMetricDefinitionsRequest(resourceGroupName, name, instance); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMultiRoleMetricDefinitionsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/multiRolePools/default/metricdefinitions", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get metric definitions for a multi-role pool of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> ListMultiRoleMetricDefinitionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRoleMetricDefinitionsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get metric definitions for a multi-role pool of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response ListMultiRoleMetricDefinitions(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRoleMetricDefinitionsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMultiRolePoolSkusRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/multiRolePools/default/skus", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available SKUs for scaling a multi-role pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> ListMultiRolePoolSkusAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRolePoolSkusRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SkuInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available SKUs for scaling a multi-role pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response ListMultiRolePoolSkus(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRolePoolSkusRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SkuInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMultiRoleUsagesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/multiRolePools/default/usages", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get usage metrics for a multi-role pool of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> ListMultiRoleUsagesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRoleUsagesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - UsageCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = UsageCollection.DeserializeUsageCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get usage metrics for a multi-role pool of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response ListMultiRoleUsages(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRoleUsagesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - UsageCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = UsageCollection.DeserializeUsageCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOperationsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/operations", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all currently running operations on the App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task>> ListOperationsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListOperationsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(Models.Operation.DeserializeOperation(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all currently running operations on the App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response> ListOperations(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListOperationsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(Models.Operation.DeserializeOperation(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetOutboundNetworkDependenciesEndpointsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/outboundNetworkDependenciesEndpoints", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the network endpoints of all outbound dependencies of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> GetOutboundNetworkDependenciesEndpointsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetOutboundNetworkDependenciesEndpointsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OutboundEnvironmentEndpointCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OutboundEnvironmentEndpointCollection.DeserializeOutboundEnvironmentEndpointCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the network endpoints of all outbound dependencies of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response GetOutboundNetworkDependenciesEndpoints(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetOutboundNetworkDependenciesEndpointsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OutboundEnvironmentEndpointCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OutboundEnvironmentEndpointCollection.DeserializeOutboundEnvironmentEndpointCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateEndpointConnectionListRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the list of private endpoints associated with a hosting environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> GetPrivateEndpointConnectionListAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateEndpointConnectionListRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the list of private endpoints associated with a hosting environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response GetPrivateEndpointConnectionList(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateEndpointConnectionListRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the private endpoint connection. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetPrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - - using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RemotePrivateEndpointConnectionARMResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the private endpoint connection. - /// The cancellation token to use. - /// , , or is null. - public Response GetPrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - - using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RemotePrivateEndpointConnectionARMResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateApproveOrRejectPrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(privateEndpointWrapper); - request.Content = content; - return message; - } - - /// Description for Approves or rejects a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The String to use. - /// The PrivateLinkConnectionApprovalRequestResource to use. - /// The cancellation token to use. - /// , , , or is null. - public async Task ApproveOrRejectPrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - if (privateEndpointWrapper == null) - { - throw new ArgumentNullException(nameof(privateEndpointWrapper)); - } - - using var message = CreateApproveOrRejectPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Approves or rejects a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The String to use. - /// The PrivateLinkConnectionApprovalRequestResource to use. - /// The cancellation token to use. - /// , , , or is null. - public Response ApproveOrRejectPrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - if (privateEndpointWrapper == null) - { - throw new ArgumentNullException(nameof(privateEndpointWrapper)); - } - - using var message = CreateApproveOrRejectPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeletePrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task DeletePrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - - using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response DeletePrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - - using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateLinkResourcesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the private link resources. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> GetPrivateLinkResourcesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateLinkResourcesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateLinkResourcesWrapper value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the private link resources. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response GetPrivateLinkResources(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateLinkResourcesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateLinkResourcesWrapper value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRebootRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/reboot", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Reboot all machines in an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task RebootAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateRebootRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Reboot all machines in an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response Reboot(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateRebootRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResumeRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/resume", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Resume an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task ResumeAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateResumeRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Resume an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response Resume(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateResumeRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListAppServicePlansRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/serverfarms", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all App Service plans in an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> ListAppServicePlansAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListAppServicePlansRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServicePlanCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all App Service plans in an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response ListAppServicePlans(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListAppServicePlansRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServicePlanCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebAppsRequest(string resourceGroupName, string name, string propertiesToInclude) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/sites", false); - if (propertiesToInclude != null) - { - uri.AppendQuery("propertiesToInclude", propertiesToInclude, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all apps in an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Comma separated list of app properties to include. - /// The cancellation token to use. - /// or is null. - public async Task> ListWebAppsAsync(string resourceGroupName, string name, string propertiesToInclude = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWebAppsRequest(resourceGroupName, name, propertiesToInclude); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all apps in an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Comma separated list of app properties to include. - /// The cancellation token to use. - /// or is null. - public Response ListWebApps(string resourceGroupName, string name, string propertiesToInclude = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWebAppsRequest(resourceGroupName, name, propertiesToInclude); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateSuspendRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/suspend", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Suspend an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task SuspendAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateSuspendRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Suspend an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response Suspend(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateSuspendRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string name, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/usages", false); - uri.AppendQuery("api-version", apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get global usage metrics of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// or is null. - public async Task> ListUsagesAsync(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListUsagesRequest(resourceGroupName, name, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get global usage metrics of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// or is null. - public Response ListUsages(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListUsagesRequest(resourceGroupName, name, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWorkerPoolsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/workerPools", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all worker pools of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public async Task> ListWorkerPoolsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWorkerPoolsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkerPoolCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all worker pools of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// or is null. - public Response ListWorkerPools(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWorkerPoolsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkerPoolCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetWorkerPoolRequest(string resourceGroupName, string name, string workerPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/workerPools/", false); - uri.AppendPath(workerPoolName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get properties of a worker pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetWorkerPoolAsync(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateGetWorkerPoolRequest(resourceGroupName, name, workerPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkerPoolResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get properties of a worker pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , or is null. - public Response GetWorkerPool(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateGetWorkerPoolRequest(resourceGroupName, name, workerPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkerPoolResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateWorkerPoolRequest(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/workerPools/", false); - uri.AppendPath(workerPoolName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(workerPoolEnvelope); - request.Content = content; - return message; - } - - /// Description for Create or update a worker pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// Properties of the worker pool. - /// The cancellation token to use. - /// , , , or is null. - public async Task CreateOrUpdateWorkerPoolAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - if (workerPoolEnvelope == null) - { - throw new ArgumentNullException(nameof(workerPoolEnvelope)); - } - - using var message = CreateCreateOrUpdateWorkerPoolRequest(resourceGroupName, name, workerPoolName, workerPoolEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create or update a worker pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// Properties of the worker pool. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateWorkerPool(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - if (workerPoolEnvelope == null) - { - throw new ArgumentNullException(nameof(workerPoolEnvelope)); - } - - using var message = CreateCreateOrUpdateWorkerPoolRequest(resourceGroupName, name, workerPoolName, workerPoolEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateWorkerPoolRequest(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/workerPools/", false); - uri.AppendPath(workerPoolName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(workerPoolEnvelope); - request.Content = content; - return message; - } - - /// Description for Create or update a worker pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// Properties of the worker pool. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateWorkerPoolAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - if (workerPoolEnvelope == null) - { - throw new ArgumentNullException(nameof(workerPoolEnvelope)); - } - - using var message = CreateUpdateWorkerPoolRequest(resourceGroupName, name, workerPoolName, workerPoolEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - { - WorkerPoolResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create or update a worker pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// Properties of the worker pool. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateWorkerPool(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - if (workerPoolEnvelope == null) - { - throw new ArgumentNullException(nameof(workerPoolEnvelope)); - } - - using var message = CreateUpdateWorkerPoolRequest(resourceGroupName, name, workerPoolName, workerPoolEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - { - WorkerPoolResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WorkerPoolResource.DeserializeWorkerPoolResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWorkerPoolInstanceMetricDefinitionsRequest(string resourceGroupName, string name, string workerPoolName, string instance) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/workerPools/", false); - uri.AppendPath(workerPoolName, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instance, true); - uri.AppendPath("/metricdefinitions", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get metric definitions for a specific instance of a worker pool of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// Name of the instance in the worker pool. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListWorkerPoolInstanceMetricDefinitionsAsync(string resourceGroupName, string name, string workerPoolName, string instance, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - if (instance == null) - { - throw new ArgumentNullException(nameof(instance)); - } - - using var message = CreateListWorkerPoolInstanceMetricDefinitionsRequest(resourceGroupName, name, workerPoolName, instance); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get metric definitions for a specific instance of a worker pool of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// Name of the instance in the worker pool. - /// The cancellation token to use. - /// , , , or is null. - public Response ListWorkerPoolInstanceMetricDefinitions(string resourceGroupName, string name, string workerPoolName, string instance, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - if (instance == null) - { - throw new ArgumentNullException(nameof(instance)); - } - - using var message = CreateListWorkerPoolInstanceMetricDefinitionsRequest(resourceGroupName, name, workerPoolName, instance); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebWorkerMetricDefinitionsRequest(string resourceGroupName, string name, string workerPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/workerPools/", false); - uri.AppendPath(workerPoolName, true); - uri.AppendPath("/metricdefinitions", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get metric definitions for a worker pool of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListWebWorkerMetricDefinitionsAsync(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateListWebWorkerMetricDefinitionsRequest(resourceGroupName, name, workerPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get metric definitions for a worker pool of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , or is null. - public Response ListWebWorkerMetricDefinitions(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateListWebWorkerMetricDefinitionsRequest(resourceGroupName, name, workerPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWorkerPoolSkusRequest(string resourceGroupName, string name, string workerPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/workerPools/", false); - uri.AppendPath(workerPoolName, true); - uri.AppendPath("/skus", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available SKUs for scaling a worker pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListWorkerPoolSkusAsync(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateListWorkerPoolSkusRequest(resourceGroupName, name, workerPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SkuInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available SKUs for scaling a worker pool. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , or is null. - public Response ListWorkerPoolSkus(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateListWorkerPoolSkusRequest(resourceGroupName, name, workerPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SkuInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebWorkerUsagesRequest(string resourceGroupName, string name, string workerPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/workerPools/", false); - uri.AppendPath(workerPoolName, true); - uri.AppendPath("/usages", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get usage metrics for a worker pool of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListWebWorkerUsagesAsync(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateListWebWorkerUsagesRequest(resourceGroupName, name, workerPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - UsageCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = UsageCollection.DeserializeUsageCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get usage metrics for a worker pool of an App Service Environment. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , or is null. - public Response ListWebWorkerUsages(string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateListWebWorkerUsagesRequest(resourceGroupName, name, workerPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - UsageCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = UsageCollection.DeserializeUsageCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all App Service Environments for a subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceEnvironmentCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all App Service Environments for a subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceEnvironmentCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all App Service Environments in a resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServiceEnvironmentCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all App Service Environments in a resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServiceEnvironmentCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServiceEnvironmentCollection.DeserializeAppServiceEnvironmentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListCapacitiesNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the used, available, and total worker capacity an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListCapacitiesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListCapacitiesNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StampCapacityCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StampCapacityCollection.DeserializeStampCapacityCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the used, available, and total worker capacity an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response ListCapacitiesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListCapacitiesNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StampCapacityCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StampCapacityCollection.DeserializeStampCapacityCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateChangeVnetNextPageRequest(string nextLink, string resourceGroupName, string name, VirtualNetworkProfile vnetInfo) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Move an App Service Environment to a different VNET. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Details for the new virtual network. - /// The cancellation token to use. - /// , , , or is null. - public async Task ChangeVnetNextPageAsync(string nextLink, string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetInfo == null) - { - throw new ArgumentNullException(nameof(vnetInfo)); - } - - using var message = CreateChangeVnetNextPageRequest(nextLink, resourceGroupName, name, vnetInfo); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Move an App Service Environment to a different VNET. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Details for the new virtual network. - /// The cancellation token to use. - /// , , , or is null. - public Response ChangeVnetNextPage(string nextLink, string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetInfo == null) - { - throw new ArgumentNullException(nameof(vnetInfo)); - } - - using var message = CreateChangeVnetNextPageRequest(nextLink, resourceGroupName, name, vnetInfo); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInboundNetworkDependenciesEndpointsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the network endpoints of all inbound dependencies of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetInboundNetworkDependenciesEndpointsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetInboundNetworkDependenciesEndpointsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - InboundEnvironmentEndpointCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = InboundEnvironmentEndpointCollection.DeserializeInboundEnvironmentEndpointCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the network endpoints of all inbound dependencies of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response GetInboundNetworkDependenciesEndpointsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetInboundNetworkDependenciesEndpointsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - InboundEnvironmentEndpointCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = InboundEnvironmentEndpointCollection.DeserializeInboundEnvironmentEndpointCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMultiRolePoolsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all multi-role pools. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListMultiRolePoolsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRolePoolsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkerPoolCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all multi-role pools. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response ListMultiRolePoolsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRolePoolsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkerPoolCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMultiRolePoolInstanceMetricDefinitionsNextPageRequest(string nextLink, string resourceGroupName, string name, string instance) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the instance in the multi-role pool. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListMultiRolePoolInstanceMetricDefinitionsNextPageAsync(string nextLink, string resourceGroupName, string name, string instance, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instance == null) - { - throw new ArgumentNullException(nameof(instance)); - } - - using var message = CreateListMultiRolePoolInstanceMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name, instance); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the instance in the multi-role pool. - /// The cancellation token to use. - /// , , , or is null. - public Response ListMultiRolePoolInstanceMetricDefinitionsNextPage(string nextLink, string resourceGroupName, string name, string instance, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instance == null) - { - throw new ArgumentNullException(nameof(instance)); - } - - using var message = CreateListMultiRolePoolInstanceMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name, instance); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMultiRoleMetricDefinitionsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get metric definitions for a multi-role pool of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListMultiRoleMetricDefinitionsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRoleMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get metric definitions for a multi-role pool of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response ListMultiRoleMetricDefinitionsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRoleMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMultiRolePoolSkusNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available SKUs for scaling a multi-role pool. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListMultiRolePoolSkusNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRolePoolSkusNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SkuInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available SKUs for scaling a multi-role pool. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response ListMultiRolePoolSkusNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRolePoolSkusNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SkuInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMultiRoleUsagesNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get usage metrics for a multi-role pool of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListMultiRoleUsagesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRoleUsagesNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - UsageCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = UsageCollection.DeserializeUsageCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get usage metrics for a multi-role pool of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response ListMultiRoleUsagesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMultiRoleUsagesNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - UsageCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = UsageCollection.DeserializeUsageCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetOutboundNetworkDependenciesEndpointsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the network endpoints of all outbound dependencies of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetOutboundNetworkDependenciesEndpointsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OutboundEnvironmentEndpointCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OutboundEnvironmentEndpointCollection.DeserializeOutboundEnvironmentEndpointCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the network endpoints of all outbound dependencies of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response GetOutboundNetworkDependenciesEndpointsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OutboundEnvironmentEndpointCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OutboundEnvironmentEndpointCollection.DeserializeOutboundEnvironmentEndpointCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateEndpointConnectionListNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the list of private endpoints associated with a hosting environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetPrivateEndpointConnectionListNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateEndpointConnectionListNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the list of private endpoints associated with a hosting environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response GetPrivateEndpointConnectionListNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateEndpointConnectionListNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResumeNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Resume an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task ResumeNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateResumeNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Resume an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response ResumeNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateResumeNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListAppServicePlansNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all App Service plans in an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListAppServicePlansNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListAppServicePlansNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServicePlanCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all App Service plans in an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response ListAppServicePlansNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListAppServicePlansNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServicePlanCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebAppsNextPageRequest(string nextLink, string resourceGroupName, string name, string propertiesToInclude) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all apps in an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Comma separated list of app properties to include. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListWebAppsNextPageAsync(string nextLink, string resourceGroupName, string name, string propertiesToInclude = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWebAppsNextPageRequest(nextLink, resourceGroupName, name, propertiesToInclude); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all apps in an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Comma separated list of app properties to include. - /// The cancellation token to use. - /// , , or is null. - public Response ListWebAppsNextPage(string nextLink, string resourceGroupName, string name, string propertiesToInclude = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWebAppsNextPageRequest(nextLink, resourceGroupName, name, propertiesToInclude); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateSuspendNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Suspend an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task SuspendNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateSuspendNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Suspend an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response SuspendNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateSuspendNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListUsagesNextPageRequest(string nextLink, string resourceGroupName, string name, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get global usage metrics of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListUsagesNextPageAsync(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListUsagesNextPageRequest(nextLink, resourceGroupName, name, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get global usage metrics of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , or is null. - public Response ListUsagesNextPage(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListUsagesNextPageRequest(nextLink, resourceGroupName, name, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWorkerPoolsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all worker pools of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListWorkerPoolsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWorkerPoolsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkerPoolCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all worker pools of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// The cancellation token to use. - /// , , or is null. - public Response ListWorkerPoolsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWorkerPoolsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkerPoolCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WorkerPoolCollection.DeserializeWorkerPoolCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWorkerPoolInstanceMetricDefinitionsNextPageRequest(string nextLink, string resourceGroupName, string name, string workerPoolName, string instance) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get metric definitions for a specific instance of a worker pool of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// Name of the instance in the worker pool. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListWorkerPoolInstanceMetricDefinitionsNextPageAsync(string nextLink, string resourceGroupName, string name, string workerPoolName, string instance, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - if (instance == null) - { - throw new ArgumentNullException(nameof(instance)); - } - - using var message = CreateListWorkerPoolInstanceMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name, workerPoolName, instance); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get metric definitions for a specific instance of a worker pool of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// Name of the instance in the worker pool. - /// The cancellation token to use. - /// , , , , or is null. - public Response ListWorkerPoolInstanceMetricDefinitionsNextPage(string nextLink, string resourceGroupName, string name, string workerPoolName, string instance, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - if (instance == null) - { - throw new ArgumentNullException(nameof(instance)); - } - - using var message = CreateListWorkerPoolInstanceMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name, workerPoolName, instance); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebWorkerMetricDefinitionsNextPageRequest(string nextLink, string resourceGroupName, string name, string workerPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get metric definitions for a worker pool of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListWebWorkerMetricDefinitionsNextPageAsync(string nextLink, string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateListWebWorkerMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name, workerPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get metric definitions for a worker pool of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , , or is null. - public Response ListWebWorkerMetricDefinitionsNextPage(string nextLink, string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateListWebWorkerMetricDefinitionsNextPageRequest(nextLink, resourceGroupName, name, workerPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceMetricDefinitionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceMetricDefinitionCollection.DeserializeResourceMetricDefinitionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWorkerPoolSkusNextPageRequest(string nextLink, string resourceGroupName, string name, string workerPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available SKUs for scaling a worker pool. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListWorkerPoolSkusNextPageAsync(string nextLink, string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateListWorkerPoolSkusNextPageRequest(nextLink, resourceGroupName, name, workerPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SkuInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available SKUs for scaling a worker pool. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , , or is null. - public Response ListWorkerPoolSkusNextPage(string nextLink, string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateListWorkerPoolSkusNextPageRequest(nextLink, resourceGroupName, name, workerPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SkuInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SkuInfoCollection.DeserializeSkuInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebWorkerUsagesNextPageRequest(string nextLink, string resourceGroupName, string name, string workerPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get usage metrics for a worker pool of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListWebWorkerUsagesNextPageAsync(string nextLink, string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateListWebWorkerUsagesNextPageRequest(nextLink, resourceGroupName, name, workerPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - UsageCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = UsageCollection.DeserializeUsageCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get usage metrics for a worker pool of an App Service Environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service Environment. - /// Name of the worker pool. - /// The cancellation token to use. - /// , , , or is null. - public Response ListWebWorkerUsagesNextPage(string nextLink, string resourceGroupName, string name, string workerPoolName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerPoolName == null) - { - throw new ArgumentNullException(nameof(workerPoolName)); - } - - using var message = CreateListWebWorkerUsagesNextPageRequest(nextLink, resourceGroupName, name, workerPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - UsageCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = UsageCollection.DeserializeUsageCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServicePlansRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServicePlansRestClient.cs deleted file mode 100644 index ae6ff7267ffc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServicePlansRestClient.cs +++ /dev/null @@ -1,3199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class AppServicePlansRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of AppServicePlansRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public AppServicePlansRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListRequest(bool? detailed) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms", false); - if (detailed != null) - { - uri.AppendQuery("detailed", detailed.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all App Service plans for a subscription. - /// - /// Specify <code>true</code> to return all App Service plan properties. The default is <code>false</code>, which returns a subset of the properties. - /// Retrieval of all properties may increase the API latency. - /// - /// The cancellation token to use. - public async Task> ListAsync(bool? detailed = null, CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(detailed); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServicePlanCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all App Service plans for a subscription. - /// - /// Specify <code>true</code> to return all App Service plan properties. The default is <code>false</code>, which returns a subset of the properties. - /// Retrieval of all properties may increase the API latency. - /// - /// The cancellation token to use. - public Response List(bool? detailed = null, CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(detailed); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServicePlanCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all App Service plans in a resource group. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServicePlanCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all App Service plans in a resource group. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServicePlanCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// or is null. - public async Task> GetAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServicePlan value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServicePlan.DeserializeAppServicePlan(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AppServicePlan)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// or is null. - public Response Get(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServicePlan value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServicePlan.DeserializeAppServicePlan(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AppServicePlan)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string name, AppServicePlan appServicePlan) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(appServicePlan); - request.Content = content; - return message; - } - - /// Description for Creates or updates an App Service Plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Details of the App Service plan. - /// The cancellation token to use. - /// , , or is null. - public async Task CreateOrUpdateAsync(string resourceGroupName, string name, AppServicePlan appServicePlan, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appServicePlan == null) - { - throw new ArgumentNullException(nameof(appServicePlan)); - } - - using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, appServicePlan); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates or updates an App Service Plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Details of the App Service plan. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdate(string resourceGroupName, string name, AppServicePlan appServicePlan, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appServicePlan == null) - { - throw new ArgumentNullException(nameof(appServicePlan)); - } - - using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, appServicePlan); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// or is null. - public async Task DeleteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// or is null. - public Response Delete(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string resourceGroupName, string name, AppServicePlanPatchResource appServicePlan) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(appServicePlan); - request.Content = content; - return message; - } - - /// Description for Creates or updates an App Service Plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Details of the App Service plan. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateAsync(string resourceGroupName, string name, AppServicePlanPatchResource appServicePlan, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appServicePlan == null) - { - throw new ArgumentNullException(nameof(appServicePlan)); - } - - using var message = CreateUpdateRequest(resourceGroupName, name, appServicePlan); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - { - AppServicePlan value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServicePlan.DeserializeAppServicePlan(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates or updates an App Service Plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Details of the App Service plan. - /// The cancellation token to use. - /// , , or is null. - public Response Update(string resourceGroupName, string name, AppServicePlanPatchResource appServicePlan, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appServicePlan == null) - { - throw new ArgumentNullException(nameof(appServicePlan)); - } - - using var message = CreateUpdateRequest(resourceGroupName, name, appServicePlan); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - { - AppServicePlan value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServicePlan.DeserializeAppServicePlan(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListCapabilitiesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/capabilities", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all capabilities of an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// or is null. - public async Task>> ListCapabilitiesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListCapabilitiesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(Capability.DeserializeCapability(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all capabilities of an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// or is null. - public Response> ListCapabilities(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListCapabilitiesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(Capability.DeserializeCapability(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridConnectionNamespaces/", false); - uri.AppendPath(namespaceName, true); - uri.AppendPath("/relays/", false); - uri.AppendPath(relayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Retrieve a Hybrid Connection in use in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Service Bus namespace. - /// Name of the Service Bus relay. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateGetHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Retrieve a Hybrid Connection in use in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Service Bus namespace. - /// Name of the Service Bus relay. - /// The cancellation token to use. - /// , , , or is null. - public Response GetHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateGetHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridConnectionNamespaces/", false); - uri.AppendPath(namespaceName, true); - uri.AppendPath("/relays/", false); - uri.AppendPath(relayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a Hybrid Connection in use in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Service Bus namespace. - /// Name of the Service Bus relay. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateDeleteHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a Hybrid Connection in use in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Service Bus namespace. - /// Name of the Service Bus relay. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateDeleteHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHybridConnectionKeysRequest(string resourceGroupName, string name, string namespaceName, string relayName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridConnectionNamespaces/", false); - uri.AppendPath(namespaceName, true); - uri.AppendPath("/relays/", false); - uri.AppendPath(relayName, true); - uri.AppendPath("/listKeys", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the send key name and value of a Hybrid Connection. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The name of the Service Bus namespace. - /// The name of the Service Bus relay. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListHybridConnectionKeysAsync(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateListHybridConnectionKeysRequest(resourceGroupName, name, namespaceName, relayName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnectionKey value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnectionKey.DeserializeHybridConnectionKey(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the send key name and value of a Hybrid Connection. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The name of the Service Bus namespace. - /// The name of the Service Bus relay. - /// The cancellation token to use. - /// , , , or is null. - public Response ListHybridConnectionKeys(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateListHybridConnectionKeysRequest(resourceGroupName, name, namespaceName, relayName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnectionKey value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnectionKey.DeserializeHybridConnectionKey(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebAppsByHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridConnectionNamespaces/", false); - uri.AppendPath(namespaceName, true); - uri.AppendPath("/relays/", false); - uri.AppendPath(relayName, true); - uri.AppendPath("/sites", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all apps that use a Hybrid Connection in an App Service Plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Hybrid Connection namespace. - /// Name of the Hybrid Connection relay. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListWebAppsByHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateListWebAppsByHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceCollection.DeserializeResourceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all apps that use a Hybrid Connection in an App Service Plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Hybrid Connection namespace. - /// Name of the Hybrid Connection relay. - /// The cancellation token to use. - /// , , , or is null. - public Response ListWebAppsByHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateListWebAppsByHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceCollection.DeserializeResourceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetHybridConnectionPlanLimitRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridConnectionPlanLimits/limit", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the maximum number of Hybrid Connections allowed in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// or is null. - public async Task> GetHybridConnectionPlanLimitAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetHybridConnectionPlanLimitRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnectionLimits value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnectionLimits.DeserializeHybridConnectionLimits(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the maximum number of Hybrid Connections allowed in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// or is null. - public Response GetHybridConnectionPlanLimit(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetHybridConnectionPlanLimitRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnectionLimits value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnectionLimits.DeserializeHybridConnectionLimits(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHybridConnectionsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridConnectionRelays", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Retrieve all Hybrid Connections in use in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// or is null. - public async Task> ListHybridConnectionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHybridConnectionsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnectionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnectionCollection.DeserializeHybridConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Retrieve all Hybrid Connections in use in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// or is null. - public Response ListHybridConnections(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHybridConnectionsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnectionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnectionCollection.DeserializeHybridConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRestartWebAppsRequest(string resourceGroupName, string name, bool? softRestart) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/restartSites", false); - if (softRestart != null) - { - uri.AppendQuery("softRestart", softRestart.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Restart all apps in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Specify <code>true</code> to perform a soft restart, applies the configuration settings and restarts the apps if necessary. The default is <code>false</code>, which always restarts and reprovisions the apps. - /// The cancellation token to use. - /// or is null. - public async Task RestartWebAppsAsync(string resourceGroupName, string name, bool? softRestart = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateRestartWebAppsRequest(resourceGroupName, name, softRestart); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Restart all apps in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Specify <code>true</code> to perform a soft restart, applies the configuration settings and restarts the apps if necessary. The default is <code>false</code>, which always restarts and reprovisions the apps. - /// The cancellation token to use. - /// or is null. - public Response RestartWebApps(string resourceGroupName, string name, bool? softRestart = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateRestartWebAppsRequest(resourceGroupName, name, softRestart); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebAppsRequest(string resourceGroupName, string name, string skipToken, string filter, string top) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/sites", false); - uri.AppendQuery("api-version", apiVersion, true); - if (skipToken != null) - { - uri.AppendQuery("$skipToken", skipToken, true); - } - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - if (top != null) - { - uri.AppendQuery("$top", top, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all apps associated with an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list. - /// Supported filter: $filter=state eq running. Returns only web apps that are currently running. - /// List page size. If specified, results are paged. - /// The cancellation token to use. - /// or is null. - public async Task> ListWebAppsAsync(string resourceGroupName, string name, string skipToken = null, string filter = null, string top = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWebAppsRequest(resourceGroupName, name, skipToken, filter, top); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all apps associated with an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list. - /// Supported filter: $filter=state eq running. Returns only web apps that are currently running. - /// List page size. If specified, results are paged. - /// The cancellation token to use. - /// or is null. - public Response ListWebApps(string resourceGroupName, string name, string skipToken = null, string filter = null, string top = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWebAppsRequest(resourceGroupName, name, skipToken, filter, top); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetServerFarmSkusRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/skus", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all selectable SKUs for a given App Service Plan. - /// Name of the resource group to which the resource belongs. - /// Name of App Service Plan. - /// The cancellation token to use. - /// or is null. - public async Task> GetServerFarmSkusAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetServerFarmSkusRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - object value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = document.RootElement.GetObject(); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all selectable SKUs for a given App Service Plan. - /// Name of the resource group to which the resource belongs. - /// Name of App Service Plan. - /// The cancellation token to use. - /// or is null. - public Response GetServerFarmSkus(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetServerFarmSkusRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - object value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = document.RootElement.GetObject(); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string name, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/usages", false); - uri.AppendQuery("api-version", apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets server farm usage information. - /// Name of the resource group to which the resource belongs. - /// Name of App Service Plan. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). - /// The cancellation token to use. - /// or is null. - public async Task> ListUsagesAsync(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListUsagesRequest(resourceGroupName, name, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets server farm usage information. - /// Name of the resource group to which the resource belongs. - /// Name of App Service Plan. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). - /// The cancellation token to use. - /// or is null. - public Response ListUsages(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListUsagesRequest(resourceGroupName, name, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListVnetsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all Virtual Networks associated with an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// or is null. - public async Task>> ListVnetsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListVnetsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(VnetInfo.DeserializeVnetInfo(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all Virtual Networks associated with an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// or is null. - public Response> ListVnets(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListVnetsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(VnetInfo.DeserializeVnetInfo(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetVnetFromServerFarmRequest(string resourceGroupName, string name, string vnetName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a Virtual Network associated with an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetVnetFromServerFarmAsync(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - - using var message = CreateGetVnetFromServerFarmRequest(resourceGroupName, name, vnetName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((VnetInfo)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a Virtual Network associated with an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// The cancellation token to use. - /// , , or is null. - public Response GetVnetFromServerFarm(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - - using var message = CreateGetVnetFromServerFarmRequest(resourceGroupName, name, vnetName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((VnetInfo)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetVnetGatewayRequest(string resourceGroupName, string name, string vnetName, string gatewayName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a Virtual Network gateway. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// Name of the gateway. Only the 'primary' gateway is supported. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetVnetGatewayAsync(string resourceGroupName, string name, string vnetName, string gatewayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - - using var message = CreateGetVnetGatewayRequest(resourceGroupName, name, vnetName, gatewayName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a Virtual Network gateway. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// Name of the gateway. Only the 'primary' gateway is supported. - /// The cancellation token to use. - /// , , , or is null. - public Response GetVnetGateway(string resourceGroupName, string name, string vnetName, string gatewayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - - using var message = CreateGetVnetGatewayRequest(resourceGroupName, name, vnetName, gatewayName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateVnetGatewayRequest(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Update a Virtual Network gateway. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// Name of the gateway. Only the 'primary' gateway is supported. - /// Definition of the gateway. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> UpdateVnetGatewayAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateVnetGatewayRequest(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Update a Virtual Network gateway. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// Name of the gateway. Only the 'primary' gateway is supported. - /// Definition of the gateway. - /// The cancellation token to use. - /// , , , , or is null. - public Response UpdateVnetGateway(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateVnetGatewayRequest(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRoutesForVnetRequest(string resourceGroupName, string name, string vnetName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/routes", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all routes that are associated with a Virtual Network in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// The cancellation token to use. - /// , , or is null. - public async Task>> ListRoutesForVnetAsync(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - - using var message = CreateListRoutesForVnetRequest(resourceGroupName, name, vnetName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(VnetRoute.DeserializeVnetRoute(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all routes that are associated with a Virtual Network in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// The cancellation token to use. - /// , , or is null. - public Response> ListRoutesForVnet(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - - using var message = CreateListRoutesForVnetRequest(resourceGroupName, name, vnetName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(VnetRoute.DeserializeVnetRoute(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRouteForVnetRequest(string resourceGroupName, string name, string vnetName, string routeName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/routes/", false); - uri.AppendPath(routeName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a Virtual Network route in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// Name of the Virtual Network route. - /// The cancellation token to use. - /// , , , or is null. - public async Task>> GetRouteForVnetAsync(string resourceGroupName, string name, string vnetName, string routeName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (routeName == null) - { - throw new ArgumentNullException(nameof(routeName)); - } - - using var message = CreateGetRouteForVnetRequest(resourceGroupName, name, vnetName, routeName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(VnetRoute.DeserializeVnetRoute(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((IReadOnlyList)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a Virtual Network route in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// Name of the Virtual Network route. - /// The cancellation token to use. - /// , , , or is null. - public Response> GetRouteForVnet(string resourceGroupName, string name, string vnetName, string routeName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (routeName == null) - { - throw new ArgumentNullException(nameof(routeName)); - } - - using var message = CreateGetRouteForVnetRequest(resourceGroupName, name, vnetName, routeName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(VnetRoute.DeserializeVnetRoute(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((IReadOnlyList)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateVnetRouteRequest(string resourceGroupName, string name, string vnetName, string routeName, VnetRoute route) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/routes/", false); - uri.AppendPath(routeName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(route); - request.Content = content; - return message; - } - - /// Description for Create or update a Virtual Network route in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// Name of the Virtual Network route. - /// Definition of the Virtual Network route. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> CreateOrUpdateVnetRouteAsync(string resourceGroupName, string name, string vnetName, string routeName, VnetRoute route, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (routeName == null) - { - throw new ArgumentNullException(nameof(routeName)); - } - if (route == null) - { - throw new ArgumentNullException(nameof(route)); - } - - using var message = CreateCreateOrUpdateVnetRouteRequest(resourceGroupName, name, vnetName, routeName, route); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetRoute value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetRoute.DeserializeVnetRoute(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 400: - case 404: - return Response.FromValue((VnetRoute)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create or update a Virtual Network route in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// Name of the Virtual Network route. - /// Definition of the Virtual Network route. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateOrUpdateVnetRoute(string resourceGroupName, string name, string vnetName, string routeName, VnetRoute route, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (routeName == null) - { - throw new ArgumentNullException(nameof(routeName)); - } - if (route == null) - { - throw new ArgumentNullException(nameof(route)); - } - - using var message = CreateCreateOrUpdateVnetRouteRequest(resourceGroupName, name, vnetName, routeName, route); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetRoute value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetRoute.DeserializeVnetRoute(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 400: - case 404: - return Response.FromValue((VnetRoute)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteVnetRouteRequest(string resourceGroupName, string name, string vnetName, string routeName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/routes/", false); - uri.AppendPath(routeName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a Virtual Network route in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// Name of the Virtual Network route. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteVnetRouteAsync(string resourceGroupName, string name, string vnetName, string routeName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (routeName == null) - { - throw new ArgumentNullException(nameof(routeName)); - } - - using var message = CreateDeleteVnetRouteRequest(resourceGroupName, name, vnetName, routeName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a Virtual Network route in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// Name of the Virtual Network route. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteVnetRoute(string resourceGroupName, string name, string vnetName, string routeName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (routeName == null) - { - throw new ArgumentNullException(nameof(routeName)); - } - - using var message = CreateDeleteVnetRouteRequest(resourceGroupName, name, vnetName, routeName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateVnetRouteRequest(string resourceGroupName, string name, string vnetName, string routeName, VnetRoute route) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/routes/", false); - uri.AppendPath(routeName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(route); - request.Content = content; - return message; - } - - /// Description for Create or update a Virtual Network route in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// Name of the Virtual Network route. - /// Definition of the Virtual Network route. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> UpdateVnetRouteAsync(string resourceGroupName, string name, string vnetName, string routeName, VnetRoute route, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (routeName == null) - { - throw new ArgumentNullException(nameof(routeName)); - } - if (route == null) - { - throw new ArgumentNullException(nameof(route)); - } - - using var message = CreateUpdateVnetRouteRequest(resourceGroupName, name, vnetName, routeName, route); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetRoute value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetRoute.DeserializeVnetRoute(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 400: - case 404: - return Response.FromValue((VnetRoute)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create or update a Virtual Network route in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Virtual Network. - /// Name of the Virtual Network route. - /// Definition of the Virtual Network route. - /// The cancellation token to use. - /// , , , , or is null. - public Response UpdateVnetRoute(string resourceGroupName, string name, string vnetName, string routeName, VnetRoute route, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (routeName == null) - { - throw new ArgumentNullException(nameof(routeName)); - } - if (route == null) - { - throw new ArgumentNullException(nameof(route)); - } - - using var message = CreateUpdateVnetRouteRequest(resourceGroupName, name, vnetName, routeName, route); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetRoute value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetRoute.DeserializeVnetRoute(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 400: - case 404: - return Response.FromValue((VnetRoute)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRebootWorkerRequest(string resourceGroupName, string name, string workerName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/serverfarms/", false); - uri.AppendPath(name, true); - uri.AppendPath("/workers/", false); - uri.AppendPath(workerName, true); - uri.AppendPath("/reboot", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Reboot a worker machine in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of worker machine, which typically starts with RD. - /// The cancellation token to use. - /// , , or is null. - public async Task RebootWorkerAsync(string resourceGroupName, string name, string workerName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerName == null) - { - throw new ArgumentNullException(nameof(workerName)); - } - - using var message = CreateRebootWorkerRequest(resourceGroupName, name, workerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Reboot a worker machine in an App Service plan. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of worker machine, which typically starts with RD. - /// The cancellation token to use. - /// , , or is null. - public Response RebootWorker(string resourceGroupName, string name, string workerName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (workerName == null) - { - throw new ArgumentNullException(nameof(workerName)); - } - - using var message = CreateRebootWorkerRequest(resourceGroupName, name, workerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, bool? detailed) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all App Service plans for a subscription. - /// The URL to the next page of results. - /// - /// Specify <code>true</code> to return all App Service plan properties. The default is <code>false</code>, which returns a subset of the properties. - /// Retrieval of all properties may increase the API latency. - /// - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, bool? detailed = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink, detailed); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServicePlanCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all App Service plans for a subscription. - /// The URL to the next page of results. - /// - /// Specify <code>true</code> to return all App Service plan properties. The default is <code>false</code>, which returns a subset of the properties. - /// Retrieval of all properties may increase the API latency. - /// - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, bool? detailed = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink, detailed); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServicePlanCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all App Service plans in a resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppServicePlanCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all App Service plans in a resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppServicePlanCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppServicePlanCollection.DeserializeAppServicePlanCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebAppsByHybridConnectionNextPageRequest(string nextLink, string resourceGroupName, string name, string namespaceName, string relayName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all apps that use a Hybrid Connection in an App Service Plan. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Hybrid Connection namespace. - /// Name of the Hybrid Connection relay. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListWebAppsByHybridConnectionNextPageAsync(string nextLink, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateListWebAppsByHybridConnectionNextPageRequest(nextLink, resourceGroupName, name, namespaceName, relayName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceCollection.DeserializeResourceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all apps that use a Hybrid Connection in an App Service Plan. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Name of the Hybrid Connection namespace. - /// Name of the Hybrid Connection relay. - /// The cancellation token to use. - /// , , , , or is null. - public Response ListWebAppsByHybridConnectionNextPage(string nextLink, string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateListWebAppsByHybridConnectionNextPageRequest(nextLink, resourceGroupName, name, namespaceName, relayName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceCollection.DeserializeResourceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHybridConnectionsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Retrieve all Hybrid Connections in use in an App Service plan. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListHybridConnectionsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHybridConnectionsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnectionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnectionCollection.DeserializeHybridConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Retrieve all Hybrid Connections in use in an App Service plan. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// The cancellation token to use. - /// , , or is null. - public Response ListHybridConnectionsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHybridConnectionsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnectionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnectionCollection.DeserializeHybridConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebAppsNextPageRequest(string nextLink, string resourceGroupName, string name, string skipToken, string filter, string top) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all apps associated with an App Service plan. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list. - /// Supported filter: $filter=state eq running. Returns only web apps that are currently running. - /// List page size. If specified, results are paged. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListWebAppsNextPageAsync(string nextLink, string resourceGroupName, string name, string skipToken = null, string filter = null, string top = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWebAppsNextPageRequest(nextLink, resourceGroupName, name, skipToken, filter, top); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all apps associated with an App Service plan. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the App Service plan. - /// Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list. - /// Supported filter: $filter=state eq running. Returns only web apps that are currently running. - /// List page size. If specified, results are paged. - /// The cancellation token to use. - /// , , or is null. - public Response ListWebAppsNextPage(string nextLink, string resourceGroupName, string name, string skipToken = null, string filter = null, string top = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWebAppsNextPageRequest(nextLink, resourceGroupName, name, skipToken, filter, top); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListUsagesNextPageRequest(string nextLink, string resourceGroupName, string name, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets server farm usage information. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of App Service Plan. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). - /// The cancellation token to use. - /// , , or is null. - public async Task> ListUsagesNextPageAsync(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListUsagesNextPageRequest(nextLink, resourceGroupName, name, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets server farm usage information. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of App Service Plan. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). - /// The cancellation token to use. - /// , , or is null. - public Response ListUsagesNextPage(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListUsagesNextPageRequest(nextLink, resourceGroupName, name, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsRestClient.cs deleted file mode 100644 index f7854c3a36e9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsRestClient.cs +++ /dev/null @@ -1,337 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class CertificateOrdersDiagnosticsRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of CertificateOrdersDiagnosticsRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public CertificateOrdersDiagnosticsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListAppServiceCertificateOrderDetectorResponseRequest(string resourceGroupName, string certificateOrderName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/detectors", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. - /// Name of the resource group to which the resource belongs. - /// The certificate order name for which the response is needed. - /// The cancellation token to use. - /// or is null. - public async Task> ListAppServiceCertificateOrderDetectorResponseAsync(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateListAppServiceCertificateOrderDetectorResponseRequest(resourceGroupName, certificateOrderName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. - /// Name of the resource group to which the resource belongs. - /// The certificate order name for which the response is needed. - /// The cancellation token to use. - /// or is null. - public Response ListAppServiceCertificateOrderDetectorResponse(string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateListAppServiceCertificateOrderDetectorResponseRequest(resourceGroupName, certificateOrderName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAppServiceCertificateOrderDetectorResponseRequest(string resourceGroupName, string certificateOrderName, string detectorName, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/certificateOrders/", false); - uri.AppendPath(certificateOrderName, true); - uri.AppendPath("/detectors/", false); - uri.AppendPath(detectorName, true); - if (startTime != null) - { - uri.AppendQuery("startTime", startTime.Value, "O", true); - } - if (endTime != null) - { - uri.AppendQuery("endTime", endTime.Value, "O", true); - } - if (timeGrain != null) - { - uri.AppendQuery("timeGrain", timeGrain, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Microsoft.CertificateRegistration call to get a detector response from App Lens. - /// Name of the resource group to which the resource belongs. - /// The certificate order name for which the response is needed. - /// The detector name which needs to be run. - /// The start time for detector response. - /// The end time for the detector response. - /// The time grain for the detector response. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetAppServiceCertificateOrderDetectorResponseAsync(string resourceGroupName, string certificateOrderName, string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - - using var message = CreateGetAppServiceCertificateOrderDetectorResponseRequest(resourceGroupName, certificateOrderName, detectorName, startTime, endTime, timeGrain); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Microsoft.CertificateRegistration call to get a detector response from App Lens. - /// Name of the resource group to which the resource belongs. - /// The certificate order name for which the response is needed. - /// The detector name which needs to be run. - /// The start time for detector response. - /// The end time for the detector response. - /// The time grain for the detector response. - /// The cancellation token to use. - /// , , or is null. - public Response GetAppServiceCertificateOrderDetectorResponse(string resourceGroupName, string certificateOrderName, string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - - using var message = CreateGetAppServiceCertificateOrderDetectorResponseRequest(resourceGroupName, certificateOrderName, detectorName, startTime, endTime, timeGrain); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListAppServiceCertificateOrderDetectorResponseNextPageRequest(string nextLink, string resourceGroupName, string certificateOrderName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The certificate order name for which the response is needed. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListAppServiceCertificateOrderDetectorResponseNextPageAsync(string nextLink, string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateListAppServiceCertificateOrderDetectorResponseNextPageRequest(nextLink, resourceGroupName, certificateOrderName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The certificate order name for which the response is needed. - /// The cancellation token to use. - /// , , or is null. - public Response ListAppServiceCertificateOrderDetectorResponseNextPage(string nextLink, string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (certificateOrderName == null) - { - throw new ArgumentNullException(nameof(certificateOrderName)); - } - - using var message = CreateListAppServiceCertificateOrderDetectorResponseNextPageRequest(nextLink, resourceGroupName, certificateOrderName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateRegistrationProviderRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateRegistrationProviderRestClient.cs deleted file mode 100644 index 23fdf0c0400f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateRegistrationProviderRestClient.cs +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class CertificateRegistrationProviderRestClient - { - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of CertificateRegistrationProviderRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// server parameter. - /// Api Version. - /// is null. - public CertificateRegistrationProviderRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint = null, string apiVersion = "2020-12-01") - { - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListOperationsRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.CertificateRegistration/operations", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - /// The cancellation token to use. - public async Task> ListOperationsAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListOperationsRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmOperationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - /// The cancellation token to use. - public Response ListOperations(CancellationToken cancellationToken = default) - { - using var message = CreateListOperationsRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmOperationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOperationsNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListOperationsNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListOperationsNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmOperationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListOperationsNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListOperationsNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmOperationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesRestClient.cs deleted file mode 100644 index 5456e15582c3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesRestClient.cs +++ /dev/null @@ -1,685 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class CertificatesRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of CertificatesRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public CertificatesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListRequest(string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/certificates", false); - uri.AppendQuery("api-version", apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all certificates for a subscription. - /// Return only information specified in the filter (using OData syntax). For example: $filter=KeyVaultId eq 'KeyVaultId'. - /// The cancellation token to use. - public async Task> ListAsync(string filter = null, CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CertificateCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all certificates for a subscription. - /// Return only information specified in the filter (using OData syntax). For example: $filter=KeyVaultId eq 'KeyVaultId'. - /// The cancellation token to use. - public Response List(string filter = null, CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CertificateCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/certificates", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all certificates in a resource group. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CertificateCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all certificates in a resource group. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CertificateCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/certificates/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a certificate. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate. - /// The cancellation token to use. - /// or is null. - public async Task> GetAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Certificate value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Certificate.DeserializeCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a certificate. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate. - /// The cancellation token to use. - /// or is null. - public Response Get(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Certificate value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Certificate.DeserializeCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string name, Certificate certificateEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/certificates/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(certificateEnvelope); - request.Content = content; - return message; - } - - /// Description for Create or update a certificate. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate. - /// Details of certificate, if it exists already. - /// The cancellation token to use. - /// , , or is null. - public async Task> CreateOrUpdateAsync(string resourceGroupName, string name, Certificate certificateEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (certificateEnvelope == null) - { - throw new ArgumentNullException(nameof(certificateEnvelope)); - } - - using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, certificateEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Certificate value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Certificate.DeserializeCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create or update a certificate. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate. - /// Details of certificate, if it exists already. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdate(string resourceGroupName, string name, Certificate certificateEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (certificateEnvelope == null) - { - throw new ArgumentNullException(nameof(certificateEnvelope)); - } - - using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, certificateEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Certificate value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Certificate.DeserializeCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/certificates/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a certificate. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate. - /// The cancellation token to use. - /// or is null. - public async Task DeleteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a certificate. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate. - /// The cancellation token to use. - /// or is null. - public Response Delete(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string resourceGroupName, string name, CertificatePatchResource certificateEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/certificates/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(certificateEnvelope); - request.Content = content; - return message; - } - - /// Description for Create or update a certificate. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate. - /// Details of certificate, if it exists already. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateAsync(string resourceGroupName, string name, CertificatePatchResource certificateEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (certificateEnvelope == null) - { - throw new ArgumentNullException(nameof(certificateEnvelope)); - } - - using var message = CreateUpdateRequest(resourceGroupName, name, certificateEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Certificate value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Certificate.DeserializeCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create or update a certificate. - /// Name of the resource group to which the resource belongs. - /// Name of the certificate. - /// Details of certificate, if it exists already. - /// The cancellation token to use. - /// , , or is null. - public Response Update(string resourceGroupName, string name, CertificatePatchResource certificateEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (certificateEnvelope == null) - { - throw new ArgumentNullException(nameof(certificateEnvelope)); - } - - using var message = CreateUpdateRequest(resourceGroupName, name, certificateEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Certificate value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Certificate.DeserializeCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all certificates for a subscription. - /// The URL to the next page of results. - /// Return only information specified in the filter (using OData syntax). For example: $filter=KeyVaultId eq 'KeyVaultId'. - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CertificateCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all certificates for a subscription. - /// The URL to the next page of results. - /// Return only information specified in the filter (using OData syntax). For example: $filter=KeyVaultId eq 'KeyVaultId'. - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CertificateCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all certificates in a resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CertificateCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all certificates in a resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CertificateCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CertificateCollection.DeserializeCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DeletedWebAppsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DeletedWebAppsRestClient.cs deleted file mode 100644 index 0692eebd419e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DeletedWebAppsRestClient.cs +++ /dev/null @@ -1,408 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class DeletedWebAppsRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of DeletedWebAppsRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public DeletedWebAppsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/deletedSites", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all deleted apps for a subscription. - /// The cancellation token to use. - public async Task> ListAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeletedWebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all deleted apps for a subscription. - /// The cancellation token to use. - public Response List(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeletedWebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByLocationRequest(string location) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/deletedSites", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all deleted apps for a subscription at location. - /// The String to use. - /// The cancellation token to use. - /// is null. - public async Task> ListByLocationAsync(string location, CancellationToken cancellationToken = default) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - using var message = CreateListByLocationRequest(location); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeletedWebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all deleted apps for a subscription at location. - /// The String to use. - /// The cancellation token to use. - /// is null. - public Response ListByLocation(string location, CancellationToken cancellationToken = default) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - using var message = CreateListByLocationRequest(location); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeletedWebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetDeletedWebAppByLocationRequest(string location, string deletedSiteId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/deletedSites/", false); - uri.AppendPath(deletedSiteId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get deleted app for a subscription at location. - /// The String to use. - /// The numeric ID of the deleted app, e.g. 12345. - /// The cancellation token to use. - /// or is null. - public async Task> GetDeletedWebAppByLocationAsync(string location, string deletedSiteId, CancellationToken cancellationToken = default) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - if (deletedSiteId == null) - { - throw new ArgumentNullException(nameof(deletedSiteId)); - } - - using var message = CreateGetDeletedWebAppByLocationRequest(location, deletedSiteId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeletedSite value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeletedSite.DeserializeDeletedSite(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get deleted app for a subscription at location. - /// The String to use. - /// The numeric ID of the deleted app, e.g. 12345. - /// The cancellation token to use. - /// or is null. - public Response GetDeletedWebAppByLocation(string location, string deletedSiteId, CancellationToken cancellationToken = default) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - if (deletedSiteId == null) - { - throw new ArgumentNullException(nameof(deletedSiteId)); - } - - using var message = CreateGetDeletedWebAppByLocationRequest(location, deletedSiteId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeletedSite value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeletedSite.DeserializeDeletedSite(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all deleted apps for a subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeletedWebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all deleted apps for a subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeletedWebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string location) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all deleted apps for a subscription at location. - /// The URL to the next page of results. - /// The String to use. - /// The cancellation token to use. - /// or is null. - public async Task> ListByLocationNextPageAsync(string nextLink, string location, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - using var message = CreateListByLocationNextPageRequest(nextLink, location); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeletedWebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all deleted apps for a subscription at location. - /// The URL to the next page of results. - /// The String to use. - /// The cancellation token to use. - /// or is null. - public Response ListByLocationNextPage(string nextLink, string location, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - using var message = CreateListByLocationNextPageRequest(nextLink, location); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeletedWebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeletedWebAppCollection.DeserializeDeletedWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DiagnosticsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DiagnosticsRestClient.cs deleted file mode 100644 index 4c327025eb9e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DiagnosticsRestClient.cs +++ /dev/null @@ -1,3301 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class DiagnosticsRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of DiagnosticsRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public DiagnosticsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListHostingEnvironmentDetectorResponsesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/detectors", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List Hosting Environment Detector Responses. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// The cancellation token to use. - /// or is null. - public async Task> ListHostingEnvironmentDetectorResponsesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHostingEnvironmentDetectorResponsesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List Hosting Environment Detector Responses. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// The cancellation token to use. - /// or is null. - public Response ListHostingEnvironmentDetectorResponses(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHostingEnvironmentDetectorResponsesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetHostingEnvironmentDetectorResponseRequest(string resourceGroupName, string name, string detectorName, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(name, true); - uri.AppendPath("/detectors/", false); - uri.AppendPath(detectorName, true); - if (startTime != null) - { - uri.AppendQuery("startTime", startTime.Value, "O", true); - } - if (endTime != null) - { - uri.AppendQuery("endTime", endTime.Value, "O", true); - } - if (timeGrain != null) - { - uri.AppendQuery("timeGrain", timeGrain, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Hosting Environment Detector Response. - /// Name of the resource group to which the resource belongs. - /// App Service Environment Name. - /// Detector Resource Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetHostingEnvironmentDetectorResponseAsync(string resourceGroupName, string name, string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - - using var message = CreateGetHostingEnvironmentDetectorResponseRequest(resourceGroupName, name, detectorName, startTime, endTime, timeGrain); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Hosting Environment Detector Response. - /// Name of the resource group to which the resource belongs. - /// App Service Environment Name. - /// Detector Resource Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , or is null. - public Response GetHostingEnvironmentDetectorResponse(string resourceGroupName, string name, string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - - using var message = CreateGetHostingEnvironmentDetectorResponseRequest(resourceGroupName, name, detectorName, startTime, endTime, timeGrain); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteDetectorResponsesRequest(string resourceGroupName, string siteName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/detectors", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List Site Detector Responses. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// The cancellation token to use. - /// or is null. - public async Task> ListSiteDetectorResponsesAsync(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListSiteDetectorResponsesRequest(resourceGroupName, siteName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List Site Detector Responses. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// The cancellation token to use. - /// or is null. - public Response ListSiteDetectorResponses(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListSiteDetectorResponsesRequest(resourceGroupName, siteName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteDetectorResponseRequest(string resourceGroupName, string siteName, string detectorName, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/detectors/", false); - uri.AppendPath(detectorName, true); - if (startTime != null) - { - uri.AppendQuery("startTime", startTime.Value, "O", true); - } - if (endTime != null) - { - uri.AppendQuery("endTime", endTime.Value, "O", true); - } - if (timeGrain != null) - { - uri.AppendQuery("timeGrain", timeGrain, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get site detector response. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Detector Resource Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetSiteDetectorResponseAsync(string resourceGroupName, string siteName, string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - - using var message = CreateGetSiteDetectorResponseRequest(resourceGroupName, siteName, detectorName, startTime, endTime, timeGrain); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get site detector response. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Detector Resource Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , or is null. - public Response GetSiteDetectorResponse(string resourceGroupName, string siteName, string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - - using var message = CreateGetSiteDetectorResponseRequest(resourceGroupName, siteName, detectorName, startTime, endTime, timeGrain); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteDiagnosticCategoriesRequest(string resourceGroupName, string siteName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/diagnostics", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Diagnostics Categories. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// The cancellation token to use. - /// or is null. - public async Task> ListSiteDiagnosticCategoriesAsync(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListSiteDiagnosticCategoriesRequest(resourceGroupName, siteName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticCategoryCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Diagnostics Categories. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// The cancellation token to use. - /// or is null. - public Response ListSiteDiagnosticCategories(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListSiteDiagnosticCategoriesRequest(resourceGroupName, siteName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticCategoryCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteDiagnosticCategoryRequest(string resourceGroupName, string siteName, string diagnosticCategory) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Diagnostics Category. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetSiteDiagnosticCategoryAsync(string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - - using var message = CreateGetSiteDiagnosticCategoryRequest(resourceGroupName, siteName, diagnosticCategory); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticCategory value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticCategory.DeserializeDiagnosticCategory(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Diagnostics Category. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// The cancellation token to use. - /// , , or is null. - public Response GetSiteDiagnosticCategory(string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - - using var message = CreateGetSiteDiagnosticCategoryRequest(resourceGroupName, siteName, diagnosticCategory); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticCategory value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticCategory.DeserializeDiagnosticCategory(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteAnalysesRequest(string resourceGroupName, string siteName, string diagnosticCategory) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendPath("/analyses", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Site Analyses. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSiteAnalysesAsync(string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - - using var message = CreateListSiteAnalysesRequest(resourceGroupName, siteName, diagnosticCategory); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticAnalysisCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Site Analyses. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// The cancellation token to use. - /// , , or is null. - public Response ListSiteAnalyses(string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - - using var message = CreateListSiteAnalysesRequest(resourceGroupName, siteName, diagnosticCategory); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticAnalysisCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteAnalysisRequest(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendPath("/analyses/", false); - uri.AppendPath(analysisName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Site Analysis. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Analysis Name. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetSiteAnalysisAsync(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (analysisName == null) - { - throw new ArgumentNullException(nameof(analysisName)); - } - - using var message = CreateGetSiteAnalysisRequest(resourceGroupName, siteName, diagnosticCategory, analysisName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AnalysisDefinition value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AnalysisDefinition.DeserializeAnalysisDefinition(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Site Analysis. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Analysis Name. - /// The cancellation token to use. - /// , , , or is null. - public Response GetSiteAnalysis(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (analysisName == null) - { - throw new ArgumentNullException(nameof(analysisName)); - } - - using var message = CreateGetSiteAnalysisRequest(resourceGroupName, siteName, diagnosticCategory, analysisName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AnalysisDefinition value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AnalysisDefinition.DeserializeAnalysisDefinition(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateExecuteSiteAnalysisRequest(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendPath("/analyses/", false); - uri.AppendPath(analysisName, true); - uri.AppendPath("/execute", false); - if (startTime != null) - { - uri.AppendQuery("startTime", startTime.Value, "O", true); - } - if (endTime != null) - { - uri.AppendQuery("endTime", endTime.Value, "O", true); - } - if (timeGrain != null) - { - uri.AppendQuery("timeGrain", timeGrain, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Execute Analysis. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Category Name. - /// Analysis Resource Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ExecuteSiteAnalysisAsync(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (analysisName == null) - { - throw new ArgumentNullException(nameof(analysisName)); - } - - using var message = CreateExecuteSiteAnalysisRequest(resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticAnalysis value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticAnalysis.DeserializeDiagnosticAnalysis(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Execute Analysis. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Category Name. - /// Analysis Resource Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , , or is null. - public Response ExecuteSiteAnalysis(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (analysisName == null) - { - throw new ArgumentNullException(nameof(analysisName)); - } - - using var message = CreateExecuteSiteAnalysisRequest(resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticAnalysis value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticAnalysis.DeserializeDiagnosticAnalysis(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteDetectorsRequest(string resourceGroupName, string siteName, string diagnosticCategory) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendPath("/detectors", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Detectors. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSiteDetectorsAsync(string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - - using var message = CreateListSiteDetectorsRequest(resourceGroupName, siteName, diagnosticCategory); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticDetectorCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Detectors. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// The cancellation token to use. - /// , , or is null. - public Response ListSiteDetectors(string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - - using var message = CreateListSiteDetectorsRequest(resourceGroupName, siteName, diagnosticCategory); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticDetectorCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteDetectorRequest(string resourceGroupName, string siteName, string diagnosticCategory, string detectorName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendPath("/detectors/", false); - uri.AppendPath(detectorName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Detector. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Detector Name. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetSiteDetectorAsync(string resourceGroupName, string siteName, string diagnosticCategory, string detectorName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - - using var message = CreateGetSiteDetectorRequest(resourceGroupName, siteName, diagnosticCategory, detectorName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorDefinition value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorDefinition.DeserializeDetectorDefinition(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Detector. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Detector Name. - /// The cancellation token to use. - /// , , , or is null. - public Response GetSiteDetector(string resourceGroupName, string siteName, string diagnosticCategory, string detectorName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - - using var message = CreateGetSiteDetectorRequest(resourceGroupName, siteName, diagnosticCategory, detectorName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorDefinition value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorDefinition.DeserializeDetectorDefinition(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateExecuteSiteDetectorRequest(string resourceGroupName, string siteName, string detectorName, string diagnosticCategory, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendPath("/detectors/", false); - uri.AppendPath(detectorName, true); - uri.AppendPath("/execute", false); - if (startTime != null) - { - uri.AppendQuery("startTime", startTime.Value, "O", true); - } - if (endTime != null) - { - uri.AppendQuery("endTime", endTime.Value, "O", true); - } - if (timeGrain != null) - { - uri.AppendQuery("timeGrain", timeGrain, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Execute Detector. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Detector Resource Name. - /// Category Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ExecuteSiteDetectorAsync(string resourceGroupName, string siteName, string detectorName, string diagnosticCategory, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - - using var message = CreateExecuteSiteDetectorRequest(resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticDetectorResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticDetectorResponse.DeserializeDiagnosticDetectorResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Execute Detector. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Detector Resource Name. - /// Category Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , , or is null. - public Response ExecuteSiteDetector(string resourceGroupName, string siteName, string detectorName, string diagnosticCategory, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - - using var message = CreateExecuteSiteDetectorRequest(resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticDetectorResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticDetectorResponse.DeserializeDiagnosticDetectorResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteDetectorResponsesSlotRequest(string resourceGroupName, string siteName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/detectors", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List Site Detector Responses. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Slot Name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSiteDetectorResponsesSlotAsync(string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteDetectorResponsesSlotRequest(resourceGroupName, siteName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List Site Detector Responses. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Slot Name. - /// The cancellation token to use. - /// , , or is null. - public Response ListSiteDetectorResponsesSlot(string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteDetectorResponsesSlotRequest(resourceGroupName, siteName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteDetectorResponseSlotRequest(string resourceGroupName, string siteName, string detectorName, string slot, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/detectors/", false); - uri.AppendPath(detectorName, true); - if (startTime != null) - { - uri.AppendQuery("startTime", startTime.Value, "O", true); - } - if (endTime != null) - { - uri.AppendQuery("endTime", endTime.Value, "O", true); - } - if (timeGrain != null) - { - uri.AppendQuery("timeGrain", timeGrain, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get site detector response. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Detector Resource Name. - /// Slot Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetSiteDetectorResponseSlotAsync(string resourceGroupName, string siteName, string detectorName, string slot, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteDetectorResponseSlotRequest(resourceGroupName, siteName, detectorName, slot, startTime, endTime, timeGrain); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get site detector response. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Detector Resource Name. - /// Slot Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , , or is null. - public Response GetSiteDetectorResponseSlot(string resourceGroupName, string siteName, string detectorName, string slot, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteDetectorResponseSlotRequest(resourceGroupName, siteName, detectorName, slot, startTime, endTime, timeGrain); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorResponse.DeserializeDetectorResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteDiagnosticCategoriesSlotRequest(string resourceGroupName, string siteName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/diagnostics", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Diagnostics Categories. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Slot Name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSiteDiagnosticCategoriesSlotAsync(string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteDiagnosticCategoriesSlotRequest(resourceGroupName, siteName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticCategoryCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Diagnostics Categories. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Slot Name. - /// The cancellation token to use. - /// , , or is null. - public Response ListSiteDiagnosticCategoriesSlot(string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteDiagnosticCategoriesSlotRequest(resourceGroupName, siteName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticCategoryCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteDiagnosticCategorySlotRequest(string resourceGroupName, string siteName, string diagnosticCategory, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Diagnostics Category. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Slot Name. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetSiteDiagnosticCategorySlotAsync(string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteDiagnosticCategorySlotRequest(resourceGroupName, siteName, diagnosticCategory, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticCategory value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticCategory.DeserializeDiagnosticCategory(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Diagnostics Category. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Slot Name. - /// The cancellation token to use. - /// , , , or is null. - public Response GetSiteDiagnosticCategorySlot(string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteDiagnosticCategorySlotRequest(resourceGroupName, siteName, diagnosticCategory, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticCategory value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticCategory.DeserializeDiagnosticCategory(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteAnalysesSlotRequest(string resourceGroupName, string siteName, string diagnosticCategory, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendPath("/analyses", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Site Analyses. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Slot Name. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListSiteAnalysesSlotAsync(string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteAnalysesSlotRequest(resourceGroupName, siteName, diagnosticCategory, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticAnalysisCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Site Analyses. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Slot Name. - /// The cancellation token to use. - /// , , , or is null. - public Response ListSiteAnalysesSlot(string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteAnalysesSlotRequest(resourceGroupName, siteName, diagnosticCategory, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticAnalysisCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteAnalysisSlotRequest(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendPath("/analyses/", false); - uri.AppendPath(analysisName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Site Analysis. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Analysis Name. - /// Slot - optional. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> GetSiteAnalysisSlotAsync(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (analysisName == null) - { - throw new ArgumentNullException(nameof(analysisName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteAnalysisSlotRequest(resourceGroupName, siteName, diagnosticCategory, analysisName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AnalysisDefinition value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AnalysisDefinition.DeserializeAnalysisDefinition(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Site Analysis. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Analysis Name. - /// Slot - optional. - /// The cancellation token to use. - /// , , , , or is null. - public Response GetSiteAnalysisSlot(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (analysisName == null) - { - throw new ArgumentNullException(nameof(analysisName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteAnalysisSlotRequest(resourceGroupName, siteName, diagnosticCategory, analysisName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AnalysisDefinition value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AnalysisDefinition.DeserializeAnalysisDefinition(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateExecuteSiteAnalysisSlotRequest(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, string slot, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendPath("/analyses/", false); - uri.AppendPath(analysisName, true); - uri.AppendPath("/execute", false); - if (startTime != null) - { - uri.AppendQuery("startTime", startTime.Value, "O", true); - } - if (endTime != null) - { - uri.AppendQuery("endTime", endTime.Value, "O", true); - } - if (timeGrain != null) - { - uri.AppendQuery("timeGrain", timeGrain, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Execute Analysis. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Category Name. - /// Analysis Resource Name. - /// Slot Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ExecuteSiteAnalysisSlotAsync(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, string slot, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (analysisName == null) - { - throw new ArgumentNullException(nameof(analysisName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateExecuteSiteAnalysisSlotRequest(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, startTime, endTime, timeGrain); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticAnalysis value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticAnalysis.DeserializeDiagnosticAnalysis(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Execute Analysis. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Category Name. - /// Analysis Resource Name. - /// Slot Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , , , or is null. - public Response ExecuteSiteAnalysisSlot(string resourceGroupName, string siteName, string diagnosticCategory, string analysisName, string slot, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (analysisName == null) - { - throw new ArgumentNullException(nameof(analysisName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateExecuteSiteAnalysisSlotRequest(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, startTime, endTime, timeGrain); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticAnalysis value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticAnalysis.DeserializeDiagnosticAnalysis(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteDetectorsSlotRequest(string resourceGroupName, string siteName, string diagnosticCategory, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendPath("/detectors", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Detectors. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Slot Name. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListSiteDetectorsSlotAsync(string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteDetectorsSlotRequest(resourceGroupName, siteName, diagnosticCategory, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticDetectorCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Detectors. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Slot Name. - /// The cancellation token to use. - /// , , , or is null. - public Response ListSiteDetectorsSlot(string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteDetectorsSlotRequest(resourceGroupName, siteName, diagnosticCategory, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticDetectorCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteDetectorSlotRequest(string resourceGroupName, string siteName, string diagnosticCategory, string detectorName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendPath("/detectors/", false); - uri.AppendPath(detectorName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Detector. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Detector Name. - /// Slot Name. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> GetSiteDetectorSlotAsync(string resourceGroupName, string siteName, string diagnosticCategory, string detectorName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteDetectorSlotRequest(resourceGroupName, siteName, diagnosticCategory, detectorName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorDefinition value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorDefinition.DeserializeDetectorDefinition(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Detector. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Detector Name. - /// Slot Name. - /// The cancellation token to use. - /// , , , , or is null. - public Response GetSiteDetectorSlot(string resourceGroupName, string siteName, string diagnosticCategory, string detectorName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteDetectorSlotRequest(resourceGroupName, siteName, diagnosticCategory, detectorName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorDefinition value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorDefinition.DeserializeDetectorDefinition(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateExecuteSiteDetectorSlotRequest(string resourceGroupName, string siteName, string detectorName, string diagnosticCategory, string slot, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/diagnostics/", false); - uri.AppendPath(diagnosticCategory, true); - uri.AppendPath("/detectors/", false); - uri.AppendPath(detectorName, true); - uri.AppendPath("/execute", false); - if (startTime != null) - { - uri.AppendQuery("startTime", startTime.Value, "O", true); - } - if (endTime != null) - { - uri.AppendQuery("endTime", endTime.Value, "O", true); - } - if (timeGrain != null) - { - uri.AppendQuery("timeGrain", timeGrain, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Execute Detector. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Detector Resource Name. - /// Category Name. - /// Slot Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ExecuteSiteDetectorSlotAsync(string resourceGroupName, string siteName, string detectorName, string diagnosticCategory, string slot, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateExecuteSiteDetectorSlotRequest(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, startTime, endTime, timeGrain); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticDetectorResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticDetectorResponse.DeserializeDiagnosticDetectorResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Execute Detector. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Detector Resource Name. - /// Category Name. - /// Slot Name. - /// Start Time. - /// End Time. - /// Time Grain. - /// The cancellation token to use. - /// , , , , or is null. - public Response ExecuteSiteDetectorSlot(string resourceGroupName, string siteName, string detectorName, string diagnosticCategory, string slot, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (detectorName == null) - { - throw new ArgumentNullException(nameof(detectorName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateExecuteSiteDetectorSlotRequest(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, startTime, endTime, timeGrain); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticDetectorResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticDetectorResponse.DeserializeDiagnosticDetectorResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHostingEnvironmentDetectorResponsesNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List Hosting Environment Detector Responses. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListHostingEnvironmentDetectorResponsesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHostingEnvironmentDetectorResponsesNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List Hosting Environment Detector Responses. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// The cancellation token to use. - /// , , or is null. - public Response ListHostingEnvironmentDetectorResponsesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHostingEnvironmentDetectorResponsesNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteDetectorResponsesNextPageRequest(string nextLink, string resourceGroupName, string siteName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List Site Detector Responses. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSiteDetectorResponsesNextPageAsync(string nextLink, string resourceGroupName, string siteName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListSiteDetectorResponsesNextPageRequest(nextLink, resourceGroupName, siteName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List Site Detector Responses. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// The cancellation token to use. - /// , , or is null. - public Response ListSiteDetectorResponsesNextPage(string nextLink, string resourceGroupName, string siteName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListSiteDetectorResponsesNextPageRequest(nextLink, resourceGroupName, siteName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteDiagnosticCategoriesNextPageRequest(string nextLink, string resourceGroupName, string siteName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Diagnostics Categories. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSiteDiagnosticCategoriesNextPageAsync(string nextLink, string resourceGroupName, string siteName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListSiteDiagnosticCategoriesNextPageRequest(nextLink, resourceGroupName, siteName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticCategoryCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Diagnostics Categories. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// The cancellation token to use. - /// , , or is null. - public Response ListSiteDiagnosticCategoriesNextPage(string nextLink, string resourceGroupName, string siteName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListSiteDiagnosticCategoriesNextPageRequest(nextLink, resourceGroupName, siteName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticCategoryCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteAnalysesNextPageRequest(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Site Analyses. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListSiteAnalysesNextPageAsync(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - - using var message = CreateListSiteAnalysesNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticAnalysisCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Site Analyses. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// The cancellation token to use. - /// , , , or is null. - public Response ListSiteAnalysesNextPage(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - - using var message = CreateListSiteAnalysesNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticAnalysisCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteDetectorsNextPageRequest(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Detectors. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListSiteDetectorsNextPageAsync(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - - using var message = CreateListSiteDetectorsNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticDetectorCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Detectors. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// The cancellation token to use. - /// , , , or is null. - public Response ListSiteDetectorsNextPage(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - - using var message = CreateListSiteDetectorsNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticDetectorCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteDetectorResponsesSlotNextPageRequest(string nextLink, string resourceGroupName, string siteName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List Site Detector Responses. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Slot Name. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListSiteDetectorResponsesSlotNextPageAsync(string nextLink, string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteDetectorResponsesSlotNextPageRequest(nextLink, resourceGroupName, siteName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List Site Detector Responses. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Slot Name. - /// The cancellation token to use. - /// , , , or is null. - public Response ListSiteDetectorResponsesSlotNextPage(string nextLink, string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteDetectorResponsesSlotNextPageRequest(nextLink, resourceGroupName, siteName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DetectorResponseCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DetectorResponseCollection.DeserializeDetectorResponseCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteDiagnosticCategoriesSlotNextPageRequest(string nextLink, string resourceGroupName, string siteName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Diagnostics Categories. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Slot Name. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListSiteDiagnosticCategoriesSlotNextPageAsync(string nextLink, string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteDiagnosticCategoriesSlotNextPageRequest(nextLink, resourceGroupName, siteName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticCategoryCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Diagnostics Categories. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Slot Name. - /// The cancellation token to use. - /// , , , or is null. - public Response ListSiteDiagnosticCategoriesSlotNextPage(string nextLink, string resourceGroupName, string siteName, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteDiagnosticCategoriesSlotNextPageRequest(nextLink, resourceGroupName, siteName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticCategoryCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticCategoryCollection.DeserializeDiagnosticCategoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteAnalysesSlotNextPageRequest(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Site Analyses. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Slot Name. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListSiteAnalysesSlotNextPageAsync(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteAnalysesSlotNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticAnalysisCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Site Analyses. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Slot Name. - /// The cancellation token to use. - /// , , , , or is null. - public Response ListSiteAnalysesSlotNextPage(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteAnalysesSlotNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticAnalysisCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticAnalysisCollection.DeserializeDiagnosticAnalysisCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteDetectorsSlotNextPageRequest(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get Detectors. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Slot Name. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListSiteDetectorsSlotNextPageAsync(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteDetectorsSlotNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiagnosticDetectorCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get Detectors. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site Name. - /// Diagnostic Category. - /// Slot Name. - /// The cancellation token to use. - /// , , , , or is null. - public Response ListSiteDetectorsSlotNextPage(string nextLink, string resourceGroupName, string siteName, string diagnosticCategory, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (diagnosticCategory == null) - { - throw new ArgumentNullException(nameof(diagnosticCategory)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteDetectorsSlotNextPageRequest(nextLink, resourceGroupName, siteName, diagnosticCategory, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiagnosticDetectorCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiagnosticDetectorCollection.DeserializeDiagnosticDetectorCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainRegistrationProviderRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainRegistrationProviderRestClient.cs deleted file mode 100644 index 2f81172b3f66..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainRegistrationProviderRestClient.cs +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class DomainRegistrationProviderRestClient - { - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of DomainRegistrationProviderRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// server parameter. - /// Api Version. - /// is null. - public DomainRegistrationProviderRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint = null, string apiVersion = "2020-12-01") - { - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListOperationsRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.DomainRegistration/operations", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - /// The cancellation token to use. - public async Task> ListOperationsAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListOperationsRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmOperationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - /// The cancellation token to use. - public Response ListOperations(CancellationToken cancellationToken = default) - { - using var message = CreateListOperationsRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmOperationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOperationsNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListOperationsNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListOperationsNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmOperationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListOperationsNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListOperationsNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmOperationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsRestClient.cs deleted file mode 100644 index c42efefded17..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsRestClient.cs +++ /dev/null @@ -1,1607 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class DomainsRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of DomainsRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public DomainsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateCheckAvailabilityRequest(NameIdentifier identifier) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/checkDomainAvailability", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(identifier); - request.Content = content; - return message; - } - - /// Description for Check if a domain is available for registration. - /// Name of the domain. - /// The cancellation token to use. - /// is null. - public async Task> CheckAvailabilityAsync(NameIdentifier identifier, CancellationToken cancellationToken = default) - { - if (identifier == null) - { - throw new ArgumentNullException(nameof(identifier)); - } - - using var message = CreateCheckAvailabilityRequest(identifier); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DomainAvailabilityCheckResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DomainAvailabilityCheckResult.DeserializeDomainAvailabilityCheckResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Check if a domain is available for registration. - /// Name of the domain. - /// The cancellation token to use. - /// is null. - public Response CheckAvailability(NameIdentifier identifier, CancellationToken cancellationToken = default) - { - if (identifier == null) - { - throw new ArgumentNullException(nameof(identifier)); - } - - using var message = CreateCheckAvailabilityRequest(identifier); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DomainAvailabilityCheckResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DomainAvailabilityCheckResult.DeserializeDomainAvailabilityCheckResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/domains", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all domains in a subscription. - /// The cancellation token to use. - public async Task> ListAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DomainCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DomainCollection.DeserializeDomainCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all domains in a subscription. - /// The cancellation token to use. - public Response List(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DomainCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DomainCollection.DeserializeDomainCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetControlCenterSsoRequestRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/generateSsoRequest", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Generate a single sign-on request for the domain management portal. - /// The cancellation token to use. - public async Task> GetControlCenterSsoRequestAsync(CancellationToken cancellationToken = default) - { - using var message = CreateGetControlCenterSsoRequestRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DomainControlCenterSsoRequest value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DomainControlCenterSsoRequest.DeserializeDomainControlCenterSsoRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Generate a single sign-on request for the domain management portal. - /// The cancellation token to use. - public Response GetControlCenterSsoRequest(CancellationToken cancellationToken = default) - { - using var message = CreateGetControlCenterSsoRequestRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DomainControlCenterSsoRequest value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DomainControlCenterSsoRequest.DeserializeDomainControlCenterSsoRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRecommendationsRequest(DomainRecommendationSearchParameters parameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/listDomainRecommendations", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(parameters); - request.Content = content; - return message; - } - - /// Description for Get domain name recommendations based on keywords. - /// Search parameters for domain name recommendations. - /// The cancellation token to use. - /// is null. - public async Task> ListRecommendationsAsync(DomainRecommendationSearchParameters parameters, CancellationToken cancellationToken = default) - { - if (parameters == null) - { - throw new ArgumentNullException(nameof(parameters)); - } - - using var message = CreateListRecommendationsRequest(parameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NameIdentifierCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NameIdentifierCollection.DeserializeNameIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get domain name recommendations based on keywords. - /// Search parameters for domain name recommendations. - /// The cancellation token to use. - /// is null. - public Response ListRecommendations(DomainRecommendationSearchParameters parameters, CancellationToken cancellationToken = default) - { - if (parameters == null) - { - throw new ArgumentNullException(nameof(parameters)); - } - - using var message = CreateListRecommendationsRequest(parameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NameIdentifierCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NameIdentifierCollection.DeserializeNameIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/domains", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all domains in a resource group. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DomainCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DomainCollection.DeserializeDomainCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all domains in a resource group. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DomainCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DomainCollection.DeserializeDomainCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string resourceGroupName, string domainName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); - uri.AppendPath(domainName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a domain. - /// Name of the resource group to which the resource belongs. - /// Name of the domain. - /// The cancellation token to use. - /// or is null. - public async Task> GetAsync(string resourceGroupName, string domainName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateGetRequest(resourceGroupName, domainName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Domain value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Domain.DeserializeDomain(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a domain. - /// Name of the resource group to which the resource belongs. - /// Name of the domain. - /// The cancellation token to use. - /// or is null. - public Response Get(string resourceGroupName, string domainName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateGetRequest(resourceGroupName, domainName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Domain value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Domain.DeserializeDomain(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string domainName, Domain domain) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); - uri.AppendPath(domainName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(domain); - request.Content = content; - return message; - } - - /// Description for Creates or updates a domain. - /// Name of the resource group to which the resource belongs. - /// Name of the domain. - /// Domain registration information. - /// The cancellation token to use. - /// , , or is null. - public async Task CreateOrUpdateAsync(string resourceGroupName, string domainName, Domain domain, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (domain == null) - { - throw new ArgumentNullException(nameof(domain)); - } - - using var message = CreateCreateOrUpdateRequest(resourceGroupName, domainName, domain); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates or updates a domain. - /// Name of the resource group to which the resource belongs. - /// Name of the domain. - /// Domain registration information. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdate(string resourceGroupName, string domainName, Domain domain, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (domain == null) - { - throw new ArgumentNullException(nameof(domain)); - } - - using var message = CreateCreateOrUpdateRequest(resourceGroupName, domainName, domain); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string resourceGroupName, string domainName, bool? forceHardDeleteDomain) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); - uri.AppendPath(domainName, true); - if (forceHardDeleteDomain != null) - { - uri.AppendQuery("forceHardDeleteDomain", forceHardDeleteDomain.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a domain. - /// Name of the resource group to which the resource belongs. - /// Name of the domain. - /// Specify <code>true</code> to delete the domain immediately. The default is <code>false</code> which deletes the domain after 24 hours. - /// The cancellation token to use. - /// or is null. - public async Task DeleteAsync(string resourceGroupName, string domainName, bool? forceHardDeleteDomain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateDeleteRequest(resourceGroupName, domainName, forceHardDeleteDomain); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a domain. - /// Name of the resource group to which the resource belongs. - /// Name of the domain. - /// Specify <code>true</code> to delete the domain immediately. The default is <code>false</code> which deletes the domain after 24 hours. - /// The cancellation token to use. - /// or is null. - public Response Delete(string resourceGroupName, string domainName, bool? forceHardDeleteDomain = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateDeleteRequest(resourceGroupName, domainName, forceHardDeleteDomain); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string resourceGroupName, string domainName, DomainPatchResource domain) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); - uri.AppendPath(domainName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(domain); - request.Content = content; - return message; - } - - /// Description for Creates or updates a domain. - /// Name of the resource group to which the resource belongs. - /// Name of the domain. - /// Domain registration information. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateAsync(string resourceGroupName, string domainName, DomainPatchResource domain, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (domain == null) - { - throw new ArgumentNullException(nameof(domain)); - } - - using var message = CreateUpdateRequest(resourceGroupName, domainName, domain); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - { - Domain value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Domain.DeserializeDomain(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates or updates a domain. - /// Name of the resource group to which the resource belongs. - /// Name of the domain. - /// Domain registration information. - /// The cancellation token to use. - /// , , or is null. - public Response Update(string resourceGroupName, string domainName, DomainPatchResource domain, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (domain == null) - { - throw new ArgumentNullException(nameof(domain)); - } - - using var message = CreateUpdateRequest(resourceGroupName, domainName, domain); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - { - Domain value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Domain.DeserializeDomain(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOwnershipIdentifiersRequest(string resourceGroupName, string domainName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); - uri.AppendPath(domainName, true); - uri.AppendPath("/domainOwnershipIdentifiers", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Lists domain ownership identifiers. - /// Name of the resource group to which the resource belongs. - /// Name of domain. - /// The cancellation token to use. - /// or is null. - public async Task> ListOwnershipIdentifiersAsync(string resourceGroupName, string domainName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateListOwnershipIdentifiersRequest(resourceGroupName, domainName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DomainOwnershipIdentifierCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DomainOwnershipIdentifierCollection.DeserializeDomainOwnershipIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Lists domain ownership identifiers. - /// Name of the resource group to which the resource belongs. - /// Name of domain. - /// The cancellation token to use. - /// or is null. - public Response ListOwnershipIdentifiers(string resourceGroupName, string domainName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateListOwnershipIdentifiersRequest(resourceGroupName, domainName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DomainOwnershipIdentifierCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DomainOwnershipIdentifierCollection.DeserializeDomainOwnershipIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetOwnershipIdentifierRequest(string resourceGroupName, string domainName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); - uri.AppendPath(domainName, true); - uri.AppendPath("/domainOwnershipIdentifiers/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get ownership identifier for domain. - /// Name of the resource group to which the resource belongs. - /// Name of domain. - /// Name of identifier. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetOwnershipIdentifierAsync(string resourceGroupName, string domainName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetOwnershipIdentifierRequest(resourceGroupName, domainName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DomainOwnershipIdentifier value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get ownership identifier for domain. - /// Name of the resource group to which the resource belongs. - /// Name of domain. - /// Name of identifier. - /// The cancellation token to use. - /// , , or is null. - public Response GetOwnershipIdentifier(string resourceGroupName, string domainName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetOwnershipIdentifierRequest(resourceGroupName, domainName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DomainOwnershipIdentifier value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateOwnershipIdentifierRequest(string resourceGroupName, string domainName, string name, DomainOwnershipIdentifier domainOwnershipIdentifier) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); - uri.AppendPath(domainName, true); - uri.AppendPath("/domainOwnershipIdentifiers/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(domainOwnershipIdentifier); - request.Content = content; - return message; - } - - /// Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - /// Name of the resource group to which the resource belongs. - /// Name of domain. - /// Name of identifier. - /// A JSON representation of the domain ownership properties. - /// The cancellation token to use. - /// , , , or is null. - public async Task> CreateOrUpdateOwnershipIdentifierAsync(string resourceGroupName, string domainName, string name, DomainOwnershipIdentifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifier == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); - } - - using var message = CreateCreateOrUpdateOwnershipIdentifierRequest(resourceGroupName, domainName, name, domainOwnershipIdentifier); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DomainOwnershipIdentifier value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - /// Name of the resource group to which the resource belongs. - /// Name of domain. - /// Name of identifier. - /// A JSON representation of the domain ownership properties. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateOwnershipIdentifier(string resourceGroupName, string domainName, string name, DomainOwnershipIdentifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifier == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); - } - - using var message = CreateCreateOrUpdateOwnershipIdentifierRequest(resourceGroupName, domainName, name, domainOwnershipIdentifier); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DomainOwnershipIdentifier value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteOwnershipIdentifierRequest(string resourceGroupName, string domainName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); - uri.AppendPath(domainName, true); - uri.AppendPath("/domainOwnershipIdentifiers/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete ownership identifier for domain. - /// Name of the resource group to which the resource belongs. - /// Name of domain. - /// Name of identifier. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteOwnershipIdentifierAsync(string resourceGroupName, string domainName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteOwnershipIdentifierRequest(resourceGroupName, domainName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete ownership identifier for domain. - /// Name of the resource group to which the resource belongs. - /// Name of domain. - /// Name of identifier. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteOwnershipIdentifier(string resourceGroupName, string domainName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteOwnershipIdentifierRequest(resourceGroupName, domainName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateOwnershipIdentifierRequest(string resourceGroupName, string domainName, string name, DomainOwnershipIdentifier domainOwnershipIdentifier) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); - uri.AppendPath(domainName, true); - uri.AppendPath("/domainOwnershipIdentifiers/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(domainOwnershipIdentifier); - request.Content = content; - return message; - } - - /// Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - /// Name of the resource group to which the resource belongs. - /// Name of domain. - /// Name of identifier. - /// A JSON representation of the domain ownership properties. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateOwnershipIdentifierAsync(string resourceGroupName, string domainName, string name, DomainOwnershipIdentifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifier == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); - } - - using var message = CreateUpdateOwnershipIdentifierRequest(resourceGroupName, domainName, name, domainOwnershipIdentifier); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DomainOwnershipIdentifier value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier. - /// Name of the resource group to which the resource belongs. - /// Name of domain. - /// Name of identifier. - /// A JSON representation of the domain ownership properties. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateOwnershipIdentifier(string resourceGroupName, string domainName, string name, DomainOwnershipIdentifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifier == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); - } - - using var message = CreateUpdateOwnershipIdentifierRequest(resourceGroupName, domainName, name, domainOwnershipIdentifier); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DomainOwnershipIdentifier value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRenewRequest(string resourceGroupName, string domainName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/domains/", false); - uri.AppendPath(domainName, true); - uri.AppendPath("/renew", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Renew a domain. - /// Name of the resource group to which the resource belongs. - /// Name of the domain. - /// The cancellation token to use. - /// or is null. - public async Task RenewAsync(string resourceGroupName, string domainName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateRenewRequest(resourceGroupName, domainName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Renew a domain. - /// Name of the resource group to which the resource belongs. - /// Name of the domain. - /// The cancellation token to use. - /// or is null. - public Response Renew(string resourceGroupName, string domainName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateRenewRequest(resourceGroupName, domainName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all domains in a subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DomainCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DomainCollection.DeserializeDomainCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all domains in a subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DomainCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DomainCollection.DeserializeDomainCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRecommendationsNextPageRequest(string nextLink, DomainRecommendationSearchParameters parameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get domain name recommendations based on keywords. - /// The URL to the next page of results. - /// Search parameters for domain name recommendations. - /// The cancellation token to use. - /// or is null. - public async Task> ListRecommendationsNextPageAsync(string nextLink, DomainRecommendationSearchParameters parameters, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (parameters == null) - { - throw new ArgumentNullException(nameof(parameters)); - } - - using var message = CreateListRecommendationsNextPageRequest(nextLink, parameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NameIdentifierCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NameIdentifierCollection.DeserializeNameIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get domain name recommendations based on keywords. - /// The URL to the next page of results. - /// Search parameters for domain name recommendations. - /// The cancellation token to use. - /// or is null. - public Response ListRecommendationsNextPage(string nextLink, DomainRecommendationSearchParameters parameters, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (parameters == null) - { - throw new ArgumentNullException(nameof(parameters)); - } - - using var message = CreateListRecommendationsNextPageRequest(nextLink, parameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NameIdentifierCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NameIdentifierCollection.DeserializeNameIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all domains in a resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DomainCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DomainCollection.DeserializeDomainCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all domains in a resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DomainCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DomainCollection.DeserializeDomainCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOwnershipIdentifiersNextPageRequest(string nextLink, string resourceGroupName, string domainName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Lists domain ownership identifiers. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of domain. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListOwnershipIdentifiersNextPageAsync(string nextLink, string resourceGroupName, string domainName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateListOwnershipIdentifiersNextPageRequest(nextLink, resourceGroupName, domainName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DomainOwnershipIdentifierCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DomainOwnershipIdentifierCollection.DeserializeDomainOwnershipIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Lists domain ownership identifiers. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of domain. - /// The cancellation token to use. - /// , , or is null. - public Response ListOwnershipIdentifiersNextPage(string nextLink, string resourceGroupName, string domainName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateListOwnershipIdentifiersNextPageRequest(nextLink, resourceGroupName, domainName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DomainOwnershipIdentifierCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DomainOwnershipIdentifierCollection.DeserializeDomainOwnershipIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalRestClient.cs deleted file mode 100644 index e0ba77312f50..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalRestClient.cs +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class GlobalRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of GlobalRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public GlobalRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateGetDeletedWebAppRequest(string deletedSiteId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/deletedSites/", false); - uri.AppendPath(deletedSiteId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get deleted app for a subscription. - /// The numeric ID of the deleted app, e.g. 12345. - /// The cancellation token to use. - /// is null. - public async Task> GetDeletedWebAppAsync(string deletedSiteId, CancellationToken cancellationToken = default) - { - if (deletedSiteId == null) - { - throw new ArgumentNullException(nameof(deletedSiteId)); - } - - using var message = CreateGetDeletedWebAppRequest(deletedSiteId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeletedSite value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeletedSite.DeserializeDeletedSite(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get deleted app for a subscription. - /// The numeric ID of the deleted app, e.g. 12345. - /// The cancellation token to use. - /// is null. - public Response GetDeletedWebApp(string deletedSiteId, CancellationToken cancellationToken = default) - { - if (deletedSiteId == null) - { - throw new ArgumentNullException(nameof(deletedSiteId)); - } - - using var message = CreateGetDeletedWebAppRequest(deletedSiteId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeletedSite value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeletedSite.DeserializeDeletedSite(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetDeletedWebAppSnapshotsRequest(string deletedSiteId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/deletedSites/", false); - uri.AppendPath(deletedSiteId, true); - uri.AppendPath("/snapshots", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all deleted apps for a subscription. - /// The numeric ID of the deleted app, e.g. 12345. - /// The cancellation token to use. - /// is null. - public async Task>> GetDeletedWebAppSnapshotsAsync(string deletedSiteId, CancellationToken cancellationToken = default) - { - if (deletedSiteId == null) - { - throw new ArgumentNullException(nameof(deletedSiteId)); - } - - using var message = CreateGetDeletedWebAppSnapshotsRequest(deletedSiteId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(Snapshot.DeserializeSnapshot(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all deleted apps for a subscription. - /// The numeric ID of the deleted app, e.g. 12345. - /// The cancellation token to use. - /// is null. - public Response> GetDeletedWebAppSnapshots(string deletedSiteId, CancellationToken cancellationToken = default) - { - if (deletedSiteId == null) - { - throw new ArgumentNullException(nameof(deletedSiteId)); - } - - using var message = CreateGetDeletedWebAppSnapshotsRequest(deletedSiteId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(Snapshot.DeserializeSnapshot(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSubscriptionOperationWithAsyncResponseRequest(string location, string operationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/operations/", false); - uri.AppendPath(operationId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets an operation in a subscription and given region. - /// Location name. - /// Operation Id. - /// The cancellation token to use. - /// or is null. - public async Task GetSubscriptionOperationWithAsyncResponseAsync(string location, string operationId, CancellationToken cancellationToken = default) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - - using var message = CreateGetSubscriptionOperationWithAsyncResponseRequest(location, operationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets an operation in a subscription and given region. - /// Location name. - /// Operation Id. - /// The cancellation token to use. - /// or is null. - public Response GetSubscriptionOperationWithAsyncResponse(string location, string operationId, CancellationToken cancellationToken = default) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - - using var message = CreateGetSubscriptionOperationWithAsyncResponseRequest(location, operationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.Serialization.cs deleted file mode 100644 index 185184c847e6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.Serialization.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AbnormalTimePeriod : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(StartTime)) - { - writer.WritePropertyName("startTime"); - writer.WriteStringValue(StartTime.Value, "O"); - } - if (Optional.IsDefined(EndTime)) - { - writer.WritePropertyName("endTime"); - writer.WriteStringValue(EndTime.Value, "O"); - } - if (Optional.IsCollectionDefined(Events)) - { - writer.WritePropertyName("events"); - writer.WriteStartArray(); - foreach (var item in Events) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Solutions)) - { - writer.WritePropertyName("solutions"); - writer.WriteStartArray(); - foreach (var item in Solutions) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static AbnormalTimePeriod DeserializeAbnormalTimePeriod(JsonElement element) - { - Optional startTime = default; - Optional endTime = default; - Optional> events = default; - Optional> solutions = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("startTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("endTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - endTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("events")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DetectorAbnormalTimePeriod.DeserializeDetectorAbnormalTimePeriod(item)); - } - events = array; - continue; - } - if (property.NameEquals("solutions")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Solution.DeserializeSolution(item)); - } - solutions = array; - continue; - } - } - return new AbnormalTimePeriod(Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToList(events), Optional.ToList(solutions)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.cs index c7f6656d11fe..8d3638668527 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AbnormalTimePeriod.cs @@ -1,46 +1,77 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Class representing Abnormal Time Period identified in diagnosis. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Class representing Abnormal Time Period identified in diagnosis + /// public partial class AbnormalTimePeriod { - /// Initializes a new instance of AbnormalTimePeriod. + /// + /// Initializes a new instance of the AbnormalTimePeriod class. + /// public AbnormalTimePeriod() { - Events = new ChangeTrackingList(); - Solutions = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of AbnormalTimePeriod. - /// Start time of the downtime. - /// End time of the downtime. - /// List of Possible Cause of downtime. - /// List of proposed solutions. - internal AbnormalTimePeriod(DateTimeOffset? startTime, DateTimeOffset? endTime, IList events, IList solutions) + /// + /// Initializes a new instance of the AbnormalTimePeriod class. + /// + /// Start time of the downtime + /// End time of the downtime + /// List of Possible Cause of downtime + /// List of proposed solutions + public AbnormalTimePeriod(System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), IList events = default(IList), IList solutions = default(IList)) { StartTime = startTime; EndTime = endTime; Events = events; Solutions = solutions; + CustomInit(); } - /// Start time of the downtime. - public DateTimeOffset? StartTime { get; set; } - /// End time of the downtime. - public DateTimeOffset? EndTime { get; set; } - /// List of Possible Cause of downtime. - public IList Events { get; } - /// List of proposed solutions. - public IList Solutions { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets start time of the downtime + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets end time of the downtime + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets list of Possible Cause of downtime + /// + [JsonProperty(PropertyName = "events")] + public IList Events { get; set; } + + /// + /// Gets or sets list of proposed solutions + /// + [JsonProperty(PropertyName = "solutions")] + public IList Solutions { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.Serialization.cs deleted file mode 100644 index 8356d4e93e6a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.Serialization.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Address : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("address1"); - writer.WriteStringValue(Address1); - if (Optional.IsDefined(Address2)) - { - writer.WritePropertyName("address2"); - writer.WriteStringValue(Address2); - } - writer.WritePropertyName("city"); - writer.WriteStringValue(City); - writer.WritePropertyName("country"); - writer.WriteStringValue(Country); - writer.WritePropertyName("postalCode"); - writer.WriteStringValue(PostalCode); - writer.WritePropertyName("state"); - writer.WriteStringValue(State); - writer.WriteEndObject(); - } - - internal static Address DeserializeAddress(JsonElement element) - { - string address1 = default; - Optional address2 = default; - string city = default; - string country = default; - string postalCode = default; - string state = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("address1")) - { - address1 = property.Value.GetString(); - continue; - } - if (property.NameEquals("address2")) - { - address2 = property.Value.GetString(); - continue; - } - if (property.NameEquals("city")) - { - city = property.Value.GetString(); - continue; - } - if (property.NameEquals("country")) - { - country = property.Value.GetString(); - continue; - } - if (property.NameEquals("postalCode")) - { - postalCode = property.Value.GetString(); - continue; - } - if (property.NameEquals("state")) - { - state = property.Value.GetString(); - continue; - } - } - return new Address(address1, address2.Value, city, country, postalCode, state); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.cs index 056b1bf5400e..93da3addd3ba 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Address.cs @@ -1,62 +1,43 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Address information for domain registration. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Address information for domain registration. + /// public partial class Address { - /// Initializes a new instance of Address. - /// First line of an Address. - /// The city for the address. - /// The country for the address. - /// The postal code for the address. - /// The state or province for the address. - /// , , , , or is null. - public Address(string address1, string city, string country, string postalCode, string state) + /// + /// Initializes a new instance of the Address class. + /// + public Address() { - if (address1 == null) - { - throw new ArgumentNullException(nameof(address1)); - } - if (city == null) - { - throw new ArgumentNullException(nameof(city)); - } - if (country == null) - { - throw new ArgumentNullException(nameof(country)); - } - if (postalCode == null) - { - throw new ArgumentNullException(nameof(postalCode)); - } - if (state == null) - { - throw new ArgumentNullException(nameof(state)); - } - - Address1 = address1; - City = city; - Country = country; - PostalCode = postalCode; - State = state; + CustomInit(); } - /// Initializes a new instance of Address. - /// First line of an Address. - /// The second line of the Address. Optional. - /// The city for the address. - /// The country for the address. - /// The postal code for the address. - /// The state or province for the address. - internal Address(string address1, string address2, string city, string country, string postalCode, string state) + /// + /// Initializes a new instance of the Address class. + /// + /// First line of an Address. + /// The city for the address. + /// The country for the address. + /// The postal code for the address. + /// The state or province for the address. + /// The second line of the Address. + /// Optional. + public Address(string address1, string city, string country, string postalCode, string state, string address2 = default(string)) { Address1 = address1; Address2 = address2; @@ -64,19 +45,78 @@ internal Address(string address1, string address2, string city, string country, Country = country; PostalCode = postalCode; State = state; + CustomInit(); } - /// First line of an Address. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets first line of an Address. + /// + [JsonProperty(PropertyName = "address1")] public string Address1 { get; set; } - /// The second line of the Address. Optional. + + /// + /// Gets or sets the second line of the Address. Optional. + /// + [JsonProperty(PropertyName = "address2")] public string Address2 { get; set; } - /// The city for the address. + + /// + /// Gets or sets the city for the address. + /// + [JsonProperty(PropertyName = "city")] public string City { get; set; } - /// The country for the address. + + /// + /// Gets or sets the country for the address. + /// + [JsonProperty(PropertyName = "country")] public string Country { get; set; } - /// The postal code for the address. + + /// + /// Gets or sets the postal code for the address. + /// + [JsonProperty(PropertyName = "postalCode")] public string PostalCode { get; set; } - /// The state or province for the address. + + /// + /// Gets or sets the state or province for the address. + /// + [JsonProperty(PropertyName = "state")] public string State { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Address1 == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Address1"); + } + if (City == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "City"); + } + if (Country == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Country"); + } + if (PostalCode == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PostalCode"); + } + if (State == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "State"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.Serialization.cs deleted file mode 100644 index f11f9b92d06e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.Serialization.cs +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AddressResponse : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ServiceIpAddress)) - { - writer.WritePropertyName("serviceIpAddress"); - writer.WriteStringValue(ServiceIpAddress); - } - if (Optional.IsDefined(InternalIpAddress)) - { - writer.WritePropertyName("internalIpAddress"); - writer.WriteStringValue(InternalIpAddress); - } - if (Optional.IsCollectionDefined(OutboundIpAddresses)) - { - writer.WritePropertyName("outboundIpAddresses"); - writer.WriteStartArray(); - foreach (var item in OutboundIpAddresses) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(VipMappings)) - { - writer.WritePropertyName("vipMappings"); - writer.WriteStartArray(); - foreach (var item in VipMappings) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AddressResponse DeserializeAddressResponse(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional serviceIpAddress = default; - Optional internalIpAddress = default; - Optional> outboundIpAddresses = default; - Optional> vipMappings = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("serviceIpAddress")) - { - serviceIpAddress = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("internalIpAddress")) - { - internalIpAddress = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("outboundIpAddresses")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - outboundIpAddresses = array; - continue; - } - if (property0.NameEquals("vipMappings")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(VirtualIPMapping.DeserializeVirtualIPMapping(item)); - } - vipMappings = array; - continue; - } - } - continue; - } - } - return new AddressResponse(id.Value, name.Value, kind.Value, type.Value, serviceIpAddress.Value, internalIpAddress.Value, Optional.ToList(outboundIpAddresses), Optional.ToList(vipMappings)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.cs index a17a2524bd9f..879dbaad9a28 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AddressResponse.cs @@ -1,49 +1,89 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Describes main public IP address and any extra virtual IPs. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes main public IP address and any extra virtual IPs. + /// + [Rest.Serialization.JsonTransformation] public partial class AddressResponse : ProxyOnlyResource { - /// Initializes a new instance of AddressResponse. + /// + /// Initializes a new instance of the AddressResponse class. + /// public AddressResponse() { - OutboundIpAddresses = new ChangeTrackingList(); - VipMappings = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of AddressResponse. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Main public virtual IP. - /// Virtual Network internal IP address of the App Service Environment if it is in internal load-balancing mode. - /// IP addresses appearing on outbound connections. - /// Additional virtual IPs. - internal AddressResponse(string id, string name, string kind, string type, string serviceIpAddress, string internalIpAddress, IList outboundIpAddresses, IList vipMappings) : base(id, name, kind, type) + /// + /// Initializes a new instance of the AddressResponse class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Main public virtual IP. + /// Virtual Network internal IP address + /// of the App Service Environment if it is in internal load-balancing + /// mode. + /// IP addresses appearing on + /// outbound connections. + /// Additional virtual IPs. + public AddressResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string serviceIpAddress = default(string), string internalIpAddress = default(string), IList outboundIpAddresses = default(IList), IList vipMappings = default(IList)) + : base(id, name, kind, type) { ServiceIpAddress = serviceIpAddress; InternalIpAddress = internalIpAddress; OutboundIpAddresses = outboundIpAddresses; VipMappings = vipMappings; + CustomInit(); } - /// Main public virtual IP. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets main public virtual IP. + /// + [JsonProperty(PropertyName = "properties.serviceIpAddress")] public string ServiceIpAddress { get; set; } - /// Virtual Network internal IP address of the App Service Environment if it is in internal load-balancing mode. + + /// + /// Gets or sets virtual Network internal IP address of the App Service + /// Environment if it is in internal load-balancing mode. + /// + [JsonProperty(PropertyName = "properties.internalIpAddress")] public string InternalIpAddress { get; set; } - /// IP addresses appearing on outbound connections. - public IList OutboundIpAddresses { get; } - /// Additional virtual IPs. - public IList VipMappings { get; } + + /// + /// Gets or sets IP addresses appearing on outbound connections. + /// + [JsonProperty(PropertyName = "properties.outboundIpAddresses")] + public IList OutboundIpAddresses { get; set; } + + /// + /// Gets or sets additional virtual IPs. + /// + [JsonProperty(PropertyName = "properties.vipMappings")] + public IList VipMappings { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs deleted file mode 100644 index 0cff877bdcf7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AllowedAudiencesValidation : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(AllowedAudiences)) - { - writer.WritePropertyName("allowedAudiences"); - writer.WriteStartArray(); - foreach (var item in AllowedAudiences) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AllowedAudiencesValidation DeserializeAllowedAudiencesValidation(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional> allowedAudiences = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("allowedAudiences")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedAudiences = array; - continue; - } - } - continue; - } - } - return new AllowedAudiencesValidation(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(allowedAudiences)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.cs index da286950f19d..7af8c086f3f3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AllowedAudiencesValidation.cs @@ -1,35 +1,56 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// The AllowedAudiencesValidation. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class AllowedAudiencesValidation : ProxyOnlyResource { - /// Initializes a new instance of AllowedAudiencesValidation. + /// + /// Initializes a new instance of the AllowedAudiencesValidation class. + /// public AllowedAudiencesValidation() { - AllowedAudiences = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of AllowedAudiencesValidation. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// . - internal AllowedAudiencesValidation(string id, string name, string kind, string type, IList allowedAudiences) : base(id, name, kind, type) + /// + /// Initializes a new instance of the AllowedAudiencesValidation class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public AllowedAudiencesValidation(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList allowedAudiences = default(IList)) + : base(id, name, kind, type) { AllowedAudiences = allowedAudiences; + CustomInit(); } - public IList AllowedAudiences { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.allowedAudiences")] + public IList AllowedAudiences { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.Serialization.cs deleted file mode 100644 index 3a248e451eff..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.Serialization.cs +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AnalysisData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Source)) - { - writer.WritePropertyName("source"); - writer.WriteStringValue(Source); - } - if (Optional.IsDefined(DetectorDefinition)) - { - writer.WritePropertyName("detectorDefinition"); - writer.WriteObjectValue(DetectorDefinition); - } - if (Optional.IsCollectionDefined(Metrics)) - { - writer.WritePropertyName("metrics"); - writer.WriteStartArray(); - foreach (var item in Metrics) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Data)) - { - writer.WritePropertyName("data"); - writer.WriteStartArray(); - foreach (var item in Data) - { - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteObjectValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(DetectorMetaData)) - { - writer.WritePropertyName("detectorMetaData"); - writer.WriteObjectValue(DetectorMetaData); - } - writer.WriteEndObject(); - } - - internal static AnalysisData DeserializeAnalysisData(JsonElement element) - { - Optional source = default; - Optional detectorDefinition = default; - Optional> metrics = default; - Optional>> data = default; - Optional detectorMetaData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("source")) - { - source = property.Value.GetString(); - continue; - } - if (property.NameEquals("detectorDefinition")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - detectorDefinition = DetectorDefinition.DeserializeDetectorDefinition(property.Value); - continue; - } - if (property.NameEquals("metrics")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DiagnosticMetricSet.DeserializeDiagnosticMetricSet(item)); - } - metrics = array; - continue; - } - if (property.NameEquals("data")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - List array0 = new List(); - foreach (var item0 in item.EnumerateArray()) - { - array0.Add(NameValuePair.DeserializeNameValuePair(item0)); - } - array.Add(array0); - } - data = array; - continue; - } - if (property.NameEquals("detectorMetaData")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - detectorMetaData = ResponseMetaData.DeserializeResponseMetaData(property.Value); - continue; - } - } - return new AnalysisData(source.Value, detectorDefinition.Value, Optional.ToList(metrics), Optional.ToList(data), detectorMetaData.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.cs index 2b051434fdfb..2cbb22216f0d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisData.cs @@ -1,49 +1,85 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Class Representing Detector Evidence used for analysis. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Class Representing Detector Evidence used for analysis + /// public partial class AnalysisData { - /// Initializes a new instance of AnalysisData. + /// + /// Initializes a new instance of the AnalysisData class. + /// public AnalysisData() { - Metrics = new ChangeTrackingList(); - Data = new ChangeTrackingList>(); + CustomInit(); } - /// Initializes a new instance of AnalysisData. - /// Name of the Detector. - /// Detector Definition. - /// Source Metrics. - /// Additional Source Data. - /// Detector Meta Data. - internal AnalysisData(string source, DetectorDefinition detectorDefinition, IList metrics, IList> data, ResponseMetaData detectorMetaData) + /// + /// Initializes a new instance of the AnalysisData class. + /// + /// Name of the Detector + /// Detector Definition + /// Source Metrics + /// Additional Source Data + /// Detector Meta Data + public AnalysisData(string source = default(string), DetectorDefinition detectorDefinition = default(DetectorDefinition), IList metrics = default(IList), IList> data = default(IList>), ResponseMetaData detectorMetaData = default(ResponseMetaData)) { Source = source; DetectorDefinition = detectorDefinition; Metrics = metrics; Data = data; DetectorMetaData = detectorMetaData; + CustomInit(); } - /// Name of the Detector. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the Detector + /// + [JsonProperty(PropertyName = "source")] public string Source { get; set; } - /// Detector Definition. + + /// + /// Gets or sets detector Definition + /// + [JsonProperty(PropertyName = "detectorDefinition")] public DetectorDefinition DetectorDefinition { get; set; } - /// Source Metrics. - public IList Metrics { get; } - /// Additional Source Data. - public IList> Data { get; } - /// Detector Meta Data. + + /// + /// Gets or sets source Metrics + /// + [JsonProperty(PropertyName = "metrics")] + public IList Metrics { get; set; } + + /// + /// Gets or sets additional Source Data + /// + [JsonProperty(PropertyName = "data")] + public IList> Data { get; set; } + + /// + /// Gets or sets detector Meta Data + /// + [JsonProperty(PropertyName = "detectorMetaData")] public ResponseMetaData DetectorMetaData { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.Serialization.cs deleted file mode 100644 index 1d9c58ef4f17..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.Serialization.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AnalysisDefinition : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AnalysisDefinition DeserializeAnalysisDefinition(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("description")) - { - description = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new AnalysisDefinition(id.Value, name.Value, kind.Value, type.Value, description.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.cs index 0c3baed0c5af..69956364b44c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AnalysisDefinition.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Definition of Analysis. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of Analysis + /// + [Rest.Serialization.JsonTransformation] public partial class AnalysisDefinition : ProxyOnlyResource { - /// Initializes a new instance of AnalysisDefinition. + /// + /// Initializes a new instance of the AnalysisDefinition class. + /// public AnalysisDefinition() { + CustomInit(); } - /// Initializes a new instance of AnalysisDefinition. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Description of the Analysis. - internal AnalysisDefinition(string id, string name, string kind, string type, string description) : base(id, name, kind, type) + /// + /// Initializes a new instance of the AnalysisDefinition class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Description of the Analysis + public AnalysisDefinition(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string description = default(string)) + : base(id, name, kind, type) { Description = description; + CustomInit(); } - /// Description of the Analysis. - public string Description { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets description of the Analysis + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.Serialization.cs deleted file mode 100644 index 04a52966b937..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.Serialization.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ApiDefinitionInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Url)) - { - writer.WritePropertyName("url"); - writer.WriteStringValue(Url); - } - writer.WriteEndObject(); - } - - internal static ApiDefinitionInfo DeserializeApiDefinitionInfo(JsonElement element) - { - Optional url = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("url")) - { - url = property.Value.GetString(); - continue; - } - } - return new ApiDefinitionInfo(url.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.cs index 68254c2b40a2..76e5be22e2fb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiDefinitionInfo.cs @@ -1,28 +1,51 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Information about the formal API definition for the app. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Information about the formal API definition for the app. + /// public partial class ApiDefinitionInfo { - /// Initializes a new instance of ApiDefinitionInfo. + /// + /// Initializes a new instance of the ApiDefinitionInfo class. + /// public ApiDefinitionInfo() { + CustomInit(); } - /// Initializes a new instance of ApiDefinitionInfo. - /// The URL of the API definition. - internal ApiDefinitionInfo(string url) + /// + /// Initializes a new instance of the ApiDefinitionInfo class. + /// + /// The URL of the API definition. + public ApiDefinitionInfo(string url = default(string)) { Url = url; + CustomInit(); } - /// The URL of the API definition. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the URL of the API definition. + /// + [JsonProperty(PropertyName = "url")] public string Url { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.Serialization.cs deleted file mode 100644 index b7c03ba9e635..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.Serialization.cs +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ApiKVReference : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Reference)) - { - writer.WritePropertyName("reference"); - writer.WriteStringValue(Reference); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"); - writer.WriteStringValue(Status.Value.ToSerialString()); - } - if (Optional.IsDefined(VaultName)) - { - writer.WritePropertyName("vaultName"); - writer.WriteStringValue(VaultName); - } - if (Optional.IsDefined(SecretName)) - { - writer.WritePropertyName("secretName"); - writer.WriteStringValue(SecretName); - } - if (Optional.IsDefined(SecretVersion)) - { - writer.WritePropertyName("secretVersion"); - writer.WriteStringValue(SecretVersion); - } - if (Optional.IsDefined(IdentityType)) - { - writer.WritePropertyName("identityType"); - writer.WriteObjectValue(IdentityType); - } - if (Optional.IsDefined(Details)) - { - writer.WritePropertyName("details"); - writer.WriteStringValue(Details); - } - if (Optional.IsDefined(Source)) - { - writer.WritePropertyName("source"); - writer.WriteStringValue(Source); - } - if (Optional.IsDefined(ActiveVersion)) - { - writer.WritePropertyName("activeVersion"); - writer.WriteStringValue(ActiveVersion); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ApiKVReference DeserializeApiKVReference(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional reference = default; - Optional status = default; - Optional vaultName = default; - Optional secretName = default; - Optional secretVersion = default; - Optional identityType = default; - Optional details = default; - Optional source = default; - Optional activeVersion = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("reference")) - { - reference = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property0.Value.GetString().ToResolveStatus(); - continue; - } - if (property0.NameEquals("vaultName")) - { - vaultName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("secretName")) - { - secretName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("secretVersion")) - { - secretVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("identityType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - identityType = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property0.Value); - continue; - } - if (property0.NameEquals("details")) - { - details = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("source")) - { - source = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("activeVersion")) - { - activeVersion = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new ApiKVReference(id.Value, name.Value, kind.Value, type.Value, reference.Value, Optional.ToNullable(status), vaultName.Value, secretName.Value, secretVersion.Value, identityType.Value, details.Value, source.Value, activeVersion.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs deleted file mode 100644 index 72f1f9aa6466..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Description of site key vault references. - public partial class ApiKVReference : ProxyOnlyResource - { - /// Initializes a new instance of ApiKVReference. - public ApiKVReference() - { - Source = "KeyVault"; - } - - /// Initializes a new instance of ApiKVReference. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// . - /// . - /// . - /// . - /// . - /// Managed service identity. - /// . - /// . - /// . - internal ApiKVReference(string id, string name, string kind, string type, string reference, ResolveStatus? status, string vaultName, string secretName, string secretVersion, ManagedServiceIdentity identityType, string details, string source, string activeVersion) : base(id, name, kind, type) - { - Reference = reference; - Status = status; - VaultName = vaultName; - SecretName = secretName; - SecretVersion = secretVersion; - IdentityType = identityType; - Details = details; - Source = source; - ActiveVersion = activeVersion; - } - - public string Reference { get; set; } - public ResolveStatus? Status { get; set; } - public string VaultName { get; set; } - public string SecretName { get; set; } - public string SecretVersion { get; set; } - /// Managed service identity. - public ManagedServiceIdentity IdentityType { get; set; } - public string Details { get; set; } - public string Source { get; set; } - public string ActiveVersion { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.Serialization.cs deleted file mode 100644 index f5693159eaba..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class ApiKVReferenceCollection - { - internal static ApiKVReferenceCollection DeserializeApiKVReferenceCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ApiKVReference.DeserializeApiKVReference(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ApiKVReferenceCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.cs deleted file mode 100644 index 8a48f3055be7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReferenceCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The ApiKVReferenceCollection. - internal partial class ApiKVReferenceCollection - { - /// Initializes a new instance of ApiKVReferenceCollection. - /// Collection of resources. - /// is null. - internal ApiKVReferenceCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of ApiKVReferenceCollection. - /// Collection of resources. - /// Link to next page of resources. - internal ApiKVReferenceCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.Serialization.cs deleted file mode 100644 index 8b0cd0e43afc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.Serialization.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ApiManagementConfig : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"); - writer.WriteStringValue(Id); - } - writer.WriteEndObject(); - } - - internal static ApiManagementConfig DeserializeApiManagementConfig(JsonElement element) - { - Optional id = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - } - return new ApiManagementConfig(id.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.cs index 4a0eecd9c4af..2b6bf8637dc2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiManagementConfig.cs @@ -1,28 +1,51 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Azure API management (APIM) configuration linked to the app. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure API management (APIM) configuration linked to the app. + /// public partial class ApiManagementConfig { - /// Initializes a new instance of ApiManagementConfig. + /// + /// Initializes a new instance of the ApiManagementConfig class. + /// public ApiManagementConfig() { + CustomInit(); } - /// Initializes a new instance of ApiManagementConfig. - /// APIM-Api Identifier. - internal ApiManagementConfig(string id) + /// + /// Initializes a new instance of the ApiManagementConfig class. + /// + /// APIM-Api Identifier. + public ApiManagementConfig(string id = default(string)) { Id = id; + CustomInit(); } - /// APIM-Api Identifier. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets aPIM-Api Identifier. + /// + [JsonProperty(PropertyName = "id")] public string Id { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.Serialization.cs deleted file mode 100644 index 9c22e0d7a1a5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppInsightsWebAppStackSettings - { - internal static AppInsightsWebAppStackSettings DeserializeAppInsightsWebAppStackSettings(JsonElement element) - { - Optional isSupported = default; - Optional isDefaultOff = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("isSupported")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isSupported = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isDefaultOff")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isDefaultOff = property.Value.GetBoolean(); - continue; - } - } - return new AppInsightsWebAppStackSettings(Optional.ToNullable(isSupported), Optional.ToNullable(isDefaultOff)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs deleted file mode 100644 index 7fff155378dd..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// App Insights Web App stack settings. - public partial class AppInsightsWebAppStackSettings - { - /// Initializes a new instance of AppInsightsWebAppStackSettings. - internal AppInsightsWebAppStackSettings() - { - } - - /// Initializes a new instance of AppInsightsWebAppStackSettings. - /// <code>true</code> if remote Application Insights is supported for the stack; otherwise, <code>false</code>. - /// <code>true</code> if Application Insights is disabled by default for the stack; otherwise, <code>false</code>. - internal AppInsightsWebAppStackSettings(bool? isSupported, bool? isDefaultOff) - { - IsSupported = isSupported; - IsDefaultOff = isDefaultOff; - } - - /// <code>true</code> if remote Application Insights is supported for the stack; otherwise, <code>false</code>. - public bool? IsSupported { get; } - /// <code>true</code> if Application Insights is disabled by default for the stack; otherwise, <code>false</code>. - public bool? IsDefaultOff { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.Serialization.cs deleted file mode 100644 index 378419e8eaba..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.Serialization.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppRegistration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(AppId)) - { - writer.WritePropertyName("appId"); - writer.WriteStringValue(AppId); - } - if (Optional.IsDefined(AppSecretSettingName)) - { - writer.WritePropertyName("appSecretSettingName"); - writer.WriteStringValue(AppSecretSettingName); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AppRegistration DeserializeAppRegistration(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional appId = default; - Optional appSecretSettingName = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("appId")) - { - appId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("appSecretSettingName")) - { - appSecretSettingName = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new AppRegistration(id.Value, name.Value, kind.Value, type.Value, appId.Value, appSecretSettingName.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.cs index 365367a13ca1..a1e6ff47661a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.cs @@ -1,36 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the app registration for providers that have app ids and app secrets. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class AppRegistration : ProxyOnlyResource { - /// Initializes a new instance of AppRegistration. + /// + /// Initializes a new instance of the AppRegistration class. + /// public AppRegistration() { + CustomInit(); } - /// Initializes a new instance of AppRegistration. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The App ID of the app used for login. - /// The app setting name that contains the app secret. - internal AppRegistration(string id, string name, string kind, string type, string appId, string appSecretSettingName) : base(id, name, kind, type) + /// + /// Initializes a new instance of the AppRegistration class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public AppRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string appId = default(string), string appSecretSettingName = default(string)) + : base(id, name, kind, type) { AppId = appId; AppSecretSettingName = appSecretSettingName; + CustomInit(); } - /// The App ID of the app used for login. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.appId")] public string AppId { get; set; } - /// The app setting name that contains the app secret. + + /// + /// + [JsonProperty(PropertyName = "properties.appSecretSettingName")] public string AppSecretSettingName { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.Serialization.cs deleted file mode 100644 index 84e961bda598..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.Serialization.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppServiceCertificate : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(KeyVaultId)) - { - writer.WritePropertyName("keyVaultId"); - writer.WriteStringValue(KeyVaultId); - } - if (Optional.IsDefined(KeyVaultSecretName)) - { - writer.WritePropertyName("keyVaultSecretName"); - writer.WriteStringValue(KeyVaultSecretName); - } - writer.WriteEndObject(); - } - - internal static AppServiceCertificate DeserializeAppServiceCertificate(JsonElement element) - { - Optional keyVaultId = default; - Optional keyVaultSecretName = default; - Optional provisioningState = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("keyVaultId")) - { - keyVaultId = property.Value.GetString(); - continue; - } - if (property.NameEquals("keyVaultSecretName")) - { - keyVaultSecretName = property.Value.GetString(); - continue; - } - if (property.NameEquals("provisioningState")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property.Value.GetString().ToKeyVaultSecretStatus(); - continue; - } - } - return new AppServiceCertificate(keyVaultId.Value, keyVaultSecretName.Value, Optional.ToNullable(provisioningState)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.cs index a52b098afe85..0f89676c64ac 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificate.cs @@ -1,36 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Key Vault container for a certificate that is purchased through Azure. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Key Vault container for a certificate that is purchased through Azure. + /// public partial class AppServiceCertificate { - /// Initializes a new instance of AppServiceCertificate. + /// + /// Initializes a new instance of the AppServiceCertificate class. + /// public AppServiceCertificate() { + CustomInit(); } - /// Initializes a new instance of AppServiceCertificate. - /// Key Vault resource Id. - /// Key Vault secret name. - /// Status of the Key Vault secret. - internal AppServiceCertificate(string keyVaultId, string keyVaultSecretName, KeyVaultSecretStatus? provisioningState) + /// + /// Initializes a new instance of the AppServiceCertificate class. + /// + /// Key Vault resource Id. + /// Key Vault secret name. + /// Status of the Key Vault secret. + /// Possible values include: 'Initialized', + /// 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', + /// 'OperationNotPermittedOnKeyVault', + /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + /// 'Unknown' + public AppServiceCertificate(string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? provisioningState = default(KeyVaultSecretStatus?)) { KeyVaultId = keyVaultId; KeyVaultSecretName = keyVaultSecretName; ProvisioningState = provisioningState; + CustomInit(); } - /// Key Vault resource Id. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets key Vault resource Id. + /// + [JsonProperty(PropertyName = "keyVaultId")] public string KeyVaultId { get; set; } - /// Key Vault secret name. + + /// + /// Gets or sets key Vault secret name. + /// + [JsonProperty(PropertyName = "keyVaultSecretName")] public string KeyVaultSecretName { get; set; } - /// Status of the Key Vault secret. - public KeyVaultSecretStatus? ProvisioningState { get; } + + /// + /// Gets status of the Key Vault secret. Possible values include: + /// 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', + /// 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + /// 'Unknown' + /// + [JsonProperty(PropertyName = "provisioningState")] + public KeyVaultSecretStatus? ProvisioningState { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.Serialization.cs deleted file mode 100644 index 2c371d537f1b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class AppServiceCertificateCollection - { - internal static AppServiceCertificateCollection DeserializeAppServiceCertificateCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AppServiceCertificateResource.DeserializeAppServiceCertificateResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new AppServiceCertificateCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.cs deleted file mode 100644 index a7492da9212a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of certificate order certificates. - internal partial class AppServiceCertificateCollection - { - /// Initializes a new instance of AppServiceCertificateCollection. - /// Collection of resources. - /// is null. - internal AppServiceCertificateCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of AppServiceCertificateCollection. - /// Collection of resources. - /// Link to next page of resources. - internal AppServiceCertificateCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.Serialization.cs deleted file mode 100644 index f4c4e8f139cc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.Serialization.cs +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppServiceCertificateOrder : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Certificates)) - { - writer.WritePropertyName("certificates"); - writer.WriteStartObject(); - foreach (var item in Certificates) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(DistinguishedName)) - { - writer.WritePropertyName("distinguishedName"); - writer.WriteStringValue(DistinguishedName); - } - if (Optional.IsDefined(ValidityInYears)) - { - writer.WritePropertyName("validityInYears"); - writer.WriteNumberValue(ValidityInYears.Value); - } - if (Optional.IsDefined(KeySize)) - { - writer.WritePropertyName("keySize"); - writer.WriteNumberValue(KeySize.Value); - } - if (Optional.IsDefined(ProductType)) - { - writer.WritePropertyName("productType"); - writer.WriteStringValue(ProductType.Value.ToSerialString()); - } - if (Optional.IsDefined(AutoRenew)) - { - writer.WritePropertyName("autoRenew"); - writer.WriteBooleanValue(AutoRenew.Value); - } - if (Optional.IsDefined(Csr)) - { - writer.WritePropertyName("csr"); - writer.WriteStringValue(Csr); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AppServiceCertificateOrder DeserializeAppServiceCertificateOrder(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - string location = default; - Optional type = default; - Optional> tags = default; - Optional> certificates = default; - Optional distinguishedName = default; - Optional domainVerificationToken = default; - Optional validityInYears = default; - Optional keySize = default; - Optional productType = default; - Optional autoRenew = default; - Optional provisioningState = default; - Optional status = default; - Optional signedCertificate = default; - Optional csr = default; - Optional intermediate = default; - Optional root = default; - Optional serialNumber = default; - Optional lastCertificateIssuanceTime = default; - Optional expirationTime = default; - Optional isPrivateKeyExternal = default; - Optional> appServiceCertificateNotRenewableReasons = default; - Optional nextAutoRenewalTimeStamp = default; - Optional contact = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("certificates")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, AppServiceCertificate.DeserializeAppServiceCertificate(property1.Value)); - } - certificates = dictionary; - continue; - } - if (property0.NameEquals("distinguishedName")) - { - distinguishedName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("domainVerificationToken")) - { - domainVerificationToken = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("validityInYears")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - validityInYears = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("keySize")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - keySize = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("productType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - productType = property0.Value.GetString().ToCertificateProductType(); - continue; - } - if (property0.NameEquals("autoRenew")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - autoRenew = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property0.Value.GetString().ToProvisioningState(); - continue; - } - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property0.Value.GetString().ToCertificateOrderStatus(); - continue; - } - if (property0.NameEquals("signedCertificate")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - signedCertificate = CertificateDetails.DeserializeCertificateDetails(property0.Value); - continue; - } - if (property0.NameEquals("csr")) - { - csr = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("intermediate")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - intermediate = CertificateDetails.DeserializeCertificateDetails(property0.Value); - continue; - } - if (property0.NameEquals("root")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - root = CertificateDetails.DeserializeCertificateDetails(property0.Value); - continue; - } - if (property0.NameEquals("serialNumber")) - { - serialNumber = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("lastCertificateIssuanceTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - lastCertificateIssuanceTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("expirationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - expirationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("isPrivateKeyExternal")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isPrivateKeyExternal = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("appServiceCertificateNotRenewableReasons")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(new AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(item.GetString())); - } - appServiceCertificateNotRenewableReasons = array; - continue; - } - if (property0.NameEquals("nextAutoRenewalTimeStamp")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - nextAutoRenewalTimeStamp = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("contact")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - contact = CertificateOrderContact.DeserializeCertificateOrderContact(property0.Value); - continue; - } - } - continue; - } - } - return new AppServiceCertificateOrder(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), Optional.ToDictionary(certificates), distinguishedName.Value, domainVerificationToken.Value, Optional.ToNullable(validityInYears), Optional.ToNullable(keySize), Optional.ToNullable(productType), Optional.ToNullable(autoRenew), Optional.ToNullable(provisioningState), Optional.ToNullable(status), signedCertificate.Value, csr.Value, intermediate.Value, root.Value, serialNumber.Value, Optional.ToNullable(lastCertificateIssuanceTime), Optional.ToNullable(expirationTime), Optional.ToNullable(isPrivateKeyExternal), Optional.ToList(appServiceCertificateNotRenewableReasons), Optional.ToNullable(nextAutoRenewalTimeStamp), contact.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs index d51690f5fab7..fba67b6ee17a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs @@ -1,61 +1,85 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// SSL certificate purchase order. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// SSL certificate purchase order. + /// + [Rest.Serialization.JsonTransformation] public partial class AppServiceCertificateOrder : Resource { - /// Initializes a new instance of AppServiceCertificateOrder. - /// Resource Location. - /// is null. - public AppServiceCertificateOrder(string location) : base(location) + /// + /// Initializes a new instance of the AppServiceCertificateOrder class. + /// + public AppServiceCertificateOrder() { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - Certificates = new ChangeTrackingDictionary(); - AppServiceCertificateNotRenewableReasons = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of AppServiceCertificateOrder. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource Location. - /// Resource type. - /// Resource tags. - /// State of the Key Vault secret. - /// Certificate distinguished name. - /// Domain verification token. - /// Duration in years (must be 1). - /// Certificate key size. - /// Certificate product type. - /// <code>true</code> if the certificate should be automatically renewed when it expires; otherwise, <code>false</code>. - /// Status of certificate order. - /// Current order status. - /// Signed certificate. - /// Last CSR that was created for this order. - /// Intermediate certificate. - /// Root certificate. - /// Current serial number of the certificate. - /// Certificate last issuance time. - /// Certificate expiration time. - /// <code>true</code> if private key is external; otherwise, <code>false</code>. - /// Reasons why App Service Certificate is not renewable at the current moment. - /// Time stamp when the certificate would be auto renewed next. - /// Contact info. - internal AppServiceCertificateOrder(string id, string name, string kind, string location, string type, IDictionary tags, IDictionary certificates, string distinguishedName, string domainVerificationToken, int? validityInYears, int? keySize, CertificateProductType? productType, bool? autoRenew, ProvisioningState? provisioningState, CertificateOrderStatus? status, CertificateDetails signedCertificate, string csr, CertificateDetails intermediate, CertificateDetails root, string serialNumber, DateTimeOffset? lastCertificateIssuanceTime, DateTimeOffset? expirationTime, bool? isPrivateKeyExternal, IReadOnlyList appServiceCertificateNotRenewableReasons, DateTimeOffset? nextAutoRenewalTimeStamp, CertificateOrderContact contact) : base(id, name, kind, location, type, tags) + /// + /// Initializes a new instance of the AppServiceCertificateOrder class. + /// + /// Resource Location. + /// Certificate product type. Possible values + /// include: 'StandardDomainValidatedSsl', + /// 'StandardDomainValidatedWildCardSsl' + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Resource tags. + /// State of the Key Vault secret. + /// Certificate distinguished + /// name. + /// Domain verification + /// token. + /// Duration in years (must be between 1 + /// and 3). + /// Certificate key size. + /// <code>true</code> if the + /// certificate should be automatically renewed when it expires; + /// otherwise, <code>false</code>. + /// Status of certificate order. + /// Possible values include: 'Succeeded', 'Failed', 'Canceled', + /// 'InProgress', 'Deleting' + /// Current order status. Possible values include: + /// 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', + /// 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', + /// 'NotSubmitted' + /// Signed certificate. + /// Last CSR that was created for this order. + /// Intermediate certificate. + /// Root certificate. + /// Current serial number of the + /// certificate. + /// Certificate last issuance + /// time. + /// Certificate expiration time. + /// <code>true</code> if + /// private key is external; otherwise, + /// <code>false</code>. + /// Reasons why + /// App Service Certificate is not renewable at the current + /// moment. + /// Time stamp when the + /// certificate would be auto renewed next + public AppServiceCertificateOrder(string location, CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?)) + : base(location, id, name, kind, type, tags) { Certificates = certificates; DistinguishedName = distinguishedName; @@ -76,48 +100,155 @@ internal AppServiceCertificateOrder(string id, string name, string kind, string IsPrivateKeyExternal = isPrivateKeyExternal; AppServiceCertificateNotRenewableReasons = appServiceCertificateNotRenewableReasons; NextAutoRenewalTimeStamp = nextAutoRenewalTimeStamp; - Contact = contact; + CustomInit(); } - /// State of the Key Vault secret. - public IDictionary Certificates { get; } - /// Certificate distinguished name. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets state of the Key Vault secret. + /// + [JsonProperty(PropertyName = "properties.certificates")] + public IDictionary Certificates { get; set; } + + /// + /// Gets or sets certificate distinguished name. + /// + [JsonProperty(PropertyName = "properties.distinguishedName")] public string DistinguishedName { get; set; } - /// Domain verification token. - public string DomainVerificationToken { get; } - /// Duration in years (must be 1). + + /// + /// Gets domain verification token. + /// + [JsonProperty(PropertyName = "properties.domainVerificationToken")] + public string DomainVerificationToken { get; private set; } + + /// + /// Gets or sets duration in years (must be between 1 and 3). + /// + [JsonProperty(PropertyName = "properties.validityInYears")] public int? ValidityInYears { get; set; } - /// Certificate key size. + + /// + /// Gets or sets certificate key size. + /// + [JsonProperty(PropertyName = "properties.keySize")] public int? KeySize { get; set; } - /// Certificate product type. - public CertificateProductType? ProductType { get; set; } - /// <code>true</code> if the certificate should be automatically renewed when it expires; otherwise, <code>false</code>. + + /// + /// Gets or sets certificate product type. Possible values include: + /// 'StandardDomainValidatedSsl', 'StandardDomainValidatedWildCardSsl' + /// + [JsonProperty(PropertyName = "properties.productType")] + public CertificateProductType ProductType { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// certificate should be automatically renewed when it expires; + /// otherwise, &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.autoRenew")] public bool? AutoRenew { get; set; } - /// Status of certificate order. - public ProvisioningState? ProvisioningState { get; } - /// Current order status. - public CertificateOrderStatus? Status { get; } - /// Signed certificate. - public CertificateDetails SignedCertificate { get; } - /// Last CSR that was created for this order. + + /// + /// Gets status of certificate order. Possible values include: + /// 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState? ProvisioningState { get; private set; } + + /// + /// Gets current order status. Possible values include: + /// 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', + /// 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', + /// 'NotSubmitted' + /// + [JsonProperty(PropertyName = "properties.status")] + public CertificateOrderStatus? Status { get; private set; } + + /// + /// Gets signed certificate. + /// + [JsonProperty(PropertyName = "properties.signedCertificate")] + public CertificateDetails SignedCertificate { get; private set; } + + /// + /// Gets or sets last CSR that was created for this order. + /// + [JsonProperty(PropertyName = "properties.csr")] public string Csr { get; set; } - /// Intermediate certificate. - public CertificateDetails Intermediate { get; } - /// Root certificate. - public CertificateDetails Root { get; } - /// Current serial number of the certificate. - public string SerialNumber { get; } - /// Certificate last issuance time. - public DateTimeOffset? LastCertificateIssuanceTime { get; } - /// Certificate expiration time. - public DateTimeOffset? ExpirationTime { get; } - /// <code>true</code> if private key is external; otherwise, <code>false</code>. - public bool? IsPrivateKeyExternal { get; } - /// Reasons why App Service Certificate is not renewable at the current moment. - public IReadOnlyList AppServiceCertificateNotRenewableReasons { get; } - /// Time stamp when the certificate would be auto renewed next. - public DateTimeOffset? NextAutoRenewalTimeStamp { get; } - /// Contact info. - public CertificateOrderContact Contact { get; } + + /// + /// Gets intermediate certificate. + /// + [JsonProperty(PropertyName = "properties.intermediate")] + public CertificateDetails Intermediate { get; private set; } + + /// + /// Gets root certificate. + /// + [JsonProperty(PropertyName = "properties.root")] + public CertificateDetails Root { get; private set; } + + /// + /// Gets current serial number of the certificate. + /// + [JsonProperty(PropertyName = "properties.serialNumber")] + public string SerialNumber { get; private set; } + + /// + /// Gets certificate last issuance time. + /// + [JsonProperty(PropertyName = "properties.lastCertificateIssuanceTime")] + public System.DateTime? LastCertificateIssuanceTime { get; private set; } + + /// + /// Gets certificate expiration time. + /// + [JsonProperty(PropertyName = "properties.expirationTime")] + public System.DateTime? ExpirationTime { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if private key + /// is external; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.isPrivateKeyExternal")] + public bool? IsPrivateKeyExternal { get; private set; } + + /// + /// Gets reasons why App Service Certificate is not renewable at the + /// current moment. + /// + [JsonProperty(PropertyName = "properties.appServiceCertificateNotRenewableReasons")] + public IList AppServiceCertificateNotRenewableReasons { get; private set; } + + /// + /// Gets time stamp when the certificate would be auto renewed next + /// + [JsonProperty(PropertyName = "properties.nextAutoRenewalTimeStamp")] + public System.DateTime? NextAutoRenewalTimeStamp { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (ValidityInYears > 3) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ValidityInYears", 3); + } + if (ValidityInYears < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ValidityInYears", 1); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.Serialization.cs deleted file mode 100644 index f57a802cda95..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class AppServiceCertificateOrderCollection - { - internal static AppServiceCertificateOrderCollection DeserializeAppServiceCertificateOrderCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AppServiceCertificateOrder.DeserializeAppServiceCertificateOrder(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new AppServiceCertificateOrderCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.cs deleted file mode 100644 index 186689f503b3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of certificate orders. - internal partial class AppServiceCertificateOrderCollection - { - /// Initializes a new instance of AppServiceCertificateOrderCollection. - /// Collection of resources. - /// is null. - internal AppServiceCertificateOrderCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of AppServiceCertificateOrderCollection. - /// Collection of resources. - /// Link to next page of resources. - internal AppServiceCertificateOrderCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.Serialization.cs deleted file mode 100644 index 119176a1c21b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.Serialization.cs +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppServiceCertificateOrderPatchResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Certificates)) - { - writer.WritePropertyName("certificates"); - writer.WriteStartObject(); - foreach (var item in Certificates) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(DistinguishedName)) - { - writer.WritePropertyName("distinguishedName"); - writer.WriteStringValue(DistinguishedName); - } - if (Optional.IsDefined(ValidityInYears)) - { - writer.WritePropertyName("validityInYears"); - writer.WriteNumberValue(ValidityInYears.Value); - } - if (Optional.IsDefined(KeySize)) - { - writer.WritePropertyName("keySize"); - writer.WriteNumberValue(KeySize.Value); - } - if (Optional.IsDefined(ProductType)) - { - writer.WritePropertyName("productType"); - writer.WriteStringValue(ProductType.Value.ToSerialString()); - } - if (Optional.IsDefined(AutoRenew)) - { - writer.WritePropertyName("autoRenew"); - writer.WriteBooleanValue(AutoRenew.Value); - } - if (Optional.IsDefined(Csr)) - { - writer.WritePropertyName("csr"); - writer.WriteStringValue(Csr); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AppServiceCertificateOrderPatchResource DeserializeAppServiceCertificateOrderPatchResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional> certificates = default; - Optional distinguishedName = default; - Optional domainVerificationToken = default; - Optional validityInYears = default; - Optional keySize = default; - Optional productType = default; - Optional autoRenew = default; - Optional provisioningState = default; - Optional status = default; - Optional signedCertificate = default; - Optional csr = default; - Optional intermediate = default; - Optional root = default; - Optional serialNumber = default; - Optional lastCertificateIssuanceTime = default; - Optional expirationTime = default; - Optional isPrivateKeyExternal = default; - Optional> appServiceCertificateNotRenewableReasons = default; - Optional nextAutoRenewalTimeStamp = default; - Optional contact = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("certificates")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, AppServiceCertificate.DeserializeAppServiceCertificate(property1.Value)); - } - certificates = dictionary; - continue; - } - if (property0.NameEquals("distinguishedName")) - { - distinguishedName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("domainVerificationToken")) - { - domainVerificationToken = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("validityInYears")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - validityInYears = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("keySize")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - keySize = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("productType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - productType = property0.Value.GetString().ToCertificateProductType(); - continue; - } - if (property0.NameEquals("autoRenew")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - autoRenew = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property0.Value.GetString().ToProvisioningState(); - continue; - } - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property0.Value.GetString().ToCertificateOrderStatus(); - continue; - } - if (property0.NameEquals("signedCertificate")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - signedCertificate = CertificateDetails.DeserializeCertificateDetails(property0.Value); - continue; - } - if (property0.NameEquals("csr")) - { - csr = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("intermediate")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - intermediate = CertificateDetails.DeserializeCertificateDetails(property0.Value); - continue; - } - if (property0.NameEquals("root")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - root = CertificateDetails.DeserializeCertificateDetails(property0.Value); - continue; - } - if (property0.NameEquals("serialNumber")) - { - serialNumber = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("lastCertificateIssuanceTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - lastCertificateIssuanceTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("expirationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - expirationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("isPrivateKeyExternal")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isPrivateKeyExternal = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("appServiceCertificateNotRenewableReasons")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(new AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(item.GetString())); - } - appServiceCertificateNotRenewableReasons = array; - continue; - } - if (property0.NameEquals("nextAutoRenewalTimeStamp")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - nextAutoRenewalTimeStamp = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("contact")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - contact = CertificateOrderContact.DeserializeCertificateOrderContact(property0.Value); - continue; - } - } - continue; - } - } - return new AppServiceCertificateOrderPatchResource(id.Value, name.Value, kind.Value, type.Value, Optional.ToDictionary(certificates), distinguishedName.Value, domainVerificationToken.Value, Optional.ToNullable(validityInYears), Optional.ToNullable(keySize), Optional.ToNullable(productType), Optional.ToNullable(autoRenew), Optional.ToNullable(provisioningState), Optional.ToNullable(status), signedCertificate.Value, csr.Value, intermediate.Value, root.Value, serialNumber.Value, Optional.ToNullable(lastCertificateIssuanceTime), Optional.ToNullable(expirationTime), Optional.ToNullable(isPrivateKeyExternal), Optional.ToList(appServiceCertificateNotRenewableReasons), Optional.ToNullable(nextAutoRenewalTimeStamp), contact.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs index b8e0bfcd1b27..a9284452f4d4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs @@ -1,52 +1,85 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// ARM resource for a certificate order that is purchased through Azure. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// ARM resource for a certificate order that is purchased through Azure. + /// + [Rest.Serialization.JsonTransformation] public partial class AppServiceCertificateOrderPatchResource : ProxyOnlyResource { - /// Initializes a new instance of AppServiceCertificateOrderPatchResource. + /// + /// Initializes a new instance of the + /// AppServiceCertificateOrderPatchResource class. + /// public AppServiceCertificateOrderPatchResource() { - Certificates = new ChangeTrackingDictionary(); - AppServiceCertificateNotRenewableReasons = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of AppServiceCertificateOrderPatchResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// State of the Key Vault secret. - /// Certificate distinguished name. - /// Domain verification token. - /// Duration in years (must be 1). - /// Certificate key size. - /// Certificate product type. - /// <code>true</code> if the certificate should be automatically renewed when it expires; otherwise, <code>false</code>. - /// Status of certificate order. - /// Current order status. - /// Signed certificate. - /// Last CSR that was created for this order. - /// Intermediate certificate. - /// Root certificate. - /// Current serial number of the certificate. - /// Certificate last issuance time. - /// Certificate expiration time. - /// <code>true</code> if private key is external; otherwise, <code>false</code>. - /// Reasons why App Service Certificate is not renewable at the current moment. - /// Time stamp when the certificate would be auto renewed next. - /// Contact info. - internal AppServiceCertificateOrderPatchResource(string id, string name, string kind, string type, IDictionary certificates, string distinguishedName, string domainVerificationToken, int? validityInYears, int? keySize, CertificateProductType? productType, bool? autoRenew, ProvisioningState? provisioningState, CertificateOrderStatus? status, CertificateDetails signedCertificate, string csr, CertificateDetails intermediate, CertificateDetails root, string serialNumber, DateTimeOffset? lastCertificateIssuanceTime, DateTimeOffset? expirationTime, bool? isPrivateKeyExternal, IReadOnlyList appServiceCertificateNotRenewableReasons, DateTimeOffset? nextAutoRenewalTimeStamp, CertificateOrderContact contact) : base(id, name, kind, type) + /// + /// Initializes a new instance of the + /// AppServiceCertificateOrderPatchResource class. + /// + /// Certificate product type. Possible values + /// include: 'StandardDomainValidatedSsl', + /// 'StandardDomainValidatedWildCardSsl' + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// State of the Key Vault secret. + /// Certificate distinguished + /// name. + /// Domain verification + /// token. + /// Duration in years (must be between 1 + /// and 3). + /// Certificate key size. + /// <code>true</code> if the + /// certificate should be automatically renewed when it expires; + /// otherwise, <code>false</code>. + /// Status of certificate order. + /// Possible values include: 'Succeeded', 'Failed', 'Canceled', + /// 'InProgress', 'Deleting' + /// Current order status. Possible values include: + /// 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', + /// 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', + /// 'NotSubmitted' + /// Signed certificate. + /// Last CSR that was created for this order. + /// Intermediate certificate. + /// Root certificate. + /// Current serial number of the + /// certificate. + /// Certificate last issuance + /// time. + /// Certificate expiration time. + /// <code>true</code> if + /// private key is external; otherwise, + /// <code>false</code>. + /// Reasons why + /// App Service Certificate is not renewable at the current + /// moment. + /// Time stamp when the + /// certificate would be auto renewed next + public AppServiceCertificateOrderPatchResource(CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?)) + : base(id, name, kind, type) { Certificates = certificates; DistinguishedName = distinguishedName; @@ -67,48 +100,154 @@ internal AppServiceCertificateOrderPatchResource(string id, string name, string IsPrivateKeyExternal = isPrivateKeyExternal; AppServiceCertificateNotRenewableReasons = appServiceCertificateNotRenewableReasons; NextAutoRenewalTimeStamp = nextAutoRenewalTimeStamp; - Contact = contact; + CustomInit(); } - /// State of the Key Vault secret. - public IDictionary Certificates { get; } - /// Certificate distinguished name. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets state of the Key Vault secret. + /// + [JsonProperty(PropertyName = "properties.certificates")] + public IDictionary Certificates { get; set; } + + /// + /// Gets or sets certificate distinguished name. + /// + [JsonProperty(PropertyName = "properties.distinguishedName")] public string DistinguishedName { get; set; } - /// Domain verification token. - public string DomainVerificationToken { get; } - /// Duration in years (must be 1). + + /// + /// Gets domain verification token. + /// + [JsonProperty(PropertyName = "properties.domainVerificationToken")] + public string DomainVerificationToken { get; private set; } + + /// + /// Gets or sets duration in years (must be between 1 and 3). + /// + [JsonProperty(PropertyName = "properties.validityInYears")] public int? ValidityInYears { get; set; } - /// Certificate key size. + + /// + /// Gets or sets certificate key size. + /// + [JsonProperty(PropertyName = "properties.keySize")] public int? KeySize { get; set; } - /// Certificate product type. - public CertificateProductType? ProductType { get; set; } - /// <code>true</code> if the certificate should be automatically renewed when it expires; otherwise, <code>false</code>. + + /// + /// Gets or sets certificate product type. Possible values include: + /// 'StandardDomainValidatedSsl', 'StandardDomainValidatedWildCardSsl' + /// + [JsonProperty(PropertyName = "properties.productType")] + public CertificateProductType ProductType { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// certificate should be automatically renewed when it expires; + /// otherwise, &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.autoRenew")] public bool? AutoRenew { get; set; } - /// Status of certificate order. - public ProvisioningState? ProvisioningState { get; } - /// Current order status. - public CertificateOrderStatus? Status { get; } - /// Signed certificate. - public CertificateDetails SignedCertificate { get; } - /// Last CSR that was created for this order. + + /// + /// Gets status of certificate order. Possible values include: + /// 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState? ProvisioningState { get; private set; } + + /// + /// Gets current order status. Possible values include: + /// 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', + /// 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', + /// 'NotSubmitted' + /// + [JsonProperty(PropertyName = "properties.status")] + public CertificateOrderStatus? Status { get; private set; } + + /// + /// Gets signed certificate. + /// + [JsonProperty(PropertyName = "properties.signedCertificate")] + public CertificateDetails SignedCertificate { get; private set; } + + /// + /// Gets or sets last CSR that was created for this order. + /// + [JsonProperty(PropertyName = "properties.csr")] public string Csr { get; set; } - /// Intermediate certificate. - public CertificateDetails Intermediate { get; } - /// Root certificate. - public CertificateDetails Root { get; } - /// Current serial number of the certificate. - public string SerialNumber { get; } - /// Certificate last issuance time. - public DateTimeOffset? LastCertificateIssuanceTime { get; } - /// Certificate expiration time. - public DateTimeOffset? ExpirationTime { get; } - /// <code>true</code> if private key is external; otherwise, <code>false</code>. - public bool? IsPrivateKeyExternal { get; } - /// Reasons why App Service Certificate is not renewable at the current moment. - public IReadOnlyList AppServiceCertificateNotRenewableReasons { get; } - /// Time stamp when the certificate would be auto renewed next. - public DateTimeOffset? NextAutoRenewalTimeStamp { get; } - /// Contact info. - public CertificateOrderContact Contact { get; } + + /// + /// Gets intermediate certificate. + /// + [JsonProperty(PropertyName = "properties.intermediate")] + public CertificateDetails Intermediate { get; private set; } + + /// + /// Gets root certificate. + /// + [JsonProperty(PropertyName = "properties.root")] + public CertificateDetails Root { get; private set; } + + /// + /// Gets current serial number of the certificate. + /// + [JsonProperty(PropertyName = "properties.serialNumber")] + public string SerialNumber { get; private set; } + + /// + /// Gets certificate last issuance time. + /// + [JsonProperty(PropertyName = "properties.lastCertificateIssuanceTime")] + public System.DateTime? LastCertificateIssuanceTime { get; private set; } + + /// + /// Gets certificate expiration time. + /// + [JsonProperty(PropertyName = "properties.expirationTime")] + public System.DateTime? ExpirationTime { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if private key + /// is external; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.isPrivateKeyExternal")] + public bool? IsPrivateKeyExternal { get; private set; } + + /// + /// Gets reasons why App Service Certificate is not renewable at the + /// current moment. + /// + [JsonProperty(PropertyName = "properties.appServiceCertificateNotRenewableReasons")] + public IList AppServiceCertificateNotRenewableReasons { get; private set; } + + /// + /// Gets time stamp when the certificate would be auto renewed next + /// + [JsonProperty(PropertyName = "properties.nextAutoRenewalTimeStamp")] + public System.DateTime? NextAutoRenewalTimeStamp { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ValidityInYears > 3) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ValidityInYears", 3); + } + if (ValidityInYears < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ValidityInYears", 1); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.cs deleted file mode 100644 index 268a2fe6f71d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem. - public readonly partial struct AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RegistrationStatusNotSupportedForRenewalValue = "RegistrationStatusNotSupportedForRenewal"; - private const string ExpirationNotInRenewalTimeRangeValue = "ExpirationNotInRenewalTimeRange"; - private const string SubscriptionNotActiveValue = "SubscriptionNotActive"; - - /// RegistrationStatusNotSupportedForRenewal. - public static AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem RegistrationStatusNotSupportedForRenewal { get; } = new AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(RegistrationStatusNotSupportedForRenewalValue); - /// ExpirationNotInRenewalTimeRange. - public static AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem ExpirationNotInRenewalTimeRange { get; } = new AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(ExpirationNotInRenewalTimeRangeValue); - /// SubscriptionNotActive. - public static AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem SubscriptionNotActive { get; } = new AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(SubscriptionNotActiveValue); - /// Determines if two values are the same. - public static bool operator ==(AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem left, AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem left, AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(string value) => new AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem other && Equals(other); - /// - public bool Equals(AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.cs deleted file mode 100644 index 40f1c4f78603..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem. - public readonly partial struct AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RegistrationStatusNotSupportedForRenewalValue = "RegistrationStatusNotSupportedForRenewal"; - private const string ExpirationNotInRenewalTimeRangeValue = "ExpirationNotInRenewalTimeRange"; - private const string SubscriptionNotActiveValue = "SubscriptionNotActive"; - - /// RegistrationStatusNotSupportedForRenewal. - public static AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem RegistrationStatusNotSupportedForRenewal { get; } = new AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(RegistrationStatusNotSupportedForRenewalValue); - /// ExpirationNotInRenewalTimeRange. - public static AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem ExpirationNotInRenewalTimeRange { get; } = new AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(ExpirationNotInRenewalTimeRangeValue); - /// SubscriptionNotActive. - public static AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem SubscriptionNotActive { get; } = new AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(SubscriptionNotActiveValue); - /// Determines if two values are the same. - public static bool operator ==(AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem left, AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem left, AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(string value) => new AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem other && Equals(other); - /// - public bool Equals(AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.Serialization.cs deleted file mode 100644 index 59bb9a519ed7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.Serialization.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppServiceCertificatePatchResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(KeyVaultId)) - { - writer.WritePropertyName("keyVaultId"); - writer.WriteStringValue(KeyVaultId); - } - if (Optional.IsDefined(KeyVaultSecretName)) - { - writer.WritePropertyName("keyVaultSecretName"); - writer.WriteStringValue(KeyVaultSecretName); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AppServiceCertificatePatchResource DeserializeAppServiceCertificatePatchResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional keyVaultId = default; - Optional keyVaultSecretName = default; - Optional provisioningState = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("keyVaultId")) - { - keyVaultId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("keyVaultSecretName")) - { - keyVaultSecretName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property0.Value.GetString().ToKeyVaultSecretStatus(); - continue; - } - } - continue; - } - } - return new AppServiceCertificatePatchResource(id.Value, name.Value, kind.Value, type.Value, keyVaultId.Value, keyVaultSecretName.Value, Optional.ToNullable(provisioningState)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.cs index c5c3f283eee8..cabf8228ef12 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificatePatchResource.cs @@ -1,40 +1,89 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Key Vault container ARM resource for a certificate that is purchased through Azure. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Key Vault container ARM resource for a certificate that is purchased + /// through Azure. + /// + [Rest.Serialization.JsonTransformation] public partial class AppServiceCertificatePatchResource : ProxyOnlyResource { - /// Initializes a new instance of AppServiceCertificatePatchResource. + /// + /// Initializes a new instance of the + /// AppServiceCertificatePatchResource class. + /// public AppServiceCertificatePatchResource() { + CustomInit(); } - /// Initializes a new instance of AppServiceCertificatePatchResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Key Vault resource Id. - /// Key Vault secret name. - /// Status of the Key Vault secret. - internal AppServiceCertificatePatchResource(string id, string name, string kind, string type, string keyVaultId, string keyVaultSecretName, KeyVaultSecretStatus? provisioningState) : base(id, name, kind, type) + /// + /// Initializes a new instance of the + /// AppServiceCertificatePatchResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Key Vault resource Id. + /// Key Vault secret name. + /// Status of the Key Vault secret. + /// Possible values include: 'Initialized', + /// 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', + /// 'OperationNotPermittedOnKeyVault', + /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + /// 'Unknown' + public AppServiceCertificatePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? provisioningState = default(KeyVaultSecretStatus?)) + : base(id, name, kind, type) { KeyVaultId = keyVaultId; KeyVaultSecretName = keyVaultSecretName; ProvisioningState = provisioningState; + CustomInit(); } - /// Key Vault resource Id. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets key Vault resource Id. + /// + [JsonProperty(PropertyName = "properties.keyVaultId")] public string KeyVaultId { get; set; } - /// Key Vault secret name. + + /// + /// Gets or sets key Vault secret name. + /// + [JsonProperty(PropertyName = "properties.keyVaultSecretName")] public string KeyVaultSecretName { get; set; } - /// Status of the Key Vault secret. - public KeyVaultSecretStatus? ProvisioningState { get; } + + /// + /// Gets status of the Key Vault secret. Possible values include: + /// 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', + /// 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + /// 'Unknown' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public KeyVaultSecretStatus? ProvisioningState { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.Serialization.cs deleted file mode 100644 index 2b510c0cbd2e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppServiceCertificateResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(KeyVaultId)) - { - writer.WritePropertyName("keyVaultId"); - writer.WriteStringValue(KeyVaultId); - } - if (Optional.IsDefined(KeyVaultSecretName)) - { - writer.WritePropertyName("keyVaultSecretName"); - writer.WriteStringValue(KeyVaultSecretName); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AppServiceCertificateResource DeserializeAppServiceCertificateResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - string location = default; - Optional type = default; - Optional> tags = default; - Optional keyVaultId = default; - Optional keyVaultSecretName = default; - Optional provisioningState = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("keyVaultId")) - { - keyVaultId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("keyVaultSecretName")) - { - keyVaultSecretName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property0.Value.GetString().ToKeyVaultSecretStatus(); - continue; - } - } - continue; - } - } - return new AppServiceCertificateResource(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), keyVaultId.Value, keyVaultSecretName.Value, Optional.ToNullable(provisioningState)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.cs index d11737695292..a9b3c95a4df4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateResource.cs @@ -1,51 +1,103 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; +// 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.WebSites.Models { - /// Key Vault container ARM resource for a certificate that is purchased through Azure. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Key Vault container ARM resource for a certificate that is purchased + /// through Azure. + /// + [Rest.Serialization.JsonTransformation] public partial class AppServiceCertificateResource : Resource { - /// Initializes a new instance of AppServiceCertificateResource. - /// Resource Location. - /// is null. - public AppServiceCertificateResource(string location) : base(location) + /// + /// Initializes a new instance of the AppServiceCertificateResource + /// class. + /// + public AppServiceCertificateResource() { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } + CustomInit(); } - /// Initializes a new instance of AppServiceCertificateResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource Location. - /// Resource type. - /// Resource tags. - /// Key Vault resource Id. - /// Key Vault secret name. - /// Status of the Key Vault secret. - internal AppServiceCertificateResource(string id, string name, string kind, string location, string type, IDictionary tags, string keyVaultId, string keyVaultSecretName, KeyVaultSecretStatus? provisioningState) : base(id, name, kind, location, type, tags) + /// + /// Initializes a new instance of the AppServiceCertificateResource + /// class. + /// + /// Resource Location. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Resource tags. + /// Key Vault resource Id. + /// Key Vault secret name. + /// Status of the Key Vault secret. + /// Possible values include: 'Initialized', + /// 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', + /// 'OperationNotPermittedOnKeyVault', + /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + /// 'Unknown' + public AppServiceCertificateResource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? provisioningState = default(KeyVaultSecretStatus?)) + : base(location, id, name, kind, type, tags) { KeyVaultId = keyVaultId; KeyVaultSecretName = keyVaultSecretName; ProvisioningState = provisioningState; + CustomInit(); } - /// Key Vault resource Id. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets key Vault resource Id. + /// + [JsonProperty(PropertyName = "properties.keyVaultId")] public string KeyVaultId { get; set; } - /// Key Vault secret name. + + /// + /// Gets or sets key Vault secret name. + /// + [JsonProperty(PropertyName = "properties.keyVaultSecretName")] public string KeyVaultSecretName { get; set; } - /// Status of the Key Vault secret. - public KeyVaultSecretStatus? ProvisioningState { get; } + + /// + /// Gets status of the Key Vault secret. Possible values include: + /// 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', + /// 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + /// 'Unknown' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public KeyVaultSecretStatus? ProvisioningState { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.Serialization.cs deleted file mode 100644 index 4920a92afeb6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.Serialization.cs +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppServiceEnvironment : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("virtualNetwork"); - writer.WriteObjectValue(VirtualNetwork); - if (Optional.IsDefined(InternalLoadBalancingMode)) - { - writer.WritePropertyName("internalLoadBalancingMode"); - writer.WriteStringValue(InternalLoadBalancingMode.Value.ToString()); - } - if (Optional.IsDefined(MultiSize)) - { - writer.WritePropertyName("multiSize"); - writer.WriteStringValue(MultiSize); - } - if (Optional.IsDefined(IpsslAddressCount)) - { - writer.WritePropertyName("ipsslAddressCount"); - writer.WriteNumberValue(IpsslAddressCount.Value); - } - if (Optional.IsDefined(DnsSuffix)) - { - writer.WritePropertyName("dnsSuffix"); - writer.WriteStringValue(DnsSuffix); - } - if (Optional.IsDefined(FrontEndScaleFactor)) - { - writer.WritePropertyName("frontEndScaleFactor"); - writer.WriteNumberValue(FrontEndScaleFactor.Value); - } - if (Optional.IsCollectionDefined(ClusterSettings)) - { - writer.WritePropertyName("clusterSettings"); - writer.WriteStartArray(); - foreach (var item in ClusterSettings) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(UserWhitelistedIpRanges)) - { - writer.WritePropertyName("userWhitelistedIpRanges"); - writer.WriteStartArray(); - foreach (var item in UserWhitelistedIpRanges) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static AppServiceEnvironment DeserializeAppServiceEnvironment(JsonElement element) - { - Optional provisioningState = default; - Optional status = default; - VirtualNetworkProfile virtualNetwork = default; - Optional internalLoadBalancingMode = default; - Optional multiSize = default; - Optional multiRoleCount = default; - Optional ipsslAddressCount = default; - Optional dnsSuffix = default; - Optional maximumNumberOfMachines = default; - Optional frontEndScaleFactor = default; - Optional suspended = default; - Optional> clusterSettings = default; - Optional> userWhitelistedIpRanges = default; - Optional hasLinuxWorkers = default; - Optional dedicatedHostCount = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("provisioningState")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property.Value.GetString().ToProvisioningState(); - continue; - } - if (property.NameEquals("status")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property.Value.GetString().ToHostingEnvironmentStatus(); - continue; - } - if (property.NameEquals("virtualNetwork")) - { - virtualNetwork = VirtualNetworkProfile.DeserializeVirtualNetworkProfile(property.Value); - continue; - } - if (property.NameEquals("internalLoadBalancingMode")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - internalLoadBalancingMode = new LoadBalancingMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("multiSize")) - { - multiSize = property.Value.GetString(); - continue; - } - if (property.NameEquals("multiRoleCount")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - multiRoleCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("ipsslAddressCount")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - ipsslAddressCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("dnsSuffix")) - { - dnsSuffix = property.Value.GetString(); - continue; - } - if (property.NameEquals("maximumNumberOfMachines")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maximumNumberOfMachines = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("frontEndScaleFactor")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - frontEndScaleFactor = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("suspended")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - suspended = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("clusterSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NameValuePair.DeserializeNameValuePair(item)); - } - clusterSettings = array; - continue; - } - if (property.NameEquals("userWhitelistedIpRanges")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - userWhitelistedIpRanges = array; - continue; - } - if (property.NameEquals("hasLinuxWorkers")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - hasLinuxWorkers = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("dedicatedHostCount")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - dedicatedHostCount = property.Value.GetInt32(); - continue; - } - } - return new AppServiceEnvironment(Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipsslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIpRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(dedicatedHostCount)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs index 6ebc6663c2a8..d7562b769f24 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs @@ -1,104 +1,459 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Description of an App Service Environment. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Description of an App Service Environment. + /// public partial class AppServiceEnvironment { - /// Initializes a new instance of AppServiceEnvironment. - /// Description of the Virtual Network. - /// is null. - public AppServiceEnvironment(VirtualNetworkProfile virtualNetwork) + /// + /// Initializes a new instance of the AppServiceEnvironment class. + /// + public AppServiceEnvironment() { - if (virtualNetwork == null) - { - throw new ArgumentNullException(nameof(virtualNetwork)); - } - - VirtualNetwork = virtualNetwork; - ClusterSettings = new ChangeTrackingList(); - UserWhitelistedIpRanges = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of AppServiceEnvironment. - /// Provisioning state of the App Service Environment. - /// Current status of the App Service Environment. - /// Description of the Virtual Network. - /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. - /// Front-end VM size, e.g. "Medium", "Large". - /// Number of front-end instances. - /// Number of IP SSL addresses reserved for the App Service Environment. - /// DNS suffix of the App Service Environment. - /// Maximum number of VMs in the App Service Environment. - /// Scale factor for front-ends. - /// - /// <code>true</code> if the App Service Environment is suspended; otherwise, <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - /// Custom settings for changing the behavior of the App Service Environment. - /// User added ip ranges to whitelist on ASE db. - /// Flag that displays whether an ASE has linux workers or not. - /// Dedicated Host Count. - internal AppServiceEnvironment(ProvisioningState? provisioningState, HostingEnvironmentStatus? status, VirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipsslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? suspended, IList clusterSettings, IList userWhitelistedIpRanges, bool? hasLinuxWorkers, int? dedicatedHostCount) + /// + /// Initializes a new instance of the AppServiceEnvironment class. + /// + /// Name of the App Service Environment. + /// Location of the App Service Environment, + /// e.g. "West US". + /// Description of the Virtual + /// Network. + /// Description of worker pools with worker + /// size IDs, VM sizes, and number of workers in each pool. + /// Provisioning state of the App + /// Service Environment. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'InProgress', 'Deleting' + /// Current status of the App Service Environment. + /// Possible values include: 'Preparing', 'Ready', 'Scaling', + /// 'Deleting' + /// Name of the Virtual Network for the App + /// Service Environment. + /// Resource group of the Virtual + /// Network. + /// Subnet of the Virtual Network. + /// Specifies which endpoints + /// to serve internally in the Virtual Network for the App Service + /// Environment. Possible values include: 'None', 'Web', 'Publishing', + /// 'Web,Publishing' + /// Front-end VM size, e.g. "Medium", + /// "Large". + /// Number of front-end instances. + /// Number of IP SSL addresses reserved + /// for the App Service Environment. + /// Edition of the metadata database for + /// the App Service Environment, e.g. "Standard". + /// Service objective of the + /// metadata database for the App Service Environment, e.g. + /// "S0". + /// Number of upgrade domains of the App + /// Service Environment. + /// Subscription of the App Service + /// Environment. + /// DNS suffix of the App Service + /// Environment. + /// Last deployment action on the App Service + /// Environment. + /// Result of the last deployment action + /// on the App Service Environment. + /// List of comma separated strings + /// describing which VM sizes are allowed for front-ends. + /// List of comma separated strings + /// describing which VM sizes are allowed for workers. + /// Maximum number of VMs in the + /// App Service Environment. + /// Description of IP SSL mapping for the App + /// Service Environment. + /// Current total, used, and + /// available worker capacities. + /// Access control list for + /// controlling traffic to the App Service Environment. + /// True/false indicating whether + /// the App Service Environment is healthy. + /// Detailed message about with results + /// of the last check of the App Service Environment. + /// Resource group of the App Service + /// Environment. + /// Scale factor for + /// front-ends. + /// Default Scale Factor for + /// FrontEnds. + /// API Management Account + /// associated with the App Service Environment. + /// <code>true</code> if the App + /// Service Environment is suspended; otherwise, + /// <code>false</code>. The environment can be suspended, + /// e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// True/false indicating whether the + /// App Service Environment is suspended. The environment can be + /// suspended e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// Custom settings for changing the + /// behavior of the App Service Environment. + /// User added ip ranges to + /// whitelist on ASE db + /// Flag that displays whether an ASE has + /// linux workers or not + /// Key Vault ID for ILB App Service + /// Environment default SSL certificate + /// Key Vault Secret Name for + /// ILB App Service Environment default SSL certificate + public AppServiceEnvironment(string name, string location, VirtualNetworkProfile virtualNetwork, IList workerPools, ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) { + Name = name; + Location = location; ProvisioningState = provisioningState; Status = status; + VnetName = vnetName; + VnetResourceGroupName = vnetResourceGroupName; + VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; + WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; + DatabaseEdition = databaseEdition; + DatabaseServiceObjective = databaseServiceObjective; + UpgradeDomains = upgradeDomains; + SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; + LastAction = lastAction; + LastActionResult = lastActionResult; + AllowedMultiSizes = allowedMultiSizes; + AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; + VipMappings = vipMappings; + EnvironmentCapacities = environmentCapacities; + NetworkAccessControlList = networkAccessControlList; + EnvironmentIsHealthy = environmentIsHealthy; + EnvironmentStatus = environmentStatus; + ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; + DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; + ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; + DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - DedicatedHostCount = dedicatedHostCount; + SslCertKeyVaultId = sslCertKeyVaultId; + SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; + CustomInit(); } - /// Provisioning state of the App Service Environment. - public ProvisioningState? ProvisioningState { get; } - /// Current status of the App Service Environment. - public HostingEnvironmentStatus? Status { get; } - /// Description of the Virtual Network. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the App Service Environment. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets location of the App Service Environment, e.g. "West + /// US". + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets provisioning state of the App Service Environment. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// 'Deleting' + /// + [JsonProperty(PropertyName = "provisioningState")] + public ProvisioningState? ProvisioningState { get; private set; } + + /// + /// Gets current status of the App Service Environment. Possible values + /// include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + /// + [JsonProperty(PropertyName = "status")] + public HostingEnvironmentStatus? Status { get; private set; } + + /// + /// Gets or sets name of the Virtual Network for the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "vnetName")] + public string VnetName { get; set; } + + /// + /// Gets or sets resource group of the Virtual Network. + /// + [JsonProperty(PropertyName = "vnetResourceGroupName")] + public string VnetResourceGroupName { get; set; } + + /// + /// Gets or sets subnet of the Virtual Network. + /// + [JsonProperty(PropertyName = "vnetSubnetName")] + public string VnetSubnetName { get; set; } + + /// + /// Gets or sets description of the Virtual Network. + /// + [JsonProperty(PropertyName = "virtualNetwork")] public VirtualNetworkProfile VirtualNetwork { get; set; } - /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. - public LoadBalancingMode? InternalLoadBalancingMode { get; set; } - /// Front-end VM size, e.g. "Medium", "Large". + + /// + /// Gets or sets specifies which endpoints to serve internally in the + /// Virtual Network for the App Service Environment. Possible values + /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' + /// + [JsonProperty(PropertyName = "internalLoadBalancingMode")] + public string InternalLoadBalancingMode { get; set; } + + /// + /// Gets or sets front-end VM size, e.g. "Medium", "Large". + /// + [JsonProperty(PropertyName = "multiSize")] public string MultiSize { get; set; } - /// Number of front-end instances. - public int? MultiRoleCount { get; } - /// Number of IP SSL addresses reserved for the App Service Environment. + + /// + /// Gets or sets number of front-end instances. + /// + [JsonProperty(PropertyName = "multiRoleCount")] + public int? MultiRoleCount { get; set; } + + /// + /// Gets or sets description of worker pools with worker size IDs, VM + /// sizes, and number of workers in each pool. + /// + [JsonProperty(PropertyName = "workerPools")] + public IList WorkerPools { get; set; } + + /// + /// Gets or sets number of IP SSL addresses reserved for the App + /// Service Environment. + /// + [JsonProperty(PropertyName = "ipsslAddressCount")] public int? IpsslAddressCount { get; set; } - /// DNS suffix of the App Service Environment. + + /// + /// Gets edition of the metadata database for the App Service + /// Environment, e.g. "Standard". + /// + [JsonProperty(PropertyName = "databaseEdition")] + public string DatabaseEdition { get; private set; } + + /// + /// Gets service objective of the metadata database for the App Service + /// Environment, e.g. "S0". + /// + [JsonProperty(PropertyName = "databaseServiceObjective")] + public string DatabaseServiceObjective { get; private set; } + + /// + /// Gets number of upgrade domains of the App Service Environment. + /// + [JsonProperty(PropertyName = "upgradeDomains")] + public int? UpgradeDomains { get; private set; } + + /// + /// Gets subscription of the App Service Environment. + /// + [JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId { get; private set; } + + /// + /// Gets or sets DNS suffix of the App Service Environment. + /// + [JsonProperty(PropertyName = "dnsSuffix")] public string DnsSuffix { get; set; } - /// Maximum number of VMs in the App Service Environment. - public int? MaximumNumberOfMachines { get; } - /// Scale factor for front-ends. + + /// + /// Gets last deployment action on the App Service Environment. + /// + [JsonProperty(PropertyName = "lastAction")] + public string LastAction { get; private set; } + + /// + /// Gets result of the last deployment action on the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "lastActionResult")] + public string LastActionResult { get; private set; } + + /// + /// Gets list of comma separated strings describing which VM sizes are + /// allowed for front-ends. + /// + [JsonProperty(PropertyName = "allowedMultiSizes")] + public string AllowedMultiSizes { get; private set; } + + /// + /// Gets list of comma separated strings describing which VM sizes are + /// allowed for workers. + /// + [JsonProperty(PropertyName = "allowedWorkerSizes")] + public string AllowedWorkerSizes { get; private set; } + + /// + /// Gets maximum number of VMs in the App Service Environment. + /// + [JsonProperty(PropertyName = "maximumNumberOfMachines")] + public int? MaximumNumberOfMachines { get; private set; } + + /// + /// Gets description of IP SSL mapping for the App Service Environment. + /// + [JsonProperty(PropertyName = "vipMappings")] + public IList VipMappings { get; private set; } + + /// + /// Gets current total, used, and available worker capacities. + /// + [JsonProperty(PropertyName = "environmentCapacities")] + public IList EnvironmentCapacities { get; private set; } + + /// + /// Gets or sets access control list for controlling traffic to the App + /// Service Environment. + /// + [JsonProperty(PropertyName = "networkAccessControlList")] + public IList NetworkAccessControlList { get; set; } + + /// + /// Gets true/false indicating whether the App Service Environment is + /// healthy. + /// + [JsonProperty(PropertyName = "environmentIsHealthy")] + public bool? EnvironmentIsHealthy { get; private set; } + + /// + /// Gets detailed message about with results of the last check of the + /// App Service Environment. + /// + [JsonProperty(PropertyName = "environmentStatus")] + public string EnvironmentStatus { get; private set; } + + /// + /// Gets resource group of the App Service Environment. + /// + [JsonProperty(PropertyName = "resourceGroup")] + public string ResourceGroup { get; private set; } + + /// + /// Gets or sets scale factor for front-ends. + /// + [JsonProperty(PropertyName = "frontEndScaleFactor")] public int? FrontEndScaleFactor { get; set; } + + /// + /// Gets default Scale Factor for FrontEnds. + /// + [JsonProperty(PropertyName = "defaultFrontEndScaleFactor")] + public int? DefaultFrontEndScaleFactor { get; private set; } + /// - /// <code>true</code> if the App Service Environment is suspended; otherwise, <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - public bool? Suspended { get; } - /// Custom settings for changing the behavior of the App Service Environment. - public IList ClusterSettings { get; } - /// User added ip ranges to whitelist on ASE db. - public IList UserWhitelistedIpRanges { get; } - /// Flag that displays whether an ASE has linux workers or not. - public bool? HasLinuxWorkers { get; } - /// Dedicated Host Count. - public int? DedicatedHostCount { get; } + /// Gets or sets API Management Account associated with the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "apiManagementAccountId")] + public string ApiManagementAccountId { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// App Service Environment is suspended; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. The environment can + /// be suspended, e.g. when the management endpoint is no longer + /// available + /// (most likely because NSG blocked the incoming traffic). + /// + [JsonProperty(PropertyName = "suspended")] + public bool? Suspended { get; set; } + + /// + /// Gets or sets true/false indicating whether the App Service + /// Environment is suspended. The environment can be suspended e.g. + /// when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// + [JsonProperty(PropertyName = "dynamicCacheEnabled")] + public bool? DynamicCacheEnabled { get; set; } + + /// + /// Gets or sets custom settings for changing the behavior of the App + /// Service Environment. + /// + [JsonProperty(PropertyName = "clusterSettings")] + public IList ClusterSettings { get; set; } + + /// + /// Gets or sets user added ip ranges to whitelist on ASE db + /// + [JsonProperty(PropertyName = "userWhitelistedIpRanges")] + public IList UserWhitelistedIpRanges { get; set; } + + /// + /// Gets or sets flag that displays whether an ASE has linux workers or + /// not + /// + [JsonProperty(PropertyName = "hasLinuxWorkers")] + public bool? HasLinuxWorkers { get; set; } + + /// + /// Gets or sets key Vault ID for ILB App Service Environment default + /// SSL certificate + /// + [JsonProperty(PropertyName = "sslCertKeyVaultId")] + public string SslCertKeyVaultId { get; set; } + + /// + /// Gets or sets key Vault Secret Name for ILB App Service Environment + /// default SSL certificate + /// + [JsonProperty(PropertyName = "sslCertKeyVaultSecretName")] + public string SslCertKeyVaultSecretName { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + if (VirtualNetwork == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); + } + if (WorkerPools == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.Serialization.cs deleted file mode 100644 index dea6114515c0..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class AppServiceEnvironmentCollection - { - internal static AppServiceEnvironmentCollection DeserializeAppServiceEnvironmentCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AppServiceEnvironmentResource.DeserializeAppServiceEnvironmentResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new AppServiceEnvironmentCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.cs deleted file mode 100644 index 81a50b0a1987..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of App Service Environments. - internal partial class AppServiceEnvironmentCollection - { - /// Initializes a new instance of AppServiceEnvironmentCollection. - /// Collection of resources. - /// is null. - internal AppServiceEnvironmentCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of AppServiceEnvironmentCollection. - /// Collection of resources. - /// Link to next page of resources. - internal AppServiceEnvironmentCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.Serialization.cs deleted file mode 100644 index de2b58245ed5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.Serialization.cs +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppServiceEnvironmentPatchResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(VirtualNetwork)) - { - writer.WritePropertyName("virtualNetwork"); - writer.WriteObjectValue(VirtualNetwork); - } - if (Optional.IsDefined(InternalLoadBalancingMode)) - { - writer.WritePropertyName("internalLoadBalancingMode"); - writer.WriteStringValue(InternalLoadBalancingMode.Value.ToString()); - } - if (Optional.IsDefined(MultiSize)) - { - writer.WritePropertyName("multiSize"); - writer.WriteStringValue(MultiSize); - } - if (Optional.IsDefined(IpsslAddressCount)) - { - writer.WritePropertyName("ipsslAddressCount"); - writer.WriteNumberValue(IpsslAddressCount.Value); - } - if (Optional.IsDefined(DnsSuffix)) - { - writer.WritePropertyName("dnsSuffix"); - writer.WriteStringValue(DnsSuffix); - } - if (Optional.IsDefined(FrontEndScaleFactor)) - { - writer.WritePropertyName("frontEndScaleFactor"); - writer.WriteNumberValue(FrontEndScaleFactor.Value); - } - if (Optional.IsCollectionDefined(ClusterSettings)) - { - writer.WritePropertyName("clusterSettings"); - writer.WriteStartArray(); - foreach (var item in ClusterSettings) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(UserWhitelistedIpRanges)) - { - writer.WritePropertyName("userWhitelistedIpRanges"); - writer.WriteStartArray(); - foreach (var item in UserWhitelistedIpRanges) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AppServiceEnvironmentPatchResource DeserializeAppServiceEnvironmentPatchResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional provisioningState = default; - Optional status = default; - Optional virtualNetwork = default; - Optional internalLoadBalancingMode = default; - Optional multiSize = default; - Optional multiRoleCount = default; - Optional ipsslAddressCount = default; - Optional dnsSuffix = default; - Optional maximumNumberOfMachines = default; - Optional frontEndScaleFactor = default; - Optional suspended = default; - Optional> clusterSettings = default; - Optional> userWhitelistedIpRanges = default; - Optional hasLinuxWorkers = default; - Optional dedicatedHostCount = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property0.Value.GetString().ToProvisioningState(); - continue; - } - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property0.Value.GetString().ToHostingEnvironmentStatus(); - continue; - } - if (property0.NameEquals("virtualNetwork")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - virtualNetwork = VirtualNetworkProfile.DeserializeVirtualNetworkProfile(property0.Value); - continue; - } - if (property0.NameEquals("internalLoadBalancingMode")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - internalLoadBalancingMode = new LoadBalancingMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("multiSize")) - { - multiSize = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("multiRoleCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - multiRoleCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("ipsslAddressCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - ipsslAddressCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("dnsSuffix")) - { - dnsSuffix = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("maximumNumberOfMachines")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - maximumNumberOfMachines = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("frontEndScaleFactor")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - frontEndScaleFactor = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("suspended")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - suspended = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("clusterSettings")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(NameValuePair.DeserializeNameValuePair(item)); - } - clusterSettings = array; - continue; - } - if (property0.NameEquals("userWhitelistedIpRanges")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - userWhitelistedIpRanges = array; - continue; - } - if (property0.NameEquals("hasLinuxWorkers")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hasLinuxWorkers = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("dedicatedHostCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - dedicatedHostCount = property0.Value.GetInt32(); - continue; - } - } - continue; - } - } - return new AppServiceEnvironmentPatchResource(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork.Value, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipsslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIpRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(dedicatedHostCount)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs index bd0c5cb634a9..bf9e55680b03 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs @@ -1,99 +1,469 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// ARM resource for a app service environment. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// ARM resource for a app service environment. + /// + [Rest.Serialization.JsonTransformation] public partial class AppServiceEnvironmentPatchResource : ProxyOnlyResource { - /// Initializes a new instance of AppServiceEnvironmentPatchResource. + /// + /// Initializes a new instance of the + /// AppServiceEnvironmentPatchResource class. + /// public AppServiceEnvironmentPatchResource() { - ClusterSettings = new ChangeTrackingList(); - UserWhitelistedIpRanges = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of AppServiceEnvironmentPatchResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Provisioning state of the App Service Environment. - /// Current status of the App Service Environment. - /// Description of the Virtual Network. - /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. - /// Front-end VM size, e.g. "Medium", "Large". - /// Number of front-end instances. - /// Number of IP SSL addresses reserved for the App Service Environment. - /// DNS suffix of the App Service Environment. - /// Maximum number of VMs in the App Service Environment. - /// Scale factor for front-ends. - /// - /// <code>true</code> if the App Service Environment is suspended; otherwise, <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - /// Custom settings for changing the behavior of the App Service Environment. - /// User added ip ranges to whitelist on ASE db. - /// Flag that displays whether an ASE has linux workers or not. - /// Dedicated Host Count. - internal AppServiceEnvironmentPatchResource(string id, string name, string kind, string type, ProvisioningState? provisioningState, HostingEnvironmentStatus? status, VirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipsslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? suspended, IList clusterSettings, IList userWhitelistedIpRanges, bool? hasLinuxWorkers, int? dedicatedHostCount) : base(id, name, kind, type) + /// + /// Initializes a new instance of the + /// AppServiceEnvironmentPatchResource class. + /// + /// Name of the + /// App Service Environment. + /// Location of the App Service Environment, + /// e.g. "West US". + /// Description of the Virtual + /// Network. + /// Description of worker pools with worker + /// size IDs, VM sizes, and number of workers in each pool. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Provisioning state of the App + /// Service Environment. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'InProgress', 'Deleting' + /// Current status of the App Service Environment. + /// Possible values include: 'Preparing', 'Ready', 'Scaling', + /// 'Deleting' + /// Name of the Virtual Network for the App + /// Service Environment. + /// Resource group of the Virtual + /// Network. + /// Subnet of the Virtual Network. + /// Specifies which endpoints + /// to serve internally in the Virtual Network for the App Service + /// Environment. Possible values include: 'None', 'Web', 'Publishing', + /// 'Web,Publishing' + /// Front-end VM size, e.g. "Medium", + /// "Large". + /// Number of front-end instances. + /// Number of IP SSL addresses reserved + /// for the App Service Environment. + /// Edition of the metadata database for + /// the App Service Environment, e.g. "Standard". + /// Service objective of the + /// metadata database for the App Service Environment, e.g. + /// "S0". + /// Number of upgrade domains of the App + /// Service Environment. + /// Subscription of the App Service + /// Environment. + /// DNS suffix of the App Service + /// Environment. + /// Last deployment action on the App Service + /// Environment. + /// Result of the last deployment action + /// on the App Service Environment. + /// List of comma separated strings + /// describing which VM sizes are allowed for front-ends. + /// List of comma separated strings + /// describing which VM sizes are allowed for workers. + /// Maximum number of VMs in the + /// App Service Environment. + /// Description of IP SSL mapping for the App + /// Service Environment. + /// Current total, used, and + /// available worker capacities. + /// Access control list for + /// controlling traffic to the App Service Environment. + /// True/false indicating whether + /// the App Service Environment is healthy. + /// Detailed message about with results + /// of the last check of the App Service Environment. + /// Resource group of the App Service + /// Environment. + /// Scale factor for + /// front-ends. + /// Default Scale Factor for + /// FrontEnds. + /// API Management Account + /// associated with the App Service Environment. + /// <code>true</code> if the App + /// Service Environment is suspended; otherwise, + /// <code>false</code>. The environment can be suspended, + /// e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// True/false indicating whether the + /// App Service Environment is suspended. The environment can be + /// suspended e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// Custom settings for changing the + /// behavior of the App Service Environment. + /// User added ip ranges to + /// whitelist on ASE db + /// Flag that displays whether an ASE has + /// linux workers or not + /// Key Vault ID for ILB App Service + /// Environment default SSL certificate + /// Key Vault Secret Name for + /// ILB App Service Environment default SSL certificate + public AppServiceEnvironmentPatchResource(string appServiceEnvironmentPatchResourceName, string location, VirtualNetworkProfile virtualNetwork, IList workerPools, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) + : base(id, name, kind, type) { + AppServiceEnvironmentPatchResourceName = appServiceEnvironmentPatchResourceName; + Location = location; ProvisioningState = provisioningState; Status = status; + VnetName = vnetName; + VnetResourceGroupName = vnetResourceGroupName; + VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; + WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; + DatabaseEdition = databaseEdition; + DatabaseServiceObjective = databaseServiceObjective; + UpgradeDomains = upgradeDomains; + SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; + LastAction = lastAction; + LastActionResult = lastActionResult; + AllowedMultiSizes = allowedMultiSizes; + AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; + VipMappings = vipMappings; + EnvironmentCapacities = environmentCapacities; + NetworkAccessControlList = networkAccessControlList; + EnvironmentIsHealthy = environmentIsHealthy; + EnvironmentStatus = environmentStatus; + ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; + DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; + ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; + DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - DedicatedHostCount = dedicatedHostCount; + SslCertKeyVaultId = sslCertKeyVaultId; + SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; + CustomInit(); } - /// Provisioning state of the App Service Environment. - public ProvisioningState? ProvisioningState { get; } - /// Current status of the App Service Environment. - public HostingEnvironmentStatus? Status { get; } - /// Description of the Virtual Network. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.name")] + public string AppServiceEnvironmentPatchResourceName { get; set; } + + /// + /// Gets or sets location of the App Service Environment, e.g. "West + /// US". + /// + [JsonProperty(PropertyName = "properties.location")] + public string Location { get; set; } + + /// + /// Gets provisioning state of the App Service Environment. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// 'Deleting' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState? ProvisioningState { get; private set; } + + /// + /// Gets current status of the App Service Environment. Possible values + /// include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + /// + [JsonProperty(PropertyName = "properties.status")] + public HostingEnvironmentStatus? Status { get; private set; } + + /// + /// Gets or sets name of the Virtual Network for the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "properties.vnetName")] + public string VnetName { get; set; } + + /// + /// Gets or sets resource group of the Virtual Network. + /// + [JsonProperty(PropertyName = "properties.vnetResourceGroupName")] + public string VnetResourceGroupName { get; set; } + + /// + /// Gets or sets subnet of the Virtual Network. + /// + [JsonProperty(PropertyName = "properties.vnetSubnetName")] + public string VnetSubnetName { get; set; } + + /// + /// Gets or sets description of the Virtual Network. + /// + [JsonProperty(PropertyName = "properties.virtualNetwork")] public VirtualNetworkProfile VirtualNetwork { get; set; } - /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. - public LoadBalancingMode? InternalLoadBalancingMode { get; set; } - /// Front-end VM size, e.g. "Medium", "Large". + + /// + /// Gets or sets specifies which endpoints to serve internally in the + /// Virtual Network for the App Service Environment. Possible values + /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' + /// + [JsonProperty(PropertyName = "properties.internalLoadBalancingMode")] + public string InternalLoadBalancingMode { get; set; } + + /// + /// Gets or sets front-end VM size, e.g. "Medium", "Large". + /// + [JsonProperty(PropertyName = "properties.multiSize")] public string MultiSize { get; set; } - /// Number of front-end instances. - public int? MultiRoleCount { get; } - /// Number of IP SSL addresses reserved for the App Service Environment. + + /// + /// Gets or sets number of front-end instances. + /// + [JsonProperty(PropertyName = "properties.multiRoleCount")] + public int? MultiRoleCount { get; set; } + + /// + /// Gets or sets description of worker pools with worker size IDs, VM + /// sizes, and number of workers in each pool. + /// + [JsonProperty(PropertyName = "properties.workerPools")] + public IList WorkerPools { get; set; } + + /// + /// Gets or sets number of IP SSL addresses reserved for the App + /// Service Environment. + /// + [JsonProperty(PropertyName = "properties.ipsslAddressCount")] public int? IpsslAddressCount { get; set; } - /// DNS suffix of the App Service Environment. + + /// + /// Gets edition of the metadata database for the App Service + /// Environment, e.g. "Standard". + /// + [JsonProperty(PropertyName = "properties.databaseEdition")] + public string DatabaseEdition { get; private set; } + + /// + /// Gets service objective of the metadata database for the App Service + /// Environment, e.g. "S0". + /// + [JsonProperty(PropertyName = "properties.databaseServiceObjective")] + public string DatabaseServiceObjective { get; private set; } + + /// + /// Gets number of upgrade domains of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.upgradeDomains")] + public int? UpgradeDomains { get; private set; } + + /// + /// Gets subscription of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.subscriptionId")] + public string SubscriptionId { get; private set; } + + /// + /// Gets or sets DNS suffix of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.dnsSuffix")] public string DnsSuffix { get; set; } - /// Maximum number of VMs in the App Service Environment. - public int? MaximumNumberOfMachines { get; } - /// Scale factor for front-ends. + + /// + /// Gets last deployment action on the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.lastAction")] + public string LastAction { get; private set; } + + /// + /// Gets result of the last deployment action on the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "properties.lastActionResult")] + public string LastActionResult { get; private set; } + + /// + /// Gets list of comma separated strings describing which VM sizes are + /// allowed for front-ends. + /// + [JsonProperty(PropertyName = "properties.allowedMultiSizes")] + public string AllowedMultiSizes { get; private set; } + + /// + /// Gets list of comma separated strings describing which VM sizes are + /// allowed for workers. + /// + [JsonProperty(PropertyName = "properties.allowedWorkerSizes")] + public string AllowedWorkerSizes { get; private set; } + + /// + /// Gets maximum number of VMs in the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.maximumNumberOfMachines")] + public int? MaximumNumberOfMachines { get; private set; } + + /// + /// Gets description of IP SSL mapping for the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.vipMappings")] + public IList VipMappings { get; private set; } + + /// + /// Gets current total, used, and available worker capacities. + /// + [JsonProperty(PropertyName = "properties.environmentCapacities")] + public IList EnvironmentCapacities { get; private set; } + + /// + /// Gets or sets access control list for controlling traffic to the App + /// Service Environment. + /// + [JsonProperty(PropertyName = "properties.networkAccessControlList")] + public IList NetworkAccessControlList { get; set; } + + /// + /// Gets true/false indicating whether the App Service Environment is + /// healthy. + /// + [JsonProperty(PropertyName = "properties.environmentIsHealthy")] + public bool? EnvironmentIsHealthy { get; private set; } + + /// + /// Gets detailed message about with results of the last check of the + /// App Service Environment. + /// + [JsonProperty(PropertyName = "properties.environmentStatus")] + public string EnvironmentStatus { get; private set; } + + /// + /// Gets resource group of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.resourceGroup")] + public string ResourceGroup { get; private set; } + + /// + /// Gets or sets scale factor for front-ends. + /// + [JsonProperty(PropertyName = "properties.frontEndScaleFactor")] public int? FrontEndScaleFactor { get; set; } + + /// + /// Gets default Scale Factor for FrontEnds. + /// + [JsonProperty(PropertyName = "properties.defaultFrontEndScaleFactor")] + public int? DefaultFrontEndScaleFactor { get; private set; } + + /// + /// Gets or sets API Management Account associated with the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "properties.apiManagementAccountId")] + public string ApiManagementAccountId { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// App Service Environment is suspended; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. The environment can + /// be suspended, e.g. when the management endpoint is no longer + /// available + /// (most likely because NSG blocked the incoming traffic). + /// + [JsonProperty(PropertyName = "properties.suspended")] + public bool? Suspended { get; set; } + + /// + /// Gets or sets true/false indicating whether the App Service + /// Environment is suspended. The environment can be suspended e.g. + /// when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// + [JsonProperty(PropertyName = "properties.dynamicCacheEnabled")] + public bool? DynamicCacheEnabled { get; set; } + + /// + /// Gets or sets custom settings for changing the behavior of the App + /// Service Environment. + /// + [JsonProperty(PropertyName = "properties.clusterSettings")] + public IList ClusterSettings { get; set; } + + /// + /// Gets or sets user added ip ranges to whitelist on ASE db + /// + [JsonProperty(PropertyName = "properties.userWhitelistedIpRanges")] + public IList UserWhitelistedIpRanges { get; set; } + + /// + /// Gets or sets flag that displays whether an ASE has linux workers or + /// not + /// + [JsonProperty(PropertyName = "properties.hasLinuxWorkers")] + public bool? HasLinuxWorkers { get; set; } + + /// + /// Gets or sets key Vault ID for ILB App Service Environment default + /// SSL certificate + /// + [JsonProperty(PropertyName = "properties.sslCertKeyVaultId")] + public string SslCertKeyVaultId { get; set; } + + /// + /// Gets or sets key Vault Secret Name for ILB App Service Environment + /// default SSL certificate + /// + [JsonProperty(PropertyName = "properties.sslCertKeyVaultSecretName")] + public string SslCertKeyVaultSecretName { get; set; } + /// - /// <code>true</code> if the App Service Environment is suspended; otherwise, <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - public bool? Suspended { get; } - /// Custom settings for changing the behavior of the App Service Environment. - public IList ClusterSettings { get; } - /// User added ip ranges to whitelist on ASE db. - public IList UserWhitelistedIpRanges { get; } - /// Flag that displays whether an ASE has linux workers or not. - public bool? HasLinuxWorkers { get; } - /// Dedicated Host Count. - public int? DedicatedHostCount { get; } + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AppServiceEnvironmentPatchResourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentPatchResourceName"); + } + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + if (VirtualNetwork == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); + } + if (WorkerPools == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.Serialization.cs deleted file mode 100644 index a6597f6e3aa3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.Serialization.cs +++ /dev/null @@ -1,324 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppServiceEnvironmentResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(VirtualNetwork)) - { - writer.WritePropertyName("virtualNetwork"); - writer.WriteObjectValue(VirtualNetwork); - } - if (Optional.IsDefined(InternalLoadBalancingMode)) - { - writer.WritePropertyName("internalLoadBalancingMode"); - writer.WriteStringValue(InternalLoadBalancingMode.Value.ToString()); - } - if (Optional.IsDefined(MultiSize)) - { - writer.WritePropertyName("multiSize"); - writer.WriteStringValue(MultiSize); - } - if (Optional.IsDefined(IpsslAddressCount)) - { - writer.WritePropertyName("ipsslAddressCount"); - writer.WriteNumberValue(IpsslAddressCount.Value); - } - if (Optional.IsDefined(DnsSuffix)) - { - writer.WritePropertyName("dnsSuffix"); - writer.WriteStringValue(DnsSuffix); - } - if (Optional.IsDefined(FrontEndScaleFactor)) - { - writer.WritePropertyName("frontEndScaleFactor"); - writer.WriteNumberValue(FrontEndScaleFactor.Value); - } - if (Optional.IsCollectionDefined(ClusterSettings)) - { - writer.WritePropertyName("clusterSettings"); - writer.WriteStartArray(); - foreach (var item in ClusterSettings) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(UserWhitelistedIpRanges)) - { - writer.WritePropertyName("userWhitelistedIpRanges"); - writer.WriteStartArray(); - foreach (var item in UserWhitelistedIpRanges) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AppServiceEnvironmentResource DeserializeAppServiceEnvironmentResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - string location = default; - Optional type = default; - Optional> tags = default; - Optional provisioningState = default; - Optional status = default; - Optional virtualNetwork = default; - Optional internalLoadBalancingMode = default; - Optional multiSize = default; - Optional multiRoleCount = default; - Optional ipsslAddressCount = default; - Optional dnsSuffix = default; - Optional maximumNumberOfMachines = default; - Optional frontEndScaleFactor = default; - Optional suspended = default; - Optional> clusterSettings = default; - Optional> userWhitelistedIpRanges = default; - Optional hasLinuxWorkers = default; - Optional dedicatedHostCount = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property0.Value.GetString().ToProvisioningState(); - continue; - } - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property0.Value.GetString().ToHostingEnvironmentStatus(); - continue; - } - if (property0.NameEquals("virtualNetwork")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - virtualNetwork = VirtualNetworkProfile.DeserializeVirtualNetworkProfile(property0.Value); - continue; - } - if (property0.NameEquals("internalLoadBalancingMode")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - internalLoadBalancingMode = new LoadBalancingMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("multiSize")) - { - multiSize = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("multiRoleCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - multiRoleCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("ipsslAddressCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - ipsslAddressCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("dnsSuffix")) - { - dnsSuffix = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("maximumNumberOfMachines")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - maximumNumberOfMachines = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("frontEndScaleFactor")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - frontEndScaleFactor = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("suspended")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - suspended = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("clusterSettings")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(NameValuePair.DeserializeNameValuePair(item)); - } - clusterSettings = array; - continue; - } - if (property0.NameEquals("userWhitelistedIpRanges")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - userWhitelistedIpRanges = array; - continue; - } - if (property0.NameEquals("hasLinuxWorkers")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hasLinuxWorkers = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("dedicatedHostCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - dedicatedHostCount = property0.Value.GetInt32(); - continue; - } - } - continue; - } - } - return new AppServiceEnvironmentResource(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork.Value, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipsslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIpRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(dedicatedHostCount)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs index d04fff939fd8..910c484a40d3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs @@ -1,109 +1,472 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// App Service Environment ARM resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// App Service Environment ARM resource. + /// + [Rest.Serialization.JsonTransformation] public partial class AppServiceEnvironmentResource : Resource { - /// Initializes a new instance of AppServiceEnvironmentResource. - /// Resource Location. - /// is null. - public AppServiceEnvironmentResource(string location) : base(location) + /// + /// Initializes a new instance of the AppServiceEnvironmentResource + /// class. + /// + public AppServiceEnvironmentResource() { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - ClusterSettings = new ChangeTrackingList(); - UserWhitelistedIpRanges = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of AppServiceEnvironmentResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource Location. - /// Resource type. - /// Resource tags. - /// Provisioning state of the App Service Environment. - /// Current status of the App Service Environment. - /// Description of the Virtual Network. - /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. - /// Front-end VM size, e.g. "Medium", "Large". - /// Number of front-end instances. - /// Number of IP SSL addresses reserved for the App Service Environment. - /// DNS suffix of the App Service Environment. - /// Maximum number of VMs in the App Service Environment. - /// Scale factor for front-ends. - /// - /// <code>true</code> if the App Service Environment is suspended; otherwise, <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - /// Custom settings for changing the behavior of the App Service Environment. - /// User added ip ranges to whitelist on ASE db. - /// Flag that displays whether an ASE has linux workers or not. - /// Dedicated Host Count. - internal AppServiceEnvironmentResource(string id, string name, string kind, string location, string type, IDictionary tags, ProvisioningState? provisioningState, HostingEnvironmentStatus? status, VirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipsslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? suspended, IList clusterSettings, IList userWhitelistedIpRanges, bool? hasLinuxWorkers, int? dedicatedHostCount) : base(id, name, kind, location, type, tags) + /// + /// Initializes a new instance of the AppServiceEnvironmentResource + /// class. + /// + /// Resource Location. + /// Name of the App + /// Service Environment. + /// Location of the + /// App Service Environment, e.g. "West US". + /// Description of the Virtual + /// Network. + /// Description of worker pools with worker + /// size IDs, VM sizes, and number of workers in each pool. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Resource tags. + /// Provisioning state of the App + /// Service Environment. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'InProgress', 'Deleting' + /// Current status of the App Service Environment. + /// Possible values include: 'Preparing', 'Ready', 'Scaling', + /// 'Deleting' + /// Name of the Virtual Network for the App + /// Service Environment. + /// Resource group of the Virtual + /// Network. + /// Subnet of the Virtual Network. + /// Specifies which endpoints + /// to serve internally in the Virtual Network for the App Service + /// Environment. Possible values include: 'None', 'Web', 'Publishing', + /// 'Web,Publishing' + /// Front-end VM size, e.g. "Medium", + /// "Large". + /// Number of front-end instances. + /// Number of IP SSL addresses reserved + /// for the App Service Environment. + /// Edition of the metadata database for + /// the App Service Environment, e.g. "Standard". + /// Service objective of the + /// metadata database for the App Service Environment, e.g. + /// "S0". + /// Number of upgrade domains of the App + /// Service Environment. + /// Subscription of the App Service + /// Environment. + /// DNS suffix of the App Service + /// Environment. + /// Last deployment action on the App Service + /// Environment. + /// Result of the last deployment action + /// on the App Service Environment. + /// List of comma separated strings + /// describing which VM sizes are allowed for front-ends. + /// List of comma separated strings + /// describing which VM sizes are allowed for workers. + /// Maximum number of VMs in the + /// App Service Environment. + /// Description of IP SSL mapping for the App + /// Service Environment. + /// Current total, used, and + /// available worker capacities. + /// Access control list for + /// controlling traffic to the App Service Environment. + /// True/false indicating whether + /// the App Service Environment is healthy. + /// Detailed message about with results + /// of the last check of the App Service Environment. + /// Resource group of the App Service + /// Environment. + /// Scale factor for + /// front-ends. + /// Default Scale Factor for + /// FrontEnds. + /// API Management Account + /// associated with the App Service Environment. + /// <code>true</code> if the App + /// Service Environment is suspended; otherwise, + /// <code>false</code>. The environment can be suspended, + /// e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// True/false indicating whether the + /// App Service Environment is suspended. The environment can be + /// suspended e.g. when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// Custom settings for changing the + /// behavior of the App Service Environment. + /// User added ip ranges to + /// whitelist on ASE db + /// Flag that displays whether an ASE has + /// linux workers or not + /// Key Vault ID for ILB App Service + /// Environment default SSL certificate + /// Key Vault Secret Name for + /// ILB App Service Environment default SSL certificate + public AppServiceEnvironmentResource(string location, string appServiceEnvironmentResourceName, string appServiceEnvironmentResourceLocation, VirtualNetworkProfile virtualNetwork, IList workerPools, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) + : base(location, id, name, kind, type, tags) { + AppServiceEnvironmentResourceName = appServiceEnvironmentResourceName; + AppServiceEnvironmentResourceLocation = appServiceEnvironmentResourceLocation; ProvisioningState = provisioningState; Status = status; + VnetName = vnetName; + VnetResourceGroupName = vnetResourceGroupName; + VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; + WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; + DatabaseEdition = databaseEdition; + DatabaseServiceObjective = databaseServiceObjective; + UpgradeDomains = upgradeDomains; + SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; + LastAction = lastAction; + LastActionResult = lastActionResult; + AllowedMultiSizes = allowedMultiSizes; + AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; + VipMappings = vipMappings; + EnvironmentCapacities = environmentCapacities; + NetworkAccessControlList = networkAccessControlList; + EnvironmentIsHealthy = environmentIsHealthy; + EnvironmentStatus = environmentStatus; + ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; + DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; + ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; + DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - DedicatedHostCount = dedicatedHostCount; + SslCertKeyVaultId = sslCertKeyVaultId; + SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; + CustomInit(); } - /// Provisioning state of the App Service Environment. - public ProvisioningState? ProvisioningState { get; } - /// Current status of the App Service Environment. - public HostingEnvironmentStatus? Status { get; } - /// Description of the Virtual Network. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.name")] + public string AppServiceEnvironmentResourceName { get; set; } + + /// + /// Gets or sets location of the App Service Environment, e.g. "West + /// US". + /// + [JsonProperty(PropertyName = "properties.location")] + public string AppServiceEnvironmentResourceLocation { get; set; } + + /// + /// Gets provisioning state of the App Service Environment. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// 'Deleting' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState? ProvisioningState { get; private set; } + + /// + /// Gets current status of the App Service Environment. Possible values + /// include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + /// + [JsonProperty(PropertyName = "properties.status")] + public HostingEnvironmentStatus? Status { get; private set; } + + /// + /// Gets or sets name of the Virtual Network for the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "properties.vnetName")] + public string VnetName { get; set; } + + /// + /// Gets or sets resource group of the Virtual Network. + /// + [JsonProperty(PropertyName = "properties.vnetResourceGroupName")] + public string VnetResourceGroupName { get; set; } + + /// + /// Gets or sets subnet of the Virtual Network. + /// + [JsonProperty(PropertyName = "properties.vnetSubnetName")] + public string VnetSubnetName { get; set; } + + /// + /// Gets or sets description of the Virtual Network. + /// + [JsonProperty(PropertyName = "properties.virtualNetwork")] public VirtualNetworkProfile VirtualNetwork { get; set; } - /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. - public LoadBalancingMode? InternalLoadBalancingMode { get; set; } - /// Front-end VM size, e.g. "Medium", "Large". + + /// + /// Gets or sets specifies which endpoints to serve internally in the + /// Virtual Network for the App Service Environment. Possible values + /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' + /// + [JsonProperty(PropertyName = "properties.internalLoadBalancingMode")] + public string InternalLoadBalancingMode { get; set; } + + /// + /// Gets or sets front-end VM size, e.g. "Medium", "Large". + /// + [JsonProperty(PropertyName = "properties.multiSize")] public string MultiSize { get; set; } - /// Number of front-end instances. - public int? MultiRoleCount { get; } - /// Number of IP SSL addresses reserved for the App Service Environment. + + /// + /// Gets or sets number of front-end instances. + /// + [JsonProperty(PropertyName = "properties.multiRoleCount")] + public int? MultiRoleCount { get; set; } + + /// + /// Gets or sets description of worker pools with worker size IDs, VM + /// sizes, and number of workers in each pool. + /// + [JsonProperty(PropertyName = "properties.workerPools")] + public IList WorkerPools { get; set; } + + /// + /// Gets or sets number of IP SSL addresses reserved for the App + /// Service Environment. + /// + [JsonProperty(PropertyName = "properties.ipsslAddressCount")] public int? IpsslAddressCount { get; set; } - /// DNS suffix of the App Service Environment. + + /// + /// Gets edition of the metadata database for the App Service + /// Environment, e.g. "Standard". + /// + [JsonProperty(PropertyName = "properties.databaseEdition")] + public string DatabaseEdition { get; private set; } + + /// + /// Gets service objective of the metadata database for the App Service + /// Environment, e.g. "S0". + /// + [JsonProperty(PropertyName = "properties.databaseServiceObjective")] + public string DatabaseServiceObjective { get; private set; } + + /// + /// Gets number of upgrade domains of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.upgradeDomains")] + public int? UpgradeDomains { get; private set; } + + /// + /// Gets subscription of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.subscriptionId")] + public string SubscriptionId { get; private set; } + + /// + /// Gets or sets DNS suffix of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.dnsSuffix")] public string DnsSuffix { get; set; } - /// Maximum number of VMs in the App Service Environment. - public int? MaximumNumberOfMachines { get; } - /// Scale factor for front-ends. + + /// + /// Gets last deployment action on the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.lastAction")] + public string LastAction { get; private set; } + + /// + /// Gets result of the last deployment action on the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "properties.lastActionResult")] + public string LastActionResult { get; private set; } + + /// + /// Gets list of comma separated strings describing which VM sizes are + /// allowed for front-ends. + /// + [JsonProperty(PropertyName = "properties.allowedMultiSizes")] + public string AllowedMultiSizes { get; private set; } + + /// + /// Gets list of comma separated strings describing which VM sizes are + /// allowed for workers. + /// + [JsonProperty(PropertyName = "properties.allowedWorkerSizes")] + public string AllowedWorkerSizes { get; private set; } + + /// + /// Gets maximum number of VMs in the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.maximumNumberOfMachines")] + public int? MaximumNumberOfMachines { get; private set; } + + /// + /// Gets description of IP SSL mapping for the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.vipMappings")] + public IList VipMappings { get; private set; } + + /// + /// Gets current total, used, and available worker capacities. + /// + [JsonProperty(PropertyName = "properties.environmentCapacities")] + public IList EnvironmentCapacities { get; private set; } + + /// + /// Gets or sets access control list for controlling traffic to the App + /// Service Environment. + /// + [JsonProperty(PropertyName = "properties.networkAccessControlList")] + public IList NetworkAccessControlList { get; set; } + + /// + /// Gets true/false indicating whether the App Service Environment is + /// healthy. + /// + [JsonProperty(PropertyName = "properties.environmentIsHealthy")] + public bool? EnvironmentIsHealthy { get; private set; } + + /// + /// Gets detailed message about with results of the last check of the + /// App Service Environment. + /// + [JsonProperty(PropertyName = "properties.environmentStatus")] + public string EnvironmentStatus { get; private set; } + + /// + /// Gets resource group of the App Service Environment. + /// + [JsonProperty(PropertyName = "properties.resourceGroup")] + public string ResourceGroup { get; private set; } + + /// + /// Gets or sets scale factor for front-ends. + /// + [JsonProperty(PropertyName = "properties.frontEndScaleFactor")] public int? FrontEndScaleFactor { get; set; } + + /// + /// Gets default Scale Factor for FrontEnds. + /// + [JsonProperty(PropertyName = "properties.defaultFrontEndScaleFactor")] + public int? DefaultFrontEndScaleFactor { get; private set; } + /// - /// <code>true</code> if the App Service Environment is suspended; otherwise, <code>false</code>. The environment can be suspended, e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - public bool? Suspended { get; } - /// Custom settings for changing the behavior of the App Service Environment. - public IList ClusterSettings { get; } - /// User added ip ranges to whitelist on ASE db. - public IList UserWhitelistedIpRanges { get; } - /// Flag that displays whether an ASE has linux workers or not. - public bool? HasLinuxWorkers { get; } - /// Dedicated Host Count. - public int? DedicatedHostCount { get; } + /// Gets or sets API Management Account associated with the App Service + /// Environment. + /// + [JsonProperty(PropertyName = "properties.apiManagementAccountId")] + public string ApiManagementAccountId { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// App Service Environment is suspended; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. The environment can + /// be suspended, e.g. when the management endpoint is no longer + /// available + /// (most likely because NSG blocked the incoming traffic). + /// + [JsonProperty(PropertyName = "properties.suspended")] + public bool? Suspended { get; set; } + + /// + /// Gets or sets true/false indicating whether the App Service + /// Environment is suspended. The environment can be suspended e.g. + /// when the management endpoint is no longer available + /// (most likely because NSG blocked the incoming traffic). + /// + [JsonProperty(PropertyName = "properties.dynamicCacheEnabled")] + public bool? DynamicCacheEnabled { get; set; } + + /// + /// Gets or sets custom settings for changing the behavior of the App + /// Service Environment. + /// + [JsonProperty(PropertyName = "properties.clusterSettings")] + public IList ClusterSettings { get; set; } + + /// + /// Gets or sets user added ip ranges to whitelist on ASE db + /// + [JsonProperty(PropertyName = "properties.userWhitelistedIpRanges")] + public IList UserWhitelistedIpRanges { get; set; } + + /// + /// Gets or sets flag that displays whether an ASE has linux workers or + /// not + /// + [JsonProperty(PropertyName = "properties.hasLinuxWorkers")] + public bool? HasLinuxWorkers { get; set; } + + /// + /// Gets or sets key Vault ID for ILB App Service Environment default + /// SSL certificate + /// + [JsonProperty(PropertyName = "properties.sslCertKeyVaultId")] + public string SslCertKeyVaultId { get; set; } + + /// + /// Gets or sets key Vault Secret Name for ILB App Service Environment + /// default SSL certificate + /// + [JsonProperty(PropertyName = "properties.sslCertKeyVaultSecretName")] + public string SslCertKeyVaultSecretName { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (AppServiceEnvironmentResourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentResourceName"); + } + if (AppServiceEnvironmentResourceLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentResourceLocation"); + } + if (VirtualNetwork == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); + } + if (WorkerPools == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.Serialization.cs deleted file mode 100644 index 0f81eb1ed486..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.Serialization.cs +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppServicePlan : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"); - writer.WriteObjectValue(Sku); - } - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(WorkerTierName)) - { - writer.WritePropertyName("workerTierName"); - writer.WriteStringValue(WorkerTierName); - } - if (Optional.IsDefined(HostingEnvironmentProfile)) - { - writer.WritePropertyName("hostingEnvironmentProfile"); - writer.WriteObjectValue(HostingEnvironmentProfile); - } - if (Optional.IsDefined(PerSiteScaling)) - { - writer.WritePropertyName("perSiteScaling"); - writer.WriteBooleanValue(PerSiteScaling.Value); - } - if (Optional.IsDefined(MaximumElasticWorkerCount)) - { - writer.WritePropertyName("maximumElasticWorkerCount"); - writer.WriteNumberValue(MaximumElasticWorkerCount.Value); - } - if (Optional.IsDefined(IsSpot)) - { - writer.WritePropertyName("isSpot"); - writer.WriteBooleanValue(IsSpot.Value); - } - if (Optional.IsDefined(SpotExpirationTime)) - { - writer.WritePropertyName("spotExpirationTime"); - writer.WriteStringValue(SpotExpirationTime.Value, "O"); - } - if (Optional.IsDefined(FreeOfferExpirationTime)) - { - writer.WritePropertyName("freeOfferExpirationTime"); - writer.WriteStringValue(FreeOfferExpirationTime.Value, "O"); - } - if (Optional.IsDefined(Reserved)) - { - writer.WritePropertyName("reserved"); - writer.WriteBooleanValue(Reserved.Value); - } - if (Optional.IsDefined(IsXenon)) - { - writer.WritePropertyName("isXenon"); - writer.WriteBooleanValue(IsXenon.Value); - } - if (Optional.IsDefined(HyperV)) - { - writer.WritePropertyName("hyperV"); - writer.WriteBooleanValue(HyperV.Value); - } - if (Optional.IsDefined(TargetWorkerCount)) - { - writer.WritePropertyName("targetWorkerCount"); - writer.WriteNumberValue(TargetWorkerCount.Value); - } - if (Optional.IsDefined(TargetWorkerSizeId)) - { - writer.WritePropertyName("targetWorkerSizeId"); - writer.WriteNumberValue(TargetWorkerSizeId.Value); - } - if (Optional.IsDefined(KubeEnvironmentProfile)) - { - writer.WritePropertyName("kubeEnvironmentProfile"); - writer.WriteObjectValue(KubeEnvironmentProfile); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AppServicePlan DeserializeAppServicePlan(JsonElement element) - { - Optional sku = default; - Optional id = default; - Optional name = default; - Optional kind = default; - string location = default; - Optional type = default; - Optional> tags = default; - Optional workerTierName = default; - Optional status = default; - Optional subscription = default; - Optional hostingEnvironmentProfile = default; - Optional maximumNumberOfWorkers = default; - Optional geoRegion = default; - Optional perSiteScaling = default; - Optional maximumElasticWorkerCount = default; - Optional numberOfSites = default; - Optional isSpot = default; - Optional spotExpirationTime = default; - Optional freeOfferExpirationTime = default; - Optional resourceGroup = default; - Optional reserved = default; - Optional isXenon = default; - Optional hyperV = default; - Optional targetWorkerCount = default; - Optional targetWorkerSizeId = default; - Optional provisioningState = default; - Optional kubeEnvironmentProfile = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sku")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - sku = SkuDescription.DeserializeSkuDescription(property.Value); - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("workerTierName")) - { - workerTierName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property0.Value.GetString().ToStatusOptions(); - continue; - } - if (property0.NameEquals("subscription")) - { - subscription = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostingEnvironmentProfile")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); - continue; - } - if (property0.NameEquals("maximumNumberOfWorkers")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - maximumNumberOfWorkers = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("geoRegion")) - { - geoRegion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("perSiteScaling")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - perSiteScaling = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("maximumElasticWorkerCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - maximumElasticWorkerCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("numberOfSites")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - numberOfSites = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("isSpot")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isSpot = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("spotExpirationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - spotExpirationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("freeOfferExpirationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - freeOfferExpirationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("resourceGroup")) - { - resourceGroup = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("reserved")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - reserved = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("isXenon")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isXenon = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("hyperV")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hyperV = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("targetWorkerCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - targetWorkerCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("targetWorkerSizeId")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - targetWorkerSizeId = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property0.Value.GetString().ToProvisioningState(); - continue; - } - if (property0.NameEquals("kubeEnvironmentProfile")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - kubeEnvironmentProfile = KubeEnvironmentProfile.DeserializeKubeEnvironmentProfile(property0.Value); - continue; - } - } - continue; - } - } - return new AppServicePlan(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), sku.Value, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(maximumElasticWorkerCount), Optional.ToNullable(numberOfSites), Optional.ToNullable(isSpot), Optional.ToNullable(spotExpirationTime), Optional.ToNullable(freeOfferExpirationTime), resourceGroup.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(targetWorkerCount), Optional.ToNullable(targetWorkerSizeId), Optional.ToNullable(provisioningState), kubeEnvironmentProfile.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs index a586a8578ab5..6f5f763da3eb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs @@ -1,63 +1,90 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; +// 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.WebSites.Models { - /// App Service plan. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// App Service plan. + /// + [Rest.Serialization.JsonTransformation] public partial class AppServicePlan : Resource { - /// Initializes a new instance of AppServicePlan. - /// Resource Location. - /// is null. - public AppServicePlan(string location) : base(location) + /// + /// Initializes a new instance of the AppServicePlan class. + /// + public AppServicePlan() { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } + CustomInit(); } - /// Initializes a new instance of AppServicePlan. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource Location. - /// Resource type. - /// Resource tags. - /// Description of a SKU for a scalable resource. - /// Target worker tier assigned to the App Service plan. - /// App Service plan status. - /// App Service plan subscription. - /// Specification for the App Service Environment to use for the App Service plan. - /// Maximum number of instances that can be assigned to this App Service plan. - /// Geographical location for the App Service plan. - /// - /// If <code>true</code>, apps assigned to this App Service plan can be scaled independently. - /// If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the plan. - /// - /// Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan. - /// Number of apps assigned to this App Service plan. - /// If <code>true</code>, this App Service Plan owns spot instances. - /// The time when the server farm expires. Valid only if it is a spot server farm. - /// The time when the server farm free offer expires. - /// Resource group of the App Service plan. - /// If Linux app service plan <code>true</code>, <code>false</code> otherwise. - /// Obsolete: If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. - /// If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. - /// Scaling worker count. - /// Scaling worker size ID. - /// Provisioning state of the App Service Plan. - /// Specification for the Kubernetes Environment to use for the App Service plan. - internal AppServicePlan(string id, string name, string kind, string location, string type, IDictionary tags, SkuDescription sku, string workerTierName, StatusOptions? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, string geoRegion, bool? perSiteScaling, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpirationTime, DateTimeOffset? freeOfferExpirationTime, string resourceGroup, bool? reserved, bool? isXenon, bool? hyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile) : base(id, name, kind, location, type, tags) + /// + /// Initializes a new instance of the AppServicePlan class. + /// + /// Resource Location. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Resource tags. + /// Target worker tier assigned to the App + /// Service plan. + /// App Service plan status. Possible values + /// include: 'Ready', 'Pending', 'Creating' + /// App Service plan subscription. + /// Specification for the App + /// Service Environment to use for the App Service plan. + /// Maximum number of instances + /// that can be assigned to this App Service plan. + /// Geographical location for the App Service + /// plan. + /// If <code>true</code>, apps + /// assigned to this App Service plan can be scaled independently. + /// If <code>false</code>, apps assigned to this App + /// Service plan will scale to all instances of the plan. + /// Maximum number of total + /// workers allowed for this ElasticScaleEnabled App Service + /// Plan + /// Number of apps assigned to this App + /// Service plan. + /// If <code>true</code>, this App + /// Service Plan owns spot instances. + /// The time when the server farm + /// expires. Valid only if it is a spot server farm. + /// The time when the server farm + /// free offer expires. + /// Resource group of the App Service + /// plan. + /// If Linux app service plan + /// <code>true</code>, <code>false</code> + /// otherwise. + /// Obsolete: If Hyper-V container app service + /// plan <code>true</code>, <code>false</code> + /// otherwise. + /// If Hyper-V container app service plan + /// <code>true</code>, <code>false</code> + /// otherwise. + /// Scaling worker count. + /// Scaling worker size ID. + /// Provisioning state of the App + /// Service Environment. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'InProgress', 'Deleting' + public AppServicePlan(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), SkuDescription sku = default(SkuDescription)) + : base(location, id, name, kind, type, tags) { - Sku = sku; WorkerTierName = workerTierName; Status = status; Subscription = subscription; @@ -77,53 +104,160 @@ internal AppServicePlan(string id, string name, string kind, string location, st TargetWorkerCount = targetWorkerCount; TargetWorkerSizeId = targetWorkerSizeId; ProvisioningState = provisioningState; - KubeEnvironmentProfile = kubeEnvironmentProfile; + Sku = sku; + CustomInit(); } - /// Description of a SKU for a scalable resource. - public SkuDescription Sku { get; set; } - /// Target worker tier assigned to the App Service plan. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets target worker tier assigned to the App Service plan. + /// + [JsonProperty(PropertyName = "properties.workerTierName")] public string WorkerTierName { get; set; } - /// App Service plan status. - public StatusOptions? Status { get; } - /// App Service plan subscription. - public string Subscription { get; } - /// Specification for the App Service Environment to use for the App Service plan. + + /// + /// Gets app Service plan status. Possible values include: 'Ready', + /// 'Pending', 'Creating' + /// + [JsonProperty(PropertyName = "properties.status")] + public StatusOptions? Status { get; private set; } + + /// + /// Gets app Service plan subscription. + /// + [JsonProperty(PropertyName = "properties.subscription")] + public string Subscription { get; private set; } + + /// + /// Gets or sets specification for the App Service Environment to use + /// for the App Service plan. + /// + [JsonProperty(PropertyName = "properties.hostingEnvironmentProfile")] public HostingEnvironmentProfile HostingEnvironmentProfile { get; set; } - /// Maximum number of instances that can be assigned to this App Service plan. - public int? MaximumNumberOfWorkers { get; } - /// Geographical location for the App Service plan. - public string GeoRegion { get; } + /// - /// If <code>true</code>, apps assigned to this App Service plan can be scaled independently. - /// If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the plan. + /// Gets maximum number of instances that can be assigned to this App + /// Service plan. /// + [JsonProperty(PropertyName = "properties.maximumNumberOfWorkers")] + public int? MaximumNumberOfWorkers { get; private set; } + + /// + /// Gets geographical location for the App Service plan. + /// + [JsonProperty(PropertyName = "properties.geoRegion")] + public string GeoRegion { get; private set; } + + /// + /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, apps + /// assigned to this App Service plan can be scaled independently. + /// If &lt;code&gt;false&lt;/code&gt;, apps assigned to + /// this App Service plan will scale to all instances of the plan. + /// + [JsonProperty(PropertyName = "properties.perSiteScaling")] public bool? PerSiteScaling { get; set; } - /// Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan. + + /// + /// Gets or sets maximum number of total workers allowed for this + /// ElasticScaleEnabled App Service Plan + /// + [JsonProperty(PropertyName = "properties.maximumElasticWorkerCount")] public int? MaximumElasticWorkerCount { get; set; } - /// Number of apps assigned to this App Service plan. - public int? NumberOfSites { get; } - /// If <code>true</code>, this App Service Plan owns spot instances. + + /// + /// Gets number of apps assigned to this App Service plan. + /// + [JsonProperty(PropertyName = "properties.numberOfSites")] + public int? NumberOfSites { get; private set; } + + /// + /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, this + /// App Service Plan owns spot instances. + /// + [JsonProperty(PropertyName = "properties.isSpot")] public bool? IsSpot { get; set; } - /// The time when the server farm expires. Valid only if it is a spot server farm. - public DateTimeOffset? SpotExpirationTime { get; set; } - /// The time when the server farm free offer expires. - public DateTimeOffset? FreeOfferExpirationTime { get; set; } - /// Resource group of the App Service plan. - public string ResourceGroup { get; } - /// If Linux app service plan <code>true</code>, <code>false</code> otherwise. + + /// + /// Gets or sets the time when the server farm expires. Valid only if + /// it is a spot server farm. + /// + [JsonProperty(PropertyName = "properties.spotExpirationTime")] + public System.DateTime? SpotExpirationTime { get; set; } + + /// + /// Gets or sets the time when the server farm free offer expires. + /// + [JsonProperty(PropertyName = "properties.freeOfferExpirationTime")] + public System.DateTime? FreeOfferExpirationTime { get; set; } + + /// + /// Gets resource group of the App Service plan. + /// + [JsonProperty(PropertyName = "properties.resourceGroup")] + public string ResourceGroup { get; private set; } + + /// + /// Gets or sets if Linux app service plan + /// &lt;code&gt;true&lt;/code&gt;, + /// &lt;code&gt;false&lt;/code&gt; otherwise. + /// + [JsonProperty(PropertyName = "properties.reserved")] public bool? Reserved { get; set; } - /// Obsolete: If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. + + /// + /// Gets or sets obsolete: If Hyper-V container app service plan + /// &lt;code&gt;true&lt;/code&gt;, + /// &lt;code&gt;false&lt;/code&gt; otherwise. + /// + [JsonProperty(PropertyName = "properties.isXenon")] public bool? IsXenon { get; set; } - /// If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. + + /// + /// Gets or sets if Hyper-V container app service plan + /// &lt;code&gt;true&lt;/code&gt;, + /// &lt;code&gt;false&lt;/code&gt; otherwise. + /// + [JsonProperty(PropertyName = "properties.hyperV")] public bool? HyperV { get; set; } - /// Scaling worker count. + + /// + /// Gets or sets scaling worker count. + /// + [JsonProperty(PropertyName = "properties.targetWorkerCount")] public int? TargetWorkerCount { get; set; } - /// Scaling worker size ID. + + /// + /// Gets or sets scaling worker size ID. + /// + [JsonProperty(PropertyName = "properties.targetWorkerSizeId")] public int? TargetWorkerSizeId { get; set; } - /// Provisioning state of the App Service Plan. - public ProvisioningState? ProvisioningState { get; } - /// Specification for the Kubernetes Environment to use for the App Service plan. - public KubeEnvironmentProfile KubeEnvironmentProfile { get; set; } + + /// + /// Gets provisioning state of the App Service Environment. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// 'Deleting' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState? ProvisioningState { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public SkuDescription Sku { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.Serialization.cs deleted file mode 100644 index e3d14f1695ef..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class AppServicePlanCollection - { - internal static AppServicePlanCollection DeserializeAppServicePlanCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AppServicePlan.DeserializeAppServicePlan(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new AppServicePlanCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.cs deleted file mode 100644 index 46c3866242d5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of App Service plans. - internal partial class AppServicePlanCollection - { - /// Initializes a new instance of AppServicePlanCollection. - /// Collection of resources. - /// is null. - internal AppServicePlanCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of AppServicePlanCollection. - /// Collection of resources. - /// Link to next page of resources. - internal AppServicePlanCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.Serialization.cs deleted file mode 100644 index 501b7df31a47..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.Serialization.cs +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppServicePlanPatchResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(WorkerTierName)) - { - writer.WritePropertyName("workerTierName"); - writer.WriteStringValue(WorkerTierName); - } - if (Optional.IsDefined(HostingEnvironmentProfile)) - { - writer.WritePropertyName("hostingEnvironmentProfile"); - writer.WriteObjectValue(HostingEnvironmentProfile); - } - if (Optional.IsDefined(PerSiteScaling)) - { - writer.WritePropertyName("perSiteScaling"); - writer.WriteBooleanValue(PerSiteScaling.Value); - } - if (Optional.IsDefined(MaximumElasticWorkerCount)) - { - writer.WritePropertyName("maximumElasticWorkerCount"); - writer.WriteNumberValue(MaximumElasticWorkerCount.Value); - } - if (Optional.IsDefined(IsSpot)) - { - writer.WritePropertyName("isSpot"); - writer.WriteBooleanValue(IsSpot.Value); - } - if (Optional.IsDefined(SpotExpirationTime)) - { - writer.WritePropertyName("spotExpirationTime"); - writer.WriteStringValue(SpotExpirationTime.Value, "O"); - } - if (Optional.IsDefined(FreeOfferExpirationTime)) - { - writer.WritePropertyName("freeOfferExpirationTime"); - writer.WriteStringValue(FreeOfferExpirationTime.Value, "O"); - } - if (Optional.IsDefined(Reserved)) - { - writer.WritePropertyName("reserved"); - writer.WriteBooleanValue(Reserved.Value); - } - if (Optional.IsDefined(IsXenon)) - { - writer.WritePropertyName("isXenon"); - writer.WriteBooleanValue(IsXenon.Value); - } - if (Optional.IsDefined(HyperV)) - { - writer.WritePropertyName("hyperV"); - writer.WriteBooleanValue(HyperV.Value); - } - if (Optional.IsDefined(TargetWorkerCount)) - { - writer.WritePropertyName("targetWorkerCount"); - writer.WriteNumberValue(TargetWorkerCount.Value); - } - if (Optional.IsDefined(TargetWorkerSizeId)) - { - writer.WritePropertyName("targetWorkerSizeId"); - writer.WriteNumberValue(TargetWorkerSizeId.Value); - } - if (Optional.IsDefined(KubeEnvironmentProfile)) - { - writer.WritePropertyName("kubeEnvironmentProfile"); - writer.WriteObjectValue(KubeEnvironmentProfile); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AppServicePlanPatchResource DeserializeAppServicePlanPatchResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional workerTierName = default; - Optional status = default; - Optional subscription = default; - Optional hostingEnvironmentProfile = default; - Optional maximumNumberOfWorkers = default; - Optional geoRegion = default; - Optional perSiteScaling = default; - Optional maximumElasticWorkerCount = default; - Optional numberOfSites = default; - Optional isSpot = default; - Optional spotExpirationTime = default; - Optional freeOfferExpirationTime = default; - Optional resourceGroup = default; - Optional reserved = default; - Optional isXenon = default; - Optional hyperV = default; - Optional targetWorkerCount = default; - Optional targetWorkerSizeId = default; - Optional provisioningState = default; - Optional kubeEnvironmentProfile = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("workerTierName")) - { - workerTierName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property0.Value.GetString().ToStatusOptions(); - continue; - } - if (property0.NameEquals("subscription")) - { - subscription = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostingEnvironmentProfile")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); - continue; - } - if (property0.NameEquals("maximumNumberOfWorkers")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - maximumNumberOfWorkers = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("geoRegion")) - { - geoRegion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("perSiteScaling")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - perSiteScaling = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("maximumElasticWorkerCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - maximumElasticWorkerCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("numberOfSites")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - numberOfSites = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("isSpot")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isSpot = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("spotExpirationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - spotExpirationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("freeOfferExpirationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - freeOfferExpirationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("resourceGroup")) - { - resourceGroup = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("reserved")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - reserved = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("isXenon")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isXenon = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("hyperV")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hyperV = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("targetWorkerCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - targetWorkerCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("targetWorkerSizeId")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - targetWorkerSizeId = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property0.Value.GetString().ToProvisioningState(); - continue; - } - if (property0.NameEquals("kubeEnvironmentProfile")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - kubeEnvironmentProfile = KubeEnvironmentProfile.DeserializeKubeEnvironmentProfile(property0.Value); - continue; - } - } - continue; - } - } - return new AppServicePlanPatchResource(id.Value, name.Value, kind.Value, type.Value, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(maximumElasticWorkerCount), Optional.ToNullable(numberOfSites), Optional.ToNullable(isSpot), Optional.ToNullable(spotExpirationTime), Optional.ToNullable(freeOfferExpirationTime), resourceGroup.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(targetWorkerCount), Optional.ToNullable(targetWorkerSizeId), Optional.ToNullable(provisioningState), kubeEnvironmentProfile.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs index 6d69334f52ec..55716222a405 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs @@ -1,51 +1,89 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// ARM resource for a app service plan. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// ARM resource for a app service plan. + /// + [Rest.Serialization.JsonTransformation] public partial class AppServicePlanPatchResource : ProxyOnlyResource { - /// Initializes a new instance of AppServicePlanPatchResource. + /// + /// Initializes a new instance of the AppServicePlanPatchResource + /// class. + /// public AppServicePlanPatchResource() { + CustomInit(); } - /// Initializes a new instance of AppServicePlanPatchResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Target worker tier assigned to the App Service plan. - /// App Service plan status. - /// App Service plan subscription. - /// Specification for the App Service Environment to use for the App Service plan. - /// Maximum number of instances that can be assigned to this App Service plan. - /// Geographical location for the App Service plan. - /// - /// If <code>true</code>, apps assigned to this App Service plan can be scaled independently. - /// If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the plan. - /// - /// Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan. - /// Number of apps assigned to this App Service plan. - /// If <code>true</code>, this App Service Plan owns spot instances. - /// The time when the server farm expires. Valid only if it is a spot server farm. - /// The time when the server farm free offer expires. - /// Resource group of the App Service plan. - /// If Linux app service plan <code>true</code>, <code>false</code> otherwise. - /// Obsolete: If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. - /// If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. - /// Scaling worker count. - /// Scaling worker size ID. - /// Provisioning state of the App Service Plan. - /// Specification for the Kubernetes Environment to use for the App Service plan. - internal AppServicePlanPatchResource(string id, string name, string kind, string type, string workerTierName, StatusOptions? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, string geoRegion, bool? perSiteScaling, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpirationTime, DateTimeOffset? freeOfferExpirationTime, string resourceGroup, bool? reserved, bool? isXenon, bool? hyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile) : base(id, name, kind, type) + /// + /// Initializes a new instance of the AppServicePlanPatchResource + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Target worker tier assigned to the App + /// Service plan. + /// App Service plan status. Possible values + /// include: 'Ready', 'Pending', 'Creating' + /// App Service plan subscription. + /// Specification for the App + /// Service Environment to use for the App Service plan. + /// Maximum number of instances + /// that can be assigned to this App Service plan. + /// Geographical location for the App Service + /// plan. + /// If <code>true</code>, apps + /// assigned to this App Service plan can be scaled independently. + /// If <code>false</code>, apps assigned to this App + /// Service plan will scale to all instances of the plan. + /// Maximum number of total + /// workers allowed for this ElasticScaleEnabled App Service + /// Plan + /// Number of apps assigned to this App + /// Service plan. + /// If <code>true</code>, this App + /// Service Plan owns spot instances. + /// The time when the server farm + /// expires. Valid only if it is a spot server farm. + /// The time when the server farm + /// free offer expires. + /// Resource group of the App Service + /// plan. + /// This needs to set to + /// <code>true</code> when creating a Linux App Service + /// Plan, along with <code>kind</code> set to + /// <code>Linux</code>. It should be + /// <code>false</code> otherwise. + /// Obsolete: If Hyper-V container app service + /// plan <code>true</code>, <code>false</code> + /// otherwise. + /// If Hyper-V container app service plan + /// <code>true</code>, <code>false</code> + /// otherwise. + /// Scaling worker count. + /// Scaling worker size ID. + /// Provisioning state of the App + /// Service Environment. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'InProgress', 'Deleting' + public AppServicePlanPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?)) + : base(id, name, kind, type) { WorkerTierName = workerTierName; Status = status; @@ -66,51 +104,147 @@ internal AppServicePlanPatchResource(string id, string name, string kind, string TargetWorkerCount = targetWorkerCount; TargetWorkerSizeId = targetWorkerSizeId; ProvisioningState = provisioningState; - KubeEnvironmentProfile = kubeEnvironmentProfile; + CustomInit(); } - /// Target worker tier assigned to the App Service plan. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets target worker tier assigned to the App Service plan. + /// + [JsonProperty(PropertyName = "properties.workerTierName")] public string WorkerTierName { get; set; } - /// App Service plan status. - public StatusOptions? Status { get; } - /// App Service plan subscription. - public string Subscription { get; } - /// Specification for the App Service Environment to use for the App Service plan. + + /// + /// Gets app Service plan status. Possible values include: 'Ready', + /// 'Pending', 'Creating' + /// + [JsonProperty(PropertyName = "properties.status")] + public StatusOptions? Status { get; private set; } + + /// + /// Gets app Service plan subscription. + /// + [JsonProperty(PropertyName = "properties.subscription")] + public string Subscription { get; private set; } + + /// + /// Gets or sets specification for the App Service Environment to use + /// for the App Service plan. + /// + [JsonProperty(PropertyName = "properties.hostingEnvironmentProfile")] public HostingEnvironmentProfile HostingEnvironmentProfile { get; set; } - /// Maximum number of instances that can be assigned to this App Service plan. - public int? MaximumNumberOfWorkers { get; } - /// Geographical location for the App Service plan. - public string GeoRegion { get; } + + /// + /// Gets maximum number of instances that can be assigned to this App + /// Service plan. + /// + [JsonProperty(PropertyName = "properties.maximumNumberOfWorkers")] + public int? MaximumNumberOfWorkers { get; private set; } + + /// + /// Gets geographical location for the App Service plan. + /// + [JsonProperty(PropertyName = "properties.geoRegion")] + public string GeoRegion { get; private set; } + /// - /// If <code>true</code>, apps assigned to this App Service plan can be scaled independently. - /// If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the plan. + /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, apps + /// assigned to this App Service plan can be scaled independently. + /// If &lt;code&gt;false&lt;/code&gt;, apps assigned to + /// this App Service plan will scale to all instances of the plan. /// + [JsonProperty(PropertyName = "properties.perSiteScaling")] public bool? PerSiteScaling { get; set; } - /// Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan. + + /// + /// Gets or sets maximum number of total workers allowed for this + /// ElasticScaleEnabled App Service Plan + /// + [JsonProperty(PropertyName = "properties.maximumElasticWorkerCount")] public int? MaximumElasticWorkerCount { get; set; } - /// Number of apps assigned to this App Service plan. - public int? NumberOfSites { get; } - /// If <code>true</code>, this App Service Plan owns spot instances. + + /// + /// Gets number of apps assigned to this App Service plan. + /// + [JsonProperty(PropertyName = "properties.numberOfSites")] + public int? NumberOfSites { get; private set; } + + /// + /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, this + /// App Service Plan owns spot instances. + /// + [JsonProperty(PropertyName = "properties.isSpot")] public bool? IsSpot { get; set; } - /// The time when the server farm expires. Valid only if it is a spot server farm. - public DateTimeOffset? SpotExpirationTime { get; set; } - /// The time when the server farm free offer expires. - public DateTimeOffset? FreeOfferExpirationTime { get; set; } - /// Resource group of the App Service plan. - public string ResourceGroup { get; } - /// If Linux app service plan <code>true</code>, <code>false</code> otherwise. + + /// + /// Gets or sets the time when the server farm expires. Valid only if + /// it is a spot server farm. + /// + [JsonProperty(PropertyName = "properties.spotExpirationTime")] + public System.DateTime? SpotExpirationTime { get; set; } + + /// + /// Gets or sets the time when the server farm free offer expires. + /// + [JsonProperty(PropertyName = "properties.freeOfferExpirationTime")] + public System.DateTime? FreeOfferExpirationTime { get; set; } + + /// + /// Gets resource group of the App Service plan. + /// + [JsonProperty(PropertyName = "properties.resourceGroup")] + public string ResourceGroup { get; private set; } + + /// + /// Gets or sets this needs to set to + /// &lt;code&gt;true&lt;/code&gt; when creating a Linux + /// App Service Plan, along with + /// &lt;code&gt;kind&lt;/code&gt; set to + /// &lt;code&gt;Linux&lt;/code&gt;. It should be + /// &lt;code&gt;false&lt;/code&gt; otherwise. + /// + [JsonProperty(PropertyName = "properties.reserved")] public bool? Reserved { get; set; } - /// Obsolete: If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. + + /// + /// Gets or sets obsolete: If Hyper-V container app service plan + /// &lt;code&gt;true&lt;/code&gt;, + /// &lt;code&gt;false&lt;/code&gt; otherwise. + /// + [JsonProperty(PropertyName = "properties.isXenon")] public bool? IsXenon { get; set; } - /// If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. + + /// + /// Gets or sets if Hyper-V container app service plan + /// &lt;code&gt;true&lt;/code&gt;, + /// &lt;code&gt;false&lt;/code&gt; otherwise. + /// + [JsonProperty(PropertyName = "properties.hyperV")] public bool? HyperV { get; set; } - /// Scaling worker count. + + /// + /// Gets or sets scaling worker count. + /// + [JsonProperty(PropertyName = "properties.targetWorkerCount")] public int? TargetWorkerCount { get; set; } - /// Scaling worker size ID. + + /// + /// Gets or sets scaling worker size ID. + /// + [JsonProperty(PropertyName = "properties.targetWorkerSizeId")] public int? TargetWorkerSizeId { get; set; } - /// Provisioning state of the App Service Plan. - public ProvisioningState? ProvisioningState { get; } - /// Specification for the Kubernetes Environment to use for the App Service plan. - public KubeEnvironmentProfile KubeEnvironmentProfile { get; set; } + + /// + /// Gets provisioning state of the App Service Environment. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// 'Deleting' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState? ProvisioningState { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.Serialization.cs deleted file mode 100644 index b3486f8ae599..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class AppServicePlanRestrictionsExtensions - { - public static string ToSerialString(this AppServicePlanRestrictions value) => value switch - { - AppServicePlanRestrictions.None => "None", - AppServicePlanRestrictions.Free => "Free", - AppServicePlanRestrictions.Shared => "Shared", - AppServicePlanRestrictions.Basic => "Basic", - AppServicePlanRestrictions.Standard => "Standard", - AppServicePlanRestrictions.Premium => "Premium", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AppServicePlanRestrictions value.") - }; - - public static AppServicePlanRestrictions ToAppServicePlanRestrictions(this string value) - { - if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return AppServicePlanRestrictions.None; - if (string.Equals(value, "Free", StringComparison.InvariantCultureIgnoreCase)) return AppServicePlanRestrictions.Free; - if (string.Equals(value, "Shared", StringComparison.InvariantCultureIgnoreCase)) return AppServicePlanRestrictions.Shared; - if (string.Equals(value, "Basic", StringComparison.InvariantCultureIgnoreCase)) return AppServicePlanRestrictions.Basic; - if (string.Equals(value, "Standard", StringComparison.InvariantCultureIgnoreCase)) return AppServicePlanRestrictions.Standard; - if (string.Equals(value, "Premium", StringComparison.InvariantCultureIgnoreCase)) return AppServicePlanRestrictions.Premium; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AppServicePlanRestrictions value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.cs index 9cd006d48f56..e27c1a65a91a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanRestrictions.cs @@ -1,26 +1,84 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// App Service plans this offer is restricted to. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AppServicePlanRestrictions. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum AppServicePlanRestrictions { - /// None. + [EnumMember(Value = "None")] None, - /// Free. + [EnumMember(Value = "Free")] Free, - /// Shared. + [EnumMember(Value = "Shared")] Shared, - /// Basic. + [EnumMember(Value = "Basic")] Basic, - /// Standard. + [EnumMember(Value = "Standard")] Standard, - /// Premium. + [EnumMember(Value = "Premium")] Premium } + internal static class AppServicePlanRestrictionsEnumExtension + { + internal static string ToSerializedValue(this AppServicePlanRestrictions? value) + { + return value == null ? null : ((AppServicePlanRestrictions)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AppServicePlanRestrictions value) + { + switch( value ) + { + case AppServicePlanRestrictions.None: + return "None"; + case AppServicePlanRestrictions.Free: + return "Free"; + case AppServicePlanRestrictions.Shared: + return "Shared"; + case AppServicePlanRestrictions.Basic: + return "Basic"; + case AppServicePlanRestrictions.Standard: + return "Standard"; + case AppServicePlanRestrictions.Premium: + return "Premium"; + } + return null; + } + + internal static AppServicePlanRestrictions? ParseAppServicePlanRestrictions(this string value) + { + switch( value ) + { + case "None": + return AppServicePlanRestrictions.None; + case "Free": + return AppServicePlanRestrictions.Free; + case "Shared": + return AppServicePlanRestrictions.Shared; + case "Basic": + return AppServicePlanRestrictions.Basic; + case "Standard": + return AppServicePlanRestrictions.Standard; + case "Premium": + return AppServicePlanRestrictions.Premium; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.Serialization.cs deleted file mode 100644 index f274f16d9d2a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.Serialization.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Apple : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(Registration)) - { - writer.WritePropertyName("registration"); - writer.WriteObjectValue(Registration); - } - if (Optional.IsDefined(Login)) - { - writer.WritePropertyName("login"); - writer.WriteObjectValue(Login); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Apple DeserializeApple(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional registration = default; - Optional login = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("registration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - registration = AppleRegistration.DeserializeAppleRegistration(property0.Value); - continue; - } - if (property0.NameEquals("login")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - login = LoginScopes.DeserializeLoginScopes(property0.Value); - continue; - } - } - continue; - } - } - return new Apple(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, login.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs deleted file mode 100644 index f598b3fb34b4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The configuration settings of the Apple provider. - public partial class Apple : ProxyOnlyResource - { - /// Initializes a new instance of Apple. - public Apple() - { - } - - /// Initializes a new instance of Apple. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>false</code> if the Apple provider should not be enabled despite the set registration; otherwise, <code>true</code>. - /// The configuration settings of the Apple registration. - /// The configuration settings of the login flow. - internal Apple(string id, string name, string kind, string type, bool? enabled, AppleRegistration registration, LoginScopes login) : base(id, name, kind, type) - { - Enabled = enabled; - Registration = registration; - Login = login; - } - - /// <code>false</code> if the Apple provider should not be enabled despite the set registration; otherwise, <code>true</code>. - public bool? Enabled { get; set; } - /// The configuration settings of the Apple registration. - public AppleRegistration Registration { get; set; } - /// The configuration settings of the login flow. - public LoginScopes Login { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.Serialization.cs deleted file mode 100644 index bb2f205bf8cb..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.Serialization.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppleRegistration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ClientId)) - { - writer.WritePropertyName("clientId"); - writer.WriteStringValue(ClientId); - } - if (Optional.IsDefined(ClientSecretSettingName)) - { - writer.WritePropertyName("clientSecretSettingName"); - writer.WriteStringValue(ClientSecretSettingName); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AppleRegistration DeserializeAppleRegistration(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional clientId = default; - Optional clientSecretSettingName = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("clientId")) - { - clientId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("clientSecretSettingName")) - { - clientSecretSettingName = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new AppleRegistration(id.Value, name.Value, kind.Value, type.Value, clientId.Value, clientSecretSettingName.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs deleted file mode 100644 index a327f3e1f226..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The configuration settings of the registration for the Apple provider. - public partial class AppleRegistration : ProxyOnlyResource - { - /// Initializes a new instance of AppleRegistration. - public AppleRegistration() - { - } - - /// Initializes a new instance of AppleRegistration. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Client ID of the app used for login. - /// The app setting name that contains the client secret. - internal AppleRegistration(string id, string name, string kind, string type, string clientId, string clientSecretSettingName) : base(id, name, kind, type) - { - ClientId = clientId; - ClientSecretSettingName = clientSecretSettingName; - } - - /// The Client ID of the app used for login. - public string ClientId { get; set; } - /// The app setting name that contains the client secret. - public string ClientSecretSettingName { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.Serialization.cs deleted file mode 100644 index 6808d603e257..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.Serialization.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ApplicationLogsConfig : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(FileSystem)) - { - writer.WritePropertyName("fileSystem"); - writer.WriteObjectValue(FileSystem); - } - if (Optional.IsDefined(AzureTableStorage)) - { - writer.WritePropertyName("azureTableStorage"); - writer.WriteObjectValue(AzureTableStorage); - } - if (Optional.IsDefined(AzureBlobStorage)) - { - writer.WritePropertyName("azureBlobStorage"); - writer.WriteObjectValue(AzureBlobStorage); - } - writer.WriteEndObject(); - } - - internal static ApplicationLogsConfig DeserializeApplicationLogsConfig(JsonElement element) - { - Optional fileSystem = default; - Optional azureTableStorage = default; - Optional azureBlobStorage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("fileSystem")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - fileSystem = FileSystemApplicationLogsConfig.DeserializeFileSystemApplicationLogsConfig(property.Value); - continue; - } - if (property.NameEquals("azureTableStorage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - azureTableStorage = AzureTableStorageApplicationLogsConfig.DeserializeAzureTableStorageApplicationLogsConfig(property.Value); - continue; - } - if (property.NameEquals("azureBlobStorage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - azureBlobStorage = AzureBlobStorageApplicationLogsConfig.DeserializeAzureBlobStorageApplicationLogsConfig(property.Value); - continue; - } - } - return new ApplicationLogsConfig(fileSystem.Value, azureTableStorage.Value, azureBlobStorage.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.cs index fb1d757f4fcf..49d7982d2b0b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationLogsConfig.cs @@ -1,36 +1,83 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Application logs configuration. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Application logs configuration. + /// public partial class ApplicationLogsConfig { - /// Initializes a new instance of ApplicationLogsConfig. + /// + /// Initializes a new instance of the ApplicationLogsConfig class. + /// public ApplicationLogsConfig() { + CustomInit(); } - /// Initializes a new instance of ApplicationLogsConfig. - /// Application logs to file system configuration. - /// Application logs to azure table storage configuration. - /// Application logs to blob storage configuration. - internal ApplicationLogsConfig(FileSystemApplicationLogsConfig fileSystem, AzureTableStorageApplicationLogsConfig azureTableStorage, AzureBlobStorageApplicationLogsConfig azureBlobStorage) + /// + /// Initializes a new instance of the ApplicationLogsConfig class. + /// + /// Application logs to file system + /// configuration. + /// Application logs to azure table + /// storage configuration. + /// Application logs to blob storage + /// configuration. + public ApplicationLogsConfig(FileSystemApplicationLogsConfig fileSystem = default(FileSystemApplicationLogsConfig), AzureTableStorageApplicationLogsConfig azureTableStorage = default(AzureTableStorageApplicationLogsConfig), AzureBlobStorageApplicationLogsConfig azureBlobStorage = default(AzureBlobStorageApplicationLogsConfig)) { FileSystem = fileSystem; AzureTableStorage = azureTableStorage; AzureBlobStorage = azureBlobStorage; + CustomInit(); } - /// Application logs to file system configuration. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets application logs to file system configuration. + /// + [JsonProperty(PropertyName = "fileSystem")] public FileSystemApplicationLogsConfig FileSystem { get; set; } - /// Application logs to azure table storage configuration. + + /// + /// Gets or sets application logs to azure table storage configuration. + /// + [JsonProperty(PropertyName = "azureTableStorage")] public AzureTableStorageApplicationLogsConfig AzureTableStorage { get; set; } - /// Application logs to blob storage configuration. + + /// + /// Gets or sets application logs to blob storage configuration. + /// + [JsonProperty(PropertyName = "azureBlobStorage")] public AzureBlobStorageApplicationLogsConfig AzureBlobStorage { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AzureTableStorage != null) + { + AzureTableStorage.Validate(); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.Serialization.cs deleted file mode 100644 index 38907973405c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ApplicationStack : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Display)) - { - writer.WritePropertyName("display"); - writer.WriteStringValue(Display); - } - if (Optional.IsDefined(Dependency)) - { - writer.WritePropertyName("dependency"); - writer.WriteStringValue(Dependency); - } - if (Optional.IsCollectionDefined(MajorVersions)) - { - writer.WritePropertyName("majorVersions"); - writer.WriteStartArray(); - foreach (var item in MajorVersions) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Frameworks)) - { - writer.WritePropertyName("frameworks"); - writer.WriteStartArray(); - foreach (var item in Frameworks) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(IsDeprecated)) - { - writer.WritePropertyName("isDeprecated"); - writer.WriteStartArray(); - foreach (var item in IsDeprecated) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static ApplicationStack DeserializeApplicationStack(JsonElement element) - { - Optional name = default; - Optional display = default; - Optional dependency = default; - Optional> majorVersions = default; - Optional> frameworks = default; - Optional> isDeprecated = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("display")) - { - display = property.Value.GetString(); - continue; - } - if (property.NameEquals("dependency")) - { - dependency = property.Value.GetString(); - continue; - } - if (property.NameEquals("majorVersions")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(StackMajorVersion.DeserializeStackMajorVersion(item)); - } - majorVersions = array; - continue; - } - if (property.NameEquals("frameworks")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeserializeApplicationStack(item)); - } - frameworks = array; - continue; - } - if (property.NameEquals("isDeprecated")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeserializeApplicationStack(item)); - } - isDeprecated = array; - continue; - } - } - return new ApplicationStack(name.Value, display.Value, dependency.Value, Optional.ToList(majorVersions), Optional.ToList(frameworks), Optional.ToList(isDeprecated)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs index 1cc471b98f26..1eb2589b59e0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs @@ -1,54 +1,87 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Application stack. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Application stack. + /// public partial class ApplicationStack { - /// Initializes a new instance of ApplicationStack. + /// + /// Initializes a new instance of the ApplicationStack class. + /// public ApplicationStack() { - MajorVersions = new ChangeTrackingList(); - Frameworks = new ChangeTrackingList(); - IsDeprecated = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of ApplicationStack. - /// Application stack name. - /// Application stack display name. - /// Application stack dependency. - /// List of major versions available. - /// List of frameworks associated with application stack. - /// <code>true</code> if this is the stack is deprecated; otherwise, <code>false</code>. - internal ApplicationStack(string name, string display, string dependency, IList majorVersions, IList frameworks, IList isDeprecated) + /// + /// Initializes a new instance of the ApplicationStack class. + /// + /// Application stack name. + /// Application stack display name. + /// Application stack dependency. + /// List of major versions + /// available. + /// List of frameworks associated with + /// application stack. + public ApplicationStack(string name = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList)) { Name = name; Display = display; Dependency = dependency; MajorVersions = majorVersions; Frameworks = frameworks; - IsDeprecated = isDeprecated; + CustomInit(); } - /// Application stack name. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets application stack name. + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// Application stack display name. + + /// + /// Gets or sets application stack display name. + /// + [JsonProperty(PropertyName = "display")] public string Display { get; set; } - /// Application stack dependency. + + /// + /// Gets or sets application stack dependency. + /// + [JsonProperty(PropertyName = "dependency")] public string Dependency { get; set; } - /// List of major versions available. - public IList MajorVersions { get; } - /// List of frameworks associated with application stack. - public IList Frameworks { get; } - /// <code>true</code> if this is the stack is deprecated; otherwise, <code>false</code>. - public IList IsDeprecated { get; } + + /// + /// Gets or sets list of major versions available. + /// + [JsonProperty(PropertyName = "majorVersions")] + public IList MajorVersions { get; set; } + + /// + /// Gets or sets list of frameworks associated with application stack. + /// + [JsonProperty(PropertyName = "frameworks")] + public IList Frameworks { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.Serialization.cs deleted file mode 100644 index 88acb590dda9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class ApplicationStackCollection - { - internal static ApplicationStackCollection DeserializeApplicationStackCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ApplicationStackResource.DeserializeApplicationStackResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ApplicationStackCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.cs deleted file mode 100644 index 23bc8311d9b4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Application Stacks. - internal partial class ApplicationStackCollection - { - /// Initializes a new instance of ApplicationStackCollection. - /// Collection of resources. - /// is null. - internal ApplicationStackCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of ApplicationStackCollection. - /// Collection of resources. - /// Link to next page of resources. - internal ApplicationStackCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.Serialization.cs deleted file mode 100644 index ac230ddad216..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.Serialization.cs +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ApplicationStackResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(NamePropertiesName)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(NamePropertiesName); - } - if (Optional.IsDefined(Display)) - { - writer.WritePropertyName("display"); - writer.WriteStringValue(Display); - } - if (Optional.IsDefined(Dependency)) - { - writer.WritePropertyName("dependency"); - writer.WriteStringValue(Dependency); - } - if (Optional.IsCollectionDefined(MajorVersions)) - { - writer.WritePropertyName("majorVersions"); - writer.WriteStartArray(); - foreach (var item in MajorVersions) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Frameworks)) - { - writer.WritePropertyName("frameworks"); - writer.WriteStartArray(); - foreach (var item in Frameworks) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(IsDeprecated)) - { - writer.WritePropertyName("isDeprecated"); - writer.WriteStartArray(); - foreach (var item in IsDeprecated) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ApplicationStackResource DeserializeApplicationStackResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional name0 = default; - Optional display = default; - Optional dependency = default; - Optional> majorVersions = default; - Optional> frameworks = default; - Optional> isDeprecated = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("name")) - { - name0 = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("display")) - { - display = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("dependency")) - { - dependency = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("majorVersions")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(StackMajorVersion.DeserializeStackMajorVersion(item)); - } - majorVersions = array; - continue; - } - if (property0.NameEquals("frameworks")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ApplicationStack.DeserializeApplicationStack(item)); - } - frameworks = array; - continue; - } - if (property0.NameEquals("isDeprecated")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ApplicationStack.DeserializeApplicationStack(item)); - } - isDeprecated = array; - continue; - } - } - continue; - } - } - return new ApplicationStackResource(id.Value, name.Value, kind.Value, type.Value, name0.Value, display.Value, dependency.Value, Optional.ToList(majorVersions), Optional.ToList(frameworks), Optional.ToList(isDeprecated)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs index 42ea7c1fabde..ac8153b7ec12 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs @@ -1,58 +1,96 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// ARM resource for a ApplicationStack. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// ARM resource for a ApplicationStack. + /// + [Rest.Serialization.JsonTransformation] public partial class ApplicationStackResource : ProxyOnlyResource { - /// Initializes a new instance of ApplicationStackResource. + /// + /// Initializes a new instance of the ApplicationStackResource class. + /// public ApplicationStackResource() { - MajorVersions = new ChangeTrackingList(); - Frameworks = new ChangeTrackingList(); - IsDeprecated = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of ApplicationStackResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Application stack name. - /// Application stack display name. - /// Application stack dependency. - /// List of major versions available. - /// List of frameworks associated with application stack. - /// <code>true</code> if this is the stack is deprecated; otherwise, <code>false</code>. - internal ApplicationStackResource(string id, string name, string kind, string type, string namePropertiesName, string display, string dependency, IList majorVersions, IList frameworks, IList isDeprecated) : base(id, name, kind, type) + /// + /// Initializes a new instance of the ApplicationStackResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Application stack + /// name. + /// Application stack display name. + /// Application stack dependency. + /// List of major versions + /// available. + /// List of frameworks associated with + /// application stack. + public ApplicationStackResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string applicationStackResourceName = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList)) + : base(id, name, kind, type) { - NamePropertiesName = namePropertiesName; + ApplicationStackResourceName = applicationStackResourceName; Display = display; Dependency = dependency; MajorVersions = majorVersions; Frameworks = frameworks; - IsDeprecated = isDeprecated; + CustomInit(); } - /// Application stack name. - public string NamePropertiesName { get; set; } - /// Application stack display name. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets application stack name. + /// + [JsonProperty(PropertyName = "properties.name")] + public string ApplicationStackResourceName { get; set; } + + /// + /// Gets or sets application stack display name. + /// + [JsonProperty(PropertyName = "properties.display")] public string Display { get; set; } - /// Application stack dependency. + + /// + /// Gets or sets application stack dependency. + /// + [JsonProperty(PropertyName = "properties.dependency")] public string Dependency { get; set; } - /// List of major versions available. - public IList MajorVersions { get; } - /// List of frameworks associated with application stack. - public IList Frameworks { get; } - /// <code>true</code> if this is the stack is deprecated; otherwise, <code>false</code>. - public IList IsDeprecated { get; } + + /// + /// Gets or sets list of major versions available. + /// + [JsonProperty(PropertyName = "properties.majorVersions")] + public IList MajorVersions { get; set; } + + /// + /// Gets or sets list of frameworks associated with application stack. + /// + [JsonProperty(PropertyName = "properties.frameworks")] + public IList Frameworks { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.Serialization.cs deleted file mode 100644 index 4c012b3d7485..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.Serialization.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AppserviceGithubToken - { - internal static AppserviceGithubToken DeserializeAppserviceGithubToken(JsonElement element) - { - Optional accessToken = default; - Optional scope = default; - Optional tokenType = default; - Optional gotToken = default; - Optional errorMessage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("accessToken")) - { - accessToken = property.Value.GetString(); - continue; - } - if (property.NameEquals("scope")) - { - scope = property.Value.GetString(); - continue; - } - if (property.NameEquals("tokenType")) - { - tokenType = property.Value.GetString(); - continue; - } - if (property.NameEquals("gotToken")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - gotToken = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("errorMessage")) - { - errorMessage = property.Value.GetString(); - continue; - } - } - return new AppserviceGithubToken(accessToken.Value, scope.Value, tokenType.Value, Optional.ToNullable(gotToken), errorMessage.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs deleted file mode 100644 index 32a8f75151e2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Github access token for Appservice CLI github integration. - public partial class AppserviceGithubToken - { - /// Initializes a new instance of AppserviceGithubToken. - internal AppserviceGithubToken() - { - } - - /// Initializes a new instance of AppserviceGithubToken. - /// Github access token for Appservice CLI github integration. - /// Scope of the github access token. - /// token type. - /// True if valid github token received, False otherwise. - /// Error message if unable to get token. - internal AppserviceGithubToken(string accessToken, string scope, string tokenType, bool? gotToken, string errorMessage) - { - AccessToken = accessToken; - Scope = scope; - TokenType = tokenType; - GotToken = gotToken; - ErrorMessage = errorMessage; - } - - /// Github access token for Appservice CLI github integration. - public string AccessToken { get; } - /// Scope of the github access token. - public string Scope { get; } - /// token type. - public string TokenType { get; } - /// True if valid github token received, False otherwise. - public bool? GotToken { get; } - /// Error message if unable to get token. - public string ErrorMessage { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.Serialization.cs deleted file mode 100644 index 96dd3cd7b89b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.Serialization.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class AppserviceGithubTokenRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("code"); - writer.WriteStringValue(Code); - writer.WritePropertyName("state"); - writer.WriteStringValue(State); - writer.WriteEndObject(); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs deleted file mode 100644 index 27e7d1f3f1bc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Appservice Github token request content. - internal partial class AppserviceGithubTokenRequest - { - /// Initializes a new instance of AppserviceGithubTokenRequest. - /// Code string to exchange for Github Access token. - /// State string used for verification. - /// or is null. - public AppserviceGithubTokenRequest(string code, string state) - { - if (code == null) - { - throw new ArgumentNullException(nameof(code)); - } - if (state == null) - { - throw new ArgumentNullException(nameof(state)); - } - - Code = code; - State = state; - } - - /// Code string to exchange for Github Access token. - public string Code { get; } - /// State string used for verification. - public string State { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.Serialization.cs deleted file mode 100644 index 80ce650d842e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ArmIdWrapper : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } - - internal static ArmIdWrapper DeserializeArmIdWrapper(JsonElement element) - { - Optional id = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - } - return new ArmIdWrapper(id.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.cs index c620e2ce5ce9..29086012629d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmIdWrapper.cs @@ -1,27 +1,49 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// A wrapper for an ARM resource id. + using Newtonsoft.Json; + using System.Linq; + + /// + /// A wrapper for an ARM resource id + /// public partial class ArmIdWrapper { - /// Initializes a new instance of ArmIdWrapper. + /// + /// Initializes a new instance of the ArmIdWrapper class. + /// public ArmIdWrapper() { + CustomInit(); } - /// Initializes a new instance of ArmIdWrapper. - /// . - internal ArmIdWrapper(string id) + /// + /// Initializes a new instance of the ArmIdWrapper class. + /// + public ArmIdWrapper(string id = default(string)) { Id = id; + CustomInit(); } - public string Id { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.Serialization.cs deleted file mode 100644 index 26e9979fe39a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.Serialization.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ArmPlan - { - internal static ArmPlan DeserializeArmPlan(JsonElement element) - { - Optional name = default; - Optional publisher = default; - Optional product = default; - Optional promotionCode = default; - Optional version = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("publisher")) - { - publisher = property.Value.GetString(); - continue; - } - if (property.NameEquals("product")) - { - product = property.Value.GetString(); - continue; - } - if (property.NameEquals("promotionCode")) - { - promotionCode = property.Value.GetString(); - continue; - } - if (property.NameEquals("version")) - { - version = property.Value.GetString(); - continue; - } - } - return new ArmPlan(name.Value, publisher.Value, product.Value, promotionCode.Value, version.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.cs deleted file mode 100644 index febf65d9d70e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The plan object in Azure Resource Manager, represents a marketplace plan. - public partial class ArmPlan - { - /// Initializes a new instance of ArmPlan. - internal ArmPlan() - { - } - - /// Initializes a new instance of ArmPlan. - /// The name. - /// The publisher. - /// The product. - /// The promotion code. - /// Version of product. - internal ArmPlan(string name, string publisher, string product, string promotionCode, string version) - { - Name = name; - Publisher = publisher; - Product = product; - PromotionCode = promotionCode; - Version = version; - } - - /// The name. - public string Name { get; } - /// The publisher. - public string Publisher { get; } - /// The product. - public string Product { get; } - /// The promotion code. - public string PromotionCode { get; } - /// Version of product. - public string Version { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.Serialization.cs deleted file mode 100644 index 8c06fa0780b4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.Serialization.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AseV3NetworkingConfiguration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(AllowNewPrivateEndpointConnections)) - { - writer.WritePropertyName("allowNewPrivateEndpointConnections"); - writer.WriteBooleanValue(AllowNewPrivateEndpointConnections.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AseV3NetworkingConfiguration DeserializeAseV3NetworkingConfiguration(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional> windowsOutboundIpAddresses = default; - Optional> linuxOutboundIpAddresses = default; - Optional allowNewPrivateEndpointConnections = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("windowsOutboundIpAddresses")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - windowsOutboundIpAddresses = array; - continue; - } - if (property0.NameEquals("linuxOutboundIpAddresses")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - linuxOutboundIpAddresses = array; - continue; - } - if (property0.NameEquals("allowNewPrivateEndpointConnections")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - allowNewPrivateEndpointConnections = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new AseV3NetworkingConfiguration(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(windowsOutboundIpAddresses), Optional.ToList(linuxOutboundIpAddresses), Optional.ToNullable(allowNewPrivateEndpointConnections)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs deleted file mode 100644 index 0020b194bb9e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Full view of networking configuration for an ASE. - public partial class AseV3NetworkingConfiguration : ProxyOnlyResource - { - /// Initializes a new instance of AseV3NetworkingConfiguration. - public AseV3NetworkingConfiguration() - { - WindowsOutboundIpAddresses = new ChangeTrackingList(); - LinuxOutboundIpAddresses = new ChangeTrackingList(); - } - - /// Initializes a new instance of AseV3NetworkingConfiguration. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// . - /// . - /// Property to enable and disable new private endpoint connection creation on ASE. - internal AseV3NetworkingConfiguration(string id, string name, string kind, string type, IReadOnlyList windowsOutboundIpAddresses, IReadOnlyList linuxOutboundIpAddresses, bool? allowNewPrivateEndpointConnections) : base(id, name, kind, type) - { - WindowsOutboundIpAddresses = windowsOutboundIpAddresses; - LinuxOutboundIpAddresses = linuxOutboundIpAddresses; - AllowNewPrivateEndpointConnections = allowNewPrivateEndpointConnections; - } - - public IReadOnlyList WindowsOutboundIpAddresses { get; } - public IReadOnlyList LinuxOutboundIpAddresses { get; } - /// Property to enable and disable new private endpoint connection creation on ASE. - public bool? AllowNewPrivateEndpointConnections { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.Serialization.cs deleted file mode 100644 index 96710f2366fe..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AuthPlatform : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(RuntimeVersion)) - { - writer.WritePropertyName("runtimeVersion"); - writer.WriteStringValue(RuntimeVersion); - } - if (Optional.IsDefined(ConfigFilePath)) - { - writer.WritePropertyName("configFilePath"); - writer.WriteStringValue(ConfigFilePath); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AuthPlatform DeserializeAuthPlatform(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional runtimeVersion = default; - Optional configFilePath = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("runtimeVersion")) - { - runtimeVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("configFilePath")) - { - configFilePath = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new AuthPlatform(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), runtimeVersion.Value, configFilePath.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.cs index a412039e2548..fcb76de8feff 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.cs @@ -1,52 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the platform of App Service Authentication/Authorization. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class AuthPlatform : ProxyOnlyResource { - /// Initializes a new instance of AuthPlatform. + /// + /// Initializes a new instance of the AuthPlatform class. + /// public AuthPlatform() { + CustomInit(); } - /// Initializes a new instance of AuthPlatform. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>true</code> if the Authentication / Authorization feature is enabled for the current app; otherwise, <code>false</code>. - /// - /// The RuntimeVersion of the Authentication / Authorization feature in use for the current app. - /// The setting in this value can control the behavior of certain features in the Authentication / Authorization module. - /// - /// - /// The path of the config file containing auth settings if they come from a file. - /// If the path is relative, base will the site's root directory. - /// - internal AuthPlatform(string id, string name, string kind, string type, bool? enabled, string runtimeVersion, string configFilePath) : base(id, name, kind, type) + /// + /// Initializes a new instance of the AuthPlatform class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public AuthPlatform(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), string runtimeVersion = default(string), string configFilePath = default(string)) + : base(id, name, kind, type) { Enabled = enabled; RuntimeVersion = runtimeVersion; ConfigFilePath = configFilePath; + CustomInit(); } - /// <code>true</code> if the Authentication / Authorization feature is enabled for the current app; otherwise, <code>false</code>. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } + /// - /// The RuntimeVersion of the Authentication / Authorization feature in use for the current app. - /// The setting in this value can control the behavior of certain features in the Authentication / Authorization module. /// + [JsonProperty(PropertyName = "properties.runtimeVersion")] public string RuntimeVersion { get; set; } + /// - /// The path of the config file containing auth settings if they come from a file. - /// If the path is relative, base will the site's root directory. /// + [JsonProperty(PropertyName = "properties.configFilePath")] public string ConfigFilePath { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.Serialization.cs deleted file mode 100644 index a6e1d2b60aa0..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class AutoHealActionTypeExtensions - { - public static string ToSerialString(this AutoHealActionType value) => value switch - { - AutoHealActionType.Recycle => "Recycle", - AutoHealActionType.LogEvent => "LogEvent", - AutoHealActionType.CustomAction => "CustomAction", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AutoHealActionType value.") - }; - - public static AutoHealActionType ToAutoHealActionType(this string value) - { - if (string.Equals(value, "Recycle", StringComparison.InvariantCultureIgnoreCase)) return AutoHealActionType.Recycle; - if (string.Equals(value, "LogEvent", StringComparison.InvariantCultureIgnoreCase)) return AutoHealActionType.LogEvent; - if (string.Equals(value, "CustomAction", StringComparison.InvariantCultureIgnoreCase)) return AutoHealActionType.CustomAction; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AutoHealActionType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.cs index 3b121c8bbd0e..60d28758200e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActionType.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Predefined action to be taken. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AutoHealActionType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum AutoHealActionType { - /// Recycle. + [EnumMember(Value = "Recycle")] Recycle, - /// LogEvent. + [EnumMember(Value = "LogEvent")] LogEvent, - /// CustomAction. + [EnumMember(Value = "CustomAction")] CustomAction } + internal static class AutoHealActionTypeEnumExtension + { + internal static string ToSerializedValue(this AutoHealActionType? value) + { + return value == null ? null : ((AutoHealActionType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AutoHealActionType value) + { + switch( value ) + { + case AutoHealActionType.Recycle: + return "Recycle"; + case AutoHealActionType.LogEvent: + return "LogEvent"; + case AutoHealActionType.CustomAction: + return "CustomAction"; + } + return null; + } + + internal static AutoHealActionType? ParseAutoHealActionType(this string value) + { + switch( value ) + { + case "Recycle": + return AutoHealActionType.Recycle; + case "LogEvent": + return AutoHealActionType.LogEvent; + case "CustomAction": + return AutoHealActionType.CustomAction; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.Serialization.cs deleted file mode 100644 index d3a1e1fcb80d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.Serialization.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AutoHealActions : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ActionType)) - { - writer.WritePropertyName("actionType"); - writer.WriteStringValue(ActionType.Value.ToSerialString()); - } - if (Optional.IsDefined(CustomAction)) - { - writer.WritePropertyName("customAction"); - writer.WriteObjectValue(CustomAction); - } - if (Optional.IsDefined(MinProcessExecutionTime)) - { - writer.WritePropertyName("minProcessExecutionTime"); - writer.WriteStringValue(MinProcessExecutionTime); - } - writer.WriteEndObject(); - } - - internal static AutoHealActions DeserializeAutoHealActions(JsonElement element) - { - Optional actionType = default; - Optional customAction = default; - Optional minProcessExecutionTime = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("actionType")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - actionType = property.Value.GetString().ToAutoHealActionType(); - continue; - } - if (property.NameEquals("customAction")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - customAction = AutoHealCustomAction.DeserializeAutoHealCustomAction(property.Value); - continue; - } - if (property.NameEquals("minProcessExecutionTime")) - { - minProcessExecutionTime = property.Value.GetString(); - continue; - } - } - return new AutoHealActions(Optional.ToNullable(actionType), customAction.Value, minProcessExecutionTime.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.cs index b9e07d8aaeca..14b9448320b6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealActions.cs @@ -1,42 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Actions which to take by the auto-heal module when a rule is triggered. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Actions which to take by the auto-heal module when a rule is triggered. + /// public partial class AutoHealActions { - /// Initializes a new instance of AutoHealActions. + /// + /// Initializes a new instance of the AutoHealActions class. + /// public AutoHealActions() { + CustomInit(); } - /// Initializes a new instance of AutoHealActions. - /// Predefined action to be taken. - /// Custom action to be taken. - /// - /// Minimum time the process must execute - /// before taking the action. - /// - internal AutoHealActions(AutoHealActionType? actionType, AutoHealCustomAction customAction, string minProcessExecutionTime) + /// + /// Initializes a new instance of the AutoHealActions class. + /// + /// Predefined action to be taken. Possible + /// values include: 'Recycle', 'LogEvent', 'CustomAction' + /// Custom action to be taken. + /// Minimum time the process must + /// execute + /// before taking the action + public AutoHealActions(AutoHealActionType? actionType = default(AutoHealActionType?), AutoHealCustomAction customAction = default(AutoHealCustomAction), string minProcessExecutionTime = default(string)) { ActionType = actionType; CustomAction = customAction; MinProcessExecutionTime = minProcessExecutionTime; + CustomInit(); } - /// Predefined action to be taken. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets predefined action to be taken. Possible values + /// include: 'Recycle', 'LogEvent', 'CustomAction' + /// + [JsonProperty(PropertyName = "actionType")] public AutoHealActionType? ActionType { get; set; } - /// Custom action to be taken. + + /// + /// Gets or sets custom action to be taken. + /// + [JsonProperty(PropertyName = "customAction")] public AutoHealCustomAction CustomAction { get; set; } + /// - /// Minimum time the process must execute - /// before taking the action. + /// Gets or sets minimum time the process must execute + /// before taking the action /// + [JsonProperty(PropertyName = "minProcessExecutionTime")] public string MinProcessExecutionTime { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.Serialization.cs deleted file mode 100644 index 6ca77cf75dbd..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AutoHealCustomAction : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Exe)) - { - writer.WritePropertyName("exe"); - writer.WriteStringValue(Exe); - } - if (Optional.IsDefined(Parameters)) - { - writer.WritePropertyName("parameters"); - writer.WriteStringValue(Parameters); - } - writer.WriteEndObject(); - } - - internal static AutoHealCustomAction DeserializeAutoHealCustomAction(JsonElement element) - { - Optional exe = default; - Optional parameters = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("exe")) - { - exe = property.Value.GetString(); - continue; - } - if (property.NameEquals("parameters")) - { - parameters = property.Value.GetString(); - continue; - } - } - return new AutoHealCustomAction(exe.Value, parameters.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.cs index a6f95eb73cd3..d21dbb6d57f3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealCustomAction.cs @@ -1,35 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { + using Newtonsoft.Json; + using System.Linq; + /// /// Custom action to be executed /// when an auto heal rule is triggered. /// public partial class AutoHealCustomAction { - /// Initializes a new instance of AutoHealCustomAction. + /// + /// Initializes a new instance of the AutoHealCustomAction class. + /// public AutoHealCustomAction() { + CustomInit(); } - /// Initializes a new instance of AutoHealCustomAction. - /// Executable to be run. - /// Parameters for the executable. - internal AutoHealCustomAction(string exe, string parameters) + /// + /// Initializes a new instance of the AutoHealCustomAction class. + /// + /// Executable to be run. + /// Parameters for the executable. + public AutoHealCustomAction(string exe = default(string), string parameters = default(string)) { Exe = exe; Parameters = parameters; + CustomInit(); } - /// Executable to be run. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets executable to be run. + /// + [JsonProperty(PropertyName = "exe")] public string Exe { get; set; } - /// Parameters for the executable. + + /// + /// Gets or sets parameters for the executable. + /// + [JsonProperty(PropertyName = "parameters")] public string Parameters { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.Serialization.cs deleted file mode 100644 index d5c863b5abe7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.Serialization.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AutoHealRules : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Triggers)) - { - writer.WritePropertyName("triggers"); - writer.WriteObjectValue(Triggers); - } - if (Optional.IsDefined(Actions)) - { - writer.WritePropertyName("actions"); - writer.WriteObjectValue(Actions); - } - writer.WriteEndObject(); - } - - internal static AutoHealRules DeserializeAutoHealRules(JsonElement element) - { - Optional triggers = default; - Optional actions = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("triggers")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - triggers = AutoHealTriggers.DeserializeAutoHealTriggers(property.Value); - continue; - } - if (property.NameEquals("actions")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - actions = AutoHealActions.DeserializeAutoHealActions(property.Value); - continue; - } - } - return new AutoHealRules(triggers.Value, actions.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.cs index dcd8d5e3650e..73309239d4f8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealRules.cs @@ -1,32 +1,62 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Rules that can be defined for auto-heal. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Rules that can be defined for auto-heal. + /// public partial class AutoHealRules { - /// Initializes a new instance of AutoHealRules. + /// + /// Initializes a new instance of the AutoHealRules class. + /// public AutoHealRules() { + CustomInit(); } - /// Initializes a new instance of AutoHealRules. - /// Conditions that describe when to execute the auto-heal actions. - /// Actions to be executed when a rule is triggered. - internal AutoHealRules(AutoHealTriggers triggers, AutoHealActions actions) + /// + /// Initializes a new instance of the AutoHealRules class. + /// + /// Conditions that describe when to execute the + /// auto-heal actions. + /// Actions to be executed when a rule is + /// triggered. + public AutoHealRules(AutoHealTriggers triggers = default(AutoHealTriggers), AutoHealActions actions = default(AutoHealActions)) { Triggers = triggers; Actions = actions; + CustomInit(); } - /// Conditions that describe when to execute the auto-heal actions. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets conditions that describe when to execute the auto-heal + /// actions. + /// + [JsonProperty(PropertyName = "triggers")] public AutoHealTriggers Triggers { get; set; } - /// Actions to be executed when a rule is triggered. + + /// + /// Gets or sets actions to be executed when a rule is triggered. + /// + [JsonProperty(PropertyName = "actions")] public AutoHealActions Actions { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.Serialization.cs deleted file mode 100644 index 42f5c3b11625..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.Serialization.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AutoHealTriggers : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Requests)) - { - writer.WritePropertyName("requests"); - writer.WriteObjectValue(Requests); - } - if (Optional.IsDefined(PrivateBytesInKB)) - { - writer.WritePropertyName("privateBytesInKB"); - writer.WriteNumberValue(PrivateBytesInKB.Value); - } - if (Optional.IsCollectionDefined(StatusCodes)) - { - writer.WritePropertyName("statusCodes"); - writer.WriteStartArray(); - foreach (var item in StatusCodes) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(SlowRequests)) - { - writer.WritePropertyName("slowRequests"); - writer.WriteObjectValue(SlowRequests); - } - if (Optional.IsCollectionDefined(SlowRequestsWithPath)) - { - writer.WritePropertyName("slowRequestsWithPath"); - writer.WriteStartArray(); - foreach (var item in SlowRequestsWithPath) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(StatusCodesRange)) - { - writer.WritePropertyName("statusCodesRange"); - writer.WriteStartArray(); - foreach (var item in StatusCodesRange) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static AutoHealTriggers DeserializeAutoHealTriggers(JsonElement element) - { - Optional requests = default; - Optional privateBytesInKB = default; - Optional> statusCodes = default; - Optional slowRequests = default; - Optional> slowRequestsWithPath = default; - Optional> statusCodesRange = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("requests")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - requests = RequestsBasedTrigger.DeserializeRequestsBasedTrigger(property.Value); - continue; - } - if (property.NameEquals("privateBytesInKB")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - privateBytesInKB = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("statusCodes")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(StatusCodesBasedTrigger.DeserializeStatusCodesBasedTrigger(item)); - } - statusCodes = array; - continue; - } - if (property.NameEquals("slowRequests")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - slowRequests = SlowRequestsBasedTrigger.DeserializeSlowRequestsBasedTrigger(property.Value); - continue; - } - if (property.NameEquals("slowRequestsWithPath")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SlowRequestsBasedTrigger.DeserializeSlowRequestsBasedTrigger(item)); - } - slowRequestsWithPath = array; - continue; - } - if (property.NameEquals("statusCodesRange")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(StatusCodesRangeBasedTrigger.DeserializeStatusCodesRangeBasedTrigger(item)); - } - statusCodesRange = array; - continue; - } - } - return new AutoHealTriggers(requests.Value, Optional.ToNullable(privateBytesInKB), Optional.ToList(statusCodes), slowRequests.Value, Optional.ToList(slowRequestsWithPath), Optional.ToList(statusCodesRange)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs index a0fecbfd0c17..1249271bac0a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs @@ -1,54 +1,79 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Triggers for auto-heal. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Triggers for auto-heal. + /// public partial class AutoHealTriggers { - /// Initializes a new instance of AutoHealTriggers. + /// + /// Initializes a new instance of the AutoHealTriggers class. + /// public AutoHealTriggers() { - StatusCodes = new ChangeTrackingList(); - SlowRequestsWithPath = new ChangeTrackingList(); - StatusCodesRange = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of AutoHealTriggers. - /// A rule based on total requests. - /// A rule based on private bytes. - /// A rule based on status codes. - /// A rule based on request execution time. - /// A rule based on multiple Slow Requests Rule with path. - /// A rule based on status codes ranges. - internal AutoHealTriggers(RequestsBasedTrigger requests, int? privateBytesInKB, IList statusCodes, SlowRequestsBasedTrigger slowRequests, IList slowRequestsWithPath, IList statusCodesRange) + /// + /// Initializes a new instance of the AutoHealTriggers class. + /// + /// A rule based on total requests. + /// A rule based on private + /// bytes. + /// A rule based on status codes. + /// A rule based on request execution + /// time. + public AutoHealTriggers(RequestsBasedTrigger requests = default(RequestsBasedTrigger), int? privateBytesInKB = default(int?), IList statusCodes = default(IList), SlowRequestsBasedTrigger slowRequests = default(SlowRequestsBasedTrigger)) { Requests = requests; PrivateBytesInKB = privateBytesInKB; StatusCodes = statusCodes; SlowRequests = slowRequests; - SlowRequestsWithPath = slowRequestsWithPath; - StatusCodesRange = statusCodesRange; + CustomInit(); } - /// A rule based on total requests. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a rule based on total requests. + /// + [JsonProperty(PropertyName = "requests")] public RequestsBasedTrigger Requests { get; set; } - /// A rule based on private bytes. + + /// + /// Gets or sets a rule based on private bytes. + /// + [JsonProperty(PropertyName = "privateBytesInKB")] public int? PrivateBytesInKB { get; set; } - /// A rule based on status codes. - public IList StatusCodes { get; } - /// A rule based on request execution time. + + /// + /// Gets or sets a rule based on status codes. + /// + [JsonProperty(PropertyName = "statusCodes")] + public IList StatusCodes { get; set; } + + /// + /// Gets or sets a rule based on request execution time. + /// + [JsonProperty(PropertyName = "slowRequests")] public SlowRequestsBasedTrigger SlowRequests { get; set; } - /// A rule based on multiple Slow Requests Rule with path. - public IList SlowRequestsWithPath { get; } - /// A rule based on status codes ranges. - public IList StatusCodesRange { get; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.Serialization.cs deleted file mode 100644 index 5a8eed589752..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.Serialization.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AzureActiveDirectory : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(Registration)) - { - writer.WritePropertyName("registration"); - writer.WriteObjectValue(Registration); - } - if (Optional.IsDefined(Login)) - { - writer.WritePropertyName("login"); - writer.WriteObjectValue(Login); - } - if (Optional.IsDefined(Validation)) - { - writer.WritePropertyName("validation"); - writer.WriteObjectValue(Validation); - } - if (Optional.IsDefined(IsAutoProvisioned)) - { - writer.WritePropertyName("isAutoProvisioned"); - writer.WriteBooleanValue(IsAutoProvisioned.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AzureActiveDirectory DeserializeAzureActiveDirectory(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional registration = default; - Optional login = default; - Optional validation = default; - Optional isAutoProvisioned = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("registration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - registration = AzureActiveDirectoryRegistration.DeserializeAzureActiveDirectoryRegistration(property0.Value); - continue; - } - if (property0.NameEquals("login")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - login = AzureActiveDirectoryLogin.DeserializeAzureActiveDirectoryLogin(property0.Value); - continue; - } - if (property0.NameEquals("validation")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - validation = AzureActiveDirectoryValidation.DeserializeAzureActiveDirectoryValidation(property0.Value); - continue; - } - if (property0.NameEquals("isAutoProvisioned")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isAutoProvisioned = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new AzureActiveDirectory(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, login.Value, validation.Value, Optional.ToNullable(isAutoProvisioned)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.cs index 470e43f85806..1adab0d29484 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.cs @@ -1,56 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the Azure Active directory provider. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class AzureActiveDirectory : ProxyOnlyResource { - /// Initializes a new instance of AzureActiveDirectory. + /// + /// Initializes a new instance of the AzureActiveDirectory class. + /// public AzureActiveDirectory() { + CustomInit(); } - /// Initializes a new instance of AzureActiveDirectory. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>false</code> if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, <code>true</code>. - /// The configuration settings of the Azure Active Directory app registration. - /// The configuration settings of the Azure Active Directory login flow. - /// The configuration settings of the Azure Active Directory token validation flow. - /// - /// Gets a value indicating whether the Azure AD configuration was auto-provisioned using 1st party tooling. - /// This is an internal flag primarily intended to support the Azure Management Portal. Users should not - /// read or write to this property. - /// - internal AzureActiveDirectory(string id, string name, string kind, string type, bool? enabled, AzureActiveDirectoryRegistration registration, AzureActiveDirectoryLogin login, AzureActiveDirectoryValidation validation, bool? isAutoProvisioned) : base(id, name, kind, type) + /// + /// Initializes a new instance of the AzureActiveDirectory class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public AzureActiveDirectory(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), AzureActiveDirectoryRegistration registration = default(AzureActiveDirectoryRegistration), AzureActiveDirectoryLogin login = default(AzureActiveDirectoryLogin), AzureActiveDirectoryValidation validation = default(AzureActiveDirectoryValidation), bool? isAutoProvisioned = default(bool?)) + : base(id, name, kind, type) { Enabled = enabled; Registration = registration; Login = login; Validation = validation; IsAutoProvisioned = isAutoProvisioned; + CustomInit(); } - /// <code>false</code> if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } - /// The configuration settings of the Azure Active Directory app registration. + + /// + /// + [JsonProperty(PropertyName = "properties.registration")] public AzureActiveDirectoryRegistration Registration { get; set; } - /// The configuration settings of the Azure Active Directory login flow. + + /// + /// + [JsonProperty(PropertyName = "properties.login")] public AzureActiveDirectoryLogin Login { get; set; } - /// The configuration settings of the Azure Active Directory token validation flow. + + /// + /// + [JsonProperty(PropertyName = "properties.validation")] public AzureActiveDirectoryValidation Validation { get; set; } + /// - /// Gets a value indicating whether the Azure AD configuration was auto-provisioned using 1st party tooling. - /// This is an internal flag primarily intended to support the Azure Management Portal. Users should not - /// read or write to this property. /// + [JsonProperty(PropertyName = "properties.isAutoProvisioned")] public bool? IsAutoProvisioned { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.Serialization.cs deleted file mode 100644 index e0d32b44fc40..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.Serialization.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AzureActiveDirectoryLogin : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(DisableWWWAuthenticate)) - { - writer.WritePropertyName("disableWWWAuthenticate"); - writer.WriteBooleanValue(DisableWWWAuthenticate.Value); - } - if (Optional.IsCollectionDefined(LoginParameters)) - { - writer.WritePropertyName("loginParameters"); - writer.WriteStartArray(); - foreach (var item in LoginParameters) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AzureActiveDirectoryLogin DeserializeAzureActiveDirectoryLogin(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional disableWWWAuthenticate = default; - Optional> loginParameters = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("disableWWWAuthenticate")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - disableWWWAuthenticate = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("loginParameters")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - loginParameters = array; - continue; - } - } - continue; - } - } - return new AzureActiveDirectoryLogin(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(disableWWWAuthenticate), Optional.ToList(loginParameters)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.cs index 27da8519f256..108a38b756cf 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.cs @@ -1,45 +1,62 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// The configuration settings of the Azure Active Directory login flow. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class AzureActiveDirectoryLogin : ProxyOnlyResource { - /// Initializes a new instance of AzureActiveDirectoryLogin. + /// + /// Initializes a new instance of the AzureActiveDirectoryLogin class. + /// public AzureActiveDirectoryLogin() { - LoginParameters = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of AzureActiveDirectoryLogin. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// . - /// - /// Login parameters to send to the OpenID Connect authorization endpoint when - /// a user logs in. Each parameter must be in the form "key=value". - /// - internal AzureActiveDirectoryLogin(string id, string name, string kind, string type, bool? disableWWWAuthenticate, IList loginParameters) : base(id, name, kind, type) + /// + /// Initializes a new instance of the AzureActiveDirectoryLogin class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public AzureActiveDirectoryLogin(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? disableWWWAuthenticate = default(bool?), IList loginParameters = default(IList)) + : base(id, name, kind, type) { DisableWWWAuthenticate = disableWWWAuthenticate; LoginParameters = loginParameters; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.disableWWWAuthenticate")] public bool? DisableWWWAuthenticate { get; set; } + /// - /// Login parameters to send to the OpenID Connect authorization endpoint when - /// a user logs in. Each parameter must be in the form "key=value". /// - public IList LoginParameters { get; } + [JsonProperty(PropertyName = "properties.loginParameters")] + public IList LoginParameters { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.Serialization.cs deleted file mode 100644 index 2c9381862ff1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.Serialization.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AzureActiveDirectoryRegistration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(OpenIdIssuer)) - { - writer.WritePropertyName("openIdIssuer"); - writer.WriteStringValue(OpenIdIssuer); - } - if (Optional.IsDefined(ClientId)) - { - writer.WritePropertyName("clientId"); - writer.WriteStringValue(ClientId); - } - if (Optional.IsDefined(ClientSecretSettingName)) - { - writer.WritePropertyName("clientSecretSettingName"); - writer.WriteStringValue(ClientSecretSettingName); - } - if (Optional.IsDefined(ClientSecretCertificateThumbprint)) - { - writer.WritePropertyName("clientSecretCertificateThumbprint"); - writer.WriteStringValue(ClientSecretCertificateThumbprint); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AzureActiveDirectoryRegistration DeserializeAzureActiveDirectoryRegistration(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional openIdIssuer = default; - Optional clientId = default; - Optional clientSecretSettingName = default; - Optional clientSecretCertificateThumbprint = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("openIdIssuer")) - { - openIdIssuer = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("clientId")) - { - clientId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("clientSecretSettingName")) - { - clientSecretSettingName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("clientSecretCertificateThumbprint")) - { - clientSecretCertificateThumbprint = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new AzureActiveDirectoryRegistration(id.Value, name.Value, kind.Value, type.Value, openIdIssuer.Value, clientId.Value, clientSecretSettingName.Value, clientSecretCertificateThumbprint.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.cs index 11dfa562d4a0..28c6a7986420 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.cs @@ -1,70 +1,74 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the Azure Active Directory app registration. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class AzureActiveDirectoryRegistration : ProxyOnlyResource { - /// Initializes a new instance of AzureActiveDirectoryRegistration. + /// + /// Initializes a new instance of the AzureActiveDirectoryRegistration + /// class. + /// public AzureActiveDirectoryRegistration() { + CustomInit(); } - /// Initializes a new instance of AzureActiveDirectoryRegistration. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// - /// The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. - /// When using Azure Active Directory, this value is the URI of the directory tenant, e.g. https://login.microsoftonline.com/v2.0/{tenant-guid}/. - /// This URI is a case-sensitive identifier for the token issuer. - /// More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. - /// - /// - /// The Client ID of this relying party application, known as the client_id. - /// This setting is required for enabling OpenID Connection authentication with Azure Active Directory or - /// other 3rd party OpenID Connect providers. - /// More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. - /// - /// The app setting name that contains the client secret of the relying party application. - /// - /// An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as - /// a replacement for the Client Secret. It is also optional. - /// - internal AzureActiveDirectoryRegistration(string id, string name, string kind, string type, string openIdIssuer, string clientId, string clientSecretSettingName, string clientSecretCertificateThumbprint) : base(id, name, kind, type) + /// + /// Initializes a new instance of the AzureActiveDirectoryRegistration + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public AzureActiveDirectoryRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string openIdIssuer = default(string), string clientId = default(string), string clientSecretSettingName = default(string), string clientSecretCertificateThumbprint = default(string)) + : base(id, name, kind, type) { OpenIdIssuer = openIdIssuer; ClientId = clientId; ClientSecretSettingName = clientSecretSettingName; ClientSecretCertificateThumbprint = clientSecretCertificateThumbprint; + CustomInit(); } /// - /// The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. - /// When using Azure Active Directory, this value is the URI of the directory tenant, e.g. https://login.microsoftonline.com/v2.0/{tenant-guid}/. - /// This URI is a case-sensitive identifier for the token issuer. - /// More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// /// + [JsonProperty(PropertyName = "properties.openIdIssuer")] public string OpenIdIssuer { get; set; } + /// - /// The Client ID of this relying party application, known as the client_id. - /// This setting is required for enabling OpenID Connection authentication with Azure Active Directory or - /// other 3rd party OpenID Connect providers. - /// More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. /// + [JsonProperty(PropertyName = "properties.clientId")] public string ClientId { get; set; } - /// The app setting name that contains the client secret of the relying party application. + + /// + /// + [JsonProperty(PropertyName = "properties.clientSecretSettingName")] public string ClientSecretSettingName { get; set; } + /// - /// An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as - /// a replacement for the Client Secret. It is also optional. /// + [JsonProperty(PropertyName = "properties.clientSecretCertificateThumbprint")] public string ClientSecretCertificateThumbprint { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.Serialization.cs deleted file mode 100644 index bda8d9ef8598..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.Serialization.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AzureActiveDirectoryValidation : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(JwtClaimChecks)) - { - writer.WritePropertyName("jwtClaimChecks"); - writer.WriteObjectValue(JwtClaimChecks); - } - if (Optional.IsCollectionDefined(AllowedAudiences)) - { - writer.WritePropertyName("allowedAudiences"); - writer.WriteStartArray(); - foreach (var item in AllowedAudiences) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AzureActiveDirectoryValidation DeserializeAzureActiveDirectoryValidation(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional jwtClaimChecks = default; - Optional> allowedAudiences = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("jwtClaimChecks")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - jwtClaimChecks = JwtClaimChecks.DeserializeJwtClaimChecks(property0.Value); - continue; - } - if (property0.NameEquals("allowedAudiences")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedAudiences = array; - continue; - } - } - continue; - } - } - return new AzureActiveDirectoryValidation(id.Value, name.Value, kind.Value, type.Value, jwtClaimChecks.Value, Optional.ToList(allowedAudiences)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.cs index 48104650098c..4122b36d7f76 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.cs @@ -1,40 +1,64 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// The configuration settings of the Azure Active Directory token validation flow. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class AzureActiveDirectoryValidation : ProxyOnlyResource { - /// Initializes a new instance of AzureActiveDirectoryValidation. + /// + /// Initializes a new instance of the AzureActiveDirectoryValidation + /// class. + /// public AzureActiveDirectoryValidation() { - AllowedAudiences = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of AzureActiveDirectoryValidation. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The configuration settings of the checks that should be made while validating the JWT Claims. - /// The list of audiences that can make successful authentication/authorization requests. - internal AzureActiveDirectoryValidation(string id, string name, string kind, string type, JwtClaimChecks jwtClaimChecks, IList allowedAudiences) : base(id, name, kind, type) + /// + /// Initializes a new instance of the AzureActiveDirectoryValidation + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public AzureActiveDirectoryValidation(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), JwtClaimChecks jwtClaimChecks = default(JwtClaimChecks), IList allowedAudiences = default(IList)) + : base(id, name, kind, type) { JwtClaimChecks = jwtClaimChecks; AllowedAudiences = allowedAudiences; + CustomInit(); } - /// The configuration settings of the checks that should be made while validating the JWT Claims. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.jwtClaimChecks")] public JwtClaimChecks JwtClaimChecks { get; set; } - /// The list of audiences that can make successful authentication/authorization requests. - public IList AllowedAudiences { get; } + + /// + /// + [JsonProperty(PropertyName = "properties.allowedAudiences")] + public IList AllowedAudiences { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.Serialization.cs deleted file mode 100644 index 975035246dc3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.Serialization.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AzureBlobStorageApplicationLogsConfig : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Level)) - { - writer.WritePropertyName("level"); - writer.WriteStringValue(Level.Value.ToSerialString()); - } - if (Optional.IsDefined(SasUrl)) - { - writer.WritePropertyName("sasUrl"); - writer.WriteStringValue(SasUrl); - } - if (Optional.IsDefined(RetentionInDays)) - { - writer.WritePropertyName("retentionInDays"); - writer.WriteNumberValue(RetentionInDays.Value); - } - writer.WriteEndObject(); - } - - internal static AzureBlobStorageApplicationLogsConfig DeserializeAzureBlobStorageApplicationLogsConfig(JsonElement element) - { - Optional level = default; - Optional sasUrl = default; - Optional retentionInDays = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("level")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - level = property.Value.GetString().ToLogLevel(); - continue; - } - if (property.NameEquals("sasUrl")) - { - sasUrl = property.Value.GetString(); - continue; - } - if (property.NameEquals("retentionInDays")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - retentionInDays = property.Value.GetInt32(); - continue; - } - } - return new AzureBlobStorageApplicationLogsConfig(Optional.ToNullable(level), sasUrl.Value, Optional.ToNullable(retentionInDays)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.cs index ef35b9d02623..dbfaddf80d36 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageApplicationLogsConfig.cs @@ -1,44 +1,77 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Application logs azure blob storage configuration. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Application logs azure blob storage configuration. + /// public partial class AzureBlobStorageApplicationLogsConfig { - /// Initializes a new instance of AzureBlobStorageApplicationLogsConfig. + /// + /// Initializes a new instance of the + /// AzureBlobStorageApplicationLogsConfig class. + /// public AzureBlobStorageApplicationLogsConfig() { + CustomInit(); } - /// Initializes a new instance of AzureBlobStorageApplicationLogsConfig. - /// Log level. - /// SAS url to a azure blob container with read/write/list/delete permissions. - /// - /// Retention in days. + /// + /// Initializes a new instance of the + /// AzureBlobStorageApplicationLogsConfig class. + /// + /// Log level. Possible values include: 'Off', + /// 'Verbose', 'Information', 'Warning', 'Error' + /// SAS url to a azure blob container with + /// read/write/list/delete permissions. + /// Retention in days. /// Remove blobs older than X days. - /// 0 or lower means no retention. - /// - internal AzureBlobStorageApplicationLogsConfig(LogLevel? level, string sasUrl, int? retentionInDays) + /// 0 or lower means no retention. + public AzureBlobStorageApplicationLogsConfig(LogLevel? level = default(LogLevel?), string sasUrl = default(string), int? retentionInDays = default(int?)) { Level = level; SasUrl = sasUrl; RetentionInDays = retentionInDays; + CustomInit(); } - /// Log level. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets log level. Possible values include: 'Off', 'Verbose', + /// 'Information', 'Warning', 'Error' + /// + [JsonProperty(PropertyName = "level")] public LogLevel? Level { get; set; } - /// SAS url to a azure blob container with read/write/list/delete permissions. + + /// + /// Gets or sets SAS url to a azure blob container with + /// read/write/list/delete permissions. + /// + [JsonProperty(PropertyName = "sasUrl")] public string SasUrl { get; set; } + /// - /// Retention in days. + /// Gets or sets retention in days. /// Remove blobs older than X days. /// 0 or lower means no retention. /// + [JsonProperty(PropertyName = "retentionInDays")] public int? RetentionInDays { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.Serialization.cs deleted file mode 100644 index 319372c375c4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.Serialization.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AzureBlobStorageHttpLogsConfig : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(SasUrl)) - { - writer.WritePropertyName("sasUrl"); - writer.WriteStringValue(SasUrl); - } - if (Optional.IsDefined(RetentionInDays)) - { - writer.WritePropertyName("retentionInDays"); - writer.WriteNumberValue(RetentionInDays.Value); - } - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - writer.WriteEndObject(); - } - - internal static AzureBlobStorageHttpLogsConfig DeserializeAzureBlobStorageHttpLogsConfig(JsonElement element) - { - Optional sasUrl = default; - Optional retentionInDays = default; - Optional enabled = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sasUrl")) - { - sasUrl = property.Value.GetString(); - continue; - } - if (property.NameEquals("retentionInDays")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - retentionInDays = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("enabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - } - return new AzureBlobStorageHttpLogsConfig(sasUrl.Value, Optional.ToNullable(retentionInDays), Optional.ToNullable(enabled)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.cs index c1fb93c28e14..c192a6ca93fe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureBlobStorageHttpLogsConfig.cs @@ -1,44 +1,77 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Http logs to azure blob storage configuration. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Http logs to azure blob storage configuration. + /// public partial class AzureBlobStorageHttpLogsConfig { - /// Initializes a new instance of AzureBlobStorageHttpLogsConfig. + /// + /// Initializes a new instance of the AzureBlobStorageHttpLogsConfig + /// class. + /// public AzureBlobStorageHttpLogsConfig() { + CustomInit(); } - /// Initializes a new instance of AzureBlobStorageHttpLogsConfig. - /// SAS url to a azure blob container with read/write/list/delete permissions. - /// - /// Retention in days. + /// + /// Initializes a new instance of the AzureBlobStorageHttpLogsConfig + /// class. + /// + /// SAS url to a azure blob container with + /// read/write/list/delete permissions. + /// Retention in days. /// Remove blobs older than X days. - /// 0 or lower means no retention. - /// - /// True if configuration is enabled, false if it is disabled and null if configuration is not set. - internal AzureBlobStorageHttpLogsConfig(string sasUrl, int? retentionInDays, bool? enabled) + /// 0 or lower means no retention. + /// True if configuration is enabled, false if it + /// is disabled and null if configuration is not set. + public AzureBlobStorageHttpLogsConfig(string sasUrl = default(string), int? retentionInDays = default(int?), bool? enabled = default(bool?)) { SasUrl = sasUrl; RetentionInDays = retentionInDays; Enabled = enabled; + CustomInit(); } - /// SAS url to a azure blob container with read/write/list/delete permissions. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets SAS url to a azure blob container with + /// read/write/list/delete permissions. + /// + [JsonProperty(PropertyName = "sasUrl")] public string SasUrl { get; set; } + /// - /// Retention in days. + /// Gets or sets retention in days. /// Remove blobs older than X days. /// 0 or lower means no retention. /// + [JsonProperty(PropertyName = "retentionInDays")] public int? RetentionInDays { get; set; } - /// True if configuration is enabled, false if it is disabled and null if configuration is not set. + + /// + /// Gets or sets true if configuration is enabled, false if it is + /// disabled and null if configuration is not set. + /// + [JsonProperty(PropertyName = "enabled")] public bool? Enabled { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.Serialization.cs deleted file mode 100644 index f51022705820..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class AzureResourceTypeExtensions - { - public static string ToSerialString(this AzureResourceType value) => value switch - { - AzureResourceType.Website => "Website", - AzureResourceType.TrafficManager => "TrafficManager", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureResourceType value.") - }; - - public static AzureResourceType ToAzureResourceType(this string value) - { - if (string.Equals(value, "Website", StringComparison.InvariantCultureIgnoreCase)) return AzureResourceType.Website; - if (string.Equals(value, "TrafficManager", StringComparison.InvariantCultureIgnoreCase)) return AzureResourceType.TrafficManager; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureResourceType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.cs index c9c779a4b5f4..ea35b94ba2e5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureResourceType.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Type of the Azure resource the hostname is assigned to. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AzureResourceType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum AzureResourceType { - /// Website. + [EnumMember(Value = "Website")] Website, - /// TrafficManager. + [EnumMember(Value = "TrafficManager")] TrafficManager } + internal static class AzureResourceTypeEnumExtension + { + internal static string ToSerializedValue(this AzureResourceType? value) + { + return value == null ? null : ((AzureResourceType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AzureResourceType value) + { + switch( value ) + { + case AzureResourceType.Website: + return "Website"; + case AzureResourceType.TrafficManager: + return "TrafficManager"; + } + return null; + } + + internal static AzureResourceType? ParseAzureResourceType(this string value) + { + switch( value ) + { + case "Website": + return AzureResourceType.Website; + case "TrafficManager": + return AzureResourceType.TrafficManager; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.Serialization.cs deleted file mode 100644 index cae093bcd089..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.Serialization.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AzureStaticWebApps : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(Registration)) - { - writer.WritePropertyName("registration"); - writer.WriteObjectValue(Registration); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AzureStaticWebApps DeserializeAzureStaticWebApps(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional registration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("registration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - registration = AzureStaticWebAppsRegistration.DeserializeAzureStaticWebAppsRegistration(property0.Value); - continue; - } - } - continue; - } - } - return new AzureStaticWebApps(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs deleted file mode 100644 index 75e5fa73466f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The configuration settings of the Azure Static Web Apps provider. - public partial class AzureStaticWebApps : ProxyOnlyResource - { - /// Initializes a new instance of AzureStaticWebApps. - public AzureStaticWebApps() - { - } - - /// Initializes a new instance of AzureStaticWebApps. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>false</code> if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, <code>true</code>. - /// The configuration settings of the Azure Static Web Apps registration. - internal AzureStaticWebApps(string id, string name, string kind, string type, bool? enabled, AzureStaticWebAppsRegistration registration) : base(id, name, kind, type) - { - Enabled = enabled; - Registration = registration; - } - - /// <code>false</code> if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, <code>true</code>. - public bool? Enabled { get; set; } - /// The configuration settings of the Azure Static Web Apps registration. - public AzureStaticWebAppsRegistration Registration { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.Serialization.cs deleted file mode 100644 index c5880b9911f9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AzureStaticWebAppsRegistration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ClientId)) - { - writer.WritePropertyName("clientId"); - writer.WriteStringValue(ClientId); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AzureStaticWebAppsRegistration DeserializeAzureStaticWebAppsRegistration(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional clientId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("clientId")) - { - clientId = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new AzureStaticWebAppsRegistration(id.Value, name.Value, kind.Value, type.Value, clientId.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs deleted file mode 100644 index 7d122e03f36f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The configuration settings of the registration for the Azure Static Web Apps provider. - public partial class AzureStaticWebAppsRegistration : ProxyOnlyResource - { - /// Initializes a new instance of AzureStaticWebAppsRegistration. - public AzureStaticWebAppsRegistration() - { - } - - /// Initializes a new instance of AzureStaticWebAppsRegistration. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Client ID of the app used for login. - internal AzureStaticWebAppsRegistration(string id, string name, string kind, string type, string clientId) : base(id, name, kind, type) - { - ClientId = clientId; - } - - /// The Client ID of the app used for login. - public string ClientId { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.Serialization.cs deleted file mode 100644 index ba1c2552d158..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AzureStorageInfoValue : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Type)) - { - writer.WritePropertyName("type"); - writer.WriteStringValue(Type.Value.ToSerialString()); - } - if (Optional.IsDefined(AccountName)) - { - writer.WritePropertyName("accountName"); - writer.WriteStringValue(AccountName); - } - if (Optional.IsDefined(ShareName)) - { - writer.WritePropertyName("shareName"); - writer.WriteStringValue(ShareName); - } - if (Optional.IsDefined(AccessKey)) - { - writer.WritePropertyName("accessKey"); - writer.WriteStringValue(AccessKey); - } - if (Optional.IsDefined(MountPath)) - { - writer.WritePropertyName("mountPath"); - writer.WriteStringValue(MountPath); - } - writer.WriteEndObject(); - } - - internal static AzureStorageInfoValue DeserializeAzureStorageInfoValue(JsonElement element) - { - Optional type = default; - Optional accountName = default; - Optional shareName = default; - Optional accessKey = default; - Optional mountPath = default; - Optional state = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = property.Value.GetString().ToAzureStorageType(); - continue; - } - if (property.NameEquals("accountName")) - { - accountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("shareName")) - { - shareName = property.Value.GetString(); - continue; - } - if (property.NameEquals("accessKey")) - { - accessKey = property.Value.GetString(); - continue; - } - if (property.NameEquals("mountPath")) - { - mountPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("state")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - state = property.Value.GetString().ToAzureStorageState(); - continue; - } - } - return new AzureStorageInfoValue(Optional.ToNullable(type), accountName.Value, shareName.Value, accessKey.Value, mountPath.Value, Optional.ToNullable(state)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs index a187e4ab2246..a0dec36fc138 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs @@ -1,28 +1,46 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Azure Files or Blob Storage access information value for dictionary storage. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure Files or Blob Storage access information value for dictionary + /// storage. + /// public partial class AzureStorageInfoValue { - /// Initializes a new instance of AzureStorageInfoValue. + /// + /// Initializes a new instance of the AzureStorageInfoValue class. + /// public AzureStorageInfoValue() { + CustomInit(); } - /// Initializes a new instance of AzureStorageInfoValue. - /// Type of storage. - /// Name of the storage account. - /// Name of the file share (container name, for Blob storage). - /// Access key for the storage account. - /// Path to mount the storage within the site's runtime environment. - /// State of the storage account. - internal AzureStorageInfoValue(AzureStorageType? type, string accountName, string shareName, string accessKey, string mountPath, AzureStorageState? state) + /// + /// Initializes a new instance of the AzureStorageInfoValue class. + /// + /// Type of storage. Possible values include: + /// 'AzureFiles', 'AzureBlob' + /// Name of the storage account. + /// Name of the file share (container name, for + /// Blob storage). + /// Access key for the storage account. + /// Path to mount the storage within the site's + /// runtime environment. + /// State of the storage account. Possible values + /// include: 'Ok', 'InvalidCredentials', 'InvalidShare' + public AzureStorageInfoValue(AzureStorageType? type = default(AzureStorageType?), string accountName = default(string), string shareName = default(string), string accessKey = default(string), string mountPath = default(string), AzureStorageState? state = default(AzureStorageState?)) { Type = type; AccountName = accountName; @@ -30,19 +48,53 @@ internal AzureStorageInfoValue(AzureStorageType? type, string accountName, strin AccessKey = accessKey; MountPath = mountPath; State = state; + CustomInit(); } - /// Type of storage. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of storage. Possible values include: + /// 'AzureFiles', 'AzureBlob' + /// + [JsonProperty(PropertyName = "type")] public AzureStorageType? Type { get; set; } - /// Name of the storage account. + + /// + /// Gets or sets name of the storage account. + /// + [JsonProperty(PropertyName = "accountName")] public string AccountName { get; set; } - /// Name of the file share (container name, for Blob storage). + + /// + /// Gets or sets name of the file share (container name, for Blob + /// storage). + /// + [JsonProperty(PropertyName = "shareName")] public string ShareName { get; set; } - /// Access key for the storage account. + + /// + /// Gets or sets access key for the storage account. + /// + [JsonProperty(PropertyName = "accessKey")] public string AccessKey { get; set; } - /// Path to mount the storage within the site's runtime environment. + + /// + /// Gets or sets path to mount the storage within the site's runtime + /// environment. + /// + [JsonProperty(PropertyName = "mountPath")] public string MountPath { get; set; } - /// State of the storage account. - public AzureStorageState? State { get; } + + /// + /// Gets state of the storage account. Possible values include: 'Ok', + /// 'InvalidCredentials', 'InvalidShare' + /// + [JsonProperty(PropertyName = "state")] + public AzureStorageState? State { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.Serialization.cs deleted file mode 100644 index 922c6123da60..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AzureStoragePropertyDictionaryResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Properties)) - { - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WriteEndObject(); - } - - internal static AzureStoragePropertyDictionaryResource DeserializeAzureStoragePropertyDictionaryResource(JsonElement element) - { - Optional> properties = default; - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, AzureStorageInfoValue.DeserializeAzureStorageInfoValue(property0.Value)); - } - properties = dictionary; - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - } - return new AzureStoragePropertyDictionaryResource(id.Value, name.Value, kind.Value, type.Value, Optional.ToDictionary(properties)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.cs index 3cbeb5a43e65..331960cea659 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStoragePropertyDictionaryResource.cs @@ -1,36 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// AzureStorageInfo dictionary resource. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// AzureStorageInfo dictionary resource. + /// public partial class AzureStoragePropertyDictionaryResource : ProxyOnlyResource { - /// Initializes a new instance of AzureStoragePropertyDictionaryResource. + /// + /// Initializes a new instance of the + /// AzureStoragePropertyDictionaryResource class. + /// public AzureStoragePropertyDictionaryResource() { - Properties = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of AzureStoragePropertyDictionaryResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Azure storage accounts. - internal AzureStoragePropertyDictionaryResource(string id, string name, string kind, string type, IDictionary properties) : base(id, name, kind, type) + /// + /// Initializes a new instance of the + /// AzureStoragePropertyDictionaryResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Azure storage accounts. + public AzureStoragePropertyDictionaryResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary properties = default(IDictionary)) + : base(id, name, kind, type) { Properties = properties; + CustomInit(); } - /// Azure storage accounts. - public IDictionary Properties { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets azure storage accounts. + /// + [JsonProperty(PropertyName = "properties")] + public IDictionary Properties { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.Serialization.cs deleted file mode 100644 index 0ef989d0b238..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.Serialization.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class AzureStorageStateExtensions - { - public static string ToSerialString(this AzureStorageState value) => value switch - { - AzureStorageState.Ok => "Ok", - AzureStorageState.InvalidCredentials => "InvalidCredentials", - AzureStorageState.InvalidShare => "InvalidShare", - AzureStorageState.NotValidated => "NotValidated", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureStorageState value.") - }; - - public static AzureStorageState ToAzureStorageState(this string value) - { - if (string.Equals(value, "Ok", StringComparison.InvariantCultureIgnoreCase)) return AzureStorageState.Ok; - if (string.Equals(value, "InvalidCredentials", StringComparison.InvariantCultureIgnoreCase)) return AzureStorageState.InvalidCredentials; - if (string.Equals(value, "InvalidShare", StringComparison.InvariantCultureIgnoreCase)) return AzureStorageState.InvalidShare; - if (string.Equals(value, "NotValidated", StringComparison.InvariantCultureIgnoreCase)) return AzureStorageState.NotValidated; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureStorageState value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs index 70bc96a6e1bd..49d68d686c25 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs @@ -1,22 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// State of the storage account. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AzureStorageState. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum AzureStorageState { - /// Ok. + [EnumMember(Value = "Ok")] Ok, - /// InvalidCredentials. + [EnumMember(Value = "InvalidCredentials")] InvalidCredentials, - /// InvalidShare. - InvalidShare, - /// NotValidated. - NotValidated + [EnumMember(Value = "InvalidShare")] + InvalidShare + } + internal static class AzureStorageStateEnumExtension + { + internal static string ToSerializedValue(this AzureStorageState? value) + { + return value == null ? null : ((AzureStorageState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AzureStorageState value) + { + switch( value ) + { + case AzureStorageState.Ok: + return "Ok"; + case AzureStorageState.InvalidCredentials: + return "InvalidCredentials"; + case AzureStorageState.InvalidShare: + return "InvalidShare"; + } + return null; + } + + internal static AzureStorageState? ParseAzureStorageState(this string value) + { + switch( value ) + { + case "Ok": + return AzureStorageState.Ok; + case "InvalidCredentials": + return AzureStorageState.InvalidCredentials; + case "InvalidShare": + return AzureStorageState.InvalidShare; + } + return null; + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.Serialization.cs deleted file mode 100644 index 05b1f95639b2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class AzureStorageTypeExtensions - { - public static string ToSerialString(this AzureStorageType value) => value switch - { - AzureStorageType.AzureFiles => "AzureFiles", - AzureStorageType.AzureBlob => "AzureBlob", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureStorageType value.") - }; - - public static AzureStorageType ToAzureStorageType(this string value) - { - if (string.Equals(value, "AzureFiles", StringComparison.InvariantCultureIgnoreCase)) return AzureStorageType.AzureFiles; - if (string.Equals(value, "AzureBlob", StringComparison.InvariantCultureIgnoreCase)) return AzureStorageType.AzureBlob; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AzureStorageType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.cs index c7998d792a5b..15dcdf17157f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageType.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Type of storage. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for AzureStorageType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum AzureStorageType { - /// AzureFiles. + [EnumMember(Value = "AzureFiles")] AzureFiles, - /// AzureBlob. + [EnumMember(Value = "AzureBlob")] AzureBlob } + internal static class AzureStorageTypeEnumExtension + { + internal static string ToSerializedValue(this AzureStorageType? value) + { + return value == null ? null : ((AzureStorageType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this AzureStorageType value) + { + switch( value ) + { + case AzureStorageType.AzureFiles: + return "AzureFiles"; + case AzureStorageType.AzureBlob: + return "AzureBlob"; + } + return null; + } + + internal static AzureStorageType? ParseAzureStorageType(this string value) + { + switch( value ) + { + case "AzureFiles": + return AzureStorageType.AzureFiles; + case "AzureBlob": + return AzureStorageType.AzureBlob; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.Serialization.cs deleted file mode 100644 index bba00e73d938..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.Serialization.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class AzureTableStorageApplicationLogsConfig : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Level)) - { - writer.WritePropertyName("level"); - writer.WriteStringValue(Level.Value.ToSerialString()); - } - writer.WritePropertyName("sasUrl"); - writer.WriteStringValue(SasUrl); - writer.WriteEndObject(); - } - - internal static AzureTableStorageApplicationLogsConfig DeserializeAzureTableStorageApplicationLogsConfig(JsonElement element) - { - Optional level = default; - string sasUrl = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("level")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - level = property.Value.GetString().ToLogLevel(); - continue; - } - if (property.NameEquals("sasUrl")) - { - sasUrl = property.Value.GetString(); - continue; - } - } - return new AzureTableStorageApplicationLogsConfig(Optional.ToNullable(level), sasUrl); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.cs index 77d8c07f6022..a44928dcfd91 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureTableStorageApplicationLogsConfig.cs @@ -1,42 +1,79 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Application logs to Azure table storage configuration. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Application logs to Azure table storage configuration. + /// public partial class AzureTableStorageApplicationLogsConfig { - /// Initializes a new instance of AzureTableStorageApplicationLogsConfig. - /// SAS URL to an Azure table with add/query/delete permissions. - /// is null. - public AzureTableStorageApplicationLogsConfig(string sasUrl) + /// + /// Initializes a new instance of the + /// AzureTableStorageApplicationLogsConfig class. + /// + public AzureTableStorageApplicationLogsConfig() { - if (sasUrl == null) - { - throw new ArgumentNullException(nameof(sasUrl)); - } - - SasUrl = sasUrl; + CustomInit(); } - /// Initializes a new instance of AzureTableStorageApplicationLogsConfig. - /// Log level. - /// SAS URL to an Azure table with add/query/delete permissions. - internal AzureTableStorageApplicationLogsConfig(LogLevel? level, string sasUrl) + /// + /// Initializes a new instance of the + /// AzureTableStorageApplicationLogsConfig class. + /// + /// SAS URL to an Azure table with + /// add/query/delete permissions. + /// Log level. Possible values include: 'Off', + /// 'Verbose', 'Information', 'Warning', 'Error' + public AzureTableStorageApplicationLogsConfig(string sasUrl, LogLevel? level = default(LogLevel?)) { Level = level; SasUrl = sasUrl; + CustomInit(); } - /// Log level. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets log level. Possible values include: 'Off', 'Verbose', + /// 'Information', 'Warning', 'Error' + /// + [JsonProperty(PropertyName = "level")] public LogLevel? Level { get; set; } - /// SAS URL to an Azure table with add/query/delete permissions. + + /// + /// Gets or sets SAS URL to an Azure table with add/query/delete + /// permissions. + /// + [JsonProperty(PropertyName = "sasUrl")] public string SasUrl { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SasUrl == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SasUrl"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.Serialization.cs deleted file mode 100644 index f7e8e5d022d4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.Serialization.cs +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class BackupItem : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static BackupItem DeserializeBackupItem(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional id0 = default; - Optional storageAccountUrl = default; - Optional blobName = default; - Optional name0 = default; - Optional status = default; - Optional sizeInBytes = default; - Optional created = default; - Optional log = default; - Optional> databases = default; - Optional scheduled = default; - Optional lastRestoreTimeStamp = default; - Optional finishedTimeStamp = default; - Optional correlationId = default; - Optional websiteSizeInBytes = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("id")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - id0 = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("storageAccountUrl")) - { - storageAccountUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("blobName")) - { - blobName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("name")) - { - name0 = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property0.Value.GetString().ToBackupItemStatus(); - continue; - } - if (property0.NameEquals("sizeInBytes")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - sizeInBytes = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("created")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - created = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("log")) - { - log = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("databases")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(DatabaseBackupSetting.DeserializeDatabaseBackupSetting(item)); - } - databases = array; - continue; - } - if (property0.NameEquals("scheduled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - scheduled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("lastRestoreTimeStamp")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - lastRestoreTimeStamp = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("finishedTimeStamp")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - finishedTimeStamp = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("correlationId")) - { - correlationId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("websiteSizeInBytes")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - websiteSizeInBytes = property0.Value.GetInt64(); - continue; - } - } - continue; - } - } - return new BackupItem(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(id0), storageAccountUrl.Value, blobName.Value, name0.Value, Optional.ToNullable(status), Optional.ToNullable(sizeInBytes), Optional.ToNullable(created), log.Value, Optional.ToList(databases), Optional.ToNullable(scheduled), Optional.ToNullable(lastRestoreTimeStamp), Optional.ToNullable(finishedTimeStamp), correlationId.Value, Optional.ToNullable(websiteSizeInBytes)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.cs index 61b9f974c8dd..d88db9a81169 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItem.cs @@ -1,50 +1,77 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Backup description. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Backup description. + /// + [Rest.Serialization.JsonTransformation] public partial class BackupItem : ProxyOnlyResource { - /// Initializes a new instance of BackupItem. + /// + /// Initializes a new instance of the BackupItem class. + /// public BackupItem() { - Databases = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of BackupItem. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Id of the backup. - /// SAS URL for the storage account container which contains this backup. - /// Name of the blob which contains data for this backup. - /// Name of this backup. - /// Backup status. - /// Size of the backup in bytes. - /// Timestamp of the backup creation. - /// Details regarding this backup. Might contain an error message. - /// List of databases included in the backup. - /// True if this backup has been created due to a schedule being triggered. - /// Timestamp of a last restore operation which used this backup. - /// Timestamp when this backup finished. - /// Unique correlation identifier. Please use this along with the timestamp while communicating with Azure support. - /// Size of the original web app which has been backed up. - internal BackupItem(string id, string name, string kind, string type, int? backupId, string storageAccountUrl, string blobName, string namePropertiesName, BackupItemStatus? status, long? sizeInBytes, DateTimeOffset? created, string log, IReadOnlyList databases, bool? scheduled, DateTimeOffset? lastRestoreTimeStamp, DateTimeOffset? finishedTimeStamp, string correlationId, long? websiteSizeInBytes) : base(id, name, kind, type) + /// + /// Initializes a new instance of the BackupItem class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Id of the backup. + /// SAS URL for the storage account + /// container which contains this backup. + /// Name of the blob which contains data for + /// this backup. + /// Name of this backup. + /// Backup status. Possible values include: + /// 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created', + /// 'Skipped', 'PartiallySucceeded', 'DeleteInProgress', + /// 'DeleteFailed', 'Deleted' + /// Size of the backup in bytes. + /// Timestamp of the backup creation. + /// Details regarding this backup. Might contain an + /// error message. + /// List of databases included in the + /// backup. + /// True if this backup has been created due to + /// a schedule being triggered. + /// Timestamp of a last restore + /// operation which used this backup. + /// Timestamp when this backup + /// finished. + /// Unique correlation identifier. Please + /// use this along with the timestamp while communicating with Azure + /// support. + /// Size of the original web app which + /// has been backed up. + public BackupItem(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? backupId = default(int?), string storageAccountUrl = default(string), string blobName = default(string), string backupItemName = default(string), BackupItemStatus? status = default(BackupItemStatus?), long? sizeInBytes = default(long?), System.DateTime? created = default(System.DateTime?), string log = default(string), IList databases = default(IList), bool? scheduled = default(bool?), System.DateTime? lastRestoreTimeStamp = default(System.DateTime?), System.DateTime? finishedTimeStamp = default(System.DateTime?), string correlationId = default(string), long? websiteSizeInBytes = default(long?)) + : base(id, name, kind, type) { BackupId = backupId; StorageAccountUrl = storageAccountUrl; BlobName = blobName; - NamePropertiesName = namePropertiesName; + BackupItemName = backupItemName; Status = status; SizeInBytes = sizeInBytes; Created = created; @@ -55,35 +82,102 @@ internal BackupItem(string id, string name, string kind, string type, int? backu FinishedTimeStamp = finishedTimeStamp; CorrelationId = correlationId; WebsiteSizeInBytes = websiteSizeInBytes; + CustomInit(); } - /// Id of the backup. - public int? BackupId { get; } - /// SAS URL for the storage account container which contains this backup. - public string StorageAccountUrl { get; } - /// Name of the blob which contains data for this backup. - public string BlobName { get; } - /// Name of this backup. - public string NamePropertiesName { get; } - /// Backup status. - public BackupItemStatus? Status { get; } - /// Size of the backup in bytes. - public long? SizeInBytes { get; } - /// Timestamp of the backup creation. - public DateTimeOffset? Created { get; } - /// Details regarding this backup. Might contain an error message. - public string Log { get; } - /// List of databases included in the backup. - public IReadOnlyList Databases { get; } - /// True if this backup has been created due to a schedule being triggered. - public bool? Scheduled { get; } - /// Timestamp of a last restore operation which used this backup. - public DateTimeOffset? LastRestoreTimeStamp { get; } - /// Timestamp when this backup finished. - public DateTimeOffset? FinishedTimeStamp { get; } - /// Unique correlation identifier. Please use this along with the timestamp while communicating with Azure support. - public string CorrelationId { get; } - /// Size of the original web app which has been backed up. - public long? WebsiteSizeInBytes { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets id of the backup. + /// + [JsonProperty(PropertyName = "properties.id")] + public int? BackupId { get; private set; } + + /// + /// Gets SAS URL for the storage account container which contains this + /// backup. + /// + [JsonProperty(PropertyName = "properties.storageAccountUrl")] + public string StorageAccountUrl { get; private set; } + + /// + /// Gets name of the blob which contains data for this backup. + /// + [JsonProperty(PropertyName = "properties.blobName")] + public string BlobName { get; private set; } + + /// + /// Gets name of this backup. + /// + [JsonProperty(PropertyName = "properties.name")] + public string BackupItemName { get; private set; } + + /// + /// Gets backup status. Possible values include: 'InProgress', + /// 'Failed', 'Succeeded', 'TimedOut', 'Created', 'Skipped', + /// 'PartiallySucceeded', 'DeleteInProgress', 'DeleteFailed', 'Deleted' + /// + [JsonProperty(PropertyName = "properties.status")] + public BackupItemStatus? Status { get; private set; } + + /// + /// Gets size of the backup in bytes. + /// + [JsonProperty(PropertyName = "properties.sizeInBytes")] + public long? SizeInBytes { get; private set; } + + /// + /// Gets timestamp of the backup creation. + /// + [JsonProperty(PropertyName = "properties.created")] + public System.DateTime? Created { get; private set; } + + /// + /// Gets details regarding this backup. Might contain an error message. + /// + [JsonProperty(PropertyName = "properties.log")] + public string Log { get; private set; } + + /// + /// Gets list of databases included in the backup. + /// + [JsonProperty(PropertyName = "properties.databases")] + public IList Databases { get; private set; } + + /// + /// Gets true if this backup has been created due to a schedule being + /// triggered. + /// + [JsonProperty(PropertyName = "properties.scheduled")] + public bool? Scheduled { get; private set; } + + /// + /// Gets timestamp of a last restore operation which used this backup. + /// + [JsonProperty(PropertyName = "properties.lastRestoreTimeStamp")] + public System.DateTime? LastRestoreTimeStamp { get; private set; } + + /// + /// Gets timestamp when this backup finished. + /// + [JsonProperty(PropertyName = "properties.finishedTimeStamp")] + public System.DateTime? FinishedTimeStamp { get; private set; } + + /// + /// Gets unique correlation identifier. Please use this along with the + /// timestamp while communicating with Azure support. + /// + [JsonProperty(PropertyName = "properties.correlationId")] + public string CorrelationId { get; private set; } + + /// + /// Gets size of the original web app which has been backed up. + /// + [JsonProperty(PropertyName = "properties.websiteSizeInBytes")] + public long? WebsiteSizeInBytes { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.Serialization.cs deleted file mode 100644 index 23a5352e5f4f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class BackupItemCollection - { - internal static BackupItemCollection DeserializeBackupItemCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BackupItem.DeserializeBackupItem(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new BackupItemCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.cs deleted file mode 100644 index 77467c50bd05..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of backup items. - internal partial class BackupItemCollection - { - /// Initializes a new instance of BackupItemCollection. - /// Collection of resources. - /// is null. - internal BackupItemCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of BackupItemCollection. - /// Collection of resources. - /// Link to next page of resources. - internal BackupItemCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.Serialization.cs deleted file mode 100644 index 75e146ed7044..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class BackupItemStatusExtensions - { - public static string ToSerialString(this BackupItemStatus value) => value switch - { - BackupItemStatus.InProgress => "InProgress", - BackupItemStatus.Failed => "Failed", - BackupItemStatus.Succeeded => "Succeeded", - BackupItemStatus.TimedOut => "TimedOut", - BackupItemStatus.Created => "Created", - BackupItemStatus.Skipped => "Skipped", - BackupItemStatus.PartiallySucceeded => "PartiallySucceeded", - BackupItemStatus.DeleteInProgress => "DeleteInProgress", - BackupItemStatus.DeleteFailed => "DeleteFailed", - BackupItemStatus.Deleted => "Deleted", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BackupItemStatus value.") - }; - - public static BackupItemStatus ToBackupItemStatus(this string value) - { - if (string.Equals(value, "InProgress", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.InProgress; - if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.Failed; - if (string.Equals(value, "Succeeded", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.Succeeded; - if (string.Equals(value, "TimedOut", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.TimedOut; - if (string.Equals(value, "Created", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.Created; - if (string.Equals(value, "Skipped", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.Skipped; - if (string.Equals(value, "PartiallySucceeded", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.PartiallySucceeded; - if (string.Equals(value, "DeleteInProgress", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.DeleteInProgress; - if (string.Equals(value, "DeleteFailed", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.DeleteFailed; - if (string.Equals(value, "Deleted", StringComparison.InvariantCultureIgnoreCase)) return BackupItemStatus.Deleted; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BackupItemStatus value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.cs index fcc79e43bbaa..e2752ce9307d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupItemStatus.cs @@ -1,34 +1,108 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Backup status. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for BackupItemStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum BackupItemStatus { - /// InProgress. + [EnumMember(Value = "InProgress")] InProgress, - /// Failed. + [EnumMember(Value = "Failed")] Failed, - /// Succeeded. + [EnumMember(Value = "Succeeded")] Succeeded, - /// TimedOut. + [EnumMember(Value = "TimedOut")] TimedOut, - /// Created. + [EnumMember(Value = "Created")] Created, - /// Skipped. + [EnumMember(Value = "Skipped")] Skipped, - /// PartiallySucceeded. + [EnumMember(Value = "PartiallySucceeded")] PartiallySucceeded, - /// DeleteInProgress. + [EnumMember(Value = "DeleteInProgress")] DeleteInProgress, - /// DeleteFailed. + [EnumMember(Value = "DeleteFailed")] DeleteFailed, - /// Deleted. + [EnumMember(Value = "Deleted")] Deleted } + internal static class BackupItemStatusEnumExtension + { + internal static string ToSerializedValue(this BackupItemStatus? value) + { + return value == null ? null : ((BackupItemStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this BackupItemStatus value) + { + switch( value ) + { + case BackupItemStatus.InProgress: + return "InProgress"; + case BackupItemStatus.Failed: + return "Failed"; + case BackupItemStatus.Succeeded: + return "Succeeded"; + case BackupItemStatus.TimedOut: + return "TimedOut"; + case BackupItemStatus.Created: + return "Created"; + case BackupItemStatus.Skipped: + return "Skipped"; + case BackupItemStatus.PartiallySucceeded: + return "PartiallySucceeded"; + case BackupItemStatus.DeleteInProgress: + return "DeleteInProgress"; + case BackupItemStatus.DeleteFailed: + return "DeleteFailed"; + case BackupItemStatus.Deleted: + return "Deleted"; + } + return null; + } + + internal static BackupItemStatus? ParseBackupItemStatus(this string value) + { + switch( value ) + { + case "InProgress": + return BackupItemStatus.InProgress; + case "Failed": + return BackupItemStatus.Failed; + case "Succeeded": + return BackupItemStatus.Succeeded; + case "TimedOut": + return BackupItemStatus.TimedOut; + case "Created": + return BackupItemStatus.Created; + case "Skipped": + return BackupItemStatus.Skipped; + case "PartiallySucceeded": + return BackupItemStatus.PartiallySucceeded; + case "DeleteInProgress": + return BackupItemStatus.DeleteInProgress; + case "DeleteFailed": + return BackupItemStatus.DeleteFailed; + case "Deleted": + return BackupItemStatus.Deleted; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.Serialization.cs deleted file mode 100644 index 0d820c70a422..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.Serialization.cs +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class BackupRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(BackupName)) - { - writer.WritePropertyName("backupName"); - writer.WriteStringValue(BackupName); - } - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(StorageAccountUrl)) - { - writer.WritePropertyName("storageAccountUrl"); - writer.WriteStringValue(StorageAccountUrl); - } - if (Optional.IsDefined(BackupSchedule)) - { - writer.WritePropertyName("backupSchedule"); - writer.WriteObjectValue(BackupSchedule); - } - if (Optional.IsCollectionDefined(Databases)) - { - writer.WritePropertyName("databases"); - writer.WriteStartArray(); - foreach (var item in Databases) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static BackupRequest DeserializeBackupRequest(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional backupName = default; - Optional enabled = default; - Optional storageAccountUrl = default; - Optional backupSchedule = default; - Optional> databases = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("backupName")) - { - backupName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("storageAccountUrl")) - { - storageAccountUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("backupSchedule")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - backupSchedule = BackupSchedule.DeserializeBackupSchedule(property0.Value); - continue; - } - if (property0.NameEquals("databases")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(DatabaseBackupSetting.DeserializeDatabaseBackupSetting(item)); - } - databases = array; - continue; - } - } - continue; - } - } - return new BackupRequest(id.Value, name.Value, kind.Value, type.Value, backupName.Value, Optional.ToNullable(enabled), storageAccountUrl.Value, backupSchedule.Value, Optional.ToList(databases)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.cs index 3c2a859a0248..8a5bda6bc021 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRequest.cs @@ -1,52 +1,126 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Description of a backup which will be performed. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Description of a backup which will be performed. + /// + [Rest.Serialization.JsonTransformation] public partial class BackupRequest : ProxyOnlyResource { - /// Initializes a new instance of BackupRequest. + /// + /// Initializes a new instance of the BackupRequest class. + /// public BackupRequest() { - Databases = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of BackupRequest. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Name of the backup. - /// True if the backup schedule is enabled (must be included in that case), false if the backup schedule should be disabled. - /// SAS URL to the container. - /// Schedule for the backup if it is executed periodically. - /// Databases included in the backup. - internal BackupRequest(string id, string name, string kind, string type, string backupName, bool? enabled, string storageAccountUrl, BackupSchedule backupSchedule, IList databases) : base(id, name, kind, type) + /// + /// Initializes a new instance of the BackupRequest class. + /// + /// SAS URL to the container. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Name of the backup. + /// True if the backup schedule is enabled (must + /// be included in that case), false if the backup schedule should be + /// disabled. + /// Schedule for the backup if it is + /// executed periodically. + /// Databases included in the backup. + public BackupRequest(string storageAccountUrl, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string backupName = default(string), bool? enabled = default(bool?), BackupSchedule backupSchedule = default(BackupSchedule), IList databases = default(IList)) + : base(id, name, kind, type) { BackupName = backupName; Enabled = enabled; StorageAccountUrl = storageAccountUrl; BackupSchedule = backupSchedule; Databases = databases; + CustomInit(); } - /// Name of the backup. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the backup. + /// + [JsonProperty(PropertyName = "properties.backupName")] public string BackupName { get; set; } - /// True if the backup schedule is enabled (must be included in that case), false if the backup schedule should be disabled. + + /// + /// Gets or sets true if the backup schedule is enabled (must be + /// included in that case), false if the backup schedule should be + /// disabled. + /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } - /// SAS URL to the container. + + /// + /// Gets or sets SAS URL to the container. + /// + [JsonProperty(PropertyName = "properties.storageAccountUrl")] public string StorageAccountUrl { get; set; } - /// Schedule for the backup if it is executed periodically. + + /// + /// Gets or sets schedule for the backup if it is executed + /// periodically. + /// + [JsonProperty(PropertyName = "properties.backupSchedule")] public BackupSchedule BackupSchedule { get; set; } - /// Databases included in the backup. - public IList Databases { get; } + + /// + /// Gets or sets databases included in the backup. + /// + [JsonProperty(PropertyName = "properties.databases")] + public IList Databases { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StorageAccountUrl == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccountUrl"); + } + if (BackupSchedule != null) + { + BackupSchedule.Validate(); + } + if (Databases != null) + { + foreach (var element in Databases) + { + if (element != null) + { + element.Validate(); + } + } + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.Serialization.cs deleted file mode 100644 index 4a62674af966..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class BackupRestoreOperationTypeExtensions - { - public static string ToSerialString(this BackupRestoreOperationType value) => value switch - { - BackupRestoreOperationType.Default => "Default", - BackupRestoreOperationType.Clone => "Clone", - BackupRestoreOperationType.Relocation => "Relocation", - BackupRestoreOperationType.Snapshot => "Snapshot", - BackupRestoreOperationType.CloudFS => "CloudFS", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BackupRestoreOperationType value.") - }; - - public static BackupRestoreOperationType ToBackupRestoreOperationType(this string value) - { - if (string.Equals(value, "Default", StringComparison.InvariantCultureIgnoreCase)) return BackupRestoreOperationType.Default; - if (string.Equals(value, "Clone", StringComparison.InvariantCultureIgnoreCase)) return BackupRestoreOperationType.Clone; - if (string.Equals(value, "Relocation", StringComparison.InvariantCultureIgnoreCase)) return BackupRestoreOperationType.Relocation; - if (string.Equals(value, "Snapshot", StringComparison.InvariantCultureIgnoreCase)) return BackupRestoreOperationType.Snapshot; - if (string.Equals(value, "CloudFS", StringComparison.InvariantCultureIgnoreCase)) return BackupRestoreOperationType.CloudFS; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BackupRestoreOperationType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.cs index 3ed80c4e6a83..bc7721d2bbd7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupRestoreOperationType.cs @@ -1,24 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Operation type. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for BackupRestoreOperationType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum BackupRestoreOperationType { - /// Default. + [EnumMember(Value = "Default")] Default, - /// Clone. + [EnumMember(Value = "Clone")] Clone, - /// Relocation. + [EnumMember(Value = "Relocation")] Relocation, - /// Snapshot. + [EnumMember(Value = "Snapshot")] Snapshot, - /// CloudFS. + [EnumMember(Value = "CloudFS")] CloudFS } + internal static class BackupRestoreOperationTypeEnumExtension + { + internal static string ToSerializedValue(this BackupRestoreOperationType? value) + { + return value == null ? null : ((BackupRestoreOperationType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this BackupRestoreOperationType value) + { + switch( value ) + { + case BackupRestoreOperationType.Default: + return "Default"; + case BackupRestoreOperationType.Clone: + return "Clone"; + case BackupRestoreOperationType.Relocation: + return "Relocation"; + case BackupRestoreOperationType.Snapshot: + return "Snapshot"; + case BackupRestoreOperationType.CloudFS: + return "CloudFS"; + } + return null; + } + + internal static BackupRestoreOperationType? ParseBackupRestoreOperationType(this string value) + { + switch( value ) + { + case "Default": + return BackupRestoreOperationType.Default; + case "Clone": + return BackupRestoreOperationType.Clone; + case "Relocation": + return BackupRestoreOperationType.Relocation; + case "Snapshot": + return BackupRestoreOperationType.Snapshot; + case "CloudFS": + return BackupRestoreOperationType.CloudFS; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.Serialization.cs deleted file mode 100644 index 2ff6701423f7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.Serialization.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class BackupSchedule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("frequencyInterval"); - writer.WriteNumberValue(FrequencyInterval); - writer.WritePropertyName("frequencyUnit"); - writer.WriteStringValue(FrequencyUnit.ToSerialString()); - writer.WritePropertyName("keepAtLeastOneBackup"); - writer.WriteBooleanValue(KeepAtLeastOneBackup); - writer.WritePropertyName("retentionPeriodInDays"); - writer.WriteNumberValue(RetentionPeriodInDays); - if (Optional.IsDefined(StartTime)) - { - writer.WritePropertyName("startTime"); - writer.WriteStringValue(StartTime.Value, "O"); - } - writer.WriteEndObject(); - } - - internal static BackupSchedule DeserializeBackupSchedule(JsonElement element) - { - int frequencyInterval = default; - FrequencyUnit frequencyUnit = default; - bool keepAtLeastOneBackup = default; - int retentionPeriodInDays = default; - Optional startTime = default; - Optional lastExecutionTime = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("frequencyInterval")) - { - frequencyInterval = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("frequencyUnit")) - { - frequencyUnit = property.Value.GetString().ToFrequencyUnit(); - continue; - } - if (property.NameEquals("keepAtLeastOneBackup")) - { - keepAtLeastOneBackup = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("retentionPeriodInDays")) - { - retentionPeriodInDays = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("startTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("lastExecutionTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - lastExecutionTime = property.Value.GetDateTimeOffset("O"); - continue; - } - } - return new BackupSchedule(frequencyInterval, frequencyUnit, keepAtLeastOneBackup, retentionPeriodInDays, Optional.ToNullable(startTime), Optional.ToNullable(lastExecutionTime)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.cs index e33fb8181d7b..ca17ab471980 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BackupSchedule.cs @@ -1,38 +1,52 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Description of a backup schedule. Describes how often should be the backup performed and what should be the retention policy. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Description of a backup schedule. Describes how often should be the + /// backup performed and what should be the retention policy. + /// public partial class BackupSchedule { - /// Initializes a new instance of BackupSchedule. - /// How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day). - /// The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). - /// True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise. - /// After how many days backups should be deleted. - public BackupSchedule(int frequencyInterval, FrequencyUnit frequencyUnit, bool keepAtLeastOneBackup, int retentionPeriodInDays) + /// + /// Initializes a new instance of the BackupSchedule class. + /// + public BackupSchedule() { - FrequencyInterval = frequencyInterval; - FrequencyUnit = frequencyUnit; - KeepAtLeastOneBackup = keepAtLeastOneBackup; - RetentionPeriodInDays = retentionPeriodInDays; + CustomInit(); } - /// Initializes a new instance of BackupSchedule. - /// How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day). - /// The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). - /// True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise. - /// After how many days backups should be deleted. - /// When the schedule should start working. - /// Last time when this schedule was triggered. - internal BackupSchedule(int frequencyInterval, FrequencyUnit frequencyUnit, bool keepAtLeastOneBackup, int retentionPeriodInDays, DateTimeOffset? startTime, DateTimeOffset? lastExecutionTime) + /// + /// Initializes a new instance of the BackupSchedule class. + /// + /// How often the backup should be + /// executed (e.g. for weekly backup, this should be set to 7 and + /// FrequencyUnit should be set to Day) + /// The unit of time for how often the + /// backup should be executed (e.g. for weekly backup, this should be + /// set to Day and FrequencyInterval should be set to 7). Possible + /// values include: 'Day', 'Hour' + /// True if the retention policy + /// should always keep at least one backup in the storage account, + /// regardless how old it is; false otherwise. + /// After how many days backups + /// should be deleted. + /// When the schedule should start + /// working. + /// Last time when this schedule was + /// triggered. + public BackupSchedule(int frequencyInterval, FrequencyUnit frequencyUnit, bool keepAtLeastOneBackup, int retentionPeriodInDays, System.DateTime? startTime = default(System.DateTime?), System.DateTime? lastExecutionTime = default(System.DateTime?)) { FrequencyInterval = frequencyInterval; FrequencyUnit = frequencyUnit; @@ -40,19 +54,65 @@ internal BackupSchedule(int frequencyInterval, FrequencyUnit frequencyUnit, bool RetentionPeriodInDays = retentionPeriodInDays; StartTime = startTime; LastExecutionTime = lastExecutionTime; + CustomInit(); } - /// How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day). + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets how often the backup should be executed (e.g. for + /// weekly backup, this should be set to 7 and FrequencyUnit should be + /// set to Day) + /// + [JsonProperty(PropertyName = "frequencyInterval")] public int FrequencyInterval { get; set; } - /// The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). + + /// + /// Gets or sets the unit of time for how often the backup should be + /// executed (e.g. for weekly backup, this should be set to Day and + /// FrequencyInterval should be set to 7). Possible values include: + /// 'Day', 'Hour' + /// + [JsonProperty(PropertyName = "frequencyUnit")] public FrequencyUnit FrequencyUnit { get; set; } - /// True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise. + + /// + /// Gets or sets true if the retention policy should always keep at + /// least one backup in the storage account, regardless how old it is; + /// false otherwise. + /// + [JsonProperty(PropertyName = "keepAtLeastOneBackup")] public bool KeepAtLeastOneBackup { get; set; } - /// After how many days backups should be deleted. + + /// + /// Gets or sets after how many days backups should be deleted. + /// + [JsonProperty(PropertyName = "retentionPeriodInDays")] public int RetentionPeriodInDays { get; set; } - /// When the schedule should start working. - public DateTimeOffset? StartTime { get; set; } - /// Last time when this schedule was triggered. - public DateTimeOffset? LastExecutionTime { get; } + + /// + /// Gets or sets when the schedule should start working. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets last time when this schedule was triggered. + /// + [JsonProperty(PropertyName = "lastExecutionTime")] + public System.DateTime? LastExecutionTime { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.Serialization.cs deleted file mode 100644 index 1a4effb7bfcc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.Serialization.cs +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class BillingMeter : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(MeterId)) - { - writer.WritePropertyName("meterId"); - writer.WriteStringValue(MeterId); - } - if (Optional.IsDefined(BillingLocation)) - { - writer.WritePropertyName("billingLocation"); - writer.WriteStringValue(BillingLocation); - } - if (Optional.IsDefined(ShortName)) - { - writer.WritePropertyName("shortName"); - writer.WriteStringValue(ShortName); - } - if (Optional.IsDefined(FriendlyName)) - { - writer.WritePropertyName("friendlyName"); - writer.WriteStringValue(FriendlyName); - } - if (Optional.IsDefined(ResourceType)) - { - writer.WritePropertyName("resourceType"); - writer.WriteStringValue(ResourceType); - } - if (Optional.IsDefined(OsType)) - { - writer.WritePropertyName("osType"); - writer.WriteStringValue(OsType); - } - if (Optional.IsDefined(Multiplier)) - { - writer.WritePropertyName("multiplier"); - writer.WriteNumberValue(Multiplier.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static BillingMeter DeserializeBillingMeter(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional meterId = default; - Optional billingLocation = default; - Optional shortName = default; - Optional friendlyName = default; - Optional resourceType = default; - Optional osType = default; - Optional multiplier = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("meterId")) - { - meterId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("billingLocation")) - { - billingLocation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("shortName")) - { - shortName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("friendlyName")) - { - friendlyName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("resourceType")) - { - resourceType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("osType")) - { - osType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("multiplier")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - multiplier = property0.Value.GetDouble(); - continue; - } - } - continue; - } - } - return new BillingMeter(id.Value, name.Value, kind.Value, type.Value, meterId.Value, billingLocation.Value, shortName.Value, friendlyName.Value, resourceType.Value, osType.Value, Optional.ToNullable(multiplier)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs index 361998ab5c9e..2e6698cad5cd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs @@ -1,33 +1,53 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// App Service billing entity that contains information about meter which the Azure billing system utilizes to charge users for services. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// App Service billing entity that contains information about meter which + /// the Azure billing system utilizes to charge users for services. + /// + [Rest.Serialization.JsonTransformation] public partial class BillingMeter : ProxyOnlyResource { - /// Initializes a new instance of BillingMeter. + /// + /// Initializes a new instance of the BillingMeter class. + /// public BillingMeter() { + CustomInit(); } - /// Initializes a new instance of BillingMeter. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Meter GUID onboarded in Commerce. - /// Azure Location of billable resource. - /// Short Name from App Service Azure pricing Page. - /// Friendly name of the meter. - /// App Service ResourceType meter used for. - /// App Service OS type meter used for. - /// Meter Multiplier. - internal BillingMeter(string id, string name, string kind, string type, string meterId, string billingLocation, string shortName, string friendlyName, string resourceType, string osType, double? multiplier) : base(id, name, kind, type) + /// + /// Initializes a new instance of the BillingMeter class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Meter GUID onboarded in Commerce + /// Azure Location of billable + /// resource + /// Short Name from App Service Azure pricing + /// Page + /// Friendly name of the meter + /// App Service ResourceType meter used + /// for + /// App Service OS type meter used for + public BillingMeter(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string meterId = default(string), string billingLocation = default(string), string shortName = default(string), string friendlyName = default(string), string resourceType = default(string), string osType = default(string)) + : base(id, name, kind, type) { MeterId = meterId; BillingLocation = billingLocation; @@ -35,22 +55,49 @@ internal BillingMeter(string id, string name, string kind, string type, string m FriendlyName = friendlyName; ResourceType = resourceType; OsType = osType; - Multiplier = multiplier; + CustomInit(); } - /// Meter GUID onboarded in Commerce. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets meter GUID onboarded in Commerce + /// + [JsonProperty(PropertyName = "properties.meterId")] public string MeterId { get; set; } - /// Azure Location of billable resource. + + /// + /// Gets or sets azure Location of billable resource + /// + [JsonProperty(PropertyName = "properties.billingLocation")] public string BillingLocation { get; set; } - /// Short Name from App Service Azure pricing Page. + + /// + /// Gets or sets short Name from App Service Azure pricing Page + /// + [JsonProperty(PropertyName = "properties.shortName")] public string ShortName { get; set; } - /// Friendly name of the meter. + + /// + /// Gets or sets friendly name of the meter + /// + [JsonProperty(PropertyName = "properties.friendlyName")] public string FriendlyName { get; set; } - /// App Service ResourceType meter used for. + + /// + /// Gets or sets app Service ResourceType meter used for + /// + [JsonProperty(PropertyName = "properties.resourceType")] public string ResourceType { get; set; } - /// App Service OS type meter used for. + + /// + /// Gets or sets app Service OS type meter used for + /// + [JsonProperty(PropertyName = "properties.osType")] public string OsType { get; set; } - /// Meter Multiplier. - public double? Multiplier { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.Serialization.cs deleted file mode 100644 index e2e9ecb7151d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class BillingMeterCollection - { - internal static BillingMeterCollection DeserializeBillingMeterCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BillingMeter.DeserializeBillingMeter(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new BillingMeterCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.cs deleted file mode 100644 index a7e7ac2bdfb1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeterCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Billing Meters. - internal partial class BillingMeterCollection - { - /// Initializes a new instance of BillingMeterCollection. - /// Collection of resources. - /// is null. - internal BillingMeterCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of BillingMeterCollection. - /// Collection of resources. - /// Link to next page of resources. - internal BillingMeterCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.Serialization.cs deleted file mode 100644 index 0fbd1f3259c0..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class BlobStorageTokenStore : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(SasUrlSettingName)) - { - writer.WritePropertyName("sasUrlSettingName"); - writer.WriteStringValue(SasUrlSettingName); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static BlobStorageTokenStore DeserializeBlobStorageTokenStore(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional sasUrlSettingName = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("sasUrlSettingName")) - { - sasUrlSettingName = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new BlobStorageTokenStore(id.Value, name.Value, kind.Value, type.Value, sasUrlSettingName.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.cs index 903e04acc18c..477633b938cb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.cs @@ -1,32 +1,54 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the storage of the tokens if blob storage is used. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class BlobStorageTokenStore : ProxyOnlyResource { - /// Initializes a new instance of BlobStorageTokenStore. + /// + /// Initializes a new instance of the BlobStorageTokenStore class. + /// public BlobStorageTokenStore() { + CustomInit(); } - /// Initializes a new instance of BlobStorageTokenStore. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The name of the app setting containing the SAS URL of the blob storage containing the tokens. - internal BlobStorageTokenStore(string id, string name, string kind, string type, string sasUrlSettingName) : base(id, name, kind, type) + /// + /// Initializes a new instance of the BlobStorageTokenStore class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public BlobStorageTokenStore(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string sasUrlSettingName = default(string)) + : base(id, name, kind, type) { SasUrlSettingName = sasUrlSettingName; + CustomInit(); } - /// The name of the app setting containing the SAS URL of the blob storage containing the tokens. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.sasUrlSettingName")] public string SasUrlSettingName { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuildStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuildStatus.cs index c380c88c30a4..108549cc3987 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuildStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuildStatus.cs @@ -1,66 +1,27 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// The status of the static site build. - public readonly partial struct BuildStatus : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public BuildStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string WaitingForDeploymentValue = "WaitingForDeployment"; - private const string UploadingValue = "Uploading"; - private const string DeployingValue = "Deploying"; - private const string ReadyValue = "Ready"; - private const string FailedValue = "Failed"; - private const string DeletingValue = "Deleting"; - private const string DetachedValue = "Detached"; - - /// WaitingForDeployment. - public static BuildStatus WaitingForDeployment { get; } = new BuildStatus(WaitingForDeploymentValue); - /// Uploading. - public static BuildStatus Uploading { get; } = new BuildStatus(UploadingValue); - /// Deploying. - public static BuildStatus Deploying { get; } = new BuildStatus(DeployingValue); - /// Ready. - public static BuildStatus Ready { get; } = new BuildStatus(ReadyValue); - /// Failed. - public static BuildStatus Failed { get; } = new BuildStatus(FailedValue); - /// Deleting. - public static BuildStatus Deleting { get; } = new BuildStatus(DeletingValue); - /// Detached. - public static BuildStatus Detached { get; } = new BuildStatus(DetachedValue); - /// Determines if two values are the same. - public static bool operator ==(BuildStatus left, BuildStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(BuildStatus left, BuildStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator BuildStatus(string value) => new BuildStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is BuildStatus other && Equals(other); - /// - public bool Equals(BuildStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for BuildStatus. + /// + public static class BuildStatus + { + public const string WaitingForDeployment = "WaitingForDeployment"; + public const string Uploading = "Uploading"; + public const string Deploying = "Deploying"; + public const string Ready = "Ready"; + public const string Failed = "Failed"; + public const string Deleting = "Deleting"; + public const string Detached = "Detached"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.Serialization.cs deleted file mode 100644 index dc0c5330c9e1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class BuiltInAuthenticationProviderExtensions - { - public static string ToSerialString(this BuiltInAuthenticationProvider value) => value switch - { - BuiltInAuthenticationProvider.AzureActiveDirectory => "AzureActiveDirectory", - BuiltInAuthenticationProvider.Facebook => "Facebook", - BuiltInAuthenticationProvider.Google => "Google", - BuiltInAuthenticationProvider.MicrosoftAccount => "MicrosoftAccount", - BuiltInAuthenticationProvider.Twitter => "Twitter", - BuiltInAuthenticationProvider.Github => "Github", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BuiltInAuthenticationProvider value.") - }; - - public static BuiltInAuthenticationProvider ToBuiltInAuthenticationProvider(this string value) - { - if (string.Equals(value, "AzureActiveDirectory", StringComparison.InvariantCultureIgnoreCase)) return BuiltInAuthenticationProvider.AzureActiveDirectory; - if (string.Equals(value, "Facebook", StringComparison.InvariantCultureIgnoreCase)) return BuiltInAuthenticationProvider.Facebook; - if (string.Equals(value, "Google", StringComparison.InvariantCultureIgnoreCase)) return BuiltInAuthenticationProvider.Google; - if (string.Equals(value, "MicrosoftAccount", StringComparison.InvariantCultureIgnoreCase)) return BuiltInAuthenticationProvider.MicrosoftAccount; - if (string.Equals(value, "Twitter", StringComparison.InvariantCultureIgnoreCase)) return BuiltInAuthenticationProvider.Twitter; - if (string.Equals(value, "Github", StringComparison.InvariantCultureIgnoreCase)) return BuiltInAuthenticationProvider.Github; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BuiltInAuthenticationProvider value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.cs index ef4031d77a81..7c1d8d8ded9a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BuiltInAuthenticationProvider.cs @@ -1,30 +1,84 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + /// - /// The default authentication provider to use when multiple providers are configured. - /// This setting is only needed if multiple providers are configured and the unauthenticated client - /// action is set to "RedirectToLoginPage". + /// Defines values for BuiltInAuthenticationProvider. /// + [JsonConverter(typeof(StringEnumConverter))] public enum BuiltInAuthenticationProvider { - /// AzureActiveDirectory. + [EnumMember(Value = "AzureActiveDirectory")] AzureActiveDirectory, - /// Facebook. + [EnumMember(Value = "Facebook")] Facebook, - /// Google. + [EnumMember(Value = "Google")] Google, - /// MicrosoftAccount. + [EnumMember(Value = "MicrosoftAccount")] MicrosoftAccount, - /// Twitter. + [EnumMember(Value = "Twitter")] Twitter, - /// Github. + [EnumMember(Value = "Github")] Github } + internal static class BuiltInAuthenticationProviderEnumExtension + { + internal static string ToSerializedValue(this BuiltInAuthenticationProvider? value) + { + return value == null ? null : ((BuiltInAuthenticationProvider)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this BuiltInAuthenticationProvider value) + { + switch( value ) + { + case BuiltInAuthenticationProvider.AzureActiveDirectory: + return "AzureActiveDirectory"; + case BuiltInAuthenticationProvider.Facebook: + return "Facebook"; + case BuiltInAuthenticationProvider.Google: + return "Google"; + case BuiltInAuthenticationProvider.MicrosoftAccount: + return "MicrosoftAccount"; + case BuiltInAuthenticationProvider.Twitter: + return "Twitter"; + case BuiltInAuthenticationProvider.Github: + return "Github"; + } + return null; + } + + internal static BuiltInAuthenticationProvider? ParseBuiltInAuthenticationProvider(this string value) + { + switch( value ) + { + case "AzureActiveDirectory": + return BuiltInAuthenticationProvider.AzureActiveDirectory; + case "Facebook": + return BuiltInAuthenticationProvider.Facebook; + case "Google": + return BuiltInAuthenticationProvider.Google; + case "MicrosoftAccount": + return BuiltInAuthenticationProvider.MicrosoftAccount; + case "Twitter": + return BuiltInAuthenticationProvider.Twitter; + case "Github": + return BuiltInAuthenticationProvider.Github; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.Serialization.cs deleted file mode 100644 index 08032a8aab99..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.Serialization.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Capability : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Value)) - { - writer.WritePropertyName("value"); - writer.WriteStringValue(Value); - } - if (Optional.IsDefined(Reason)) - { - writer.WritePropertyName("reason"); - writer.WriteStringValue(Reason); - } - writer.WriteEndObject(); - } - - internal static Capability DeserializeCapability(JsonElement element) - { - Optional name = default; - Optional value = default; - Optional reason = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("value")) - { - value = property.Value.GetString(); - continue; - } - if (property.NameEquals("reason")) - { - reason = property.Value.GetString(); - continue; - } - } - return new Capability(name.Value, value.Value, reason.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.cs index 53e496330103..789072a1e19a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Capability.cs @@ -1,36 +1,67 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Describes the capabilities/features allowed for a specific SKU. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the capabilities/features allowed for a specific SKU. + /// public partial class Capability { - /// Initializes a new instance of Capability. + /// + /// Initializes a new instance of the Capability class. + /// public Capability() { + CustomInit(); } - /// Initializes a new instance of Capability. - /// Name of the SKU capability. - /// Value of the SKU capability. - /// Reason of the SKU capability. - internal Capability(string name, string value, string reason) + /// + /// Initializes a new instance of the Capability class. + /// + /// Name of the SKU capability. + /// Value of the SKU capability. + /// Reason of the SKU capability. + public Capability(string name = default(string), string value = default(string), string reason = default(string)) { Name = name; Value = value; Reason = reason; + CustomInit(); } - /// Name of the SKU capability. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the SKU capability. + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// Value of the SKU capability. + + /// + /// Gets or sets value of the SKU capability. + /// + [JsonProperty(PropertyName = "value")] public string Value { get; set; } - /// Reason of the SKU capability. + + /// + /// Gets or sets reason of the SKU capability. + /// + [JsonProperty(PropertyName = "reason")] public string Reason { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.Serialization.cs deleted file mode 100644 index feb79889223f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.Serialization.cs +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Certificate : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Password)) - { - writer.WritePropertyName("password"); - writer.WriteStringValue(Password); - } - if (Optional.IsCollectionDefined(HostNames)) - { - writer.WritePropertyName("hostNames"); - writer.WriteStartArray(); - foreach (var item in HostNames) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(PfxBlob)) - { - writer.WritePropertyName("pfxBlob"); - writer.WriteBase64StringValue(PfxBlob, "D"); - } - if (Optional.IsDefined(KeyVaultId)) - { - writer.WritePropertyName("keyVaultId"); - writer.WriteStringValue(KeyVaultId); - } - if (Optional.IsDefined(KeyVaultSecretName)) - { - writer.WritePropertyName("keyVaultSecretName"); - writer.WriteStringValue(KeyVaultSecretName); - } - if (Optional.IsDefined(ServerFarmId)) - { - writer.WritePropertyName("serverFarmId"); - writer.WriteStringValue(ServerFarmId); - } - if (Optional.IsDefined(CanonicalName)) - { - writer.WritePropertyName("canonicalName"); - writer.WriteStringValue(CanonicalName); - } - if (Optional.IsDefined(DomainValidationMethod)) - { - writer.WritePropertyName("domainValidationMethod"); - writer.WriteStringValue(DomainValidationMethod); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Certificate DeserializeCertificate(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - string location = default; - Optional type = default; - Optional> tags = default; - Optional password = default; - Optional friendlyName = default; - Optional subjectName = default; - Optional> hostNames = default; - Optional pfxBlob = default; - Optional siteName = default; - Optional selfLink = default; - Optional issuer = default; - Optional issueDate = default; - Optional expirationDate = default; - Optional thumbprint = default; - Optional valid = default; - Optional cerBlob = default; - Optional publicKeyHash = default; - Optional hostingEnvironmentProfile = default; - Optional keyVaultId = default; - Optional keyVaultSecretName = default; - Optional keyVaultSecretStatus = default; - Optional serverFarmId = default; - Optional canonicalName = default; - Optional domainValidationMethod = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("password")) - { - password = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("friendlyName")) - { - friendlyName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("subjectName")) - { - subjectName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - hostNames = array; - continue; - } - if (property0.NameEquals("pfxBlob")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - pfxBlob = property0.Value.GetBytesFromBase64("D"); - continue; - } - if (property0.NameEquals("siteName")) - { - siteName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("selfLink")) - { - selfLink = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("issuer")) - { - issuer = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("issueDate")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - issueDate = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("expirationDate")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - expirationDate = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("thumbprint")) - { - thumbprint = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("valid")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - valid = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("cerBlob")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - cerBlob = property0.Value.GetBytesFromBase64("D"); - continue; - } - if (property0.NameEquals("publicKeyHash")) - { - publicKeyHash = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostingEnvironmentProfile")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); - continue; - } - if (property0.NameEquals("keyVaultId")) - { - keyVaultId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("keyVaultSecretName")) - { - keyVaultSecretName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("keyVaultSecretStatus")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - keyVaultSecretStatus = property0.Value.GetString().ToKeyVaultSecretStatus(); - continue; - } - if (property0.NameEquals("serverFarmId")) - { - serverFarmId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("canonicalName")) - { - canonicalName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("domainValidationMethod")) - { - domainValidationMethod = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new Certificate(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), password.Value, friendlyName.Value, subjectName.Value, Optional.ToList(hostNames), pfxBlob.Value, siteName.Value, selfLink.Value, issuer.Value, Optional.ToNullable(issueDate), Optional.ToNullable(expirationDate), thumbprint.Value, Optional.ToNullable(valid), cerBlob.Value, publicKeyHash.Value, hostingEnvironmentProfile.Value, keyVaultId.Value, keyVaultSecretName.Value, Optional.ToNullable(keyVaultSecretStatus), serverFarmId.Value, canonicalName.Value, domainValidationMethod.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs index 839ef4e94fb7..d46eb9c0661c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs @@ -1,63 +1,80 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// SSL certificate for an app. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// SSL certificate for an app. + /// + [Rest.Serialization.JsonTransformation] public partial class Certificate : Resource { - /// Initializes a new instance of Certificate. - /// Resource Location. - /// is null. - public Certificate(string location) : base(location) + /// + /// Initializes a new instance of the Certificate class. + /// + public Certificate() { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - HostNames = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of Certificate. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource Location. - /// Resource type. - /// Resource tags. - /// Certificate password. - /// Friendly name of the certificate. - /// Subject name of the certificate. - /// Host names the certificate applies to. - /// Pfx blob. - /// App name. - /// Self link. - /// Certificate issuer. - /// Certificate issue Date. - /// Certificate expiration date. - /// Certificate thumbprint. - /// Is the certificate valid?. - /// Raw bytes of .cer file. - /// Public key hash. - /// Specification for the App Service Environment to use for the certificate. - /// Key Vault Csm resource Id. - /// Key Vault secret name. - /// Status of the Key Vault secret. - /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - /// CNAME of the certificate to be issued via free certificate. - /// Method of domain validation for free cert. - internal Certificate(string id, string name, string kind, string location, string type, IDictionary tags, string password, string friendlyName, string subjectName, IList hostNames, byte[] pfxBlob, string siteName, string selfLink, string issuer, DateTimeOffset? issueDate, DateTimeOffset? expirationDate, string thumbprint, bool? valid, byte[] cerBlob, string publicKeyHash, HostingEnvironmentProfile hostingEnvironmentProfile, string keyVaultId, string keyVaultSecretName, KeyVaultSecretStatus? keyVaultSecretStatus, string serverFarmId, string canonicalName, string domainValidationMethod) : base(id, name, kind, location, type, tags) + /// + /// Initializes a new instance of the Certificate class. + /// + /// Resource Location. + /// Certificate password. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Resource tags. + /// Friendly name of the + /// certificate. + /// Subject name of the certificate. + /// Host names the certificate applies + /// to. + /// Pfx blob. + /// App name. + /// Self link. + /// Certificate issuer. + /// Certificate issue Date. + /// Certificate expiration date. + /// Certificate thumbprint. + /// Is the certificate valid?. + /// Raw bytes of .cer file + /// Public key hash. + /// Specification for the App + /// Service Environment to use for the certificate. + /// Key Vault Csm resource Id. + /// Key Vault secret name. + /// Status of the Key Vault secret. + /// Possible values include: 'Initialized', + /// 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', + /// 'OperationNotPermittedOnKeyVault', + /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + /// 'Unknown' + /// Resource ID of the associated App + /// Service plan, formatted as: + /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + /// CNAME of the certificate to be issued + /// via free certificate + public Certificate(string location, string password, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string)) + : base(location, id, name, kind, type, tags) { - Password = password; FriendlyName = friendlyName; SubjectName = subjectName; HostNames = hostNames; @@ -67,6 +84,7 @@ internal Certificate(string id, string name, string kind, string location, strin Issuer = issuer; IssueDate = issueDate; ExpirationDate = expirationDate; + Password = password; Thumbprint = thumbprint; Valid = valid; CerBlob = cerBlob; @@ -77,50 +95,156 @@ internal Certificate(string id, string name, string kind, string location, strin KeyVaultSecretStatus = keyVaultSecretStatus; ServerFarmId = serverFarmId; CanonicalName = canonicalName; - DomainValidationMethod = domainValidationMethod; + CustomInit(); } - /// Certificate password. - public string Password { get; set; } - /// Friendly name of the certificate. - public string FriendlyName { get; } - /// Subject name of the certificate. - public string SubjectName { get; } - /// Host names the certificate applies to. - public IList HostNames { get; } - /// Pfx blob. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets friendly name of the certificate. + /// + [JsonProperty(PropertyName = "properties.friendlyName")] + public string FriendlyName { get; private set; } + + /// + /// Gets subject name of the certificate. + /// + [JsonProperty(PropertyName = "properties.subjectName")] + public string SubjectName { get; private set; } + + /// + /// Gets or sets host names the certificate applies to. + /// + [JsonProperty(PropertyName = "properties.hostNames")] + public IList HostNames { get; set; } + + /// + /// Gets or sets pfx blob. + /// + [JsonProperty(PropertyName = "properties.pfxBlob")] public byte[] PfxBlob { get; set; } - /// App name. - public string SiteName { get; } - /// Self link. - public string SelfLink { get; } - /// Certificate issuer. - public string Issuer { get; } - /// Certificate issue Date. - public DateTimeOffset? IssueDate { get; } - /// Certificate expiration date. - public DateTimeOffset? ExpirationDate { get; } - /// Certificate thumbprint. - public string Thumbprint { get; } - /// Is the certificate valid?. - public bool? Valid { get; } - /// Raw bytes of .cer file. - public byte[] CerBlob { get; } - /// Public key hash. - public string PublicKeyHash { get; } - /// Specification for the App Service Environment to use for the certificate. - public HostingEnvironmentProfile HostingEnvironmentProfile { get; } - /// Key Vault Csm resource Id. + + /// + /// Gets app name. + /// + [JsonProperty(PropertyName = "properties.siteName")] + public string SiteName { get; private set; } + + /// + /// Gets self link. + /// + [JsonProperty(PropertyName = "properties.selfLink")] + public string SelfLink { get; private set; } + + /// + /// Gets certificate issuer. + /// + [JsonProperty(PropertyName = "properties.issuer")] + public string Issuer { get; private set; } + + /// + /// Gets certificate issue Date. + /// + [JsonProperty(PropertyName = "properties.issueDate")] + public System.DateTime? IssueDate { get; private set; } + + /// + /// Gets certificate expiration date. + /// + [JsonProperty(PropertyName = "properties.expirationDate")] + public System.DateTime? ExpirationDate { get; private set; } + + /// + /// Gets or sets certificate password. + /// + [JsonProperty(PropertyName = "properties.password")] + public string Password { get; set; } + + /// + /// Gets certificate thumbprint. + /// + [JsonProperty(PropertyName = "properties.thumbprint")] + public string Thumbprint { get; private set; } + + /// + /// Gets is the certificate valid?. + /// + [JsonProperty(PropertyName = "properties.valid")] + public bool? Valid { get; private set; } + + /// + /// Gets raw bytes of .cer file + /// + [JsonProperty(PropertyName = "properties.cerBlob")] + public byte[] CerBlob { get; private set; } + + /// + /// Gets public key hash. + /// + [JsonProperty(PropertyName = "properties.publicKeyHash")] + public string PublicKeyHash { get; private set; } + + /// + /// Gets specification for the App Service Environment to use for the + /// certificate. + /// + [JsonProperty(PropertyName = "properties.hostingEnvironmentProfile")] + public HostingEnvironmentProfile HostingEnvironmentProfile { get; private set; } + + /// + /// Gets or sets key Vault Csm resource Id. + /// + [JsonProperty(PropertyName = "properties.keyVaultId")] public string KeyVaultId { get; set; } - /// Key Vault secret name. + + /// + /// Gets or sets key Vault secret name. + /// + [JsonProperty(PropertyName = "properties.keyVaultSecretName")] public string KeyVaultSecretName { get; set; } - /// Status of the Key Vault secret. - public KeyVaultSecretStatus? KeyVaultSecretStatus { get; } - /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + + /// + /// Gets status of the Key Vault secret. Possible values include: + /// 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', + /// 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + /// 'Unknown' + /// + [JsonProperty(PropertyName = "properties.keyVaultSecretStatus")] + public KeyVaultSecretStatus? KeyVaultSecretStatus { get; private set; } + + /// + /// Gets or sets resource ID of the associated App Service plan, + /// formatted as: + /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + /// + [JsonProperty(PropertyName = "properties.serverFarmId")] public string ServerFarmId { get; set; } - /// CNAME of the certificate to be issued via free certificate. + + /// + /// Gets or sets CNAME of the certificate to be issued via free + /// certificate + /// + [JsonProperty(PropertyName = "properties.canonicalName")] public string CanonicalName { get; set; } - /// Method of domain validation for free cert. - public string DomainValidationMethod { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Password == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Password"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.Serialization.cs deleted file mode 100644 index 5ac197bc1d8c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class CertificateCollection - { - internal static CertificateCollection DeserializeCertificateCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Certificate.DeserializeCertificate(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new CertificateCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.cs deleted file mode 100644 index c286a293e4dd..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of certificates. - internal partial class CertificateCollection - { - /// Initializes a new instance of CertificateCollection. - /// Collection of resources. - /// is null. - internal CertificateCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of CertificateCollection. - /// Collection of resources. - /// Link to next page of resources. - internal CertificateCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.Serialization.cs deleted file mode 100644 index c229c791d75b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.Serialization.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CertificateDetails - { - internal static CertificateDetails DeserializeCertificateDetails(JsonElement element) - { - Optional version = default; - Optional serialNumber = default; - Optional thumbprint = default; - Optional subject = default; - Optional notBefore = default; - Optional notAfter = default; - Optional signatureAlgorithm = default; - Optional issuer = default; - Optional rawData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("version")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - version = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("serialNumber")) - { - serialNumber = property.Value.GetString(); - continue; - } - if (property.NameEquals("thumbprint")) - { - thumbprint = property.Value.GetString(); - continue; - } - if (property.NameEquals("subject")) - { - subject = property.Value.GetString(); - continue; - } - if (property.NameEquals("notBefore")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - notBefore = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("notAfter")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - notAfter = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("signatureAlgorithm")) - { - signatureAlgorithm = property.Value.GetString(); - continue; - } - if (property.NameEquals("issuer")) - { - issuer = property.Value.GetString(); - continue; - } - if (property.NameEquals("rawData")) - { - rawData = property.Value.GetString(); - continue; - } - } - return new CertificateDetails(Optional.ToNullable(version), serialNumber.Value, thumbprint.Value, subject.Value, Optional.ToNullable(notBefore), Optional.ToNullable(notAfter), signatureAlgorithm.Value, issuer.Value, rawData.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.cs index 346fc8986c7f..88da305a42c3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateDetails.cs @@ -1,33 +1,45 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// SSL certificate details. + using Newtonsoft.Json; + using System.Linq; + + /// + /// SSL certificate details. + /// public partial class CertificateDetails { - /// Initializes a new instance of CertificateDetails. - internal CertificateDetails() + /// + /// Initializes a new instance of the CertificateDetails class. + /// + public CertificateDetails() { + CustomInit(); } - /// Initializes a new instance of CertificateDetails. - /// Certificate Version. - /// Certificate Serial Number. - /// Certificate Thumbprint. - /// Certificate Subject. - /// Date Certificate is valid from. - /// Date Certificate is valid to. - /// Certificate Signature algorithm. - /// Certificate Issuer. - /// Raw certificate data. - internal CertificateDetails(int? version, string serialNumber, string thumbprint, string subject, DateTimeOffset? notBefore, DateTimeOffset? notAfter, string signatureAlgorithm, string issuer, string rawData) + /// + /// Initializes a new instance of the CertificateDetails class. + /// + /// Certificate Version. + /// Certificate Serial Number. + /// Certificate Thumbprint. + /// Certificate Subject. + /// Date Certificate is valid from. + /// Date Certificate is valid to. + /// Certificate Signature + /// algorithm. + /// Certificate Issuer. + /// Raw certificate data. + public CertificateDetails(int? version = default(int?), string serialNumber = default(string), string thumbprint = default(string), string subject = default(string), System.DateTime? notBefore = default(System.DateTime?), System.DateTime? notAfter = default(System.DateTime?), string signatureAlgorithm = default(string), string issuer = default(string), string rawData = default(string)) { Version = version; SerialNumber = serialNumber; @@ -38,25 +50,67 @@ internal CertificateDetails(int? version, string serialNumber, string thumbprint SignatureAlgorithm = signatureAlgorithm; Issuer = issuer; RawData = rawData; + CustomInit(); } - /// Certificate Version. - public int? Version { get; } - /// Certificate Serial Number. - public string SerialNumber { get; } - /// Certificate Thumbprint. - public string Thumbprint { get; } - /// Certificate Subject. - public string Subject { get; } - /// Date Certificate is valid from. - public DateTimeOffset? NotBefore { get; } - /// Date Certificate is valid to. - public DateTimeOffset? NotAfter { get; } - /// Certificate Signature algorithm. - public string SignatureAlgorithm { get; } - /// Certificate Issuer. - public string Issuer { get; } - /// Raw certificate data. - public string RawData { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets certificate Version. + /// + [JsonProperty(PropertyName = "version")] + public int? Version { get; private set; } + + /// + /// Gets certificate Serial Number. + /// + [JsonProperty(PropertyName = "serialNumber")] + public string SerialNumber { get; private set; } + + /// + /// Gets certificate Thumbprint. + /// + [JsonProperty(PropertyName = "thumbprint")] + public string Thumbprint { get; private set; } + + /// + /// Gets certificate Subject. + /// + [JsonProperty(PropertyName = "subject")] + public string Subject { get; private set; } + + /// + /// Gets date Certificate is valid from. + /// + [JsonProperty(PropertyName = "notBefore")] + public System.DateTime? NotBefore { get; private set; } + + /// + /// Gets date Certificate is valid to. + /// + [JsonProperty(PropertyName = "notAfter")] + public System.DateTime? NotAfter { get; private set; } + + /// + /// Gets certificate Signature algorithm. + /// + [JsonProperty(PropertyName = "signatureAlgorithm")] + public string SignatureAlgorithm { get; private set; } + + /// + /// Gets certificate Issuer. + /// + [JsonProperty(PropertyName = "issuer")] + public string Issuer { get; private set; } + + /// + /// Gets raw certificate data. + /// + [JsonProperty(PropertyName = "rawData")] + public string RawData { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.Serialization.cs deleted file mode 100644 index abee94842940..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.Serialization.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CertificateEmail : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(EmailId)) - { - writer.WritePropertyName("emailId"); - writer.WriteStringValue(EmailId); - } - if (Optional.IsDefined(TimeStamp)) - { - writer.WritePropertyName("timeStamp"); - writer.WriteStringValue(TimeStamp.Value, "O"); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static CertificateEmail DeserializeCertificateEmail(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional emailId = default; - Optional timeStamp = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("emailId")) - { - emailId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("timeStamp")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - timeStamp = property0.Value.GetDateTimeOffset("O"); - continue; - } - } - continue; - } - } - return new CertificateEmail(id.Value, name.Value, kind.Value, type.Value, emailId.Value, Optional.ToNullable(timeStamp)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.cs index e44b7139b2c3..964709077aa5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateEmail.cs @@ -1,38 +1,67 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// SSL certificate email. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// SSL certificate email. + /// + [Rest.Serialization.JsonTransformation] public partial class CertificateEmail : ProxyOnlyResource { - /// Initializes a new instance of CertificateEmail. + /// + /// Initializes a new instance of the CertificateEmail class. + /// public CertificateEmail() { + CustomInit(); } - /// Initializes a new instance of CertificateEmail. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Email id. - /// Time stamp. - internal CertificateEmail(string id, string name, string kind, string type, string emailId, DateTimeOffset? timeStamp) : base(id, name, kind, type) + /// + /// Initializes a new instance of the CertificateEmail class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Email id. + /// Time stamp. + public CertificateEmail(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string emailId = default(string), System.DateTime? timeStamp = default(System.DateTime?)) + : base(id, name, kind, type) { EmailId = emailId; TimeStamp = timeStamp; + CustomInit(); } - /// Email id. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets email id. + /// + [JsonProperty(PropertyName = "properties.emailId")] public string EmailId { get; set; } - /// Time stamp. - public DateTimeOffset? TimeStamp { get; set; } + + /// + /// Gets or sets time stamp. + /// + [JsonProperty(PropertyName = "properties.timeStamp")] + public System.DateTime? TimeStamp { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.Serialization.cs deleted file mode 100644 index afedc3b9c2d3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.Serialization.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CertificateOrderAction : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static CertificateOrderAction DeserializeCertificateOrderAction(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional actionType = default; - Optional createdAt = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("actionType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - actionType = property0.Value.GetString().ToCertificateOrderActionType(); - continue; - } - if (property0.NameEquals("createdAt")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - createdAt = property0.Value.GetDateTimeOffset("O"); - continue; - } - } - continue; - } - } - return new CertificateOrderAction(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(actionType), Optional.ToNullable(createdAt)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.cs index 122ef7336dd9..19be35309378 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderAction.cs @@ -1,38 +1,80 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Certificate order action. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Certificate order action. + /// + [Rest.Serialization.JsonTransformation] public partial class CertificateOrderAction : ProxyOnlyResource { - /// Initializes a new instance of CertificateOrderAction. + /// + /// Initializes a new instance of the CertificateOrderAction class. + /// public CertificateOrderAction() { + CustomInit(); } - /// Initializes a new instance of CertificateOrderAction. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Action type. - /// Time at which the certificate action was performed. - internal CertificateOrderAction(string id, string name, string kind, string type, CertificateOrderActionType? actionType, DateTimeOffset? createdAt) : base(id, name, kind, type) + /// + /// Initializes a new instance of the CertificateOrderAction class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Action type. Possible values include: + /// 'CertificateIssued', 'CertificateOrderCanceled', + /// 'CertificateOrderCreated', 'CertificateRevoked', + /// 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', + /// 'OrgValidationComplete', 'SanDrop', 'FraudCleared', + /// 'CertificateExpired', 'CertificateExpirationWarning', + /// 'FraudDocumentationRequired', 'Unknown' + /// Time at which the certificate action was + /// performed. + public CertificateOrderAction(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), CertificateOrderActionType? actionType = default(CertificateOrderActionType?), System.DateTime? createdAt = default(System.DateTime?)) + : base(id, name, kind, type) { ActionType = actionType; CreatedAt = createdAt; + CustomInit(); } - /// Action type. - public CertificateOrderActionType? ActionType { get; } - /// Time at which the certificate action was performed. - public DateTimeOffset? CreatedAt { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets action type. Possible values include: 'CertificateIssued', + /// 'CertificateOrderCanceled', 'CertificateOrderCreated', + /// 'CertificateRevoked', 'DomainValidationComplete', 'FraudDetected', + /// 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', + /// 'FraudCleared', 'CertificateExpired', + /// 'CertificateExpirationWarning', 'FraudDocumentationRequired', + /// 'Unknown' + /// + [JsonProperty(PropertyName = "properties.actionType")] + public CertificateOrderActionType? ActionType { get; private set; } + + /// + /// Gets time at which the certificate action was performed. + /// + [JsonProperty(PropertyName = "properties.createdAt")] + public System.DateTime? CreatedAt { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.Serialization.cs deleted file mode 100644 index 43a3eb07e092..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class CertificateOrderActionTypeExtensions - { - public static string ToSerialString(this CertificateOrderActionType value) => value switch - { - CertificateOrderActionType.CertificateIssued => "CertificateIssued", - CertificateOrderActionType.CertificateOrderCanceled => "CertificateOrderCanceled", - CertificateOrderActionType.CertificateOrderCreated => "CertificateOrderCreated", - CertificateOrderActionType.CertificateRevoked => "CertificateRevoked", - CertificateOrderActionType.DomainValidationComplete => "DomainValidationComplete", - CertificateOrderActionType.FraudDetected => "FraudDetected", - CertificateOrderActionType.OrgNameChange => "OrgNameChange", - CertificateOrderActionType.OrgValidationComplete => "OrgValidationComplete", - CertificateOrderActionType.SanDrop => "SanDrop", - CertificateOrderActionType.FraudCleared => "FraudCleared", - CertificateOrderActionType.CertificateExpired => "CertificateExpired", - CertificateOrderActionType.CertificateExpirationWarning => "CertificateExpirationWarning", - CertificateOrderActionType.FraudDocumentationRequired => "FraudDocumentationRequired", - CertificateOrderActionType.Unknown => "Unknown", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateOrderActionType value.") - }; - - public static CertificateOrderActionType ToCertificateOrderActionType(this string value) - { - if (string.Equals(value, "CertificateIssued", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.CertificateIssued; - if (string.Equals(value, "CertificateOrderCanceled", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.CertificateOrderCanceled; - if (string.Equals(value, "CertificateOrderCreated", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.CertificateOrderCreated; - if (string.Equals(value, "CertificateRevoked", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.CertificateRevoked; - if (string.Equals(value, "DomainValidationComplete", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.DomainValidationComplete; - if (string.Equals(value, "FraudDetected", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.FraudDetected; - if (string.Equals(value, "OrgNameChange", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.OrgNameChange; - if (string.Equals(value, "OrgValidationComplete", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.OrgValidationComplete; - if (string.Equals(value, "SanDrop", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.SanDrop; - if (string.Equals(value, "FraudCleared", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.FraudCleared; - if (string.Equals(value, "CertificateExpired", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.CertificateExpired; - if (string.Equals(value, "CertificateExpirationWarning", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.CertificateExpirationWarning; - if (string.Equals(value, "FraudDocumentationRequired", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.FraudDocumentationRequired; - if (string.Equals(value, "Unknown", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderActionType.Unknown; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateOrderActionType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.cs index 7cdff7e605a2..6ada766d33f4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderActionType.cs @@ -1,42 +1,132 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Action type. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for CertificateOrderActionType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum CertificateOrderActionType { - /// CertificateIssued. + [EnumMember(Value = "CertificateIssued")] CertificateIssued, - /// CertificateOrderCanceled. + [EnumMember(Value = "CertificateOrderCanceled")] CertificateOrderCanceled, - /// CertificateOrderCreated. + [EnumMember(Value = "CertificateOrderCreated")] CertificateOrderCreated, - /// CertificateRevoked. + [EnumMember(Value = "CertificateRevoked")] CertificateRevoked, - /// DomainValidationComplete. + [EnumMember(Value = "DomainValidationComplete")] DomainValidationComplete, - /// FraudDetected. + [EnumMember(Value = "FraudDetected")] FraudDetected, - /// OrgNameChange. + [EnumMember(Value = "OrgNameChange")] OrgNameChange, - /// OrgValidationComplete. + [EnumMember(Value = "OrgValidationComplete")] OrgValidationComplete, - /// SanDrop. + [EnumMember(Value = "SanDrop")] SanDrop, - /// FraudCleared. + [EnumMember(Value = "FraudCleared")] FraudCleared, - /// CertificateExpired. + [EnumMember(Value = "CertificateExpired")] CertificateExpired, - /// CertificateExpirationWarning. + [EnumMember(Value = "CertificateExpirationWarning")] CertificateExpirationWarning, - /// FraudDocumentationRequired. + [EnumMember(Value = "FraudDocumentationRequired")] FraudDocumentationRequired, - /// Unknown. + [EnumMember(Value = "Unknown")] Unknown } + internal static class CertificateOrderActionTypeEnumExtension + { + internal static string ToSerializedValue(this CertificateOrderActionType? value) + { + return value == null ? null : ((CertificateOrderActionType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this CertificateOrderActionType value) + { + switch( value ) + { + case CertificateOrderActionType.CertificateIssued: + return "CertificateIssued"; + case CertificateOrderActionType.CertificateOrderCanceled: + return "CertificateOrderCanceled"; + case CertificateOrderActionType.CertificateOrderCreated: + return "CertificateOrderCreated"; + case CertificateOrderActionType.CertificateRevoked: + return "CertificateRevoked"; + case CertificateOrderActionType.DomainValidationComplete: + return "DomainValidationComplete"; + case CertificateOrderActionType.FraudDetected: + return "FraudDetected"; + case CertificateOrderActionType.OrgNameChange: + return "OrgNameChange"; + case CertificateOrderActionType.OrgValidationComplete: + return "OrgValidationComplete"; + case CertificateOrderActionType.SanDrop: + return "SanDrop"; + case CertificateOrderActionType.FraudCleared: + return "FraudCleared"; + case CertificateOrderActionType.CertificateExpired: + return "CertificateExpired"; + case CertificateOrderActionType.CertificateExpirationWarning: + return "CertificateExpirationWarning"; + case CertificateOrderActionType.FraudDocumentationRequired: + return "FraudDocumentationRequired"; + case CertificateOrderActionType.Unknown: + return "Unknown"; + } + return null; + } + + internal static CertificateOrderActionType? ParseCertificateOrderActionType(this string value) + { + switch( value ) + { + case "CertificateIssued": + return CertificateOrderActionType.CertificateIssued; + case "CertificateOrderCanceled": + return CertificateOrderActionType.CertificateOrderCanceled; + case "CertificateOrderCreated": + return CertificateOrderActionType.CertificateOrderCreated; + case "CertificateRevoked": + return CertificateOrderActionType.CertificateRevoked; + case "DomainValidationComplete": + return CertificateOrderActionType.DomainValidationComplete; + case "FraudDetected": + return CertificateOrderActionType.FraudDetected; + case "OrgNameChange": + return CertificateOrderActionType.OrgNameChange; + case "OrgValidationComplete": + return CertificateOrderActionType.OrgValidationComplete; + case "SanDrop": + return CertificateOrderActionType.SanDrop; + case "FraudCleared": + return CertificateOrderActionType.FraudCleared; + case "CertificateExpired": + return CertificateOrderActionType.CertificateExpired; + case "CertificateExpirationWarning": + return CertificateOrderActionType.CertificateExpirationWarning; + case "FraudDocumentationRequired": + return CertificateOrderActionType.FraudDocumentationRequired; + case "Unknown": + return CertificateOrderActionType.Unknown; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.Serialization.cs deleted file mode 100644 index 8f71676d9913..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CertificateOrderContact - { - internal static CertificateOrderContact DeserializeCertificateOrderContact(JsonElement element) - { - Optional email = default; - Optional nameFirst = default; - Optional nameLast = default; - Optional phone = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("email")) - { - email = property.Value.GetString(); - continue; - } - if (property.NameEquals("nameFirst")) - { - nameFirst = property.Value.GetString(); - continue; - } - if (property.NameEquals("nameLast")) - { - nameLast = property.Value.GetString(); - continue; - } - if (property.NameEquals("phone")) - { - phone = property.Value.GetString(); - continue; - } - } - return new CertificateOrderContact(email.Value, nameFirst.Value, nameLast.Value, phone.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs deleted file mode 100644 index d59e113f695d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The CertificateOrderContact. - public partial class CertificateOrderContact - { - /// Initializes a new instance of CertificateOrderContact. - internal CertificateOrderContact() - { - } - - /// Initializes a new instance of CertificateOrderContact. - /// . - /// . - /// . - /// . - internal CertificateOrderContact(string email, string nameFirst, string nameLast, string phone) - { - Email = email; - NameFirst = nameFirst; - NameLast = nameLast; - Phone = phone; - } - - public string Email { get; } - public string NameFirst { get; } - public string NameLast { get; } - public string Phone { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.Serialization.cs deleted file mode 100644 index 79b6a36e21a9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class CertificateOrderStatusExtensions - { - public static string ToSerialString(this CertificateOrderStatus value) => value switch - { - CertificateOrderStatus.Pendingissuance => "Pendingissuance", - CertificateOrderStatus.Issued => "Issued", - CertificateOrderStatus.Revoked => "Revoked", - CertificateOrderStatus.Canceled => "Canceled", - CertificateOrderStatus.Denied => "Denied", - CertificateOrderStatus.Pendingrevocation => "Pendingrevocation", - CertificateOrderStatus.PendingRekey => "PendingRekey", - CertificateOrderStatus.Unused => "Unused", - CertificateOrderStatus.Expired => "Expired", - CertificateOrderStatus.NotSubmitted => "NotSubmitted", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateOrderStatus value.") - }; - - public static CertificateOrderStatus ToCertificateOrderStatus(this string value) - { - if (string.Equals(value, "Pendingissuance", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Pendingissuance; - if (string.Equals(value, "Issued", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Issued; - if (string.Equals(value, "Revoked", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Revoked; - if (string.Equals(value, "Canceled", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Canceled; - if (string.Equals(value, "Denied", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Denied; - if (string.Equals(value, "Pendingrevocation", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Pendingrevocation; - if (string.Equals(value, "PendingRekey", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.PendingRekey; - if (string.Equals(value, "Unused", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Unused; - if (string.Equals(value, "Expired", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.Expired; - if (string.Equals(value, "NotSubmitted", StringComparison.InvariantCultureIgnoreCase)) return CertificateOrderStatus.NotSubmitted; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateOrderStatus value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.cs index 5d7da3418885..47bd350eb582 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderStatus.cs @@ -1,34 +1,108 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Current order status. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for CertificateOrderStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum CertificateOrderStatus { - /// Pendingissuance. + [EnumMember(Value = "Pendingissuance")] Pendingissuance, - /// Issued. + [EnumMember(Value = "Issued")] Issued, - /// Revoked. + [EnumMember(Value = "Revoked")] Revoked, - /// Canceled. + [EnumMember(Value = "Canceled")] Canceled, - /// Denied. + [EnumMember(Value = "Denied")] Denied, - /// Pendingrevocation. + [EnumMember(Value = "Pendingrevocation")] Pendingrevocation, - /// PendingRekey. + [EnumMember(Value = "PendingRekey")] PendingRekey, - /// Unused. + [EnumMember(Value = "Unused")] Unused, - /// Expired. + [EnumMember(Value = "Expired")] Expired, - /// NotSubmitted. + [EnumMember(Value = "NotSubmitted")] NotSubmitted } + internal static class CertificateOrderStatusEnumExtension + { + internal static string ToSerializedValue(this CertificateOrderStatus? value) + { + return value == null ? null : ((CertificateOrderStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this CertificateOrderStatus value) + { + switch( value ) + { + case CertificateOrderStatus.Pendingissuance: + return "Pendingissuance"; + case CertificateOrderStatus.Issued: + return "Issued"; + case CertificateOrderStatus.Revoked: + return "Revoked"; + case CertificateOrderStatus.Canceled: + return "Canceled"; + case CertificateOrderStatus.Denied: + return "Denied"; + case CertificateOrderStatus.Pendingrevocation: + return "Pendingrevocation"; + case CertificateOrderStatus.PendingRekey: + return "PendingRekey"; + case CertificateOrderStatus.Unused: + return "Unused"; + case CertificateOrderStatus.Expired: + return "Expired"; + case CertificateOrderStatus.NotSubmitted: + return "NotSubmitted"; + } + return null; + } + + internal static CertificateOrderStatus? ParseCertificateOrderStatus(this string value) + { + switch( value ) + { + case "Pendingissuance": + return CertificateOrderStatus.Pendingissuance; + case "Issued": + return CertificateOrderStatus.Issued; + case "Revoked": + return CertificateOrderStatus.Revoked; + case "Canceled": + return CertificateOrderStatus.Canceled; + case "Denied": + return CertificateOrderStatus.Denied; + case "Pendingrevocation": + return CertificateOrderStatus.Pendingrevocation; + case "PendingRekey": + return CertificateOrderStatus.PendingRekey; + case "Unused": + return CertificateOrderStatus.Unused; + case "Expired": + return CertificateOrderStatus.Expired; + case "NotSubmitted": + return CertificateOrderStatus.NotSubmitted; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.Serialization.cs deleted file mode 100644 index 9e2bc0e3f279..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.Serialization.cs +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CertificatePatchResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Password)) - { - writer.WritePropertyName("password"); - writer.WriteStringValue(Password); - } - if (Optional.IsCollectionDefined(HostNames)) - { - writer.WritePropertyName("hostNames"); - writer.WriteStartArray(); - foreach (var item in HostNames) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(PfxBlob)) - { - writer.WritePropertyName("pfxBlob"); - writer.WriteBase64StringValue(PfxBlob, "D"); - } - if (Optional.IsDefined(KeyVaultId)) - { - writer.WritePropertyName("keyVaultId"); - writer.WriteStringValue(KeyVaultId); - } - if (Optional.IsDefined(KeyVaultSecretName)) - { - writer.WritePropertyName("keyVaultSecretName"); - writer.WriteStringValue(KeyVaultSecretName); - } - if (Optional.IsDefined(ServerFarmId)) - { - writer.WritePropertyName("serverFarmId"); - writer.WriteStringValue(ServerFarmId); - } - if (Optional.IsDefined(CanonicalName)) - { - writer.WritePropertyName("canonicalName"); - writer.WriteStringValue(CanonicalName); - } - if (Optional.IsDefined(DomainValidationMethod)) - { - writer.WritePropertyName("domainValidationMethod"); - writer.WriteStringValue(DomainValidationMethod); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static CertificatePatchResource DeserializeCertificatePatchResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional password = default; - Optional friendlyName = default; - Optional subjectName = default; - Optional> hostNames = default; - Optional pfxBlob = default; - Optional siteName = default; - Optional selfLink = default; - Optional issuer = default; - Optional issueDate = default; - Optional expirationDate = default; - Optional thumbprint = default; - Optional valid = default; - Optional cerBlob = default; - Optional publicKeyHash = default; - Optional hostingEnvironmentProfile = default; - Optional keyVaultId = default; - Optional keyVaultSecretName = default; - Optional keyVaultSecretStatus = default; - Optional serverFarmId = default; - Optional canonicalName = default; - Optional domainValidationMethod = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("password")) - { - password = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("friendlyName")) - { - friendlyName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("subjectName")) - { - subjectName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - hostNames = array; - continue; - } - if (property0.NameEquals("pfxBlob")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - pfxBlob = property0.Value.GetBytesFromBase64("D"); - continue; - } - if (property0.NameEquals("siteName")) - { - siteName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("selfLink")) - { - selfLink = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("issuer")) - { - issuer = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("issueDate")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - issueDate = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("expirationDate")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - expirationDate = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("thumbprint")) - { - thumbprint = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("valid")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - valid = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("cerBlob")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - cerBlob = property0.Value.GetBytesFromBase64("D"); - continue; - } - if (property0.NameEquals("publicKeyHash")) - { - publicKeyHash = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostingEnvironmentProfile")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); - continue; - } - if (property0.NameEquals("keyVaultId")) - { - keyVaultId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("keyVaultSecretName")) - { - keyVaultSecretName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("keyVaultSecretStatus")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - keyVaultSecretStatus = property0.Value.GetString().ToKeyVaultSecretStatus(); - continue; - } - if (property0.NameEquals("serverFarmId")) - { - serverFarmId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("canonicalName")) - { - canonicalName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("domainValidationMethod")) - { - domainValidationMethod = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new CertificatePatchResource(id.Value, name.Value, kind.Value, type.Value, password.Value, friendlyName.Value, subjectName.Value, Optional.ToList(hostNames), pfxBlob.Value, siteName.Value, selfLink.Value, issuer.Value, Optional.ToNullable(issueDate), Optional.ToNullable(expirationDate), thumbprint.Value, Optional.ToNullable(valid), cerBlob.Value, publicKeyHash.Value, hostingEnvironmentProfile.Value, keyVaultId.Value, keyVaultSecretName.Value, Optional.ToNullable(keyVaultSecretStatus), serverFarmId.Value, canonicalName.Value, domainValidationMethod.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs index 4d7e6ca0b5c5..f2579bd985bc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs @@ -1,54 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// ARM resource for a certificate. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// ARM resource for a certificate. + /// + [Rest.Serialization.JsonTransformation] public partial class CertificatePatchResource : ProxyOnlyResource { - /// Initializes a new instance of CertificatePatchResource. + /// + /// Initializes a new instance of the CertificatePatchResource class. + /// public CertificatePatchResource() { - HostNames = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of CertificatePatchResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Certificate password. - /// Friendly name of the certificate. - /// Subject name of the certificate. - /// Host names the certificate applies to. - /// Pfx blob. - /// App name. - /// Self link. - /// Certificate issuer. - /// Certificate issue Date. - /// Certificate expiration date. - /// Certificate thumbprint. - /// Is the certificate valid?. - /// Raw bytes of .cer file. - /// Public key hash. - /// Specification for the App Service Environment to use for the certificate. - /// Key Vault Csm resource Id. - /// Key Vault secret name. - /// Status of the Key Vault secret. - /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - /// CNAME of the certificate to be issued via free certificate. - /// Method of domain validation for free cert. - internal CertificatePatchResource(string id, string name, string kind, string type, string password, string friendlyName, string subjectName, IList hostNames, byte[] pfxBlob, string siteName, string selfLink, string issuer, DateTimeOffset? issueDate, DateTimeOffset? expirationDate, string thumbprint, bool? valid, byte[] cerBlob, string publicKeyHash, HostingEnvironmentProfile hostingEnvironmentProfile, string keyVaultId, string keyVaultSecretName, KeyVaultSecretStatus? keyVaultSecretStatus, string serverFarmId, string canonicalName, string domainValidationMethod) : base(id, name, kind, type) + /// + /// Initializes a new instance of the CertificatePatchResource class. + /// + /// Certificate password. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Friendly name of the + /// certificate. + /// Subject name of the certificate. + /// Host names the certificate applies + /// to. + /// Pfx blob. + /// App name. + /// Self link. + /// Certificate issuer. + /// Certificate issue Date. + /// Certificate expiration date. + /// Certificate thumbprint. + /// Is the certificate valid?. + /// Raw bytes of .cer file + /// Public key hash. + /// Specification for the App + /// Service Environment to use for the certificate. + /// Key Vault Csm resource Id. + /// Key Vault secret name. + /// Status of the Key Vault secret. + /// Possible values include: 'Initialized', + /// 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', + /// 'OperationNotPermittedOnKeyVault', + /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + /// 'Unknown' + /// Resource ID of the associated App + /// Service plan, formatted as: + /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + /// CNAME of the certificate to be issued + /// via free certificate + public CertificatePatchResource(string password, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string)) + : base(id, name, kind, type) { - Password = password; FriendlyName = friendlyName; SubjectName = subjectName; HostNames = hostNames; @@ -58,6 +82,7 @@ internal CertificatePatchResource(string id, string name, string kind, string ty Issuer = issuer; IssueDate = issueDate; ExpirationDate = expirationDate; + Password = password; Thumbprint = thumbprint; Valid = valid; CerBlob = cerBlob; @@ -68,50 +93,155 @@ internal CertificatePatchResource(string id, string name, string kind, string ty KeyVaultSecretStatus = keyVaultSecretStatus; ServerFarmId = serverFarmId; CanonicalName = canonicalName; - DomainValidationMethod = domainValidationMethod; + CustomInit(); } - /// Certificate password. - public string Password { get; set; } - /// Friendly name of the certificate. - public string FriendlyName { get; } - /// Subject name of the certificate. - public string SubjectName { get; } - /// Host names the certificate applies to. - public IList HostNames { get; } - /// Pfx blob. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets friendly name of the certificate. + /// + [JsonProperty(PropertyName = "properties.friendlyName")] + public string FriendlyName { get; private set; } + + /// + /// Gets subject name of the certificate. + /// + [JsonProperty(PropertyName = "properties.subjectName")] + public string SubjectName { get; private set; } + + /// + /// Gets or sets host names the certificate applies to. + /// + [JsonProperty(PropertyName = "properties.hostNames")] + public IList HostNames { get; set; } + + /// + /// Gets or sets pfx blob. + /// + [JsonProperty(PropertyName = "properties.pfxBlob")] public byte[] PfxBlob { get; set; } - /// App name. - public string SiteName { get; } - /// Self link. - public string SelfLink { get; } - /// Certificate issuer. - public string Issuer { get; } - /// Certificate issue Date. - public DateTimeOffset? IssueDate { get; } - /// Certificate expiration date. - public DateTimeOffset? ExpirationDate { get; } - /// Certificate thumbprint. - public string Thumbprint { get; } - /// Is the certificate valid?. - public bool? Valid { get; } - /// Raw bytes of .cer file. - public byte[] CerBlob { get; } - /// Public key hash. - public string PublicKeyHash { get; } - /// Specification for the App Service Environment to use for the certificate. - public HostingEnvironmentProfile HostingEnvironmentProfile { get; } - /// Key Vault Csm resource Id. + + /// + /// Gets app name. + /// + [JsonProperty(PropertyName = "properties.siteName")] + public string SiteName { get; private set; } + + /// + /// Gets self link. + /// + [JsonProperty(PropertyName = "properties.selfLink")] + public string SelfLink { get; private set; } + + /// + /// Gets certificate issuer. + /// + [JsonProperty(PropertyName = "properties.issuer")] + public string Issuer { get; private set; } + + /// + /// Gets certificate issue Date. + /// + [JsonProperty(PropertyName = "properties.issueDate")] + public System.DateTime? IssueDate { get; private set; } + + /// + /// Gets certificate expiration date. + /// + [JsonProperty(PropertyName = "properties.expirationDate")] + public System.DateTime? ExpirationDate { get; private set; } + + /// + /// Gets or sets certificate password. + /// + [JsonProperty(PropertyName = "properties.password")] + public string Password { get; set; } + + /// + /// Gets certificate thumbprint. + /// + [JsonProperty(PropertyName = "properties.thumbprint")] + public string Thumbprint { get; private set; } + + /// + /// Gets is the certificate valid?. + /// + [JsonProperty(PropertyName = "properties.valid")] + public bool? Valid { get; private set; } + + /// + /// Gets raw bytes of .cer file + /// + [JsonProperty(PropertyName = "properties.cerBlob")] + public byte[] CerBlob { get; private set; } + + /// + /// Gets public key hash. + /// + [JsonProperty(PropertyName = "properties.publicKeyHash")] + public string PublicKeyHash { get; private set; } + + /// + /// Gets specification for the App Service Environment to use for the + /// certificate. + /// + [JsonProperty(PropertyName = "properties.hostingEnvironmentProfile")] + public HostingEnvironmentProfile HostingEnvironmentProfile { get; private set; } + + /// + /// Gets or sets key Vault Csm resource Id. + /// + [JsonProperty(PropertyName = "properties.keyVaultId")] public string KeyVaultId { get; set; } - /// Key Vault secret name. + + /// + /// Gets or sets key Vault secret name. + /// + [JsonProperty(PropertyName = "properties.keyVaultSecretName")] public string KeyVaultSecretName { get; set; } - /// Status of the Key Vault secret. - public KeyVaultSecretStatus? KeyVaultSecretStatus { get; } - /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + + /// + /// Gets status of the Key Vault secret. Possible values include: + /// 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', + /// 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + /// 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + /// 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + /// 'Unknown' + /// + [JsonProperty(PropertyName = "properties.keyVaultSecretStatus")] + public KeyVaultSecretStatus? KeyVaultSecretStatus { get; private set; } + + /// + /// Gets or sets resource ID of the associated App Service plan, + /// formatted as: + /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + /// + [JsonProperty(PropertyName = "properties.serverFarmId")] public string ServerFarmId { get; set; } - /// CNAME of the certificate to be issued via free certificate. + + /// + /// Gets or sets CNAME of the certificate to be issued via free + /// certificate + /// + [JsonProperty(PropertyName = "properties.canonicalName")] public string CanonicalName { get; set; } - /// Method of domain validation for free cert. - public string DomainValidationMethod { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Password == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Password"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.Serialization.cs deleted file mode 100644 index 365bfbdd1b04..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class CertificateProductTypeExtensions - { - public static string ToSerialString(this CertificateProductType value) => value switch - { - CertificateProductType.StandardDomainValidatedSsl => "StandardDomainValidatedSsl", - CertificateProductType.StandardDomainValidatedWildCardSsl => "StandardDomainValidatedWildCardSsl", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateProductType value.") - }; - - public static CertificateProductType ToCertificateProductType(this string value) - { - if (string.Equals(value, "StandardDomainValidatedSsl", StringComparison.InvariantCultureIgnoreCase)) return CertificateProductType.StandardDomainValidatedSsl; - if (string.Equals(value, "StandardDomainValidatedWildCardSsl", StringComparison.InvariantCultureIgnoreCase)) return CertificateProductType.StandardDomainValidatedWildCardSsl; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CertificateProductType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.cs index 37db093b8507..218a545ac0ee 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateProductType.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Certificate product type. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for CertificateProductType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum CertificateProductType { - /// StandardDomainValidatedSsl. + [EnumMember(Value = "StandardDomainValidatedSsl")] StandardDomainValidatedSsl, - /// StandardDomainValidatedWildCardSsl. + [EnumMember(Value = "StandardDomainValidatedWildCardSsl")] StandardDomainValidatedWildCardSsl } + internal static class CertificateProductTypeEnumExtension + { + internal static string ToSerializedValue(this CertificateProductType? value) + { + return value == null ? null : ((CertificateProductType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this CertificateProductType value) + { + switch( value ) + { + case CertificateProductType.StandardDomainValidatedSsl: + return "StandardDomainValidatedSsl"; + case CertificateProductType.StandardDomainValidatedWildCardSsl: + return "StandardDomainValidatedWildCardSsl"; + } + return null; + } + + internal static CertificateProductType? ParseCertificateProductType(this string value) + { + switch( value ) + { + case "StandardDomainValidatedSsl": + return CertificateProductType.StandardDomainValidatedSsl; + case "StandardDomainValidatedWildCardSsl": + return CertificateProductType.StandardDomainValidatedWildCardSsl; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.Serialization.cs deleted file mode 100644 index a0acb8deaaf9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class ChannelsExtensions - { - public static string ToSerialString(this Channels value) => value switch - { - Channels.Notification => "Notification", - Channels.Api => "Api", - Channels.Email => "Email", - Channels.Webhook => "Webhook", - Channels.All => "All", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Channels value.") - }; - - public static Channels ToChannels(this string value) - { - if (string.Equals(value, "Notification", StringComparison.InvariantCultureIgnoreCase)) return Channels.Notification; - if (string.Equals(value, "Api", StringComparison.InvariantCultureIgnoreCase)) return Channels.Api; - if (string.Equals(value, "Email", StringComparison.InvariantCultureIgnoreCase)) return Channels.Email; - if (string.Equals(value, "Webhook", StringComparison.InvariantCultureIgnoreCase)) return Channels.Webhook; - if (string.Equals(value, "All", StringComparison.InvariantCultureIgnoreCase)) return Channels.All; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Channels value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.cs index b4ed6f6ec535..509a07710bdf 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Channels.cs @@ -1,24 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// List of channels that this recommendation can apply. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for Channels. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum Channels { - /// Notification. + [EnumMember(Value = "Notification")] Notification, - /// Api. + [EnumMember(Value = "Api")] Api, - /// Email. + [EnumMember(Value = "Email")] Email, - /// Webhook. + [EnumMember(Value = "Webhook")] Webhook, - /// All. + [EnumMember(Value = "All")] All } + internal static class ChannelsEnumExtension + { + internal static string ToSerializedValue(this Channels? value) + { + return value == null ? null : ((Channels)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this Channels value) + { + switch( value ) + { + case Channels.Notification: + return "Notification"; + case Channels.Api: + return "Api"; + case Channels.Email: + return "Email"; + case Channels.Webhook: + return "Webhook"; + case Channels.All: + return "All"; + } + return null; + } + + internal static Channels? ParseChannels(this string value) + { + switch( value ) + { + case "Notification": + return Channels.Notification; + case "Api": + return Channels.Api; + case "Email": + return Channels.Email; + case "Webhook": + return Channels.Webhook; + case "All": + return Channels.All; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CheckNameResourceTypes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CheckNameResourceTypes.cs index 1aec6905ab01..b13b8d8adcc4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CheckNameResourceTypes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CheckNameResourceTypes.cs @@ -1,69 +1,28 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// Resource type used for verification. - public readonly partial struct CheckNameResourceTypes : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public CheckNameResourceTypes(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string SiteValue = "Site"; - private const string SlotValue = "Slot"; - private const string HostingEnvironmentValue = "HostingEnvironment"; - private const string PublishingUserValue = "PublishingUser"; - private const string MicrosoftWebSitesValue = "Microsoft.Web/sites"; - private const string MicrosoftWebSitesSlotsValue = "Microsoft.Web/sites/slots"; - private const string MicrosoftWebHostingEnvironmentsValue = "Microsoft.Web/hostingEnvironments"; - private const string MicrosoftWebPublishingUsersValue = "Microsoft.Web/publishingUsers"; - - /// Site. - public static CheckNameResourceTypes Site { get; } = new CheckNameResourceTypes(SiteValue); - /// Slot. - public static CheckNameResourceTypes Slot { get; } = new CheckNameResourceTypes(SlotValue); - /// HostingEnvironment. - public static CheckNameResourceTypes HostingEnvironment { get; } = new CheckNameResourceTypes(HostingEnvironmentValue); - /// PublishingUser. - public static CheckNameResourceTypes PublishingUser { get; } = new CheckNameResourceTypes(PublishingUserValue); - /// Microsoft.Web/sites. - public static CheckNameResourceTypes MicrosoftWebSites { get; } = new CheckNameResourceTypes(MicrosoftWebSitesValue); - /// Microsoft.Web/sites/slots. - public static CheckNameResourceTypes MicrosoftWebSitesSlots { get; } = new CheckNameResourceTypes(MicrosoftWebSitesSlotsValue); - /// Microsoft.Web/hostingEnvironments. - public static CheckNameResourceTypes MicrosoftWebHostingEnvironments { get; } = new CheckNameResourceTypes(MicrosoftWebHostingEnvironmentsValue); - /// Microsoft.Web/publishingUsers. - public static CheckNameResourceTypes MicrosoftWebPublishingUsers { get; } = new CheckNameResourceTypes(MicrosoftWebPublishingUsersValue); - /// Determines if two values are the same. - public static bool operator ==(CheckNameResourceTypes left, CheckNameResourceTypes right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CheckNameResourceTypes left, CheckNameResourceTypes right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator CheckNameResourceTypes(string value) => new CheckNameResourceTypes(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CheckNameResourceTypes other && Equals(other); - /// - public bool Equals(CheckNameResourceTypes other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for CheckNameResourceTypes. + /// + public static class CheckNameResourceTypes + { + public const string Site = "Site"; + public const string Slot = "Slot"; + public const string HostingEnvironment = "HostingEnvironment"; + public const string PublishingUser = "PublishingUser"; + public const string MicrosoftWebSites = "Microsoft.Web/sites"; + public const string MicrosoftWebSitesSlots = "Microsoft.Web/sites/slots"; + public const string MicrosoftWebHostingEnvironments = "Microsoft.Web/hostingEnvironments"; + public const string MicrosoftWebPublishingUsers = "Microsoft.Web/publishingUsers"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.Serialization.cs deleted file mode 100644 index d601a4e5a596..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class ClientCertModeExtensions - { - public static string ToSerialString(this ClientCertMode value) => value switch - { - ClientCertMode.Required => "Required", - ClientCertMode.Optional => "Optional", - ClientCertMode.OptionalInteractiveUser => "OptionalInteractiveUser", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ClientCertMode value.") - }; - - public static ClientCertMode ToClientCertMode(this string value) - { - if (string.Equals(value, "Required", StringComparison.InvariantCultureIgnoreCase)) return ClientCertMode.Required; - if (string.Equals(value, "Optional", StringComparison.InvariantCultureIgnoreCase)) return ClientCertMode.Optional; - if (string.Equals(value, "OptionalInteractiveUser", StringComparison.InvariantCultureIgnoreCase)) return ClientCertMode.OptionalInteractiveUser; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ClientCertMode value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs index 359687cb657e..422855315598 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs @@ -1,25 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + /// - /// This composes with ClientCertEnabled setting. - /// - ClientCertEnabled: false means ClientCert is ignored. - /// - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. - /// - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. + /// Defines values for ClientCertMode. /// + [JsonConverter(typeof(StringEnumConverter))] public enum ClientCertMode { - /// Required. + [EnumMember(Value = "Required")] Required, - /// Optional. - Optional, - /// OptionalInteractiveUser. - OptionalInteractiveUser + [EnumMember(Value = "Optional")] + Optional + } + internal static class ClientCertModeEnumExtension + { + internal static string ToSerializedValue(this ClientCertMode? value) + { + return value == null ? null : ((ClientCertMode)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ClientCertMode value) + { + switch( value ) + { + case ClientCertMode.Required: + return "Required"; + case ClientCertMode.Optional: + return "Optional"; + } + return null; + } + + internal static ClientCertMode? ParseClientCertMode(this string value) + { + switch( value ) + { + case "Required": + return ClientCertMode.Required; + case "Optional": + return ClientCertMode.Optional; + } + return null; + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.Serialization.cs deleted file mode 100644 index 0b0b0e6ac25e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.Serialization.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ClientRegistration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ClientId)) - { - writer.WritePropertyName("clientId"); - writer.WriteStringValue(ClientId); - } - if (Optional.IsDefined(ClientSecretSettingName)) - { - writer.WritePropertyName("clientSecretSettingName"); - writer.WriteStringValue(ClientSecretSettingName); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ClientRegistration DeserializeClientRegistration(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional clientId = default; - Optional clientSecretSettingName = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("clientId")) - { - clientId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("clientSecretSettingName")) - { - clientSecretSettingName = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new ClientRegistration(id.Value, name.Value, kind.Value, type.Value, clientId.Value, clientSecretSettingName.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.cs index b64a39ea0ec8..516e1eda692c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.cs @@ -1,36 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the app registration for providers that have client ids and client secrets. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class ClientRegistration : ProxyOnlyResource { - /// Initializes a new instance of ClientRegistration. + /// + /// Initializes a new instance of the ClientRegistration class. + /// public ClientRegistration() { + CustomInit(); } - /// Initializes a new instance of ClientRegistration. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Client ID of the app used for login. - /// The app setting name that contains the client secret. - internal ClientRegistration(string id, string name, string kind, string type, string clientId, string clientSecretSettingName) : base(id, name, kind, type) + /// + /// Initializes a new instance of the ClientRegistration class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public ClientRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string clientId = default(string), string clientSecretSettingName = default(string)) + : base(id, name, kind, type) { ClientId = clientId; ClientSecretSettingName = clientSecretSettingName; + CustomInit(); } - /// The Client ID of the app used for login. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.clientId")] public string ClientId { get; set; } - /// The app setting name that contains the client secret. + + /// + /// + [JsonProperty(PropertyName = "properties.clientSecretSettingName")] public string ClientSecretSettingName { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.Serialization.cs deleted file mode 100644 index 3a59a8760746..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class CloneAbilityResultExtensions - { - public static string ToSerialString(this CloneAbilityResult value) => value switch - { - CloneAbilityResult.Cloneable => "Cloneable", - CloneAbilityResult.PartiallyCloneable => "PartiallyCloneable", - CloneAbilityResult.NotCloneable => "NotCloneable", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CloneAbilityResult value.") - }; - - public static CloneAbilityResult ToCloneAbilityResult(this string value) - { - if (string.Equals(value, "Cloneable", StringComparison.InvariantCultureIgnoreCase)) return CloneAbilityResult.Cloneable; - if (string.Equals(value, "PartiallyCloneable", StringComparison.InvariantCultureIgnoreCase)) return CloneAbilityResult.PartiallyCloneable; - if (string.Equals(value, "NotCloneable", StringComparison.InvariantCultureIgnoreCase)) return CloneAbilityResult.NotCloneable; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CloneAbilityResult value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.cs index 40e143b0a282..3555d8200dba 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloneAbilityResult.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Name of app. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for CloneAbilityResult. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum CloneAbilityResult { - /// Cloneable. + [EnumMember(Value = "Cloneable")] Cloneable, - /// PartiallyCloneable. + [EnumMember(Value = "PartiallyCloneable")] PartiallyCloneable, - /// NotCloneable. + [EnumMember(Value = "NotCloneable")] NotCloneable } + internal static class CloneAbilityResultEnumExtension + { + internal static string ToSerializedValue(this CloneAbilityResult? value) + { + return value == null ? null : ((CloneAbilityResult)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this CloneAbilityResult value) + { + switch( value ) + { + case CloneAbilityResult.Cloneable: + return "Cloneable"; + case CloneAbilityResult.PartiallyCloneable: + return "PartiallyCloneable"; + case CloneAbilityResult.NotCloneable: + return "NotCloneable"; + } + return null; + } + + internal static CloneAbilityResult? ParseCloneAbilityResult(this string value) + { + switch( value ) + { + case "Cloneable": + return CloneAbilityResult.Cloneable; + case "PartiallyCloneable": + return CloneAbilityResult.PartiallyCloneable; + case "NotCloneable": + return CloneAbilityResult.NotCloneable; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.Serialization.cs deleted file mode 100644 index ff456e4c7ee2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.Serialization.cs +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CloningInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CorrelationId)) - { - writer.WritePropertyName("correlationId"); - writer.WriteStringValue(CorrelationId.Value); - } - if (Optional.IsDefined(Overwrite)) - { - writer.WritePropertyName("overwrite"); - writer.WriteBooleanValue(Overwrite.Value); - } - if (Optional.IsDefined(CloneCustomHostNames)) - { - writer.WritePropertyName("cloneCustomHostNames"); - writer.WriteBooleanValue(CloneCustomHostNames.Value); - } - if (Optional.IsDefined(CloneSourceControl)) - { - writer.WritePropertyName("cloneSourceControl"); - writer.WriteBooleanValue(CloneSourceControl.Value); - } - writer.WritePropertyName("sourceWebAppId"); - writer.WriteStringValue(SourceWebAppId); - if (Optional.IsDefined(SourceWebAppLocation)) - { - writer.WritePropertyName("sourceWebAppLocation"); - writer.WriteStringValue(SourceWebAppLocation); - } - if (Optional.IsDefined(HostingEnvironment)) - { - writer.WritePropertyName("hostingEnvironment"); - writer.WriteStringValue(HostingEnvironment); - } - if (Optional.IsCollectionDefined(AppSettingsOverrides)) - { - writer.WritePropertyName("appSettingsOverrides"); - writer.WriteStartObject(); - foreach (var item in AppSettingsOverrides) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(ConfigureLoadBalancing)) - { - writer.WritePropertyName("configureLoadBalancing"); - writer.WriteBooleanValue(ConfigureLoadBalancing.Value); - } - if (Optional.IsDefined(TrafficManagerProfileId)) - { - writer.WritePropertyName("trafficManagerProfileId"); - writer.WriteStringValue(TrafficManagerProfileId); - } - if (Optional.IsDefined(TrafficManagerProfileName)) - { - writer.WritePropertyName("trafficManagerProfileName"); - writer.WriteStringValue(TrafficManagerProfileName); - } - writer.WriteEndObject(); - } - - internal static CloningInfo DeserializeCloningInfo(JsonElement element) - { - Optional correlationId = default; - Optional overwrite = default; - Optional cloneCustomHostNames = default; - Optional cloneSourceControl = default; - string sourceWebAppId = default; - Optional sourceWebAppLocation = default; - Optional hostingEnvironment = default; - Optional> appSettingsOverrides = default; - Optional configureLoadBalancing = default; - Optional trafficManagerProfileId = default; - Optional trafficManagerProfileName = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("correlationId")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - correlationId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("overwrite")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - overwrite = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("cloneCustomHostNames")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - cloneCustomHostNames = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("cloneSourceControl")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - cloneSourceControl = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("sourceWebAppId")) - { - sourceWebAppId = property.Value.GetString(); - continue; - } - if (property.NameEquals("sourceWebAppLocation")) - { - sourceWebAppLocation = property.Value.GetString(); - continue; - } - if (property.NameEquals("hostingEnvironment")) - { - hostingEnvironment = property.Value.GetString(); - continue; - } - if (property.NameEquals("appSettingsOverrides")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - appSettingsOverrides = dictionary; - continue; - } - if (property.NameEquals("configureLoadBalancing")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - configureLoadBalancing = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("trafficManagerProfileId")) - { - trafficManagerProfileId = property.Value.GetString(); - continue; - } - if (property.NameEquals("trafficManagerProfileName")) - { - trafficManagerProfileName = property.Value.GetString(); - continue; - } - } - return new CloningInfo(Optional.ToNullable(correlationId), Optional.ToNullable(overwrite), Optional.ToNullable(cloneCustomHostNames), Optional.ToNullable(cloneSourceControl), sourceWebAppId, sourceWebAppLocation.Value, hostingEnvironment.Value, Optional.ToDictionary(appSettingsOverrides), Optional.ToNullable(configureLoadBalancing), trafficManagerProfileId.Value, trafficManagerProfileName.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.cs index 436aa76c80cc..173b4f376d33 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CloningInfo.cs @@ -1,63 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Information needed for cloning operation. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Information needed for cloning operation. + /// public partial class CloningInfo { - /// Initializes a new instance of CloningInfo. - /// - /// ARM resource ID of the source app. App resource ID is of the form - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. - /// - /// is null. - public CloningInfo(string sourceWebAppId) + /// + /// Initializes a new instance of the CloningInfo class. + /// + public CloningInfo() { - if (sourceWebAppId == null) - { - throw new ArgumentNullException(nameof(sourceWebAppId)); - } - - SourceWebAppId = sourceWebAppId; - AppSettingsOverrides = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of CloningInfo. - /// - /// Correlation ID of cloning operation. This ID ties multiple cloning operations - /// together to use the same snapshot. - /// - /// <code>true</code> to overwrite destination app; otherwise, <code>false</code>. - /// <code>true</code> to clone custom hostnames from source app; otherwise, <code>false</code>. - /// <code>true</code> to clone source control from source app; otherwise, <code>false</code>. - /// - /// ARM resource ID of the source app. App resource ID is of the form - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. - /// - /// Location of source app ex: West US or North Europe. - /// App Service Environment. - /// - /// Application setting overrides for cloned app. If specified, these settings override the settings cloned - /// from source app. Otherwise, application settings from source app are retained. - /// - /// <code>true</code> to configure load balancing for source and destination app. - /// - /// ARM resource ID of the Traffic Manager profile to use, if it exists. Traffic Manager resource ID is of the form - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. - /// - /// Name of Traffic Manager profile to create. This is only needed if Traffic Manager profile does not already exist. - internal CloningInfo(Guid? correlationId, bool? overwrite, bool? cloneCustomHostNames, bool? cloneSourceControl, string sourceWebAppId, string sourceWebAppLocation, string hostingEnvironment, IDictionary appSettingsOverrides, bool? configureLoadBalancing, string trafficManagerProfileId, string trafficManagerProfileName) + /// + /// Initializes a new instance of the CloningInfo class. + /// + /// ARM resource ID of the source app. App + /// resource ID is of the form + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + /// for production slots and + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + /// for other slots. + /// Correlation ID of cloning operation. + /// This ID ties multiple cloning operations + /// together to use the same snapshot. + /// <code>true</code> to overwrite + /// destination app; otherwise, <code>false</code>. + /// <code>true</code> to + /// clone custom hostnames from source app; otherwise, + /// <code>false</code>. + /// <code>true</code> to + /// clone source control from source app; otherwise, + /// <code>false</code>. + /// Location of source app ex: West + /// US or North Europe + /// App Service Environment. + /// Application setting overrides + /// for cloned app. If specified, these settings override the settings + /// cloned + /// from source app. Otherwise, application settings from source app + /// are retained. + /// <code>true</code> + /// to configure load balancing for source and destination app. + /// ARM resource ID of the + /// Traffic Manager profile to use, if it exists. Traffic Manager + /// resource ID is of the form + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + /// Name of Traffic Manager + /// profile to create. This is only needed if Traffic Manager profile + /// does not already exist. + public CloningInfo(string sourceWebAppId, System.Guid? correlationId = default(System.Guid?), bool? overwrite = default(bool?), bool? cloneCustomHostNames = default(bool?), bool? cloneSourceControl = default(bool?), string sourceWebAppLocation = default(string), string hostingEnvironment = default(string), IDictionary appSettingsOverrides = default(IDictionary), bool? configureLoadBalancing = default(bool?), string trafficManagerProfileId = default(string), string trafficManagerProfileName = default(string)) { CorrelationId = correlationId; Overwrite = overwrite; @@ -70,42 +79,112 @@ internal CloningInfo(Guid? correlationId, bool? overwrite, bool? cloneCustomHost ConfigureLoadBalancing = configureLoadBalancing; TrafficManagerProfileId = trafficManagerProfileId; TrafficManagerProfileName = trafficManagerProfileName; + CustomInit(); } /// - /// Correlation ID of cloning operation. This ID ties multiple cloning operations + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets correlation ID of cloning operation. This ID ties + /// multiple cloning operations /// together to use the same snapshot. /// - public Guid? CorrelationId { get; set; } - /// <code>true</code> to overwrite destination app; otherwise, <code>false</code>. + [JsonProperty(PropertyName = "correlationId")] + public System.Guid? CorrelationId { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// overwrite destination app; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "overwrite")] public bool? Overwrite { get; set; } - /// <code>true</code> to clone custom hostnames from source app; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to clone + /// custom hostnames from source app; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "cloneCustomHostNames")] public bool? CloneCustomHostNames { get; set; } - /// <code>true</code> to clone source control from source app; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to clone + /// source control from source app; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "cloneSourceControl")] public bool? CloneSourceControl { get; set; } + /// - /// ARM resource ID of the source app. App resource ID is of the form - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. + /// Gets or sets ARM resource ID of the source app. App resource ID is + /// of the form + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + /// for production slots and + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + /// for other slots. /// + [JsonProperty(PropertyName = "sourceWebAppId")] public string SourceWebAppId { get; set; } - /// Location of source app ex: West US or North Europe. + + /// + /// Gets or sets location of source app ex: West US or North Europe + /// + [JsonProperty(PropertyName = "sourceWebAppLocation")] public string SourceWebAppLocation { get; set; } - /// App Service Environment. + + /// + /// Gets or sets app Service Environment. + /// + [JsonProperty(PropertyName = "hostingEnvironment")] public string HostingEnvironment { get; set; } + + /// + /// Gets or sets application setting overrides for cloned app. If + /// specified, these settings override the settings cloned + /// from source app. Otherwise, application settings from source app + /// are retained. + /// + [JsonProperty(PropertyName = "appSettingsOverrides")] + public IDictionary AppSettingsOverrides { get; set; } + /// - /// Application setting overrides for cloned app. If specified, these settings override the settings cloned - /// from source app. Otherwise, application settings from source app are retained. + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// configure load balancing for source and destination app. /// - public IDictionary AppSettingsOverrides { get; } - /// <code>true</code> to configure load balancing for source and destination app. + [JsonProperty(PropertyName = "configureLoadBalancing")] public bool? ConfigureLoadBalancing { get; set; } + /// - /// ARM resource ID of the Traffic Manager profile to use, if it exists. Traffic Manager resource ID is of the form + /// Gets or sets ARM resource ID of the Traffic Manager profile to use, + /// if it exists. Traffic Manager resource ID is of the form /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. /// + [JsonProperty(PropertyName = "trafficManagerProfileId")] public string TrafficManagerProfileId { get; set; } - /// Name of Traffic Manager profile to create. This is only needed if Traffic Manager profile does not already exist. + + /// + /// Gets or sets name of Traffic Manager profile to create. This is + /// only needed if Traffic Manager profile does not already exist. + /// + [JsonProperty(PropertyName = "trafficManagerProfileName")] public string TrafficManagerProfileName { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SourceWebAppId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SourceWebAppId"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.Serialization.cs deleted file mode 100644 index 8ca1e771e43c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } - - internal static Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties DeserializeComponents1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(JsonElement element) - { - Optional principalId = default; - Optional clientId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("principalId")) - { - principalId = property.Value.GetString(); - continue; - } - if (property.NameEquals("clientId")) - { - clientId = property.Value.GetString(); - continue; - } - } - return new Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(principalId.Value, clientId.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs deleted file mode 100644 index e65733473777..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. - public partial class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties - { - /// Initializes a new instance of Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. - public Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties() - { - } - - /// Initializes a new instance of Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. - /// Principal Id of user assigned identity. - /// Client Id of user assigned identity. - internal Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(string principalId, string clientId) - { - PrincipalId = principalId; - ClientId = clientId; - } - - /// Principal Id of user assigned identity. - public string PrincipalId { get; } - /// Client Id of user assigned identity. - public string ClientId { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.Serialization.cs deleted file mode 100644 index 93844470290a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class ComputeModeOptionsExtensions - { - public static string ToSerialString(this ComputeModeOptions value) => value switch - { - ComputeModeOptions.Shared => "Shared", - ComputeModeOptions.Dedicated => "Dedicated", - ComputeModeOptions.Dynamic => "Dynamic", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeModeOptions value.") - }; - - public static ComputeModeOptions ToComputeModeOptions(this string value) - { - if (string.Equals(value, "Shared", StringComparison.InvariantCultureIgnoreCase)) return ComputeModeOptions.Shared; - if (string.Equals(value, "Dedicated", StringComparison.InvariantCultureIgnoreCase)) return ComputeModeOptions.Dedicated; - if (string.Equals(value, "Dynamic", StringComparison.InvariantCultureIgnoreCase)) return ComputeModeOptions.Dynamic; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputeModeOptions value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.cs index 0f7865e7ba68..d294d5065e68 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ComputeModeOptions.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Shared/dedicated workers. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ComputeModeOptions. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum ComputeModeOptions { - /// Shared. + [EnumMember(Value = "Shared")] Shared, - /// Dedicated. + [EnumMember(Value = "Dedicated")] Dedicated, - /// Dynamic. + [EnumMember(Value = "Dynamic")] Dynamic } + internal static class ComputeModeOptionsEnumExtension + { + internal static string ToSerializedValue(this ComputeModeOptions? value) + { + return value == null ? null : ((ComputeModeOptions)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ComputeModeOptions value) + { + switch( value ) + { + case ComputeModeOptions.Shared: + return "Shared"; + case ComputeModeOptions.Dedicated: + return "Dedicated"; + case ComputeModeOptions.Dynamic: + return "Dynamic"; + } + return null; + } + + internal static ComputeModeOptions? ParseComputeModeOptions(this string value) + { + switch( value ) + { + case "Shared": + return ComputeModeOptions.Shared; + case "Dedicated": + return ComputeModeOptions.Dedicated; + case "Dynamic": + return ComputeModeOptions.Dynamic; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.Serialization.cs deleted file mode 100644 index bea643e51951..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.Serialization.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ConnStringInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(ConnectionString)) - { - writer.WritePropertyName("connectionString"); - writer.WriteStringValue(ConnectionString); - } - if (Optional.IsDefined(Type)) - { - writer.WritePropertyName("type"); - writer.WriteStringValue(Type.Value.ToSerialString()); - } - writer.WriteEndObject(); - } - - internal static ConnStringInfo DeserializeConnStringInfo(JsonElement element) - { - Optional name = default; - Optional connectionString = default; - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("connectionString")) - { - connectionString = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = property.Value.GetString().ToConnectionStringType(); - continue; - } - } - return new ConnStringInfo(name.Value, connectionString.Value, Optional.ToNullable(type)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.cs index f0923dfef98d..aaf7a07978ca 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringInfo.cs @@ -1,36 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Database connection string information. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Database connection string information. + /// public partial class ConnStringInfo { - /// Initializes a new instance of ConnStringInfo. + /// + /// Initializes a new instance of the ConnStringInfo class. + /// public ConnStringInfo() { + CustomInit(); } - /// Initializes a new instance of ConnStringInfo. - /// Name of connection string. - /// Connection string value. - /// Type of database. - internal ConnStringInfo(string name, string connectionString, ConnectionStringType? type) + /// + /// Initializes a new instance of the ConnStringInfo class. + /// + /// Name of connection string. + /// Connection string value. + /// Type of database. Possible values include: + /// 'MySql', 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', + /// 'ServiceBus', 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', + /// 'PostgreSQL' + public ConnStringInfo(string name = default(string), string connectionString = default(string), ConnectionStringType? type = default(ConnectionStringType?)) { Name = name; ConnectionString = connectionString; Type = type; + CustomInit(); } - /// Name of connection string. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of connection string. + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// Connection string value. + + /// + /// Gets or sets connection string value. + /// + [JsonProperty(PropertyName = "connectionString")] public string ConnectionString { get; set; } - /// Type of database. + + /// + /// Gets or sets type of database. Possible values include: 'MySql', + /// 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', 'ServiceBus', + /// 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' + /// + [JsonProperty(PropertyName = "type")] public ConnectionStringType? Type { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.Serialization.cs deleted file mode 100644 index 50c2cb5d9265..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ConnStringValueTypePair : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("value"); - writer.WriteStringValue(Value); - writer.WritePropertyName("type"); - writer.WriteStringValue(Type.ToSerialString()); - writer.WriteEndObject(); - } - - internal static ConnStringValueTypePair DeserializeConnStringValueTypePair(JsonElement element) - { - string value = default; - ConnectionStringType type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - value = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString().ToConnectionStringType(); - continue; - } - } - return new ConnStringValueTypePair(value, type); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.cs index 941ad080f959..7ea4321cc8c3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnStringValueTypePair.cs @@ -1,35 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Database connection string value to type pair. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Database connection string value to type pair. + /// public partial class ConnStringValueTypePair { - /// Initializes a new instance of ConnStringValueTypePair. - /// Value of pair. - /// Type of database. - /// is null. - public ConnStringValueTypePair(string value, ConnectionStringType type) + /// + /// Initializes a new instance of the ConnStringValueTypePair class. + /// + public ConnStringValueTypePair() { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } + CustomInit(); + } + /// + /// Initializes a new instance of the ConnStringValueTypePair class. + /// + /// Value of pair. + /// Type of database. Possible values include: + /// 'MySql', 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', + /// 'ServiceBus', 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', + /// 'PostgreSQL' + public ConnStringValueTypePair(string value, ConnectionStringType type) + { Value = value; Type = type; + CustomInit(); } - /// Value of pair. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets value of pair. + /// + [JsonProperty(PropertyName = "value")] public string Value { get; set; } - /// Type of database. + + /// + /// Gets or sets type of database. Possible values include: 'MySql', + /// 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', 'ServiceBus', + /// 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' + /// + [JsonProperty(PropertyName = "type")] public ConnectionStringType Type { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.Serialization.cs deleted file mode 100644 index f8e0ec37d4ff..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ConnectionStringDictionary : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Properties)) - { - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WriteEndObject(); - } - - internal static ConnectionStringDictionary DeserializeConnectionStringDictionary(JsonElement element) - { - Optional> properties = default; - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, ConnStringValueTypePair.DeserializeConnStringValueTypePair(property0.Value)); - } - properties = dictionary; - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - } - return new ConnectionStringDictionary(id.Value, name.Value, kind.Value, type.Value, Optional.ToDictionary(properties)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.cs index 25dcbd5a3a72..2211f6ff3636 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringDictionary.cs @@ -1,36 +1,58 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// String dictionary resource. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// String dictionary resource. + /// public partial class ConnectionStringDictionary : ProxyOnlyResource { - /// Initializes a new instance of ConnectionStringDictionary. + /// + /// Initializes a new instance of the ConnectionStringDictionary class. + /// public ConnectionStringDictionary() { - Properties = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of ConnectionStringDictionary. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Connection strings. - internal ConnectionStringDictionary(string id, string name, string kind, string type, IDictionary properties) : base(id, name, kind, type) + /// + /// Initializes a new instance of the ConnectionStringDictionary class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Connection strings. + public ConnectionStringDictionary(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary properties = default(IDictionary)) + : base(id, name, kind, type) { Properties = properties; + CustomInit(); } - /// Connection strings. - public IDictionary Properties { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets connection strings. + /// + [JsonProperty(PropertyName = "properties")] + public IDictionary Properties { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.Serialization.cs deleted file mode 100644 index 3c8cd294c35b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class ConnectionStringTypeExtensions - { - public static string ToSerialString(this ConnectionStringType value) => value switch - { - ConnectionStringType.MySql => "MySql", - ConnectionStringType.SQLServer => "SQLServer", - ConnectionStringType.SQLAzure => "SQLAzure", - ConnectionStringType.Custom => "Custom", - ConnectionStringType.NotificationHub => "NotificationHub", - ConnectionStringType.ServiceBus => "ServiceBus", - ConnectionStringType.EventHub => "EventHub", - ConnectionStringType.ApiHub => "ApiHub", - ConnectionStringType.DocDb => "DocDb", - ConnectionStringType.RedisCache => "RedisCache", - ConnectionStringType.PostgreSQL => "PostgreSQL", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ConnectionStringType value.") - }; - - public static ConnectionStringType ToConnectionStringType(this string value) - { - if (string.Equals(value, "MySql", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.MySql; - if (string.Equals(value, "SQLServer", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.SQLServer; - if (string.Equals(value, "SQLAzure", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.SQLAzure; - if (string.Equals(value, "Custom", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.Custom; - if (string.Equals(value, "NotificationHub", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.NotificationHub; - if (string.Equals(value, "ServiceBus", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.ServiceBus; - if (string.Equals(value, "EventHub", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.EventHub; - if (string.Equals(value, "ApiHub", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.ApiHub; - if (string.Equals(value, "DocDb", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.DocDb; - if (string.Equals(value, "RedisCache", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.RedisCache; - if (string.Equals(value, "PostgreSQL", StringComparison.InvariantCultureIgnoreCase)) return ConnectionStringType.PostgreSQL; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ConnectionStringType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.cs index be2da8c04a42..5e79b9550271 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConnectionStringType.cs @@ -1,36 +1,114 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Type of database. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ConnectionStringType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum ConnectionStringType { - /// MySql. + [EnumMember(Value = "MySql")] MySql, - /// SQLServer. + [EnumMember(Value = "SQLServer")] SQLServer, - /// SQLAzure. + [EnumMember(Value = "SQLAzure")] SQLAzure, - /// Custom. + [EnumMember(Value = "Custom")] Custom, - /// NotificationHub. + [EnumMember(Value = "NotificationHub")] NotificationHub, - /// ServiceBus. + [EnumMember(Value = "ServiceBus")] ServiceBus, - /// EventHub. + [EnumMember(Value = "EventHub")] EventHub, - /// ApiHub. + [EnumMember(Value = "ApiHub")] ApiHub, - /// DocDb. + [EnumMember(Value = "DocDb")] DocDb, - /// RedisCache. + [EnumMember(Value = "RedisCache")] RedisCache, - /// PostgreSQL. + [EnumMember(Value = "PostgreSQL")] PostgreSQL } + internal static class ConnectionStringTypeEnumExtension + { + internal static string ToSerializedValue(this ConnectionStringType? value) + { + return value == null ? null : ((ConnectionStringType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ConnectionStringType value) + { + switch( value ) + { + case ConnectionStringType.MySql: + return "MySql"; + case ConnectionStringType.SQLServer: + return "SQLServer"; + case ConnectionStringType.SQLAzure: + return "SQLAzure"; + case ConnectionStringType.Custom: + return "Custom"; + case ConnectionStringType.NotificationHub: + return "NotificationHub"; + case ConnectionStringType.ServiceBus: + return "ServiceBus"; + case ConnectionStringType.EventHub: + return "EventHub"; + case ConnectionStringType.ApiHub: + return "ApiHub"; + case ConnectionStringType.DocDb: + return "DocDb"; + case ConnectionStringType.RedisCache: + return "RedisCache"; + case ConnectionStringType.PostgreSQL: + return "PostgreSQL"; + } + return null; + } + + internal static ConnectionStringType? ParseConnectionStringType(this string value) + { + switch( value ) + { + case "MySql": + return ConnectionStringType.MySql; + case "SQLServer": + return ConnectionStringType.SQLServer; + case "SQLAzure": + return ConnectionStringType.SQLAzure; + case "Custom": + return ConnectionStringType.Custom; + case "NotificationHub": + return ConnectionStringType.NotificationHub; + case "ServiceBus": + return ConnectionStringType.ServiceBus; + case "EventHub": + return ConnectionStringType.EventHub; + case "ApiHub": + return ConnectionStringType.ApiHub; + case "DocDb": + return ConnectionStringType.DocDb; + case "RedisCache": + return ConnectionStringType.RedisCache; + case "PostgreSQL": + return ConnectionStringType.PostgreSQL; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.Serialization.cs deleted file mode 100644 index 182ccb75898e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.Serialization.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Contact : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(AddressMailing)) - { - writer.WritePropertyName("addressMailing"); - writer.WriteObjectValue(AddressMailing); - } - writer.WritePropertyName("email"); - writer.WriteStringValue(Email); - if (Optional.IsDefined(Fax)) - { - writer.WritePropertyName("fax"); - writer.WriteStringValue(Fax); - } - if (Optional.IsDefined(JobTitle)) - { - writer.WritePropertyName("jobTitle"); - writer.WriteStringValue(JobTitle); - } - writer.WritePropertyName("nameFirst"); - writer.WriteStringValue(NameFirst); - writer.WritePropertyName("nameLast"); - writer.WriteStringValue(NameLast); - if (Optional.IsDefined(NameMiddle)) - { - writer.WritePropertyName("nameMiddle"); - writer.WriteStringValue(NameMiddle); - } - if (Optional.IsDefined(Organization)) - { - writer.WritePropertyName("organization"); - writer.WriteStringValue(Organization); - } - writer.WritePropertyName("phone"); - writer.WriteStringValue(Phone); - writer.WriteEndObject(); - } - - internal static Contact DeserializeContact(JsonElement element) - { - Optional
addressMailing = default; - string email = default; - Optional fax = default; - Optional jobTitle = default; - string nameFirst = default; - string nameLast = default; - Optional nameMiddle = default; - Optional organization = default; - string phone = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("addressMailing")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - addressMailing = Address.DeserializeAddress(property.Value); - continue; - } - if (property.NameEquals("email")) - { - email = property.Value.GetString(); - continue; - } - if (property.NameEquals("fax")) - { - fax = property.Value.GetString(); - continue; - } - if (property.NameEquals("jobTitle")) - { - jobTitle = property.Value.GetString(); - continue; - } - if (property.NameEquals("nameFirst")) - { - nameFirst = property.Value.GetString(); - continue; - } - if (property.NameEquals("nameLast")) - { - nameLast = property.Value.GetString(); - continue; - } - if (property.NameEquals("nameMiddle")) - { - nameMiddle = property.Value.GetString(); - continue; - } - if (property.NameEquals("organization")) - { - organization = property.Value.GetString(); - continue; - } - if (property.NameEquals("phone")) - { - phone = property.Value.GetString(); - continue; - } - } - return new Contact(addressMailing.Value, email, fax.Value, jobTitle.Value, nameFirst, nameLast, nameMiddle.Value, organization.Value, phone); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.cs index 224d9cb2bb2c..89b6c43702b3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Contact.cs @@ -1,62 +1,48 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + /// - /// Contact information for domain registration. If 'Domain Privacy' option is not selected then the contact information is made publicly available through the Whois + /// Contact information for domain registration. If 'Domain Privacy' option + /// is not selected then the contact information is made publicly available + /// through the Whois /// directories as per ICANN requirements. /// public partial class Contact { - /// Initializes a new instance of Contact. - /// Email address. - /// First name. - /// Last name. - /// Phone number. - /// , , , or is null. - public Contact(string email, string nameFirst, string nameLast, string phone) + /// + /// Initializes a new instance of the Contact class. + /// + public Contact() { - if (email == null) - { - throw new ArgumentNullException(nameof(email)); - } - if (nameFirst == null) - { - throw new ArgumentNullException(nameof(nameFirst)); - } - if (nameLast == null) - { - throw new ArgumentNullException(nameof(nameLast)); - } - if (phone == null) - { - throw new ArgumentNullException(nameof(phone)); - } - - Email = email; - NameFirst = nameFirst; - NameLast = nameLast; - Phone = phone; + CustomInit(); } - /// Initializes a new instance of Contact. - /// Mailing address. - /// Email address. - /// Fax number. - /// Job title. - /// First name. - /// Last name. - /// Middle name. - /// Organization contact belongs to. - /// Phone number. - internal Contact(Address addressMailing, string email, string fax, string jobTitle, string nameFirst, string nameLast, string nameMiddle, string organization, string phone) + /// + /// Initializes a new instance of the Contact class. + /// + /// Email address. + /// First name. + /// Last name. + /// Phone number. + /// Mailing address. + /// Fax number. + /// Job title. + /// Middle name. + /// Organization contact belongs to. + public Contact(string email, string nameFirst, string nameLast, string phone, Address addressMailing = default(Address), string fax = default(string), string jobTitle = default(string), string nameMiddle = default(string), string organization = default(string)) { AddressMailing = addressMailing; Email = email; @@ -67,25 +53,96 @@ internal Contact(Address addressMailing, string email, string fax, string jobTit NameMiddle = nameMiddle; Organization = organization; Phone = phone; + CustomInit(); } - /// Mailing address. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets mailing address. + /// + [JsonProperty(PropertyName = "addressMailing")] public Address AddressMailing { get; set; } - /// Email address. + + /// + /// Gets or sets email address. + /// + [JsonProperty(PropertyName = "email")] public string Email { get; set; } - /// Fax number. + + /// + /// Gets or sets fax number. + /// + [JsonProperty(PropertyName = "fax")] public string Fax { get; set; } - /// Job title. + + /// + /// Gets or sets job title. + /// + [JsonProperty(PropertyName = "jobTitle")] public string JobTitle { get; set; } - /// First name. + + /// + /// Gets or sets first name. + /// + [JsonProperty(PropertyName = "nameFirst")] public string NameFirst { get; set; } - /// Last name. + + /// + /// Gets or sets last name. + /// + [JsonProperty(PropertyName = "nameLast")] public string NameLast { get; set; } - /// Middle name. + + /// + /// Gets or sets middle name. + /// + [JsonProperty(PropertyName = "nameMiddle")] public string NameMiddle { get; set; } - /// Organization contact belongs to. + + /// + /// Gets or sets organization contact belongs to. + /// + [JsonProperty(PropertyName = "organization")] public string Organization { get; set; } - /// Phone number. + + /// + /// Gets or sets phone number. + /// + [JsonProperty(PropertyName = "phone")] public string Phone { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Email == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Email"); + } + if (NameFirst == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NameFirst"); + } + if (NameLast == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NameLast"); + } + if (Phone == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Phone"); + } + if (AddressMailing != null) + { + AddressMailing.Validate(); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.Serialization.cs deleted file mode 100644 index 741db1579d32..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.Serialization.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ContainerCpuStatistics : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CpuUsage)) - { - writer.WritePropertyName("cpuUsage"); - writer.WriteObjectValue(CpuUsage); - } - if (Optional.IsDefined(SystemCpuUsage)) - { - writer.WritePropertyName("systemCpuUsage"); - writer.WriteNumberValue(SystemCpuUsage.Value); - } - if (Optional.IsDefined(OnlineCpuCount)) - { - writer.WritePropertyName("onlineCpuCount"); - writer.WriteNumberValue(OnlineCpuCount.Value); - } - if (Optional.IsDefined(ThrottlingData)) - { - writer.WritePropertyName("throttlingData"); - writer.WriteObjectValue(ThrottlingData); - } - writer.WriteEndObject(); - } - - internal static ContainerCpuStatistics DeserializeContainerCpuStatistics(JsonElement element) - { - Optional cpuUsage = default; - Optional systemCpuUsage = default; - Optional onlineCpuCount = default; - Optional throttlingData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("cpuUsage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - cpuUsage = ContainerCpuUsage.DeserializeContainerCpuUsage(property.Value); - continue; - } - if (property.NameEquals("systemCpuUsage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemCpuUsage = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("onlineCpuCount")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - onlineCpuCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("throttlingData")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - throttlingData = ContainerThrottlingData.DeserializeContainerThrottlingData(property.Value); - continue; - } - } - return new ContainerCpuStatistics(cpuUsage.Value, Optional.ToNullable(systemCpuUsage), Optional.ToNullable(onlineCpuCount), throttlingData.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.cs index 626c10e2d7f2..fef297e782d1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuStatistics.cs @@ -1,36 +1,64 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The ContainerCpuStatistics. + using Newtonsoft.Json; + using System.Linq; + public partial class ContainerCpuStatistics { - /// Initializes a new instance of ContainerCpuStatistics. + /// + /// Initializes a new instance of the ContainerCpuStatistics class. + /// public ContainerCpuStatistics() { + CustomInit(); } - /// Initializes a new instance of ContainerCpuStatistics. - /// . - /// . - /// . - /// . - internal ContainerCpuStatistics(ContainerCpuUsage cpuUsage, long? systemCpuUsage, int? onlineCpuCount, ContainerThrottlingData throttlingData) + /// + /// Initializes a new instance of the ContainerCpuStatistics class. + /// + public ContainerCpuStatistics(ContainerCpuUsage cpuUsage = default(ContainerCpuUsage), long? systemCpuUsage = default(long?), int? onlineCpuCount = default(int?), ContainerThrottlingData throttlingData = default(ContainerThrottlingData)) { CpuUsage = cpuUsage; SystemCpuUsage = systemCpuUsage; OnlineCpuCount = onlineCpuCount; ThrottlingData = throttlingData; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "cpuUsage")] public ContainerCpuUsage CpuUsage { get; set; } + + /// + /// + [JsonProperty(PropertyName = "systemCpuUsage")] public long? SystemCpuUsage { get; set; } + + /// + /// + [JsonProperty(PropertyName = "onlineCpuCount")] public int? OnlineCpuCount { get; set; } + + /// + /// + [JsonProperty(PropertyName = "throttlingData")] public ContainerThrottlingData ThrottlingData { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.Serialization.cs deleted file mode 100644 index e9915c007aa3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.Serialization.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ContainerCpuUsage : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(TotalUsage)) - { - writer.WritePropertyName("totalUsage"); - writer.WriteNumberValue(TotalUsage.Value); - } - if (Optional.IsCollectionDefined(PerCpuUsage)) - { - writer.WritePropertyName("perCpuUsage"); - writer.WriteStartArray(); - foreach (var item in PerCpuUsage) - { - writer.WriteNumberValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(KernelModeUsage)) - { - writer.WritePropertyName("kernelModeUsage"); - writer.WriteNumberValue(KernelModeUsage.Value); - } - if (Optional.IsDefined(UserModeUsage)) - { - writer.WritePropertyName("userModeUsage"); - writer.WriteNumberValue(UserModeUsage.Value); - } - writer.WriteEndObject(); - } - - internal static ContainerCpuUsage DeserializeContainerCpuUsage(JsonElement element) - { - Optional totalUsage = default; - Optional> perCpuUsage = default; - Optional kernelModeUsage = default; - Optional userModeUsage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("totalUsage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - totalUsage = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("perCpuUsage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetInt64()); - } - perCpuUsage = array; - continue; - } - if (property.NameEquals("kernelModeUsage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - kernelModeUsage = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("userModeUsage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - userModeUsage = property.Value.GetInt64(); - continue; - } - } - return new ContainerCpuUsage(Optional.ToNullable(totalUsage), Optional.ToList(perCpuUsage), Optional.ToNullable(kernelModeUsage), Optional.ToNullable(userModeUsage)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.cs index b24823e31234..b0d93c37d24d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerCpuUsage.cs @@ -1,40 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// The ContainerCpuUsage. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + public partial class ContainerCpuUsage { - /// Initializes a new instance of ContainerCpuUsage. + /// + /// Initializes a new instance of the ContainerCpuUsage class. + /// public ContainerCpuUsage() { - PerCpuUsage = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of ContainerCpuUsage. - /// . - /// . - /// . - /// . - internal ContainerCpuUsage(long? totalUsage, IList perCpuUsage, long? kernelModeUsage, long? userModeUsage) + /// + /// Initializes a new instance of the ContainerCpuUsage class. + /// + public ContainerCpuUsage(long? totalUsage = default(long?), IList perCpuUsage = default(IList), long? kernelModeUsage = default(long?), long? userModeUsage = default(long?)) { TotalUsage = totalUsage; PerCpuUsage = perCpuUsage; KernelModeUsage = kernelModeUsage; UserModeUsage = userModeUsage; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "totalUsage")] public long? TotalUsage { get; set; } - public IList PerCpuUsage { get; } + + /// + /// + [JsonProperty(PropertyName = "perCpuUsage")] + public IList PerCpuUsage { get; set; } + + /// + /// + [JsonProperty(PropertyName = "kernelModeUsage")] public long? KernelModeUsage { get; set; } + + /// + /// + [JsonProperty(PropertyName = "userModeUsage")] public long? UserModeUsage { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.Serialization.cs deleted file mode 100644 index cd9bd6469100..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.Serialization.cs +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ContainerInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CurrentTimeStamp)) - { - writer.WritePropertyName("currentTimeStamp"); - writer.WriteStringValue(CurrentTimeStamp.Value, "O"); - } - if (Optional.IsDefined(PreviousTimeStamp)) - { - writer.WritePropertyName("previousTimeStamp"); - writer.WriteStringValue(PreviousTimeStamp.Value, "O"); - } - if (Optional.IsDefined(CurrentCpuStats)) - { - writer.WritePropertyName("currentCpuStats"); - writer.WriteObjectValue(CurrentCpuStats); - } - if (Optional.IsDefined(PreviousCpuStats)) - { - writer.WritePropertyName("previousCpuStats"); - writer.WriteObjectValue(PreviousCpuStats); - } - if (Optional.IsDefined(MemoryStats)) - { - writer.WritePropertyName("memoryStats"); - writer.WriteObjectValue(MemoryStats); - } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(Eth0)) - { - writer.WritePropertyName("eth0"); - writer.WriteObjectValue(Eth0); - } - writer.WriteEndObject(); - } - - internal static ContainerInfo DeserializeContainerInfo(JsonElement element) - { - Optional currentTimeStamp = default; - Optional previousTimeStamp = default; - Optional currentCpuStats = default; - Optional previousCpuStats = default; - Optional memoryStats = default; - Optional name = default; - Optional id = default; - Optional eth0 = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("currentTimeStamp")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - currentTimeStamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("previousTimeStamp")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - previousTimeStamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("currentCpuStats")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - currentCpuStats = ContainerCpuStatistics.DeserializeContainerCpuStatistics(property.Value); - continue; - } - if (property.NameEquals("previousCpuStats")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - previousCpuStats = ContainerCpuStatistics.DeserializeContainerCpuStatistics(property.Value); - continue; - } - if (property.NameEquals("memoryStats")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - memoryStats = ContainerMemoryStatistics.DeserializeContainerMemoryStatistics(property.Value); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("eth0")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - eth0 = ContainerNetworkInterfaceStatistics.DeserializeContainerNetworkInterfaceStatistics(property.Value); - continue; - } - } - return new ContainerInfo(Optional.ToNullable(currentTimeStamp), Optional.ToNullable(previousTimeStamp), currentCpuStats.Value, previousCpuStats.Value, memoryStats.Value, name.Value, id.Value, eth0.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.cs index c1544f41337a..0eecbf3b3654 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerInfo.cs @@ -1,32 +1,32 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// The ContainerInfo. + using Newtonsoft.Json; + using System.Linq; + public partial class ContainerInfo { - /// Initializes a new instance of ContainerInfo. + /// + /// Initializes a new instance of the ContainerInfo class. + /// public ContainerInfo() { + CustomInit(); } - /// Initializes a new instance of ContainerInfo. - /// . - /// . - /// . - /// . - /// . - /// . - /// . - /// . - internal ContainerInfo(DateTimeOffset? currentTimeStamp, DateTimeOffset? previousTimeStamp, ContainerCpuStatistics currentCpuStats, ContainerCpuStatistics previousCpuStats, ContainerMemoryStatistics memoryStats, string name, string id, ContainerNetworkInterfaceStatistics eth0) + /// + /// Initializes a new instance of the ContainerInfo class. + /// + public ContainerInfo(System.DateTime? currentTimeStamp = default(System.DateTime?), System.DateTime? previousTimeStamp = default(System.DateTime?), ContainerCpuStatistics currentCpuStats = default(ContainerCpuStatistics), ContainerCpuStatistics previousCpuStats = default(ContainerCpuStatistics), ContainerMemoryStatistics memoryStats = default(ContainerMemoryStatistics), string name = default(string), string id = default(string), ContainerNetworkInterfaceStatistics eth0 = default(ContainerNetworkInterfaceStatistics)) { CurrentTimeStamp = currentTimeStamp; PreviousTimeStamp = previousTimeStamp; @@ -36,15 +36,53 @@ internal ContainerInfo(DateTimeOffset? currentTimeStamp, DateTimeOffset? previou Name = name; Id = id; Eth0 = eth0; + CustomInit(); } - public DateTimeOffset? CurrentTimeStamp { get; set; } - public DateTimeOffset? PreviousTimeStamp { get; set; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "currentTimeStamp")] + public System.DateTime? CurrentTimeStamp { get; set; } + + /// + /// + [JsonProperty(PropertyName = "previousTimeStamp")] + public System.DateTime? PreviousTimeStamp { get; set; } + + /// + /// + [JsonProperty(PropertyName = "currentCpuStats")] public ContainerCpuStatistics CurrentCpuStats { get; set; } + + /// + /// + [JsonProperty(PropertyName = "previousCpuStats")] public ContainerCpuStatistics PreviousCpuStats { get; set; } + + /// + /// + [JsonProperty(PropertyName = "memoryStats")] public ContainerMemoryStatistics MemoryStats { get; set; } + + /// + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "id")] public string Id { get; set; } + + /// + /// + [JsonProperty(PropertyName = "eth0")] public ContainerNetworkInterfaceStatistics Eth0 { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.Serialization.cs deleted file mode 100644 index 41d2d05229d0..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.Serialization.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ContainerMemoryStatistics : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Usage)) - { - writer.WritePropertyName("usage"); - writer.WriteNumberValue(Usage.Value); - } - if (Optional.IsDefined(MaxUsage)) - { - writer.WritePropertyName("maxUsage"); - writer.WriteNumberValue(MaxUsage.Value); - } - if (Optional.IsDefined(Limit)) - { - writer.WritePropertyName("limit"); - writer.WriteNumberValue(Limit.Value); - } - writer.WriteEndObject(); - } - - internal static ContainerMemoryStatistics DeserializeContainerMemoryStatistics(JsonElement element) - { - Optional usage = default; - Optional maxUsage = default; - Optional limit = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("usage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - usage = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("maxUsage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maxUsage = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("limit")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - limit = property.Value.GetInt64(); - continue; - } - } - return new ContainerMemoryStatistics(Optional.ToNullable(usage), Optional.ToNullable(maxUsage), Optional.ToNullable(limit)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.cs index b0cadd3c0aa8..ac4bc9cbfc83 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerMemoryStatistics.cs @@ -1,33 +1,58 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The ContainerMemoryStatistics. + using Newtonsoft.Json; + using System.Linq; + public partial class ContainerMemoryStatistics { - /// Initializes a new instance of ContainerMemoryStatistics. + /// + /// Initializes a new instance of the ContainerMemoryStatistics class. + /// public ContainerMemoryStatistics() { + CustomInit(); } - /// Initializes a new instance of ContainerMemoryStatistics. - /// . - /// . - /// . - internal ContainerMemoryStatistics(long? usage, long? maxUsage, long? limit) + /// + /// Initializes a new instance of the ContainerMemoryStatistics class. + /// + public ContainerMemoryStatistics(long? usage = default(long?), long? maxUsage = default(long?), long? limit = default(long?)) { Usage = usage; MaxUsage = maxUsage; Limit = limit; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "usage")] public long? Usage { get; set; } + + /// + /// + [JsonProperty(PropertyName = "maxUsage")] public long? MaxUsage { get; set; } + + /// + /// + [JsonProperty(PropertyName = "limit")] public long? Limit { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.Serialization.cs deleted file mode 100644 index 66ea662d7f99..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.Serialization.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ContainerNetworkInterfaceStatistics : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(RxBytes)) - { - writer.WritePropertyName("rxBytes"); - writer.WriteNumberValue(RxBytes.Value); - } - if (Optional.IsDefined(RxPackets)) - { - writer.WritePropertyName("rxPackets"); - writer.WriteNumberValue(RxPackets.Value); - } - if (Optional.IsDefined(RxErrors)) - { - writer.WritePropertyName("rxErrors"); - writer.WriteNumberValue(RxErrors.Value); - } - if (Optional.IsDefined(RxDropped)) - { - writer.WritePropertyName("rxDropped"); - writer.WriteNumberValue(RxDropped.Value); - } - if (Optional.IsDefined(TxBytes)) - { - writer.WritePropertyName("txBytes"); - writer.WriteNumberValue(TxBytes.Value); - } - if (Optional.IsDefined(TxPackets)) - { - writer.WritePropertyName("txPackets"); - writer.WriteNumberValue(TxPackets.Value); - } - if (Optional.IsDefined(TxErrors)) - { - writer.WritePropertyName("txErrors"); - writer.WriteNumberValue(TxErrors.Value); - } - if (Optional.IsDefined(TxDropped)) - { - writer.WritePropertyName("txDropped"); - writer.WriteNumberValue(TxDropped.Value); - } - writer.WriteEndObject(); - } - - internal static ContainerNetworkInterfaceStatistics DeserializeContainerNetworkInterfaceStatistics(JsonElement element) - { - Optional rxBytes = default; - Optional rxPackets = default; - Optional rxErrors = default; - Optional rxDropped = default; - Optional txBytes = default; - Optional txPackets = default; - Optional txErrors = default; - Optional txDropped = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("rxBytes")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - rxBytes = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("rxPackets")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - rxPackets = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("rxErrors")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - rxErrors = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("rxDropped")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - rxDropped = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("txBytes")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - txBytes = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("txPackets")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - txPackets = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("txErrors")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - txErrors = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("txDropped")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - txDropped = property.Value.GetInt64(); - continue; - } - } - return new ContainerNetworkInterfaceStatistics(Optional.ToNullable(rxBytes), Optional.ToNullable(rxPackets), Optional.ToNullable(rxErrors), Optional.ToNullable(rxDropped), Optional.ToNullable(txBytes), Optional.ToNullable(txPackets), Optional.ToNullable(txErrors), Optional.ToNullable(txDropped)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.cs index 204d400ee756..f2a7bdfdb180 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerNetworkInterfaceStatistics.cs @@ -1,30 +1,34 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The ContainerNetworkInterfaceStatistics. + using Newtonsoft.Json; + using System.Linq; + public partial class ContainerNetworkInterfaceStatistics { - /// Initializes a new instance of ContainerNetworkInterfaceStatistics. + /// + /// Initializes a new instance of the + /// ContainerNetworkInterfaceStatistics class. + /// public ContainerNetworkInterfaceStatistics() { + CustomInit(); } - /// Initializes a new instance of ContainerNetworkInterfaceStatistics. - /// . - /// . - /// . - /// . - /// . - /// . - /// . - /// . - internal ContainerNetworkInterfaceStatistics(long? rxBytes, long? rxPackets, long? rxErrors, long? rxDropped, long? txBytes, long? txPackets, long? txErrors, long? txDropped) + /// + /// Initializes a new instance of the + /// ContainerNetworkInterfaceStatistics class. + /// + public ContainerNetworkInterfaceStatistics(long? rxBytes = default(long?), long? rxPackets = default(long?), long? rxErrors = default(long?), long? rxDropped = default(long?), long? txBytes = default(long?), long? txPackets = default(long?), long? txErrors = default(long?), long? txDropped = default(long?)) { RxBytes = rxBytes; RxPackets = rxPackets; @@ -34,15 +38,53 @@ internal ContainerNetworkInterfaceStatistics(long? rxBytes, long? rxPackets, lon TxPackets = txPackets; TxErrors = txErrors; TxDropped = txDropped; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "rxBytes")] public long? RxBytes { get; set; } + + /// + /// + [JsonProperty(PropertyName = "rxPackets")] public long? RxPackets { get; set; } + + /// + /// + [JsonProperty(PropertyName = "rxErrors")] public long? RxErrors { get; set; } + + /// + /// + [JsonProperty(PropertyName = "rxDropped")] public long? RxDropped { get; set; } + + /// + /// + [JsonProperty(PropertyName = "txBytes")] public long? TxBytes { get; set; } + + /// + /// + [JsonProperty(PropertyName = "txPackets")] public long? TxPackets { get; set; } + + /// + /// + [JsonProperty(PropertyName = "txErrors")] public long? TxErrors { get; set; } + + /// + /// + [JsonProperty(PropertyName = "txDropped")] public long? TxDropped { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.Serialization.cs deleted file mode 100644 index 3bb6653883d6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.Serialization.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ContainerThrottlingData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Periods)) - { - writer.WritePropertyName("periods"); - writer.WriteNumberValue(Periods.Value); - } - if (Optional.IsDefined(ThrottledPeriods)) - { - writer.WritePropertyName("throttledPeriods"); - writer.WriteNumberValue(ThrottledPeriods.Value); - } - if (Optional.IsDefined(ThrottledTime)) - { - writer.WritePropertyName("throttledTime"); - writer.WriteNumberValue(ThrottledTime.Value); - } - writer.WriteEndObject(); - } - - internal static ContainerThrottlingData DeserializeContainerThrottlingData(JsonElement element) - { - Optional periods = default; - Optional throttledPeriods = default; - Optional throttledTime = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("periods")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - periods = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("throttledPeriods")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - throttledPeriods = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("throttledTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - throttledTime = property.Value.GetInt32(); - continue; - } - } - return new ContainerThrottlingData(Optional.ToNullable(periods), Optional.ToNullable(throttledPeriods), Optional.ToNullable(throttledTime)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.cs index ab89cb3e931f..286d2ae0c717 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContainerThrottlingData.cs @@ -1,33 +1,58 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The ContainerThrottlingData. + using Newtonsoft.Json; + using System.Linq; + public partial class ContainerThrottlingData { - /// Initializes a new instance of ContainerThrottlingData. + /// + /// Initializes a new instance of the ContainerThrottlingData class. + /// public ContainerThrottlingData() { + CustomInit(); } - /// Initializes a new instance of ContainerThrottlingData. - /// . - /// . - /// . - internal ContainerThrottlingData(int? periods, int? throttledPeriods, int? throttledTime) + /// + /// Initializes a new instance of the ContainerThrottlingData class. + /// + public ContainerThrottlingData(int? periods = default(int?), int? throttledPeriods = default(int?), int? throttledTime = default(int?)) { Periods = periods; ThrottledPeriods = throttledPeriods; ThrottledTime = throttledTime; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "periods")] public int? Periods { get; set; } + + /// + /// + [JsonProperty(PropertyName = "throttledPeriods")] public int? ThrottledPeriods { get; set; } + + /// + /// + [JsonProperty(PropertyName = "throttledTime")] public int? ThrottledTime { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.Serialization.cs deleted file mode 100644 index 8f24a756046f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.Serialization.cs +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ContinuousWebJob : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"); - writer.WriteStringValue(Status.Value.ToSerialString()); - } - if (Optional.IsDefined(DetailedStatus)) - { - writer.WritePropertyName("detailed_status"); - writer.WriteStringValue(DetailedStatus); - } - if (Optional.IsDefined(LogUrl)) - { - writer.WritePropertyName("log_url"); - writer.WriteStringValue(LogUrl); - } - if (Optional.IsDefined(RunCommand)) - { - writer.WritePropertyName("run_command"); - writer.WriteStringValue(RunCommand); - } - if (Optional.IsDefined(Url)) - { - writer.WritePropertyName("url"); - writer.WriteStringValue(Url); - } - if (Optional.IsDefined(ExtraInfoUrl)) - { - writer.WritePropertyName("extra_info_url"); - writer.WriteStringValue(ExtraInfoUrl); - } - if (Optional.IsDefined(WebJobType)) - { - writer.WritePropertyName("web_job_type"); - writer.WriteStringValue(WebJobType.Value.ToSerialString()); - } - if (Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"); - writer.WriteStringValue(Error); - } - if (Optional.IsDefined(UsingSdk)) - { - writer.WritePropertyName("using_sdk"); - writer.WriteBooleanValue(UsingSdk.Value); - } - if (Optional.IsCollectionDefined(Settings)) - { - writer.WritePropertyName("settings"); - writer.WriteStartObject(); - foreach (var item in Settings) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ContinuousWebJob DeserializeContinuousWebJob(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional status = default; - Optional detailedStatus = default; - Optional logUrl = default; - Optional runCommand = default; - Optional url = default; - Optional extraInfoUrl = default; - Optional webJobType = default; - Optional error = default; - Optional usingSdk = default; - Optional> settings = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property0.Value.GetString().ToContinuousWebJobStatus(); - continue; - } - if (property0.NameEquals("detailed_status")) - { - detailedStatus = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("log_url")) - { - logUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("run_command")) - { - runCommand = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("url")) - { - url = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("extra_info_url")) - { - extraInfoUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("web_job_type")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - webJobType = property0.Value.GetString().ToWebJobType(); - continue; - } - if (property0.NameEquals("error")) - { - error = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("using_sdk")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - usingSdk = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("settings")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetObject()); - } - settings = dictionary; - continue; - } - } - continue; - } - } - return new ContinuousWebJob(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(status), detailedStatus.Value, logUrl.Value, runCommand.Value, url.Value, extraInfoUrl.Value, Optional.ToNullable(webJobType), error.Value, Optional.ToNullable(usingSdk), Optional.ToDictionary(settings)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.cs index 569c2977f90d..f8139a745481 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJob.cs @@ -1,40 +1,58 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Continuous Web Job Information. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Continuous Web Job Information. + /// + [Rest.Serialization.JsonTransformation] public partial class ContinuousWebJob : ProxyOnlyResource { - /// Initializes a new instance of ContinuousWebJob. + /// + /// Initializes a new instance of the ContinuousWebJob class. + /// public ContinuousWebJob() { - Settings = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of ContinuousWebJob. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Job status. - /// Detailed status. - /// Log URL. - /// Run command. - /// Job URL. - /// Extra Info URL. - /// Job type. - /// Error information. - /// Using SDK?. - /// Job settings. - internal ContinuousWebJob(string id, string name, string kind, string type, ContinuousWebJobStatus? status, string detailedStatus, string logUrl, string runCommand, string url, string extraInfoUrl, WebJobType? webJobType, string error, bool? usingSdk, IDictionary settings) : base(id, name, kind, type) + /// + /// Initializes a new instance of the ContinuousWebJob class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Job status. Possible values include: + /// 'Initializing', 'Starting', 'Running', 'PendingRestart', + /// 'Stopped' + /// Detailed status. + /// Log URL. + /// Run command. + /// Job URL. + /// Extra Info URL. + /// Job type. Possible values include: + /// 'Continuous', 'Triggered' + /// Error information. + /// Using SDK? + /// Job settings. + public ContinuousWebJob(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ContinuousWebJobStatus? status = default(ContinuousWebJobStatus?), string detailedStatus = default(string), string logUrl = default(string), string runCommand = default(string), string url = default(string), string extraInfoUrl = default(string), WebJobType? webJobType = default(WebJobType?), string error = default(string), bool? usingSdk = default(bool?), IDictionary settings = default(IDictionary)) + : base(id, name, kind, type) { Status = status; DetailedStatus = detailedStatus; @@ -46,27 +64,75 @@ internal ContinuousWebJob(string id, string name, string kind, string type, Cont Error = error; UsingSdk = usingSdk; Settings = settings; + CustomInit(); } - /// Job status. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets job status. Possible values include: 'Initializing', + /// 'Starting', 'Running', 'PendingRestart', 'Stopped' + /// + [JsonProperty(PropertyName = "properties.status")] public ContinuousWebJobStatus? Status { get; set; } - /// Detailed status. + + /// + /// Gets or sets detailed status. + /// + [JsonProperty(PropertyName = "properties.detailed_status")] public string DetailedStatus { get; set; } - /// Log URL. + + /// + /// Gets or sets log URL. + /// + [JsonProperty(PropertyName = "properties.log_url")] public string LogUrl { get; set; } - /// Run command. + + /// + /// Gets or sets run command. + /// + [JsonProperty(PropertyName = "properties.run_command")] public string RunCommand { get; set; } - /// Job URL. + + /// + /// Gets or sets job URL. + /// + [JsonProperty(PropertyName = "properties.url")] public string Url { get; set; } - /// Extra Info URL. + + /// + /// Gets or sets extra Info URL. + /// + [JsonProperty(PropertyName = "properties.extra_info_url")] public string ExtraInfoUrl { get; set; } - /// Job type. + + /// + /// Gets or sets job type. Possible values include: 'Continuous', + /// 'Triggered' + /// + [JsonProperty(PropertyName = "properties.web_job_type")] public WebJobType? WebJobType { get; set; } - /// Error information. + + /// + /// Gets or sets error information. + /// + [JsonProperty(PropertyName = "properties.error")] public string Error { get; set; } - /// Using SDK?. + + /// + /// Gets or sets using SDK? + /// + [JsonProperty(PropertyName = "properties.using_sdk")] public bool? UsingSdk { get; set; } - /// Job settings. - public IDictionary Settings { get; } + + /// + /// Gets or sets job settings. + /// + [JsonProperty(PropertyName = "properties.settings")] + public IDictionary Settings { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.Serialization.cs deleted file mode 100644 index e1940f8e8e1b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class ContinuousWebJobCollection - { - internal static ContinuousWebJobCollection DeserializeContinuousWebJobCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ContinuousWebJob.DeserializeContinuousWebJob(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ContinuousWebJobCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.cs deleted file mode 100644 index c9cb5f8029ef..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Kudu continuous web job information elements. - internal partial class ContinuousWebJobCollection - { - /// Initializes a new instance of ContinuousWebJobCollection. - /// Collection of resources. - /// is null. - internal ContinuousWebJobCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of ContinuousWebJobCollection. - /// Collection of resources. - /// Link to next page of resources. - internal ContinuousWebJobCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.Serialization.cs deleted file mode 100644 index 2cbb4fd36f4a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class ContinuousWebJobStatusExtensions - { - public static string ToSerialString(this ContinuousWebJobStatus value) => value switch - { - ContinuousWebJobStatus.Initializing => "Initializing", - ContinuousWebJobStatus.Starting => "Starting", - ContinuousWebJobStatus.Running => "Running", - ContinuousWebJobStatus.PendingRestart => "PendingRestart", - ContinuousWebJobStatus.Stopped => "Stopped", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ContinuousWebJobStatus value.") - }; - - public static ContinuousWebJobStatus ToContinuousWebJobStatus(this string value) - { - if (string.Equals(value, "Initializing", StringComparison.InvariantCultureIgnoreCase)) return ContinuousWebJobStatus.Initializing; - if (string.Equals(value, "Starting", StringComparison.InvariantCultureIgnoreCase)) return ContinuousWebJobStatus.Starting; - if (string.Equals(value, "Running", StringComparison.InvariantCultureIgnoreCase)) return ContinuousWebJobStatus.Running; - if (string.Equals(value, "PendingRestart", StringComparison.InvariantCultureIgnoreCase)) return ContinuousWebJobStatus.PendingRestart; - if (string.Equals(value, "Stopped", StringComparison.InvariantCultureIgnoreCase)) return ContinuousWebJobStatus.Stopped; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ContinuousWebJobStatus value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.cs index 79be39ecd3dd..4ee338d1cd45 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ContinuousWebJobStatus.cs @@ -1,24 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Job status. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ContinuousWebJobStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum ContinuousWebJobStatus { - /// Initializing. + [EnumMember(Value = "Initializing")] Initializing, - /// Starting. + [EnumMember(Value = "Starting")] Starting, - /// Running. + [EnumMember(Value = "Running")] Running, - /// PendingRestart. + [EnumMember(Value = "PendingRestart")] PendingRestart, - /// Stopped. + [EnumMember(Value = "Stopped")] Stopped } + internal static class ContinuousWebJobStatusEnumExtension + { + internal static string ToSerializedValue(this ContinuousWebJobStatus? value) + { + return value == null ? null : ((ContinuousWebJobStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ContinuousWebJobStatus value) + { + switch( value ) + { + case ContinuousWebJobStatus.Initializing: + return "Initializing"; + case ContinuousWebJobStatus.Starting: + return "Starting"; + case ContinuousWebJobStatus.Running: + return "Running"; + case ContinuousWebJobStatus.PendingRestart: + return "PendingRestart"; + case ContinuousWebJobStatus.Stopped: + return "Stopped"; + } + return null; + } + + internal static ContinuousWebJobStatus? ParseContinuousWebJobStatus(this string value) + { + switch( value ) + { + case "Initializing": + return ContinuousWebJobStatus.Initializing; + case "Starting": + return ContinuousWebJobStatus.Starting; + case "Running": + return ContinuousWebJobStatus.Running; + case "PendingRestart": + return ContinuousWebJobStatus.PendingRestart; + case "Stopped": + return ContinuousWebJobStatus.Stopped; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.Serialization.cs deleted file mode 100644 index 9b08ef122c04..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CookieExpiration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Convention)) - { - writer.WritePropertyName("convention"); - writer.WriteStringValue(Convention.Value.ToSerialString()); - } - if (Optional.IsDefined(TimeToExpiration)) - { - writer.WritePropertyName("timeToExpiration"); - writer.WriteStringValue(TimeToExpiration); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static CookieExpiration DeserializeCookieExpiration(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional convention = default; - Optional timeToExpiration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("convention")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - convention = property0.Value.GetString().ToCookieExpirationConvention(); - continue; - } - if (property0.NameEquals("timeToExpiration")) - { - timeToExpiration = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new CookieExpiration(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(convention), timeToExpiration.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.cs index b0f4599cc117..2bad787f8310 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.cs @@ -1,36 +1,64 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the session cookie's expiration. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class CookieExpiration : ProxyOnlyResource { - /// Initializes a new instance of CookieExpiration. + /// + /// Initializes a new instance of the CookieExpiration class. + /// public CookieExpiration() { + CustomInit(); } - /// Initializes a new instance of CookieExpiration. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The convention used when determining the session cookie's expiration. - /// The time after the request is made when the session cookie should expire. - internal CookieExpiration(string id, string name, string kind, string type, CookieExpirationConvention? convention, string timeToExpiration) : base(id, name, kind, type) + /// + /// Initializes a new instance of the CookieExpiration class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Possible values include: 'FixedTime', + /// 'IdentityProviderDerived' + public CookieExpiration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), CookieExpirationConvention? convention = default(CookieExpirationConvention?), string timeToExpiration = default(string)) + : base(id, name, kind, type) { Convention = convention; TimeToExpiration = timeToExpiration; + CustomInit(); } - /// The convention used when determining the session cookie's expiration. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'FixedTime', + /// 'IdentityProviderDerived' + /// + [JsonProperty(PropertyName = "properties.convention")] public CookieExpirationConvention? Convention { get; set; } - /// The time after the request is made when the session cookie should expire. + + /// + /// + [JsonProperty(PropertyName = "properties.timeToExpiration")] public string TimeToExpiration { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.Serialization.cs deleted file mode 100644 index f1880787b687..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class CookieExpirationConventionExtensions - { - public static string ToSerialString(this CookieExpirationConvention value) => value switch - { - CookieExpirationConvention.FixedTime => "FixedTime", - CookieExpirationConvention.IdentityProviderDerived => "IdentityProviderDerived", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CookieExpirationConvention value.") - }; - - public static CookieExpirationConvention ToCookieExpirationConvention(this string value) - { - if (string.Equals(value, "FixedTime", StringComparison.InvariantCultureIgnoreCase)) return CookieExpirationConvention.FixedTime; - if (string.Equals(value, "IdentityProviderDerived", StringComparison.InvariantCultureIgnoreCase)) return CookieExpirationConvention.IdentityProviderDerived; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CookieExpirationConvention value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.cs index d93558a9524b..f70cd921b20d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpirationConvention.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The convention used when determining the session cookie's expiration. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for CookieExpirationConvention. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum CookieExpirationConvention { - /// FixedTime. + [EnumMember(Value = "FixedTime")] FixedTime, - /// IdentityProviderDerived. + [EnumMember(Value = "IdentityProviderDerived")] IdentityProviderDerived } + internal static class CookieExpirationConventionEnumExtension + { + internal static string ToSerializedValue(this CookieExpirationConvention? value) + { + return value == null ? null : ((CookieExpirationConvention)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this CookieExpirationConvention value) + { + switch( value ) + { + case CookieExpirationConvention.FixedTime: + return "FixedTime"; + case CookieExpirationConvention.IdentityProviderDerived: + return "IdentityProviderDerived"; + } + return null; + } + + internal static CookieExpirationConvention? ParseCookieExpirationConvention(this string value) + { + switch( value ) + { + case "FixedTime": + return CookieExpirationConvention.FixedTime; + case "IdentityProviderDerived": + return CookieExpirationConvention.IdentityProviderDerived; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.Serialization.cs deleted file mode 100644 index b90c7d21e2eb..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.Serialization.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CorsSettings : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(AllowedOrigins)) - { - writer.WritePropertyName("allowedOrigins"); - writer.WriteStartArray(); - foreach (var item in AllowedOrigins) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(SupportCredentials)) - { - writer.WritePropertyName("supportCredentials"); - writer.WriteBooleanValue(SupportCredentials.Value); - } - writer.WriteEndObject(); - } - - internal static CorsSettings DeserializeCorsSettings(JsonElement element) - { - Optional> allowedOrigins = default; - Optional supportCredentials = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("allowedOrigins")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedOrigins = array; - continue; - } - if (property.NameEquals("supportCredentials")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - supportCredentials = property.Value.GetBoolean(); - continue; - } - } - return new CorsSettings(Optional.ToList(allowedOrigins), Optional.ToNullable(supportCredentials)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.cs index 870c293c10e0..30cffd37b2a1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CorsSettings.cs @@ -1,50 +1,73 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Cross-Origin Resource Sharing (CORS) settings for the app. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Cross-Origin Resource Sharing (CORS) settings for the app. + /// public partial class CorsSettings { - /// Initializes a new instance of CorsSettings. + /// + /// Initializes a new instance of the CorsSettings class. + /// public CorsSettings() { - AllowedOrigins = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of CorsSettings. - /// - /// Gets or sets the list of origins that should be allowed to make cross-origin - /// calls (for example: http://example.com:12345). Use "*" to allow all. - /// - /// - /// Gets or sets whether CORS requests with credentials are allowed. See + /// + /// Initializes a new instance of the CorsSettings class. + /// + /// Gets or sets the list of origins that + /// should be allowed to make cross-origin + /// calls (for example: http://example.com:12345). Use "*" to allow + /// all. + /// Gets or sets whether CORS requests + /// with credentials are allowed. See /// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials - /// for more details. - /// - internal CorsSettings(IList allowedOrigins, bool? supportCredentials) + /// for more details. + public CorsSettings(IList allowedOrigins = default(IList), bool? supportCredentials = default(bool?)) { AllowedOrigins = allowedOrigins; SupportCredentials = supportCredentials; + CustomInit(); } /// - /// Gets or sets the list of origins that should be allowed to make cross-origin - /// calls (for example: http://example.com:12345). Use "*" to allow all. + /// An initialization method that performs custom operations like setting defaults /// - public IList AllowedOrigins { get; } + partial void CustomInit(); + /// - /// Gets or sets whether CORS requests with credentials are allowed. See + /// Gets or sets the list of origins that should be allowed to make + /// cross-origin + /// calls (for example: http://example.com:12345). Use "*" to allow + /// all. + /// + [JsonProperty(PropertyName = "allowedOrigins")] + public IList AllowedOrigins { get; set; } + + /// + /// Gets or sets whether CORS requests with credentials are allowed. + /// See /// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials /// for more details. /// + [JsonProperty(PropertyName = "supportCredentials")] public bool? SupportCredentials { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.Serialization.cs deleted file mode 100644 index bc0240c5e27b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CsmMoveResourceEnvelope : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(TargetResourceGroup)) - { - writer.WritePropertyName("targetResourceGroup"); - writer.WriteStringValue(TargetResourceGroup); - } - if (Optional.IsCollectionDefined(Resources)) - { - writer.WritePropertyName("resources"); - writer.WriteStartArray(); - foreach (var item in Resources) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.cs index c8dd999c42b8..221891f818a8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmMoveResourceEnvelope.cs @@ -1,25 +1,83 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Object with a list of the resources that need to be moved and the resource group they should be moved to. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Object with a list of the resources that need to be moved and the + /// resource group they should be moved to. + /// public partial class CsmMoveResourceEnvelope { - /// Initializes a new instance of CsmMoveResourceEnvelope. + /// + /// Initializes a new instance of the CsmMoveResourceEnvelope class. + /// public CsmMoveResourceEnvelope() { - Resources = new ChangeTrackingList(); + CustomInit(); + } + + /// + /// Initializes a new instance of the CsmMoveResourceEnvelope class. + /// + public CsmMoveResourceEnvelope(string targetResourceGroup = default(string), IList resources = default(IList)) + { + TargetResourceGroup = targetResourceGroup; + Resources = resources; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "targetResourceGroup")] public string TargetResourceGroup { get; set; } - public IList Resources { get; } + + /// + /// + [JsonProperty(PropertyName = "resources")] + public IList Resources { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TargetResourceGroup != null) + { + if (TargetResourceGroup.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "TargetResourceGroup", 90); + } + if (TargetResourceGroup.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "TargetResourceGroup", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(TargetResourceGroup, " ^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "TargetResourceGroup", " ^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.Serialization.cs deleted file mode 100644 index 8adafeda13d6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class CsmOperationCollection - { - internal static CsmOperationCollection DeserializeCsmOperationCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CsmOperationDescription.DeserializeCsmOperationDescription(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new CsmOperationCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.cs deleted file mode 100644 index 93635c58dad5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Azure resource manager operation metadata. - internal partial class CsmOperationCollection - { - /// Initializes a new instance of CsmOperationCollection. - /// Collection of resources. - /// is null. - internal CsmOperationCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of CsmOperationCollection. - /// Collection of resources. - /// Link to next page of resources. - internal CsmOperationCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.Serialization.cs deleted file mode 100644 index 090730b6b372..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.Serialization.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CsmOperationDescription - { - internal static CsmOperationDescription DeserializeCsmOperationDescription(JsonElement element) - { - Optional name = default; - Optional display = default; - Optional origin = default; - Optional properties = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("display")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - display = CsmOperationDisplay.DeserializeCsmOperationDisplay(property.Value); - continue; - } - if (property.NameEquals("origin")) - { - origin = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - properties = CsmOperationDescriptionProperties.DeserializeCsmOperationDescriptionProperties(property.Value); - continue; - } - } - return new CsmOperationDescription(name.Value, display.Value, origin.Value, properties.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.cs index afcad5be5f4b..e37bb469ac64 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescription.cs @@ -1,38 +1,68 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Description of an operation available for Microsoft.Web resource provider. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Description of an operation available for Microsoft.Web resource + /// provider. + /// public partial class CsmOperationDescription { - /// Initializes a new instance of CsmOperationDescription. - internal CsmOperationDescription() + /// + /// Initializes a new instance of the CsmOperationDescription class. + /// + public CsmOperationDescription() { + CustomInit(); } - /// Initializes a new instance of CsmOperationDescription. - /// . - /// Meta data about operation used for display in portal. - /// . - /// Properties available for a Microsoft.Web resource provider operation. - internal CsmOperationDescription(string name, CsmOperationDisplay display, string origin, CsmOperationDescriptionProperties properties) + /// + /// Initializes a new instance of the CsmOperationDescription class. + /// + public CsmOperationDescription(string name = default(string), CsmOperationDisplay display = default(CsmOperationDisplay), string origin = default(string), CsmOperationDescriptionProperties properties = default(CsmOperationDescriptionProperties)) { Name = name; Display = display; Origin = origin; Properties = properties; + CustomInit(); } - public string Name { get; } - /// Meta data about operation used for display in portal. - public CsmOperationDisplay Display { get; } - public string Origin { get; } - /// Properties available for a Microsoft.Web resource provider operation. - public CsmOperationDescriptionProperties Properties { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "display")] + public CsmOperationDisplay Display { get; set; } + + /// + /// + [JsonProperty(PropertyName = "origin")] + public string Origin { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties")] + public CsmOperationDescriptionProperties Properties { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs deleted file mode 100644 index 69996bedbfe9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CsmOperationDescriptionProperties - { - internal static CsmOperationDescriptionProperties DeserializeCsmOperationDescriptionProperties(JsonElement element) - { - Optional serviceSpecification = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("serviceSpecification")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - serviceSpecification = ServiceSpecification.DeserializeServiceSpecification(property.Value); - continue; - } - } - return new CsmOperationDescriptionProperties(serviceSpecification.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.cs index 88ade7c2c5a2..2c2db9daf03d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDescriptionProperties.cs @@ -1,28 +1,51 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Properties available for a Microsoft.Web resource provider operation. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties available for a Microsoft.Web resource provider operation. + /// public partial class CsmOperationDescriptionProperties { - /// Initializes a new instance of CsmOperationDescriptionProperties. - internal CsmOperationDescriptionProperties() + /// + /// Initializes a new instance of the CsmOperationDescriptionProperties + /// class. + /// + public CsmOperationDescriptionProperties() { + CustomInit(); } - /// Initializes a new instance of CsmOperationDescriptionProperties. - /// Resource metrics service provided by Microsoft.Insights resource provider. - internal CsmOperationDescriptionProperties(ServiceSpecification serviceSpecification) + /// + /// Initializes a new instance of the CsmOperationDescriptionProperties + /// class. + /// + public CsmOperationDescriptionProperties(ServiceSpecification serviceSpecification = default(ServiceSpecification)) { ServiceSpecification = serviceSpecification; + CustomInit(); } - /// Resource metrics service provided by Microsoft.Insights resource provider. - public ServiceSpecification ServiceSpecification { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "serviceSpecification")] + public ServiceSpecification ServiceSpecification { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.Serialization.cs deleted file mode 100644 index d3e75cadd874..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CsmOperationDisplay - { - internal static CsmOperationDisplay DeserializeCsmOperationDisplay(JsonElement element) - { - Optional provider = default; - Optional resource = default; - Optional operation = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("provider")) - { - provider = property.Value.GetString(); - continue; - } - if (property.NameEquals("resource")) - { - resource = property.Value.GetString(); - continue; - } - if (property.NameEquals("operation")) - { - operation = property.Value.GetString(); - continue; - } - if (property.NameEquals("description")) - { - description = property.Value.GetString(); - continue; - } - } - return new CsmOperationDisplay(provider.Value, resource.Value, operation.Value, description.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.cs index 82c6553b4b2b..e22e286ff398 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmOperationDisplay.cs @@ -1,36 +1,67 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Meta data about operation used for display in portal. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Meta data about operation used for display in portal. + /// public partial class CsmOperationDisplay { - /// Initializes a new instance of CsmOperationDisplay. - internal CsmOperationDisplay() + /// + /// Initializes a new instance of the CsmOperationDisplay class. + /// + public CsmOperationDisplay() { + CustomInit(); } - /// Initializes a new instance of CsmOperationDisplay. - /// . - /// . - /// . - /// . - internal CsmOperationDisplay(string provider, string resource, string operation, string description) + /// + /// Initializes a new instance of the CsmOperationDisplay class. + /// + public CsmOperationDisplay(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(); } - public string Provider { get; } - public string Resource { get; } - public string Operation { get; } - public string Description { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + /// + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.Serialization.cs deleted file mode 100644 index 95642e8ea39b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.Serialization.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CsmPublishingCredentialsPoliciesCollection : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Ftp)) - { - writer.WritePropertyName("ftp"); - writer.WriteObjectValue(Ftp); - } - if (Optional.IsDefined(Scm)) - { - writer.WritePropertyName("scm"); - writer.WriteObjectValue(Scm); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static CsmPublishingCredentialsPoliciesCollection DeserializeCsmPublishingCredentialsPoliciesCollection(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional ftp = default; - Optional scm = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("ftp")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - ftp = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(property0.Value); - continue; - } - if (property0.NameEquals("scm")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - scm = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(property0.Value); - continue; - } - } - continue; - } - } - return new CsmPublishingCredentialsPoliciesCollection(id.Value, name.Value, kind.Value, type.Value, ftp.Value, scm.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.cs index 02750462c671..364b186fed71 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesCollection.cs @@ -1,36 +1,94 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Publishing Credentials Policies collection. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Publishing Credentials Policies collection. + /// + [Rest.Serialization.JsonTransformation] public partial class CsmPublishingCredentialsPoliciesCollection : ProxyOnlyResource { - /// Initializes a new instance of CsmPublishingCredentialsPoliciesCollection. + /// + /// Initializes a new instance of the + /// CsmPublishingCredentialsPoliciesCollection class. + /// public CsmPublishingCredentialsPoliciesCollection() { + CustomInit(); } - /// Initializes a new instance of CsmPublishingCredentialsPoliciesCollection. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Whether FTP is allowed. - /// Whether Scm Basic Auth is allowed. - internal CsmPublishingCredentialsPoliciesCollection(string id, string name, string kind, string type, CsmPublishingCredentialsPoliciesEntity ftp, CsmPublishingCredentialsPoliciesEntity scm) : base(id, name, kind, type) + /// + /// Initializes a new instance of the + /// CsmPublishingCredentialsPoliciesCollection class. + /// + /// Whether FTP is allowed. + /// Whether Scm Basic Auth is allowed. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public CsmPublishingCredentialsPoliciesCollection(CsmPublishingCredentialsPoliciesEntity ftp, CsmPublishingCredentialsPoliciesEntity scm, string id = default(string), string name = default(string), string kind = default(string), string type = default(string)) + : base(id, name, kind, type) { Ftp = ftp; Scm = scm; + CustomInit(); } - /// Whether FTP is allowed. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets whether FTP is allowed. + /// + [JsonProperty(PropertyName = "properties.ftp")] public CsmPublishingCredentialsPoliciesEntity Ftp { get; set; } - /// Whether Scm Basic Auth is allowed. + + /// + /// Gets or sets whether Scm Basic Auth is allowed. + /// + [JsonProperty(PropertyName = "properties.scm")] public CsmPublishingCredentialsPoliciesEntity Scm { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Ftp == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Ftp"); + } + if (Scm == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Scm"); + } + if (Ftp != null) + { + Ftp.Validate(); + } + if (Scm != null) + { + Scm.Validate(); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.Serialization.cs deleted file mode 100644 index bfacbbff92bb..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.Serialization.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CsmPublishingCredentialsPoliciesEntity : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Allow)) - { - writer.WritePropertyName("allow"); - writer.WriteBooleanValue(Allow.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static CsmPublishingCredentialsPoliciesEntity DeserializeCsmPublishingCredentialsPoliciesEntity(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional allow = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("allow")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - allow = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new CsmPublishingCredentialsPoliciesEntity(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(allow)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.cs index 5d41bffff318..3b389e6e76fa 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingCredentialsPoliciesEntity.cs @@ -1,32 +1,75 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Publishing Credentials Policies parameters. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Publishing Credentials Policies parameters. + /// + [Rest.Serialization.JsonTransformation] public partial class CsmPublishingCredentialsPoliciesEntity : ProxyOnlyResource { - /// Initializes a new instance of CsmPublishingCredentialsPoliciesEntity. + /// + /// Initializes a new instance of the + /// CsmPublishingCredentialsPoliciesEntity class. + /// public CsmPublishingCredentialsPoliciesEntity() { + CustomInit(); } - /// Initializes a new instance of CsmPublishingCredentialsPoliciesEntity. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>true</code> to allow access to a publishing method; otherwise, <code>false</code>. - internal CsmPublishingCredentialsPoliciesEntity(string id, string name, string kind, string type, bool? allow) : base(id, name, kind, type) + /// + /// Initializes a new instance of the + /// CsmPublishingCredentialsPoliciesEntity class. + /// + /// <code>true</code> to allow access + /// to a publishing method; otherwise, + /// <code>false</code>. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public CsmPublishingCredentialsPoliciesEntity(bool allow, string id = default(string), string name = default(string), string kind = default(string), string type = default(string)) + : base(id, name, kind, type) { Allow = allow; + CustomInit(); } - /// <code>true</code> to allow access to a publishing method; otherwise, <code>false</code>. - public bool? Allow { get; set; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to allow + /// access to a publishing method; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.allow")] + public bool Allow { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.Serialization.cs deleted file mode 100644 index f2b9674f8c01..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.Serialization.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CsmPublishingProfileOptions : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Format)) - { - writer.WritePropertyName("format"); - writer.WriteStringValue(Format.Value.ToString()); - } - if (Optional.IsDefined(IncludeDisasterRecoveryEndpoints)) - { - writer.WritePropertyName("includeDisasterRecoveryEndpoints"); - writer.WriteBooleanValue(IncludeDisasterRecoveryEndpoints.Value); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.cs index 86b308d82a55..ab77ff58b750 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmPublishingProfileOptions.cs @@ -1,28 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Publishing options for requested profile. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Publishing options for requested profile. + /// public partial class CsmPublishingProfileOptions { - /// Initializes a new instance of CsmPublishingProfileOptions. + /// + /// Initializes a new instance of the CsmPublishingProfileOptions + /// class. + /// public CsmPublishingProfileOptions() { + CustomInit(); } /// - /// Name of the format. Valid values are: + /// Initializes a new instance of the CsmPublishingProfileOptions + /// class. + /// + /// Name of the format. Valid values are: /// FileZilla3 /// WebDeploy -- default - /// Ftp. + /// Ftp. Possible values include: 'FileZilla3', 'WebDeploy', + /// 'Ftp' + /// Include the + /// DisasterRecover endpoint if true + public CsmPublishingProfileOptions(string format = default(string), bool? includeDisasterRecoveryEndpoints = default(bool?)) + { + Format = format; + IncludeDisasterRecoveryEndpoints = includeDisasterRecoveryEndpoints; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults /// - public PublishingProfileFormat? Format { get; set; } - /// Include the DisasterRecover endpoint if true. + partial void CustomInit(); + + /// + /// Gets or sets name of the format. Valid values are: + /// FileZilla3 + /// WebDeploy -- default + /// Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + /// + [JsonProperty(PropertyName = "format")] + public string Format { get; set; } + + /// + /// Gets or sets include the DisasterRecover endpoint if true + /// + [JsonProperty(PropertyName = "includeDisasterRecoveryEndpoints")] public bool? IncludeDisasterRecoveryEndpoints { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.Serialization.cs deleted file mode 100644 index 49335c1caa12..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.Serialization.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CsmSlotEntity : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("targetSlot"); - writer.WriteStringValue(TargetSlot); - writer.WritePropertyName("preserveVnet"); - writer.WriteBooleanValue(PreserveVnet); - writer.WriteEndObject(); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.cs index 956f34622e45..ab57d287cfc7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmSlotEntity.cs @@ -1,35 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Deployment slot parameters. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Deployment slot parameters. + /// public partial class CsmSlotEntity { - /// Initializes a new instance of CsmSlotEntity. - /// Destination deployment slot during swap operation. - /// <code>true</code> to preserve Virtual Network to the slot during swap; otherwise, <code>false</code>. - /// is null. - public CsmSlotEntity(string targetSlot, bool preserveVnet) + /// + /// Initializes a new instance of the CsmSlotEntity class. + /// + public CsmSlotEntity() { - if (targetSlot == null) - { - throw new ArgumentNullException(nameof(targetSlot)); - } + CustomInit(); + } + /// + /// Initializes a new instance of the CsmSlotEntity class. + /// + /// Destination deployment slot during swap + /// operation. + /// <code>true</code> to + /// preserve Virtual Network to the slot during swap; otherwise, + /// <code>false</code>. + public CsmSlotEntity(string targetSlot, bool preserveVnet) + { TargetSlot = targetSlot; PreserveVnet = preserveVnet; + CustomInit(); } - /// Destination deployment slot during swap operation. - public string TargetSlot { get; } - /// <code>true</code> to preserve Virtual Network to the slot during swap; otherwise, <code>false</code>. - public bool PreserveVnet { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets destination deployment slot during swap operation. + /// + [JsonProperty(PropertyName = "targetSlot")] + public string TargetSlot { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// preserve Virtual Network to the slot during swap; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "preserveVnet")] + public bool PreserveVnet { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TargetSlot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetSlot"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.Serialization.cs deleted file mode 100644 index 644010ed33ec..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.Serialization.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CsmUsageQuota - { - internal static CsmUsageQuota DeserializeCsmUsageQuota(JsonElement element) - { - Optional unit = default; - Optional nextResetTime = default; - Optional currentValue = default; - Optional limit = default; - Optional name = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("unit")) - { - unit = property.Value.GetString(); - continue; - } - if (property.NameEquals("nextResetTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - nextResetTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("currentValue")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - currentValue = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("limit")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - limit = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("name")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - name = LocalizableString.DeserializeLocalizableString(property.Value); - continue; - } - } - return new CsmUsageQuota(unit.Value, Optional.ToNullable(nextResetTime), Optional.ToNullable(currentValue), Optional.ToNullable(limit), name.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.cs index a397ee5bb02f..8ebed8720d9e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuota.cs @@ -1,46 +1,86 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Usage of the quota resource. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Usage of the quota resource. + /// public partial class CsmUsageQuota { - /// Initializes a new instance of CsmUsageQuota. - internal CsmUsageQuota() + /// + /// Initializes a new instance of the CsmUsageQuota class. + /// + public CsmUsageQuota() { + CustomInit(); } - /// Initializes a new instance of CsmUsageQuota. - /// Units of measurement for the quota resource. - /// Next reset time for the resource counter. - /// The current value of the resource counter. - /// The resource limit. - /// Quota name. - internal CsmUsageQuota(string unit, DateTimeOffset? nextResetTime, long? currentValue, long? limit, LocalizableString name) + /// + /// Initializes a new instance of the CsmUsageQuota class. + /// + /// Units of measurement for the quota + /// resource. + /// Next reset time for the resource + /// counter. + /// The current value of the resource + /// counter. + /// The resource limit. + /// Quota name. + public CsmUsageQuota(string unit = default(string), System.DateTime? nextResetTime = default(System.DateTime?), long? currentValue = default(long?), long? limit = default(long?), LocalizableString name = default(LocalizableString)) { Unit = unit; NextResetTime = nextResetTime; CurrentValue = currentValue; Limit = limit; Name = name; + CustomInit(); } - /// Units of measurement for the quota resource. - public string Unit { get; } - /// Next reset time for the resource counter. - public DateTimeOffset? NextResetTime { get; } - /// The current value of the resource counter. - public long? CurrentValue { get; } - /// The resource limit. - public long? Limit { get; } - /// Quota name. - public LocalizableString Name { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets units of measurement for the quota resource. + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + /// + /// Gets or sets next reset time for the resource counter. + /// + [JsonProperty(PropertyName = "nextResetTime")] + public System.DateTime? NextResetTime { get; set; } + + /// + /// Gets or sets the current value of the resource counter. + /// + [JsonProperty(PropertyName = "currentValue")] + public long? CurrentValue { get; set; } + + /// + /// Gets or sets the resource limit. + /// + [JsonProperty(PropertyName = "limit")] + public long? Limit { get; set; } + + /// + /// Gets or sets quota name. + /// + [JsonProperty(PropertyName = "name")] + public LocalizableString Name { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.Serialization.cs deleted file mode 100644 index 024487639e6e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class CsmUsageQuotaCollection - { - internal static CsmUsageQuotaCollection DeserializeCsmUsageQuotaCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CsmUsageQuota.DeserializeCsmUsageQuota(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new CsmUsageQuotaCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.cs deleted file mode 100644 index c938bd4d8083..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmUsageQuotaCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of CSM usage quotas. - internal partial class CsmUsageQuotaCollection - { - /// Initializes a new instance of CsmUsageQuotaCollection. - /// Collection of resources. - /// is null. - internal CsmUsageQuotaCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of CsmUsageQuotaCollection. - /// Collection of resources. - /// Link to next page of resources. - internal CsmUsageQuotaCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs deleted file mode 100644 index 4dd12a03d6e2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The status of the custom domain. - public readonly partial struct CustomDomainStatus : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public CustomDomainStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RetrievingValidationTokenValue = "RetrievingValidationToken"; - private const string ValidatingValue = "Validating"; - private const string AddingValue = "Adding"; - private const string ReadyValue = "Ready"; - private const string FailedValue = "Failed"; - private const string DeletingValue = "Deleting"; - - /// RetrievingValidationToken. - public static CustomDomainStatus RetrievingValidationToken { get; } = new CustomDomainStatus(RetrievingValidationTokenValue); - /// Validating. - public static CustomDomainStatus Validating { get; } = new CustomDomainStatus(ValidatingValue); - /// Adding. - public static CustomDomainStatus Adding { get; } = new CustomDomainStatus(AddingValue); - /// Ready. - public static CustomDomainStatus Ready { get; } = new CustomDomainStatus(ReadyValue); - /// Failed. - public static CustomDomainStatus Failed { get; } = new CustomDomainStatus(FailedValue); - /// Deleting. - public static CustomDomainStatus Deleting { get; } = new CustomDomainStatus(DeletingValue); - /// Determines if two values are the same. - public static bool operator ==(CustomDomainStatus left, CustomDomainStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CustomDomainStatus left, CustomDomainStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator CustomDomainStatus(string value) => new CustomDomainStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CustomDomainStatus other && Equals(other); - /// - public bool Equals(CustomDomainStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.Serialization.cs deleted file mode 100644 index de43ae73baa8..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class CustomHostNameDnsRecordTypeExtensions - { - public static string ToSerialString(this CustomHostNameDnsRecordType value) => value switch - { - CustomHostNameDnsRecordType.CName => "CName", - CustomHostNameDnsRecordType.A => "A", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CustomHostNameDnsRecordType value.") - }; - - public static CustomHostNameDnsRecordType ToCustomHostNameDnsRecordType(this string value) - { - if (string.Equals(value, "CName", StringComparison.InvariantCultureIgnoreCase)) return CustomHostNameDnsRecordType.CName; - if (string.Equals(value, "A", StringComparison.InvariantCultureIgnoreCase)) return CustomHostNameDnsRecordType.A; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CustomHostNameDnsRecordType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.cs index 647c8418f5d1..9226829dbeae 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostNameDnsRecordType.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Type of the DNS record. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for CustomHostNameDnsRecordType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum CustomHostNameDnsRecordType { - /// CName. + [EnumMember(Value = "CName")] CName, - /// A. + [EnumMember(Value = "A")] A } + internal static class CustomHostNameDnsRecordTypeEnumExtension + { + internal static string ToSerializedValue(this CustomHostNameDnsRecordType? value) + { + return value == null ? null : ((CustomHostNameDnsRecordType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this CustomHostNameDnsRecordType value) + { + switch( value ) + { + case CustomHostNameDnsRecordType.CName: + return "CName"; + case CustomHostNameDnsRecordType.A: + return "A"; + } + return null; + } + + internal static CustomHostNameDnsRecordType? ParseCustomHostNameDnsRecordType(this string value) + { + switch( value ) + { + case "CName": + return CustomHostNameDnsRecordType.CName; + case "A": + return CustomHostNameDnsRecordType.A; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.Serialization.cs deleted file mode 100644 index 18ca16f89f18..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.Serialization.cs +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CustomHostnameAnalysisResult : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(CNameRecords)) - { - writer.WritePropertyName("cNameRecords"); - writer.WriteStartArray(); - foreach (var item in CNameRecords) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(TxtRecords)) - { - writer.WritePropertyName("txtRecords"); - writer.WriteStartArray(); - foreach (var item in TxtRecords) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ARecords)) - { - writer.WritePropertyName("aRecords"); - writer.WriteStartArray(); - foreach (var item in ARecords) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(AlternateCNameRecords)) - { - writer.WritePropertyName("alternateCNameRecords"); - writer.WriteStartArray(); - foreach (var item in AlternateCNameRecords) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(AlternateTxtRecords)) - { - writer.WritePropertyName("alternateTxtRecords"); - writer.WriteStartArray(); - foreach (var item in AlternateTxtRecords) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static CustomHostnameAnalysisResult DeserializeCustomHostnameAnalysisResult(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional isHostnameAlreadyVerified = default; - Optional customDomainVerificationTest = default; - Optional customDomainVerificationFailureInfo = default; - Optional hasConflictOnScaleUnit = default; - Optional hasConflictAcrossSubscription = default; - Optional conflictingAppResourceId = default; - Optional> cNameRecords = default; - Optional> txtRecords = default; - Optional> aRecords = default; - Optional> alternateCNameRecords = default; - Optional> alternateTxtRecords = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("isHostnameAlreadyVerified")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isHostnameAlreadyVerified = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("customDomainVerificationTest")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - customDomainVerificationTest = property0.Value.GetString().ToDnsVerificationTestResult(); - continue; - } - if (property0.NameEquals("customDomainVerificationFailureInfo")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - customDomainVerificationFailureInfo = ErrorEntity.DeserializeErrorEntity(property0.Value); - continue; - } - if (property0.NameEquals("hasConflictOnScaleUnit")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hasConflictOnScaleUnit = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("hasConflictAcrossSubscription")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hasConflictAcrossSubscription = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("conflictingAppResourceId")) - { - conflictingAppResourceId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("cNameRecords")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - cNameRecords = array; - continue; - } - if (property0.NameEquals("txtRecords")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - txtRecords = array; - continue; - } - if (property0.NameEquals("aRecords")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - aRecords = array; - continue; - } - if (property0.NameEquals("alternateCNameRecords")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - alternateCNameRecords = array; - continue; - } - if (property0.NameEquals("alternateTxtRecords")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - alternateTxtRecords = array; - continue; - } - } - continue; - } - } - return new CustomHostnameAnalysisResult(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(isHostnameAlreadyVerified), Optional.ToNullable(customDomainVerificationTest), customDomainVerificationFailureInfo.Value, Optional.ToNullable(hasConflictOnScaleUnit), Optional.ToNullable(hasConflictAcrossSubscription), conflictingAppResourceId.Value, Optional.ToList(cNameRecords), Optional.ToList(txtRecords), Optional.ToList(aRecords), Optional.ToList(alternateCNameRecords), Optional.ToList(alternateTxtRecords)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.cs index 551406042555..78dddad2e52e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomHostnameAnalysisResult.cs @@ -1,45 +1,75 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Custom domain analysis. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Custom domain analysis. + /// + [Rest.Serialization.JsonTransformation] public partial class CustomHostnameAnalysisResult : ProxyOnlyResource { - /// Initializes a new instance of CustomHostnameAnalysisResult. + /// + /// Initializes a new instance of the CustomHostnameAnalysisResult + /// class. + /// public CustomHostnameAnalysisResult() { - CNameRecords = new ChangeTrackingList(); - TxtRecords = new ChangeTrackingList(); - ARecords = new ChangeTrackingList(); - AlternateCNameRecords = new ChangeTrackingList(); - AlternateTxtRecords = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of CustomHostnameAnalysisResult. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>true</code> if hostname is already verified; otherwise, <code>false</code>. - /// DNS verification test result. - /// Raw failure information if DNS verification fails. - /// <code>true</code> if there is a conflict on a scale unit; otherwise, <code>false</code>. - /// <code>true</code> if there is a conflict across subscriptions; otherwise, <code>false</code>. - /// Name of the conflicting app on scale unit if it's within the same subscription. - /// CName records controller can see for this hostname. - /// TXT records controller can see for this hostname. - /// A records controller can see for this hostname. - /// Alternate CName records controller can see for this hostname. - /// Alternate TXT records controller can see for this hostname. - internal CustomHostnameAnalysisResult(string id, string name, string kind, string type, bool? isHostnameAlreadyVerified, DnsVerificationTestResult? customDomainVerificationTest, ErrorEntity customDomainVerificationFailureInfo, bool? hasConflictOnScaleUnit, bool? hasConflictAcrossSubscription, string conflictingAppResourceId, IList cNameRecords, IList txtRecords, IList aRecords, IList alternateCNameRecords, IList alternateTxtRecords) : base(id, name, kind, type) + /// + /// Initializes a new instance of the CustomHostnameAnalysisResult + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>true</code> if + /// hostname is already verified; otherwise, + /// <code>false</code>. + /// DNS verification test + /// result. Possible values include: 'Passed', 'Failed', + /// 'Skipped' + /// Raw failure + /// information if DNS verification fails. + /// <code>true</code> + /// if there is a conflict on a scale unit; otherwise, + /// <code>false</code>. + /// <code>true</code> + /// if there is a conflict across subscriptions; otherwise, + /// <code>false</code>. + /// Name of the conflicting app + /// on scale unit if it's within the same subscription. + /// CName records controller can see for + /// this hostname. + /// TXT records controller can see for this + /// hostname. + /// A records controller can see for this + /// hostname. + /// Alternate CName records + /// controller can see for this hostname. + /// Alternate TXT records controller + /// can see for this hostname. + public CustomHostnameAnalysisResult(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? isHostnameAlreadyVerified = default(bool?), DnsVerificationTestResult? customDomainVerificationTest = default(DnsVerificationTestResult?), ErrorEntity customDomainVerificationFailureInfo = default(ErrorEntity), bool? hasConflictOnScaleUnit = default(bool?), bool? hasConflictAcrossSubscription = default(bool?), string conflictingAppResourceId = default(string), IList cNameRecords = default(IList), IList txtRecords = default(IList), IList aRecords = default(IList), IList alternateCNameRecords = default(IList), IList alternateTxtRecords = default(IList)) + : base(id, name, kind, type) { IsHostnameAlreadyVerified = isHostnameAlreadyVerified; CustomDomainVerificationTest = customDomainVerificationTest; @@ -52,29 +82,89 @@ internal CustomHostnameAnalysisResult(string id, string name, string kind, strin ARecords = aRecords; AlternateCNameRecords = alternateCNameRecords; AlternateTxtRecords = alternateTxtRecords; + CustomInit(); } - /// <code>true</code> if hostname is already verified; otherwise, <code>false</code>. - public bool? IsHostnameAlreadyVerified { get; } - /// DNS verification test result. - public DnsVerificationTestResult? CustomDomainVerificationTest { get; } - /// Raw failure information if DNS verification fails. - public ErrorEntity CustomDomainVerificationFailureInfo { get; } - /// <code>true</code> if there is a conflict on a scale unit; otherwise, <code>false</code>. - public bool? HasConflictOnScaleUnit { get; } - /// <code>true</code> if there is a conflict across subscriptions; otherwise, <code>false</code>. - public bool? HasConflictAcrossSubscription { get; } - /// Name of the conflicting app on scale unit if it's within the same subscription. - public string ConflictingAppResourceId { get; } - /// CName records controller can see for this hostname. - public IList CNameRecords { get; } - /// TXT records controller can see for this hostname. - public IList TxtRecords { get; } - /// A records controller can see for this hostname. - public IList ARecords { get; } - /// Alternate CName records controller can see for this hostname. - public IList AlternateCNameRecords { get; } - /// Alternate TXT records controller can see for this hostname. - public IList AlternateTxtRecords { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if hostname is + /// already verified; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.isHostnameAlreadyVerified")] + public bool? IsHostnameAlreadyVerified { get; private set; } + + /// + /// Gets DNS verification test result. Possible values include: + /// 'Passed', 'Failed', 'Skipped' + /// + [JsonProperty(PropertyName = "properties.customDomainVerificationTest")] + public DnsVerificationTestResult? CustomDomainVerificationTest { get; private set; } + + /// + /// Gets raw failure information if DNS verification fails. + /// + [JsonProperty(PropertyName = "properties.customDomainVerificationFailureInfo")] + public ErrorEntity CustomDomainVerificationFailureInfo { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if there is a + /// conflict on a scale unit; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.hasConflictOnScaleUnit")] + public bool? HasConflictOnScaleUnit { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if there is a + /// conflict across subscriptions; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.hasConflictAcrossSubscription")] + public bool? HasConflictAcrossSubscription { get; private set; } + + /// + /// Gets name of the conflicting app on scale unit if it's within the + /// same subscription. + /// + [JsonProperty(PropertyName = "properties.conflictingAppResourceId")] + public string ConflictingAppResourceId { get; private set; } + + /// + /// Gets or sets cName records controller can see for this hostname. + /// + [JsonProperty(PropertyName = "properties.cNameRecords")] + public IList CNameRecords { get; set; } + + /// + /// Gets or sets TXT records controller can see for this hostname. + /// + [JsonProperty(PropertyName = "properties.txtRecords")] + public IList TxtRecords { get; set; } + + /// + /// Gets or sets a records controller can see for this hostname. + /// + [JsonProperty(PropertyName = "properties.aRecords")] + public IList ARecords { get; set; } + + /// + /// Gets or sets alternate CName records controller can see for this + /// hostname. + /// + [JsonProperty(PropertyName = "properties.alternateCNameRecords")] + public IList AlternateCNameRecords { get; set; } + + /// + /// Gets or sets alternate TXT records controller can see for this + /// hostname. + /// + [JsonProperty(PropertyName = "properties.alternateTxtRecords")] + public IList AlternateTxtRecords { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.Serialization.cs deleted file mode 100644 index d3caa8d88bfe..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.Serialization.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class CustomOpenIdConnectProvider : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(Registration)) - { - writer.WritePropertyName("registration"); - writer.WriteObjectValue(Registration); - } - if (Optional.IsDefined(Login)) - { - writer.WritePropertyName("login"); - writer.WriteObjectValue(Login); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static CustomOpenIdConnectProvider DeserializeCustomOpenIdConnectProvider(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional registration = default; - Optional login = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("registration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - registration = OpenIdConnectRegistration.DeserializeOpenIdConnectRegistration(property0.Value); - continue; - } - if (property0.NameEquals("login")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - login = OpenIdConnectLogin.DeserializeOpenIdConnectLogin(property0.Value); - continue; - } - } - continue; - } - } - return new CustomOpenIdConnectProvider(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, login.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.cs index c4fd38bc6640..c6bcf20e8429 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.cs @@ -1,40 +1,68 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the custom Open ID Connect provider. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class CustomOpenIdConnectProvider : ProxyOnlyResource { - /// Initializes a new instance of CustomOpenIdConnectProvider. + /// + /// Initializes a new instance of the CustomOpenIdConnectProvider + /// class. + /// public CustomOpenIdConnectProvider() { + CustomInit(); } - /// Initializes a new instance of CustomOpenIdConnectProvider. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>false</code> if the custom Open ID provider provider should not be enabled; otherwise, <code>true</code>. - /// The configuration settings of the app registration for the custom Open ID Connect provider. - /// The configuration settings of the login flow of the custom Open ID Connect provider. - internal CustomOpenIdConnectProvider(string id, string name, string kind, string type, bool? enabled, OpenIdConnectRegistration registration, OpenIdConnectLogin login) : base(id, name, kind, type) + /// + /// Initializes a new instance of the CustomOpenIdConnectProvider + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public CustomOpenIdConnectProvider(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), OpenIdConnectRegistration registration = default(OpenIdConnectRegistration), OpenIdConnectLogin login = default(OpenIdConnectLogin)) + : base(id, name, kind, type) { Enabled = enabled; Registration = registration; Login = login; + CustomInit(); } - /// <code>false</code> if the custom Open ID provider provider should not be enabled; otherwise, <code>true</code>. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } - /// The configuration settings of the app registration for the custom Open ID Connect provider. + + /// + /// + [JsonProperty(PropertyName = "properties.registration")] public OpenIdConnectRegistration Registration { get; set; } - /// The configuration settings of the login flow of the custom Open ID Connect provider. + + /// + /// + [JsonProperty(PropertyName = "properties.login")] public OpenIdConnectLogin Login { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.Serialization.cs deleted file mode 100644 index afa42df1a4c1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.Serialization.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DataProviderMetadata : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ProviderName)) - { - writer.WritePropertyName("providerName"); - writer.WriteStringValue(ProviderName); - } - writer.WriteEndObject(); - } - - internal static DataProviderMetadata DeserializeDataProviderMetadata(JsonElement element) - { - Optional providerName = default; - Optional> propertyBag = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("providerName")) - { - providerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("propertyBag")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(KeyValuePairStringObject.DeserializeKeyValuePairStringObject(item)); - } - propertyBag = array; - continue; - } - } - return new DataProviderMetadata(providerName.Value, Optional.ToList(propertyBag)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs deleted file mode 100644 index f10919caebe1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Additional configuration for a data providers. - public partial class DataProviderMetadata - { - /// Initializes a new instance of DataProviderMetadata. - public DataProviderMetadata() - { - PropertyBag = new ChangeTrackingList(); - } - - /// Initializes a new instance of DataProviderMetadata. - /// . - /// Settings for the data provider. - internal DataProviderMetadata(string providerName, IReadOnlyList propertyBag) - { - ProviderName = providerName; - PropertyBag = propertyBag; - } - - public string ProviderName { get; set; } - /// Settings for the data provider. - public IReadOnlyList PropertyBag { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.Serialization.cs deleted file mode 100644 index 7f3d5e7453d2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.Serialization.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DataSource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Instructions)) - { - writer.WritePropertyName("instructions"); - writer.WriteStartArray(); - foreach (var item in Instructions) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(DataSourceUri)) - { - writer.WritePropertyName("dataSourceUri"); - writer.WriteStartArray(); - foreach (var item in DataSourceUri) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static DataSource DeserializeDataSource(JsonElement element) - { - Optional> instructions = default; - Optional> dataSourceUri = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("instructions")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - instructions = array; - continue; - } - if (property.NameEquals("dataSourceUri")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NameValuePair.DeserializeNameValuePair(item)); - } - dataSourceUri = array; - continue; - } - } - return new DataSource(Optional.ToList(instructions), Optional.ToList(dataSourceUri)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.cs index f26b3aa56c51..8b2f0198c7a7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataSource.cs @@ -1,37 +1,62 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Class representing data source used by the detectors. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Class representing data source used by the detectors + /// public partial class DataSource { - /// Initializes a new instance of DataSource. + /// + /// Initializes a new instance of the DataSource class. + /// public DataSource() { - Instructions = new ChangeTrackingList(); - DataSourceUri = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of DataSource. - /// Instructions if any for the data source. - /// Datasource Uri Links. - internal DataSource(IList instructions, IList dataSourceUri) + /// + /// Initializes a new instance of the DataSource class. + /// + /// Instructions if any for the data + /// source + /// Datasource Uri Links + public DataSource(IList instructions = default(IList), IList dataSourceUri = default(IList)) { Instructions = instructions; DataSourceUri = dataSourceUri; + CustomInit(); } - /// Instructions if any for the data source. - public IList Instructions { get; } - /// Datasource Uri Links. - public IList DataSourceUri { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets instructions if any for the data source + /// + [JsonProperty(PropertyName = "instructions")] + public IList Instructions { get; set; } + + /// + /// Gets or sets datasource Uri Links + /// + [JsonProperty(PropertyName = "dataSourceUri")] + public IList DataSourceUri { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.Serialization.cs deleted file mode 100644 index bef2d52223cb..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.Serialization.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DataTableResponseColumn : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ColumnName)) - { - writer.WritePropertyName("columnName"); - writer.WriteStringValue(ColumnName); - } - if (Optional.IsDefined(DataType)) - { - writer.WritePropertyName("dataType"); - writer.WriteStringValue(DataType); - } - if (Optional.IsDefined(ColumnType)) - { - writer.WritePropertyName("columnType"); - writer.WriteStringValue(ColumnType); - } - writer.WriteEndObject(); - } - - internal static DataTableResponseColumn DeserializeDataTableResponseColumn(JsonElement element) - { - Optional columnName = default; - Optional dataType = default; - Optional columnType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("columnName")) - { - columnName = property.Value.GetString(); - continue; - } - if (property.NameEquals("dataType")) - { - dataType = property.Value.GetString(); - continue; - } - if (property.NameEquals("columnType")) - { - columnType = property.Value.GetString(); - continue; - } - } - return new DataTableResponseColumn(columnName.Value, dataType.Value, columnType.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.cs index 86d269daa3e0..ecc4760a549b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseColumn.cs @@ -1,36 +1,68 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Column definition. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Column definition + /// public partial class DataTableResponseColumn { - /// Initializes a new instance of DataTableResponseColumn. + /// + /// Initializes a new instance of the DataTableResponseColumn class. + /// public DataTableResponseColumn() { + CustomInit(); } - /// Initializes a new instance of DataTableResponseColumn. - /// Name of the column. - /// Data type which looks like 'String' or 'Int32'. - /// Column Type. - internal DataTableResponseColumn(string columnName, string dataType, string columnType) + /// + /// Initializes a new instance of the DataTableResponseColumn class. + /// + /// Name of the column + /// Data type which looks like 'String' or + /// 'Int32'. + /// Column Type + public DataTableResponseColumn(string columnName = default(string), string dataType = default(string), string columnType = default(string)) { ColumnName = columnName; DataType = dataType; ColumnType = columnType; + CustomInit(); } - /// Name of the column. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the column + /// + [JsonProperty(PropertyName = "columnName")] public string ColumnName { get; set; } - /// Data type which looks like 'String' or 'Int32'. + + /// + /// Gets or sets data type which looks like 'String' or 'Int32'. + /// + [JsonProperty(PropertyName = "dataType")] public string DataType { get; set; } - /// Column Type. + + /// + /// Gets or sets column Type + /// + [JsonProperty(PropertyName = "columnType")] public string ColumnType { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.Serialization.cs deleted file mode 100644 index 16b8f9f8bd91..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.Serialization.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DataTableResponseObject : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(TableName)) - { - writer.WritePropertyName("tableName"); - writer.WriteStringValue(TableName); - } - if (Optional.IsCollectionDefined(Columns)) - { - writer.WritePropertyName("columns"); - writer.WriteStartArray(); - foreach (var item in Columns) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Rows)) - { - writer.WritePropertyName("rows"); - writer.WriteStartArray(); - foreach (var item in Rows) - { - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteStringValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static DataTableResponseObject DeserializeDataTableResponseObject(JsonElement element) - { - Optional tableName = default; - Optional> columns = default; - Optional>> rows = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tableName")) - { - tableName = property.Value.GetString(); - continue; - } - if (property.NameEquals("columns")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DataTableResponseColumn.DeserializeDataTableResponseColumn(item)); - } - columns = array; - continue; - } - if (property.NameEquals("rows")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - List array0 = new List(); - foreach (var item0 in item.EnumerateArray()) - { - array0.Add(item0.GetString()); - } - array.Add(array0); - } - rows = array; - continue; - } - } - return new DataTableResponseObject(tableName.Value, Optional.ToList(columns), Optional.ToList(rows)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.cs index 40294e694220..685a53bb99b9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataTableResponseObject.cs @@ -1,41 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Data Table which defines columns and raw row values. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Data Table which defines columns and raw row values + /// public partial class DataTableResponseObject { - /// Initializes a new instance of DataTableResponseObject. + /// + /// Initializes a new instance of the DataTableResponseObject class. + /// public DataTableResponseObject() { - Columns = new ChangeTrackingList(); - Rows = new ChangeTrackingList>(); + CustomInit(); } - /// Initializes a new instance of DataTableResponseObject. - /// Name of the table. - /// List of columns with data types. - /// Raw row values. - internal DataTableResponseObject(string tableName, IList columns, IList> rows) + /// + /// Initializes a new instance of the DataTableResponseObject class. + /// + /// Name of the table + /// List of columns with data types + /// Raw row values + public DataTableResponseObject(string tableName = default(string), IList columns = default(IList), IList> rows = default(IList>)) { TableName = tableName; Columns = columns; Rows = rows; + CustomInit(); } - /// Name of the table. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the table + /// + [JsonProperty(PropertyName = "tableName")] public string TableName { get; set; } - /// List of columns with data types. - public IList Columns { get; } - /// Raw row values. - public IList> Rows { get; } + + /// + /// Gets or sets list of columns with data types + /// + [JsonProperty(PropertyName = "columns")] + public IList Columns { get; set; } + + /// + /// Gets or sets raw row values + /// + [JsonProperty(PropertyName = "rows")] + public IList> Rows { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.Serialization.cs deleted file mode 100644 index 45754457ff6d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.Serialization.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DatabaseBackupSetting : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("databaseType"); - writer.WriteStringValue(DatabaseType.ToString()); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(ConnectionStringName)) - { - writer.WritePropertyName("connectionStringName"); - writer.WriteStringValue(ConnectionStringName); - } - if (Optional.IsDefined(ConnectionString)) - { - writer.WritePropertyName("connectionString"); - writer.WriteStringValue(ConnectionString); - } - writer.WriteEndObject(); - } - - internal static DatabaseBackupSetting DeserializeDatabaseBackupSetting(JsonElement element) - { - DatabaseType databaseType = default; - Optional name = default; - Optional connectionStringName = default; - Optional connectionString = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("databaseType")) - { - databaseType = new DatabaseType(property.Value.GetString()); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("connectionStringName")) - { - connectionStringName = property.Value.GetString(); - continue; - } - if (property.NameEquals("connectionString")) - { - connectionString = property.Value.GetString(); - continue; - } - } - return new DatabaseBackupSetting(databaseType, name.Value, connectionStringName.Value, connectionString.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.cs index a5506476e3a1..d8bd1344a233 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseBackupSetting.cs @@ -1,47 +1,101 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Database backup settings. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Database backup settings. + /// public partial class DatabaseBackupSetting { - /// Initializes a new instance of DatabaseBackupSetting. - /// Database type (e.g. SqlAzure / MySql). - public DatabaseBackupSetting(DatabaseType databaseType) + /// + /// Initializes a new instance of the DatabaseBackupSetting class. + /// + public DatabaseBackupSetting() { - DatabaseType = databaseType; + CustomInit(); } - /// Initializes a new instance of DatabaseBackupSetting. - /// Database type (e.g. SqlAzure / MySql). - /// . - /// - /// Contains a connection string name that is linked to the SiteConfig.ConnectionStrings. - /// This is used during restore with overwrite connection strings options. - /// - /// Contains a connection string to a database which is being backed up or restored. If the restore should happen to a new database, the database name inside is the new one. - internal DatabaseBackupSetting(DatabaseType databaseType, string name, string connectionStringName, string connectionString) + /// + /// Initializes a new instance of the DatabaseBackupSetting class. + /// + /// Database type (e.g. SqlAzure / MySql). + /// Possible values include: 'SqlAzure', 'MySql', 'LocalMySql', + /// 'PostgreSql' + /// Contains a connection string + /// name that is linked to the SiteConfig.ConnectionStrings. + /// This is used during restore with overwrite connection strings + /// options. + /// Contains a connection string to a + /// database which is being backed up or restored. If the restore + /// should happen to a new database, the database name inside is the + /// new one. + public DatabaseBackupSetting(string databaseType, string name = default(string), string connectionStringName = default(string), string connectionString = default(string)) { DatabaseType = databaseType; Name = name; ConnectionStringName = connectionStringName; ConnectionString = connectionString; + CustomInit(); } - /// Database type (e.g. SqlAzure / MySql). - public DatabaseType DatabaseType { get; set; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets database type (e.g. SqlAzure / MySql). Possible values + /// include: 'SqlAzure', 'MySql', 'LocalMySql', 'PostgreSql' + /// + [JsonProperty(PropertyName = "databaseType")] + public string DatabaseType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } + /// - /// Contains a connection string name that is linked to the SiteConfig.ConnectionStrings. - /// This is used during restore with overwrite connection strings options. + /// Gets or sets contains a connection string name that is linked to + /// the SiteConfig.ConnectionStrings. + /// This is used during restore with overwrite connection strings + /// options. /// + [JsonProperty(PropertyName = "connectionStringName")] public string ConnectionStringName { get; set; } - /// Contains a connection string to a database which is being backed up or restored. If the restore should happen to a new database, the database name inside is the new one. + + /// + /// Gets or sets contains a connection string to a database which is + /// being backed up or restored. If the restore should happen to a new + /// database, the database name inside is the new one. + /// + [JsonProperty(PropertyName = "connectionString")] public string ConnectionString { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DatabaseType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DatabaseType"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseType.cs index 445526091c66..ee4f92916ee0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DatabaseType.cs @@ -1,57 +1,24 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// Database type (e.g. SqlAzure / MySql). - public readonly partial struct DatabaseType : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public DatabaseType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string SqlAzureValue = "SqlAzure"; - private const string MySqlValue = "MySql"; - private const string LocalMySqlValue = "LocalMySql"; - private const string PostgreSqlValue = "PostgreSql"; - - /// SqlAzure. - public static DatabaseType SqlAzure { get; } = new DatabaseType(SqlAzureValue); - /// MySql. - public static DatabaseType MySql { get; } = new DatabaseType(MySqlValue); - /// LocalMySql. - public static DatabaseType LocalMySql { get; } = new DatabaseType(LocalMySqlValue); - /// PostgreSql. - public static DatabaseType PostgreSql { get; } = new DatabaseType(PostgreSqlValue); - /// Determines if two values are the same. - public static bool operator ==(DatabaseType left, DatabaseType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DatabaseType left, DatabaseType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DatabaseType(string value) => new DatabaseType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DatabaseType other && Equals(other); - /// - public bool Equals(DatabaseType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for DatabaseType. + /// + public static class DatabaseType + { + public const string SqlAzure = "SqlAzure"; + public const string MySql = "MySql"; + public const string LocalMySql = "LocalMySql"; + public const string PostgreSql = "PostgreSql"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.Serialization.cs deleted file mode 100644 index 90a436a6edae..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Xml.Linq; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class DefaultErrorResponse - { - internal static DefaultErrorResponse DeserializeDefaultErrorResponse(JsonElement element) - { - Optional error = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("error")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - error = DefaultErrorResponseError.DeserializeDefaultErrorResponseError(property.Value); - continue; - } - } - return new DefaultErrorResponse(error.Value); - } - - internal static DefaultErrorResponse DeserializeDefaultErrorResponse(XElement element) - { - DefaultErrorResponseError error = default; - if (element.Element("error") is XElement errorElement) - { - error = DefaultErrorResponseError.DeserializeDefaultErrorResponseError(errorElement); - } - return new DefaultErrorResponse(error); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.cs index ded42ee88475..f70bb4e938fa 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponse.cs @@ -1,28 +1,51 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// App Service error response. - internal partial class DefaultErrorResponse + using Newtonsoft.Json; + using System.Linq; + + /// + /// App Service error response. + /// + public partial class DefaultErrorResponse { - /// Initializes a new instance of DefaultErrorResponse. - internal DefaultErrorResponse() + /// + /// Initializes a new instance of the DefaultErrorResponse class. + /// + public DefaultErrorResponse() { + CustomInit(); } - /// Initializes a new instance of DefaultErrorResponse. - /// Error model. - internal DefaultErrorResponse(DefaultErrorResponseError error) + /// + /// Initializes a new instance of the DefaultErrorResponse class. + /// + /// Error model. + public DefaultErrorResponse(DefaultErrorResponseError error = default(DefaultErrorResponseError)) { Error = error; + CustomInit(); } - /// Error model. - public DefaultErrorResponseError Error { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets error model. + /// + [JsonProperty(PropertyName = "error")] + public DefaultErrorResponseError Error { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.Serialization.cs deleted file mode 100644 index 2f2fbef30c55..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.Serialization.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using System.Xml.Linq; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class DefaultErrorResponseError - { - internal static DefaultErrorResponseError DeserializeDefaultErrorResponseError(JsonElement element) - { - Optional code = default; - Optional message = default; - Optional target = default; - Optional> details = default; - Optional innererror = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code")) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message")) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("target")) - { - target = property.Value.GetString(); - continue; - } - if (property.NameEquals("details")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DefaultErrorResponseErrorDetailsItem.DeserializeDefaultErrorResponseErrorDetailsItem(item)); - } - details = array; - continue; - } - if (property.NameEquals("innererror")) - { - innererror = property.Value.GetString(); - continue; - } - } - return new DefaultErrorResponseError(code.Value, message.Value, target.Value, Optional.ToList(details), innererror.Value); - } - - internal static DefaultErrorResponseError DeserializeDefaultErrorResponseError(XElement element) - { - string code = default; - string message = default; - string target = default; - string innererror = default; - IReadOnlyList details = default; - if (element.Element("code") is XElement codeElement) - { - code = (string)codeElement; - } - if (element.Element("message") is XElement messageElement) - { - message = (string)messageElement; - } - if (element.Element("target") is XElement targetElement) - { - target = (string)targetElement; - } - if (element.Element("innererror") is XElement innererrorElement) - { - innererror = (string)innererrorElement; - } - var array = new List(); - foreach (var e in element.Elements("DefaultErrorResponseErrorDetailsItem")) - { - array.Add(DefaultErrorResponseErrorDetailsItem.DeserializeDefaultErrorResponseErrorDetailsItem(e)); - } - details = array; - return new DefaultErrorResponseError(code, message, target, details, innererror); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.cs index d13212bfb1f8..3c389512860f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseError.cs @@ -1,47 +1,86 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Error model. - internal partial class DefaultErrorResponseError + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Error model. + /// + public partial class DefaultErrorResponseError { - /// Initializes a new instance of DefaultErrorResponseError. - internal DefaultErrorResponseError() + /// + /// Initializes a new instance of the DefaultErrorResponseError class. + /// + public DefaultErrorResponseError() { - Details = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of DefaultErrorResponseError. - /// Standardized string to programmatically identify the error. - /// Detailed error description and debugging information. - /// Detailed error description and debugging information. - /// . - /// More information to debug error. - internal DefaultErrorResponseError(string code, string message, string target, IReadOnlyList details, string innererror) + /// + /// Initializes a new instance of the DefaultErrorResponseError class. + /// + /// Standardized string to programmatically identify + /// the error. + /// Detailed error description and debugging + /// information. + /// Detailed error description and debugging + /// information. + /// More information to debug error. + public DefaultErrorResponseError(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), string innererror = default(string)) { Code = code; Message = message; Target = target; Details = details; Innererror = innererror; + CustomInit(); } - /// Standardized string to programmatically identify the error. - public string Code { get; } - /// Detailed error description and debugging information. - public string Message { get; } - /// Detailed error description and debugging information. - public string Target { get; } - public IReadOnlyList Details { get; } - /// More information to debug error. - public string Innererror { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets standardized string to programmatically identify the error. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets detailed error description and debugging information. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets detailed error description and debugging information. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; set; } + + /// + /// Gets more information to debug error. + /// + [JsonProperty(PropertyName = "innererror")] + public string Innererror { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs deleted file mode 100644 index f31311c626ee..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.Serialization.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Xml.Linq; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class DefaultErrorResponseErrorDetailsItem - { - internal static DefaultErrorResponseErrorDetailsItem DeserializeDefaultErrorResponseErrorDetailsItem(JsonElement element) - { - Optional code = default; - Optional message = default; - Optional target = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code")) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message")) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("target")) - { - target = property.Value.GetString(); - continue; - } - } - return new DefaultErrorResponseErrorDetailsItem(code.Value, message.Value, target.Value); - } - - internal static DefaultErrorResponseErrorDetailsItem DeserializeDefaultErrorResponseErrorDetailsItem(XElement element) - { - string code = default; - string message = default; - string target = default; - if (element.Element("code") is XElement codeElement) - { - code = (string)codeElement; - } - if (element.Element("message") is XElement messageElement) - { - message = (string)messageElement; - } - if (element.Element("target") is XElement targetElement) - { - target = (string)targetElement; - } - return new DefaultErrorResponseErrorDetailsItem(code, message, target); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs index 8fcc9656c2fb..5a4b118818cc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DefaultErrorResponseErrorDetailsItem.cs @@ -1,36 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Detailed errors. - internal partial class DefaultErrorResponseErrorDetailsItem + using Newtonsoft.Json; + using System.Linq; + + /// + /// Detailed errors. + /// + public partial class DefaultErrorResponseErrorDetailsItem { - /// Initializes a new instance of DefaultErrorResponseErrorDetailsItem. - internal DefaultErrorResponseErrorDetailsItem() + /// + /// Initializes a new instance of the + /// DefaultErrorResponseErrorDetailsItem class. + /// + public DefaultErrorResponseErrorDetailsItem() { + CustomInit(); } - /// Initializes a new instance of DefaultErrorResponseErrorDetailsItem. - /// Standardized string to programmatically identify the error. - /// Detailed error description and debugging information. - /// Detailed error description and debugging information. - internal DefaultErrorResponseErrorDetailsItem(string code, string message, string target) + /// + /// Initializes a new instance of the + /// DefaultErrorResponseErrorDetailsItem class. + /// + /// Standardized string to programmatically identify + /// the error. + /// Detailed error description and debugging + /// information. + /// Detailed error description and debugging + /// information. + public DefaultErrorResponseErrorDetailsItem(string code = default(string), string message = default(string), string target = default(string)) { Code = code; Message = message; Target = target; + CustomInit(); } - /// Standardized string to programmatically identify the error. - public string Code { get; } - /// Detailed error description and debugging information. - public string Message { get; } - /// Detailed error description and debugging information. - public string Target { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets standardized string to programmatically identify the error. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets detailed error description and debugging information. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets detailed error description and debugging information. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.Serialization.cs deleted file mode 100644 index 0d5a91c81a0d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DeletedAppRestoreRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(DeletedSiteId)) - { - writer.WritePropertyName("deletedSiteId"); - writer.WriteStringValue(DeletedSiteId); - } - if (Optional.IsDefined(RecoverConfiguration)) - { - writer.WritePropertyName("recoverConfiguration"); - writer.WriteBooleanValue(RecoverConfiguration.Value); - } - if (Optional.IsDefined(SnapshotTime)) - { - writer.WritePropertyName("snapshotTime"); - writer.WriteStringValue(SnapshotTime); - } - if (Optional.IsDefined(UseDRSecondary)) - { - writer.WritePropertyName("useDRSecondary"); - writer.WriteBooleanValue(UseDRSecondary.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static DeletedAppRestoreRequest DeserializeDeletedAppRestoreRequest(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional deletedSiteId = default; - Optional recoverConfiguration = default; - Optional snapshotTime = default; - Optional useDRSecondary = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("deletedSiteId")) - { - deletedSiteId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("recoverConfiguration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - recoverConfiguration = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("snapshotTime")) - { - snapshotTime = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("useDRSecondary")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - useDRSecondary = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new DeletedAppRestoreRequest(id.Value, name.Value, kind.Value, type.Value, deletedSiteId.Value, Optional.ToNullable(recoverConfiguration), snapshotTime.Value, Optional.ToNullable(useDRSecondary)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.cs index fdc6172cf3e1..347a22b2abf2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedAppRestoreRequest.cs @@ -1,56 +1,95 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Details about restoring a deleted app. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details about restoring a deleted app. + /// + [Rest.Serialization.JsonTransformation] public partial class DeletedAppRestoreRequest : ProxyOnlyResource { - /// Initializes a new instance of DeletedAppRestoreRequest. + /// + /// Initializes a new instance of the DeletedAppRestoreRequest class. + /// public DeletedAppRestoreRequest() { + CustomInit(); } - /// Initializes a new instance of DeletedAppRestoreRequest. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// - /// ARM resource ID of the deleted app. Example: - /// /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. - /// - /// If true, deleted site configuration, in addition to content, will be restored. - /// - /// Point in time to restore the deleted app from, formatted as a DateTime string. - /// If unspecified, default value is the time that the app was deleted. - /// - /// If true, the snapshot is retrieved from DRSecondary endpoint. - internal DeletedAppRestoreRequest(string id, string name, string kind, string type, string deletedSiteId, bool? recoverConfiguration, string snapshotTime, bool? useDRSecondary) : base(id, name, kind, type) + /// + /// Initializes a new instance of the DeletedAppRestoreRequest class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// ARM resource ID of the deleted app. + /// Example: + /// /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + /// If true, deleted site + /// configuration, in addition to content, will be restored. + /// Point in time to restore the deleted app + /// from, formatted as a DateTime string. + /// If unspecified, default value is the time that the app was + /// deleted. + /// If true, the snapshot is retrieved + /// from DRSecondary endpoint. + public DeletedAppRestoreRequest(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string deletedSiteId = default(string), bool? recoverConfiguration = default(bool?), string snapshotTime = default(string), bool? useDRSecondary = default(bool?)) + : base(id, name, kind, type) { DeletedSiteId = deletedSiteId; RecoverConfiguration = recoverConfiguration; SnapshotTime = snapshotTime; UseDRSecondary = useDRSecondary; + CustomInit(); } /// - /// ARM resource ID of the deleted app. Example: - /// /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. + /// An initialization method that performs custom operations like setting defaults /// + partial void CustomInit(); + + /// + /// Gets or sets ARM resource ID of the deleted app. Example: + /// /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + /// + [JsonProperty(PropertyName = "properties.deletedSiteId")] public string DeletedSiteId { get; set; } - /// If true, deleted site configuration, in addition to content, will be restored. + + /// + /// Gets or sets if true, deleted site configuration, in addition to + /// content, will be restored. + /// + [JsonProperty(PropertyName = "properties.recoverConfiguration")] public bool? RecoverConfiguration { get; set; } + /// - /// Point in time to restore the deleted app from, formatted as a DateTime string. + /// Gets or sets point in time to restore the deleted app from, + /// formatted as a DateTime string. /// If unspecified, default value is the time that the app was deleted. /// + [JsonProperty(PropertyName = "properties.snapshotTime")] public string SnapshotTime { get; set; } - /// If true, the snapshot is retrieved from DRSecondary endpoint. + + /// + /// Gets or sets if true, the snapshot is retrieved from DRSecondary + /// endpoint. + /// + [JsonProperty(PropertyName = "properties.useDRSecondary")] public bool? UseDRSecondary { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.Serialization.cs deleted file mode 100644 index 96271c0f4a7f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DeletedSite : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static DeletedSite DeserializeDeletedSite(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional deletedSiteId = default; - Optional deletedTimestamp = default; - Optional subscription = default; - Optional resourceGroup = default; - Optional deletedSiteName = default; - Optional slot = default; - Optional kind0 = default; - Optional geoRegionName = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("deletedSiteId")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - deletedSiteId = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("deletedTimestamp")) - { - deletedTimestamp = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("subscription")) - { - subscription = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("resourceGroup")) - { - resourceGroup = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("deletedSiteName")) - { - deletedSiteName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("slot")) - { - slot = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("kind")) - { - kind0 = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("geoRegionName")) - { - geoRegionName = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new DeletedSite(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(deletedSiteId), deletedTimestamp.Value, subscription.Value, resourceGroup.Value, deletedSiteName.Value, slot.Value, kind0.Value, geoRegionName.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.cs index 130e51a84016..565a9b6b34d0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedSite.cs @@ -1,34 +1,54 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// A deleted app. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A deleted app. + /// + [Rest.Serialization.JsonTransformation] public partial class DeletedSite : ProxyOnlyResource { - /// Initializes a new instance of DeletedSite. + /// + /// Initializes a new instance of the DeletedSite class. + /// public DeletedSite() { + CustomInit(); } - /// Initializes a new instance of DeletedSite. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Numeric id for the deleted site. - /// Time in UTC when the app was deleted. - /// Subscription containing the deleted site. - /// ResourceGroup that contained the deleted site. - /// Name of the deleted site. - /// Slot of the deleted site. - /// Kind of site that was deleted. - /// Geo Region of the deleted site. - internal DeletedSite(string id, string name, string kind, string type, int? deletedSiteId, string deletedTimestamp, string subscription, string resourceGroup, string deletedSiteName, string slot, string kindPropertiesKind, string geoRegionName) : base(id, name, kind, type) + /// + /// Initializes a new instance of the DeletedSite class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Numeric id for the deleted site + /// Time in UTC when the app was + /// deleted. + /// Subscription containing the deleted + /// site + /// ResourceGroup that contained the + /// deleted site + /// Name of the deleted site + /// Slot of the deleted site + /// Kind of site that was deleted + /// Geo Region of the deleted site + public DeletedSite(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? deletedSiteId = default(int?), string deletedTimestamp = default(string), string subscription = default(string), string resourceGroup = default(string), string deletedSiteName = default(string), string slot = default(string), string deletedSiteKind = default(string), string geoRegionName = default(string)) + : base(id, name, kind, type) { DeletedSiteId = deletedSiteId; DeletedTimestamp = deletedTimestamp; @@ -36,25 +56,63 @@ internal DeletedSite(string id, string name, string kind, string type, int? dele ResourceGroup = resourceGroup; DeletedSiteName = deletedSiteName; Slot = slot; - KindPropertiesKind = kindPropertiesKind; + DeletedSiteKind = deletedSiteKind; GeoRegionName = geoRegionName; + CustomInit(); } - /// Numeric id for the deleted site. - public int? DeletedSiteId { get; } - /// Time in UTC when the app was deleted. - public string DeletedTimestamp { get; } - /// Subscription containing the deleted site. - public string Subscription { get; } - /// ResourceGroup that contained the deleted site. - public string ResourceGroup { get; } - /// Name of the deleted site. - public string DeletedSiteName { get; } - /// Slot of the deleted site. - public string Slot { get; } - /// Kind of site that was deleted. - public string KindPropertiesKind { get; } - /// Geo Region of the deleted site. - public string GeoRegionName { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets numeric id for the deleted site + /// + [JsonProperty(PropertyName = "properties.deletedSiteId")] + public int? DeletedSiteId { get; private set; } + + /// + /// Gets time in UTC when the app was deleted. + /// + [JsonProperty(PropertyName = "properties.deletedTimestamp")] + public string DeletedTimestamp { get; private set; } + + /// + /// Gets subscription containing the deleted site + /// + [JsonProperty(PropertyName = "properties.subscription")] + public string Subscription { get; private set; } + + /// + /// Gets resourceGroup that contained the deleted site + /// + [JsonProperty(PropertyName = "properties.resourceGroup")] + public string ResourceGroup { get; private set; } + + /// + /// Gets name of the deleted site + /// + [JsonProperty(PropertyName = "properties.deletedSiteName")] + public string DeletedSiteName { get; private set; } + + /// + /// Gets slot of the deleted site + /// + [JsonProperty(PropertyName = "properties.slot")] + public string Slot { get; private set; } + + /// + /// Gets kind of site that was deleted + /// + [JsonProperty(PropertyName = "properties.kind")] + public string DeletedSiteKind { get; private set; } + + /// + /// Gets geo Region of the deleted site + /// + [JsonProperty(PropertyName = "properties.geoRegionName")] + public string GeoRegionName { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.Serialization.cs deleted file mode 100644 index 01e8a18b926c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class DeletedWebAppCollection - { - internal static DeletedWebAppCollection DeserializeDeletedWebAppCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeletedSite.DeserializeDeletedSite(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DeletedWebAppCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.cs deleted file mode 100644 index 231fe96ddfb5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeletedWebAppCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of deleted apps. - internal partial class DeletedWebAppCollection - { - /// Initializes a new instance of DeletedWebAppCollection. - /// Collection of resources. - /// is null. - internal DeletedWebAppCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of DeletedWebAppCollection. - /// Collection of resources. - /// Link to next page of resources. - internal DeletedWebAppCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.Serialization.cs deleted file mode 100644 index 8c4e77d0cd5c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.Serialization.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Deployment : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"); - writer.WriteNumberValue(Status.Value); - } - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"); - writer.WriteStringValue(Message); - } - if (Optional.IsDefined(Author)) - { - writer.WritePropertyName("author"); - writer.WriteStringValue(Author); - } - if (Optional.IsDefined(Deployer)) - { - writer.WritePropertyName("deployer"); - writer.WriteStringValue(Deployer); - } - if (Optional.IsDefined(AuthorEmail)) - { - writer.WritePropertyName("author_email"); - writer.WriteStringValue(AuthorEmail); - } - if (Optional.IsDefined(StartTime)) - { - writer.WritePropertyName("start_time"); - writer.WriteStringValue(StartTime.Value, "O"); - } - if (Optional.IsDefined(EndTime)) - { - writer.WritePropertyName("end_time"); - writer.WriteStringValue(EndTime.Value, "O"); - } - if (Optional.IsDefined(Active)) - { - writer.WritePropertyName("active"); - writer.WriteBooleanValue(Active.Value); - } - if (Optional.IsDefined(Details)) - { - writer.WritePropertyName("details"); - writer.WriteStringValue(Details); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Deployment DeserializeDeployment(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional status = default; - Optional message = default; - Optional author = default; - Optional deployer = default; - Optional authorEmail = default; - Optional startTime = default; - Optional endTime = default; - Optional active = default; - Optional details = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("message")) - { - message = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("author")) - { - author = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("deployer")) - { - deployer = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("author_email")) - { - authorEmail = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("start_time")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("end_time")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - endTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("active")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - active = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("details")) - { - details = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new Deployment(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(status), message.Value, author.Value, deployer.Value, authorEmail.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToNullable(active), details.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.cs index 0640c316065f..9a88a578c6b1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Deployment.cs @@ -1,37 +1,53 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// User credentials used for publishing activity. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// User credentials used for publishing activity. + /// + [Rest.Serialization.JsonTransformation] public partial class Deployment : ProxyOnlyResource { - /// Initializes a new instance of Deployment. + /// + /// Initializes a new instance of the Deployment class. + /// public Deployment() { + CustomInit(); } - /// Initializes a new instance of Deployment. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Deployment status. - /// Details about deployment status. - /// Who authored the deployment. - /// Who performed the deployment. - /// Author email. - /// Start time. - /// End time. - /// True if deployment is currently active, false if completed and null if not started. - /// Details on deployment. - internal Deployment(string id, string name, string kind, string type, int? status, string message, string author, string deployer, string authorEmail, DateTimeOffset? startTime, DateTimeOffset? endTime, bool? active, string details) : base(id, name, kind, type) + /// + /// Initializes a new instance of the Deployment class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Deployment status. + /// Details about deployment status. + /// Who authored the deployment. + /// Who performed the deployment. + /// Author email. + /// Start time. + /// End time. + /// True if deployment is currently active, false + /// if completed and null if not started. + /// Details on deployment. + public Deployment(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? status = default(int?), string message = default(string), string author = default(string), string deployer = default(string), string authorEmail = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), bool? active = default(bool?), string details = default(string)) + : base(id, name, kind, type) { Status = status; Message = message; @@ -42,25 +58,68 @@ internal Deployment(string id, string name, string kind, string type, int? statu EndTime = endTime; Active = active; Details = details; + CustomInit(); } - /// Deployment status. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets deployment status. + /// + [JsonProperty(PropertyName = "properties.status")] public int? Status { get; set; } - /// Details about deployment status. + + /// + /// Gets or sets details about deployment status. + /// + [JsonProperty(PropertyName = "properties.message")] public string Message { get; set; } - /// Who authored the deployment. + + /// + /// Gets or sets who authored the deployment. + /// + [JsonProperty(PropertyName = "properties.author")] public string Author { get; set; } - /// Who performed the deployment. + + /// + /// Gets or sets who performed the deployment. + /// + [JsonProperty(PropertyName = "properties.deployer")] public string Deployer { get; set; } - /// Author email. + + /// + /// Gets or sets author email. + /// + [JsonProperty(PropertyName = "properties.author_email")] public string AuthorEmail { get; set; } - /// Start time. - public DateTimeOffset? StartTime { get; set; } - /// End time. - public DateTimeOffset? EndTime { get; set; } - /// True if deployment is currently active, false if completed and null if not started. + + /// + /// Gets or sets start time. + /// + [JsonProperty(PropertyName = "properties.start_time")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets end time. + /// + [JsonProperty(PropertyName = "properties.end_time")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets true if deployment is currently active, false if + /// completed and null if not started. + /// + [JsonProperty(PropertyName = "properties.active")] public bool? Active { get; set; } - /// Details on deployment. + + /// + /// Gets or sets details on deployment. + /// + [JsonProperty(PropertyName = "properties.details")] public string Details { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.Serialization.cs deleted file mode 100644 index eaf8dc14c1c5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class DeploymentCollection - { - internal static DeploymentCollection DeserializeDeploymentCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Deployment.DeserializeDeployment(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DeploymentCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.cs deleted file mode 100644 index c698adcc69ef..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of app deployments. - internal partial class DeploymentCollection - { - /// Initializes a new instance of DeploymentCollection. - /// Collection of resources. - /// is null. - internal DeploymentCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of DeploymentCollection. - /// Collection of resources. - /// Link to next page of resources. - internal DeploymentCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.Serialization.cs deleted file mode 100644 index cb7581aed205..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.Serialization.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DeploymentLocations - { - internal static DeploymentLocations DeserializeDeploymentLocations(JsonElement element) - { - Optional> locations = default; - Optional> hostingEnvironments = default; - Optional> hostingEnvironmentDeploymentInfos = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("locations")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(GeoRegion.DeserializeGeoRegion(item)); - } - locations = array; - continue; - } - if (property.NameEquals("hostingEnvironments")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AppServiceEnvironment.DeserializeAppServiceEnvironment(item)); - } - hostingEnvironments = array; - continue; - } - if (property.NameEquals("hostingEnvironmentDeploymentInfos")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HostingEnvironmentDeploymentInfo.DeserializeHostingEnvironmentDeploymentInfo(item)); - } - hostingEnvironmentDeploymentInfos = array; - continue; - } - } - return new DeploymentLocations(Optional.ToList(locations), Optional.ToList(hostingEnvironments), Optional.ToList(hostingEnvironmentDeploymentInfos)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.cs index ea7b8d8746ad..a51e11fef786 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DeploymentLocations.cs @@ -1,45 +1,74 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + /// /// List of available locations (regions or App Service Environments) for /// deployment of App Service resources. /// public partial class DeploymentLocations { - /// Initializes a new instance of DeploymentLocations. - internal DeploymentLocations() + /// + /// Initializes a new instance of the DeploymentLocations class. + /// + public DeploymentLocations() { - Locations = new ChangeTrackingList(); - HostingEnvironments = new ChangeTrackingList(); - HostingEnvironmentDeploymentInfos = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of DeploymentLocations. - /// Available regions. - /// Available App Service Environments with full descriptions of the environments. - /// Available App Service Environments with basic information. - internal DeploymentLocations(IReadOnlyList locations, IReadOnlyList hostingEnvironments, IReadOnlyList hostingEnvironmentDeploymentInfos) + /// + /// Initializes a new instance of the DeploymentLocations class. + /// + /// Available regions. + /// Available App Service + /// Environments with full descriptions of the environments. + /// Available App + /// Service Environments with basic information. + public DeploymentLocations(IList locations = default(IList), IList hostingEnvironments = default(IList), IList hostingEnvironmentDeploymentInfos = default(IList)) { Locations = locations; HostingEnvironments = hostingEnvironments; HostingEnvironmentDeploymentInfos = hostingEnvironmentDeploymentInfos; + CustomInit(); } - /// Available regions. - public IReadOnlyList Locations { get; } - /// Available App Service Environments with full descriptions of the environments. - public IReadOnlyList HostingEnvironments { get; } - /// Available App Service Environments with basic information. - public IReadOnlyList HostingEnvironmentDeploymentInfos { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets available regions. + /// + [JsonProperty(PropertyName = "locations")] + public IList Locations { get; set; } + + /// + /// Gets or sets available App Service Environments with full + /// descriptions of the environments. + /// + [JsonProperty(PropertyName = "hostingEnvironments")] + public IList HostingEnvironments { get; set; } + + /// + /// Gets or sets available App Service Environments with basic + /// information. + /// + [JsonProperty(PropertyName = "hostingEnvironmentDeploymentInfos")] + public IList HostingEnvironmentDeploymentInfos { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.Serialization.cs deleted file mode 100644 index 5ea23ccb7c0f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.Serialization.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DetectorAbnormalTimePeriod : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(StartTime)) - { - writer.WritePropertyName("startTime"); - writer.WriteStringValue(StartTime.Value, "O"); - } - if (Optional.IsDefined(EndTime)) - { - writer.WritePropertyName("endTime"); - writer.WriteStringValue(EndTime.Value, "O"); - } - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"); - writer.WriteStringValue(Message); - } - if (Optional.IsDefined(Source)) - { - writer.WritePropertyName("source"); - writer.WriteStringValue(Source); - } - if (Optional.IsDefined(Priority)) - { - writer.WritePropertyName("priority"); - writer.WriteNumberValue(Priority.Value); - } - if (Optional.IsCollectionDefined(MetaData)) - { - writer.WritePropertyName("metaData"); - writer.WriteStartArray(); - foreach (var item in MetaData) - { - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteObjectValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(Type)) - { - writer.WritePropertyName("type"); - writer.WriteStringValue(Type.Value.ToSerialString()); - } - if (Optional.IsCollectionDefined(Solutions)) - { - writer.WritePropertyName("solutions"); - writer.WriteStartArray(); - foreach (var item in Solutions) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static DetectorAbnormalTimePeriod DeserializeDetectorAbnormalTimePeriod(JsonElement element) - { - Optional startTime = default; - Optional endTime = default; - Optional message = default; - Optional source = default; - Optional priority = default; - Optional>> metaData = default; - Optional type = default; - Optional> solutions = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("startTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("endTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - endTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("message")) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("source")) - { - source = property.Value.GetString(); - continue; - } - if (property.NameEquals("priority")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - priority = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("metaData")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - List array0 = new List(); - foreach (var item0 in item.EnumerateArray()) - { - array0.Add(NameValuePair.DeserializeNameValuePair(item0)); - } - array.Add(array0); - } - metaData = array; - continue; - } - if (property.NameEquals("type")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = property.Value.GetString().ToIssueType(); - continue; - } - if (property.NameEquals("solutions")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Solution.DeserializeSolution(item)); - } - solutions = array; - continue; - } - } - return new DetectorAbnormalTimePeriod(Optional.ToNullable(startTime), Optional.ToNullable(endTime), message.Value, source.Value, Optional.ToNullable(priority), Optional.ToList(metaData), Optional.ToNullable(type), Optional.ToList(solutions)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.cs index a267ecebb168..f91fda4d5d63 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorAbnormalTimePeriod.cs @@ -1,36 +1,48 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Class representing Abnormal Time Period detected. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Class representing Abnormal Time Period detected. + /// public partial class DetectorAbnormalTimePeriod { - /// Initializes a new instance of DetectorAbnormalTimePeriod. + /// + /// Initializes a new instance of the DetectorAbnormalTimePeriod class. + /// public DetectorAbnormalTimePeriod() { - MetaData = new ChangeTrackingList>(); - Solutions = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of DetectorAbnormalTimePeriod. - /// Start time of the correlated event. - /// End time of the correlated event. - /// Message describing the event. - /// Represents the name of the Detector. - /// Represents the rank of the Detector. - /// Downtime metadata. - /// Represents the type of the Detector. - /// List of proposed solutions. - internal DetectorAbnormalTimePeriod(DateTimeOffset? startTime, DateTimeOffset? endTime, string message, string source, double? priority, IList> metaData, IssueType? type, IList solutions) + /// + /// Initializes a new instance of the DetectorAbnormalTimePeriod class. + /// + /// Start time of the correlated event + /// End time of the correlated event + /// Message describing the event + /// Represents the name of the Detector + /// Represents the rank of the Detector + /// Downtime metadata + /// Represents the type of the Detector. Possible + /// values include: 'ServiceIncident', 'AppDeployment', 'AppCrash', + /// 'RuntimeIssueDetected', 'AseDeployment', 'UserIssue', + /// 'PlatformIssue', 'Other' + /// List of proposed solutions + public DetectorAbnormalTimePeriod(System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string message = default(string), string source = default(string), double? priority = default(double?), IList> metaData = default(IList>), IssueType? type = default(IssueType?), IList solutions = default(IList)) { StartTime = startTime; EndTime = endTime; @@ -40,23 +52,64 @@ internal DetectorAbnormalTimePeriod(DateTimeOffset? startTime, DateTimeOffset? e MetaData = metaData; Type = type; Solutions = solutions; + CustomInit(); } - /// Start time of the correlated event. - public DateTimeOffset? StartTime { get; set; } - /// End time of the correlated event. - public DateTimeOffset? EndTime { get; set; } - /// Message describing the event. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets start time of the correlated event + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets end time of the correlated event + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets message describing the event + /// + [JsonProperty(PropertyName = "message")] public string Message { get; set; } - /// Represents the name of the Detector. + + /// + /// Gets or sets represents the name of the Detector + /// + [JsonProperty(PropertyName = "source")] public string Source { get; set; } - /// Represents the rank of the Detector. + + /// + /// Gets or sets represents the rank of the Detector + /// + [JsonProperty(PropertyName = "priority")] public double? Priority { get; set; } - /// Downtime metadata. - public IList> MetaData { get; } - /// Represents the type of the Detector. + + /// + /// Gets or sets downtime metadata + /// + [JsonProperty(PropertyName = "metaData")] + public IList> MetaData { get; set; } + + /// + /// Gets or sets represents the type of the Detector. Possible values + /// include: 'ServiceIncident', 'AppDeployment', 'AppCrash', + /// 'RuntimeIssueDetected', 'AseDeployment', 'UserIssue', + /// 'PlatformIssue', 'Other' + /// + [JsonProperty(PropertyName = "type")] public IssueType? Type { get; set; } - /// List of proposed solutions. - public IList Solutions { get; } + + /// + /// Gets or sets list of proposed solutions + /// + [JsonProperty(PropertyName = "solutions")] + public IList Solutions { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.Serialization.cs deleted file mode 100644 index 2182373f002a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.Serialization.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DetectorDefinition : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static DetectorDefinition DeserializeDetectorDefinition(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional displayName = default; - Optional description = default; - Optional rank = default; - Optional isEnabled = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("displayName")) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description")) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("rank")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - rank = property0.Value.GetDouble(); - continue; - } - if (property0.NameEquals("isEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isEnabled = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new DetectorDefinition(id.Value, name.Value, kind.Value, type.Value, displayName.Value, description.Value, Optional.ToNullable(rank), Optional.ToNullable(isEnabled)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.cs index f7d2781840f1..bcccb400ddc8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorDefinition.cs @@ -1,44 +1,84 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Class representing detector definition. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Class representing detector definition + /// + [Rest.Serialization.JsonTransformation] public partial class DetectorDefinition : ProxyOnlyResource { - /// Initializes a new instance of DetectorDefinition. + /// + /// Initializes a new instance of the DetectorDefinition class. + /// public DetectorDefinition() { + CustomInit(); } - /// Initializes a new instance of DetectorDefinition. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Display name of the detector. - /// Description of the detector. - /// Detector Rank. - /// Flag representing whether detector is enabled or not. - internal DetectorDefinition(string id, string name, string kind, string type, string displayName, string description, double? rank, bool? isEnabled) : base(id, name, kind, type) + /// + /// Initializes a new instance of the DetectorDefinition class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Display name of the detector + /// Description of the detector + /// Detector Rank + /// Flag representing whether detector is + /// enabled or not. + public DetectorDefinition(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string displayName = default(string), string description = default(string), double? rank = default(double?), bool? isEnabled = default(bool?)) + : base(id, name, kind, type) { DisplayName = displayName; Description = description; Rank = rank; IsEnabled = isEnabled; + CustomInit(); } - /// Display name of the detector. - public string DisplayName { get; } - /// Description of the detector. - public string Description { get; } - /// Detector Rank. - public double? Rank { get; } - /// Flag representing whether detector is enabled or not. - public bool? IsEnabled { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets display name of the detector + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets description of the detector + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + + /// + /// Gets detector Rank + /// + [JsonProperty(PropertyName = "properties.rank")] + public double? Rank { get; private set; } + + /// + /// Gets flag representing whether detector is enabled or not. + /// + [JsonProperty(PropertyName = "properties.isEnabled")] + public bool? IsEnabled { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.Serialization.cs deleted file mode 100644 index 3ebfcb140af3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.Serialization.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DetectorInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } - - internal static DetectorInfo DeserializeDetectorInfo(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional description = default; - Optional author = default; - Optional category = default; - Optional> supportTopicList = default; - Optional> analysisType = default; - Optional type = default; - Optional score = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("description")) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("author")) - { - author = property.Value.GetString(); - continue; - } - if (property.NameEquals("category")) - { - category = property.Value.GetString(); - continue; - } - if (property.NameEquals("supportTopicList")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SupportTopic.DeserializeSupportTopic(item)); - } - supportTopicList = array; - continue; - } - if (property.NameEquals("analysisType")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - analysisType = array; - continue; - } - if (property.NameEquals("type")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = property.Value.GetString().ToDetectorType(); - continue; - } - if (property.NameEquals("score")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - score = property.Value.GetSingle(); - continue; - } - } - return new DetectorInfo(id.Value, name.Value, description.Value, author.Value, category.Value, Optional.ToList(supportTopicList), Optional.ToList(analysisType), Optional.ToNullable(type), Optional.ToNullable(score)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs index b31bdc4c640a..78af46d0f5c1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs @@ -1,65 +1,76 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Definition of Detector. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of Detector + /// public partial class DetectorInfo { - /// Initializes a new instance of DetectorInfo. + /// + /// Initializes a new instance of the DetectorInfo class. + /// public DetectorInfo() { - SupportTopicList = new ChangeTrackingList(); - AnalysisType = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of DetectorInfo. - /// Id of detector. - /// Name of detector. - /// Short description of the detector and its purpose. - /// Author of the detector. - /// Problem category. This serves for organizing group for detectors. - /// List of Support Topics for which this detector is enabled. - /// Analysis Types for which this detector should apply to. - /// Whether this detector is an Analysis Detector or not. - /// Defines score of a detector to power ML based matching. - internal DetectorInfo(string id, string name, string description, string author, string category, IReadOnlyList supportTopicList, IReadOnlyList analysisType, DetectorType? type, float? score) + /// + /// Initializes a new instance of the DetectorInfo class. + /// + /// Short description of the detector and its + /// purpose + /// Support Category + /// Support Sub Category + /// Support Topic Id + public DetectorInfo(string description = default(string), string category = default(string), string subCategory = default(string), string supportTopicId = default(string)) { - Id = id; - Name = name; Description = description; - Author = author; Category = category; - SupportTopicList = supportTopicList; - AnalysisType = analysisType; - Type = type; - Score = score; + SubCategory = subCategory; + SupportTopicId = supportTopicId; + CustomInit(); } - /// Id of detector. - public string Id { get; } - /// Name of detector. - public string Name { get; } - /// Short description of the detector and its purpose. - public string Description { get; } - /// Author of the detector. - public string Author { get; } - /// Problem category. This serves for organizing group for detectors. - public string Category { get; } - /// List of Support Topics for which this detector is enabled. - public IReadOnlyList SupportTopicList { get; } - /// Analysis Types for which this detector should apply to. - public IReadOnlyList AnalysisType { get; } - /// Whether this detector is an Analysis Detector or not. - public DetectorType? Type { get; } - /// Defines score of a detector to power ML based matching. - public float? Score { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets short description of the detector and its purpose + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + /// + /// Gets support Category + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; private set; } + + /// + /// Gets support Sub Category + /// + [JsonProperty(PropertyName = "subCategory")] + public string SubCategory { get; private set; } + + /// + /// Gets support Topic Id + /// + [JsonProperty(PropertyName = "supportTopicId")] + public string SupportTopicId { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.Serialization.cs deleted file mode 100644 index d838f88fd13c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.Serialization.cs +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DetectorResponse : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Metadata)) - { - writer.WritePropertyName("metadata"); - writer.WriteObjectValue(Metadata); - } - if (Optional.IsCollectionDefined(Dataset)) - { - writer.WritePropertyName("dataset"); - writer.WriteStartArray(); - foreach (var item in Dataset) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"); - writer.WriteObjectValue(Status); - } - if (Optional.IsCollectionDefined(DataProvidersMetadata)) - { - writer.WritePropertyName("dataProvidersMetadata"); - writer.WriteStartArray(); - foreach (var item in DataProvidersMetadata) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(SuggestedUtterances)) - { - writer.WritePropertyName("suggestedUtterances"); - writer.WriteObjectValue(SuggestedUtterances); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static DetectorResponse DeserializeDetectorResponse(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional metadata = default; - Optional> dataset = default; - Optional status = default; - Optional> dataProvidersMetadata = default; - Optional suggestedUtterances = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("metadata")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - metadata = DetectorInfo.DeserializeDetectorInfo(property0.Value); - continue; - } - if (property0.NameEquals("dataset")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(DiagnosticData.DeserializeDiagnosticData(item)); - } - dataset = array; - continue; - } - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = Status.DeserializeStatus(property0.Value); - continue; - } - if (property0.NameEquals("dataProvidersMetadata")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(DataProviderMetadata.DeserializeDataProviderMetadata(item)); - } - dataProvidersMetadata = array; - continue; - } - if (property0.NameEquals("suggestedUtterances")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - suggestedUtterances = QueryUtterancesResults.DeserializeQueryUtterancesResults(property0.Value); - continue; - } - } - continue; - } - } - return new DetectorResponse(id.Value, name.Value, kind.Value, type.Value, metadata.Value, Optional.ToList(dataset), status.Value, Optional.ToList(dataProvidersMetadata), suggestedUtterances.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs index 3663ba200263..853860a84c5c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs @@ -1,53 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Class representing Response from Detector. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Class representing Response from Detector + /// + [Rest.Serialization.JsonTransformation] public partial class DetectorResponse : ProxyOnlyResource { - /// Initializes a new instance of DetectorResponse. + /// + /// Initializes a new instance of the DetectorResponse class. + /// public DetectorResponse() { - Dataset = new ChangeTrackingList(); - DataProvidersMetadata = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of DetectorResponse. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// metadata for the detector. - /// Data Set. - /// Indicates status of the most severe insight. - /// Additional configuration for different data providers to be used by the UI. - /// Suggested utterances where the detector can be applicable. - internal DetectorResponse(string id, string name, string kind, string type, DetectorInfo metadata, IList dataset, Status status, IList dataProvidersMetadata, QueryUtterancesResults suggestedUtterances) : base(id, name, kind, type) + /// + /// Initializes a new instance of the DetectorResponse class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// metadata for the detector + /// Data Set + public DetectorResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), DetectorInfo metadata = default(DetectorInfo), IList dataset = default(IList)) + : base(id, name, kind, type) { Metadata = metadata; Dataset = dataset; - Status = status; - DataProvidersMetadata = dataProvidersMetadata; - SuggestedUtterances = suggestedUtterances; + CustomInit(); } - /// metadata for the detector. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets metadata for the detector + /// + [JsonProperty(PropertyName = "properties.metadata")] public DetectorInfo Metadata { get; set; } - /// Data Set. - public IList Dataset { get; } - /// Indicates status of the most severe insight. - public Status Status { get; set; } - /// Additional configuration for different data providers to be used by the UI. - public IList DataProvidersMetadata { get; } - /// Suggested utterances where the detector can be applicable. - public QueryUtterancesResults SuggestedUtterances { get; set; } + + /// + /// Gets or sets data Set + /// + [JsonProperty(PropertyName = "properties.dataset")] + public IList Dataset { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.Serialization.cs deleted file mode 100644 index f0195e8b4148..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class DetectorResponseCollection - { - internal static DetectorResponseCollection DeserializeDetectorResponseCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DetectorResponse.DeserializeDetectorResponse(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DetectorResponseCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.cs deleted file mode 100644 index cde9fd7d7869..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponseCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of detector responses. - internal partial class DetectorResponseCollection - { - /// Initializes a new instance of DetectorResponseCollection. - /// Collection of resources. - /// is null. - internal DetectorResponseCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of DetectorResponseCollection. - /// Collection of resources. - /// Link to next page of resources. - internal DetectorResponseCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.Serialization.cs deleted file mode 100644 index bdb355078c64..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class DetectorTypeExtensions - { - public static string ToSerialString(this DetectorType value) => value switch - { - DetectorType.Detector => "Detector", - DetectorType.Analysis => "Analysis", - DetectorType.CategoryOverview => "CategoryOverview", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DetectorType value.") - }; - - public static DetectorType ToDetectorType(this string value) - { - if (string.Equals(value, "Detector", StringComparison.InvariantCultureIgnoreCase)) return DetectorType.Detector; - if (string.Equals(value, "Analysis", StringComparison.InvariantCultureIgnoreCase)) return DetectorType.Analysis; - if (string.Equals(value, "CategoryOverview", StringComparison.InvariantCultureIgnoreCase)) return DetectorType.CategoryOverview; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DetectorType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs deleted file mode 100644 index 223658e179f5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Whether this detector is an Analysis Detector or not. - public enum DetectorType - { - /// Detector. - Detector, - /// Analysis. - Analysis, - /// CategoryOverview. - CategoryOverview - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.Serialization.cs deleted file mode 100644 index 3ce45d498fa1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.Serialization.cs +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DiagnosticAnalysis : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(StartTime)) - { - writer.WritePropertyName("startTime"); - writer.WriteStringValue(StartTime.Value, "O"); - } - if (Optional.IsDefined(EndTime)) - { - writer.WritePropertyName("endTime"); - writer.WriteStringValue(EndTime.Value, "O"); - } - if (Optional.IsCollectionDefined(AbnormalTimePeriods)) - { - writer.WritePropertyName("abnormalTimePeriods"); - writer.WriteStartArray(); - foreach (var item in AbnormalTimePeriods) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Payload)) - { - writer.WritePropertyName("payload"); - writer.WriteStartArray(); - foreach (var item in Payload) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(NonCorrelatedDetectors)) - { - writer.WritePropertyName("nonCorrelatedDetectors"); - writer.WriteStartArray(); - foreach (var item in NonCorrelatedDetectors) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static DiagnosticAnalysis DeserializeDiagnosticAnalysis(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional startTime = default; - Optional endTime = default; - Optional> abnormalTimePeriods = default; - Optional> payload = default; - Optional> nonCorrelatedDetectors = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("startTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("endTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - endTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("abnormalTimePeriods")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(AbnormalTimePeriod.DeserializeAbnormalTimePeriod(item)); - } - abnormalTimePeriods = array; - continue; - } - if (property0.NameEquals("payload")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(AnalysisData.DeserializeAnalysisData(item)); - } - payload = array; - continue; - } - if (property0.NameEquals("nonCorrelatedDetectors")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(DetectorDefinition.DeserializeDetectorDefinition(item)); - } - nonCorrelatedDetectors = array; - continue; - } - } - continue; - } - } - return new DiagnosticAnalysis(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToList(abnormalTimePeriods), Optional.ToList(payload), Optional.ToList(nonCorrelatedDetectors)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.cs index c1139d512225..a14320e7e5e3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysis.cs @@ -1,55 +1,95 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Class representing a diagnostic analysis done on an application. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Class representing a diagnostic analysis done on an application + /// + [Rest.Serialization.JsonTransformation] public partial class DiagnosticAnalysis : ProxyOnlyResource { - /// Initializes a new instance of DiagnosticAnalysis. + /// + /// Initializes a new instance of the DiagnosticAnalysis class. + /// public DiagnosticAnalysis() { - AbnormalTimePeriods = new ChangeTrackingList(); - Payload = new ChangeTrackingList(); - NonCorrelatedDetectors = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of DiagnosticAnalysis. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Start time of the period. - /// End time of the period. - /// List of time periods. - /// Data by each detector. - /// Data by each detector for detectors that did not corelate. - internal DiagnosticAnalysis(string id, string name, string kind, string type, DateTimeOffset? startTime, DateTimeOffset? endTime, IList abnormalTimePeriods, IList payload, IList nonCorrelatedDetectors) : base(id, name, kind, type) + /// + /// Initializes a new instance of the DiagnosticAnalysis class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Start time of the period + /// End time of the period + /// List of time periods. + /// Data by each detector + /// Data by each detector for + /// detectors that did not corelate + public DiagnosticAnalysis(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), IList abnormalTimePeriods = default(IList), IList payload = default(IList), IList nonCorrelatedDetectors = default(IList)) + : base(id, name, kind, type) { StartTime = startTime; EndTime = endTime; AbnormalTimePeriods = abnormalTimePeriods; Payload = payload; NonCorrelatedDetectors = nonCorrelatedDetectors; + CustomInit(); } - /// Start time of the period. - public DateTimeOffset? StartTime { get; set; } - /// End time of the period. - public DateTimeOffset? EndTime { get; set; } - /// List of time periods. - public IList AbnormalTimePeriods { get; } - /// Data by each detector. - public IList Payload { get; } - /// Data by each detector for detectors that did not corelate. - public IList NonCorrelatedDetectors { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets start time of the period + /// + [JsonProperty(PropertyName = "properties.startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets end time of the period + /// + [JsonProperty(PropertyName = "properties.endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets list of time periods. + /// + [JsonProperty(PropertyName = "properties.abnormalTimePeriods")] + public IList AbnormalTimePeriods { get; set; } + + /// + /// Gets or sets data by each detector + /// + [JsonProperty(PropertyName = "properties.payload")] + public IList Payload { get; set; } + + /// + /// Gets or sets data by each detector for detectors that did not + /// corelate + /// + [JsonProperty(PropertyName = "properties.nonCorrelatedDetectors")] + public IList NonCorrelatedDetectors { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.Serialization.cs deleted file mode 100644 index 05f5ebd864f5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class DiagnosticAnalysisCollection - { - internal static DiagnosticAnalysisCollection DeserializeDiagnosticAnalysisCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AnalysisDefinition.DeserializeAnalysisDefinition(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DiagnosticAnalysisCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.cs deleted file mode 100644 index bb0b26ede346..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticAnalysisCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Diagnostic Analyses. - internal partial class DiagnosticAnalysisCollection - { - /// Initializes a new instance of DiagnosticAnalysisCollection. - /// Collection of resources. - /// is null. - internal DiagnosticAnalysisCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of DiagnosticAnalysisCollection. - /// Collection of resources. - /// Link to next page of resources. - internal DiagnosticAnalysisCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.Serialization.cs deleted file mode 100644 index 0a0331c16c11..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.Serialization.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DiagnosticCategory : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static DiagnosticCategory DeserializeDiagnosticCategory(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("description")) - { - description = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new DiagnosticCategory(id.Value, name.Value, kind.Value, type.Value, description.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.cs index dca5053fae54..57b10cf75dd7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategory.cs @@ -1,32 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Class representing detector definition. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Class representing detector definition + /// + [Rest.Serialization.JsonTransformation] public partial class DiagnosticCategory : ProxyOnlyResource { - /// Initializes a new instance of DiagnosticCategory. + /// + /// Initializes a new instance of the DiagnosticCategory class. + /// public DiagnosticCategory() { + CustomInit(); } - /// Initializes a new instance of DiagnosticCategory. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Description of the diagnostic category. - internal DiagnosticCategory(string id, string name, string kind, string type, string description) : base(id, name, kind, type) + /// + /// Initializes a new instance of the DiagnosticCategory class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Description of the diagnostic + /// category + public DiagnosticCategory(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string description = default(string)) + : base(id, name, kind, type) { Description = description; + CustomInit(); } - /// Description of the diagnostic category. - public string Description { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets description of the diagnostic category + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.Serialization.cs deleted file mode 100644 index 0b7bb69869c6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class DiagnosticCategoryCollection - { - internal static DiagnosticCategoryCollection DeserializeDiagnosticCategoryCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DiagnosticCategory.DeserializeDiagnosticCategory(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DiagnosticCategoryCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.cs deleted file mode 100644 index 558bb7cc0b4d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticCategoryCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Diagnostic Categories. - internal partial class DiagnosticCategoryCollection - { - /// Initializes a new instance of DiagnosticCategoryCollection. - /// Collection of resources. - /// is null. - internal DiagnosticCategoryCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of DiagnosticCategoryCollection. - /// Collection of resources. - /// Link to next page of resources. - internal DiagnosticCategoryCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.Serialization.cs deleted file mode 100644 index 9bec690470e3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.Serialization.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DiagnosticData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Table)) - { - writer.WritePropertyName("table"); - writer.WriteObjectValue(Table); - } - if (Optional.IsDefined(RenderingProperties)) - { - writer.WritePropertyName("renderingProperties"); - writer.WriteObjectValue(RenderingProperties); - } - writer.WriteEndObject(); - } - - internal static DiagnosticData DeserializeDiagnosticData(JsonElement element) - { - Optional table = default; - Optional renderingProperties = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("table")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - table = DataTableResponseObject.DeserializeDataTableResponseObject(property.Value); - continue; - } - if (property.NameEquals("renderingProperties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - renderingProperties = Rendering.DeserializeRendering(property.Value); - continue; - } - } - return new DiagnosticData(table.Value, renderingProperties.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.cs index 75ba32a7ef5b..af8f9d08d4c9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticData.cs @@ -1,32 +1,61 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Set of data with rendering instructions. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Set of data with rendering instructions + /// public partial class DiagnosticData { - /// Initializes a new instance of DiagnosticData. + /// + /// Initializes a new instance of the DiagnosticData class. + /// public DiagnosticData() { + CustomInit(); } - /// Initializes a new instance of DiagnosticData. - /// Data in table form. - /// Properties that describe how the table should be rendered. - internal DiagnosticData(DataTableResponseObject table, Rendering renderingProperties) + /// + /// Initializes a new instance of the DiagnosticData class. + /// + /// Data in table form + /// Properties that describe how the + /// table should be rendered + public DiagnosticData(DataTableResponseObject table = default(DataTableResponseObject), Rendering renderingProperties = default(Rendering)) { Table = table; RenderingProperties = renderingProperties; + CustomInit(); } - /// Data in table form. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets data in table form + /// + [JsonProperty(PropertyName = "table")] public DataTableResponseObject Table { get; set; } - /// Properties that describe how the table should be rendered. + + /// + /// Gets or sets properties that describe how the table should be + /// rendered + /// + [JsonProperty(PropertyName = "renderingProperties")] public Rendering RenderingProperties { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.Serialization.cs deleted file mode 100644 index 87cc22578f0a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class DiagnosticDetectorCollection - { - internal static DiagnosticDetectorCollection DeserializeDiagnosticDetectorCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DetectorDefinition.DeserializeDetectorDefinition(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DiagnosticDetectorCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.cs deleted file mode 100644 index 22a94d00e81a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Diagnostic Detectors. - internal partial class DiagnosticDetectorCollection - { - /// Initializes a new instance of DiagnosticDetectorCollection. - /// Collection of resources. - /// is null. - internal DiagnosticDetectorCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of DiagnosticDetectorCollection. - /// Collection of resources. - /// Link to next page of resources. - internal DiagnosticDetectorCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.Serialization.cs deleted file mode 100644 index 0a10d646c42b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.Serialization.cs +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DiagnosticDetectorResponse : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(StartTime)) - { - writer.WritePropertyName("startTime"); - writer.WriteStringValue(StartTime.Value, "O"); - } - if (Optional.IsDefined(EndTime)) - { - writer.WritePropertyName("endTime"); - writer.WriteStringValue(EndTime.Value, "O"); - } - if (Optional.IsDefined(IssueDetected)) - { - writer.WritePropertyName("issueDetected"); - writer.WriteBooleanValue(IssueDetected.Value); - } - if (Optional.IsDefined(DetectorDefinition)) - { - writer.WritePropertyName("detectorDefinition"); - writer.WriteObjectValue(DetectorDefinition); - } - if (Optional.IsCollectionDefined(Metrics)) - { - writer.WritePropertyName("metrics"); - writer.WriteStartArray(); - foreach (var item in Metrics) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(AbnormalTimePeriods)) - { - writer.WritePropertyName("abnormalTimePeriods"); - writer.WriteStartArray(); - foreach (var item in AbnormalTimePeriods) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Data)) - { - writer.WritePropertyName("data"); - writer.WriteStartArray(); - foreach (var item in Data) - { - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteObjectValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ResponseMetaData)) - { - writer.WritePropertyName("responseMetaData"); - writer.WriteObjectValue(ResponseMetaData); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static DiagnosticDetectorResponse DeserializeDiagnosticDetectorResponse(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional startTime = default; - Optional endTime = default; - Optional issueDetected = default; - Optional detectorDefinition = default; - Optional> metrics = default; - Optional> abnormalTimePeriods = default; - Optional>> data = default; - Optional responseMetaData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("startTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("endTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - endTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("issueDetected")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - issueDetected = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("detectorDefinition")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - detectorDefinition = DetectorDefinition.DeserializeDetectorDefinition(property0.Value); - continue; - } - if (property0.NameEquals("metrics")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(DiagnosticMetricSet.DeserializeDiagnosticMetricSet(item)); - } - metrics = array; - continue; - } - if (property0.NameEquals("abnormalTimePeriods")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(DetectorAbnormalTimePeriod.DeserializeDetectorAbnormalTimePeriod(item)); - } - abnormalTimePeriods = array; - continue; - } - if (property0.NameEquals("data")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property0.Value.EnumerateArray()) - { - List array0 = new List(); - foreach (var item0 in item.EnumerateArray()) - { - array0.Add(NameValuePair.DeserializeNameValuePair(item0)); - } - array.Add(array0); - } - data = array; - continue; - } - if (property0.NameEquals("responseMetaData")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - responseMetaData = ResponseMetaData.DeserializeResponseMetaData(property0.Value); - continue; - } - } - continue; - } - } - return new DiagnosticDetectorResponse(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToNullable(issueDetected), detectorDefinition.Value, Optional.ToList(metrics), Optional.ToList(abnormalTimePeriods), Optional.ToList(data), responseMetaData.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.cs index 454d5f3b7f3a..2a896dd8fdef 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticDetectorResponse.cs @@ -1,41 +1,56 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Class representing Response from Diagnostic Detectors. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Class representing Response from Diagnostic Detectors + /// + [Rest.Serialization.JsonTransformation] public partial class DiagnosticDetectorResponse : ProxyOnlyResource { - /// Initializes a new instance of DiagnosticDetectorResponse. + /// + /// Initializes a new instance of the DiagnosticDetectorResponse class. + /// public DiagnosticDetectorResponse() { - Metrics = new ChangeTrackingList(); - AbnormalTimePeriods = new ChangeTrackingList(); - Data = new ChangeTrackingList>(); + CustomInit(); } - /// Initializes a new instance of DiagnosticDetectorResponse. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Start time of the period. - /// End time of the period. - /// Flag representing Issue was detected. - /// Detector's definition. - /// Metrics provided by the detector. - /// List of Correlated events found by the detector. - /// Additional Data that detector wants to send. - /// Meta Data. - internal DiagnosticDetectorResponse(string id, string name, string kind, string type, DateTimeOffset? startTime, DateTimeOffset? endTime, bool? issueDetected, DetectorDefinition detectorDefinition, IList metrics, IList abnormalTimePeriods, IList> data, ResponseMetaData responseMetaData) : base(id, name, kind, type) + /// + /// Initializes a new instance of the DiagnosticDetectorResponse class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Start time of the period + /// End time of the period + /// Flag representing Issue was + /// detected. + /// Detector's definition + /// Metrics provided by the detector + /// List of Correlated events found + /// by the detector + /// Additional Data that detector wants to + /// send. + /// Meta Data + public DiagnosticDetectorResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), bool? issueDetected = default(bool?), DetectorDefinition detectorDefinition = default(DetectorDefinition), IList metrics = default(IList), IList abnormalTimePeriods = default(IList), IList> data = default(IList>), ResponseMetaData responseMetaData = default(ResponseMetaData)) + : base(id, name, kind, type) { StartTime = startTime; EndTime = endTime; @@ -45,23 +60,61 @@ internal DiagnosticDetectorResponse(string id, string name, string kind, string AbnormalTimePeriods = abnormalTimePeriods; Data = data; ResponseMetaData = responseMetaData; + CustomInit(); } - /// Start time of the period. - public DateTimeOffset? StartTime { get; set; } - /// End time of the period. - public DateTimeOffset? EndTime { get; set; } - /// Flag representing Issue was detected. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets start time of the period + /// + [JsonProperty(PropertyName = "properties.startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets end time of the period + /// + [JsonProperty(PropertyName = "properties.endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets flag representing Issue was detected. + /// + [JsonProperty(PropertyName = "properties.issueDetected")] public bool? IssueDetected { get; set; } - /// Detector's definition. + + /// + /// Gets or sets detector's definition + /// + [JsonProperty(PropertyName = "properties.detectorDefinition")] public DetectorDefinition DetectorDefinition { get; set; } - /// Metrics provided by the detector. - public IList Metrics { get; } - /// List of Correlated events found by the detector. - public IList AbnormalTimePeriods { get; } - /// Additional Data that detector wants to send. - public IList> Data { get; } - /// Meta Data. + + /// + /// Gets or sets metrics provided by the detector + /// + [JsonProperty(PropertyName = "properties.metrics")] + public IList Metrics { get; set; } + + /// + /// Gets or sets list of Correlated events found by the detector + /// + [JsonProperty(PropertyName = "properties.abnormalTimePeriods")] + public IList AbnormalTimePeriods { get; set; } + + /// + /// Gets or sets additional Data that detector wants to send. + /// + [JsonProperty(PropertyName = "properties.data")] + public IList> Data { get; set; } + + /// + /// Gets or sets meta Data + /// + [JsonProperty(PropertyName = "properties.responseMetaData")] public ResponseMetaData ResponseMetaData { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.Serialization.cs deleted file mode 100644 index bef57da80be3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.Serialization.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DiagnosticMetricSample : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Timestamp)) - { - writer.WritePropertyName("timestamp"); - writer.WriteStringValue(Timestamp.Value, "O"); - } - if (Optional.IsDefined(RoleInstance)) - { - writer.WritePropertyName("roleInstance"); - writer.WriteStringValue(RoleInstance); - } - if (Optional.IsDefined(Total)) - { - writer.WritePropertyName("total"); - writer.WriteNumberValue(Total.Value); - } - if (Optional.IsDefined(Maximum)) - { - writer.WritePropertyName("maximum"); - writer.WriteNumberValue(Maximum.Value); - } - if (Optional.IsDefined(Minimum)) - { - writer.WritePropertyName("minimum"); - writer.WriteNumberValue(Minimum.Value); - } - if (Optional.IsDefined(IsAggregated)) - { - writer.WritePropertyName("isAggregated"); - writer.WriteBooleanValue(IsAggregated.Value); - } - writer.WriteEndObject(); - } - - internal static DiagnosticMetricSample DeserializeDiagnosticMetricSample(JsonElement element) - { - Optional timestamp = default; - Optional roleInstance = default; - Optional total = default; - Optional maximum = default; - Optional minimum = default; - Optional isAggregated = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timestamp")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - timestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("roleInstance")) - { - roleInstance = property.Value.GetString(); - continue; - } - if (property.NameEquals("total")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - total = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("maximum")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maximum = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("minimum")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - minimum = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("isAggregated")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isAggregated = property.Value.GetBoolean(); - continue; - } - } - return new DiagnosticMetricSample(Optional.ToNullable(timestamp), roleInstance.Value, Optional.ToNullable(total), Optional.ToNullable(maximum), Optional.ToNullable(minimum), Optional.ToNullable(isAggregated)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.cs index 41687074a22a..5c39fa5a0748 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSample.cs @@ -1,35 +1,51 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Class representing Diagnostic Metric. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Class representing Diagnostic Metric + /// public partial class DiagnosticMetricSample { - /// Initializes a new instance of DiagnosticMetricSample. + /// + /// Initializes a new instance of the DiagnosticMetricSample class. + /// public DiagnosticMetricSample() { + CustomInit(); } - /// Initializes a new instance of DiagnosticMetricSample. - /// Time at which metric is measured. - /// - /// Role Instance. Null if this counter is not per instance - /// This is returned and should be whichever instance name we desire to be returned + /// + /// Initializes a new instance of the DiagnosticMetricSample class. + /// + /// Time at which metric is measured + /// Role Instance. Null if this counter is + /// not per instance + /// This is returned and should be whichever instance name we desire to + /// be returned /// i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) - /// where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis. - /// - /// Total value of the metric. If multiple measurements are made this will have sum of all. - /// Maximum of the metric sampled during the time period. - /// Minimum of the metric sampled during the time period. - /// Whether the values are aggregates across all workers or not. - internal DiagnosticMetricSample(DateTimeOffset? timestamp, string roleInstance, double? total, double? maximum, double? minimum, bool? isAggregated) + /// where RDWORKERNAME is Machine name below and RoleInstance name in + /// parenthesis + /// Total value of the metric. If multiple + /// measurements are made this will have sum of all. + /// Maximum of the metric sampled during the time + /// period + /// Minimum of the metric sampled during the time + /// period + /// Whether the values are aggregates across + /// all workers or not + public DiagnosticMetricSample(System.DateTime? timestamp = default(System.DateTime?), string roleInstance = default(string), double? total = default(double?), double? maximum = default(double?), double? minimum = default(double?), bool? isAggregated = default(bool?)) { Timestamp = timestamp; RoleInstance = roleInstance; @@ -37,24 +53,57 @@ internal DiagnosticMetricSample(DateTimeOffset? timestamp, string roleInstance, Maximum = maximum; Minimum = minimum; IsAggregated = isAggregated; + CustomInit(); } - /// Time at which metric is measured. - public DateTimeOffset? Timestamp { get; set; } /// - /// Role Instance. Null if this counter is not per instance - /// This is returned and should be whichever instance name we desire to be returned + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets time at which metric is measured + /// + [JsonProperty(PropertyName = "timestamp")] + public System.DateTime? Timestamp { get; set; } + + /// + /// Gets or sets role Instance. Null if this counter is not per + /// instance + /// This is returned and should be whichever instance name we desire to + /// be returned /// i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) - /// where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis. + /// where RDWORKERNAME is Machine name below and RoleInstance name in + /// parenthesis /// + [JsonProperty(PropertyName = "roleInstance")] public string RoleInstance { get; set; } - /// Total value of the metric. If multiple measurements are made this will have sum of all. + + /// + /// Gets or sets total value of the metric. If multiple measurements + /// are made this will have sum of all. + /// + [JsonProperty(PropertyName = "total")] public double? Total { get; set; } - /// Maximum of the metric sampled during the time period. + + /// + /// Gets or sets maximum of the metric sampled during the time period + /// + [JsonProperty(PropertyName = "maximum")] public double? Maximum { get; set; } - /// Minimum of the metric sampled during the time period. + + /// + /// Gets or sets minimum of the metric sampled during the time period + /// + [JsonProperty(PropertyName = "minimum")] public double? Minimum { get; set; } - /// Whether the values are aggregates across all workers or not. + + /// + /// Gets or sets whether the values are aggregates across all workers + /// or not + /// + [JsonProperty(PropertyName = "isAggregated")] public bool? IsAggregated { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.Serialization.cs deleted file mode 100644 index 22ef7acd3dd2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.Serialization.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DiagnosticMetricSet : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Unit)) - { - writer.WritePropertyName("unit"); - writer.WriteStringValue(Unit); - } - if (Optional.IsDefined(StartTime)) - { - writer.WritePropertyName("startTime"); - writer.WriteStringValue(StartTime.Value, "O"); - } - if (Optional.IsDefined(EndTime)) - { - writer.WritePropertyName("endTime"); - writer.WriteStringValue(EndTime.Value, "O"); - } - if (Optional.IsDefined(TimeGrain)) - { - writer.WritePropertyName("timeGrain"); - writer.WriteStringValue(TimeGrain); - } - if (Optional.IsCollectionDefined(Values)) - { - writer.WritePropertyName("values"); - writer.WriteStartArray(); - foreach (var item in Values) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static DiagnosticMetricSet DeserializeDiagnosticMetricSet(JsonElement element) - { - Optional name = default; - Optional unit = default; - Optional startTime = default; - Optional endTime = default; - Optional timeGrain = default; - Optional> values = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("unit")) - { - unit = property.Value.GetString(); - continue; - } - if (property.NameEquals("startTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("endTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - endTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("timeGrain")) - { - timeGrain = property.Value.GetString(); - continue; - } - if (property.NameEquals("values")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DiagnosticMetricSample.DeserializeDiagnosticMetricSample(item)); - } - values = array; - continue; - } - } - return new DiagnosticMetricSet(name.Value, unit.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), timeGrain.Value, Optional.ToList(values)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.cs index 81998f8fdb97..d815618a15d5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DiagnosticMetricSet.cs @@ -1,33 +1,46 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Class representing Diagnostic Metric information. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Class representing Diagnostic Metric information + /// public partial class DiagnosticMetricSet { - /// Initializes a new instance of DiagnosticMetricSet. + /// + /// Initializes a new instance of the DiagnosticMetricSet class. + /// public DiagnosticMetricSet() { - Values = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of DiagnosticMetricSet. - /// Name of the metric. - /// Metric's unit. - /// Start time of the period. - /// End time of the period. - /// Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D. - /// Collection of metric values for the selected period based on the {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain}. - internal DiagnosticMetricSet(string name, string unit, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain, IList values) + /// + /// Initializes a new instance of the DiagnosticMetricSet class. + /// + /// Name of the metric + /// Metric's unit + /// Start time of the period + /// End time of the period + /// Presented time grain. Supported grains at + /// the moment are PT1M, PT1H, P1D + /// Collection of metric values for the selected + /// period based on the + /// {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain} + public DiagnosticMetricSet(string name = default(string), string unit = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), IList values = default(IList)) { Name = name; Unit = unit; @@ -35,19 +48,52 @@ internal DiagnosticMetricSet(string name, string unit, DateTimeOffset? startTime EndTime = endTime; TimeGrain = timeGrain; Values = values; + CustomInit(); } - /// Name of the metric. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the metric + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// Metric's unit. + + /// + /// Gets or sets metric's unit + /// + [JsonProperty(PropertyName = "unit")] public string Unit { get; set; } - /// Start time of the period. - public DateTimeOffset? StartTime { get; set; } - /// End time of the period. - public DateTimeOffset? EndTime { get; set; } - /// Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D. + + /// + /// Gets or sets start time of the period + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets end time of the period + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets presented time grain. Supported grains at the moment + /// are PT1M, PT1H, P1D + /// + [JsonProperty(PropertyName = "timeGrain")] public string TimeGrain { get; set; } - /// Collection of metric values for the selected period based on the {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain}. - public IList Values { get; } + + /// + /// Gets or sets collection of metric values for the selected period + /// based on the + /// {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain} + /// + [JsonProperty(PropertyName = "values")] + public IList Values { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.Serialization.cs deleted file mode 100644 index a89ec6e8f30b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Dimension - { - internal static Dimension DeserializeDimension(JsonElement element) - { - Optional name = default; - Optional displayName = default; - Optional internalName = default; - Optional toBeExportedForShoebox = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("displayName")) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("internalName")) - { - internalName = property.Value.GetString(); - continue; - } - if (property.NameEquals("toBeExportedForShoebox")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - toBeExportedForShoebox = property.Value.GetBoolean(); - continue; - } - } - return new Dimension(name.Value, displayName.Value, internalName.Value, Optional.ToNullable(toBeExportedForShoebox)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.cs index 0dba87b68e95..1d48f3d78976 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Dimension.cs @@ -1,39 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { + using Newtonsoft.Json; + using System.Linq; + /// - /// Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, - /// where instance name is dimension of the metric HTTP request. + /// Dimension of a resource metric. For e.g. instance specific HTTP + /// requests for a web app, + /// where instance name is dimension of the metric HTTP request /// public partial class Dimension { - /// Initializes a new instance of Dimension. - internal Dimension() + /// + /// Initializes a new instance of the Dimension class. + /// + public Dimension() { + CustomInit(); } - /// Initializes a new instance of Dimension. - /// . - /// . - /// . - /// . - internal Dimension(string name, string displayName, string internalName, bool? toBeExportedForShoebox) + /// + /// Initializes a new instance of the Dimension class. + /// + public Dimension(string name = default(string), string displayName = default(string), string internalName = default(string), bool? toBeExportedForShoebox = default(bool?)) { Name = name; DisplayName = displayName; InternalName = internalName; ToBeExportedForShoebox = toBeExportedForShoebox; + CustomInit(); } - public string Name { get; } - public string DisplayName { get; } - public string InternalName { get; } - public bool? ToBeExportedForShoebox { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// + [JsonProperty(PropertyName = "internalName")] + public string InternalName { get; set; } + + /// + /// + [JsonProperty(PropertyName = "toBeExportedForShoebox")] + public bool? ToBeExportedForShoebox { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.Serialization.cs deleted file mode 100644 index eb5c4160812b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class DnsTypeExtensions - { - public static string ToSerialString(this DnsType value) => value switch - { - DnsType.AzureDns => "AzureDns", - DnsType.DefaultDomainRegistrarDns => "DefaultDomainRegistrarDns", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DnsType value.") - }; - - public static DnsType ToDnsType(this string value) - { - if (string.Equals(value, "AzureDns", StringComparison.InvariantCultureIgnoreCase)) return DnsType.AzureDns; - if (string.Equals(value, "DefaultDomainRegistrarDns", StringComparison.InvariantCultureIgnoreCase)) return DnsType.DefaultDomainRegistrarDns; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DnsType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.cs index bb47253477f3..2790d6b0308b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsType.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Current DNS type. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DnsType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum DnsType { - /// AzureDns. + [EnumMember(Value = "AzureDns")] AzureDns, - /// DefaultDomainRegistrarDns. + [EnumMember(Value = "DefaultDomainRegistrarDns")] DefaultDomainRegistrarDns } + internal static class DnsTypeEnumExtension + { + internal static string ToSerializedValue(this DnsType? value) + { + return value == null ? null : ((DnsType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DnsType value) + { + switch( value ) + { + case DnsType.AzureDns: + return "AzureDns"; + case DnsType.DefaultDomainRegistrarDns: + return "DefaultDomainRegistrarDns"; + } + return null; + } + + internal static DnsType? ParseDnsType(this string value) + { + switch( value ) + { + case "AzureDns": + return DnsType.AzureDns; + case "DefaultDomainRegistrarDns": + return DnsType.DefaultDomainRegistrarDns; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.Serialization.cs deleted file mode 100644 index 86a9a903bd85..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class DnsVerificationTestResultExtensions - { - public static string ToSerialString(this DnsVerificationTestResult value) => value switch - { - DnsVerificationTestResult.Passed => "Passed", - DnsVerificationTestResult.Failed => "Failed", - DnsVerificationTestResult.Skipped => "Skipped", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DnsVerificationTestResult value.") - }; - - public static DnsVerificationTestResult ToDnsVerificationTestResult(this string value) - { - if (string.Equals(value, "Passed", StringComparison.InvariantCultureIgnoreCase)) return DnsVerificationTestResult.Passed; - if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return DnsVerificationTestResult.Failed; - if (string.Equals(value, "Skipped", StringComparison.InvariantCultureIgnoreCase)) return DnsVerificationTestResult.Skipped; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DnsVerificationTestResult value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.cs index 3033815a2eed..eabbc5fe01af 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DnsVerificationTestResult.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// DNS verification test result. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DnsVerificationTestResult. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum DnsVerificationTestResult { - /// Passed. + [EnumMember(Value = "Passed")] Passed, - /// Failed. + [EnumMember(Value = "Failed")] Failed, - /// Skipped. + [EnumMember(Value = "Skipped")] Skipped } + internal static class DnsVerificationTestResultEnumExtension + { + internal static string ToSerializedValue(this DnsVerificationTestResult? value) + { + return value == null ? null : ((DnsVerificationTestResult)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DnsVerificationTestResult value) + { + switch( value ) + { + case DnsVerificationTestResult.Passed: + return "Passed"; + case DnsVerificationTestResult.Failed: + return "Failed"; + case DnsVerificationTestResult.Skipped: + return "Skipped"; + } + return null; + } + + internal static DnsVerificationTestResult? ParseDnsVerificationTestResult(this string value) + { + switch( value ) + { + case "Passed": + return DnsVerificationTestResult.Passed; + case "Failed": + return DnsVerificationTestResult.Failed; + case "Skipped": + return DnsVerificationTestResult.Skipped; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.Serialization.cs deleted file mode 100644 index ce2d3c3ac0e8..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.Serialization.cs +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Domain : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ContactAdmin)) - { - writer.WritePropertyName("contactAdmin"); - writer.WriteObjectValue(ContactAdmin); - } - if (Optional.IsDefined(ContactBilling)) - { - writer.WritePropertyName("contactBilling"); - writer.WriteObjectValue(ContactBilling); - } - if (Optional.IsDefined(ContactRegistrant)) - { - writer.WritePropertyName("contactRegistrant"); - writer.WriteObjectValue(ContactRegistrant); - } - if (Optional.IsDefined(ContactTech)) - { - writer.WritePropertyName("contactTech"); - writer.WriteObjectValue(ContactTech); - } - if (Optional.IsDefined(Privacy)) - { - writer.WritePropertyName("privacy"); - writer.WriteBooleanValue(Privacy.Value); - } - if (Optional.IsDefined(AutoRenew)) - { - writer.WritePropertyName("autoRenew"); - writer.WriteBooleanValue(AutoRenew.Value); - } - if (Optional.IsDefined(Consent)) - { - writer.WritePropertyName("consent"); - writer.WriteObjectValue(Consent); - } - if (Optional.IsDefined(DnsType)) - { - writer.WritePropertyName("dnsType"); - writer.WriteStringValue(DnsType.Value.ToSerialString()); - } - if (Optional.IsDefined(DnsZoneId)) - { - writer.WritePropertyName("dnsZoneId"); - writer.WriteStringValue(DnsZoneId); - } - if (Optional.IsDefined(TargetDnsType)) - { - writer.WritePropertyName("targetDnsType"); - writer.WriteStringValue(TargetDnsType.Value.ToSerialString()); - } - if (Optional.IsDefined(AuthCode)) - { - writer.WritePropertyName("authCode"); - writer.WriteStringValue(AuthCode); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Domain DeserializeDomain(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - string location = default; - Optional type = default; - Optional> tags = default; - Optional contactAdmin = default; - Optional contactBilling = default; - Optional contactRegistrant = default; - Optional contactTech = default; - Optional registrationStatus = default; - Optional provisioningState = default; - Optional> nameServers = default; - Optional privacy = default; - Optional createdTime = default; - Optional expirationTime = default; - Optional lastRenewedTime = default; - Optional autoRenew = default; - Optional readyForDnsRecordManagement = default; - Optional> managedHostNames = default; - Optional consent = default; - Optional> domainNotRenewableReasons = default; - Optional dnsType = default; - Optional dnsZoneId = default; - Optional targetDnsType = default; - Optional authCode = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("contactAdmin")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - contactAdmin = Contact.DeserializeContact(property0.Value); - continue; - } - if (property0.NameEquals("contactBilling")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - contactBilling = Contact.DeserializeContact(property0.Value); - continue; - } - if (property0.NameEquals("contactRegistrant")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - contactRegistrant = Contact.DeserializeContact(property0.Value); - continue; - } - if (property0.NameEquals("contactTech")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - contactTech = Contact.DeserializeContact(property0.Value); - continue; - } - if (property0.NameEquals("registrationStatus")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - registrationStatus = property0.Value.GetString().ToDomainStatus(); - continue; - } - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property0.Value.GetString().ToProvisioningState(); - continue; - } - if (property0.NameEquals("nameServers")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - nameServers = array; - continue; - } - if (property0.NameEquals("privacy")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - privacy = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("createdTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - createdTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("expirationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - expirationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("lastRenewedTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - lastRenewedTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("autoRenew")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - autoRenew = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("readyForDnsRecordManagement")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - readyForDnsRecordManagement = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("managedHostNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(HostName.DeserializeHostName(item)); - } - managedHostNames = array; - continue; - } - if (property0.NameEquals("consent")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - consent = DomainPurchaseConsent.DeserializeDomainPurchaseConsent(property0.Value); - continue; - } - if (property0.NameEquals("domainNotRenewableReasons")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(new DomainPropertiesDomainNotRenewableReasonsItem(item.GetString())); - } - domainNotRenewableReasons = array; - continue; - } - if (property0.NameEquals("dnsType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - dnsType = property0.Value.GetString().ToDnsType(); - continue; - } - if (property0.NameEquals("dnsZoneId")) - { - dnsZoneId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("targetDnsType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - targetDnsType = property0.Value.GetString().ToDnsType(); - continue; - } - if (property0.NameEquals("authCode")) - { - authCode = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new Domain(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), contactAdmin.Value, contactBilling.Value, contactRegistrant.Value, contactTech.Value, Optional.ToNullable(registrationStatus), Optional.ToNullable(provisioningState), Optional.ToList(nameServers), Optional.ToNullable(privacy), Optional.ToNullable(createdTime), Optional.ToNullable(expirationTime), Optional.ToNullable(lastRenewedTime), Optional.ToNullable(autoRenew), Optional.ToNullable(readyForDnsRecordManagement), Optional.ToList(managedHostNames), consent.Value, Optional.ToList(domainNotRenewableReasons), Optional.ToNullable(dnsType), dnsZoneId.Value, Optional.ToNullable(targetDnsType), authCode.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.cs index 26987b50860c..7b37c3176248 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Domain.cs @@ -1,65 +1,90 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Information about a domain. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Information about a domain. + /// + [Rest.Serialization.JsonTransformation] public partial class Domain : Resource { - /// Initializes a new instance of Domain. - /// Resource Location. - /// is null. - public Domain(string location) : base(location) + /// + /// Initializes a new instance of the Domain class. + /// + public Domain() { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - NameServers = new ChangeTrackingList(); - ManagedHostNames = new ChangeTrackingList(); - DomainNotRenewableReasons = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of Domain. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource Location. - /// Resource type. - /// Resource tags. - /// Administrative contact. - /// Billing contact. - /// Registrant contact. - /// Technical contact. - /// Domain registration status. - /// Domain provisioning state. - /// Name servers. - /// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>. - /// Domain creation timestamp. - /// Domain expiration timestamp. - /// Timestamp when the domain was renewed last time. - /// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>. - /// - /// <code>true</code> if Azure can assign this domain to App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain registration status is active and - /// it is hosted on name servers Azure has programmatic access to. - /// - /// All hostnames derived from the domain and assigned to Azure resources. - /// Legal agreement consent. - /// Reasons why domain is not renewable. - /// Current DNS type. - /// Azure DNS Zone to use. - /// Target DNS type (would be used for migration). - /// . - internal Domain(string id, string name, string kind, string location, string type, IDictionary tags, Contact contactAdmin, Contact contactBilling, Contact contactRegistrant, Contact contactTech, DomainStatus? registrationStatus, ProvisioningState? provisioningState, IReadOnlyList nameServers, bool? privacy, DateTimeOffset? createdTime, DateTimeOffset? expirationTime, DateTimeOffset? lastRenewedTime, bool? autoRenew, bool? readyForDnsRecordManagement, IReadOnlyList managedHostNames, DomainPurchaseConsent consent, IReadOnlyList domainNotRenewableReasons, DnsType? dnsType, string dnsZoneId, DnsType? targetDnsType, string authCode) : base(id, name, kind, location, type, tags) + /// + /// Initializes a new instance of the Domain class. + /// + /// Resource Location. + /// Administrative contact. + /// Billing contact. + /// Registrant contact. + /// Technical contact. + /// Legal agreement consent. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Resource tags. + /// Domain registration status. + /// Possible values include: 'Active', 'Awaiting', 'Cancelled', + /// 'Confiscated', 'Disabled', 'Excluded', 'Expired', 'Failed', 'Held', + /// 'Locked', 'Parked', 'Pending', 'Reserved', 'Reverted', 'Suspended', + /// 'Transferred', 'Unknown', 'Unlocked', 'Unparked', 'Updated', + /// 'JsonConverterFailed' + /// Domain provisioning state. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// 'Deleting' + /// Name servers. + /// <code>true</code> if domain + /// privacy is enabled for this domain; otherwise, + /// <code>false</code>. + /// Domain creation timestamp. + /// Domain expiration timestamp. + /// Timestamp when the domain was renewed + /// last time. + /// <code>true</code> if the domain + /// should be automatically renewed; otherwise, + /// <code>false</code>. + /// <code>true</code> if + /// Azure can assign this domain to App Service apps; otherwise, + /// <code>false</code>. This value will be + /// <code>true</code> if domain registration status is + /// active and + /// it is hosted on name servers Azure has programmatic access + /// to. + /// All hostnames derived from the + /// domain and assigned to Azure resources. + /// Reasons why domain is not + /// renewable. + /// Current DNS type. Possible values include: + /// 'AzureDns', 'DefaultDomainRegistrarDns' + /// Azure DNS Zone to use + /// Target DNS type (would be used for + /// migration). Possible values include: 'AzureDns', + /// 'DefaultDomainRegistrarDns' + public Domain(string location, Contact contactAdmin, Contact contactBilling, Contact contactRegistrant, Contact contactTech, DomainPurchaseConsent consent, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), DomainStatus? registrationStatus = default(DomainStatus?), ProvisioningState? provisioningState = default(ProvisioningState?), IList nameServers = default(IList), bool? privacy = default(bool?), System.DateTime? createdTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), System.DateTime? lastRenewedTime = default(System.DateTime?), bool? autoRenew = default(bool?), bool? readyForDnsRecordManagement = default(bool?), IList managedHostNames = default(IList), IList domainNotRenewableReasons = default(IList), DnsType? dnsType = default(DnsType?), string dnsZoneId = default(string), DnsType? targetDnsType = default(DnsType?), string authCode = default(string)) + : base(location, id, name, kind, type, tags) { ContactAdmin = contactAdmin; ContactBilling = contactBilling; @@ -81,49 +106,195 @@ internal Domain(string id, string name, string kind, string location, string typ DnsZoneId = dnsZoneId; TargetDnsType = targetDnsType; AuthCode = authCode; + CustomInit(); } - /// Administrative contact. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets administrative contact. + /// + [JsonProperty(PropertyName = "properties.contactAdmin")] public Contact ContactAdmin { get; set; } - /// Billing contact. + + /// + /// Gets or sets billing contact. + /// + [JsonProperty(PropertyName = "properties.contactBilling")] public Contact ContactBilling { get; set; } - /// Registrant contact. + + /// + /// Gets or sets registrant contact. + /// + [JsonProperty(PropertyName = "properties.contactRegistrant")] public Contact ContactRegistrant { get; set; } - /// Technical contact. + + /// + /// Gets or sets technical contact. + /// + [JsonProperty(PropertyName = "properties.contactTech")] public Contact ContactTech { get; set; } - /// Domain registration status. - public DomainStatus? RegistrationStatus { get; } - /// Domain provisioning state. - public ProvisioningState? ProvisioningState { get; } - /// Name servers. - public IReadOnlyList NameServers { get; } - /// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>. + + /// + /// Gets domain registration status. Possible values include: 'Active', + /// 'Awaiting', 'Cancelled', 'Confiscated', 'Disabled', 'Excluded', + /// 'Expired', 'Failed', 'Held', 'Locked', 'Parked', 'Pending', + /// 'Reserved', 'Reverted', 'Suspended', 'Transferred', 'Unknown', + /// 'Unlocked', 'Unparked', 'Updated', 'JsonConverterFailed' + /// + [JsonProperty(PropertyName = "properties.registrationStatus")] + public DomainStatus? RegistrationStatus { get; private set; } + + /// + /// Gets domain provisioning state. Possible values include: + /// 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState? ProvisioningState { get; private set; } + + /// + /// Gets name servers. + /// + [JsonProperty(PropertyName = "properties.nameServers")] + public IList NameServers { get; private set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// domain privacy is enabled for this domain; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.privacy")] public bool? Privacy { get; set; } - /// Domain creation timestamp. - public DateTimeOffset? CreatedTime { get; } - /// Domain expiration timestamp. - public DateTimeOffset? ExpirationTime { get; } - /// Timestamp when the domain was renewed last time. - public DateTimeOffset? LastRenewedTime { get; } - /// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>. + + /// + /// Gets domain creation timestamp. + /// + [JsonProperty(PropertyName = "properties.createdTime")] + public System.DateTime? CreatedTime { get; private set; } + + /// + /// Gets domain expiration timestamp. + /// + [JsonProperty(PropertyName = "properties.expirationTime")] + public System.DateTime? ExpirationTime { get; private set; } + + /// + /// Gets timestamp when the domain was renewed last time. + /// + [JsonProperty(PropertyName = "properties.lastRenewedTime")] + public System.DateTime? LastRenewedTime { get; private set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// domain should be automatically renewed; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.autoRenew")] public bool? AutoRenew { get; set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if Azure can + /// assign this domain to App Service apps; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. This value will be + /// &lt;code&gt;true&lt;/code&gt; if domain + /// registration status is active and + /// it is hosted on name servers Azure has programmatic access to. + /// + [JsonProperty(PropertyName = "properties.readyForDnsRecordManagement")] + public bool? ReadyForDnsRecordManagement { get; private set; } + /// - /// <code>true</code> if Azure can assign this domain to App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain registration status is active and - /// it is hosted on name servers Azure has programmatic access to. + /// Gets all hostnames derived from the domain and assigned to Azure + /// resources. /// - public bool? ReadyForDnsRecordManagement { get; } - /// All hostnames derived from the domain and assigned to Azure resources. - public IReadOnlyList ManagedHostNames { get; } - /// Legal agreement consent. + [JsonProperty(PropertyName = "properties.managedHostNames")] + public IList ManagedHostNames { get; private set; } + + /// + /// Gets or sets legal agreement consent. + /// + [JsonProperty(PropertyName = "properties.consent")] public DomainPurchaseConsent Consent { get; set; } - /// Reasons why domain is not renewable. - public IReadOnlyList DomainNotRenewableReasons { get; } - /// Current DNS type. + + /// + /// Gets reasons why domain is not renewable. + /// + [JsonProperty(PropertyName = "properties.domainNotRenewableReasons")] + public IList DomainNotRenewableReasons { get; private set; } + + /// + /// Gets or sets current DNS type. Possible values include: 'AzureDns', + /// 'DefaultDomainRegistrarDns' + /// + [JsonProperty(PropertyName = "properties.dnsType")] public DnsType? DnsType { get; set; } - /// Azure DNS Zone to use. + + /// + /// Gets or sets azure DNS Zone to use + /// + [JsonProperty(PropertyName = "properties.dnsZoneId")] public string DnsZoneId { get; set; } - /// Target DNS type (would be used for migration). + + /// + /// Gets or sets target DNS type (would be used for migration). + /// Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + /// + [JsonProperty(PropertyName = "properties.targetDnsType")] public DnsType? TargetDnsType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.authCode")] public string AuthCode { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (ContactAdmin == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactAdmin"); + } + if (ContactBilling == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactBilling"); + } + if (ContactRegistrant == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactRegistrant"); + } + if (ContactTech == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactTech"); + } + if (Consent == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Consent"); + } + if (ContactAdmin != null) + { + ContactAdmin.Validate(); + } + if (ContactBilling != null) + { + ContactBilling.Validate(); + } + if (ContactRegistrant != null) + { + ContactRegistrant.Validate(); + } + if (ContactTech != null) + { + ContactTech.Validate(); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.Serialization.cs deleted file mode 100644 index 17e49cb55be3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DomainAvailabilityCheckResult - { - internal static DomainAvailabilityCheckResult DeserializeDomainAvailabilityCheckResult(JsonElement element) - { - Optional name = default; - Optional available = default; - Optional domainType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("available")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - available = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("domainType")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - domainType = property.Value.GetString().ToDomainType(); - continue; - } - } - return new DomainAvailabilityCheckResult(name.Value, Optional.ToNullable(available), Optional.ToNullable(domainType)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.cs index a15387bee4ac..42eec84d942e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainAvailabilityCheckResult.cs @@ -1,36 +1,80 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Domain availability check result. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Domain availability check result. + /// public partial class DomainAvailabilityCheckResult { - /// Initializes a new instance of DomainAvailabilityCheckResult. - internal DomainAvailabilityCheckResult() + /// + /// Initializes a new instance of the DomainAvailabilityCheckResult + /// class. + /// + public DomainAvailabilityCheckResult() { + CustomInit(); } - /// Initializes a new instance of DomainAvailabilityCheckResult. - /// Name of the domain. - /// <code>true</code> if domain can be purchased using CreateDomain API; otherwise, <code>false</code>. - /// Valid values are Regular domain: Azure will charge the full price of domain registration, SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost anything. - internal DomainAvailabilityCheckResult(string name, bool? available, DomainType? domainType) + /// + /// Initializes a new instance of the DomainAvailabilityCheckResult + /// class. + /// + /// Name of the domain. + /// <code>true</code> if domain can + /// be purchased using CreateDomain API; otherwise, + /// <code>false</code>. + /// Valid values are Regular domain: Azure + /// will charge the full price of domain registration, SoftDeleted: + /// Purchasing this domain will simply restore it and this operation + /// will not cost anything. Possible values include: 'Regular', + /// 'SoftDeleted' + public DomainAvailabilityCheckResult(string name = default(string), bool? available = default(bool?), DomainType? domainType = default(DomainType?)) { Name = name; Available = available; DomainType = domainType; + CustomInit(); } - /// Name of the domain. - public string Name { get; } - /// <code>true</code> if domain can be purchased using CreateDomain API; otherwise, <code>false</code>. - public bool? Available { get; } - /// Valid values are Regular domain: Azure will charge the full price of domain registration, SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost anything. - public DomainType? DomainType { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the domain. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// domain can be purchased using CreateDomain API; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "available")] + public bool? Available { get; set; } + + /// + /// Gets or sets valid values are Regular domain: Azure will charge the + /// full price of domain registration, SoftDeleted: Purchasing this + /// domain will simply restore it and this operation will not cost + /// anything. Possible values include: 'Regular', 'SoftDeleted' + /// + [JsonProperty(PropertyName = "domainType")] + public DomainType? DomainType { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.Serialization.cs deleted file mode 100644 index 5bbde88d131f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class DomainCollection - { - internal static DomainCollection DeserializeDomainCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Domain.DeserializeDomain(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DomainCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.cs deleted file mode 100644 index 325868de778e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of domains. - internal partial class DomainCollection - { - /// Initializes a new instance of DomainCollection. - /// Collection of resources. - /// is null. - internal DomainCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of DomainCollection. - /// Collection of resources. - /// Link to next page of resources. - internal DomainCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.Serialization.cs deleted file mode 100644 index 0085350aa58f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DomainControlCenterSsoRequest - { - internal static DomainControlCenterSsoRequest DeserializeDomainControlCenterSsoRequest(JsonElement element) - { - Optional url = default; - Optional postParameterKey = default; - Optional postParameterValue = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("url")) - { - url = property.Value.GetString(); - continue; - } - if (property.NameEquals("postParameterKey")) - { - postParameterKey = property.Value.GetString(); - continue; - } - if (property.NameEquals("postParameterValue")) - { - postParameterValue = property.Value.GetString(); - continue; - } - } - return new DomainControlCenterSsoRequest(url.Value, postParameterKey.Value, postParameterValue.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.cs index d329fdefad1f..0b2693314b55 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainControlCenterSsoRequest.cs @@ -1,36 +1,73 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Single sign-on request information for domain management. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Single sign-on request information for domain management. + /// public partial class DomainControlCenterSsoRequest { - /// Initializes a new instance of DomainControlCenterSsoRequest. - internal DomainControlCenterSsoRequest() + /// + /// Initializes a new instance of the DomainControlCenterSsoRequest + /// class. + /// + public DomainControlCenterSsoRequest() { + CustomInit(); } - /// Initializes a new instance of DomainControlCenterSsoRequest. - /// URL where the single sign-on request is to be made. - /// Post parameter key. - /// Post parameter value. Client should use 'application/x-www-form-urlencoded' encoding for this value. - internal DomainControlCenterSsoRequest(string url, string postParameterKey, string postParameterValue) + /// + /// Initializes a new instance of the DomainControlCenterSsoRequest + /// class. + /// + /// URL where the single sign-on request is to be + /// made. + /// Post parameter key. + /// Post parameter value. Client + /// should use 'application/x-www-form-urlencoded' encoding for this + /// value. + public DomainControlCenterSsoRequest(string url = default(string), string postParameterKey = default(string), string postParameterValue = default(string)) { Url = url; PostParameterKey = postParameterKey; PostParameterValue = postParameterValue; + CustomInit(); } - /// URL where the single sign-on request is to be made. - public string Url { get; } - /// Post parameter key. - public string PostParameterKey { get; } - /// Post parameter value. Client should use 'application/x-www-form-urlencoded' encoding for this value. - public string PostParameterValue { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets URL where the single sign-on request is to be made. + /// + [JsonProperty(PropertyName = "url")] + public string Url { get; private set; } + + /// + /// Gets post parameter key. + /// + [JsonProperty(PropertyName = "postParameterKey")] + public string PostParameterKey { get; private set; } + + /// + /// Gets post parameter value. Client should use + /// 'application/x-www-form-urlencoded' encoding for this value. + /// + [JsonProperty(PropertyName = "postParameterValue")] + public string PostParameterValue { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.Serialization.cs deleted file mode 100644 index 5c6f0a61438e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DomainOwnershipIdentifier : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(OwnershipId)) - { - writer.WritePropertyName("ownershipId"); - writer.WriteStringValue(OwnershipId); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static DomainOwnershipIdentifier DeserializeDomainOwnershipIdentifier(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional ownershipId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("ownershipId")) - { - ownershipId = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new DomainOwnershipIdentifier(id.Value, name.Value, kind.Value, type.Value, ownershipId.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.cs index aa44f273fe11..76577cbd5406 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifier.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Domain ownership Identifier. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Domain ownership Identifier. + /// + [Rest.Serialization.JsonTransformation] public partial class DomainOwnershipIdentifier : ProxyOnlyResource { - /// Initializes a new instance of DomainOwnershipIdentifier. + /// + /// Initializes a new instance of the DomainOwnershipIdentifier class. + /// public DomainOwnershipIdentifier() { + CustomInit(); } - /// Initializes a new instance of DomainOwnershipIdentifier. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Ownership Id. - internal DomainOwnershipIdentifier(string id, string name, string kind, string type, string ownershipId) : base(id, name, kind, type) + /// + /// Initializes a new instance of the DomainOwnershipIdentifier class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Ownership Id. + public DomainOwnershipIdentifier(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string ownershipId = default(string)) + : base(id, name, kind, type) { OwnershipId = ownershipId; + CustomInit(); } - /// Ownership Id. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ownership Id. + /// + [JsonProperty(PropertyName = "properties.ownershipId")] public string OwnershipId { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.Serialization.cs deleted file mode 100644 index 2d375be71247..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class DomainOwnershipIdentifierCollection - { - internal static DomainOwnershipIdentifierCollection DeserializeDomainOwnershipIdentifierCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DomainOwnershipIdentifier.DeserializeDomainOwnershipIdentifier(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DomainOwnershipIdentifierCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.cs deleted file mode 100644 index 4aa25ba011e3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainOwnershipIdentifierCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of domain ownership identifiers. - internal partial class DomainOwnershipIdentifierCollection - { - /// Initializes a new instance of DomainOwnershipIdentifierCollection. - /// Collection of resources. - /// is null. - internal DomainOwnershipIdentifierCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of DomainOwnershipIdentifierCollection. - /// Collection of resources. - /// Link to next page of resources. - internal DomainOwnershipIdentifierCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.Serialization.cs deleted file mode 100644 index 35705a4bf92c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.Serialization.cs +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DomainPatchResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ContactAdmin)) - { - writer.WritePropertyName("contactAdmin"); - writer.WriteObjectValue(ContactAdmin); - } - if (Optional.IsDefined(ContactBilling)) - { - writer.WritePropertyName("contactBilling"); - writer.WriteObjectValue(ContactBilling); - } - if (Optional.IsDefined(ContactRegistrant)) - { - writer.WritePropertyName("contactRegistrant"); - writer.WriteObjectValue(ContactRegistrant); - } - if (Optional.IsDefined(ContactTech)) - { - writer.WritePropertyName("contactTech"); - writer.WriteObjectValue(ContactTech); - } - if (Optional.IsDefined(Privacy)) - { - writer.WritePropertyName("privacy"); - writer.WriteBooleanValue(Privacy.Value); - } - if (Optional.IsDefined(AutoRenew)) - { - writer.WritePropertyName("autoRenew"); - writer.WriteBooleanValue(AutoRenew.Value); - } - if (Optional.IsDefined(Consent)) - { - writer.WritePropertyName("consent"); - writer.WriteObjectValue(Consent); - } - if (Optional.IsDefined(DnsType)) - { - writer.WritePropertyName("dnsType"); - writer.WriteStringValue(DnsType.Value.ToSerialString()); - } - if (Optional.IsDefined(DnsZoneId)) - { - writer.WritePropertyName("dnsZoneId"); - writer.WriteStringValue(DnsZoneId); - } - if (Optional.IsDefined(TargetDnsType)) - { - writer.WritePropertyName("targetDnsType"); - writer.WriteStringValue(TargetDnsType.Value.ToSerialString()); - } - if (Optional.IsDefined(AuthCode)) - { - writer.WritePropertyName("authCode"); - writer.WriteStringValue(AuthCode); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static DomainPatchResource DeserializeDomainPatchResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional contactAdmin = default; - Optional contactBilling = default; - Optional contactRegistrant = default; - Optional contactTech = default; - Optional registrationStatus = default; - Optional provisioningState = default; - Optional> nameServers = default; - Optional privacy = default; - Optional createdTime = default; - Optional expirationTime = default; - Optional lastRenewedTime = default; - Optional autoRenew = default; - Optional readyForDnsRecordManagement = default; - Optional> managedHostNames = default; - Optional consent = default; - Optional> domainNotRenewableReasons = default; - Optional dnsType = default; - Optional dnsZoneId = default; - Optional targetDnsType = default; - Optional authCode = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("contactAdmin")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - contactAdmin = Contact.DeserializeContact(property0.Value); - continue; - } - if (property0.NameEquals("contactBilling")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - contactBilling = Contact.DeserializeContact(property0.Value); - continue; - } - if (property0.NameEquals("contactRegistrant")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - contactRegistrant = Contact.DeserializeContact(property0.Value); - continue; - } - if (property0.NameEquals("contactTech")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - contactTech = Contact.DeserializeContact(property0.Value); - continue; - } - if (property0.NameEquals("registrationStatus")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - registrationStatus = property0.Value.GetString().ToDomainStatus(); - continue; - } - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property0.Value.GetString().ToProvisioningState(); - continue; - } - if (property0.NameEquals("nameServers")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - nameServers = array; - continue; - } - if (property0.NameEquals("privacy")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - privacy = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("createdTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - createdTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("expirationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - expirationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("lastRenewedTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - lastRenewedTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("autoRenew")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - autoRenew = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("readyForDnsRecordManagement")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - readyForDnsRecordManagement = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("managedHostNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(HostName.DeserializeHostName(item)); - } - managedHostNames = array; - continue; - } - if (property0.NameEquals("consent")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - consent = DomainPurchaseConsent.DeserializeDomainPurchaseConsent(property0.Value); - continue; - } - if (property0.NameEquals("domainNotRenewableReasons")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(new DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(item.GetString())); - } - domainNotRenewableReasons = array; - continue; - } - if (property0.NameEquals("dnsType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - dnsType = property0.Value.GetString().ToDnsType(); - continue; - } - if (property0.NameEquals("dnsZoneId")) - { - dnsZoneId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("targetDnsType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - targetDnsType = property0.Value.GetString().ToDnsType(); - continue; - } - if (property0.NameEquals("authCode")) - { - authCode = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new DomainPatchResource(id.Value, name.Value, kind.Value, type.Value, contactAdmin.Value, contactBilling.Value, contactRegistrant.Value, contactTech.Value, Optional.ToNullable(registrationStatus), Optional.ToNullable(provisioningState), Optional.ToList(nameServers), Optional.ToNullable(privacy), Optional.ToNullable(createdTime), Optional.ToNullable(expirationTime), Optional.ToNullable(lastRenewedTime), Optional.ToNullable(autoRenew), Optional.ToNullable(readyForDnsRecordManagement), Optional.ToList(managedHostNames), consent.Value, Optional.ToList(domainNotRenewableReasons), Optional.ToNullable(dnsType), dnsZoneId.Value, Optional.ToNullable(targetDnsType), authCode.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.cs index 0e1acddafd92..c91ad00fac20 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResource.cs @@ -1,56 +1,88 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// ARM resource for a domain. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// ARM resource for a domain. + /// + [Rest.Serialization.JsonTransformation] public partial class DomainPatchResource : ProxyOnlyResource { - /// Initializes a new instance of DomainPatchResource. + /// + /// Initializes a new instance of the DomainPatchResource class. + /// public DomainPatchResource() { - NameServers = new ChangeTrackingList(); - ManagedHostNames = new ChangeTrackingList(); - DomainNotRenewableReasons = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of DomainPatchResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Administrative contact. - /// Billing contact. - /// Registrant contact. - /// Technical contact. - /// Domain registration status. - /// Domain provisioning state. - /// Name servers. - /// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>. - /// Domain creation timestamp. - /// Domain expiration timestamp. - /// Timestamp when the domain was renewed last time. - /// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>. - /// - /// <code>true</code> if Azure can assign this domain to App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain registration status is active and - /// it is hosted on name servers Azure has programmatic access to. - /// - /// All hostnames derived from the domain and assigned to Azure resources. - /// Legal agreement consent. - /// Reasons why domain is not renewable. - /// Current DNS type. - /// Azure DNS Zone to use. - /// Target DNS type (would be used for migration). - /// . - internal DomainPatchResource(string id, string name, string kind, string type, Contact contactAdmin, Contact contactBilling, Contact contactRegistrant, Contact contactTech, DomainStatus? registrationStatus, ProvisioningState? provisioningState, IReadOnlyList nameServers, bool? privacy, DateTimeOffset? createdTime, DateTimeOffset? expirationTime, DateTimeOffset? lastRenewedTime, bool? autoRenew, bool? readyForDnsRecordManagement, IReadOnlyList managedHostNames, DomainPurchaseConsent consent, IReadOnlyList domainNotRenewableReasons, DnsType? dnsType, string dnsZoneId, DnsType? targetDnsType, string authCode) : base(id, name, kind, type) + /// + /// Initializes a new instance of the DomainPatchResource class. + /// + /// Administrative contact. + /// Billing contact. + /// Registrant contact. + /// Technical contact. + /// Legal agreement consent. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Domain registration status. + /// Possible values include: 'Active', 'Awaiting', 'Cancelled', + /// 'Confiscated', 'Disabled', 'Excluded', 'Expired', 'Failed', 'Held', + /// 'Locked', 'Parked', 'Pending', 'Reserved', 'Reverted', 'Suspended', + /// 'Transferred', 'Unknown', 'Unlocked', 'Unparked', 'Updated', + /// 'JsonConverterFailed' + /// Domain provisioning state. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// 'Deleting' + /// Name servers. + /// <code>true</code> if domain + /// privacy is enabled for this domain; otherwise, + /// <code>false</code>. + /// Domain creation timestamp. + /// Domain expiration timestamp. + /// Timestamp when the domain was renewed + /// last time. + /// <code>true</code> if the domain + /// should be automatically renewed; otherwise, + /// <code>false</code>. + /// <code>true</code> if + /// Azure can assign this domain to App Service apps; otherwise, + /// <code>false</code>. This value will be + /// <code>true</code> if domain registration status is + /// active and + /// it is hosted on name servers Azure has programmatic access + /// to. + /// All hostnames derived from the + /// domain and assigned to Azure resources. + /// Reasons why domain is not + /// renewable. + /// Current DNS type. Possible values include: + /// 'AzureDns', 'DefaultDomainRegistrarDns' + /// Azure DNS Zone to use + /// Target DNS type (would be used for + /// migration). Possible values include: 'AzureDns', + /// 'DefaultDomainRegistrarDns' + public DomainPatchResource(Contact contactAdmin, Contact contactBilling, Contact contactRegistrant, Contact contactTech, DomainPurchaseConsent consent, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), DomainStatus? registrationStatus = default(DomainStatus?), ProvisioningState? provisioningState = default(ProvisioningState?), IList nameServers = default(IList), bool? privacy = default(bool?), System.DateTime? createdTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), System.DateTime? lastRenewedTime = default(System.DateTime?), bool? autoRenew = default(bool?), bool? readyForDnsRecordManagement = default(bool?), IList managedHostNames = default(IList), IList domainNotRenewableReasons = default(IList), DnsType? dnsType = default(DnsType?), string dnsZoneId = default(string), DnsType? targetDnsType = default(DnsType?), string authCode = default(string)) + : base(id, name, kind, type) { ContactAdmin = contactAdmin; ContactBilling = contactBilling; @@ -72,49 +104,194 @@ internal DomainPatchResource(string id, string name, string kind, string type, C DnsZoneId = dnsZoneId; TargetDnsType = targetDnsType; AuthCode = authCode; + CustomInit(); } - /// Administrative contact. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets administrative contact. + /// + [JsonProperty(PropertyName = "properties.contactAdmin")] public Contact ContactAdmin { get; set; } - /// Billing contact. + + /// + /// Gets or sets billing contact. + /// + [JsonProperty(PropertyName = "properties.contactBilling")] public Contact ContactBilling { get; set; } - /// Registrant contact. + + /// + /// Gets or sets registrant contact. + /// + [JsonProperty(PropertyName = "properties.contactRegistrant")] public Contact ContactRegistrant { get; set; } - /// Technical contact. + + /// + /// Gets or sets technical contact. + /// + [JsonProperty(PropertyName = "properties.contactTech")] public Contact ContactTech { get; set; } - /// Domain registration status. - public DomainStatus? RegistrationStatus { get; } - /// Domain provisioning state. - public ProvisioningState? ProvisioningState { get; } - /// Name servers. - public IReadOnlyList NameServers { get; } - /// <code>true</code> if domain privacy is enabled for this domain; otherwise, <code>false</code>. + + /// + /// Gets domain registration status. Possible values include: 'Active', + /// 'Awaiting', 'Cancelled', 'Confiscated', 'Disabled', 'Excluded', + /// 'Expired', 'Failed', 'Held', 'Locked', 'Parked', 'Pending', + /// 'Reserved', 'Reverted', 'Suspended', 'Transferred', 'Unknown', + /// 'Unlocked', 'Unparked', 'Updated', 'JsonConverterFailed' + /// + [JsonProperty(PropertyName = "properties.registrationStatus")] + public DomainStatus? RegistrationStatus { get; private set; } + + /// + /// Gets domain provisioning state. Possible values include: + /// 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState? ProvisioningState { get; private set; } + + /// + /// Gets name servers. + /// + [JsonProperty(PropertyName = "properties.nameServers")] + public IList NameServers { get; private set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// domain privacy is enabled for this domain; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.privacy")] public bool? Privacy { get; set; } - /// Domain creation timestamp. - public DateTimeOffset? CreatedTime { get; } - /// Domain expiration timestamp. - public DateTimeOffset? ExpirationTime { get; } - /// Timestamp when the domain was renewed last time. - public DateTimeOffset? LastRenewedTime { get; } - /// <code>true</code> if the domain should be automatically renewed; otherwise, <code>false</code>. + + /// + /// Gets domain creation timestamp. + /// + [JsonProperty(PropertyName = "properties.createdTime")] + public System.DateTime? CreatedTime { get; private set; } + + /// + /// Gets domain expiration timestamp. + /// + [JsonProperty(PropertyName = "properties.expirationTime")] + public System.DateTime? ExpirationTime { get; private set; } + + /// + /// Gets timestamp when the domain was renewed last time. + /// + [JsonProperty(PropertyName = "properties.lastRenewedTime")] + public System.DateTime? LastRenewedTime { get; private set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// domain should be automatically renewed; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.autoRenew")] public bool? AutoRenew { get; set; } + /// - /// <code>true</code> if Azure can assign this domain to App Service apps; otherwise, <code>false</code>. This value will be <code>true</code> if domain registration status is active and - /// it is hosted on name servers Azure has programmatic access to. + /// Gets &lt;code&gt;true&lt;/code&gt; if Azure can + /// assign this domain to App Service apps; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. This value will be + /// &lt;code&gt;true&lt;/code&gt; if domain + /// registration status is active and + /// it is hosted on name servers Azure has programmatic access to. /// - public bool? ReadyForDnsRecordManagement { get; } - /// All hostnames derived from the domain and assigned to Azure resources. - public IReadOnlyList ManagedHostNames { get; } - /// Legal agreement consent. + [JsonProperty(PropertyName = "properties.readyForDnsRecordManagement")] + public bool? ReadyForDnsRecordManagement { get; private set; } + + /// + /// Gets all hostnames derived from the domain and assigned to Azure + /// resources. + /// + [JsonProperty(PropertyName = "properties.managedHostNames")] + public IList ManagedHostNames { get; private set; } + + /// + /// Gets or sets legal agreement consent. + /// + [JsonProperty(PropertyName = "properties.consent")] public DomainPurchaseConsent Consent { get; set; } - /// Reasons why domain is not renewable. - public IReadOnlyList DomainNotRenewableReasons { get; } - /// Current DNS type. + + /// + /// Gets reasons why domain is not renewable. + /// + [JsonProperty(PropertyName = "properties.domainNotRenewableReasons")] + public IList DomainNotRenewableReasons { get; private set; } + + /// + /// Gets or sets current DNS type. Possible values include: 'AzureDns', + /// 'DefaultDomainRegistrarDns' + /// + [JsonProperty(PropertyName = "properties.dnsType")] public DnsType? DnsType { get; set; } - /// Azure DNS Zone to use. + + /// + /// Gets or sets azure DNS Zone to use + /// + [JsonProperty(PropertyName = "properties.dnsZoneId")] public string DnsZoneId { get; set; } - /// Target DNS type (would be used for migration). + + /// + /// Gets or sets target DNS type (would be used for migration). + /// Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + /// + [JsonProperty(PropertyName = "properties.targetDnsType")] public DnsType? TargetDnsType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.authCode")] public string AuthCode { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ContactAdmin == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactAdmin"); + } + if (ContactBilling == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactBilling"); + } + if (ContactRegistrant == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactRegistrant"); + } + if (ContactTech == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactTech"); + } + if (Consent == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Consent"); + } + if (ContactAdmin != null) + { + ContactAdmin.Validate(); + } + if (ContactBilling != null) + { + ContactBilling.Validate(); + } + if (ContactRegistrant != null) + { + ContactRegistrant.Validate(); + } + if (ContactTech != null) + { + ContactTech.Validate(); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.cs deleted file mode 100644 index 02264a158168..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPatchResourcePropertiesDomainNotRenewableReasonsItem.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The DomainPatchResourcePropertiesDomainNotRenewableReasonsItem. - public readonly partial struct DomainPatchResourcePropertiesDomainNotRenewableReasonsItem : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RegistrationStatusNotSupportedForRenewalValue = "RegistrationStatusNotSupportedForRenewal"; - private const string ExpirationNotInRenewalTimeRangeValue = "ExpirationNotInRenewalTimeRange"; - private const string SubscriptionNotActiveValue = "SubscriptionNotActive"; - - /// RegistrationStatusNotSupportedForRenewal. - public static DomainPatchResourcePropertiesDomainNotRenewableReasonsItem RegistrationStatusNotSupportedForRenewal { get; } = new DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(RegistrationStatusNotSupportedForRenewalValue); - /// ExpirationNotInRenewalTimeRange. - public static DomainPatchResourcePropertiesDomainNotRenewableReasonsItem ExpirationNotInRenewalTimeRange { get; } = new DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(ExpirationNotInRenewalTimeRangeValue); - /// SubscriptionNotActive. - public static DomainPatchResourcePropertiesDomainNotRenewableReasonsItem SubscriptionNotActive { get; } = new DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(SubscriptionNotActiveValue); - /// Determines if two values are the same. - public static bool operator ==(DomainPatchResourcePropertiesDomainNotRenewableReasonsItem left, DomainPatchResourcePropertiesDomainNotRenewableReasonsItem right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DomainPatchResourcePropertiesDomainNotRenewableReasonsItem left, DomainPatchResourcePropertiesDomainNotRenewableReasonsItem right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(string value) => new DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DomainPatchResourcePropertiesDomainNotRenewableReasonsItem other && Equals(other); - /// - public bool Equals(DomainPatchResourcePropertiesDomainNotRenewableReasonsItem other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPropertiesDomainNotRenewableReasonsItem.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPropertiesDomainNotRenewableReasonsItem.cs deleted file mode 100644 index 3ab804b7c942..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPropertiesDomainNotRenewableReasonsItem.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The DomainPropertiesDomainNotRenewableReasonsItem. - public readonly partial struct DomainPropertiesDomainNotRenewableReasonsItem : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public DomainPropertiesDomainNotRenewableReasonsItem(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RegistrationStatusNotSupportedForRenewalValue = "RegistrationStatusNotSupportedForRenewal"; - private const string ExpirationNotInRenewalTimeRangeValue = "ExpirationNotInRenewalTimeRange"; - private const string SubscriptionNotActiveValue = "SubscriptionNotActive"; - - /// RegistrationStatusNotSupportedForRenewal. - public static DomainPropertiesDomainNotRenewableReasonsItem RegistrationStatusNotSupportedForRenewal { get; } = new DomainPropertiesDomainNotRenewableReasonsItem(RegistrationStatusNotSupportedForRenewalValue); - /// ExpirationNotInRenewalTimeRange. - public static DomainPropertiesDomainNotRenewableReasonsItem ExpirationNotInRenewalTimeRange { get; } = new DomainPropertiesDomainNotRenewableReasonsItem(ExpirationNotInRenewalTimeRangeValue); - /// SubscriptionNotActive. - public static DomainPropertiesDomainNotRenewableReasonsItem SubscriptionNotActive { get; } = new DomainPropertiesDomainNotRenewableReasonsItem(SubscriptionNotActiveValue); - /// Determines if two values are the same. - public static bool operator ==(DomainPropertiesDomainNotRenewableReasonsItem left, DomainPropertiesDomainNotRenewableReasonsItem right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DomainPropertiesDomainNotRenewableReasonsItem left, DomainPropertiesDomainNotRenewableReasonsItem right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DomainPropertiesDomainNotRenewableReasonsItem(string value) => new DomainPropertiesDomainNotRenewableReasonsItem(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DomainPropertiesDomainNotRenewableReasonsItem other && Equals(other); - /// - public bool Equals(DomainPropertiesDomainNotRenewableReasonsItem other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.Serialization.cs deleted file mode 100644 index 172fe85d5060..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DomainPurchaseConsent : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(AgreementKeys)) - { - writer.WritePropertyName("agreementKeys"); - writer.WriteStartArray(); - foreach (var item in AgreementKeys) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(AgreedBy)) - { - writer.WritePropertyName("agreedBy"); - writer.WriteStringValue(AgreedBy); - } - if (Optional.IsDefined(AgreedAt)) - { - writer.WritePropertyName("agreedAt"); - writer.WriteStringValue(AgreedAt.Value, "O"); - } - writer.WriteEndObject(); - } - - internal static DomainPurchaseConsent DeserializeDomainPurchaseConsent(JsonElement element) - { - Optional> agreementKeys = default; - Optional agreedBy = default; - Optional agreedAt = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("agreementKeys")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - agreementKeys = array; - continue; - } - if (property.NameEquals("agreedBy")) - { - agreedBy = property.Value.GetString(); - continue; - } - if (property.NameEquals("agreedAt")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - agreedAt = property.Value.GetDateTimeOffset("O"); - continue; - } - } - return new DomainPurchaseConsent(Optional.ToList(agreementKeys), agreedBy.Value, Optional.ToNullable(agreedAt)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.cs index 9ac8fc58cfe7..3142541d154d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainPurchaseConsent.cs @@ -1,41 +1,75 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Domain purchase consent object, representing acceptance of applicable legal agreements. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Domain purchase consent object, representing acceptance of applicable + /// legal agreements. + /// public partial class DomainPurchaseConsent { - /// Initializes a new instance of DomainPurchaseConsent. + /// + /// Initializes a new instance of the DomainPurchaseConsent class. + /// public DomainPurchaseConsent() { - AgreementKeys = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of DomainPurchaseConsent. - /// List of applicable legal agreement keys. This list can be retrieved using ListLegalAgreements API under <code>TopLevelDomain</code> resource. - /// Client IP address. - /// Timestamp when the agreements were accepted. - internal DomainPurchaseConsent(IList agreementKeys, string agreedBy, DateTimeOffset? agreedAt) + /// + /// Initializes a new instance of the DomainPurchaseConsent class. + /// + /// List of applicable legal agreement + /// keys. This list can be retrieved using ListLegalAgreements API + /// under <code>TopLevelDomain</code> resource. + /// Client IP address. + /// Timestamp when the agreements were + /// accepted. + public DomainPurchaseConsent(IList agreementKeys = default(IList), string agreedBy = default(string), System.DateTime? agreedAt = default(System.DateTime?)) { AgreementKeys = agreementKeys; AgreedBy = agreedBy; AgreedAt = agreedAt; + CustomInit(); } - /// List of applicable legal agreement keys. This list can be retrieved using ListLegalAgreements API under <code>TopLevelDomain</code> resource. - public IList AgreementKeys { get; } - /// Client IP address. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of applicable legal agreement keys. This list can + /// be retrieved using ListLegalAgreements API under + /// &lt;code&gt;TopLevelDomain&lt;/code&gt; resource. + /// + [JsonProperty(PropertyName = "agreementKeys")] + public IList AgreementKeys { get; set; } + + /// + /// Gets or sets client IP address. + /// + [JsonProperty(PropertyName = "agreedBy")] public string AgreedBy { get; set; } - /// Timestamp when the agreements were accepted. - public DateTimeOffset? AgreedAt { get; set; } + + /// + /// Gets or sets timestamp when the agreements were accepted. + /// + [JsonProperty(PropertyName = "agreedAt")] + public System.DateTime? AgreedAt { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.Serialization.cs deleted file mode 100644 index 443b7a2ebb8c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.Serialization.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class DomainRecommendationSearchParameters : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Keywords)) - { - writer.WritePropertyName("keywords"); - writer.WriteStringValue(Keywords); - } - if (Optional.IsDefined(MaxDomainRecommendations)) - { - writer.WritePropertyName("maxDomainRecommendations"); - writer.WriteNumberValue(MaxDomainRecommendations.Value); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.cs index 8ca2bf8028dd..c425a7cfabb5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainRecommendationSearchParameters.cs @@ -1,23 +1,64 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Domain recommendation search parameters. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Domain recommendation search parameters. + /// public partial class DomainRecommendationSearchParameters { - /// Initializes a new instance of DomainRecommendationSearchParameters. + /// + /// Initializes a new instance of the + /// DomainRecommendationSearchParameters class. + /// public DomainRecommendationSearchParameters() { + CustomInit(); } - /// Keywords to be used for generating domain recommendations. + /// + /// Initializes a new instance of the + /// DomainRecommendationSearchParameters class. + /// + /// Keywords to be used for generating domain + /// recommendations. + /// Maximum number of + /// recommendations. + public DomainRecommendationSearchParameters(string keywords = default(string), int? maxDomainRecommendations = default(int?)) + { + Keywords = keywords; + MaxDomainRecommendations = maxDomainRecommendations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets keywords to be used for generating domain + /// recommendations. + /// + [JsonProperty(PropertyName = "keywords")] public string Keywords { get; set; } - /// Maximum number of recommendations. + + /// + /// Gets or sets maximum number of recommendations. + /// + [JsonProperty(PropertyName = "maxDomainRecommendations")] public int? MaxDomainRecommendations { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.Serialization.cs deleted file mode 100644 index 3901684eabb9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.Serialization.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class DomainStatusExtensions - { - public static string ToSerialString(this DomainStatus value) => value switch - { - DomainStatus.Active => "Active", - DomainStatus.Awaiting => "Awaiting", - DomainStatus.Cancelled => "Cancelled", - DomainStatus.Confiscated => "Confiscated", - DomainStatus.Disabled => "Disabled", - DomainStatus.Excluded => "Excluded", - DomainStatus.Expired => "Expired", - DomainStatus.Failed => "Failed", - DomainStatus.Held => "Held", - DomainStatus.Locked => "Locked", - DomainStatus.Parked => "Parked", - DomainStatus.Pending => "Pending", - DomainStatus.Reserved => "Reserved", - DomainStatus.Reverted => "Reverted", - DomainStatus.Suspended => "Suspended", - DomainStatus.Transferred => "Transferred", - DomainStatus.Unknown => "Unknown", - DomainStatus.Unlocked => "Unlocked", - DomainStatus.Unparked => "Unparked", - DomainStatus.Updated => "Updated", - DomainStatus.JsonConverterFailed => "JsonConverterFailed", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DomainStatus value.") - }; - - public static DomainStatus ToDomainStatus(this string value) - { - if (string.Equals(value, "Active", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Active; - if (string.Equals(value, "Awaiting", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Awaiting; - if (string.Equals(value, "Cancelled", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Cancelled; - if (string.Equals(value, "Confiscated", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Confiscated; - if (string.Equals(value, "Disabled", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Disabled; - if (string.Equals(value, "Excluded", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Excluded; - if (string.Equals(value, "Expired", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Expired; - if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Failed; - if (string.Equals(value, "Held", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Held; - if (string.Equals(value, "Locked", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Locked; - if (string.Equals(value, "Parked", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Parked; - if (string.Equals(value, "Pending", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Pending; - if (string.Equals(value, "Reserved", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Reserved; - if (string.Equals(value, "Reverted", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Reverted; - if (string.Equals(value, "Suspended", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Suspended; - if (string.Equals(value, "Transferred", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Transferred; - if (string.Equals(value, "Unknown", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Unknown; - if (string.Equals(value, "Unlocked", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Unlocked; - if (string.Equals(value, "Unparked", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Unparked; - if (string.Equals(value, "Updated", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.Updated; - if (string.Equals(value, "JsonConverterFailed", StringComparison.InvariantCultureIgnoreCase)) return DomainStatus.JsonConverterFailed; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DomainStatus value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.cs index efe0fb81a74a..d9b9caa8e3cd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainStatus.cs @@ -1,56 +1,174 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Domain registration status. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DomainStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum DomainStatus { - /// Active. + [EnumMember(Value = "Active")] Active, - /// Awaiting. + [EnumMember(Value = "Awaiting")] Awaiting, - /// Cancelled. + [EnumMember(Value = "Cancelled")] Cancelled, - /// Confiscated. + [EnumMember(Value = "Confiscated")] Confiscated, - /// Disabled. + [EnumMember(Value = "Disabled")] Disabled, - /// Excluded. + [EnumMember(Value = "Excluded")] Excluded, - /// Expired. + [EnumMember(Value = "Expired")] Expired, - /// Failed. + [EnumMember(Value = "Failed")] Failed, - /// Held. + [EnumMember(Value = "Held")] Held, - /// Locked. + [EnumMember(Value = "Locked")] Locked, - /// Parked. + [EnumMember(Value = "Parked")] Parked, - /// Pending. + [EnumMember(Value = "Pending")] Pending, - /// Reserved. + [EnumMember(Value = "Reserved")] Reserved, - /// Reverted. + [EnumMember(Value = "Reverted")] Reverted, - /// Suspended. + [EnumMember(Value = "Suspended")] Suspended, - /// Transferred. + [EnumMember(Value = "Transferred")] Transferred, - /// Unknown. + [EnumMember(Value = "Unknown")] Unknown, - /// Unlocked. + [EnumMember(Value = "Unlocked")] Unlocked, - /// Unparked. + [EnumMember(Value = "Unparked")] Unparked, - /// Updated. + [EnumMember(Value = "Updated")] Updated, - /// JsonConverterFailed. + [EnumMember(Value = "JsonConverterFailed")] JsonConverterFailed } + internal static class DomainStatusEnumExtension + { + internal static string ToSerializedValue(this DomainStatus? value) + { + return value == null ? null : ((DomainStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DomainStatus value) + { + switch( value ) + { + case DomainStatus.Active: + return "Active"; + case DomainStatus.Awaiting: + return "Awaiting"; + case DomainStatus.Cancelled: + return "Cancelled"; + case DomainStatus.Confiscated: + return "Confiscated"; + case DomainStatus.Disabled: + return "Disabled"; + case DomainStatus.Excluded: + return "Excluded"; + case DomainStatus.Expired: + return "Expired"; + case DomainStatus.Failed: + return "Failed"; + case DomainStatus.Held: + return "Held"; + case DomainStatus.Locked: + return "Locked"; + case DomainStatus.Parked: + return "Parked"; + case DomainStatus.Pending: + return "Pending"; + case DomainStatus.Reserved: + return "Reserved"; + case DomainStatus.Reverted: + return "Reverted"; + case DomainStatus.Suspended: + return "Suspended"; + case DomainStatus.Transferred: + return "Transferred"; + case DomainStatus.Unknown: + return "Unknown"; + case DomainStatus.Unlocked: + return "Unlocked"; + case DomainStatus.Unparked: + return "Unparked"; + case DomainStatus.Updated: + return "Updated"; + case DomainStatus.JsonConverterFailed: + return "JsonConverterFailed"; + } + return null; + } + + internal static DomainStatus? ParseDomainStatus(this string value) + { + switch( value ) + { + case "Active": + return DomainStatus.Active; + case "Awaiting": + return DomainStatus.Awaiting; + case "Cancelled": + return DomainStatus.Cancelled; + case "Confiscated": + return DomainStatus.Confiscated; + case "Disabled": + return DomainStatus.Disabled; + case "Excluded": + return DomainStatus.Excluded; + case "Expired": + return DomainStatus.Expired; + case "Failed": + return DomainStatus.Failed; + case "Held": + return DomainStatus.Held; + case "Locked": + return DomainStatus.Locked; + case "Parked": + return DomainStatus.Parked; + case "Pending": + return DomainStatus.Pending; + case "Reserved": + return DomainStatus.Reserved; + case "Reverted": + return DomainStatus.Reverted; + case "Suspended": + return DomainStatus.Suspended; + case "Transferred": + return DomainStatus.Transferred; + case "Unknown": + return DomainStatus.Unknown; + case "Unlocked": + return DomainStatus.Unlocked; + case "Unparked": + return DomainStatus.Unparked; + case "Updated": + return DomainStatus.Updated; + case "JsonConverterFailed": + return DomainStatus.JsonConverterFailed; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.Serialization.cs deleted file mode 100644 index c0de1c41365d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class DomainTypeExtensions - { - public static string ToSerialString(this DomainType value) => value switch - { - DomainType.Regular => "Regular", - DomainType.SoftDeleted => "SoftDeleted", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DomainType value.") - }; - - public static DomainType ToDomainType(this string value) - { - if (string.Equals(value, "Regular", StringComparison.InvariantCultureIgnoreCase)) return DomainType.Regular; - if (string.Equals(value, "SoftDeleted", StringComparison.InvariantCultureIgnoreCase)) return DomainType.SoftDeleted; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DomainType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.cs index 2e0d28556298..a3892f6545e3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DomainType.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Valid values are Regular domain: Azure will charge the full price of domain registration, SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost anything. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DomainType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum DomainType { - /// Regular. + [EnumMember(Value = "Regular")] Regular, - /// SoftDeleted. + [EnumMember(Value = "SoftDeleted")] SoftDeleted } + internal static class DomainTypeEnumExtension + { + internal static string ToSerializedValue(this DomainType? value) + { + return value == null ? null : ((DomainType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DomainType value) + { + switch( value ) + { + case DomainType.Regular: + return "Regular"; + case DomainType.SoftDeleted: + return "SoftDeleted"; + } + return null; + } + + internal static DomainType? ParseDomainType(this string value) + { + switch( value ) + { + case "Regular": + return DomainType.Regular; + case "SoftDeleted": + return DomainType.SoftDeleted; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.Serialization.cs deleted file mode 100644 index d983aa000134..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class EnabledConfig : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - writer.WriteEndObject(); - } - - internal static EnabledConfig DeserializeEnabledConfig(JsonElement element) - { - Optional enabled = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - } - return new EnabledConfig(Optional.ToNullable(enabled)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.cs index 77307144d024..787276cb500e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EnabledConfig.cs @@ -1,28 +1,53 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Enabled configuration. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Enabled configuration. + /// public partial class EnabledConfig { - /// Initializes a new instance of EnabledConfig. + /// + /// Initializes a new instance of the EnabledConfig class. + /// public EnabledConfig() { + CustomInit(); } - /// Initializes a new instance of EnabledConfig. - /// True if configuration is enabled, false if it is disabled and null if configuration is not set. - internal EnabledConfig(bool? enabled) + /// + /// Initializes a new instance of the EnabledConfig class. + /// + /// True if configuration is enabled, false if it + /// is disabled and null if configuration is not set. + public EnabledConfig(bool? enabled = default(bool?)) { Enabled = enabled; + CustomInit(); } - /// True if configuration is enabled, false if it is disabled and null if configuration is not set. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets true if configuration is enabled, false if it is + /// disabled and null if configuration is not set. + /// + [JsonProperty(PropertyName = "enabled")] public bool? Enabled { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.Serialization.cs deleted file mode 100644 index 1e49db8d3fe6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class EndpointDependency - { - internal static EndpointDependency DeserializeEndpointDependency(JsonElement element) - { - Optional domainName = default; - Optional> endpointDetails = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("domainName")) - { - domainName = property.Value.GetString(); - continue; - } - if (property.NameEquals("endpointDetails")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(EndpointDetail.DeserializeEndpointDetail(item)); - } - endpointDetails = array; - continue; - } - } - return new EndpointDependency(domainName.Value, Optional.ToList(endpointDetails)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.cs index 9dd441818f66..a5cdde253b60 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDependency.cs @@ -1,36 +1,64 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// A domain name that a service is reached at, including details of the current connection status. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A domain name that a service is reached at, including details of the + /// current connection status. + /// public partial class EndpointDependency { - /// Initializes a new instance of EndpointDependency. - internal EndpointDependency() + /// + /// Initializes a new instance of the EndpointDependency class. + /// + public EndpointDependency() { - EndpointDetails = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of EndpointDependency. - /// The domain name of the dependency. - /// The IP Addresses and Ports used when connecting to DomainName. - internal EndpointDependency(string domainName, IReadOnlyList endpointDetails) + /// + /// Initializes a new instance of the EndpointDependency class. + /// + /// The domain name of the dependency. + /// The IP Addresses and Ports used when + /// connecting to DomainName. + public EndpointDependency(string domainName = default(string), IList endpointDetails = default(IList)) { DomainName = domainName; EndpointDetails = endpointDetails; + CustomInit(); } - /// The domain name of the dependency. - public string DomainName { get; } - /// The IP Addresses and Ports used when connecting to DomainName. - public IReadOnlyList EndpointDetails { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the domain name of the dependency. + /// + [JsonProperty(PropertyName = "domainName")] + public string DomainName { get; set; } + + /// + /// Gets or sets the IP Addresses and Ports used when connecting to + /// DomainName. + /// + [JsonProperty(PropertyName = "endpointDetails")] + public IList EndpointDetails { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.Serialization.cs deleted file mode 100644 index 706325e80dfa..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.Serialization.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class EndpointDetail - { - internal static EndpointDetail DeserializeEndpointDetail(JsonElement element) - { - Optional ipAddress = default; - Optional port = default; - Optional latency = default; - Optional isAccessible = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("ipAddress")) - { - ipAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("port")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - port = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("latency")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - latency = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("isAccessible")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isAccessible = property.Value.GetBoolean(); - continue; - } - } - return new EndpointDetail(ipAddress.Value, Optional.ToNullable(port), Optional.ToNullable(latency), Optional.ToNullable(isAccessible)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.cs index cce246a9ce5c..427ffe880862 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/EndpointDetail.cs @@ -1,40 +1,84 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Current TCP connectivity information from the App Service Environment to a single endpoint. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Current TCP connectivity information from the App Service Environment + /// to a single endpoint. + /// public partial class EndpointDetail { - /// Initializes a new instance of EndpointDetail. - internal EndpointDetail() + /// + /// Initializes a new instance of the EndpointDetail class. + /// + public EndpointDetail() { + CustomInit(); } - /// Initializes a new instance of EndpointDetail. - /// An IP Address that Domain Name currently resolves to. - /// The port an endpoint is connected to. - /// The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. - /// Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. - internal EndpointDetail(string ipAddress, int? port, double? latency, bool? isAccessible) + /// + /// Initializes a new instance of the EndpointDetail class. + /// + /// An IP Address that Domain Name currently + /// resolves to. + /// The port an endpoint is connected to. + /// The time in milliseconds it takes for a TCP + /// connection to be created from the App Service Environment to this + /// IpAddress at this Port. + /// Whether it is possible to create a TCP + /// connection from the App Service Environment to this IpAddress at + /// this Port. + public EndpointDetail(string ipAddress = default(string), int? port = default(int?), double? latency = default(double?), bool? isAccessible = default(bool?)) { IpAddress = ipAddress; Port = port; Latency = latency; IsAccessible = isAccessible; + CustomInit(); } - /// An IP Address that Domain Name currently resolves to. - public string IpAddress { get; } - /// The port an endpoint is connected to. - public int? Port { get; } - /// The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. - public double? Latency { get; } - /// Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. - public bool? IsAccessible { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets an IP Address that Domain Name currently resolves to. + /// + [JsonProperty(PropertyName = "ipAddress")] + public string IpAddress { get; set; } + + /// + /// Gets or sets the port an endpoint is connected to. + /// + [JsonProperty(PropertyName = "port")] + public int? Port { get; set; } + + /// + /// Gets or sets the time in milliseconds it takes for a TCP connection + /// to be created from the App Service Environment to this IpAddress at + /// this Port. + /// + [JsonProperty(PropertyName = "latency")] + public double? Latency { get; set; } + + /// + /// Gets or sets whether it is possible to create a TCP connection from + /// the App Service Environment to this IpAddress at this Port. + /// + [JsonProperty(PropertyName = "isAccessible")] + public bool? IsAccessible { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum4.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum4.cs deleted file mode 100644 index 18b450f41e98..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum4.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The Enum4. - public readonly partial struct Enum4 : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public Enum4(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string WindowsValue = "Windows"; - private const string LinuxValue = "Linux"; - private const string WindowsFunctionsValue = "WindowsFunctions"; - private const string LinuxFunctionsValue = "LinuxFunctions"; - private const string AllValue = "All"; - - /// Windows. - public static Enum4 Windows { get; } = new Enum4(WindowsValue); - /// Linux. - public static Enum4 Linux { get; } = new Enum4(LinuxValue); - /// WindowsFunctions. - public static Enum4 WindowsFunctions { get; } = new Enum4(WindowsFunctionsValue); - /// LinuxFunctions. - public static Enum4 LinuxFunctions { get; } = new Enum4(LinuxFunctionsValue); - /// All. - public static Enum4 All { get; } = new Enum4(AllValue); - /// Determines if two values are the same. - public static bool operator ==(Enum4 left, Enum4 right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Enum4 left, Enum4 right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Enum4(string value) => new Enum4(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Enum4 other && Equals(other); - /// - public bool Equals(Enum4 other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum5.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum5.cs deleted file mode 100644 index 0909773eaddc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum5.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The Enum5. - public readonly partial struct Enum5 : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public Enum5(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string WindowsValue = "Windows"; - private const string LinuxValue = "Linux"; - private const string AllValue = "All"; - - /// Windows. - public static Enum5 Windows { get; } = new Enum5(WindowsValue); - /// Linux. - public static Enum5 Linux { get; } = new Enum5(LinuxValue); - /// All. - public static Enum5 All { get; } = new Enum5(AllValue); - /// Determines if two values are the same. - public static bool operator ==(Enum5 left, Enum5 right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Enum5 left, Enum5 right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Enum5(string value) => new Enum5(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Enum5 other && Equals(other); - /// - public bool Equals(Enum5 other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum6.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum6.cs deleted file mode 100644 index f378a8aad425..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum6.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The Enum6. - public readonly partial struct Enum6 : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public Enum6(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string WindowsValue = "Windows"; - private const string LinuxValue = "Linux"; - private const string AllValue = "All"; - - /// Windows. - public static Enum6 Windows { get; } = new Enum6(WindowsValue); - /// Linux. - public static Enum6 Linux { get; } = new Enum6(LinuxValue); - /// All. - public static Enum6 All { get; } = new Enum6(AllValue); - /// Determines if two values are the same. - public static bool operator ==(Enum6 left, Enum6 right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Enum6 left, Enum6 right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Enum6(string value) => new Enum6(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Enum6 other && Equals(other); - /// - public bool Equals(Enum6 other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum7.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum7.cs deleted file mode 100644 index 5e6bae7eb178..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum7.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The Enum7. - public readonly partial struct Enum7 : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public Enum7(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string WindowsValue = "Windows"; - private const string LinuxValue = "Linux"; - private const string AllValue = "All"; - - /// Windows. - public static Enum7 Windows { get; } = new Enum7(WindowsValue); - /// Linux. - public static Enum7 Linux { get; } = new Enum7(LinuxValue); - /// All. - public static Enum7 All { get; } = new Enum7(AllValue); - /// Determines if two values are the same. - public static bool operator ==(Enum7 left, Enum7 right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Enum7 left, Enum7 right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Enum7(string value) => new Enum7(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Enum7 other && Equals(other); - /// - public bool Equals(Enum7 other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum8.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum8.cs deleted file mode 100644 index 5460e500f7a1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum8.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The Enum8. - public readonly partial struct Enum8 : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public Enum8(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string WindowsValue = "Windows"; - private const string LinuxValue = "Linux"; - private const string AllValue = "All"; - - /// Windows. - public static Enum8 Windows { get; } = new Enum8(WindowsValue); - /// Linux. - public static Enum8 Linux { get; } = new Enum8(LinuxValue); - /// All. - public static Enum8 All { get; } = new Enum8(AllValue); - /// Determines if two values are the same. - public static bool operator ==(Enum8 left, Enum8 right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Enum8 left, Enum8 right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Enum8(string value) => new Enum8(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Enum8 other && Equals(other); - /// - public bool Equals(Enum8 other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum9.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum9.cs deleted file mode 100644 index 82bb56efaa07..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Enum9.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The Enum9. - public readonly partial struct Enum9 : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public Enum9(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string WindowsValue = "Windows"; - private const string LinuxValue = "Linux"; - private const string WindowsFunctionsValue = "WindowsFunctions"; - private const string LinuxFunctionsValue = "LinuxFunctions"; - private const string AllValue = "All"; - - /// Windows. - public static Enum9 Windows { get; } = new Enum9(WindowsValue); - /// Linux. - public static Enum9 Linux { get; } = new Enum9(LinuxValue); - /// WindowsFunctions. - public static Enum9 WindowsFunctions { get; } = new Enum9(WindowsFunctionsValue); - /// LinuxFunctions. - public static Enum9 LinuxFunctions { get; } = new Enum9(LinuxFunctionsValue); - /// All. - public static Enum9 All { get; } = new Enum9(AllValue); - /// Determines if two values are the same. - public static bool operator ==(Enum9 left, Enum9 right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Enum9 left, Enum9 right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Enum9(string value) => new Enum9(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Enum9 other && Equals(other); - /// - public bool Equals(Enum9 other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.Serialization.cs deleted file mode 100644 index 89267735fe22..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.Serialization.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ErrorEntity - { - internal static ErrorEntity DeserializeErrorEntity(JsonElement element) - { - Optional extendedCode = default; - Optional messageTemplate = default; - Optional> parameters = default; - Optional> innerErrors = default; - Optional code = default; - Optional message = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("extendedCode")) - { - extendedCode = property.Value.GetString(); - continue; - } - if (property.NameEquals("messageTemplate")) - { - messageTemplate = property.Value.GetString(); - continue; - } - if (property.NameEquals("parameters")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - parameters = array; - continue; - } - if (property.NameEquals("innerErrors")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeserializeErrorEntity(item)); - } - innerErrors = array; - continue; - } - if (property.NameEquals("code")) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message")) - { - message = property.Value.GetString(); - continue; - } - } - return new ErrorEntity(extendedCode.Value, messageTemplate.Value, Optional.ToList(parameters), Optional.ToList(innerErrors), code.Value, message.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.cs index 1446ae3a9e84..d4452c070a90 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ErrorEntity.cs @@ -1,33 +1,43 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Body of the error response returned from the API. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Body of the error response returned from the API. + /// public partial class ErrorEntity { - /// Initializes a new instance of ErrorEntity. - internal ErrorEntity() + /// + /// Initializes a new instance of the ErrorEntity class. + /// + public ErrorEntity() { - Parameters = new ChangeTrackingList(); - InnerErrors = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of ErrorEntity. - /// Type of error. - /// Message template. - /// Parameters for the template. - /// Inner errors. - /// Basic error code. - /// Any details of the error. - internal ErrorEntity(string extendedCode, string messageTemplate, IReadOnlyList parameters, IReadOnlyList innerErrors, string code, string message) + /// + /// Initializes a new instance of the ErrorEntity class. + /// + /// Type of error. + /// Message template. + /// Parameters for the template. + /// Inner errors. + /// Basic error code. + /// Any details of the error. + public ErrorEntity(string extendedCode = default(string), string messageTemplate = default(string), IList parameters = default(IList), IList innerErrors = default(IList), string code = default(string), string message = default(string)) { ExtendedCode = extendedCode; MessageTemplate = messageTemplate; @@ -35,19 +45,49 @@ internal ErrorEntity(string extendedCode, string messageTemplate, IReadOnlyList< InnerErrors = innerErrors; Code = code; Message = message; + CustomInit(); } - /// Type of error. - public string ExtendedCode { get; } - /// Message template. - public string MessageTemplate { get; } - /// Parameters for the template. - public IReadOnlyList Parameters { get; } - /// Inner errors. - public IReadOnlyList InnerErrors { get; } - /// Basic error code. - public string Code { get; } - /// Any details of the error. - public string Message { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of error. + /// + [JsonProperty(PropertyName = "extendedCode")] + public string ExtendedCode { get; set; } + + /// + /// Gets or sets message template. + /// + [JsonProperty(PropertyName = "messageTemplate")] + public string MessageTemplate { get; set; } + + /// + /// Gets or sets parameters for the template. + /// + [JsonProperty(PropertyName = "parameters")] + public IList Parameters { get; set; } + + /// + /// Gets or sets inner errors. + /// + [JsonProperty(PropertyName = "innerErrors")] + public IList InnerErrors { get; set; } + + /// + /// Gets or sets basic error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets any details of the error. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.Serialization.cs deleted file mode 100644 index 0d4485ce9df6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.Serialization.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Experiments : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(RampUpRules)) - { - writer.WritePropertyName("rampUpRules"); - writer.WriteStartArray(); - foreach (var item in RampUpRules) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static Experiments DeserializeExperiments(JsonElement element) - { - Optional> rampUpRules = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("rampUpRules")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(RampUpRule.DeserializeRampUpRule(item)); - } - rampUpRules = array; - continue; - } - } - return new Experiments(Optional.ToList(rampUpRules)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.cs index e07a90bd0cff..291d41df9dbc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Experiments.cs @@ -1,32 +1,53 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Routing rules in production experiments. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Routing rules in production experiments. + /// public partial class Experiments { - /// Initializes a new instance of Experiments. + /// + /// Initializes a new instance of the Experiments class. + /// public Experiments() { - RampUpRules = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of Experiments. - /// List of ramp-up rules. - internal Experiments(IList rampUpRules) + /// + /// Initializes a new instance of the Experiments class. + /// + /// List of ramp-up rules. + public Experiments(IList rampUpRules = default(IList)) { RampUpRules = rampUpRules; + CustomInit(); } - /// List of ramp-up rules. - public IList RampUpRules { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of ramp-up rules. + /// + [JsonProperty(PropertyName = "rampUpRules")] + public IList RampUpRules { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.Serialization.cs deleted file mode 100644 index a6207ed66f3c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.Serialization.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Facebook : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(Registration)) - { - writer.WritePropertyName("registration"); - writer.WriteObjectValue(Registration); - } - if (Optional.IsDefined(GraphApiVersion)) - { - writer.WritePropertyName("graphApiVersion"); - writer.WriteStringValue(GraphApiVersion); - } - if (Optional.IsDefined(Login)) - { - writer.WritePropertyName("login"); - writer.WriteObjectValue(Login); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Facebook DeserializeFacebook(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional registration = default; - Optional graphApiVersion = default; - Optional login = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("registration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - registration = AppRegistration.DeserializeAppRegistration(property0.Value); - continue; - } - if (property0.NameEquals("graphApiVersion")) - { - graphApiVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("login")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - login = LoginScopes.DeserializeLoginScopes(property0.Value); - continue; - } - } - continue; - } - } - return new Facebook(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, graphApiVersion.Value, login.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.cs index 02a69c1711e3..5d66f50d57a6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.cs @@ -1,44 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the Facebook provider. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class Facebook : ProxyOnlyResource { - /// Initializes a new instance of Facebook. + /// + /// Initializes a new instance of the Facebook class. + /// public Facebook() { + CustomInit(); } - /// Initializes a new instance of Facebook. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>false</code> if the Facebook provider should not be enabled despite the set registration; otherwise, <code>true</code>. - /// The configuration settings of the app registration for the Facebook provider. - /// The version of the Facebook api to be used while logging in. - /// The configuration settings of the login flow. - internal Facebook(string id, string name, string kind, string type, bool? enabled, AppRegistration registration, string graphApiVersion, LoginScopes login) : base(id, name, kind, type) + /// + /// Initializes a new instance of the Facebook class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public Facebook(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), AppRegistration registration = default(AppRegistration), string graphApiVersion = default(string), LoginScopes login = default(LoginScopes)) + : base(id, name, kind, type) { Enabled = enabled; Registration = registration; GraphApiVersion = graphApiVersion; Login = login; + CustomInit(); } - /// <code>false</code> if the Facebook provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } - /// The configuration settings of the app registration for the Facebook provider. + + /// + /// + [JsonProperty(PropertyName = "properties.registration")] public AppRegistration Registration { get; set; } - /// The version of the Facebook api to be used while logging in. + + /// + /// + [JsonProperty(PropertyName = "properties.graphApiVersion")] public string GraphApiVersion { get; set; } - /// The configuration settings of the login flow. + + /// + /// + [JsonProperty(PropertyName = "properties.login")] public LoginScopes Login { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.Serialization.cs deleted file mode 100644 index 165f8ccc726a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class FileSystemApplicationLogsConfig : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Level)) - { - writer.WritePropertyName("level"); - writer.WriteStringValue(Level.Value.ToSerialString()); - } - writer.WriteEndObject(); - } - - internal static FileSystemApplicationLogsConfig DeserializeFileSystemApplicationLogsConfig(JsonElement element) - { - Optional level = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("level")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - level = property.Value.GetString().ToLogLevel(); - continue; - } - } - return new FileSystemApplicationLogsConfig(Optional.ToNullable(level)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.cs index 1e9bade1d96f..2146691d95fd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemApplicationLogsConfig.cs @@ -1,28 +1,55 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Application logs to file system configuration. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Application logs to file system configuration. + /// public partial class FileSystemApplicationLogsConfig { - /// Initializes a new instance of FileSystemApplicationLogsConfig. + /// + /// Initializes a new instance of the FileSystemApplicationLogsConfig + /// class. + /// public FileSystemApplicationLogsConfig() { + CustomInit(); } - /// Initializes a new instance of FileSystemApplicationLogsConfig. - /// Log level. - internal FileSystemApplicationLogsConfig(LogLevel? level) + /// + /// Initializes a new instance of the FileSystemApplicationLogsConfig + /// class. + /// + /// Log level. Possible values include: 'Off', + /// 'Verbose', 'Information', 'Warning', 'Error' + public FileSystemApplicationLogsConfig(LogLevel? level = default(LogLevel?)) { Level = level; + CustomInit(); } - /// Log level. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets log level. Possible values include: 'Off', 'Verbose', + /// 'Information', 'Warning', 'Error' + /// + [JsonProperty(PropertyName = "level")] public LogLevel? Level { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.Serialization.cs deleted file mode 100644 index 8ef865dcbcc6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.Serialization.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class FileSystemHttpLogsConfig : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(RetentionInMb)) - { - writer.WritePropertyName("retentionInMb"); - writer.WriteNumberValue(RetentionInMb.Value); - } - if (Optional.IsDefined(RetentionInDays)) - { - writer.WritePropertyName("retentionInDays"); - writer.WriteNumberValue(RetentionInDays.Value); - } - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - writer.WriteEndObject(); - } - - internal static FileSystemHttpLogsConfig DeserializeFileSystemHttpLogsConfig(JsonElement element) - { - Optional retentionInMb = default; - Optional retentionInDays = default; - Optional enabled = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("retentionInMb")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - retentionInMb = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("retentionInDays")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - retentionInDays = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("enabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - } - return new FileSystemHttpLogsConfig(Optional.ToNullable(retentionInMb), Optional.ToNullable(retentionInDays), Optional.ToNullable(enabled)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.cs index 673aebf44fea..67c7356df574 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemHttpLogsConfig.cs @@ -1,52 +1,98 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Http logs to file system configuration. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Http logs to file system configuration. + /// public partial class FileSystemHttpLogsConfig { - /// Initializes a new instance of FileSystemHttpLogsConfig. + /// + /// Initializes a new instance of the FileSystemHttpLogsConfig class. + /// public FileSystemHttpLogsConfig() { + CustomInit(); } - /// Initializes a new instance of FileSystemHttpLogsConfig. - /// - /// Maximum size in megabytes that http log files can use. - /// When reached old log files will be removed to make space for new ones. - /// Value can range between 25 and 100. - /// - /// - /// Retention in days. + /// + /// Initializes a new instance of the FileSystemHttpLogsConfig class. + /// + /// Maximum size in megabytes that http log + /// files can use. + /// When reached old log files will be removed to make space for new + /// ones. + /// Value can range between 25 and 100. + /// Retention in days. /// Remove files older than X days. - /// 0 or lower means no retention. - /// - /// True if configuration is enabled, false if it is disabled and null if configuration is not set. - internal FileSystemHttpLogsConfig(int? retentionInMb, int? retentionInDays, bool? enabled) + /// 0 or lower means no retention. + /// True if configuration is enabled, false if it + /// is disabled and null if configuration is not set. + public FileSystemHttpLogsConfig(int? retentionInMb = default(int?), int? retentionInDays = default(int?), bool? enabled = default(bool?)) { RetentionInMb = retentionInMb; RetentionInDays = retentionInDays; Enabled = enabled; + CustomInit(); } /// - /// Maximum size in megabytes that http log files can use. - /// When reached old log files will be removed to make space for new ones. + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets maximum size in megabytes that http log files can use. + /// When reached old log files will be removed to make space for new + /// ones. /// Value can range between 25 and 100. /// + [JsonProperty(PropertyName = "retentionInMb")] public int? RetentionInMb { get; set; } + /// - /// Retention in days. + /// Gets or sets retention in days. /// Remove files older than X days. /// 0 or lower means no retention. /// + [JsonProperty(PropertyName = "retentionInDays")] public int? RetentionInDays { get; set; } - /// True if configuration is enabled, false if it is disabled and null if configuration is not set. + + /// + /// Gets or sets true if configuration is enabled, false if it is + /// disabled and null if configuration is not set. + /// + [JsonProperty(PropertyName = "enabled")] public bool? Enabled { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (RetentionInMb > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInMb", 100); + } + if (RetentionInMb < 25) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInMb", 25); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.Serialization.cs deleted file mode 100644 index 8f7c3ed6c432..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class FileSystemTokenStore : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Directory)) - { - writer.WritePropertyName("directory"); - writer.WriteStringValue(Directory); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static FileSystemTokenStore DeserializeFileSystemTokenStore(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional directory = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("directory")) - { - directory = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new FileSystemTokenStore(id.Value, name.Value, kind.Value, type.Value, directory.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.cs index ec75ac5e0cee..d56ea63988fe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.cs @@ -1,32 +1,54 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the storage of the tokens if a file system is used. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class FileSystemTokenStore : ProxyOnlyResource { - /// Initializes a new instance of FileSystemTokenStore. + /// + /// Initializes a new instance of the FileSystemTokenStore class. + /// public FileSystemTokenStore() { + CustomInit(); } - /// Initializes a new instance of FileSystemTokenStore. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The directory in which the tokens will be stored. - internal FileSystemTokenStore(string id, string name, string kind, string type, string directory) : base(id, name, kind, type) + /// + /// Initializes a new instance of the FileSystemTokenStore class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public FileSystemTokenStore(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string directory = default(string)) + : base(id, name, kind, type) { Directory = directory; + CustomInit(); } - /// The directory in which the tokens will be stored. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.directory")] public string Directory { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.Serialization.cs deleted file mode 100644 index 96e1a74cbf7a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ForwardProxy : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Convention)) - { - writer.WritePropertyName("convention"); - writer.WriteStringValue(Convention.Value.ToSerialString()); - } - if (Optional.IsDefined(CustomHostHeaderName)) - { - writer.WritePropertyName("customHostHeaderName"); - writer.WriteStringValue(CustomHostHeaderName); - } - if (Optional.IsDefined(CustomProtoHeaderName)) - { - writer.WritePropertyName("customProtoHeaderName"); - writer.WriteStringValue(CustomProtoHeaderName); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ForwardProxy DeserializeForwardProxy(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional convention = default; - Optional customHostHeaderName = default; - Optional customProtoHeaderName = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("convention")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - convention = property0.Value.GetString().ToForwardProxyConvention(); - continue; - } - if (property0.NameEquals("customHostHeaderName")) - { - customHostHeaderName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("customProtoHeaderName")) - { - customProtoHeaderName = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new ForwardProxy(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(convention), customHostHeaderName.Value, customProtoHeaderName.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.cs index 29c9e8c00713..239718fe2b4e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.cs @@ -1,40 +1,70 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of a forward proxy used to make the requests. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class ForwardProxy : ProxyOnlyResource { - /// Initializes a new instance of ForwardProxy. + /// + /// Initializes a new instance of the ForwardProxy class. + /// public ForwardProxy() { + CustomInit(); } - /// Initializes a new instance of ForwardProxy. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The convention used to determine the url of the request made. - /// The name of the header containing the host of the request. - /// The name of the header containing the scheme of the request. - internal ForwardProxy(string id, string name, string kind, string type, ForwardProxyConvention? convention, string customHostHeaderName, string customProtoHeaderName) : base(id, name, kind, type) + /// + /// Initializes a new instance of the ForwardProxy class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Possible values include: 'NoProxy', + /// 'Standard', 'Custom' + public ForwardProxy(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ForwardProxyConvention? convention = default(ForwardProxyConvention?), string customHostHeaderName = default(string), string customProtoHeaderName = default(string)) + : base(id, name, kind, type) { Convention = convention; CustomHostHeaderName = customHostHeaderName; CustomProtoHeaderName = customProtoHeaderName; + CustomInit(); } - /// The convention used to determine the url of the request made. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'NoProxy', 'Standard', + /// 'Custom' + /// + [JsonProperty(PropertyName = "properties.convention")] public ForwardProxyConvention? Convention { get; set; } - /// The name of the header containing the host of the request. + + /// + /// + [JsonProperty(PropertyName = "properties.customHostHeaderName")] public string CustomHostHeaderName { get; set; } - /// The name of the header containing the scheme of the request. + + /// + /// + [JsonProperty(PropertyName = "properties.customProtoHeaderName")] public string CustomProtoHeaderName { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.Serialization.cs deleted file mode 100644 index cc9ef47da1ec..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class ForwardProxyConventionExtensions - { - public static string ToSerialString(this ForwardProxyConvention value) => value switch - { - ForwardProxyConvention.NoProxy => "NoProxy", - ForwardProxyConvention.Standard => "Standard", - ForwardProxyConvention.Custom => "Custom", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ForwardProxyConvention value.") - }; - - public static ForwardProxyConvention ToForwardProxyConvention(this string value) - { - if (string.Equals(value, "NoProxy", StringComparison.InvariantCultureIgnoreCase)) return ForwardProxyConvention.NoProxy; - if (string.Equals(value, "Standard", StringComparison.InvariantCultureIgnoreCase)) return ForwardProxyConvention.Standard; - if (string.Equals(value, "Custom", StringComparison.InvariantCultureIgnoreCase)) return ForwardProxyConvention.Custom; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ForwardProxyConvention value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.cs index 988d5fa90f1b..2f44e3cd8e45 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxyConvention.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The convention used to determine the url of the request made. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ForwardProxyConvention. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum ForwardProxyConvention { - /// NoProxy. + [EnumMember(Value = "NoProxy")] NoProxy, - /// Standard. + [EnumMember(Value = "Standard")] Standard, - /// Custom. + [EnumMember(Value = "Custom")] Custom } + internal static class ForwardProxyConventionEnumExtension + { + internal static string ToSerializedValue(this ForwardProxyConvention? value) + { + return value == null ? null : ((ForwardProxyConvention)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ForwardProxyConvention value) + { + switch( value ) + { + case ForwardProxyConvention.NoProxy: + return "NoProxy"; + case ForwardProxyConvention.Standard: + return "Standard"; + case ForwardProxyConvention.Custom: + return "Custom"; + } + return null; + } + + internal static ForwardProxyConvention? ParseForwardProxyConvention(this string value) + { + switch( value ) + { + case "NoProxy": + return ForwardProxyConvention.NoProxy; + case "Standard": + return ForwardProxyConvention.Standard; + case "Custom": + return ForwardProxyConvention.Custom; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.Serialization.cs deleted file mode 100644 index 6ea7f77e4c57..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class FrequencyUnitExtensions - { - public static string ToSerialString(this FrequencyUnit value) => value switch - { - FrequencyUnit.Day => "Day", - FrequencyUnit.Hour => "Hour", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FrequencyUnit value.") - }; - - public static FrequencyUnit ToFrequencyUnit(this string value) - { - if (string.Equals(value, "Day", StringComparison.InvariantCultureIgnoreCase)) return FrequencyUnit.Day; - if (string.Equals(value, "Hour", StringComparison.InvariantCultureIgnoreCase)) return FrequencyUnit.Hour; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FrequencyUnit value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.cs index b665316a8aff..ad2b69d824cd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FrequencyUnit.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for FrequencyUnit. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum FrequencyUnit { - /// Day. + [EnumMember(Value = "Day")] Day, - /// Hour. + [EnumMember(Value = "Hour")] Hour } + internal static class FrequencyUnitEnumExtension + { + internal static string ToSerializedValue(this FrequencyUnit? value) + { + return value == null ? null : ((FrequencyUnit)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this FrequencyUnit value) + { + switch( value ) + { + case FrequencyUnit.Day: + return "Day"; + case FrequencyUnit.Hour: + return "Hour"; + } + return null; + } + + internal static FrequencyUnit? ParseFrequencyUnit(this string value) + { + switch( value ) + { + case "Day": + return FrequencyUnit.Day; + case "Hour": + return FrequencyUnit.Hour; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FtpsState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FtpsState.cs index 0fda6f449bc4..481d92f38573 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FtpsState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FtpsState.cs @@ -1,54 +1,23 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// State of FTP / FTPS service. - public readonly partial struct FtpsState : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public FtpsState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string AllAllowedValue = "AllAllowed"; - private const string FtpsOnlyValue = "FtpsOnly"; - private const string DisabledValue = "Disabled"; - - /// AllAllowed. - public static FtpsState AllAllowed { get; } = new FtpsState(AllAllowedValue); - /// FtpsOnly. - public static FtpsState FtpsOnly { get; } = new FtpsState(FtpsOnlyValue); - /// Disabled. - public static FtpsState Disabled { get; } = new FtpsState(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(FtpsState left, FtpsState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(FtpsState left, FtpsState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator FtpsState(string value) => new FtpsState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is FtpsState other && Equals(other); - /// - public bool Equals(FtpsState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for FtpsState. + /// + public static class FtpsState + { + public const string AllAllowed = "AllAllowed"; + public const string FtpsOnly = "FtpsOnly"; + public const string Disabled = "Disabled"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.Serialization.cs deleted file mode 100644 index cdaf8be2eb89..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class FunctionAppMajorVersion - { - internal static FunctionAppMajorVersion DeserializeFunctionAppMajorVersion(JsonElement element) - { - Optional displayText = default; - Optional value = default; - Optional> minorVersions = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("displayText")) - { - displayText = property.Value.GetString(); - continue; - } - if (property.NameEquals("value")) - { - value = property.Value.GetString(); - continue; - } - if (property.NameEquals("minorVersions")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(FunctionAppMinorVersion.DeserializeFunctionAppMinorVersion(item)); - } - minorVersions = array; - continue; - } - } - return new FunctionAppMajorVersion(displayText.Value, value.Value, Optional.ToList(minorVersions)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs deleted file mode 100644 index 96b0ea0c7990..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Function App stack major version. - public partial class FunctionAppMajorVersion - { - /// Initializes a new instance of FunctionAppMajorVersion. - internal FunctionAppMajorVersion() - { - MinorVersions = new ChangeTrackingList(); - } - - /// Initializes a new instance of FunctionAppMajorVersion. - /// Function App stack major version (display only). - /// Function App stack major version name. - /// Minor versions associated with the major version. - internal FunctionAppMajorVersion(string displayText, string value, IReadOnlyList minorVersions) - { - DisplayText = displayText; - Value = value; - MinorVersions = minorVersions; - } - - /// Function App stack major version (display only). - public string DisplayText { get; } - /// Function App stack major version name. - public string Value { get; } - /// Minor versions associated with the major version. - public IReadOnlyList MinorVersions { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.Serialization.cs deleted file mode 100644 index d790410bb25c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class FunctionAppMinorVersion - { - internal static FunctionAppMinorVersion DeserializeFunctionAppMinorVersion(JsonElement element) - { - Optional displayText = default; - Optional value = default; - Optional stackSettings = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("displayText")) - { - displayText = property.Value.GetString(); - continue; - } - if (property.NameEquals("value")) - { - value = property.Value.GetString(); - continue; - } - if (property.NameEquals("stackSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - stackSettings = FunctionAppRuntimes.DeserializeFunctionAppRuntimes(property.Value); - continue; - } - } - return new FunctionAppMinorVersion(displayText.Value, value.Value, stackSettings.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs deleted file mode 100644 index 2f6bc197b7b4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Function App stack minor version. - public partial class FunctionAppMinorVersion - { - /// Initializes a new instance of FunctionAppMinorVersion. - internal FunctionAppMinorVersion() - { - } - - /// Initializes a new instance of FunctionAppMinorVersion. - /// Function App stack (display only). - /// Function App stack name. - /// Settings associated with the minor version. - internal FunctionAppMinorVersion(string displayText, string value, FunctionAppRuntimes stackSettings) - { - DisplayText = displayText; - Value = value; - StackSettings = stackSettings; - } - - /// Function App stack (display only). - public string DisplayText { get; } - /// Function App stack name. - public string Value { get; } - /// Settings associated with the minor version. - public FunctionAppRuntimes StackSettings { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.Serialization.cs deleted file mode 100644 index 79ec2f390a9d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.Serialization.cs +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class FunctionAppRuntimeSettings - { - internal static FunctionAppRuntimeSettings DeserializeFunctionAppRuntimeSettings(JsonElement element) - { - Optional runtimeVersion = default; - Optional remoteDebuggingSupported = default; - Optional appInsightsSettings = default; - Optional gitHubActionSettings = default; - Optional> appSettingsDictionary = default; - Optional siteConfigPropertiesDictionary = default; - Optional> supportedFunctionsExtensionVersions = default; - Optional isPreview = default; - Optional isDeprecated = default; - Optional isHidden = default; - Optional endOfLifeDate = default; - Optional isAutoUpdate = default; - Optional isEarlyAccess = default; - Optional isDefault = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("runtimeVersion")) - { - runtimeVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("remoteDebuggingSupported")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - remoteDebuggingSupported = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("appInsightsSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - appInsightsSettings = AppInsightsWebAppStackSettings.DeserializeAppInsightsWebAppStackSettings(property.Value); - continue; - } - if (property.NameEquals("gitHubActionSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - gitHubActionSettings = GitHubActionWebAppStackSettings.DeserializeGitHubActionWebAppStackSettings(property.Value); - continue; - } - if (property.NameEquals("appSettingsDictionary")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - appSettingsDictionary = dictionary; - continue; - } - if (property.NameEquals("siteConfigPropertiesDictionary")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - siteConfigPropertiesDictionary = SiteConfigPropertiesDictionary.DeserializeSiteConfigPropertiesDictionary(property.Value); - continue; - } - if (property.NameEquals("supportedFunctionsExtensionVersions")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - supportedFunctionsExtensionVersions = array; - continue; - } - if (property.NameEquals("isPreview")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isPreview = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isDeprecated")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isDeprecated = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isHidden")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isHidden = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("endOfLifeDate")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - endOfLifeDate = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("isAutoUpdate")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isAutoUpdate = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isEarlyAccess")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isEarlyAccess = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isDefault")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isDefault = property.Value.GetBoolean(); - continue; - } - } - return new FunctionAppRuntimeSettings(runtimeVersion.Value, Optional.ToNullable(remoteDebuggingSupported), appInsightsSettings.Value, gitHubActionSettings.Value, Optional.ToDictionary(appSettingsDictionary), siteConfigPropertiesDictionary.Value, Optional.ToList(supportedFunctionsExtensionVersions), Optional.ToNullable(isPreview), Optional.ToNullable(isDeprecated), Optional.ToNullable(isHidden), Optional.ToNullable(endOfLifeDate), Optional.ToNullable(isAutoUpdate), Optional.ToNullable(isEarlyAccess), Optional.ToNullable(isDefault)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs deleted file mode 100644 index 292c666d4ae5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Function App runtime settings. - public partial class FunctionAppRuntimeSettings - { - /// Initializes a new instance of FunctionAppRuntimeSettings. - internal FunctionAppRuntimeSettings() - { - AppSettingsDictionary = new ChangeTrackingDictionary(); - SupportedFunctionsExtensionVersions = new ChangeTrackingList(); - } - - /// Initializes a new instance of FunctionAppRuntimeSettings. - /// Function App stack minor version (runtime only). - /// <code>true</code> if remote debugging is supported for the stack; otherwise, <code>false</code>. - /// Application Insights settings associated with the minor version. - /// GitHub Actions settings associated with the minor version. - /// Application settings associated with the minor version. - /// Configuration settings associated with the minor version. - /// List of supported Functions extension versions. - /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. - /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. - /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. - /// End-of-life date for the minor version. - /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. - /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. - /// <code>true</code> if the minor version the default; otherwise, <code>false</code>. - internal FunctionAppRuntimeSettings(string runtimeVersion, bool? remoteDebuggingSupported, AppInsightsWebAppStackSettings appInsightsSettings, GitHubActionWebAppStackSettings gitHubActionSettings, IReadOnlyDictionary appSettingsDictionary, SiteConfigPropertiesDictionary siteConfigPropertiesDictionary, IReadOnlyList supportedFunctionsExtensionVersions, bool? isPreview, bool? isDeprecated, bool? isHidden, DateTimeOffset? endOfLifeDate, bool? isAutoUpdate, bool? isEarlyAccess, bool? isDefault) - { - RuntimeVersion = runtimeVersion; - RemoteDebuggingSupported = remoteDebuggingSupported; - AppInsightsSettings = appInsightsSettings; - GitHubActionSettings = gitHubActionSettings; - AppSettingsDictionary = appSettingsDictionary; - SiteConfigPropertiesDictionary = siteConfigPropertiesDictionary; - SupportedFunctionsExtensionVersions = supportedFunctionsExtensionVersions; - IsPreview = isPreview; - IsDeprecated = isDeprecated; - IsHidden = isHidden; - EndOfLifeDate = endOfLifeDate; - IsAutoUpdate = isAutoUpdate; - IsEarlyAccess = isEarlyAccess; - IsDefault = isDefault; - } - - /// Function App stack minor version (runtime only). - public string RuntimeVersion { get; } - /// <code>true</code> if remote debugging is supported for the stack; otherwise, <code>false</code>. - public bool? RemoteDebuggingSupported { get; } - /// Application Insights settings associated with the minor version. - public AppInsightsWebAppStackSettings AppInsightsSettings { get; } - /// GitHub Actions settings associated with the minor version. - public GitHubActionWebAppStackSettings GitHubActionSettings { get; } - /// Application settings associated with the minor version. - public IReadOnlyDictionary AppSettingsDictionary { get; } - /// Configuration settings associated with the minor version. - public SiteConfigPropertiesDictionary SiteConfigPropertiesDictionary { get; } - /// List of supported Functions extension versions. - public IReadOnlyList SupportedFunctionsExtensionVersions { get; } - /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. - public bool? IsPreview { get; } - /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. - public bool? IsDeprecated { get; } - /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. - public bool? IsHidden { get; } - /// End-of-life date for the minor version. - public DateTimeOffset? EndOfLifeDate { get; } - /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. - public bool? IsAutoUpdate { get; } - /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. - public bool? IsEarlyAccess { get; } - /// <code>true</code> if the minor version the default; otherwise, <code>false</code>. - public bool? IsDefault { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.Serialization.cs deleted file mode 100644 index 8b5fa723278c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class FunctionAppRuntimes - { - internal static FunctionAppRuntimes DeserializeFunctionAppRuntimes(JsonElement element) - { - Optional linuxRuntimeSettings = default; - Optional windowsRuntimeSettings = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("linuxRuntimeSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - linuxRuntimeSettings = FunctionAppRuntimeSettings.DeserializeFunctionAppRuntimeSettings(property.Value); - continue; - } - if (property.NameEquals("windowsRuntimeSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - windowsRuntimeSettings = FunctionAppRuntimeSettings.DeserializeFunctionAppRuntimeSettings(property.Value); - continue; - } - } - return new FunctionAppRuntimes(linuxRuntimeSettings.Value, windowsRuntimeSettings.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs deleted file mode 100644 index 359592061547..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Function App stack runtimes. - public partial class FunctionAppRuntimes - { - /// Initializes a new instance of FunctionAppRuntimes. - internal FunctionAppRuntimes() - { - } - - /// Initializes a new instance of FunctionAppRuntimes. - /// Linux-specific settings associated with the minor version. - /// Windows-specific settings associated with the minor version. - internal FunctionAppRuntimes(FunctionAppRuntimeSettings linuxRuntimeSettings, FunctionAppRuntimeSettings windowsRuntimeSettings) - { - LinuxRuntimeSettings = linuxRuntimeSettings; - WindowsRuntimeSettings = windowsRuntimeSettings; - } - - /// Linux-specific settings associated with the minor version. - public FunctionAppRuntimeSettings LinuxRuntimeSettings { get; } - /// Windows-specific settings associated with the minor version. - public FunctionAppRuntimeSettings WindowsRuntimeSettings { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.Serialization.cs deleted file mode 100644 index 458fecb2ac7f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.Serialization.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class FunctionAppStack : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static FunctionAppStack DeserializeFunctionAppStack(JsonElement element) - { - Optional location = default; - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional displayText = default; - Optional value = default; - Optional> majorVersions = default; - Optional preferredOs = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("displayText")) - { - displayText = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("value")) - { - value = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("majorVersions")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(FunctionAppMajorVersion.DeserializeFunctionAppMajorVersion(item)); - } - majorVersions = array; - continue; - } - if (property0.NameEquals("preferredOs")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - preferredOs = property0.Value.GetString().ToStackPreferredOs(); - continue; - } - } - continue; - } - } - return new FunctionAppStack(id.Value, name.Value, kind.Value, type.Value, location.Value, displayText.Value, value.Value, Optional.ToList(majorVersions), Optional.ToNullable(preferredOs)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs deleted file mode 100644 index 6bcf94102a54..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Function App Stack. - public partial class FunctionAppStack : ProxyOnlyResource - { - /// Initializes a new instance of FunctionAppStack. - public FunctionAppStack() - { - MajorVersions = new ChangeTrackingList(); - } - - /// Initializes a new instance of FunctionAppStack. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Function App stack location. - /// Function App stack (display only). - /// Function App stack name. - /// List of major versions available. - /// Function App stack preferred OS. - internal FunctionAppStack(string id, string name, string kind, string type, string location, string displayText, string value, IReadOnlyList majorVersions, StackPreferredOs? preferredOs) : base(id, name, kind, type) - { - Location = location; - DisplayText = displayText; - Value = value; - MajorVersions = majorVersions; - PreferredOs = preferredOs; - } - - /// Function App stack location. - public string Location { get; } - /// Function App stack (display only). - public string DisplayText { get; } - /// Function App stack name. - public string Value { get; } - /// List of major versions available. - public IReadOnlyList MajorVersions { get; } - /// Function App stack preferred OS. - public StackPreferredOs? PreferredOs { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.Serialization.cs deleted file mode 100644 index 326127a02cf7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class FunctionAppStackCollection - { - internal static FunctionAppStackCollection DeserializeFunctionAppStackCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(FunctionAppStack.DeserializeFunctionAppStack(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new FunctionAppStackCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.cs deleted file mode 100644 index 0f23617867f3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStackCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Function app Stacks. - internal partial class FunctionAppStackCollection - { - /// Initializes a new instance of FunctionAppStackCollection. - /// Collection of resources. - /// is null. - internal FunctionAppStackCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of FunctionAppStackCollection. - /// Collection of resources. - /// Link to next page of resources. - internal FunctionAppStackCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.Serialization.cs deleted file mode 100644 index 215f44cdb359..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.Serialization.cs +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class FunctionEnvelope : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(FunctionAppId)) - { - writer.WritePropertyName("function_app_id"); - writer.WriteStringValue(FunctionAppId); - } - if (Optional.IsDefined(ScriptRootPathHref)) - { - writer.WritePropertyName("script_root_path_href"); - writer.WriteStringValue(ScriptRootPathHref); - } - if (Optional.IsDefined(ScriptHref)) - { - writer.WritePropertyName("script_href"); - writer.WriteStringValue(ScriptHref); - } - if (Optional.IsDefined(ConfigHref)) - { - writer.WritePropertyName("config_href"); - writer.WriteStringValue(ConfigHref); - } - if (Optional.IsDefined(TestDataHref)) - { - writer.WritePropertyName("test_data_href"); - writer.WriteStringValue(TestDataHref); - } - if (Optional.IsDefined(SecretsFileHref)) - { - writer.WritePropertyName("secrets_file_href"); - writer.WriteStringValue(SecretsFileHref); - } - if (Optional.IsDefined(Href)) - { - writer.WritePropertyName("href"); - writer.WriteStringValue(Href); - } - if (Optional.IsDefined(Config)) - { - writer.WritePropertyName("config"); - writer.WriteObjectValue(Config); - } - if (Optional.IsCollectionDefined(Files)) - { - writer.WritePropertyName("files"); - writer.WriteStartObject(); - foreach (var item in Files) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(TestData)) - { - writer.WritePropertyName("test_data"); - writer.WriteStringValue(TestData); - } - if (Optional.IsDefined(InvokeUrlTemplate)) - { - writer.WritePropertyName("invoke_url_template"); - writer.WriteStringValue(InvokeUrlTemplate); - } - if (Optional.IsDefined(Language)) - { - writer.WritePropertyName("language"); - writer.WriteStringValue(Language); - } - if (Optional.IsDefined(IsDisabled)) - { - writer.WritePropertyName("isDisabled"); - writer.WriteBooleanValue(IsDisabled.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static FunctionEnvelope DeserializeFunctionEnvelope(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional functionAppId = default; - Optional scriptRootPathHref = default; - Optional scriptHref = default; - Optional configHref = default; - Optional testDataHref = default; - Optional secretsFileHref = default; - Optional href = default; - Optional config = default; - Optional> files = default; - Optional testData = default; - Optional invokeUrlTemplate = default; - Optional language = default; - Optional isDisabled = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("function_app_id")) - { - functionAppId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("script_root_path_href")) - { - scriptRootPathHref = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("script_href")) - { - scriptHref = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("config_href")) - { - configHref = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("test_data_href")) - { - testDataHref = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("secrets_file_href")) - { - secretsFileHref = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("href")) - { - href = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("config")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - config = property0.Value.GetObject(); - continue; - } - if (property0.NameEquals("files")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetString()); - } - files = dictionary; - continue; - } - if (property0.NameEquals("test_data")) - { - testData = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("invoke_url_template")) - { - invokeUrlTemplate = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("language")) - { - language = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("isDisabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isDisabled = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new FunctionEnvelope(id.Value, name.Value, kind.Value, type.Value, functionAppId.Value, scriptRootPathHref.Value, scriptHref.Value, configHref.Value, testDataHref.Value, secretsFileHref.Value, href.Value, config.Value, Optional.ToDictionary(files), testData.Value, invokeUrlTemplate.Value, language.Value, Optional.ToNullable(isDisabled)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.cs index a7533e9295bc..0e0627a92be9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelope.cs @@ -1,43 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Function information. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Function information. + /// + [Rest.Serialization.JsonTransformation] public partial class FunctionEnvelope : ProxyOnlyResource { - /// Initializes a new instance of FunctionEnvelope. + /// + /// Initializes a new instance of the FunctionEnvelope class. + /// public FunctionEnvelope() { - Files = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of FunctionEnvelope. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Function App ID. - /// Script root path URI. - /// Script URI. - /// Config URI. - /// Test data URI. - /// Secrets file URI. - /// Function URI. - /// Config information. - /// File list. - /// Test data used when testing via the Azure Portal. - /// The invocation URL. - /// The function language. - /// Gets or sets a value indicating whether the function is disabled. - internal FunctionEnvelope(string id, string name, string kind, string type, string functionAppId, string scriptRootPathHref, string scriptHref, string configHref, string testDataHref, string secretsFileHref, string href, object config, IDictionary files, string testData, string invokeUrlTemplate, string language, bool? isDisabled) : base(id, name, kind, type) + /// + /// Initializes a new instance of the FunctionEnvelope class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Function App ID. + /// Script root path URI. + /// Script URI. + /// Config URI. + /// Test data URI. + /// Secrets file URI. + /// Function URI. + /// Config information. + /// File list. + /// Test data used when testing via the Azure + /// Portal. + /// The invocation URL + /// The function language + /// Gets or sets a value indicating whether + /// the function is disabled + public FunctionEnvelope(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string functionAppId = default(string), string scriptRootPathHref = default(string), string scriptHref = default(string), string configHref = default(string), string testDataHref = default(string), string secretsFileHref = default(string), string href = default(string), object config = default(object), IDictionary files = default(IDictionary), string testData = default(string), string invokeUrlTemplate = default(string), string language = default(string), bool? isDisabled = default(bool?)) + : base(id, name, kind, type) { FunctionAppId = functionAppId; ScriptRootPathHref = scriptRootPathHref; @@ -52,33 +69,91 @@ internal FunctionEnvelope(string id, string name, string kind, string type, stri InvokeUrlTemplate = invokeUrlTemplate; Language = language; IsDisabled = isDisabled; + CustomInit(); } - /// Function App ID. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets function App ID. + /// + [JsonProperty(PropertyName = "properties.function_app_id")] public string FunctionAppId { get; set; } - /// Script root path URI. + + /// + /// Gets or sets script root path URI. + /// + [JsonProperty(PropertyName = "properties.script_root_path_href")] public string ScriptRootPathHref { get; set; } - /// Script URI. + + /// + /// Gets or sets script URI. + /// + [JsonProperty(PropertyName = "properties.script_href")] public string ScriptHref { get; set; } - /// Config URI. + + /// + /// Gets or sets config URI. + /// + [JsonProperty(PropertyName = "properties.config_href")] public string ConfigHref { get; set; } - /// Test data URI. + + /// + /// Gets or sets test data URI. + /// + [JsonProperty(PropertyName = "properties.test_data_href")] public string TestDataHref { get; set; } - /// Secrets file URI. + + /// + /// Gets or sets secrets file URI. + /// + [JsonProperty(PropertyName = "properties.secrets_file_href")] public string SecretsFileHref { get; set; } - /// Function URI. + + /// + /// Gets or sets function URI. + /// + [JsonProperty(PropertyName = "properties.href")] public string Href { get; set; } - /// Config information. + + /// + /// Gets or sets config information. + /// + [JsonProperty(PropertyName = "properties.config")] public object Config { get; set; } - /// File list. - public IDictionary Files { get; } - /// Test data used when testing via the Azure Portal. + + /// + /// Gets or sets file list. + /// + [JsonProperty(PropertyName = "properties.files")] + public IDictionary Files { get; set; } + + /// + /// Gets or sets test data used when testing via the Azure Portal. + /// + [JsonProperty(PropertyName = "properties.test_data")] public string TestData { get; set; } - /// The invocation URL. + + /// + /// Gets or sets the invocation URL + /// + [JsonProperty(PropertyName = "properties.invoke_url_template")] public string InvokeUrlTemplate { get; set; } - /// The function language. + + /// + /// Gets or sets the function language + /// + [JsonProperty(PropertyName = "properties.language")] public string Language { get; set; } - /// Gets or sets a value indicating whether the function is disabled. + + /// + /// Gets or sets a value indicating whether the function is disabled + /// + [JsonProperty(PropertyName = "properties.isDisabled")] public bool? IsDisabled { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.Serialization.cs deleted file mode 100644 index 58787280bb91..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class FunctionEnvelopeCollection - { - internal static FunctionEnvelopeCollection DeserializeFunctionEnvelopeCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(FunctionEnvelope.DeserializeFunctionEnvelope(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new FunctionEnvelopeCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.cs deleted file mode 100644 index 3fad76327e5f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionEnvelopeCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Kudu function information elements. - internal partial class FunctionEnvelopeCollection - { - /// Initializes a new instance of FunctionEnvelopeCollection. - /// Collection of resources. - /// is null. - internal FunctionEnvelopeCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of FunctionEnvelopeCollection. - /// Collection of resources. - /// Link to next page of resources. - internal FunctionEnvelopeCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.Serialization.cs deleted file mode 100644 index ae9ec835007b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class FunctionSecrets - { - internal static FunctionSecrets DeserializeFunctionSecrets(JsonElement element) - { - Optional key = default; - Optional triggerUrl = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("key")) - { - key = property.Value.GetString(); - continue; - } - if (property.NameEquals("trigger_url")) - { - triggerUrl = property.Value.GetString(); - continue; - } - } - return new FunctionSecrets(key.Value, triggerUrl.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.cs index 1d8acfaab5b5..402dfca0c929 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionSecrets.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Function secrets. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Function secrets. + /// public partial class FunctionSecrets { - /// Initializes a new instance of FunctionSecrets. - internal FunctionSecrets() + /// + /// Initializes a new instance of the FunctionSecrets class. + /// + public FunctionSecrets() { + CustomInit(); } - /// Initializes a new instance of FunctionSecrets. - /// Secret key. - /// Trigger URL. - internal FunctionSecrets(string key, string triggerUrl) + /// + /// Initializes a new instance of the FunctionSecrets class. + /// + /// Secret key. + /// Trigger URL. + public FunctionSecrets(string key = default(string), string triggerUrl = default(string)) { Key = key; TriggerUrl = triggerUrl; + CustomInit(); } - /// Secret key. - public string Key { get; } - /// Trigger URL. - public string TriggerUrl { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets secret key. + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; set; } + + /// + /// Gets or sets trigger URL. + /// + [JsonProperty(PropertyName = "trigger_url")] + public string TriggerUrl { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.Serialization.cs deleted file mode 100644 index c0b3acd3634c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.Serialization.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class GeoRegion : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static GeoRegion DeserializeGeoRegion(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional description = default; - Optional displayName = default; - Optional orgDomain = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("description")) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("displayName")) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("orgDomain")) - { - orgDomain = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new GeoRegion(id.Value, name.Value, kind.Value, type.Value, description.Value, displayName.Value, orgDomain.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.cs index 04cc371f150f..e39413ff64dd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegion.cs @@ -1,40 +1,75 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Geographical region. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Geographical region. + /// + [Rest.Serialization.JsonTransformation] public partial class GeoRegion : ProxyOnlyResource { - /// Initializes a new instance of GeoRegion. + /// + /// Initializes a new instance of the GeoRegion class. + /// public GeoRegion() { + CustomInit(); } - /// Initializes a new instance of GeoRegion. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Region description. - /// Display name for region. - /// Display name for region. - internal GeoRegion(string id, string name, string kind, string type, string description, string displayName, string orgDomain) : base(id, name, kind, type) + /// + /// Initializes a new instance of the GeoRegion class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Region description. + /// Display name for region. + /// Display name for region. + public GeoRegion(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string description = default(string), string displayName = default(string), string orgDomain = default(string)) + : base(id, name, kind, type) { Description = description; DisplayName = displayName; OrgDomain = orgDomain; + CustomInit(); } - /// Region description. - public string Description { get; } - /// Display name for region. - public string DisplayName { get; } - /// Display name for region. - public string OrgDomain { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets region description. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + + /// + /// Gets display name for region. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets display name for region. + /// + [JsonProperty(PropertyName = "properties.orgDomain")] + public string OrgDomain { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.Serialization.cs deleted file mode 100644 index cd2c70829d70..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class GeoRegionCollection - { - internal static GeoRegionCollection DeserializeGeoRegionCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(GeoRegion.DeserializeGeoRegion(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new GeoRegionCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.cs deleted file mode 100644 index d181f6a0f88c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GeoRegionCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of geographical regions. - internal partial class GeoRegionCollection - { - /// Initializes a new instance of GeoRegionCollection. - /// Collection of resources. - /// is null. - internal GeoRegionCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of GeoRegionCollection. - /// Collection of resources. - /// Link to next page of resources. - internal GeoRegionCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.Serialization.cs deleted file mode 100644 index 0c62ec03307a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.Serialization.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class GitHub : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(Registration)) - { - writer.WritePropertyName("registration"); - writer.WriteObjectValue(Registration); - } - if (Optional.IsDefined(Login)) - { - writer.WritePropertyName("login"); - writer.WriteObjectValue(Login); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static GitHub DeserializeGitHub(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional registration = default; - Optional login = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("registration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - registration = ClientRegistration.DeserializeClientRegistration(property0.Value); - continue; - } - if (property0.NameEquals("login")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - login = LoginScopes.DeserializeLoginScopes(property0.Value); - continue; - } - } - continue; - } - } - return new GitHub(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, login.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.cs index 71d7d2064421..8555c23b8f92 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.cs @@ -1,40 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the GitHub provider. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class GitHub : ProxyOnlyResource { - /// Initializes a new instance of GitHub. + /// + /// Initializes a new instance of the GitHub class. + /// public GitHub() { + CustomInit(); } - /// Initializes a new instance of GitHub. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>false</code> if the GitHub provider should not be enabled despite the set registration; otherwise, <code>true</code>. - /// The configuration settings of the app registration for the GitHub provider. - /// The configuration settings of the login flow. - internal GitHub(string id, string name, string kind, string type, bool? enabled, ClientRegistration registration, LoginScopes login) : base(id, name, kind, type) + /// + /// Initializes a new instance of the GitHub class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public GitHub(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), ClientRegistration registration = default(ClientRegistration), LoginScopes login = default(LoginScopes)) + : base(id, name, kind, type) { Enabled = enabled; Registration = registration; Login = login; + CustomInit(); } - /// <code>false</code> if the GitHub provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } - /// The configuration settings of the app registration for the GitHub provider. + + /// + /// + [JsonProperty(PropertyName = "properties.registration")] public ClientRegistration Registration { get; set; } - /// The configuration settings of the login flow. + + /// + /// + [JsonProperty(PropertyName = "properties.login")] public LoginScopes Login { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.Serialization.cs deleted file mode 100644 index 81799ac465a1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class GitHubActionCodeConfiguration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(RuntimeStack)) - { - writer.WritePropertyName("runtimeStack"); - writer.WriteStringValue(RuntimeStack); - } - if (Optional.IsDefined(RuntimeVersion)) - { - writer.WritePropertyName("runtimeVersion"); - writer.WriteStringValue(RuntimeVersion); - } - writer.WriteEndObject(); - } - - internal static GitHubActionCodeConfiguration DeserializeGitHubActionCodeConfiguration(JsonElement element) - { - Optional runtimeStack = default; - Optional runtimeVersion = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("runtimeStack")) - { - runtimeStack = property.Value.GetString(); - continue; - } - if (property.NameEquals("runtimeVersion")) - { - runtimeVersion = property.Value.GetString(); - continue; - } - } - return new GitHubActionCodeConfiguration(runtimeStack.Value, runtimeVersion.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs deleted file mode 100644 index 022d43ce4a25..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The GitHub action code configuration. - public partial class GitHubActionCodeConfiguration - { - /// Initializes a new instance of GitHubActionCodeConfiguration. - public GitHubActionCodeConfiguration() - { - } - - /// Initializes a new instance of GitHubActionCodeConfiguration. - /// Runtime stack is used to determine the workflow file content for code base apps. - /// Runtime version is used to determine what build version to set in the workflow file. - internal GitHubActionCodeConfiguration(string runtimeStack, string runtimeVersion) - { - RuntimeStack = runtimeStack; - RuntimeVersion = runtimeVersion; - } - - /// Runtime stack is used to determine the workflow file content for code base apps. - public string RuntimeStack { get; set; } - /// Runtime version is used to determine what build version to set in the workflow file. - public string RuntimeVersion { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.Serialization.cs deleted file mode 100644 index a32fca638d27..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.Serialization.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class GitHubActionConfiguration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CodeConfiguration)) - { - writer.WritePropertyName("codeConfiguration"); - writer.WriteObjectValue(CodeConfiguration); - } - if (Optional.IsDefined(ContainerConfiguration)) - { - writer.WritePropertyName("containerConfiguration"); - writer.WriteObjectValue(ContainerConfiguration); - } - if (Optional.IsDefined(IsLinux)) - { - writer.WritePropertyName("isLinux"); - writer.WriteBooleanValue(IsLinux.Value); - } - if (Optional.IsDefined(GenerateWorkflowFile)) - { - writer.WritePropertyName("generateWorkflowFile"); - writer.WriteBooleanValue(GenerateWorkflowFile.Value); - } - writer.WriteEndObject(); - } - - internal static GitHubActionConfiguration DeserializeGitHubActionConfiguration(JsonElement element) - { - Optional codeConfiguration = default; - Optional containerConfiguration = default; - Optional isLinux = default; - Optional generateWorkflowFile = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("codeConfiguration")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - codeConfiguration = GitHubActionCodeConfiguration.DeserializeGitHubActionCodeConfiguration(property.Value); - continue; - } - if (property.NameEquals("containerConfiguration")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - containerConfiguration = GitHubActionContainerConfiguration.DeserializeGitHubActionContainerConfiguration(property.Value); - continue; - } - if (property.NameEquals("isLinux")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isLinux = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("generateWorkflowFile")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - generateWorkflowFile = property.Value.GetBoolean(); - continue; - } - } - return new GitHubActionConfiguration(codeConfiguration.Value, containerConfiguration.Value, Optional.ToNullable(isLinux), Optional.ToNullable(generateWorkflowFile)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs deleted file mode 100644 index 43fbb4489362..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The GitHub action configuration. - public partial class GitHubActionConfiguration - { - /// Initializes a new instance of GitHubActionConfiguration. - public GitHubActionConfiguration() - { - } - - /// Initializes a new instance of GitHubActionConfiguration. - /// GitHub Action code configuration. - /// GitHub Action container configuration. - /// This will help determine the workflow configuration to select. - /// Workflow option to determine whether the workflow file should be generated and written to the repository. - internal GitHubActionConfiguration(GitHubActionCodeConfiguration codeConfiguration, GitHubActionContainerConfiguration containerConfiguration, bool? isLinux, bool? generateWorkflowFile) - { - CodeConfiguration = codeConfiguration; - ContainerConfiguration = containerConfiguration; - IsLinux = isLinux; - GenerateWorkflowFile = generateWorkflowFile; - } - - /// GitHub Action code configuration. - public GitHubActionCodeConfiguration CodeConfiguration { get; set; } - /// GitHub Action container configuration. - public GitHubActionContainerConfiguration ContainerConfiguration { get; set; } - /// This will help determine the workflow configuration to select. - public bool? IsLinux { get; set; } - /// Workflow option to determine whether the workflow file should be generated and written to the repository. - public bool? GenerateWorkflowFile { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.Serialization.cs deleted file mode 100644 index d7f5a3632162..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.Serialization.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class GitHubActionContainerConfiguration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ServerUrl)) - { - writer.WritePropertyName("serverUrl"); - writer.WriteStringValue(ServerUrl); - } - if (Optional.IsDefined(ImageName)) - { - writer.WritePropertyName("imageName"); - writer.WriteStringValue(ImageName); - } - if (Optional.IsDefined(Username)) - { - writer.WritePropertyName("username"); - writer.WriteStringValue(Username); - } - if (Optional.IsDefined(Password)) - { - writer.WritePropertyName("password"); - writer.WriteStringValue(Password); - } - writer.WriteEndObject(); - } - - internal static GitHubActionContainerConfiguration DeserializeGitHubActionContainerConfiguration(JsonElement element) - { - Optional serverUrl = default; - Optional imageName = default; - Optional username = default; - Optional password = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("serverUrl")) - { - serverUrl = property.Value.GetString(); - continue; - } - if (property.NameEquals("imageName")) - { - imageName = property.Value.GetString(); - continue; - } - if (property.NameEquals("username")) - { - username = property.Value.GetString(); - continue; - } - if (property.NameEquals("password")) - { - password = property.Value.GetString(); - continue; - } - } - return new GitHubActionContainerConfiguration(serverUrl.Value, imageName.Value, username.Value, password.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs deleted file mode 100644 index d1963c4c44d5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The GitHub action container configuration. - public partial class GitHubActionContainerConfiguration - { - /// Initializes a new instance of GitHubActionContainerConfiguration. - public GitHubActionContainerConfiguration() - { - } - - /// Initializes a new instance of GitHubActionContainerConfiguration. - /// The server URL for the container registry where the build will be hosted. - /// The image name for the build. - /// The username used to upload the image to the container registry. - /// The password used to upload the image to the container registry. - internal GitHubActionContainerConfiguration(string serverUrl, string imageName, string username, string password) - { - ServerUrl = serverUrl; - ImageName = imageName; - Username = username; - Password = password; - } - - /// The server URL for the container registry where the build will be hosted. - public string ServerUrl { get; set; } - /// The image name for the build. - public string ImageName { get; set; } - /// The username used to upload the image to the container registry. - public string Username { get; set; } - /// The password used to upload the image to the container registry. - public string Password { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.Serialization.cs deleted file mode 100644 index 330decde9f90..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.Serialization.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class GitHubActionWebAppStackSettings - { - internal static GitHubActionWebAppStackSettings DeserializeGitHubActionWebAppStackSettings(JsonElement element) - { - Optional isSupported = default; - Optional supportedVersion = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("isSupported")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isSupported = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("supportedVersion")) - { - supportedVersion = property.Value.GetString(); - continue; - } - } - return new GitHubActionWebAppStackSettings(Optional.ToNullable(isSupported), supportedVersion.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs deleted file mode 100644 index 11fab5120a3f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// GitHub Actions Web App stack settings. - public partial class GitHubActionWebAppStackSettings - { - /// Initializes a new instance of GitHubActionWebAppStackSettings. - internal GitHubActionWebAppStackSettings() - { - } - - /// Initializes a new instance of GitHubActionWebAppStackSettings. - /// <code>true</code> if GitHub Actions is supported for the stack; otherwise, <code>false</code>. - /// The minor version that is supported for GitHub Actions. - internal GitHubActionWebAppStackSettings(bool? isSupported, string supportedVersion) - { - IsSupported = isSupported; - SupportedVersion = supportedVersion; - } - - /// <code>true</code> if GitHub Actions is supported for the stack; otherwise, <code>false</code>. - public bool? IsSupported { get; } - /// The minor version that is supported for GitHub Actions. - public string SupportedVersion { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.Serialization.cs deleted file mode 100644 index ad37901fe43b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.Serialization.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class GlobalCsmSkuDescription - { - internal static GlobalCsmSkuDescription DeserializeGlobalCsmSkuDescription(JsonElement element) - { - Optional name = default; - Optional tier = default; - Optional size = default; - Optional family = default; - Optional capacity = default; - Optional> locations = default; - Optional> capabilities = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("tier")) - { - tier = property.Value.GetString(); - continue; - } - if (property.NameEquals("size")) - { - size = property.Value.GetString(); - continue; - } - if (property.NameEquals("family")) - { - family = property.Value.GetString(); - continue; - } - if (property.NameEquals("capacity")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - capacity = SkuCapacity.DeserializeSkuCapacity(property.Value); - continue; - } - if (property.NameEquals("locations")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - locations = array; - continue; - } - if (property.NameEquals("capabilities")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Capability.DeserializeCapability(item)); - } - capabilities = array; - continue; - } - } - return new GlobalCsmSkuDescription(name.Value, tier.Value, size.Value, family.Value, capacity.Value, Optional.ToList(locations), Optional.ToList(capabilities)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.cs index e73ca1f88db1..bc1db434b848 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalCsmSkuDescription.cs @@ -1,34 +1,46 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// A Global SKU Description. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A Global SKU Description. + /// public partial class GlobalCsmSkuDescription { - /// Initializes a new instance of GlobalCsmSkuDescription. - internal GlobalCsmSkuDescription() + /// + /// Initializes a new instance of the GlobalCsmSkuDescription class. + /// + public GlobalCsmSkuDescription() { - Locations = new ChangeTrackingList(); - Capabilities = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of GlobalCsmSkuDescription. - /// Name of the resource SKU. - /// Service Tier of the resource SKU. - /// Size specifier of the resource SKU. - /// Family code of the resource SKU. - /// Min, max, and default scale values of the SKU. - /// Locations of the SKU. - /// Capabilities of the SKU, e.g., is traffic manager enabled?. - internal GlobalCsmSkuDescription(string name, string tier, string size, string family, SkuCapacity capacity, IReadOnlyList locations, IReadOnlyList capabilities) + /// + /// Initializes a new instance of the GlobalCsmSkuDescription class. + /// + /// Name of the resource SKU. + /// Service Tier of the resource SKU. + /// Size specifier of the resource SKU. + /// Family code of the resource SKU. + /// Min, max, and default scale values of the + /// SKU. + /// Locations of the SKU. + /// Capabilities of the SKU, e.g., is + /// traffic manager enabled? + public GlobalCsmSkuDescription(string name = default(string), string tier = default(string), string size = default(string), string family = default(string), SkuCapacity capacity = default(SkuCapacity), IList locations = default(IList), IList capabilities = default(IList)) { Name = name; Tier = tier; @@ -37,21 +49,56 @@ internal GlobalCsmSkuDescription(string name, string tier, string size, string f Capacity = capacity; Locations = locations; Capabilities = capabilities; + CustomInit(); } - /// Name of the resource SKU. - public string Name { get; } - /// Service Tier of the resource SKU. - public string Tier { get; } - /// Size specifier of the resource SKU. - public string Size { get; } - /// Family code of the resource SKU. - public string Family { get; } - /// Min, max, and default scale values of the SKU. - public SkuCapacity Capacity { get; } - /// Locations of the SKU. - public IReadOnlyList Locations { get; } - /// Capabilities of the SKU, e.g., is traffic manager enabled?. - public IReadOnlyList Capabilities { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the resource SKU. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets service Tier of the resource SKU. + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; set; } + + /// + /// Gets or sets size specifier of the resource SKU. + /// + [JsonProperty(PropertyName = "size")] + public string Size { get; set; } + + /// + /// Gets or sets family code of the resource SKU. + /// + [JsonProperty(PropertyName = "family")] + public string Family { get; set; } + + /// + /// Gets or sets min, max, and default scale values of the SKU. + /// + [JsonProperty(PropertyName = "capacity")] + public SkuCapacity Capacity { get; set; } + + /// + /// Gets or sets locations of the SKU. + /// + [JsonProperty(PropertyName = "locations")] + public IList Locations { get; set; } + + /// + /// Gets or sets capabilities of the SKU, e.g., is traffic manager + /// enabled? + /// + [JsonProperty(PropertyName = "capabilities")] + public IList Capabilities { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.Serialization.cs deleted file mode 100644 index 9d115c979471..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.Serialization.cs +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class GlobalValidation : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(RequireAuthentication)) - { - writer.WritePropertyName("requireAuthentication"); - writer.WriteBooleanValue(RequireAuthentication.Value); - } - if (Optional.IsDefined(UnauthenticatedClientAction)) - { - writer.WritePropertyName("unauthenticatedClientAction"); - writer.WriteStringValue(UnauthenticatedClientAction.Value.ToSerialString()); - } - if (Optional.IsDefined(RedirectToProvider)) - { - writer.WritePropertyName("redirectToProvider"); - writer.WriteStringValue(RedirectToProvider); - } - if (Optional.IsCollectionDefined(ExcludedPaths)) - { - writer.WritePropertyName("excludedPaths"); - writer.WriteStartArray(); - foreach (var item in ExcludedPaths) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static GlobalValidation DeserializeGlobalValidation(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional requireAuthentication = default; - Optional unauthenticatedClientAction = default; - Optional redirectToProvider = default; - Optional> excludedPaths = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("requireAuthentication")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - requireAuthentication = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("unauthenticatedClientAction")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - unauthenticatedClientAction = property0.Value.GetString().ToUnauthenticatedClientActionV2(); - continue; - } - if (property0.NameEquals("redirectToProvider")) - { - redirectToProvider = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("excludedPaths")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - excludedPaths = array; - continue; - } - } - continue; - } - } - return new GlobalValidation(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(requireAuthentication), Optional.ToNullable(unauthenticatedClientAction), redirectToProvider.Value, Optional.ToList(excludedPaths)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.cs index 71cbba72cce9..6e668cba711c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.cs @@ -1,56 +1,79 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class GlobalValidation : ProxyOnlyResource { - /// Initializes a new instance of GlobalValidation. + /// + /// Initializes a new instance of the GlobalValidation class. + /// public GlobalValidation() { - ExcludedPaths = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of GlobalValidation. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>true</code> if the authentication flow is required any request is made; otherwise, <code>false</code>. - /// The action to take when an unauthenticated client attempts to access the app. - /// - /// The default authentication provider to use when multiple providers are configured. - /// This setting is only needed if multiple providers are configured and the unauthenticated client - /// action is set to "RedirectToLoginPage". - /// - /// The paths for which unauthenticated flow would not be redirected to the login page. - internal GlobalValidation(string id, string name, string kind, string type, bool? requireAuthentication, UnauthenticatedClientActionV2? unauthenticatedClientAction, string redirectToProvider, IList excludedPaths) : base(id, name, kind, type) + /// + /// Initializes a new instance of the GlobalValidation class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Possible values include: + /// 'RedirectToLoginPage', 'AllowAnonymous', 'Return401', + /// 'Return403' + public GlobalValidation(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? requireAuthentication = default(bool?), UnauthenticatedClientActionV2? unauthenticatedClientAction = default(UnauthenticatedClientActionV2?), string redirectToProvider = default(string), IList excludedPaths = default(IList)) + : base(id, name, kind, type) { RequireAuthentication = requireAuthentication; UnauthenticatedClientAction = unauthenticatedClientAction; RedirectToProvider = redirectToProvider; ExcludedPaths = excludedPaths; + CustomInit(); } - /// <code>true</code> if the authentication flow is required any request is made; otherwise, <code>false</code>. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.requireAuthentication")] public bool? RequireAuthentication { get; set; } - /// The action to take when an unauthenticated client attempts to access the app. + + /// + /// Gets or sets possible values include: 'RedirectToLoginPage', + /// 'AllowAnonymous', 'Return401', 'Return403' + /// + [JsonProperty(PropertyName = "properties.unauthenticatedClientAction")] public UnauthenticatedClientActionV2? UnauthenticatedClientAction { get; set; } + /// - /// The default authentication provider to use when multiple providers are configured. - /// This setting is only needed if multiple providers are configured and the unauthenticated client - /// action is set to "RedirectToLoginPage". /// + [JsonProperty(PropertyName = "properties.redirectToProvider")] public string RedirectToProvider { get; set; } - /// The paths for which unauthenticated flow would not be redirected to the login page. - public IList ExcludedPaths { get; } + + /// + /// + [JsonProperty(PropertyName = "properties.excludedPaths")] + public IList ExcludedPaths { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.Serialization.cs deleted file mode 100644 index c0e78deb279a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Google : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(Registration)) - { - writer.WritePropertyName("registration"); - writer.WriteObjectValue(Registration); - } - if (Optional.IsDefined(Login)) - { - writer.WritePropertyName("login"); - writer.WriteObjectValue(Login); - } - if (Optional.IsDefined(Validation)) - { - writer.WritePropertyName("validation"); - writer.WriteObjectValue(Validation); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Google DeserializeGoogle(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional registration = default; - Optional login = default; - Optional validation = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("registration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - registration = ClientRegistration.DeserializeClientRegistration(property0.Value); - continue; - } - if (property0.NameEquals("login")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - login = LoginScopes.DeserializeLoginScopes(property0.Value); - continue; - } - if (property0.NameEquals("validation")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - validation = AllowedAudiencesValidation.DeserializeAllowedAudiencesValidation(property0.Value); - continue; - } - } - continue; - } - } - return new Google(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, login.Value, validation.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.cs index 4959820e9766..26af1e210ab7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.cs @@ -1,44 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the Google provider. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class Google : ProxyOnlyResource { - /// Initializes a new instance of Google. + /// + /// Initializes a new instance of the Google class. + /// public Google() { + CustomInit(); } - /// Initializes a new instance of Google. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>false</code> if the Google provider should not be enabled despite the set registration; otherwise, <code>true</code>. - /// The configuration settings of the app registration for the Google provider. - /// The configuration settings of the login flow. - /// The configuration settings of the Azure Active Directory token validation flow. - internal Google(string id, string name, string kind, string type, bool? enabled, ClientRegistration registration, LoginScopes login, AllowedAudiencesValidation validation) : base(id, name, kind, type) + /// + /// Initializes a new instance of the Google class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public Google(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), ClientRegistration registration = default(ClientRegistration), LoginScopes login = default(LoginScopes), AllowedAudiencesValidation validation = default(AllowedAudiencesValidation)) + : base(id, name, kind, type) { Enabled = enabled; Registration = registration; Login = login; Validation = validation; + CustomInit(); } - /// <code>false</code> if the Google provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } - /// The configuration settings of the app registration for the Google provider. + + /// + /// + [JsonProperty(PropertyName = "properties.registration")] public ClientRegistration Registration { get; set; } - /// The configuration settings of the login flow. + + /// + /// + [JsonProperty(PropertyName = "properties.login")] public LoginScopes Login { get; set; } - /// The configuration settings of the Azure Active Directory token validation flow. + + /// + /// + [JsonProperty(PropertyName = "properties.validation")] public AllowedAudiencesValidation Validation { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.Serialization.cs deleted file mode 100644 index 277fe9ef9a97..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.Serialization.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HandlerMapping : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Extension)) - { - writer.WritePropertyName("extension"); - writer.WriteStringValue(Extension); - } - if (Optional.IsDefined(ScriptProcessor)) - { - writer.WritePropertyName("scriptProcessor"); - writer.WriteStringValue(ScriptProcessor); - } - if (Optional.IsDefined(Arguments)) - { - writer.WritePropertyName("arguments"); - writer.WriteStringValue(Arguments); - } - writer.WriteEndObject(); - } - - internal static HandlerMapping DeserializeHandlerMapping(JsonElement element) - { - Optional extension = default; - Optional scriptProcessor = default; - Optional arguments = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("extension")) - { - extension = property.Value.GetString(); - continue; - } - if (property.NameEquals("scriptProcessor")) - { - scriptProcessor = property.Value.GetString(); - continue; - } - if (property.NameEquals("arguments")) - { - arguments = property.Value.GetString(); - continue; - } - } - return new HandlerMapping(extension.Value, scriptProcessor.Value, arguments.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.cs index b7cb2fa7c0cc..42a290c89308 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HandlerMapping.cs @@ -1,39 +1,75 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { + using Newtonsoft.Json; + using System.Linq; + /// - /// The IIS handler mappings used to define which handler processes HTTP requests with certain extension. - /// For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension. + /// The IIS handler mappings used to define which handler processes HTTP + /// requests with certain extension. + /// For example, it is used to configure php-cgi.exe process to handle all + /// HTTP requests with *.php extension. /// public partial class HandlerMapping { - /// Initializes a new instance of HandlerMapping. + /// + /// Initializes a new instance of the HandlerMapping class. + /// public HandlerMapping() { + CustomInit(); } - /// Initializes a new instance of HandlerMapping. - /// Requests with this extension will be handled using the specified FastCGI application. - /// The absolute path to the FastCGI application. - /// Command-line arguments to be passed to the script processor. - internal HandlerMapping(string extension, string scriptProcessor, string arguments) + /// + /// Initializes a new instance of the HandlerMapping class. + /// + /// Requests with this extension will be + /// handled using the specified FastCGI application. + /// The absolute path to the FastCGI + /// application. + /// Command-line arguments to be passed to the + /// script processor. + public HandlerMapping(string extension = default(string), string scriptProcessor = default(string), string arguments = default(string)) { Extension = extension; ScriptProcessor = scriptProcessor; Arguments = arguments; + CustomInit(); } - /// Requests with this extension will be handled using the specified FastCGI application. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets requests with this extension will be handled using the + /// specified FastCGI application. + /// + [JsonProperty(PropertyName = "extension")] public string Extension { get; set; } - /// The absolute path to the FastCGI application. + + /// + /// Gets or sets the absolute path to the FastCGI application. + /// + [JsonProperty(PropertyName = "scriptProcessor")] public string ScriptProcessor { get; set; } - /// Command-line arguments to be passed to the script processor. + + /// + /// Gets or sets command-line arguments to be passed to the script + /// processor. + /// + [JsonProperty(PropertyName = "arguments")] public string Arguments { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.Serialization.cs deleted file mode 100644 index 386923a47127..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.Serialization.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HostKeys - { - internal static HostKeys DeserializeHostKeys(JsonElement element) - { - Optional masterKey = default; - Optional> functionKeys = default; - Optional> systemKeys = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("masterKey")) - { - masterKey = property.Value.GetString(); - continue; - } - if (property.NameEquals("functionKeys")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - functionKeys = dictionary; - continue; - } - if (property.NameEquals("systemKeys")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - systemKeys = dictionary; - continue; - } - } - return new HostKeys(masterKey.Value, Optional.ToDictionary(functionKeys), Optional.ToDictionary(systemKeys)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.cs index db210ee39c7c..f418e7a6f4b2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostKeys.cs @@ -1,41 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Functions host level keys. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Functions host level keys. + /// public partial class HostKeys { - /// Initializes a new instance of HostKeys. - internal HostKeys() + /// + /// Initializes a new instance of the HostKeys class. + /// + public HostKeys() { - FunctionKeys = new ChangeTrackingDictionary(); - SystemKeys = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of HostKeys. - /// Secret key. - /// Host level function keys. - /// System keys. - internal HostKeys(string masterKey, IReadOnlyDictionary functionKeys, IReadOnlyDictionary systemKeys) + /// + /// Initializes a new instance of the HostKeys class. + /// + /// Secret key. + /// Host level function keys. + /// System keys. + public HostKeys(string masterKey = default(string), IDictionary functionKeys = default(IDictionary), IDictionary systemKeys = default(IDictionary)) { MasterKey = masterKey; FunctionKeys = functionKeys; SystemKeys = systemKeys; + CustomInit(); } - /// Secret key. - public string MasterKey { get; } - /// Host level function keys. - public IReadOnlyDictionary FunctionKeys { get; } - /// System keys. - public IReadOnlyDictionary SystemKeys { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets secret key. + /// + [JsonProperty(PropertyName = "masterKey")] + public string MasterKey { get; set; } + + /// + /// Gets or sets host level function keys. + /// + [JsonProperty(PropertyName = "functionKeys")] + public IDictionary FunctionKeys { get; set; } + + /// + /// Gets or sets system keys. + /// + [JsonProperty(PropertyName = "systemKeys")] + public IDictionary SystemKeys { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.Serialization.cs deleted file mode 100644 index aba175fb300e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.Serialization.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HostName - { - internal static HostName DeserializeHostName(JsonElement element) - { - Optional name = default; - Optional> siteNames = default; - Optional azureResourceName = default; - Optional azureResourceType = default; - Optional customHostNameDnsRecordType = default; - Optional hostNameType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("siteNames")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - siteNames = array; - continue; - } - if (property.NameEquals("azureResourceName")) - { - azureResourceName = property.Value.GetString(); - continue; - } - if (property.NameEquals("azureResourceType")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - azureResourceType = property.Value.GetString().ToAzureResourceType(); - continue; - } - if (property.NameEquals("customHostNameDnsRecordType")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - customHostNameDnsRecordType = property.Value.GetString().ToCustomHostNameDnsRecordType(); - continue; - } - if (property.NameEquals("hostNameType")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - hostNameType = property.Value.GetString().ToHostNameType(); - continue; - } - } - return new HostName(name.Value, Optional.ToList(siteNames), azureResourceName.Value, Optional.ToNullable(azureResourceType), Optional.ToNullable(customHostNameDnsRecordType), Optional.ToNullable(hostNameType)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.cs index 4dc57db13bbe..4b90a7163427 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostName.cs @@ -1,32 +1,52 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Details of a hostname derived from a domain. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Details of a hostname derived from a domain. + /// public partial class HostName { - /// Initializes a new instance of HostName. - internal HostName() + /// + /// Initializes a new instance of the HostName class. + /// + public HostName() { - SiteNames = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of HostName. - /// Name of the hostname. - /// List of apps the hostname is assigned to. This list will have more than one app only if the hostname is pointing to a Traffic Manager. - /// Name of the Azure resource the hostname is assigned to. If it is assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it will be the app name. - /// Type of the Azure resource the hostname is assigned to. - /// Type of the DNS record. - /// Type of the hostname. - internal HostName(string name, IReadOnlyList siteNames, string azureResourceName, AzureResourceType? azureResourceType, CustomHostNameDnsRecordType? customHostNameDnsRecordType, HostNameType? hostNameType) + /// + /// Initializes a new instance of the HostName class. + /// + /// Name of the hostname. + /// List of apps the hostname is assigned to. + /// This list will have more than one app only if the hostname is + /// pointing to a Traffic Manager. + /// Name of the Azure resource the + /// hostname is assigned to. If it is assigned to a Traffic Manager + /// then it will be the Traffic Manager name otherwise it will be the + /// app name. + /// Type of the Azure resource the + /// hostname is assigned to. Possible values include: 'Website', + /// 'TrafficManager' + /// Type of the DNS record. + /// Possible values include: 'CName', 'A' + /// Type of the hostname. Possible values + /// include: 'Verified', 'Managed' + public HostName(string name = default(string), IList siteNames = default(IList), string azureResourceName = default(string), AzureResourceType? azureResourceType = default(AzureResourceType?), CustomHostNameDnsRecordType? customHostNameDnsRecordType = default(CustomHostNameDnsRecordType?), HostNameType? hostNameType = default(HostNameType?)) { Name = name; SiteNames = siteNames; @@ -34,19 +54,56 @@ internal HostName(string name, IReadOnlyList siteNames, string azureReso AzureResourceType = azureResourceType; CustomHostNameDnsRecordType = customHostNameDnsRecordType; HostNameType = hostNameType; + CustomInit(); } - /// Name of the hostname. - public string Name { get; } - /// List of apps the hostname is assigned to. This list will have more than one app only if the hostname is pointing to a Traffic Manager. - public IReadOnlyList SiteNames { get; } - /// Name of the Azure resource the hostname is assigned to. If it is assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it will be the app name. - public string AzureResourceName { get; } - /// Type of the Azure resource the hostname is assigned to. - public AzureResourceType? AzureResourceType { get; } - /// Type of the DNS record. - public CustomHostNameDnsRecordType? CustomHostNameDnsRecordType { get; } - /// Type of the hostname. - public HostNameType? HostNameType { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the hostname. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets list of apps the hostname is assigned to. This list + /// will have more than one app only if the hostname is pointing to a + /// Traffic Manager. + /// + [JsonProperty(PropertyName = "siteNames")] + public IList SiteNames { get; set; } + + /// + /// Gets or sets name of the Azure resource the hostname is assigned + /// to. If it is assigned to a Traffic Manager then it will be the + /// Traffic Manager name otherwise it will be the app name. + /// + [JsonProperty(PropertyName = "azureResourceName")] + public string AzureResourceName { get; set; } + + /// + /// Gets or sets type of the Azure resource the hostname is assigned + /// to. Possible values include: 'Website', 'TrafficManager' + /// + [JsonProperty(PropertyName = "azureResourceType")] + public AzureResourceType? AzureResourceType { get; set; } + + /// + /// Gets or sets type of the DNS record. Possible values include: + /// 'CName', 'A' + /// + [JsonProperty(PropertyName = "customHostNameDnsRecordType")] + public CustomHostNameDnsRecordType? CustomHostNameDnsRecordType { get; set; } + + /// + /// Gets or sets type of the hostname. Possible values include: + /// 'Verified', 'Managed' + /// + [JsonProperty(PropertyName = "hostNameType")] + public HostNameType? HostNameType { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.Serialization.cs deleted file mode 100644 index b597fbb04807..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.Serialization.cs +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HostNameBinding : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(SiteName)) - { - writer.WritePropertyName("siteName"); - writer.WriteStringValue(SiteName); - } - if (Optional.IsDefined(DomainId)) - { - writer.WritePropertyName("domainId"); - writer.WriteStringValue(DomainId); - } - if (Optional.IsDefined(AzureResourceName)) - { - writer.WritePropertyName("azureResourceName"); - writer.WriteStringValue(AzureResourceName); - } - if (Optional.IsDefined(AzureResourceType)) - { - writer.WritePropertyName("azureResourceType"); - writer.WriteStringValue(AzureResourceType.Value.ToSerialString()); - } - if (Optional.IsDefined(CustomHostNameDnsRecordType)) - { - writer.WritePropertyName("customHostNameDnsRecordType"); - writer.WriteStringValue(CustomHostNameDnsRecordType.Value.ToSerialString()); - } - if (Optional.IsDefined(HostNameType)) - { - writer.WritePropertyName("hostNameType"); - writer.WriteStringValue(HostNameType.Value.ToSerialString()); - } - if (Optional.IsDefined(SslState)) - { - writer.WritePropertyName("sslState"); - writer.WriteStringValue(SslState.Value.ToSerialString()); - } - if (Optional.IsDefined(Thumbprint)) - { - writer.WritePropertyName("thumbprint"); - writer.WriteStringValue(Thumbprint); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static HostNameBinding DeserializeHostNameBinding(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional siteName = default; - Optional domainId = default; - Optional azureResourceName = default; - Optional azureResourceType = default; - Optional customHostNameDnsRecordType = default; - Optional hostNameType = default; - Optional sslState = default; - Optional thumbprint = default; - Optional virtualIP = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("siteName")) - { - siteName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("domainId")) - { - domainId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("azureResourceName")) - { - azureResourceName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("azureResourceType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - azureResourceType = property0.Value.GetString().ToAzureResourceType(); - continue; - } - if (property0.NameEquals("customHostNameDnsRecordType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - customHostNameDnsRecordType = property0.Value.GetString().ToCustomHostNameDnsRecordType(); - continue; - } - if (property0.NameEquals("hostNameType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hostNameType = property0.Value.GetString().ToHostNameType(); - continue; - } - if (property0.NameEquals("sslState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - sslState = property0.Value.GetString().ToSslState(); - continue; - } - if (property0.NameEquals("thumbprint")) - { - thumbprint = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("virtualIP")) - { - virtualIP = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new HostNameBinding(id.Value, name.Value, kind.Value, type.Value, siteName.Value, domainId.Value, azureResourceName.Value, Optional.ToNullable(azureResourceType), Optional.ToNullable(customHostNameDnsRecordType), Optional.ToNullable(hostNameType), Optional.ToNullable(sslState), thumbprint.Value, virtualIP.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.cs index 6ddfc92e2a3b..fd1f70bf2206 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBinding.cs @@ -1,35 +1,58 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// A hostname binding object. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A hostname binding object. + /// + [Rest.Serialization.JsonTransformation] public partial class HostNameBinding : ProxyOnlyResource { - /// Initializes a new instance of HostNameBinding. + /// + /// Initializes a new instance of the HostNameBinding class. + /// public HostNameBinding() { + CustomInit(); } - /// Initializes a new instance of HostNameBinding. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// App Service app name. - /// Fully qualified ARM domain resource URI. - /// Azure resource name. - /// Azure resource type. - /// Custom DNS record type. - /// Hostname type. - /// SSL type. - /// SSL certificate thumbprint. - /// Virtual IP address assigned to the hostname if IP based SSL is enabled. - internal HostNameBinding(string id, string name, string kind, string type, string siteName, string domainId, string azureResourceName, AzureResourceType? azureResourceType, CustomHostNameDnsRecordType? customHostNameDnsRecordType, HostNameType? hostNameType, SslState? sslState, string thumbprint, string virtualIP) : base(id, name, kind, type) + /// + /// Initializes a new instance of the HostNameBinding class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// App Service app name. + /// Fully qualified ARM domain resource + /// URI. + /// Azure resource name. + /// Azure resource type. Possible + /// values include: 'Website', 'TrafficManager' + /// Custom DNS record type. + /// Possible values include: 'CName', 'A' + /// Hostname type. Possible values include: + /// 'Verified', 'Managed' + /// SSL type. Possible values include: + /// 'Disabled', 'SniEnabled', 'IpBasedEnabled' + /// SSL certificate thumbprint + /// Virtual IP address assigned to the hostname + /// if IP based SSL is enabled. + public HostNameBinding(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string siteName = default(string), string domainId = default(string), string azureResourceName = default(string), AzureResourceType? azureResourceType = default(AzureResourceType?), CustomHostNameDnsRecordType? customHostNameDnsRecordType = default(CustomHostNameDnsRecordType?), HostNameType? hostNameType = default(HostNameType?), SslState? sslState = default(SslState?), string thumbprint = default(string), string virtualIP = default(string)) + : base(id, name, kind, type) { SiteName = siteName; DomainId = domainId; @@ -40,25 +63,72 @@ internal HostNameBinding(string id, string name, string kind, string type, strin SslState = sslState; Thumbprint = thumbprint; VirtualIP = virtualIP; + CustomInit(); } - /// App Service app name. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets app Service app name. + /// + [JsonProperty(PropertyName = "properties.siteName")] public string SiteName { get; set; } - /// Fully qualified ARM domain resource URI. + + /// + /// Gets or sets fully qualified ARM domain resource URI. + /// + [JsonProperty(PropertyName = "properties.domainId")] public string DomainId { get; set; } - /// Azure resource name. + + /// + /// Gets or sets azure resource name. + /// + [JsonProperty(PropertyName = "properties.azureResourceName")] public string AzureResourceName { get; set; } - /// Azure resource type. + + /// + /// Gets or sets azure resource type. Possible values include: + /// 'Website', 'TrafficManager' + /// + [JsonProperty(PropertyName = "properties.azureResourceType")] public AzureResourceType? AzureResourceType { get; set; } - /// Custom DNS record type. + + /// + /// Gets or sets custom DNS record type. Possible values include: + /// 'CName', 'A' + /// + [JsonProperty(PropertyName = "properties.customHostNameDnsRecordType")] public CustomHostNameDnsRecordType? CustomHostNameDnsRecordType { get; set; } - /// Hostname type. + + /// + /// Gets or sets hostname type. Possible values include: 'Verified', + /// 'Managed' + /// + [JsonProperty(PropertyName = "properties.hostNameType")] public HostNameType? HostNameType { get; set; } - /// SSL type. + + /// + /// Gets or sets SSL type. Possible values include: 'Disabled', + /// 'SniEnabled', 'IpBasedEnabled' + /// + [JsonProperty(PropertyName = "properties.sslState")] public SslState? SslState { get; set; } - /// SSL certificate thumbprint. + + /// + /// Gets or sets SSL certificate thumbprint + /// + [JsonProperty(PropertyName = "properties.thumbprint")] public string Thumbprint { get; set; } - /// Virtual IP address assigned to the hostname if IP based SSL is enabled. - public string VirtualIP { get; } + + /// + /// Gets virtual IP address assigned to the hostname if IP based SSL is + /// enabled. + /// + [JsonProperty(PropertyName = "properties.virtualIP")] + public string VirtualIP { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.Serialization.cs deleted file mode 100644 index 7a63d27784dc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class HostNameBindingCollection - { - internal static HostNameBindingCollection DeserializeHostNameBindingCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HostNameBinding.DeserializeHostNameBinding(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new HostNameBindingCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.cs deleted file mode 100644 index f3d4b7ef4e41..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameBindingCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of hostname bindings. - internal partial class HostNameBindingCollection - { - /// Initializes a new instance of HostNameBindingCollection. - /// Collection of resources. - /// is null. - internal HostNameBindingCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of HostNameBindingCollection. - /// Collection of resources. - /// Link to next page of resources. - internal HostNameBindingCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.Serialization.cs deleted file mode 100644 index 14804acca60b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.Serialization.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HostNameSslState : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(SslState)) - { - writer.WritePropertyName("sslState"); - writer.WriteStringValue(SslState.Value.ToSerialString()); - } - if (Optional.IsDefined(VirtualIP)) - { - writer.WritePropertyName("virtualIP"); - writer.WriteStringValue(VirtualIP); - } - if (Optional.IsDefined(Thumbprint)) - { - writer.WritePropertyName("thumbprint"); - writer.WriteStringValue(Thumbprint); - } - if (Optional.IsDefined(ToUpdate)) - { - writer.WritePropertyName("toUpdate"); - writer.WriteBooleanValue(ToUpdate.Value); - } - if (Optional.IsDefined(HostType)) - { - writer.WritePropertyName("hostType"); - writer.WriteStringValue(HostType.Value.ToSerialString()); - } - writer.WriteEndObject(); - } - - internal static HostNameSslState DeserializeHostNameSslState(JsonElement element) - { - Optional name = default; - Optional sslState = default; - Optional virtualIP = default; - Optional thumbprint = default; - Optional toUpdate = default; - Optional hostType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("sslState")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - sslState = property.Value.GetString().ToSslState(); - continue; - } - if (property.NameEquals("virtualIP")) - { - virtualIP = property.Value.GetString(); - continue; - } - if (property.NameEquals("thumbprint")) - { - thumbprint = property.Value.GetString(); - continue; - } - if (property.NameEquals("toUpdate")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - toUpdate = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("hostType")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - hostType = property.Value.GetString().ToHostType(); - continue; - } - } - return new HostNameSslState(name.Value, Optional.ToNullable(sslState), virtualIP.Value, thumbprint.Value, Optional.ToNullable(toUpdate), Optional.ToNullable(hostType)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.cs index 9239d68d973c..de29e1c19fa8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameSslState.cs @@ -1,28 +1,46 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// SSL-enabled hostname. + using Newtonsoft.Json; + using System.Linq; + + /// + /// SSL-enabled hostname. + /// public partial class HostNameSslState { - /// Initializes a new instance of HostNameSslState. + /// + /// Initializes a new instance of the HostNameSslState class. + /// public HostNameSslState() { + CustomInit(); } - /// Initializes a new instance of HostNameSslState. - /// Hostname. - /// SSL type. - /// Virtual IP address assigned to the hostname if IP based SSL is enabled. - /// SSL certificate thumbprint. - /// Set to <code>true</code> to update existing hostname. - /// Indicates whether the hostname is a standard or repository hostname. - internal HostNameSslState(string name, SslState? sslState, string virtualIP, string thumbprint, bool? toUpdate, HostType? hostType) + /// + /// Initializes a new instance of the HostNameSslState class. + /// + /// Hostname. + /// SSL type. Possible values include: + /// 'Disabled', 'SniEnabled', 'IpBasedEnabled' + /// Virtual IP address assigned to the hostname + /// if IP based SSL is enabled. + /// SSL certificate thumbprint. + /// Set to <code>true</code> to + /// update existing hostname. + /// Indicates whether the hostname is a standard + /// or repository hostname. Possible values include: 'Standard', + /// 'Repository' + public HostNameSslState(string name = default(string), SslState? sslState = default(SslState?), string virtualIP = default(string), string thumbprint = default(string), bool? toUpdate = default(bool?), HostType? hostType = default(HostType?)) { Name = name; SslState = sslState; @@ -30,19 +48,54 @@ internal HostNameSslState(string name, SslState? sslState, string virtualIP, str Thumbprint = thumbprint; ToUpdate = toUpdate; HostType = hostType; + CustomInit(); } - /// Hostname. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets hostname. + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// SSL type. + + /// + /// Gets or sets SSL type. Possible values include: 'Disabled', + /// 'SniEnabled', 'IpBasedEnabled' + /// + [JsonProperty(PropertyName = "sslState")] public SslState? SslState { get; set; } - /// Virtual IP address assigned to the hostname if IP based SSL is enabled. + + /// + /// Gets or sets virtual IP address assigned to the hostname if IP + /// based SSL is enabled. + /// + [JsonProperty(PropertyName = "virtualIP")] public string VirtualIP { get; set; } - /// SSL certificate thumbprint. + + /// + /// Gets or sets SSL certificate thumbprint. + /// + [JsonProperty(PropertyName = "thumbprint")] public string Thumbprint { get; set; } - /// Set to <code>true</code> to update existing hostname. + + /// + /// Gets or sets set to &lt;code&gt;true&lt;/code&gt; + /// to update existing hostname. + /// + [JsonProperty(PropertyName = "toUpdate")] public bool? ToUpdate { get; set; } - /// Indicates whether the hostname is a standard or repository hostname. + + /// + /// Gets or sets indicates whether the hostname is a standard or + /// repository hostname. Possible values include: 'Standard', + /// 'Repository' + /// + [JsonProperty(PropertyName = "hostType")] public HostType? HostType { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.Serialization.cs deleted file mode 100644 index 2a6d10117162..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class HostNameTypeExtensions - { - public static string ToSerialString(this HostNameType value) => value switch - { - HostNameType.Verified => "Verified", - HostNameType.Managed => "Managed", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostNameType value.") - }; - - public static HostNameType ToHostNameType(this string value) - { - if (string.Equals(value, "Verified", StringComparison.InvariantCultureIgnoreCase)) return HostNameType.Verified; - if (string.Equals(value, "Managed", StringComparison.InvariantCultureIgnoreCase)) return HostNameType.Managed; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostNameType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.cs index 4bfccbd32a9f..2aa52b79a3e5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostNameType.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Type of the hostname. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for HostNameType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum HostNameType { - /// Verified. + [EnumMember(Value = "Verified")] Verified, - /// Managed. + [EnumMember(Value = "Managed")] Managed } + internal static class HostNameTypeEnumExtension + { + internal static string ToSerializedValue(this HostNameType? value) + { + return value == null ? null : ((HostNameType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this HostNameType value) + { + switch( value ) + { + case HostNameType.Verified: + return "Verified"; + case HostNameType.Managed: + return "Managed"; + } + return null; + } + + internal static HostNameType? ParseHostNameType(this string value) + { + switch( value ) + { + case "Verified": + return HostNameType.Verified; + case "Managed": + return HostNameType.Managed; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.Serialization.cs deleted file mode 100644 index e3b140b8261c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class HostTypeExtensions - { - public static string ToSerialString(this HostType value) => value switch - { - HostType.Standard => "Standard", - HostType.Repository => "Repository", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostType value.") - }; - - public static HostType ToHostType(this string value) - { - if (string.Equals(value, "Standard", StringComparison.InvariantCultureIgnoreCase)) return HostType.Standard; - if (string.Equals(value, "Repository", StringComparison.InvariantCultureIgnoreCase)) return HostType.Repository; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.cs index 4452af2b293d..01df354dfa0e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostType.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Indicates whether the hostname is a standard or repository hostname. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for HostType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum HostType { - /// Standard. + [EnumMember(Value = "Standard")] Standard, - /// Repository. + [EnumMember(Value = "Repository")] Repository } + internal static class HostTypeEnumExtension + { + internal static string ToSerializedValue(this HostType? value) + { + return value == null ? null : ((HostType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this HostType value) + { + switch( value ) + { + case HostType.Standard: + return "Standard"; + case HostType.Repository: + return "Repository"; + } + return null; + } + + internal static HostType? ParseHostType(this string value) + { + switch( value ) + { + case "Standard": + return HostType.Standard; + case "Repository": + return HostType.Repository; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.Serialization.cs deleted file mode 100644 index f91ee175e21b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HostingEnvironmentDeploymentInfo - { - internal static HostingEnvironmentDeploymentInfo DeserializeHostingEnvironmentDeploymentInfo(JsonElement element) - { - Optional name = default; - Optional location = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - } - return new HostingEnvironmentDeploymentInfo(name.Value, location.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.cs index 8ba1babf781e..277d773c6ce7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDeploymentInfo.cs @@ -1,32 +1,62 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Information needed to create resources on an App Service Environment. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Information needed to create resources on an App Service Environment. + /// public partial class HostingEnvironmentDeploymentInfo { - /// Initializes a new instance of HostingEnvironmentDeploymentInfo. - internal HostingEnvironmentDeploymentInfo() + /// + /// Initializes a new instance of the HostingEnvironmentDeploymentInfo + /// class. + /// + public HostingEnvironmentDeploymentInfo() { + CustomInit(); } - /// Initializes a new instance of HostingEnvironmentDeploymentInfo. - /// Name of the App Service Environment. - /// Location of the App Service Environment. - internal HostingEnvironmentDeploymentInfo(string name, string location) + /// + /// Initializes a new instance of the HostingEnvironmentDeploymentInfo + /// class. + /// + /// Name of the App Service Environment. + /// Location of the App Service + /// Environment. + public HostingEnvironmentDeploymentInfo(string name = default(string), string location = default(string)) { Name = name; Location = location; + CustomInit(); } - /// Name of the App Service Environment. - public string Name { get; } - /// Location of the App Service Environment. - public string Location { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the App Service Environment. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets location of the App Service Environment. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.Serialization.cs deleted file mode 100644 index f729f252c5bf..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HostingEnvironmentDiagnostics - { - internal static HostingEnvironmentDiagnostics DeserializeHostingEnvironmentDiagnostics(JsonElement element) - { - Optional name = default; - Optional diagnosticsOutput = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("diagnosticsOutput")) - { - diagnosticsOutput = property.Value.GetString(); - continue; - } - } - return new HostingEnvironmentDiagnostics(name.Value, diagnosticsOutput.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.cs index 2473f8473354..bf1546b5752d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentDiagnostics.cs @@ -1,32 +1,61 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Diagnostics for an App Service Environment. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Diagnostics for an App Service Environment. + /// public partial class HostingEnvironmentDiagnostics { - /// Initializes a new instance of HostingEnvironmentDiagnostics. - internal HostingEnvironmentDiagnostics() + /// + /// Initializes a new instance of the HostingEnvironmentDiagnostics + /// class. + /// + public HostingEnvironmentDiagnostics() { + CustomInit(); } - /// Initializes a new instance of HostingEnvironmentDiagnostics. - /// Name/identifier of the diagnostics. - /// Diagnostics output. - internal HostingEnvironmentDiagnostics(string name, string diagnosticsOutput) + /// + /// Initializes a new instance of the HostingEnvironmentDiagnostics + /// class. + /// + /// Name/identifier of the diagnostics. + /// Diagnostics output. + public HostingEnvironmentDiagnostics(string name = default(string), string diagnosticsOutput = default(string)) { Name = name; DiagnosticsOutput = diagnosticsOutput; + CustomInit(); } - /// Name/identifier of the diagnostics. - public string Name { get; } - /// Diagnostics output. - public string DiagnosticsOutput { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name/identifier of the diagnostics. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets diagnostics output. + /// + [JsonProperty(PropertyName = "diagnosticsOutput")] + public string DiagnosticsOutput { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.Serialization.cs deleted file mode 100644 index f2b921a8e956..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HostingEnvironmentProfile : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"); - writer.WriteStringValue(Id); - } - writer.WriteEndObject(); - } - - internal static HostingEnvironmentProfile DeserializeHostingEnvironmentProfile(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - } - return new HostingEnvironmentProfile(id.Value, name.Value, type.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.cs index 5342cbb6923c..735924754efa 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentProfile.cs @@ -1,36 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Specification for an App Service Environment to use for this resource. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specification for an App Service Environment to use for this resource. + /// public partial class HostingEnvironmentProfile { - /// Initializes a new instance of HostingEnvironmentProfile. + /// + /// Initializes a new instance of the HostingEnvironmentProfile class. + /// public HostingEnvironmentProfile() { + CustomInit(); } - /// Initializes a new instance of HostingEnvironmentProfile. - /// Resource ID of the App Service Environment. - /// Name of the App Service Environment. - /// Resource type of the App Service Environment. - internal HostingEnvironmentProfile(string id, string name, string type) + /// + /// Initializes a new instance of the HostingEnvironmentProfile class. + /// + /// Resource ID of the App Service + /// Environment. + /// Name of the App Service Environment. + /// Resource type of the App Service + /// Environment. + public HostingEnvironmentProfile(string id = default(string), string name = default(string), string type = default(string)) { Id = id; Name = name; Type = type; + CustomInit(); } - /// Resource ID of the App Service Environment. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID of the App Service Environment. + /// + [JsonProperty(PropertyName = "id")] public string Id { get; set; } - /// Name of the App Service Environment. - public string Name { get; } - /// Resource type of the App Service Environment. - public string Type { get; } + + /// + /// Gets name of the App Service Environment. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type of the App Service Environment. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.Serialization.cs deleted file mode 100644 index e5c4769022d5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.Serialization.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class HostingEnvironmentStatusExtensions - { - public static string ToSerialString(this HostingEnvironmentStatus value) => value switch - { - HostingEnvironmentStatus.Preparing => "Preparing", - HostingEnvironmentStatus.Ready => "Ready", - HostingEnvironmentStatus.Scaling => "Scaling", - HostingEnvironmentStatus.Deleting => "Deleting", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostingEnvironmentStatus value.") - }; - - public static HostingEnvironmentStatus ToHostingEnvironmentStatus(this string value) - { - if (string.Equals(value, "Preparing", StringComparison.InvariantCultureIgnoreCase)) return HostingEnvironmentStatus.Preparing; - if (string.Equals(value, "Ready", StringComparison.InvariantCultureIgnoreCase)) return HostingEnvironmentStatus.Ready; - if (string.Equals(value, "Scaling", StringComparison.InvariantCultureIgnoreCase)) return HostingEnvironmentStatus.Scaling; - if (string.Equals(value, "Deleting", StringComparison.InvariantCultureIgnoreCase)) return HostingEnvironmentStatus.Deleting; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostingEnvironmentStatus value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.cs index 876f07ab7b2a..67db91b82f23 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HostingEnvironmentStatus.cs @@ -1,22 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Current status of the App Service Environment. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for HostingEnvironmentStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum HostingEnvironmentStatus { - /// Preparing. + [EnumMember(Value = "Preparing")] Preparing, - /// Ready. + [EnumMember(Value = "Ready")] Ready, - /// Scaling. + [EnumMember(Value = "Scaling")] Scaling, - /// Deleting. + [EnumMember(Value = "Deleting")] Deleting } + internal static class HostingEnvironmentStatusEnumExtension + { + internal static string ToSerializedValue(this HostingEnvironmentStatus? value) + { + return value == null ? null : ((HostingEnvironmentStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this HostingEnvironmentStatus value) + { + switch( value ) + { + case HostingEnvironmentStatus.Preparing: + return "Preparing"; + case HostingEnvironmentStatus.Ready: + return "Ready"; + case HostingEnvironmentStatus.Scaling: + return "Scaling"; + case HostingEnvironmentStatus.Deleting: + return "Deleting"; + } + return null; + } + + internal static HostingEnvironmentStatus? ParseHostingEnvironmentStatus(this string value) + { + switch( value ) + { + case "Preparing": + return HostingEnvironmentStatus.Preparing; + case "Ready": + return HostingEnvironmentStatus.Ready; + case "Scaling": + return HostingEnvironmentStatus.Scaling; + case "Deleting": + return HostingEnvironmentStatus.Deleting; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.Serialization.cs deleted file mode 100644 index d158733c4370..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.Serialization.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HttpLogsConfig : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(FileSystem)) - { - writer.WritePropertyName("fileSystem"); - writer.WriteObjectValue(FileSystem); - } - if (Optional.IsDefined(AzureBlobStorage)) - { - writer.WritePropertyName("azureBlobStorage"); - writer.WriteObjectValue(AzureBlobStorage); - } - writer.WriteEndObject(); - } - - internal static HttpLogsConfig DeserializeHttpLogsConfig(JsonElement element) - { - Optional fileSystem = default; - Optional azureBlobStorage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("fileSystem")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - fileSystem = FileSystemHttpLogsConfig.DeserializeFileSystemHttpLogsConfig(property.Value); - continue; - } - if (property.NameEquals("azureBlobStorage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - azureBlobStorage = AzureBlobStorageHttpLogsConfig.DeserializeAzureBlobStorageHttpLogsConfig(property.Value); - continue; - } - } - return new HttpLogsConfig(fileSystem.Value, azureBlobStorage.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.cs index efe0f813abe0..32628ade3880 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpLogsConfig.cs @@ -1,32 +1,74 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Http logs configuration. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Http logs configuration. + /// public partial class HttpLogsConfig { - /// Initializes a new instance of HttpLogsConfig. + /// + /// Initializes a new instance of the HttpLogsConfig class. + /// public HttpLogsConfig() { + CustomInit(); } - /// Initializes a new instance of HttpLogsConfig. - /// Http logs to file system configuration. - /// Http logs to azure blob storage configuration. - internal HttpLogsConfig(FileSystemHttpLogsConfig fileSystem, AzureBlobStorageHttpLogsConfig azureBlobStorage) + /// + /// Initializes a new instance of the HttpLogsConfig class. + /// + /// Http logs to file system + /// configuration. + /// Http logs to azure blob storage + /// configuration. + public HttpLogsConfig(FileSystemHttpLogsConfig fileSystem = default(FileSystemHttpLogsConfig), AzureBlobStorageHttpLogsConfig azureBlobStorage = default(AzureBlobStorageHttpLogsConfig)) { FileSystem = fileSystem; AzureBlobStorage = azureBlobStorage; + CustomInit(); } - /// Http logs to file system configuration. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets http logs to file system configuration. + /// + [JsonProperty(PropertyName = "fileSystem")] public FileSystemHttpLogsConfig FileSystem { get; set; } - /// Http logs to azure blob storage configuration. + + /// + /// Gets or sets http logs to azure blob storage configuration. + /// + [JsonProperty(PropertyName = "azureBlobStorage")] public AzureBlobStorageHttpLogsConfig AzureBlobStorage { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (FileSystem != null) + { + FileSystem.Validate(); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.Serialization.cs deleted file mode 100644 index 9db932592b6b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.Serialization.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HttpSettings : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(RequireHttps)) - { - writer.WritePropertyName("requireHttps"); - writer.WriteBooleanValue(RequireHttps.Value); - } - if (Optional.IsDefined(Routes)) - { - writer.WritePropertyName("routes"); - writer.WriteObjectValue(Routes); - } - if (Optional.IsDefined(ForwardProxy)) - { - writer.WritePropertyName("forwardProxy"); - writer.WriteObjectValue(ForwardProxy); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static HttpSettings DeserializeHttpSettings(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional requireHttps = default; - Optional routes = default; - Optional forwardProxy = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("requireHttps")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - requireHttps = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("routes")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - routes = HttpSettingsRoutes.DeserializeHttpSettingsRoutes(property0.Value); - continue; - } - if (property0.NameEquals("forwardProxy")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - forwardProxy = ForwardProxy.DeserializeForwardProxy(property0.Value); - continue; - } - } - continue; - } - } - return new HttpSettings(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(requireHttps), routes.Value, forwardProxy.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.cs index 9ea5cdf9bdfc..b5090a80f932 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.cs @@ -1,40 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class HttpSettings : ProxyOnlyResource { - /// Initializes a new instance of HttpSettings. + /// + /// Initializes a new instance of the HttpSettings class. + /// public HttpSettings() { + CustomInit(); } - /// Initializes a new instance of HttpSettings. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>false</code> if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, <code>true</code>. - /// The configuration settings of the paths HTTP requests. - /// The configuration settings of a forward proxy used to make the requests. - internal HttpSettings(string id, string name, string kind, string type, bool? requireHttps, HttpSettingsRoutes routes, ForwardProxy forwardProxy) : base(id, name, kind, type) + /// + /// Initializes a new instance of the HttpSettings class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public HttpSettings(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? requireHttps = default(bool?), HttpSettingsRoutes routes = default(HttpSettingsRoutes), ForwardProxy forwardProxy = default(ForwardProxy)) + : base(id, name, kind, type) { RequireHttps = requireHttps; Routes = routes; ForwardProxy = forwardProxy; + CustomInit(); } - /// <code>false</code> if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, <code>true</code>. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.requireHttps")] public bool? RequireHttps { get; set; } - /// The configuration settings of the paths HTTP requests. + + /// + /// + [JsonProperty(PropertyName = "properties.routes")] public HttpSettingsRoutes Routes { get; set; } - /// The configuration settings of a forward proxy used to make the requests. + + /// + /// + [JsonProperty(PropertyName = "properties.forwardProxy")] public ForwardProxy ForwardProxy { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.Serialization.cs deleted file mode 100644 index 3918ca745cd2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HttpSettingsRoutes : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ApiPrefix)) - { - writer.WritePropertyName("apiPrefix"); - writer.WriteStringValue(ApiPrefix); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static HttpSettingsRoutes DeserializeHttpSettingsRoutes(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional apiPrefix = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("apiPrefix")) - { - apiPrefix = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new HttpSettingsRoutes(id.Value, name.Value, kind.Value, type.Value, apiPrefix.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.cs index 4e30599758a8..1c71deecd7f2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.cs @@ -1,32 +1,54 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the paths HTTP requests. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class HttpSettingsRoutes : ProxyOnlyResource { - /// Initializes a new instance of HttpSettingsRoutes. + /// + /// Initializes a new instance of the HttpSettingsRoutes class. + /// public HttpSettingsRoutes() { + CustomInit(); } - /// Initializes a new instance of HttpSettingsRoutes. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The prefix that should precede all the authentication/authorization paths. - internal HttpSettingsRoutes(string id, string name, string kind, string type, string apiPrefix) : base(id, name, kind, type) + /// + /// Initializes a new instance of the HttpSettingsRoutes class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public HttpSettingsRoutes(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string apiPrefix = default(string)) + : base(id, name, kind, type) { ApiPrefix = apiPrefix; + CustomInit(); } - /// The prefix that should precede all the authentication/authorization paths. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.apiPrefix")] public string ApiPrefix { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.Serialization.cs deleted file mode 100644 index 97827cdf86d3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.Serialization.cs +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HybridConnection : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ServiceBusNamespace)) - { - writer.WritePropertyName("serviceBusNamespace"); - writer.WriteStringValue(ServiceBusNamespace); - } - if (Optional.IsDefined(RelayName)) - { - writer.WritePropertyName("relayName"); - writer.WriteStringValue(RelayName); - } - if (Optional.IsDefined(RelayArmUri)) - { - writer.WritePropertyName("relayArmUri"); - writer.WriteStringValue(RelayArmUri); - } - if (Optional.IsDefined(Hostname)) - { - writer.WritePropertyName("hostname"); - writer.WriteStringValue(Hostname); - } - if (Optional.IsDefined(Port)) - { - writer.WritePropertyName("port"); - writer.WriteNumberValue(Port.Value); - } - if (Optional.IsDefined(SendKeyName)) - { - writer.WritePropertyName("sendKeyName"); - writer.WriteStringValue(SendKeyName); - } - if (Optional.IsDefined(SendKeyValue)) - { - writer.WritePropertyName("sendKeyValue"); - writer.WriteStringValue(SendKeyValue); - } - if (Optional.IsDefined(ServiceBusSuffix)) - { - writer.WritePropertyName("serviceBusSuffix"); - writer.WriteStringValue(ServiceBusSuffix); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static HybridConnection DeserializeHybridConnection(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional serviceBusNamespace = default; - Optional relayName = default; - Optional relayArmUri = default; - Optional hostname = default; - Optional port = default; - Optional sendKeyName = default; - Optional sendKeyValue = default; - Optional serviceBusSuffix = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("serviceBusNamespace")) - { - serviceBusNamespace = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("relayName")) - { - relayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("relayArmUri")) - { - relayArmUri = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostname")) - { - hostname = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("port")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - port = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("sendKeyName")) - { - sendKeyName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("sendKeyValue")) - { - sendKeyValue = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("serviceBusSuffix")) - { - serviceBusSuffix = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new HybridConnection(id.Value, name.Value, kind.Value, type.Value, serviceBusNamespace.Value, relayName.Value, relayArmUri.Value, hostname.Value, Optional.ToNullable(port), sendKeyName.Value, sendKeyValue.Value, serviceBusSuffix.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.cs index a514f7cfe91e..e98573aa1d10 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnection.cs @@ -1,37 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Hybrid Connection contract. This is used to configure a Hybrid Connection. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Hybrid Connection contract. This is used to configure a Hybrid + /// Connection. + /// + [Rest.Serialization.JsonTransformation] public partial class HybridConnection : ProxyOnlyResource { - /// Initializes a new instance of HybridConnection. + /// + /// Initializes a new instance of the HybridConnection class. + /// public HybridConnection() { + CustomInit(); } - /// Initializes a new instance of HybridConnection. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The name of the Service Bus namespace. - /// The name of the Service Bus relay. - /// The ARM URI to the Service Bus relay. - /// The hostname of the endpoint. - /// The port of the endpoint. - /// The name of the Service Bus key which has Send permissions. This is used to authenticate to Service Bus. - /// - /// The value of the Service Bus key. This is used to authenticate to Service Bus. In ARM this key will not be returned - /// normally, use the POST /listKeys API instead. - /// - /// The suffix for the service bus endpoint. By default this is .servicebus.windows.net. - internal HybridConnection(string id, string name, string kind, string type, string serviceBusNamespace, string relayName, string relayArmUri, string hostname, int? port, string sendKeyName, string sendKeyValue, string serviceBusSuffix) : base(id, name, kind, type) + /// + /// Initializes a new instance of the HybridConnection class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The name of the Service Bus + /// namespace. + /// The name of the Service Bus relay. + /// The ARM URI to the Service Bus + /// relay. + /// The hostname of the endpoint. + /// The port of the endpoint. + /// The name of the Service Bus key which has + /// Send permissions. This is used to authenticate to Service + /// Bus. + /// The value of the Service Bus key. This + /// is used to authenticate to Service Bus. In ARM this key will not be + /// returned + /// normally, use the POST /listKeys API instead. + /// The suffix for the service bus + /// endpoint. By default this is .servicebus.windows.net + public HybridConnection(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string serviceBusNamespace = default(string), string relayName = default(string), string relayArmUri = default(string), string hostname = default(string), int? port = default(int?), string sendKeyName = default(string), string sendKeyValue = default(string), string serviceBusSuffix = default(string)) + : base(id, name, kind, type) { ServiceBusNamespace = serviceBusNamespace; RelayName = relayName; @@ -41,26 +64,65 @@ internal HybridConnection(string id, string name, string kind, string type, stri SendKeyName = sendKeyName; SendKeyValue = sendKeyValue; ServiceBusSuffix = serviceBusSuffix; + CustomInit(); } - /// The name of the Service Bus namespace. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the Service Bus namespace. + /// + [JsonProperty(PropertyName = "properties.serviceBusNamespace")] public string ServiceBusNamespace { get; set; } - /// The name of the Service Bus relay. + + /// + /// Gets or sets the name of the Service Bus relay. + /// + [JsonProperty(PropertyName = "properties.relayName")] public string RelayName { get; set; } - /// The ARM URI to the Service Bus relay. + + /// + /// Gets or sets the ARM URI to the Service Bus relay. + /// + [JsonProperty(PropertyName = "properties.relayArmUri")] public string RelayArmUri { get; set; } - /// The hostname of the endpoint. + + /// + /// Gets or sets the hostname of the endpoint. + /// + [JsonProperty(PropertyName = "properties.hostname")] public string Hostname { get; set; } - /// The port of the endpoint. + + /// + /// Gets or sets the port of the endpoint. + /// + [JsonProperty(PropertyName = "properties.port")] public int? Port { get; set; } - /// The name of the Service Bus key which has Send permissions. This is used to authenticate to Service Bus. + + /// + /// Gets or sets the name of the Service Bus key which has Send + /// permissions. This is used to authenticate to Service Bus. + /// + [JsonProperty(PropertyName = "properties.sendKeyName")] public string SendKeyName { get; set; } + /// - /// The value of the Service Bus key. This is used to authenticate to Service Bus. In ARM this key will not be returned + /// Gets or sets the value of the Service Bus key. This is used to + /// authenticate to Service Bus. In ARM this key will not be returned /// normally, use the POST /listKeys API instead. /// + [JsonProperty(PropertyName = "properties.sendKeyValue")] public string SendKeyValue { get; set; } - /// The suffix for the service bus endpoint. By default this is .servicebus.windows.net. + + /// + /// Gets or sets the suffix for the service bus endpoint. By default + /// this is .servicebus.windows.net + /// + [JsonProperty(PropertyName = "properties.serviceBusSuffix")] public string ServiceBusSuffix { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.Serialization.cs deleted file mode 100644 index 2d247d62f3aa..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class HybridConnectionCollection - { - internal static HybridConnectionCollection DeserializeHybridConnectionCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HybridConnection.DeserializeHybridConnection(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new HybridConnectionCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.cs deleted file mode 100644 index dcce5544c688..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of hostname bindings. - internal partial class HybridConnectionCollection - { - /// Initializes a new instance of HybridConnectionCollection. - /// Collection of resources. - /// is null. - internal HybridConnectionCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of HybridConnectionCollection. - /// Collection of resources. - /// Link to next page of resources. - internal HybridConnectionCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.Serialization.cs deleted file mode 100644 index c2aa23d2cbbf..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.Serialization.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HybridConnectionKey : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static HybridConnectionKey DeserializeHybridConnectionKey(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional sendKeyName = default; - Optional sendKeyValue = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("sendKeyName")) - { - sendKeyName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("sendKeyValue")) - { - sendKeyValue = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new HybridConnectionKey(id.Value, name.Value, kind.Value, type.Value, sendKeyName.Value, sendKeyValue.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.cs index 1d6fdbb9c8dc..c2e79154a648 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionKey.cs @@ -1,36 +1,68 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Hybrid Connection key contract. This has the send key name and value + /// for a Hybrid Connection. + /// + [Rest.Serialization.JsonTransformation] public partial class HybridConnectionKey : ProxyOnlyResource { - /// Initializes a new instance of HybridConnectionKey. + /// + /// Initializes a new instance of the HybridConnectionKey class. + /// public HybridConnectionKey() { + CustomInit(); } - /// Initializes a new instance of HybridConnectionKey. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The name of the send key. - /// The value of the send key. - internal HybridConnectionKey(string id, string name, string kind, string type, string sendKeyName, string sendKeyValue) : base(id, name, kind, type) + /// + /// Initializes a new instance of the HybridConnectionKey class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The name of the send key. + /// The value of the send key. + public HybridConnectionKey(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string sendKeyName = default(string), string sendKeyValue = default(string)) + : base(id, name, kind, type) { SendKeyName = sendKeyName; SendKeyValue = sendKeyValue; + CustomInit(); } - /// The name of the send key. - public string SendKeyName { get; } - /// The value of the send key. - public string SendKeyValue { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the send key. + /// + [JsonProperty(PropertyName = "properties.sendKeyName")] + public string SendKeyName { get; private set; } + + /// + /// Gets the value of the send key. + /// + [JsonProperty(PropertyName = "properties.sendKeyValue")] + public string SendKeyValue { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.Serialization.cs deleted file mode 100644 index 41e55e661322..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.Serialization.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class HybridConnectionLimits : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static HybridConnectionLimits DeserializeHybridConnectionLimits(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional current = default; - Optional maximum = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("current")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - current = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("maximum")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - maximum = property0.Value.GetInt32(); - continue; - } - } - continue; - } - } - return new HybridConnectionLimits(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(current), Optional.ToNullable(maximum)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.cs index 9f3192c29d46..9ada5c91749b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HybridConnectionLimits.cs @@ -1,36 +1,70 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Hybrid Connection limits contract. This is used to return the plan limits of Hybrid Connections. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Hybrid Connection limits contract. This is used to return the plan + /// limits of Hybrid Connections. + /// + [Rest.Serialization.JsonTransformation] public partial class HybridConnectionLimits : ProxyOnlyResource { - /// Initializes a new instance of HybridConnectionLimits. + /// + /// Initializes a new instance of the HybridConnectionLimits class. + /// public HybridConnectionLimits() { + CustomInit(); } - /// Initializes a new instance of HybridConnectionLimits. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The current number of Hybrid Connections. - /// The maximum number of Hybrid Connections allowed. - internal HybridConnectionLimits(string id, string name, string kind, string type, int? current, int? maximum) : base(id, name, kind, type) + /// + /// Initializes a new instance of the HybridConnectionLimits class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The current number of Hybrid + /// Connections. + /// The maximum number of Hybrid Connections + /// allowed. + public HybridConnectionLimits(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? current = default(int?), int? maximum = default(int?)) + : base(id, name, kind, type) { Current = current; Maximum = maximum; + CustomInit(); } - /// The current number of Hybrid Connections. - public int? Current { get; } - /// The maximum number of Hybrid Connections allowed. - public int? Maximum { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the current number of Hybrid Connections. + /// + [JsonProperty(PropertyName = "properties.current")] + public int? Current { get; private set; } + + /// + /// Gets the maximum number of Hybrid Connections allowed. + /// + [JsonProperty(PropertyName = "properties.maximum")] + public int? Maximum { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.Serialization.cs deleted file mode 100644 index 9bf0479c16c2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Identifier : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Value)) - { - writer.WritePropertyName("id"); - writer.WriteStringValue(Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Identifier DeserializeIdentifier(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional id0 = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("id")) - { - id0 = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new Identifier(id.Value, name.Value, kind.Value, type.Value, id0.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.cs index ce537d340eb1..7571f8806156 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Identifier.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// A domain specific resource identifier. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A domain specific resource identifier. + /// + [Rest.Serialization.JsonTransformation] public partial class Identifier : ProxyOnlyResource { - /// Initializes a new instance of Identifier. + /// + /// Initializes a new instance of the Identifier class. + /// public Identifier() { + CustomInit(); } - /// Initializes a new instance of Identifier. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// String representation of the identity. - internal Identifier(string id, string name, string kind, string type, string value) : base(id, name, kind, type) + /// + /// Initializes a new instance of the Identifier class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// String representation of the identity. + public Identifier(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string value = default(string)) + : base(id, name, kind, type) { Value = value; + CustomInit(); } - /// String representation of the identity. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets string representation of the identity. + /// + [JsonProperty(PropertyName = "properties.id")] public string Value { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.Serialization.cs deleted file mode 100644 index c89b87a01924..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class IdentifierCollection - { - internal static IdentifierCollection DeserializeIdentifierCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Identifier.DeserializeIdentifier(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new IdentifierCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.cs deleted file mode 100644 index cf4c2b39ecb3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentifierCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of identifiers. - internal partial class IdentifierCollection - { - /// Initializes a new instance of IdentifierCollection. - /// Collection of resources. - /// is null. - internal IdentifierCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of IdentifierCollection. - /// Collection of resources. - /// Link to next page of resources. - internal IdentifierCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.Serialization.cs deleted file mode 100644 index 20a1610b8e4a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.Serialization.cs +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class IdentityProviders : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(AzureActiveDirectory)) - { - writer.WritePropertyName("azureActiveDirectory"); - writer.WriteObjectValue(AzureActiveDirectory); - } - if (Optional.IsDefined(Facebook)) - { - writer.WritePropertyName("facebook"); - writer.WriteObjectValue(Facebook); - } - if (Optional.IsDefined(GitHub)) - { - writer.WritePropertyName("gitHub"); - writer.WriteObjectValue(GitHub); - } - if (Optional.IsDefined(Google)) - { - writer.WritePropertyName("google"); - writer.WriteObjectValue(Google); - } - if (Optional.IsDefined(Twitter)) - { - writer.WritePropertyName("twitter"); - writer.WriteObjectValue(Twitter); - } - if (Optional.IsCollectionDefined(CustomOpenIdConnectProviders)) - { - writer.WritePropertyName("customOpenIdConnectProviders"); - writer.WriteStartObject(); - foreach (var item in CustomOpenIdConnectProviders) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(LegacyMicrosoftAccount)) - { - writer.WritePropertyName("legacyMicrosoftAccount"); - writer.WriteObjectValue(LegacyMicrosoftAccount); - } - if (Optional.IsDefined(Apple)) - { - writer.WritePropertyName("apple"); - writer.WriteObjectValue(Apple); - } - if (Optional.IsDefined(AzureStaticWebApps)) - { - writer.WritePropertyName("azureStaticWebApps"); - writer.WriteObjectValue(AzureStaticWebApps); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static IdentityProviders DeserializeIdentityProviders(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional azureActiveDirectory = default; - Optional facebook = default; - Optional gitHub = default; - Optional google = default; - Optional twitter = default; - Optional> customOpenIdConnectProviders = default; - Optional legacyMicrosoftAccount = default; - Optional apple = default; - Optional azureStaticWebApps = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("azureActiveDirectory")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - azureActiveDirectory = AzureActiveDirectory.DeserializeAzureActiveDirectory(property0.Value); - continue; - } - if (property0.NameEquals("facebook")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - facebook = Facebook.DeserializeFacebook(property0.Value); - continue; - } - if (property0.NameEquals("gitHub")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - gitHub = GitHub.DeserializeGitHub(property0.Value); - continue; - } - if (property0.NameEquals("google")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - google = Google.DeserializeGoogle(property0.Value); - continue; - } - if (property0.NameEquals("twitter")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - twitter = Twitter.DeserializeTwitter(property0.Value); - continue; - } - if (property0.NameEquals("customOpenIdConnectProviders")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, CustomOpenIdConnectProvider.DeserializeCustomOpenIdConnectProvider(property1.Value)); - } - customOpenIdConnectProviders = dictionary; - continue; - } - if (property0.NameEquals("legacyMicrosoftAccount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - legacyMicrosoftAccount = LegacyMicrosoftAccount.DeserializeLegacyMicrosoftAccount(property0.Value); - continue; - } - if (property0.NameEquals("apple")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - apple = Apple.DeserializeApple(property0.Value); - continue; - } - if (property0.NameEquals("azureStaticWebApps")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - azureStaticWebApps = AzureStaticWebApps.DeserializeAzureStaticWebApps(property0.Value); - continue; - } - } - continue; - } - } - return new IdentityProviders(id.Value, name.Value, kind.Value, type.Value, azureActiveDirectory.Value, facebook.Value, gitHub.Value, google.Value, twitter.Value, Optional.ToDictionary(customOpenIdConnectProviders), legacyMicrosoftAccount.Value, apple.Value, azureStaticWebApps.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs index f7a37e7ad2b1..25b7f98e559f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs @@ -1,42 +1,42 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class IdentityProviders : ProxyOnlyResource { - /// Initializes a new instance of IdentityProviders. + /// + /// Initializes a new instance of the IdentityProviders class. + /// public IdentityProviders() { - CustomOpenIdConnectProviders = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of IdentityProviders. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The configuration settings of the Azure Active directory provider. - /// The configuration settings of the Facebook provider. - /// The configuration settings of the GitHub provider. - /// The configuration settings of the Google provider. - /// The configuration settings of the Twitter provider. - /// - /// The map of the name of the alias of each custom Open ID Connect provider to the - /// configuration settings of the custom Open ID Connect provider. - /// - /// The configuration settings of the legacy Microsoft Account provider. - /// The configuration settings of the Apple provider. - /// The configuration settings of the Azure Static Web Apps provider. - internal IdentityProviders(string id, string name, string kind, string type, AzureActiveDirectory azureActiveDirectory, Facebook facebook, GitHub gitHub, Google google, Twitter twitter, IDictionary customOpenIdConnectProviders, LegacyMicrosoftAccount legacyMicrosoftAccount, Apple apple, AzureStaticWebApps azureStaticWebApps) : base(id, name, kind, type) + /// + /// Initializes a new instance of the IdentityProviders class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public IdentityProviders(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), Facebook facebook = default(Facebook), GitHub gitHub = default(GitHub), Google google = default(Google), Twitter twitter = default(Twitter), IDictionary customOpenIdConnectProviders = default(IDictionary)) + : base(id, name, kind, type) { AzureActiveDirectory = azureActiveDirectory; Facebook = facebook; @@ -44,31 +44,43 @@ internal IdentityProviders(string id, string name, string kind, string type, Azu Google = google; Twitter = twitter; CustomOpenIdConnectProviders = customOpenIdConnectProviders; - LegacyMicrosoftAccount = legacyMicrosoftAccount; - Apple = apple; - AzureStaticWebApps = azureStaticWebApps; + CustomInit(); } - /// The configuration settings of the Azure Active directory provider. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.azureActiveDirectory")] public AzureActiveDirectory AzureActiveDirectory { get; set; } - /// The configuration settings of the Facebook provider. + + /// + /// + [JsonProperty(PropertyName = "properties.facebook")] public Facebook Facebook { get; set; } - /// The configuration settings of the GitHub provider. + + /// + /// + [JsonProperty(PropertyName = "properties.gitHub")] public GitHub GitHub { get; set; } - /// The configuration settings of the Google provider. + + /// + /// + [JsonProperty(PropertyName = "properties.google")] public Google Google { get; set; } - /// The configuration settings of the Twitter provider. + + /// + /// + [JsonProperty(PropertyName = "properties.twitter")] public Twitter Twitter { get; set; } + /// - /// The map of the name of the alias of each custom Open ID Connect provider to the - /// configuration settings of the custom Open ID Connect provider. /// - public IDictionary CustomOpenIdConnectProviders { get; } - /// The configuration settings of the legacy Microsoft Account provider. - public LegacyMicrosoftAccount LegacyMicrosoftAccount { get; set; } - /// The configuration settings of the Apple provider. - public Apple Apple { get; set; } - /// The configuration settings of the Azure Static Web Apps provider. - public AzureStaticWebApps AzureStaticWebApps { get; set; } + [JsonProperty(PropertyName = "properties.customOpenIdConnectProviders")] + public IDictionary CustomOpenIdConnectProviders { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InAvailabilityReasonType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InAvailabilityReasonType.cs index 6f44a3adb50b..49dc1f04dac2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InAvailabilityReasonType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InAvailabilityReasonType.cs @@ -1,51 +1,22 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// <code>Invalid</code> indicates the name provided does not match Azure App Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and is therefore unavailable. - public readonly partial struct InAvailabilityReasonType : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public InAvailabilityReasonType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string InvalidValue = "Invalid"; - private const string AlreadyExistsValue = "AlreadyExists"; - - /// Invalid. - public static InAvailabilityReasonType Invalid { get; } = new InAvailabilityReasonType(InvalidValue); - /// AlreadyExists. - public static InAvailabilityReasonType AlreadyExists { get; } = new InAvailabilityReasonType(AlreadyExistsValue); - /// Determines if two values are the same. - public static bool operator ==(InAvailabilityReasonType left, InAvailabilityReasonType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(InAvailabilityReasonType left, InAvailabilityReasonType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator InAvailabilityReasonType(string value) => new InAvailabilityReasonType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is InAvailabilityReasonType other && Equals(other); - /// - public bool Equals(InAvailabilityReasonType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for InAvailabilityReasonType. + /// + public static class InAvailabilityReasonType + { + public const string Invalid = "Invalid"; + public const string AlreadyExists = "AlreadyExists"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.Serialization.cs deleted file mode 100644 index 5be80938c1c7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.Serialization.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class InboundEnvironmentEndpoint - { - internal static InboundEnvironmentEndpoint DeserializeInboundEnvironmentEndpoint(JsonElement element) - { - Optional description = default; - Optional> endpoints = default; - Optional> ports = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("description")) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("endpoints")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - endpoints = array; - continue; - } - if (property.NameEquals("ports")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - ports = array; - continue; - } - } - return new InboundEnvironmentEndpoint(description.Value, Optional.ToList(endpoints), Optional.ToList(ports)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.cs index c738b030aa7a..ca1a6a2421a7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpoint.cs @@ -1,41 +1,76 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// The IP Addresses and Ports that require inbound network access to and within the subnet of the App Service Environment. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The IP Addresses and Ports that require inbound network access to and + /// within the subnet of the App Service Environment. + /// public partial class InboundEnvironmentEndpoint { - /// Initializes a new instance of InboundEnvironmentEndpoint. - internal InboundEnvironmentEndpoint() + /// + /// Initializes a new instance of the InboundEnvironmentEndpoint class. + /// + public InboundEnvironmentEndpoint() { - Endpoints = new ChangeTrackingList(); - Ports = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of InboundEnvironmentEndpoint. - /// Short text describing the purpose of the network traffic. - /// The IP addresses that network traffic will originate from in cidr notation. - /// The ports that network traffic will arrive to the App Service Environment at. - internal InboundEnvironmentEndpoint(string description, IReadOnlyList endpoints, IReadOnlyList ports) + /// + /// Initializes a new instance of the InboundEnvironmentEndpoint class. + /// + /// Short text describing the purpose of the + /// network traffic. + /// The IP addresses that network traffic will + /// originate from in cidr notation. + /// The ports that network traffic will arrive to + /// the App Service Environment at. + public InboundEnvironmentEndpoint(string description = default(string), IList endpoints = default(IList), IList ports = default(IList)) { Description = description; Endpoints = endpoints; Ports = ports; + CustomInit(); } - /// Short text describing the purpose of the network traffic. - public string Description { get; } - /// The IP addresses that network traffic will originate from in cidr notation. - public IReadOnlyList Endpoints { get; } - /// The ports that network traffic will arrive to the App Service Environment at. - public IReadOnlyList Ports { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets short text describing the purpose of the network + /// traffic. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the IP addresses that network traffic will originate + /// from in cidr notation. + /// + [JsonProperty(PropertyName = "endpoints")] + public IList Endpoints { get; set; } + + /// + /// Gets or sets the ports that network traffic will arrive to the App + /// Service Environment at. + /// + [JsonProperty(PropertyName = "ports")] + public IList Ports { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.Serialization.cs deleted file mode 100644 index 32ecb96add87..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class InboundEnvironmentEndpointCollection - { - internal static InboundEnvironmentEndpointCollection DeserializeInboundEnvironmentEndpointCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(InboundEnvironmentEndpoint.DeserializeInboundEnvironmentEndpoint(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new InboundEnvironmentEndpointCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.cs deleted file mode 100644 index 934830a75f0d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InboundEnvironmentEndpointCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Inbound Environment Endpoints. - internal partial class InboundEnvironmentEndpointCollection - { - /// Initializes a new instance of InboundEnvironmentEndpointCollection. - /// Collection of resources. - /// is null. - internal InboundEnvironmentEndpointCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of InboundEnvironmentEndpointCollection. - /// Collection of resources. - /// Link to next page of resources. - internal InboundEnvironmentEndpointCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.Serialization.cs deleted file mode 100644 index 0e7ac8aa6583..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class InsightStatusExtensions - { - public static string ToSerialString(this InsightStatus value) => value switch - { - InsightStatus.Critical => "Critical", - InsightStatus.Warning => "Warning", - InsightStatus.Info => "Info", - InsightStatus.Success => "Success", - InsightStatus.None => "None", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown InsightStatus value.") - }; - - public static InsightStatus ToInsightStatus(this string value) - { - if (string.Equals(value, "Critical", StringComparison.InvariantCultureIgnoreCase)) return InsightStatus.Critical; - if (string.Equals(value, "Warning", StringComparison.InvariantCultureIgnoreCase)) return InsightStatus.Warning; - if (string.Equals(value, "Info", StringComparison.InvariantCultureIgnoreCase)) return InsightStatus.Info; - if (string.Equals(value, "Success", StringComparison.InvariantCultureIgnoreCase)) return InsightStatus.Success; - if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return InsightStatus.None; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown InsightStatus value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs deleted file mode 100644 index 968278bec223..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Level of the most severe insight generated by the detector. - public enum InsightStatus - { - /// Critical. - Critical, - /// Warning. - Warning, - /// Info. - Info, - /// Success. - Success, - /// None. - None - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpFilterTag.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpFilterTag.cs index f55bae481cc7..3b5a6fdf588c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpFilterTag.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpFilterTag.cs @@ -1,54 +1,23 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// Defines what this IP filter will be used for. This is to support IP filtering on proxies. - public readonly partial struct IpFilterTag : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public IpFilterTag(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string DefaultValue = "Default"; - private const string XffProxyValue = "XffProxy"; - private const string ServiceTagValue = "ServiceTag"; - - /// Default. - public static IpFilterTag Default { get; } = new IpFilterTag(DefaultValue); - /// XffProxy. - public static IpFilterTag XffProxy { get; } = new IpFilterTag(XffProxyValue); - /// ServiceTag. - public static IpFilterTag ServiceTag { get; } = new IpFilterTag(ServiceTagValue); - /// Determines if two values are the same. - public static bool operator ==(IpFilterTag left, IpFilterTag right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IpFilterTag left, IpFilterTag right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IpFilterTag(string value) => new IpFilterTag(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IpFilterTag other && Equals(other); - /// - public bool Equals(IpFilterTag other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for IpFilterTag. + /// + public static class IpFilterTag + { + public const string Default = "Default"; + public const string XffProxy = "XffProxy"; + public const string ServiceTag = "ServiceTag"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.Serialization.cs deleted file mode 100644 index e1788573f0b9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.Serialization.cs +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class IpSecurityRestriction : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IpAddress)) - { - writer.WritePropertyName("ipAddress"); - writer.WriteStringValue(IpAddress); - } - if (Optional.IsDefined(SubnetMask)) - { - writer.WritePropertyName("subnetMask"); - writer.WriteStringValue(SubnetMask); - } - if (Optional.IsDefined(VnetSubnetResourceId)) - { - writer.WritePropertyName("vnetSubnetResourceId"); - writer.WriteStringValue(VnetSubnetResourceId); - } - if (Optional.IsDefined(VnetTrafficTag)) - { - writer.WritePropertyName("vnetTrafficTag"); - writer.WriteNumberValue(VnetTrafficTag.Value); - } - if (Optional.IsDefined(SubnetTrafficTag)) - { - writer.WritePropertyName("subnetTrafficTag"); - writer.WriteNumberValue(SubnetTrafficTag.Value); - } - if (Optional.IsDefined(Action)) - { - writer.WritePropertyName("action"); - writer.WriteStringValue(Action); - } - if (Optional.IsDefined(Tag)) - { - writer.WritePropertyName("tag"); - writer.WriteStringValue(Tag.Value.ToString()); - } - if (Optional.IsDefined(Priority)) - { - writer.WritePropertyName("priority"); - writer.WriteNumberValue(Priority.Value); - } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"); - writer.WriteStringValue(Description); - } - if (Optional.IsCollectionDefined(Headers)) - { - writer.WritePropertyName("headers"); - writer.WriteStartObject(); - foreach (var item in Headers) - { - writer.WritePropertyName(item.Key); - writer.WriteStartArray(); - foreach (var item0 in item.Value) - { - writer.WriteStringValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - - internal static IpSecurityRestriction DeserializeIpSecurityRestriction(JsonElement element) - { - Optional ipAddress = default; - Optional subnetMask = default; - Optional vnetSubnetResourceId = default; - Optional vnetTrafficTag = default; - Optional subnetTrafficTag = default; - Optional action = default; - Optional tag = default; - Optional priority = default; - Optional name = default; - Optional description = default; - Optional>> headers = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("ipAddress")) - { - ipAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("subnetMask")) - { - subnetMask = property.Value.GetString(); - continue; - } - if (property.NameEquals("vnetSubnetResourceId")) - { - vnetSubnetResourceId = property.Value.GetString(); - continue; - } - if (property.NameEquals("vnetTrafficTag")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - vnetTrafficTag = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("subnetTrafficTag")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - subnetTrafficTag = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("action")) - { - action = property.Value.GetString(); - continue; - } - if (property.NameEquals("tag")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - tag = new IpFilterTag(property.Value.GetString()); - continue; - } - if (property.NameEquals("priority")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - priority = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("description")) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("headers")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary> dictionary = new Dictionary>(); - foreach (var property0 in property.Value.EnumerateObject()) - { - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - dictionary.Add(property0.Name, array); - } - headers = dictionary; - continue; - } - } - return new IpSecurityRestriction(ipAddress.Value, subnetMask.Value, vnetSubnetResourceId.Value, Optional.ToNullable(vnetTrafficTag), Optional.ToNullable(subnetTrafficTag), action.Value, Optional.ToNullable(tag), Optional.ToNullable(priority), name.Value, description.Value, Optional.ToDictionary(headers)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.cs index 648b6f511031..7dee1a54d39a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IpSecurityRestriction.cs @@ -1,59 +1,84 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// IP security restriction on an app. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// IP security restriction on an app. + /// public partial class IpSecurityRestriction { - /// Initializes a new instance of IpSecurityRestriction. + /// + /// Initializes a new instance of the IpSecurityRestriction class. + /// public IpSecurityRestriction() { - Headers = new ChangeTrackingDictionary>(); + CustomInit(); } - /// Initializes a new instance of IpSecurityRestriction. - /// - /// IP address the security restriction is valid for. - /// It can be in form of pure ipv4 address (required SubnetMask property) or + /// + /// Initializes a new instance of the IpSecurityRestriction class. + /// + /// IP address the security restriction is + /// valid for. + /// It can be in form of pure ipv4 address (required SubnetMask + /// property) or /// CIDR notation such as ipv4/mask (leading bit match). For CIDR, - /// SubnetMask property must not be specified. - /// - /// Subnet mask for the range of IP addresses the restriction is valid for. - /// Virtual network resource id. - /// (internal) Vnet traffic tag. - /// (internal) Subnet traffic tag. - /// Allow or Deny access for this IP range. - /// Defines what this IP filter will be used for. This is to support IP filtering on proxies. - /// Priority of IP restriction rule. - /// IP restriction rule name. - /// IP restriction rule description. - /// - /// IP restriction rule headers. - /// X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). + /// SubnetMask property must not be specified. + /// Subnet mask for the range of IP addresses + /// the restriction is valid for. + /// Virtual network resource + /// id + /// (internal) Vnet traffic tag + /// (internal) Subnet traffic + /// tag + /// Allow or Deny access for this IP + /// range. + /// Defines what this IP filter will be used for. + /// This is to support IP filtering on proxies. Possible values + /// include: 'Default', 'XffProxy', 'ServiceTag' + /// Priority of IP restriction rule. + /// IP restriction rule name. + /// IP restriction rule description. + /// IP restriction rule headers. + /// X-Forwarded-Host + /// (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). /// The matching logic is .. - /// - If the property is null or empty (default), all hosts(or lack of) are allowed. - /// - A value is compared using ordinal-ignore-case (excluding port number). - /// - Subdomain wildcards are permitted but don't match the root domain. For example, *.contoso.com matches the subdomain foo.contoso.com - /// but not the root domain contoso.com or multi-level foo.bar.contoso.com - /// - Unicode host names are allowed but are converted to Punycode for matching. - /// - /// X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). + /// - If the property is null or empty (default), all hosts(or lack of) + /// are allowed. + /// - A value is compared using ordinal-ignore-case (excluding port + /// number). + /// - Subdomain wildcards are permitted but don't match the root + /// domain. For example, *.contoso.com matches the subdomain + /// foo.contoso.com + /// but not the root domain contoso.com or multi-level + /// foo.bar.contoso.com + /// - Unicode host names are allowed but are converted to Punycode for + /// matching. + /// + /// X-Forwarded-For + /// (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). /// The matching logic is .. - /// - If the property is null or empty (default), any forwarded-for chains (or lack of) are allowed. - /// - If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property. - /// + /// - If the property is null or empty (default), any forwarded-for + /// chains (or lack of) are allowed. + /// - If any address (excluding port number) in the chain (comma + /// separated) matches the CIDR defined by the property. + /// /// X-Azure-FDID and X-FD-HealthProbe. - /// The matching logic is exact match. - /// - internal IpSecurityRestriction(string ipAddress, string subnetMask, string vnetSubnetResourceId, int? vnetTrafficTag, int? subnetTrafficTag, string action, IpFilterTag? tag, int? priority, string name, string description, IDictionary> headers) + /// The matching logic is exact match. + public IpSecurityRestriction(string ipAddress = default(string), string subnetMask = default(string), string vnetSubnetResourceId = default(string), int? vnetTrafficTag = default(int?), int? subnetTrafficTag = default(int?), string action = default(string), string tag = default(string), int? priority = default(int?), string name = default(string), string description = default(string), IDictionary> headers = default(IDictionary>)) { IpAddress = ipAddress; SubnetMask = subnetMask; @@ -66,51 +91,111 @@ internal IpSecurityRestriction(string ipAddress, string subnetMask, string vnetS Name = name; Description = description; Headers = headers; + CustomInit(); } /// - /// IP address the security restriction is valid for. - /// It can be in form of pure ipv4 address (required SubnetMask property) or + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets IP address the security restriction is valid for. + /// It can be in form of pure ipv4 address (required SubnetMask + /// property) or /// CIDR notation such as ipv4/mask (leading bit match). For CIDR, /// SubnetMask property must not be specified. /// + [JsonProperty(PropertyName = "ipAddress")] public string IpAddress { get; set; } - /// Subnet mask for the range of IP addresses the restriction is valid for. + + /// + /// Gets or sets subnet mask for the range of IP addresses the + /// restriction is valid for. + /// + [JsonProperty(PropertyName = "subnetMask")] public string SubnetMask { get; set; } - /// Virtual network resource id. + + /// + /// Gets or sets virtual network resource id + /// + [JsonProperty(PropertyName = "vnetSubnetResourceId")] public string VnetSubnetResourceId { get; set; } - /// (internal) Vnet traffic tag. + + /// + /// Gets or sets (internal) Vnet traffic tag + /// + [JsonProperty(PropertyName = "vnetTrafficTag")] public int? VnetTrafficTag { get; set; } - /// (internal) Subnet traffic tag. + + /// + /// Gets or sets (internal) Subnet traffic tag + /// + [JsonProperty(PropertyName = "subnetTrafficTag")] public int? SubnetTrafficTag { get; set; } - /// Allow or Deny access for this IP range. + + /// + /// Gets or sets allow or Deny access for this IP range. + /// + [JsonProperty(PropertyName = "action")] public string Action { get; set; } - /// Defines what this IP filter will be used for. This is to support IP filtering on proxies. - public IpFilterTag? Tag { get; set; } - /// Priority of IP restriction rule. + + /// + /// Gets or sets defines what this IP filter will be used for. This is + /// to support IP filtering on proxies. Possible values include: + /// 'Default', 'XffProxy', 'ServiceTag' + /// + [JsonProperty(PropertyName = "tag")] + public string Tag { get; set; } + + /// + /// Gets or sets priority of IP restriction rule. + /// + [JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } - /// IP restriction rule name. + + /// + /// Gets or sets IP restriction rule name. + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// IP restriction rule description. + + /// + /// Gets or sets IP restriction rule description. + /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } + /// - /// IP restriction rule headers. - /// X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). + /// Gets or sets IP restriction rule headers. + /// X-Forwarded-Host + /// (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). /// The matching logic is .. - /// - If the property is null or empty (default), all hosts(or lack of) are allowed. - /// - A value is compared using ordinal-ignore-case (excluding port number). - /// - Subdomain wildcards are permitted but don't match the root domain. For example, *.contoso.com matches the subdomain foo.contoso.com - /// but not the root domain contoso.com or multi-level foo.bar.contoso.com - /// - Unicode host names are allowed but are converted to Punycode for matching. - /// - /// X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). + /// - If the property is null or empty (default), all hosts(or lack of) + /// are allowed. + /// - A value is compared using ordinal-ignore-case (excluding port + /// number). + /// - Subdomain wildcards are permitted but don't match the root + /// domain. For example, *.contoso.com matches the subdomain + /// foo.contoso.com + /// but not the root domain contoso.com or multi-level + /// foo.bar.contoso.com + /// - Unicode host names are allowed but are converted to Punycode for + /// matching. + /// + /// X-Forwarded-For + /// (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). /// The matching logic is .. - /// - If the property is null or empty (default), any forwarded-for chains (or lack of) are allowed. - /// - If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property. - /// + /// - If the property is null or empty (default), any forwarded-for + /// chains (or lack of) are allowed. + /// - If any address (excluding port number) in the chain (comma + /// separated) matches the CIDR defined by the property. + /// /// X-Azure-FDID and X-FD-HealthProbe. /// The matching logic is exact match. /// - public IDictionary> Headers { get; } + [JsonProperty(PropertyName = "headers")] + public IDictionary> Headers { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.Serialization.cs deleted file mode 100644 index 6d2fb67137fc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.Serialization.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class IssueTypeExtensions - { - public static string ToSerialString(this IssueType value) => value switch - { - IssueType.ServiceIncident => "ServiceIncident", - IssueType.AppDeployment => "AppDeployment", - IssueType.AppCrash => "AppCrash", - IssueType.RuntimeIssueDetected => "RuntimeIssueDetected", - IssueType.AseDeployment => "AseDeployment", - IssueType.UserIssue => "UserIssue", - IssueType.PlatformIssue => "PlatformIssue", - IssueType.Other => "Other", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IssueType value.") - }; - - public static IssueType ToIssueType(this string value) - { - if (string.Equals(value, "ServiceIncident", StringComparison.InvariantCultureIgnoreCase)) return IssueType.ServiceIncident; - if (string.Equals(value, "AppDeployment", StringComparison.InvariantCultureIgnoreCase)) return IssueType.AppDeployment; - if (string.Equals(value, "AppCrash", StringComparison.InvariantCultureIgnoreCase)) return IssueType.AppCrash; - if (string.Equals(value, "RuntimeIssueDetected", StringComparison.InvariantCultureIgnoreCase)) return IssueType.RuntimeIssueDetected; - if (string.Equals(value, "AseDeployment", StringComparison.InvariantCultureIgnoreCase)) return IssueType.AseDeployment; - if (string.Equals(value, "UserIssue", StringComparison.InvariantCultureIgnoreCase)) return IssueType.UserIssue; - if (string.Equals(value, "PlatformIssue", StringComparison.InvariantCultureIgnoreCase)) return IssueType.PlatformIssue; - if (string.Equals(value, "Other", StringComparison.InvariantCultureIgnoreCase)) return IssueType.Other; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IssueType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.cs index 0a972bec15d0..0d9046f443e5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IssueType.cs @@ -1,30 +1,96 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Represents the type of the Detector. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for IssueType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum IssueType { - /// ServiceIncident. + [EnumMember(Value = "ServiceIncident")] ServiceIncident, - /// AppDeployment. + [EnumMember(Value = "AppDeployment")] AppDeployment, - /// AppCrash. + [EnumMember(Value = "AppCrash")] AppCrash, - /// RuntimeIssueDetected. + [EnumMember(Value = "RuntimeIssueDetected")] RuntimeIssueDetected, - /// AseDeployment. + [EnumMember(Value = "AseDeployment")] AseDeployment, - /// UserIssue. + [EnumMember(Value = "UserIssue")] UserIssue, - /// PlatformIssue. + [EnumMember(Value = "PlatformIssue")] PlatformIssue, - /// Other. + [EnumMember(Value = "Other")] Other } + internal static class IssueTypeEnumExtension + { + internal static string ToSerializedValue(this IssueType? value) + { + return value == null ? null : ((IssueType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this IssueType value) + { + switch( value ) + { + case IssueType.ServiceIncident: + return "ServiceIncident"; + case IssueType.AppDeployment: + return "AppDeployment"; + case IssueType.AppCrash: + return "AppCrash"; + case IssueType.RuntimeIssueDetected: + return "RuntimeIssueDetected"; + case IssueType.AseDeployment: + return "AseDeployment"; + case IssueType.UserIssue: + return "UserIssue"; + case IssueType.PlatformIssue: + return "PlatformIssue"; + case IssueType.Other: + return "Other"; + } + return null; + } + + internal static IssueType? ParseIssueType(this string value) + { + switch( value ) + { + case "ServiceIncident": + return IssueType.ServiceIncident; + case "AppDeployment": + return IssueType.AppDeployment; + case "AppCrash": + return IssueType.AppCrash; + case "RuntimeIssueDetected": + return IssueType.RuntimeIssueDetected; + case "AseDeployment": + return IssueType.AseDeployment; + case "UserIssue": + return IssueType.UserIssue; + case "PlatformIssue": + return IssueType.PlatformIssue; + case "Other": + return IssueType.Other; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.Serialization.cs deleted file mode 100644 index 6f45c204f7f1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class JwtClaimChecks : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(AllowedGroups)) - { - writer.WritePropertyName("allowedGroups"); - writer.WriteStartArray(); - foreach (var item in AllowedGroups) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(AllowedClientApplications)) - { - writer.WritePropertyName("allowedClientApplications"); - writer.WriteStartArray(); - foreach (var item in AllowedClientApplications) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static JwtClaimChecks DeserializeJwtClaimChecks(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional> allowedGroups = default; - Optional> allowedClientApplications = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("allowedGroups")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedGroups = array; - continue; - } - if (property0.NameEquals("allowedClientApplications")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedClientApplications = array; - continue; - } - } - continue; - } - } - return new JwtClaimChecks(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(allowedGroups), Optional.ToList(allowedClientApplications)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.cs index aca4e7f827f6..b6ac7bf567d9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.cs @@ -1,41 +1,62 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// The configuration settings of the checks that should be made while validating the JWT Claims. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class JwtClaimChecks : ProxyOnlyResource { - /// Initializes a new instance of JwtClaimChecks. + /// + /// Initializes a new instance of the JwtClaimChecks class. + /// public JwtClaimChecks() { - AllowedGroups = new ChangeTrackingList(); - AllowedClientApplications = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of JwtClaimChecks. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The list of the allowed groups. - /// The list of the allowed client applications. - internal JwtClaimChecks(string id, string name, string kind, string type, IList allowedGroups, IList allowedClientApplications) : base(id, name, kind, type) + /// + /// Initializes a new instance of the JwtClaimChecks class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public JwtClaimChecks(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList allowedGroups = default(IList), IList allowedClientApplications = default(IList)) + : base(id, name, kind, type) { AllowedGroups = allowedGroups; AllowedClientApplications = allowedClientApplications; + CustomInit(); } - /// The list of the allowed groups. - public IList AllowedGroups { get; } - /// The list of the allowed client applications. - public IList AllowedClientApplications { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.allowedGroups")] + public IList AllowedGroups { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.allowedClientApplications")] + public IList AllowedClientApplications { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.Serialization.cs deleted file mode 100644 index cbf04eac502c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class KeyInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Value)) - { - writer.WritePropertyName("value"); - writer.WriteStringValue(Value); - } - writer.WriteEndObject(); - } - - internal static KeyInfo DeserializeKeyInfo(JsonElement element) - { - Optional name = default; - Optional value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("value")) - { - value = property.Value.GetString(); - continue; - } - } - return new KeyInfo(name.Value, value.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.cs index fd3fa9aa3608..e4ca47f4d7b4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyInfo.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Function key info. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Function key info. + /// public partial class KeyInfo { - /// Initializes a new instance of KeyInfo. + /// + /// Initializes a new instance of the KeyInfo class. + /// public KeyInfo() { + CustomInit(); } - /// Initializes a new instance of KeyInfo. - /// Key name. - /// Key value. - internal KeyInfo(string name, string value) + /// + /// Initializes a new instance of the KeyInfo class. + /// + /// Key name + /// Key value + public KeyInfo(string name = default(string), string value = default(string)) { Name = name; Value = value; + CustomInit(); } - /// Key name. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets key name + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// Key value. + + /// + /// Gets or sets key value + /// + [JsonProperty(PropertyName = "value")] public string Value { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.Serialization.cs deleted file mode 100644 index 63f7f2647bc7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.Serialization.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class KeyValuePairStringObject - { - internal static KeyValuePairStringObject DeserializeKeyValuePairStringObject(JsonElement element) - { - Optional key = default; - Optional value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("key")) - { - key = property.Value.GetString(); - continue; - } - if (property.NameEquals("value")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - value = property.Value.GetObject(); - continue; - } - } - return new KeyValuePairStringObject(key.Value, value.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs deleted file mode 100644 index 8a25ee32a27c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The KeyValuePairStringObject. - public partial class KeyValuePairStringObject - { - /// Initializes a new instance of KeyValuePairStringObject. - internal KeyValuePairStringObject() - { - } - - /// Initializes a new instance of KeyValuePairStringObject. - /// . - /// Any object. - internal KeyValuePairStringObject(string key, object value) - { - Key = key; - Value = value; - } - - public string Key { get; } - /// Any object. - public object Value { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.Serialization.cs deleted file mode 100644 index 6f94bf9a069f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class KeyVaultSecretStatusExtensions - { - public static string ToSerialString(this KeyVaultSecretStatus value) => value switch - { - KeyVaultSecretStatus.Initialized => "Initialized", - KeyVaultSecretStatus.WaitingOnCertificateOrder => "WaitingOnCertificateOrder", - KeyVaultSecretStatus.Succeeded => "Succeeded", - KeyVaultSecretStatus.CertificateOrderFailed => "CertificateOrderFailed", - KeyVaultSecretStatus.OperationNotPermittedOnKeyVault => "OperationNotPermittedOnKeyVault", - KeyVaultSecretStatus.AzureServiceUnauthorizedToAccessKeyVault => "AzureServiceUnauthorizedToAccessKeyVault", - KeyVaultSecretStatus.KeyVaultDoesNotExist => "KeyVaultDoesNotExist", - KeyVaultSecretStatus.KeyVaultSecretDoesNotExist => "KeyVaultSecretDoesNotExist", - KeyVaultSecretStatus.UnknownError => "UnknownError", - KeyVaultSecretStatus.ExternalPrivateKey => "ExternalPrivateKey", - KeyVaultSecretStatus.Unknown => "Unknown", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown KeyVaultSecretStatus value.") - }; - - public static KeyVaultSecretStatus ToKeyVaultSecretStatus(this string value) - { - if (string.Equals(value, "Initialized", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.Initialized; - if (string.Equals(value, "WaitingOnCertificateOrder", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.WaitingOnCertificateOrder; - if (string.Equals(value, "Succeeded", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.Succeeded; - if (string.Equals(value, "CertificateOrderFailed", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.CertificateOrderFailed; - if (string.Equals(value, "OperationNotPermittedOnKeyVault", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.OperationNotPermittedOnKeyVault; - if (string.Equals(value, "AzureServiceUnauthorizedToAccessKeyVault", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.AzureServiceUnauthorizedToAccessKeyVault; - if (string.Equals(value, "KeyVaultDoesNotExist", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.KeyVaultDoesNotExist; - if (string.Equals(value, "KeyVaultSecretDoesNotExist", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.KeyVaultSecretDoesNotExist; - if (string.Equals(value, "UnknownError", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.UnknownError; - if (string.Equals(value, "ExternalPrivateKey", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.ExternalPrivateKey; - if (string.Equals(value, "Unknown", StringComparison.InvariantCultureIgnoreCase)) return KeyVaultSecretStatus.Unknown; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown KeyVaultSecretStatus value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.cs index 3cadf09886d1..1befa3ff39e1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyVaultSecretStatus.cs @@ -1,36 +1,114 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Status of the Key Vault secret. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for KeyVaultSecretStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum KeyVaultSecretStatus { - /// Initialized. + [EnumMember(Value = "Initialized")] Initialized, - /// WaitingOnCertificateOrder. + [EnumMember(Value = "WaitingOnCertificateOrder")] WaitingOnCertificateOrder, - /// Succeeded. + [EnumMember(Value = "Succeeded")] Succeeded, - /// CertificateOrderFailed. + [EnumMember(Value = "CertificateOrderFailed")] CertificateOrderFailed, - /// OperationNotPermittedOnKeyVault. + [EnumMember(Value = "OperationNotPermittedOnKeyVault")] OperationNotPermittedOnKeyVault, - /// AzureServiceUnauthorizedToAccessKeyVault. + [EnumMember(Value = "AzureServiceUnauthorizedToAccessKeyVault")] AzureServiceUnauthorizedToAccessKeyVault, - /// KeyVaultDoesNotExist. + [EnumMember(Value = "KeyVaultDoesNotExist")] KeyVaultDoesNotExist, - /// KeyVaultSecretDoesNotExist. + [EnumMember(Value = "KeyVaultSecretDoesNotExist")] KeyVaultSecretDoesNotExist, - /// UnknownError. + [EnumMember(Value = "UnknownError")] UnknownError, - /// ExternalPrivateKey. + [EnumMember(Value = "ExternalPrivateKey")] ExternalPrivateKey, - /// Unknown. + [EnumMember(Value = "Unknown")] Unknown } + internal static class KeyVaultSecretStatusEnumExtension + { + internal static string ToSerializedValue(this KeyVaultSecretStatus? value) + { + return value == null ? null : ((KeyVaultSecretStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this KeyVaultSecretStatus value) + { + switch( value ) + { + case KeyVaultSecretStatus.Initialized: + return "Initialized"; + case KeyVaultSecretStatus.WaitingOnCertificateOrder: + return "WaitingOnCertificateOrder"; + case KeyVaultSecretStatus.Succeeded: + return "Succeeded"; + case KeyVaultSecretStatus.CertificateOrderFailed: + return "CertificateOrderFailed"; + case KeyVaultSecretStatus.OperationNotPermittedOnKeyVault: + return "OperationNotPermittedOnKeyVault"; + case KeyVaultSecretStatus.AzureServiceUnauthorizedToAccessKeyVault: + return "AzureServiceUnauthorizedToAccessKeyVault"; + case KeyVaultSecretStatus.KeyVaultDoesNotExist: + return "KeyVaultDoesNotExist"; + case KeyVaultSecretStatus.KeyVaultSecretDoesNotExist: + return "KeyVaultSecretDoesNotExist"; + case KeyVaultSecretStatus.UnknownError: + return "UnknownError"; + case KeyVaultSecretStatus.ExternalPrivateKey: + return "ExternalPrivateKey"; + case KeyVaultSecretStatus.Unknown: + return "Unknown"; + } + return null; + } + + internal static KeyVaultSecretStatus? ParseKeyVaultSecretStatus(this string value) + { + switch( value ) + { + case "Initialized": + return KeyVaultSecretStatus.Initialized; + case "WaitingOnCertificateOrder": + return KeyVaultSecretStatus.WaitingOnCertificateOrder; + case "Succeeded": + return KeyVaultSecretStatus.Succeeded; + case "CertificateOrderFailed": + return KeyVaultSecretStatus.CertificateOrderFailed; + case "OperationNotPermittedOnKeyVault": + return KeyVaultSecretStatus.OperationNotPermittedOnKeyVault; + case "AzureServiceUnauthorizedToAccessKeyVault": + return KeyVaultSecretStatus.AzureServiceUnauthorizedToAccessKeyVault; + case "KeyVaultDoesNotExist": + return KeyVaultSecretStatus.KeyVaultDoesNotExist; + case "KeyVaultSecretDoesNotExist": + return KeyVaultSecretStatus.KeyVaultSecretDoesNotExist; + case "UnknownError": + return KeyVaultSecretStatus.UnknownError; + case "ExternalPrivateKey": + return KeyVaultSecretStatus.ExternalPrivateKey; + case "Unknown": + return KeyVaultSecretStatus.Unknown; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.Serialization.cs deleted file mode 100644 index e51158533da4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class KubeEnvironmentProfile : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"); - writer.WriteStringValue(Id); - } - writer.WriteEndObject(); - } - - internal static KubeEnvironmentProfile DeserializeKubeEnvironmentProfile(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - } - return new KubeEnvironmentProfile(id.Value, name.Value, type.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs deleted file mode 100644 index a7f37fca158a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Specification for a Kubernetes Environment to use for this resource. - public partial class KubeEnvironmentProfile - { - /// Initializes a new instance of KubeEnvironmentProfile. - public KubeEnvironmentProfile() - { - } - - /// Initializes a new instance of KubeEnvironmentProfile. - /// Resource ID of the Kubernetes Environment. - /// Name of the Kubernetes Environment. - /// Resource type of the Kubernetes Environment. - internal KubeEnvironmentProfile(string id, string name, string type) - { - Id = id; - Name = name; - Type = type; - } - - /// Resource ID of the Kubernetes Environment. - public string Id { get; set; } - /// Name of the Kubernetes Environment. - public string Name { get; } - /// Resource type of the Kubernetes Environment. - public string Type { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.Serialization.cs deleted file mode 100644 index 047d5272b69a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class LegacyMicrosoftAccount : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(Registration)) - { - writer.WritePropertyName("registration"); - writer.WriteObjectValue(Registration); - } - if (Optional.IsDefined(Login)) - { - writer.WritePropertyName("login"); - writer.WriteObjectValue(Login); - } - if (Optional.IsDefined(Validation)) - { - writer.WritePropertyName("validation"); - writer.WriteObjectValue(Validation); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static LegacyMicrosoftAccount DeserializeLegacyMicrosoftAccount(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional registration = default; - Optional login = default; - Optional validation = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("registration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - registration = ClientRegistration.DeserializeClientRegistration(property0.Value); - continue; - } - if (property0.NameEquals("login")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - login = LoginScopes.DeserializeLoginScopes(property0.Value); - continue; - } - if (property0.NameEquals("validation")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - validation = AllowedAudiencesValidation.DeserializeAllowedAudiencesValidation(property0.Value); - continue; - } - } - continue; - } - } - return new LegacyMicrosoftAccount(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value, login.Value, validation.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs deleted file mode 100644 index 77ddbb4cedad..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The configuration settings of the legacy Microsoft Account provider. - public partial class LegacyMicrosoftAccount : ProxyOnlyResource - { - /// Initializes a new instance of LegacyMicrosoftAccount. - public LegacyMicrosoftAccount() - { - } - - /// Initializes a new instance of LegacyMicrosoftAccount. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>false</code> if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, <code>true</code>. - /// The configuration settings of the app registration for the legacy Microsoft Account provider. - /// The configuration settings of the login flow. - /// The configuration settings of the legacy Microsoft Account provider token validation flow. - internal LegacyMicrosoftAccount(string id, string name, string kind, string type, bool? enabled, ClientRegistration registration, LoginScopes login, AllowedAudiencesValidation validation) : base(id, name, kind, type) - { - Enabled = enabled; - Registration = registration; - Login = login; - Validation = validation; - } - - /// <code>false</code> if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, <code>true</code>. - public bool? Enabled { get; set; } - /// The configuration settings of the app registration for the legacy Microsoft Account provider. - public ClientRegistration Registration { get; set; } - /// The configuration settings of the login flow. - public LoginScopes Login { get; set; } - /// The configuration settings of the legacy Microsoft Account provider token validation flow. - public AllowedAudiencesValidation Validation { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.Serialization.cs deleted file mode 100644 index 64aca084c5aa..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.Serialization.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class LinuxJavaContainerSettings - { - internal static LinuxJavaContainerSettings DeserializeLinuxJavaContainerSettings(JsonElement element) - { - Optional java11Runtime = default; - Optional java8Runtime = default; - Optional isPreview = default; - Optional isDeprecated = default; - Optional isHidden = default; - Optional endOfLifeDate = default; - Optional isAutoUpdate = default; - Optional isEarlyAccess = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("java11Runtime")) - { - java11Runtime = property.Value.GetString(); - continue; - } - if (property.NameEquals("java8Runtime")) - { - java8Runtime = property.Value.GetString(); - continue; - } - if (property.NameEquals("isPreview")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isPreview = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isDeprecated")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isDeprecated = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isHidden")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isHidden = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("endOfLifeDate")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - endOfLifeDate = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("isAutoUpdate")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isAutoUpdate = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isEarlyAccess")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isEarlyAccess = property.Value.GetBoolean(); - continue; - } - } - return new LinuxJavaContainerSettings(java11Runtime.Value, java8Runtime.Value, Optional.ToNullable(isPreview), Optional.ToNullable(isDeprecated), Optional.ToNullable(isHidden), Optional.ToNullable(endOfLifeDate), Optional.ToNullable(isAutoUpdate), Optional.ToNullable(isEarlyAccess)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs deleted file mode 100644 index 7f024a995ae7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Linux Java Container settings. - public partial class LinuxJavaContainerSettings - { - /// Initializes a new instance of LinuxJavaContainerSettings. - internal LinuxJavaContainerSettings() - { - } - - /// Initializes a new instance of LinuxJavaContainerSettings. - /// Java 11 version (runtime only). - /// Java 8 version (runtime only). - /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. - /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. - /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. - /// End-of-life date for the minor version. - /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. - /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. - internal LinuxJavaContainerSettings(string java11Runtime, string java8Runtime, bool? isPreview, bool? isDeprecated, bool? isHidden, DateTimeOffset? endOfLifeDate, bool? isAutoUpdate, bool? isEarlyAccess) - { - Java11Runtime = java11Runtime; - Java8Runtime = java8Runtime; - IsPreview = isPreview; - IsDeprecated = isDeprecated; - IsHidden = isHidden; - EndOfLifeDate = endOfLifeDate; - IsAutoUpdate = isAutoUpdate; - IsEarlyAccess = isEarlyAccess; - } - - /// Java 11 version (runtime only). - public string Java11Runtime { get; } - /// Java 8 version (runtime only). - public string Java8Runtime { get; } - /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. - public bool? IsPreview { get; } - /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. - public bool? IsDeprecated { get; } - /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. - public bool? IsHidden { get; } - /// End-of-life date for the minor version. - public DateTimeOffset? EndOfLifeDate { get; } - /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. - public bool? IsAutoUpdate { get; } - /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. - public bool? IsEarlyAccess { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs index 756f1725959c..a4a9f849e4f9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs @@ -1,57 +1,24 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. - public readonly partial struct LoadBalancingMode : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public LoadBalancingMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string NoneValue = "None"; - private const string WebValue = "Web"; - private const string PublishingValue = "Publishing"; - private const string WebPublishingValue = "Web, Publishing"; - - /// None. - public static LoadBalancingMode None { get; } = new LoadBalancingMode(NoneValue); - /// Web. - public static LoadBalancingMode Web { get; } = new LoadBalancingMode(WebValue); - /// Publishing. - public static LoadBalancingMode Publishing { get; } = new LoadBalancingMode(PublishingValue); - /// Web, Publishing. - public static LoadBalancingMode WebPublishing { get; } = new LoadBalancingMode(WebPublishingValue); - /// Determines if two values are the same. - public static bool operator ==(LoadBalancingMode left, LoadBalancingMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(LoadBalancingMode left, LoadBalancingMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator LoadBalancingMode(string value) => new LoadBalancingMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is LoadBalancingMode other && Equals(other); - /// - public bool Equals(LoadBalancingMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for LoadBalancingMode. + /// + public static class LoadBalancingMode + { + public const string None = "None"; + public const string Web = "Web"; + public const string Publishing = "Publishing"; + public const string WebPublishing = "Web,Publishing"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.Serialization.cs deleted file mode 100644 index 09655b9c46f7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class LocalizableString - { - internal static LocalizableString DeserializeLocalizableString(JsonElement element) - { - Optional value = default; - Optional localizedValue = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - value = property.Value.GetString(); - continue; - } - if (property.NameEquals("localizedValue")) - { - localizedValue = property.Value.GetString(); - continue; - } - } - return new LocalizableString(value.Value, localizedValue.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.cs index 573fb4f798a9..508f794e803a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LocalizableString.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Localizable string object containing the name and a localized value. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Localizable string object containing the name and a localized value. + /// public partial class LocalizableString { - /// Initializes a new instance of LocalizableString. - internal LocalizableString() + /// + /// Initializes a new instance of the LocalizableString class. + /// + public LocalizableString() { + CustomInit(); } - /// Initializes a new instance of LocalizableString. - /// Non-localized name. - /// Localized name. - internal LocalizableString(string value, string localizedValue) + /// + /// Initializes a new instance of the LocalizableString class. + /// + /// Non-localized name. + /// Localized name. + public LocalizableString(string value = default(string), string localizedValue = default(string)) { Value = value; LocalizedValue = localizedValue; + CustomInit(); } - /// Non-localized name. - public string Value { get; } - /// Localized name. - public string LocalizedValue { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets non-localized name. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Gets or sets localized name. + /// + [JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.Serialization.cs deleted file mode 100644 index d942c6a5e7a1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class LogLevelExtensions - { - public static string ToSerialString(this LogLevel value) => value switch - { - LogLevel.Off => "Off", - LogLevel.Verbose => "Verbose", - LogLevel.Information => "Information", - LogLevel.Warning => "Warning", - LogLevel.Error => "Error", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown LogLevel value.") - }; - - public static LogLevel ToLogLevel(this string value) - { - if (string.Equals(value, "Off", StringComparison.InvariantCultureIgnoreCase)) return LogLevel.Off; - if (string.Equals(value, "Verbose", StringComparison.InvariantCultureIgnoreCase)) return LogLevel.Verbose; - if (string.Equals(value, "Information", StringComparison.InvariantCultureIgnoreCase)) return LogLevel.Information; - if (string.Equals(value, "Warning", StringComparison.InvariantCultureIgnoreCase)) return LogLevel.Warning; - if (string.Equals(value, "Error", StringComparison.InvariantCultureIgnoreCase)) return LogLevel.Error; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown LogLevel value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.cs index b0d8de98eb3c..189524b78a3b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogLevel.cs @@ -1,24 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Log level. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for LogLevel. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum LogLevel { - /// Off. + [EnumMember(Value = "Off")] Off, - /// Verbose. + [EnumMember(Value = "Verbose")] Verbose, - /// Information. + [EnumMember(Value = "Information")] Information, - /// Warning. + [EnumMember(Value = "Warning")] Warning, - /// Error. + [EnumMember(Value = "Error")] Error } + internal static class LogLevelEnumExtension + { + internal static string ToSerializedValue(this LogLevel? value) + { + return value == null ? null : ((LogLevel)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this LogLevel value) + { + switch( value ) + { + case LogLevel.Off: + return "Off"; + case LogLevel.Verbose: + return "Verbose"; + case LogLevel.Information: + return "Information"; + case LogLevel.Warning: + return "Warning"; + case LogLevel.Error: + return "Error"; + } + return null; + } + + internal static LogLevel? ParseLogLevel(this string value) + { + switch( value ) + { + case "Off": + return LogLevel.Off; + case "Verbose": + return LogLevel.Verbose; + case "Information": + return LogLevel.Information; + case "Warning": + return LogLevel.Warning; + case "Error": + return LogLevel.Error; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.Serialization.cs deleted file mode 100644 index fe8865291ea9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class LogSpecification - { - internal static LogSpecification DeserializeLogSpecification(JsonElement element) - { - Optional name = default; - Optional displayName = default; - Optional blobDuration = default; - Optional logFilterPattern = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("displayName")) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("blobDuration")) - { - blobDuration = property.Value.GetString(); - continue; - } - if (property.NameEquals("logFilterPattern")) - { - logFilterPattern = property.Value.GetString(); - continue; - } - } - return new LogSpecification(name.Value, displayName.Value, blobDuration.Value, logFilterPattern.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.cs index 9b0e9ced4d26..3fe115f18908 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LogSpecification.cs @@ -1,36 +1,67 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Log Definition of a single resource metric. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Log Definition of a single resource metric. + /// public partial class LogSpecification { - /// Initializes a new instance of LogSpecification. - internal LogSpecification() + /// + /// Initializes a new instance of the LogSpecification class. + /// + public LogSpecification() { + CustomInit(); } - /// Initializes a new instance of LogSpecification. - /// . - /// . - /// . - /// . - internal LogSpecification(string name, string displayName, string blobDuration, string logFilterPattern) + /// + /// Initializes a new instance of the LogSpecification class. + /// + public LogSpecification(string name = default(string), string displayName = default(string), string blobDuration = default(string), string logFilterPattern = default(string)) { Name = name; DisplayName = displayName; BlobDuration = blobDuration; LogFilterPattern = logFilterPattern; + CustomInit(); } - public string Name { get; } - public string DisplayName { get; } - public string BlobDuration { get; } - public string LogFilterPattern { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// + [JsonProperty(PropertyName = "blobDuration")] + public string BlobDuration { get; set; } + + /// + /// + [JsonProperty(PropertyName = "logFilterPattern")] + public string LogFilterPattern { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.Serialization.cs deleted file mode 100644 index 60d5eea2c0a1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.Serialization.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Login : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Routes)) - { - writer.WritePropertyName("routes"); - writer.WriteObjectValue(Routes); - } - if (Optional.IsDefined(TokenStore)) - { - writer.WritePropertyName("tokenStore"); - writer.WriteObjectValue(TokenStore); - } - if (Optional.IsDefined(PreserveUrlFragmentsForLogins)) - { - writer.WritePropertyName("preserveUrlFragmentsForLogins"); - writer.WriteBooleanValue(PreserveUrlFragmentsForLogins.Value); - } - if (Optional.IsCollectionDefined(AllowedExternalRedirectUrls)) - { - writer.WritePropertyName("allowedExternalRedirectUrls"); - writer.WriteStartArray(); - foreach (var item in AllowedExternalRedirectUrls) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(CookieExpiration)) - { - writer.WritePropertyName("cookieExpiration"); - writer.WriteObjectValue(CookieExpiration); - } - if (Optional.IsDefined(Nonce)) - { - writer.WritePropertyName("nonce"); - writer.WriteObjectValue(Nonce); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Login DeserializeLogin(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional routes = default; - Optional tokenStore = default; - Optional preserveUrlFragmentsForLogins = default; - Optional> allowedExternalRedirectUrls = default; - Optional cookieExpiration = default; - Optional nonce = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("routes")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - routes = LoginRoutes.DeserializeLoginRoutes(property0.Value); - continue; - } - if (property0.NameEquals("tokenStore")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - tokenStore = TokenStore.DeserializeTokenStore(property0.Value); - continue; - } - if (property0.NameEquals("preserveUrlFragmentsForLogins")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - preserveUrlFragmentsForLogins = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("allowedExternalRedirectUrls")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedExternalRedirectUrls = array; - continue; - } - if (property0.NameEquals("cookieExpiration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - cookieExpiration = CookieExpiration.DeserializeCookieExpiration(property0.Value); - continue; - } - if (property0.NameEquals("nonce")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - nonce = Nonce.DeserializeNonce(property0.Value); - continue; - } - } - continue; - } - } - return new Login(id.Value, name.Value, kind.Value, type.Value, routes.Value, tokenStore.Value, Optional.ToNullable(preserveUrlFragmentsForLogins), Optional.ToList(allowedExternalRedirectUrls), cookieExpiration.Value, nonce.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.cs index 9945eff10029..d14e1bc90117 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.cs @@ -1,40 +1,42 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// The configuration settings of the login flow of users using App Service Authentication/Authorization. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class Login : ProxyOnlyResource { - /// Initializes a new instance of Login. + /// + /// Initializes a new instance of the Login class. + /// public Login() { - AllowedExternalRedirectUrls = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of Login. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The routes that specify the endpoints used for login and logout requests. - /// The configuration settings of the token store. - /// <code>true</code> if the fragments from the request are preserved after the login request is made; otherwise, <code>false</code>. - /// - /// External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. - /// This is an advanced setting typically only needed by Windows Store application backends. - /// Note that URLs within the current domain are always implicitly allowed. - /// - /// The configuration settings of the session cookie's expiration. - /// The configuration settings of the nonce used in the login flow. - internal Login(string id, string name, string kind, string type, LoginRoutes routes, TokenStore tokenStore, bool? preserveUrlFragmentsForLogins, IList allowedExternalRedirectUrls, CookieExpiration cookieExpiration, Nonce nonce) : base(id, name, kind, type) + /// + /// Initializes a new instance of the Login class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public Login(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), LoginRoutes routes = default(LoginRoutes), TokenStore tokenStore = default(TokenStore), bool? preserveUrlFragmentsForLogins = default(bool?), IList allowedExternalRedirectUrls = default(IList), CookieExpiration cookieExpiration = default(CookieExpiration), Nonce nonce = default(Nonce)) + : base(id, name, kind, type) { Routes = routes; TokenStore = tokenStore; @@ -42,23 +44,43 @@ internal Login(string id, string name, string kind, string type, LoginRoutes rou AllowedExternalRedirectUrls = allowedExternalRedirectUrls; CookieExpiration = cookieExpiration; Nonce = nonce; + CustomInit(); } - /// The routes that specify the endpoints used for login and logout requests. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.routes")] public LoginRoutes Routes { get; set; } - /// The configuration settings of the token store. + + /// + /// + [JsonProperty(PropertyName = "properties.tokenStore")] public TokenStore TokenStore { get; set; } - /// <code>true</code> if the fragments from the request are preserved after the login request is made; otherwise, <code>false</code>. + + /// + /// + [JsonProperty(PropertyName = "properties.preserveUrlFragmentsForLogins")] public bool? PreserveUrlFragmentsForLogins { get; set; } + /// - /// External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. - /// This is an advanced setting typically only needed by Windows Store application backends. - /// Note that URLs within the current domain are always implicitly allowed. /// - public IList AllowedExternalRedirectUrls { get; } - /// The configuration settings of the session cookie's expiration. + [JsonProperty(PropertyName = "properties.allowedExternalRedirectUrls")] + public IList AllowedExternalRedirectUrls { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.cookieExpiration")] public CookieExpiration CookieExpiration { get; set; } - /// The configuration settings of the nonce used in the login flow. + + /// + /// + [JsonProperty(PropertyName = "properties.nonce")] public Nonce Nonce { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.Serialization.cs deleted file mode 100644 index 45b64c605b52..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class LoginRoutes : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(LogoutEndpoint)) - { - writer.WritePropertyName("logoutEndpoint"); - writer.WriteStringValue(LogoutEndpoint); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static LoginRoutes DeserializeLoginRoutes(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional logoutEndpoint = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("logoutEndpoint")) - { - logoutEndpoint = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new LoginRoutes(id.Value, name.Value, kind.Value, type.Value, logoutEndpoint.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.cs index 3bc9d90bbb5a..9b31fe5653bb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.cs @@ -1,32 +1,54 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The routes that specify the endpoints used for login and logout requests. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class LoginRoutes : ProxyOnlyResource { - /// Initializes a new instance of LoginRoutes. + /// + /// Initializes a new instance of the LoginRoutes class. + /// public LoginRoutes() { + CustomInit(); } - /// Initializes a new instance of LoginRoutes. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The endpoint at which a logout request should be made. - internal LoginRoutes(string id, string name, string kind, string type, string logoutEndpoint) : base(id, name, kind, type) + /// + /// Initializes a new instance of the LoginRoutes class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public LoginRoutes(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string logoutEndpoint = default(string)) + : base(id, name, kind, type) { LogoutEndpoint = logoutEndpoint; + CustomInit(); } - /// The endpoint at which a logout request should be made. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.logoutEndpoint")] public string LogoutEndpoint { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.Serialization.cs deleted file mode 100644 index 9251c385a69e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class LoginScopes : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Scopes)) - { - writer.WritePropertyName("scopes"); - writer.WriteStartArray(); - foreach (var item in Scopes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static LoginScopes DeserializeLoginScopes(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional> scopes = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("scopes")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - scopes = array; - continue; - } - } - continue; - } - } - return new LoginScopes(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(scopes)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.cs index 893ef7c100e0..ec2430e910eb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.cs @@ -1,36 +1,56 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// The configuration settings of the login flow, including the scopes that should be requested. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class LoginScopes : ProxyOnlyResource { - /// Initializes a new instance of LoginScopes. + /// + /// Initializes a new instance of the LoginScopes class. + /// public LoginScopes() { - Scopes = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of LoginScopes. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// A list of the scopes that should be requested while authenticating. - internal LoginScopes(string id, string name, string kind, string type, IList scopes) : base(id, name, kind, type) + /// + /// Initializes a new instance of the LoginScopes class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public LoginScopes(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList scopes = default(IList)) + : base(id, name, kind, type) { Scopes = scopes; + CustomInit(); } - /// A list of the scopes that should be requested while authenticating. - public IList Scopes { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.scopes")] + public IList Scopes { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.Serialization.cs deleted file mode 100644 index d78a3ee0d26e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.Serialization.cs +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class MSDeploy : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(PackageUri)) - { - writer.WritePropertyName("packageUri"); - writer.WriteStringValue(PackageUri); - } - if (Optional.IsDefined(ConnectionString)) - { - writer.WritePropertyName("connectionString"); - writer.WriteStringValue(ConnectionString); - } - if (Optional.IsDefined(DbType)) - { - writer.WritePropertyName("dbType"); - writer.WriteStringValue(DbType); - } - if (Optional.IsDefined(SetParametersXmlFileUri)) - { - writer.WritePropertyName("setParametersXmlFileUri"); - writer.WriteStringValue(SetParametersXmlFileUri); - } - if (Optional.IsCollectionDefined(SetParameters)) - { - writer.WritePropertyName("setParameters"); - writer.WriteStartObject(); - foreach (var item in SetParameters) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(SkipAppData)) - { - writer.WritePropertyName("skipAppData"); - writer.WriteBooleanValue(SkipAppData.Value); - } - if (Optional.IsDefined(AppOffline)) - { - writer.WritePropertyName("appOffline"); - writer.WriteBooleanValue(AppOffline.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static MSDeploy DeserializeMSDeploy(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional packageUri = default; - Optional connectionString = default; - Optional dbType = default; - Optional setParametersXmlFileUri = default; - Optional> setParameters = default; - Optional skipAppData = default; - Optional appOffline = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("packageUri")) - { - packageUri = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("connectionString")) - { - connectionString = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("dbType")) - { - dbType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("setParametersXmlFileUri")) - { - setParametersXmlFileUri = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("setParameters")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetString()); - } - setParameters = dictionary; - continue; - } - if (property0.NameEquals("skipAppData")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - skipAppData = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("appOffline")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - appOffline = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new MSDeploy(id.Value, name.Value, kind.Value, type.Value, packageUri.Value, connectionString.Value, dbType.Value, setParametersXmlFileUri.Value, Optional.ToDictionary(setParameters), Optional.ToNullable(skipAppData), Optional.ToNullable(appOffline)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.cs index 058a4795b321..2a601fc13092 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeploy.cs @@ -1,45 +1,62 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// MSDeploy ARM PUT information. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// MSDeploy ARM PUT information + /// + [Rest.Serialization.JsonTransformation] public partial class MSDeploy : ProxyOnlyResource { - /// Initializes a new instance of MSDeploy. + /// + /// Initializes a new instance of the MSDeploy class. + /// public MSDeploy() { - SetParameters = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of MSDeploy. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Package URI. - /// SQL Connection String. - /// Database Type. - /// URI of MSDeploy Parameters file. Must not be set if SetParameters is used. - /// MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. - /// - /// Controls whether the MSDeploy operation skips the App_Data directory. - /// If set to <code>true</code>, the existing App_Data directory on the destination - /// will not be deleted, and any App_Data directory in the source will be ignored. - /// Setting is <code>false</code> by default. - /// - /// - /// Sets the AppOffline rule while the MSDeploy operation executes. - /// Setting is <code>false</code> by default. - /// - internal MSDeploy(string id, string name, string kind, string type, string packageUri, string connectionString, string dbType, string setParametersXmlFileUri, IDictionary setParameters, bool? skipAppData, bool? appOffline) : base(id, name, kind, type) + /// + /// Initializes a new instance of the MSDeploy class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Package URI + /// SQL Connection String + /// Database Type + /// URI of MSDeploy Parameters + /// file. Must not be set if SetParameters is used. + /// MSDeploy Parameters. Must not be set if + /// SetParametersXmlFileUri is used. + /// Controls whether the MSDeploy operation + /// skips the App_Data directory. + /// If set to <code>true</code>, the existing App_Data + /// directory on the destination + /// will not be deleted, and any App_Data directory in the source will + /// be ignored. + /// Setting is <code>false</code> by default. + /// Sets the AppOffline rule while the + /// MSDeploy operation executes. + /// Setting is <code>false</code> by default. + public MSDeploy(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string packageUri = default(string), string connectionString = default(string), string dbType = default(string), string setParametersXmlFileUri = default(string), IDictionary setParameters = default(IDictionary), bool? skipAppData = default(bool?), bool? appOffline = default(bool?)) + : base(id, name, kind, type) { PackageUri = packageUri; ConnectionString = connectionString; @@ -48,29 +65,67 @@ internal MSDeploy(string id, string name, string kind, string type, string packa SetParameters = setParameters; SkipAppData = skipAppData; AppOffline = appOffline; + CustomInit(); } - /// Package URI. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets package URI + /// + [JsonProperty(PropertyName = "properties.packageUri")] public string PackageUri { get; set; } - /// SQL Connection String. + + /// + /// Gets or sets SQL Connection String + /// + [JsonProperty(PropertyName = "properties.connectionString")] public string ConnectionString { get; set; } - /// Database Type. + + /// + /// Gets or sets database Type + /// + [JsonProperty(PropertyName = "properties.dbType")] public string DbType { get; set; } - /// URI of MSDeploy Parameters file. Must not be set if SetParameters is used. + + /// + /// Gets or sets URI of MSDeploy Parameters file. Must not be set if + /// SetParameters is used. + /// + [JsonProperty(PropertyName = "properties.setParametersXmlFileUri")] public string SetParametersXmlFileUri { get; set; } - /// MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. - public IDictionary SetParameters { get; } + /// - /// Controls whether the MSDeploy operation skips the App_Data directory. - /// If set to <code>true</code>, the existing App_Data directory on the destination - /// will not be deleted, and any App_Data directory in the source will be ignored. - /// Setting is <code>false</code> by default. + /// Gets or sets mSDeploy Parameters. Must not be set if + /// SetParametersXmlFileUri is used. /// + [JsonProperty(PropertyName = "properties.setParameters")] + public IDictionary SetParameters { get; set; } + + /// + /// Gets or sets controls whether the MSDeploy operation skips the + /// App_Data directory. + /// If set to &lt;code&gt;true&lt;/code&gt;, the + /// existing App_Data directory on the destination + /// will not be deleted, and any App_Data directory in the source will + /// be ignored. + /// Setting is &lt;code&gt;false&lt;/code&gt; by + /// default. + /// + [JsonProperty(PropertyName = "properties.skipAppData")] public bool? SkipAppData { get; set; } + /// - /// Sets the AppOffline rule while the MSDeploy operation executes. - /// Setting is <code>false</code> by default. + /// Gets or sets sets the AppOffline rule while the MSDeploy operation + /// executes. + /// Setting is &lt;code&gt;false&lt;/code&gt; by + /// default. /// + [JsonProperty(PropertyName = "properties.appOffline")] public bool? AppOffline { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.Serialization.cs deleted file mode 100644 index 161d482259fe..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.Serialization.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class MSDeployLog : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static MSDeployLog DeserializeMSDeployLog(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional> entries = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("entries")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(MSDeployLogEntry.DeserializeMSDeployLogEntry(item)); - } - entries = array; - continue; - } - } - continue; - } - } - return new MSDeployLog(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(entries)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.cs index 39c0b77588d5..b98032e54b1e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLog.cs @@ -1,36 +1,61 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// MSDeploy log. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// MSDeploy log + /// + [Rest.Serialization.JsonTransformation] public partial class MSDeployLog : ProxyOnlyResource { - /// Initializes a new instance of MSDeployLog. + /// + /// Initializes a new instance of the MSDeployLog class. + /// public MSDeployLog() { - Entries = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of MSDeployLog. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// List of log entry messages. - internal MSDeployLog(string id, string name, string kind, string type, IReadOnlyList entries) : base(id, name, kind, type) + /// + /// Initializes a new instance of the MSDeployLog class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// List of log entry messages + public MSDeployLog(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList entries = default(IList)) + : base(id, name, kind, type) { Entries = entries; + CustomInit(); } - /// List of log entry messages. - public IReadOnlyList Entries { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets list of log entry messages + /// + [JsonProperty(PropertyName = "properties.entries")] + public IList Entries { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.Serialization.cs deleted file mode 100644 index c2aa3b7e6a66..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class MSDeployLogEntry - { - internal static MSDeployLogEntry DeserializeMSDeployLogEntry(JsonElement element) - { - Optional time = default; - Optional type = default; - Optional message = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("time")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - time = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("type")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = property.Value.GetString().ToMSDeployLogEntryType(); - continue; - } - if (property.NameEquals("message")) - { - message = property.Value.GetString(); - continue; - } - } - return new MSDeployLogEntry(Optional.ToNullable(time), Optional.ToNullable(type), message.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.cs index 59cafa26c97c..f8fa05c9d688 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntry.cs @@ -1,38 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// MSDeploy log entry. + using Newtonsoft.Json; + using System.Linq; + + /// + /// MSDeploy log entry + /// public partial class MSDeployLogEntry { - /// Initializes a new instance of MSDeployLogEntry. - internal MSDeployLogEntry() + /// + /// Initializes a new instance of the MSDeployLogEntry class. + /// + public MSDeployLogEntry() { + CustomInit(); } - /// Initializes a new instance of MSDeployLogEntry. - /// Timestamp of log entry. - /// Log entry type. - /// Log entry message. - internal MSDeployLogEntry(DateTimeOffset? time, MSDeployLogEntryType? type, string message) + /// + /// Initializes a new instance of the MSDeployLogEntry class. + /// + /// Timestamp of log entry + /// Log entry type. Possible values include: + /// 'Message', 'Warning', 'Error' + /// Log entry message + public MSDeployLogEntry(System.DateTime? time = default(System.DateTime?), MSDeployLogEntryType? type = default(MSDeployLogEntryType?), string message = default(string)) { Time = time; Type = type; Message = message; + CustomInit(); } - /// Timestamp of log entry. - public DateTimeOffset? Time { get; } - /// Log entry type. - public MSDeployLogEntryType? Type { get; } - /// Log entry message. - public string Message { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets timestamp of log entry + /// + [JsonProperty(PropertyName = "time")] + public System.DateTime? Time { get; private set; } + + /// + /// Gets log entry type. Possible values include: 'Message', 'Warning', + /// 'Error' + /// + [JsonProperty(PropertyName = "type")] + public MSDeployLogEntryType? Type { get; private set; } + + /// + /// Gets log entry message + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.Serialization.cs deleted file mode 100644 index 67924e072fca..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class MSDeployLogEntryTypeExtensions - { - public static string ToSerialString(this MSDeployLogEntryType value) => value switch - { - MSDeployLogEntryType.Message => "Message", - MSDeployLogEntryType.Warning => "Warning", - MSDeployLogEntryType.Error => "Error", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MSDeployLogEntryType value.") - }; - - public static MSDeployLogEntryType ToMSDeployLogEntryType(this string value) - { - if (string.Equals(value, "Message", StringComparison.InvariantCultureIgnoreCase)) return MSDeployLogEntryType.Message; - if (string.Equals(value, "Warning", StringComparison.InvariantCultureIgnoreCase)) return MSDeployLogEntryType.Warning; - if (string.Equals(value, "Error", StringComparison.InvariantCultureIgnoreCase)) return MSDeployLogEntryType.Error; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MSDeployLogEntryType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.cs index e659496b0477..aabc6ea359b2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployLogEntryType.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Log entry type. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for MSDeployLogEntryType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum MSDeployLogEntryType { - /// Message. + [EnumMember(Value = "Message")] Message, - /// Warning. + [EnumMember(Value = "Warning")] Warning, - /// Error. + [EnumMember(Value = "Error")] Error } + internal static class MSDeployLogEntryTypeEnumExtension + { + internal static string ToSerializedValue(this MSDeployLogEntryType? value) + { + return value == null ? null : ((MSDeployLogEntryType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this MSDeployLogEntryType value) + { + switch( value ) + { + case MSDeployLogEntryType.Message: + return "Message"; + case MSDeployLogEntryType.Warning: + return "Warning"; + case MSDeployLogEntryType.Error: + return "Error"; + } + return null; + } + + internal static MSDeployLogEntryType? ParseMSDeployLogEntryType(this string value) + { + switch( value ) + { + case "Message": + return MSDeployLogEntryType.Message; + case "Warning": + return MSDeployLogEntryType.Warning; + case "Error": + return MSDeployLogEntryType.Error; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.Serialization.cs deleted file mode 100644 index b1852953b302..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class MSDeployProvisioningStateExtensions - { - public static string ToSerialString(this MSDeployProvisioningState value) => value switch - { - MSDeployProvisioningState.Accepted => "accepted", - MSDeployProvisioningState.Running => "running", - MSDeployProvisioningState.Succeeded => "succeeded", - MSDeployProvisioningState.Failed => "failed", - MSDeployProvisioningState.Canceled => "canceled", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MSDeployProvisioningState value.") - }; - - public static MSDeployProvisioningState ToMSDeployProvisioningState(this string value) - { - if (string.Equals(value, "accepted", StringComparison.InvariantCultureIgnoreCase)) return MSDeployProvisioningState.Accepted; - if (string.Equals(value, "running", StringComparison.InvariantCultureIgnoreCase)) return MSDeployProvisioningState.Running; - if (string.Equals(value, "succeeded", StringComparison.InvariantCultureIgnoreCase)) return MSDeployProvisioningState.Succeeded; - if (string.Equals(value, "failed", StringComparison.InvariantCultureIgnoreCase)) return MSDeployProvisioningState.Failed; - if (string.Equals(value, "canceled", StringComparison.InvariantCultureIgnoreCase)) return MSDeployProvisioningState.Canceled; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MSDeployProvisioningState value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.cs index d7f1ce299849..80c9344125eb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployProvisioningState.cs @@ -1,24 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Provisioning state. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for MSDeployProvisioningState. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum MSDeployProvisioningState { - /// accepted. + [EnumMember(Value = "accepted")] Accepted, - /// running. + [EnumMember(Value = "running")] Running, - /// succeeded. + [EnumMember(Value = "succeeded")] Succeeded, - /// failed. + [EnumMember(Value = "failed")] Failed, - /// canceled. + [EnumMember(Value = "canceled")] Canceled } + internal static class MSDeployProvisioningStateEnumExtension + { + internal static string ToSerializedValue(this MSDeployProvisioningState? value) + { + return value == null ? null : ((MSDeployProvisioningState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this MSDeployProvisioningState value) + { + switch( value ) + { + case MSDeployProvisioningState.Accepted: + return "accepted"; + case MSDeployProvisioningState.Running: + return "running"; + case MSDeployProvisioningState.Succeeded: + return "succeeded"; + case MSDeployProvisioningState.Failed: + return "failed"; + case MSDeployProvisioningState.Canceled: + return "canceled"; + } + return null; + } + + internal static MSDeployProvisioningState? ParseMSDeployProvisioningState(this string value) + { + switch( value ) + { + case "accepted": + return MSDeployProvisioningState.Accepted; + case "running": + return MSDeployProvisioningState.Running; + case "succeeded": + return MSDeployProvisioningState.Succeeded; + case "failed": + return MSDeployProvisioningState.Failed; + case "canceled": + return MSDeployProvisioningState.Canceled; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.Serialization.cs deleted file mode 100644 index 85ee27b63717..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.Serialization.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class MSDeployStatus : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static MSDeployStatus DeserializeMSDeployStatus(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional deployer = default; - Optional provisioningState = default; - Optional startTime = default; - Optional endTime = default; - Optional complete = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("deployer")) - { - deployer = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = property0.Value.GetString().ToMSDeployProvisioningState(); - continue; - } - if (property0.NameEquals("startTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("endTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - endTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("complete")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - complete = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new MSDeployStatus(id.Value, name.Value, kind.Value, type.Value, deployer.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToNullable(complete)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.cs index c23f316e6012..32175ea1230d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MSDeployStatus.cs @@ -1,50 +1,95 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// MSDeploy ARM response. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// MSDeploy ARM response + /// + [Rest.Serialization.JsonTransformation] public partial class MSDeployStatus : ProxyOnlyResource { - /// Initializes a new instance of MSDeployStatus. + /// + /// Initializes a new instance of the MSDeployStatus class. + /// public MSDeployStatus() { + CustomInit(); } - /// Initializes a new instance of MSDeployStatus. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Username of deployer. - /// Provisioning state. - /// Start time of deploy operation. - /// End time of deploy operation. - /// Whether the deployment operation has completed. - internal MSDeployStatus(string id, string name, string kind, string type, string deployer, MSDeployProvisioningState? provisioningState, DateTimeOffset? startTime, DateTimeOffset? endTime, bool? complete) : base(id, name, kind, type) + /// + /// Initializes a new instance of the MSDeployStatus class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Username of deployer + /// Provisioning state. Possible values + /// include: 'accepted', 'running', 'succeeded', 'failed', + /// 'canceled' + /// Start time of deploy operation + /// End time of deploy operation + /// Whether the deployment operation has + /// completed + public MSDeployStatus(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string deployer = default(string), MSDeployProvisioningState? provisioningState = default(MSDeployProvisioningState?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), bool? complete = default(bool?)) + : base(id, name, kind, type) { Deployer = deployer; ProvisioningState = provisioningState; StartTime = startTime; EndTime = endTime; Complete = complete; + CustomInit(); } - /// Username of deployer. - public string Deployer { get; } - /// Provisioning state. - public MSDeployProvisioningState? ProvisioningState { get; } - /// Start time of deploy operation. - public DateTimeOffset? StartTime { get; } - /// End time of deploy operation. - public DateTimeOffset? EndTime { get; } - /// Whether the deployment operation has completed. - public bool? Complete { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets username of deployer + /// + [JsonProperty(PropertyName = "properties.deployer")] + public string Deployer { get; private set; } + + /// + /// Gets provisioning state. Possible values include: 'accepted', + /// 'running', 'succeeded', 'failed', 'canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public MSDeployProvisioningState? ProvisioningState { get; private set; } + + /// + /// Gets start time of deploy operation + /// + [JsonProperty(PropertyName = "properties.startTime")] + public System.DateTime? StartTime { get; private set; } + + /// + /// Gets end time of deploy operation + /// + [JsonProperty(PropertyName = "properties.endTime")] + public System.DateTime? EndTime { get; private set; } + + /// + /// Gets whether the deployment operation has completed + /// + [JsonProperty(PropertyName = "properties.complete")] + public bool? Complete { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.Serialization.cs deleted file mode 100644 index 662ec831c275..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class ManagedPipelineModeExtensions - { - public static string ToSerialString(this ManagedPipelineMode value) => value switch - { - ManagedPipelineMode.Integrated => "Integrated", - ManagedPipelineMode.Classic => "Classic", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedPipelineMode value.") - }; - - public static ManagedPipelineMode ToManagedPipelineMode(this string value) - { - if (string.Equals(value, "Integrated", StringComparison.InvariantCultureIgnoreCase)) return ManagedPipelineMode.Integrated; - if (string.Equals(value, "Classic", StringComparison.InvariantCultureIgnoreCase)) return ManagedPipelineMode.Classic; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedPipelineMode value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.cs index 561a080ea51f..8eca0a3c40b3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedPipelineMode.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Managed pipeline mode. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ManagedPipelineMode. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum ManagedPipelineMode { - /// Integrated. + [EnumMember(Value = "Integrated")] Integrated, - /// Classic. + [EnumMember(Value = "Classic")] Classic } + internal static class ManagedPipelineModeEnumExtension + { + internal static string ToSerializedValue(this ManagedPipelineMode? value) + { + return value == null ? null : ((ManagedPipelineMode)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ManagedPipelineMode value) + { + switch( value ) + { + case ManagedPipelineMode.Integrated: + return "Integrated"; + case ManagedPipelineMode.Classic: + return "Classic"; + } + return null; + } + + internal static ManagedPipelineMode? ParseManagedPipelineMode(this string value) + { + switch( value ) + { + case "Integrated": + return ManagedPipelineMode.Integrated; + case "Classic": + return ManagedPipelineMode.Classic; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.Serialization.cs deleted file mode 100644 index ea931763339f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.Serialization.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ManagedServiceIdentity : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Type)) - { - writer.WritePropertyName("type"); - writer.WriteStringValue(Type.Value.ToSerialString()); - } - if (Optional.IsCollectionDefined(UserAssignedIdentities)) - { - writer.WritePropertyName("userAssignedIdentities"); - writer.WriteStartObject(); - foreach (var item in UserAssignedIdentities) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - - internal static ManagedServiceIdentity DeserializeManagedServiceIdentity(JsonElement element) - { - Optional type = default; - Optional tenantId = default; - Optional principalId = default; - Optional> userAssignedIdentities = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = property.Value.GetString().ToManagedServiceIdentityType(); - continue; - } - if (property.NameEquals("tenantId")) - { - tenantId = property.Value.GetString(); - continue; - } - if (property.NameEquals("principalId")) - { - principalId = property.Value.GetString(); - continue; - } - if (property.NameEquals("userAssignedIdentities")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.DeserializeComponents1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(property0.Value)); - } - userAssignedIdentities = dictionary; - continue; - } - } - return new ManagedServiceIdentity(Optional.ToNullable(type), tenantId.Value, principalId.Value, Optional.ToDictionary(userAssignedIdentities)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.cs index 6e7d73c3337f..2063a4bd6055 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentity.cs @@ -1,44 +1,88 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Managed service identity. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Managed service identity. + /// public partial class ManagedServiceIdentity { - /// Initializes a new instance of ManagedServiceIdentity. + /// + /// Initializes a new instance of the ManagedServiceIdentity class. + /// public ManagedServiceIdentity() { - UserAssignedIdentities = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of ManagedServiceIdentity. - /// Type of managed service identity. - /// Tenant of managed service identity. - /// Principal Id of managed service identity. - /// The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - internal ManagedServiceIdentity(ManagedServiceIdentityType? type, string tenantId, string principalId, IDictionary userAssignedIdentities) + /// + /// Initializes a new instance of the ManagedServiceIdentity class. + /// + /// Type of managed service identity. Possible + /// values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' + /// Tenant of managed service identity. + /// Principal Id of managed service + /// identity. + /// The list of user assigned + /// identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} + public ManagedServiceIdentity(ManagedServiceIdentityType? type = default(ManagedServiceIdentityType?), string tenantId = default(string), string principalId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) { Type = type; TenantId = tenantId; PrincipalId = principalId; UserAssignedIdentities = userAssignedIdentities; + CustomInit(); } - /// Type of managed service identity. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of managed service identity. Possible values + /// include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' + /// + [JsonProperty(PropertyName = "type")] public ManagedServiceIdentityType? Type { get; set; } - /// Tenant of managed service identity. - public string TenantId { get; } - /// Principal Id of managed service identity. - public string PrincipalId { get; } - /// The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - public IDictionary UserAssignedIdentities { get; } + + /// + /// Gets tenant of managed service identity. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets principal Id of managed service identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets or sets the list of user assigned identities associated with + /// the resource. The user identity dictionary key references will be + /// ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs deleted file mode 100644 index 6843ff70535d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.Serialization.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class ManagedServiceIdentityTypeExtensions - { - public static string ToSerialString(this ManagedServiceIdentityType value) => value switch - { - ManagedServiceIdentityType.SystemAssigned => "SystemAssigned", - ManagedServiceIdentityType.UserAssigned => "UserAssigned", - ManagedServiceIdentityType.SystemAssignedUserAssigned => "SystemAssigned, UserAssigned", - ManagedServiceIdentityType.None => "None", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedServiceIdentityType value.") - }; - - public static ManagedServiceIdentityType ToManagedServiceIdentityType(this string value) - { - if (string.Equals(value, "SystemAssigned", StringComparison.InvariantCultureIgnoreCase)) return ManagedServiceIdentityType.SystemAssigned; - if (string.Equals(value, "UserAssigned", StringComparison.InvariantCultureIgnoreCase)) return ManagedServiceIdentityType.UserAssigned; - if (string.Equals(value, "SystemAssigned, UserAssigned", StringComparison.InvariantCultureIgnoreCase)) return ManagedServiceIdentityType.SystemAssignedUserAssigned; - if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return ManagedServiceIdentityType.None; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ManagedServiceIdentityType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.cs index c8891bf810e1..c03bf44b3d17 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ManagedServiceIdentityType.cs @@ -1,22 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Type of managed service identity. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ManagedServiceIdentityType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum ManagedServiceIdentityType { - /// SystemAssigned. + [EnumMember(Value = "SystemAssigned")] SystemAssigned, - /// UserAssigned. + [EnumMember(Value = "UserAssigned")] UserAssigned, - /// SystemAssigned, UserAssigned. + [EnumMember(Value = "SystemAssigned, UserAssigned")] SystemAssignedUserAssigned, - /// None. + [EnumMember(Value = "None")] None } + internal static class ManagedServiceIdentityTypeEnumExtension + { + internal static string ToSerializedValue(this ManagedServiceIdentityType? value) + { + return value == null ? null : ((ManagedServiceIdentityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ManagedServiceIdentityType value) + { + switch( value ) + { + case ManagedServiceIdentityType.SystemAssigned: + return "SystemAssigned"; + case ManagedServiceIdentityType.UserAssigned: + return "UserAssigned"; + case ManagedServiceIdentityType.SystemAssignedUserAssigned: + return "SystemAssigned, UserAssigned"; + case ManagedServiceIdentityType.None: + return "None"; + } + return null; + } + + internal static ManagedServiceIdentityType? ParseManagedServiceIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return ManagedServiceIdentityType.SystemAssigned; + case "UserAssigned": + return ManagedServiceIdentityType.UserAssigned; + case "SystemAssigned, UserAssigned": + return ManagedServiceIdentityType.SystemAssignedUserAssigned; + case "None": + return ManagedServiceIdentityType.None; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.Serialization.cs deleted file mode 100644 index 2041ab019c78..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class MetricAvailability - { - internal static MetricAvailability DeserializeMetricAvailability(JsonElement element) - { - Optional timeGrain = default; - Optional blobDuration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeGrain")) - { - timeGrain = property.Value.GetString(); - continue; - } - if (property.NameEquals("blobDuration")) - { - blobDuration = property.Value.GetString(); - continue; - } - } - return new MetricAvailability(timeGrain.Value, blobDuration.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.cs index 8565f4065084..c66947cdbd0a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricAvailability.cs @@ -1,30 +1,55 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Retention policy of a resource metric. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Retention policy of a resource metric. + /// public partial class MetricAvailability { - /// Initializes a new instance of MetricAvailability. - internal MetricAvailability() + /// + /// Initializes a new instance of the MetricAvailability class. + /// + public MetricAvailability() { + CustomInit(); } - /// Initializes a new instance of MetricAvailability. - /// . - /// . - internal MetricAvailability(string timeGrain, string blobDuration) + /// + /// Initializes a new instance of the MetricAvailability class. + /// + public MetricAvailability(string timeGrain = default(string), string blobDuration = default(string)) { TimeGrain = timeGrain; BlobDuration = blobDuration; + CustomInit(); } - public string TimeGrain { get; } - public string BlobDuration { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "timeGrain")] + public string TimeGrain { get; set; } + + /// + /// + [JsonProperty(PropertyName = "blobDuration")] + public string BlobDuration { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.Serialization.cs deleted file mode 100644 index c664633228a4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.Serialization.cs +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class MetricSpecification - { - internal static MetricSpecification DeserializeMetricSpecification(JsonElement element) - { - Optional name = default; - Optional displayName = default; - Optional displayDescription = default; - Optional unit = default; - Optional aggregationType = default; - Optional supportsInstanceLevelAggregation = default; - Optional enableRegionalMdmAccount = default; - Optional sourceMdmAccount = default; - Optional sourceMdmNamespace = default; - Optional metricFilterPattern = default; - Optional fillGapWithZero = default; - Optional isInternal = default; - Optional> dimensions = default; - Optional category = default; - Optional> availabilities = default; - Optional> supportedTimeGrainTypes = default; - Optional> supportedAggregationTypes = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("displayName")) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("displayDescription")) - { - displayDescription = property.Value.GetString(); - continue; - } - if (property.NameEquals("unit")) - { - unit = property.Value.GetString(); - continue; - } - if (property.NameEquals("aggregationType")) - { - aggregationType = property.Value.GetString(); - continue; - } - if (property.NameEquals("supportsInstanceLevelAggregation")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - supportsInstanceLevelAggregation = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("enableRegionalMdmAccount")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enableRegionalMdmAccount = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("sourceMdmAccount")) - { - sourceMdmAccount = property.Value.GetString(); - continue; - } - if (property.NameEquals("sourceMdmNamespace")) - { - sourceMdmNamespace = property.Value.GetString(); - continue; - } - if (property.NameEquals("metricFilterPattern")) - { - metricFilterPattern = property.Value.GetString(); - continue; - } - if (property.NameEquals("fillGapWithZero")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - fillGapWithZero = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isInternal")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isInternal = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("dimensions")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Dimension.DeserializeDimension(item)); - } - dimensions = array; - continue; - } - if (property.NameEquals("category")) - { - category = property.Value.GetString(); - continue; - } - if (property.NameEquals("availabilities")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MetricAvailability.DeserializeMetricAvailability(item)); - } - availabilities = array; - continue; - } - if (property.NameEquals("supportedTimeGrainTypes")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - supportedTimeGrainTypes = array; - continue; - } - if (property.NameEquals("supportedAggregationTypes")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - supportedAggregationTypes = array; - continue; - } - } - return new MetricSpecification(name.Value, displayName.Value, displayDescription.Value, unit.Value, aggregationType.Value, Optional.ToNullable(supportsInstanceLevelAggregation), Optional.ToNullable(enableRegionalMdmAccount), sourceMdmAccount.Value, sourceMdmNamespace.Value, metricFilterPattern.Value, Optional.ToNullable(fillGapWithZero), Optional.ToNullable(isInternal), Optional.ToList(dimensions), category.Value, Optional.ToList(availabilities), Optional.ToList(supportedTimeGrainTypes), Optional.ToList(supportedAggregationTypes)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.cs index 117a99f5d0ad..38a0c42b3359 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MetricSpecification.cs @@ -1,46 +1,37 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Definition of a single resource metric. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Definition of a single resource metric. + /// public partial class MetricSpecification { - /// Initializes a new instance of MetricSpecification. - internal MetricSpecification() + /// + /// Initializes a new instance of the MetricSpecification class. + /// + public MetricSpecification() { - Dimensions = new ChangeTrackingList(); - Availabilities = new ChangeTrackingList(); - SupportedTimeGrainTypes = new ChangeTrackingList(); - SupportedAggregationTypes = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of MetricSpecification. - /// . - /// . - /// . - /// . - /// . - /// . - /// . - /// . - /// . - /// . - /// . - /// . - /// . - /// . - /// . - /// . - /// . - internal MetricSpecification(string name, string displayName, string displayDescription, string unit, string aggregationType, bool? supportsInstanceLevelAggregation, bool? enableRegionalMdmAccount, string sourceMdmAccount, string sourceMdmNamespace, string metricFilterPattern, bool? fillGapWithZero, bool? isInternal, IReadOnlyList dimensions, string category, IReadOnlyList availabilities, IReadOnlyList supportedTimeGrainTypes, IReadOnlyList supportedAggregationTypes) + /// + /// Initializes a new instance of the MetricSpecification class. + /// + public MetricSpecification(string name = default(string), string displayName = default(string), string displayDescription = default(string), string unit = default(string), string aggregationType = default(string), bool? supportsInstanceLevelAggregation = default(bool?), bool? enableRegionalMdmAccount = default(bool?), string sourceMdmAccount = default(string), string sourceMdmNamespace = default(string), string metricFilterPattern = default(string), bool? fillGapWithZero = default(bool?), bool? isInternal = default(bool?), IList dimensions = default(IList), string category = default(string), IList availabilities = default(IList), IList supportedTimeGrainTypes = default(IList), IList supportedAggregationTypes = default(IList)) { Name = name; DisplayName = displayName; @@ -59,24 +50,98 @@ internal MetricSpecification(string name, string displayName, string displayDesc Availabilities = availabilities; SupportedTimeGrainTypes = supportedTimeGrainTypes; SupportedAggregationTypes = supportedAggregationTypes; + CustomInit(); } - public string Name { get; } - public string DisplayName { get; } - public string DisplayDescription { get; } - public string Unit { get; } - public string AggregationType { get; } - public bool? SupportsInstanceLevelAggregation { get; } - public bool? EnableRegionalMdmAccount { get; } - public string SourceMdmAccount { get; } - public string SourceMdmNamespace { get; } - public string MetricFilterPattern { get; } - public bool? FillGapWithZero { get; } - public bool? IsInternal { get; } - public IReadOnlyList Dimensions { get; } - public string Category { get; } - public IReadOnlyList Availabilities { get; } - public IReadOnlyList SupportedTimeGrainTypes { get; } - public IReadOnlyList SupportedAggregationTypes { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// + [JsonProperty(PropertyName = "displayDescription")] + public string DisplayDescription { get; set; } + + /// + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + /// + /// + [JsonProperty(PropertyName = "aggregationType")] + public string AggregationType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "supportsInstanceLevelAggregation")] + public bool? SupportsInstanceLevelAggregation { get; set; } + + /// + /// + [JsonProperty(PropertyName = "enableRegionalMdmAccount")] + public bool? EnableRegionalMdmAccount { get; set; } + + /// + /// + [JsonProperty(PropertyName = "sourceMdmAccount")] + public string SourceMdmAccount { get; set; } + + /// + /// + [JsonProperty(PropertyName = "sourceMdmNamespace")] + public string SourceMdmNamespace { get; set; } + + /// + /// + [JsonProperty(PropertyName = "metricFilterPattern")] + public string MetricFilterPattern { get; set; } + + /// + /// + [JsonProperty(PropertyName = "fillGapWithZero")] + public bool? FillGapWithZero { get; set; } + + /// + /// + [JsonProperty(PropertyName = "isInternal")] + public bool? IsInternal { get; set; } + + /// + /// + [JsonProperty(PropertyName = "dimensions")] + public IList Dimensions { get; set; } + + /// + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// + [JsonProperty(PropertyName = "availabilities")] + public IList Availabilities { get; set; } + + /// + /// + [JsonProperty(PropertyName = "supportedTimeGrainTypes")] + public IList SupportedTimeGrainTypes { get; set; } + + /// + /// + [JsonProperty(PropertyName = "supportedAggregationTypes")] + public IList SupportedAggregationTypes { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.Serialization.cs deleted file mode 100644 index 372e3a0a460e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class MigrateMySqlRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ConnectionString)) - { - writer.WritePropertyName("connectionString"); - writer.WriteStringValue(ConnectionString); - } - if (Optional.IsDefined(MigrationType)) - { - writer.WritePropertyName("migrationType"); - writer.WriteStringValue(MigrationType.Value.ToSerialString()); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static MigrateMySqlRequest DeserializeMigrateMySqlRequest(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional connectionString = default; - Optional migrationType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("connectionString")) - { - connectionString = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("migrationType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - migrationType = property0.Value.GetString().ToMySqlMigrationType(); - continue; - } - } - continue; - } - } - return new MigrateMySqlRequest(id.Value, name.Value, kind.Value, type.Value, connectionString.Value, Optional.ToNullable(migrationType)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.cs index 5395a702c087..db3069fe54b2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlRequest.cs @@ -1,36 +1,84 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// MySQL migration request. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// MySQL migration request. + /// + [Rest.Serialization.JsonTransformation] public partial class MigrateMySqlRequest : ProxyOnlyResource { - /// Initializes a new instance of MigrateMySqlRequest. + /// + /// Initializes a new instance of the MigrateMySqlRequest class. + /// public MigrateMySqlRequest() { + CustomInit(); } - /// Initializes a new instance of MigrateMySqlRequest. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Connection string to the remote MySQL database. - /// The type of migration operation to be done. - internal MigrateMySqlRequest(string id, string name, string kind, string type, string connectionString, MySqlMigrationType? migrationType) : base(id, name, kind, type) + /// + /// Initializes a new instance of the MigrateMySqlRequest class. + /// + /// Connection string to the remote + /// MySQL database. + /// The type of migration operation to be + /// done. Possible values include: 'LocalToRemote', + /// 'RemoteToLocal' + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public MigrateMySqlRequest(string connectionString, MySqlMigrationType migrationType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string)) + : base(id, name, kind, type) { ConnectionString = connectionString; MigrationType = migrationType; + CustomInit(); } - /// Connection string to the remote MySQL database. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets connection string to the remote MySQL database. + /// + [JsonProperty(PropertyName = "properties.connectionString")] public string ConnectionString { get; set; } - /// The type of migration operation to be done. - public MySqlMigrationType? MigrationType { get; set; } + + /// + /// Gets or sets the type of migration operation to be done. Possible + /// values include: 'LocalToRemote', 'RemoteToLocal' + /// + [JsonProperty(PropertyName = "properties.migrationType")] + public MySqlMigrationType MigrationType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ConnectionString == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionString"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.Serialization.cs deleted file mode 100644 index 2909d22ede56..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.Serialization.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class MigrateMySqlStatus : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static MigrateMySqlStatus DeserializeMigrateMySqlStatus(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional migrationOperationStatus = default; - Optional operationId = default; - Optional localMySqlEnabled = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("migrationOperationStatus")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - migrationOperationStatus = property0.Value.GetString().ToOperationStatus(); - continue; - } - if (property0.NameEquals("operationId")) - { - operationId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("localMySqlEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - localMySqlEnabled = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new MigrateMySqlStatus(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(migrationOperationStatus), operationId.Value, Optional.ToNullable(localMySqlEnabled)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.cs index d5d50f4071c5..459d50aef84b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MigrateMySqlStatus.cs @@ -1,40 +1,80 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// MySQL migration status. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// MySQL migration status. + /// + [Rest.Serialization.JsonTransformation] public partial class MigrateMySqlStatus : ProxyOnlyResource { - /// Initializes a new instance of MigrateMySqlStatus. + /// + /// Initializes a new instance of the MigrateMySqlStatus class. + /// public MigrateMySqlStatus() { + CustomInit(); } - /// Initializes a new instance of MigrateMySqlStatus. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Status of the migration task. - /// Operation ID for the migration task. - /// True if the web app has in app MySql enabled. - internal MigrateMySqlStatus(string id, string name, string kind, string type, OperationStatus? migrationOperationStatus, string operationId, bool? localMySqlEnabled) : base(id, name, kind, type) + /// + /// Initializes a new instance of the MigrateMySqlStatus class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Status of the migration + /// task. Possible values include: 'InProgress', 'Failed', 'Succeeded', + /// 'TimedOut', 'Created' + /// Operation ID for the migration + /// task. + /// True if the web app has in app + /// MySql enabled + public MigrateMySqlStatus(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), OperationStatus? migrationOperationStatus = default(OperationStatus?), string operationId = default(string), bool? localMySqlEnabled = default(bool?)) + : base(id, name, kind, type) { MigrationOperationStatus = migrationOperationStatus; OperationId = operationId; LocalMySqlEnabled = localMySqlEnabled; + CustomInit(); } - /// Status of the migration task. - public OperationStatus? MigrationOperationStatus { get; } - /// Operation ID for the migration task. - public string OperationId { get; } - /// True if the web app has in app MySql enabled. - public bool? LocalMySqlEnabled { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets status of the migration task. Possible values include: + /// 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created' + /// + [JsonProperty(PropertyName = "properties.migrationOperationStatus")] + public OperationStatus? MigrationOperationStatus { get; private set; } + + /// + /// Gets operation ID for the migration task. + /// + [JsonProperty(PropertyName = "properties.operationId")] + public string OperationId { get; private set; } + + /// + /// Gets true if the web app has in app MySql enabled + /// + [JsonProperty(PropertyName = "properties.localMySqlEnabled")] + public bool? LocalMySqlEnabled { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.Serialization.cs deleted file mode 100644 index 24b1f234a57c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class MySqlMigrationTypeExtensions - { - public static string ToSerialString(this MySqlMigrationType value) => value switch - { - MySqlMigrationType.LocalToRemote => "LocalToRemote", - MySqlMigrationType.RemoteToLocal => "RemoteToLocal", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MySqlMigrationType value.") - }; - - public static MySqlMigrationType ToMySqlMigrationType(this string value) - { - if (string.Equals(value, "LocalToRemote", StringComparison.InvariantCultureIgnoreCase)) return MySqlMigrationType.LocalToRemote; - if (string.Equals(value, "RemoteToLocal", StringComparison.InvariantCultureIgnoreCase)) return MySqlMigrationType.RemoteToLocal; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MySqlMigrationType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.cs index 129e90f762db..72b86f7ca14d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/MySqlMigrationType.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The type of migration operation to be done. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for MySqlMigrationType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum MySqlMigrationType { - /// LocalToRemote. + [EnumMember(Value = "LocalToRemote")] LocalToRemote, - /// RemoteToLocal. + [EnumMember(Value = "RemoteToLocal")] RemoteToLocal } + internal static class MySqlMigrationTypeEnumExtension + { + internal static string ToSerializedValue(this MySqlMigrationType? value) + { + return value == null ? null : ((MySqlMigrationType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this MySqlMigrationType value) + { + switch( value ) + { + case MySqlMigrationType.LocalToRemote: + return "LocalToRemote"; + case MySqlMigrationType.RemoteToLocal: + return "RemoteToLocal"; + } + return null; + } + + internal static MySqlMigrationType? ParseMySqlMigrationType(this string value) + { + switch( value ) + { + case "LocalToRemote": + return MySqlMigrationType.LocalToRemote; + case "RemoteToLocal": + return MySqlMigrationType.RemoteToLocal; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.Serialization.cs deleted file mode 100644 index 7ec59dd72d2d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.Serialization.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class NameIdentifier : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - writer.WriteEndObject(); - } - - internal static NameIdentifier DeserializeNameIdentifier(JsonElement element) - { - Optional name = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - } - return new NameIdentifier(name.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.cs index e677938b3e0f..71bcdbc98296 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifier.cs @@ -1,28 +1,51 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Identifies an object. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Identifies an object. + /// public partial class NameIdentifier { - /// Initializes a new instance of NameIdentifier. + /// + /// Initializes a new instance of the NameIdentifier class. + /// public NameIdentifier() { + CustomInit(); } - /// Initializes a new instance of NameIdentifier. - /// Name of the object. - internal NameIdentifier(string name) + /// + /// Initializes a new instance of the NameIdentifier class. + /// + /// Name of the object. + public NameIdentifier(string name = default(string)) { Name = name; + CustomInit(); } - /// Name of the object. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the object. + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.Serialization.cs deleted file mode 100644 index ea567cd185e9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class NameIdentifierCollection - { - internal static NameIdentifierCollection DeserializeNameIdentifierCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NameIdentifier.DeserializeNameIdentifier(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new NameIdentifierCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.cs deleted file mode 100644 index 1e547f586f0d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameIdentifierCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of domain name identifiers. - internal partial class NameIdentifierCollection - { - /// Initializes a new instance of NameIdentifierCollection. - /// Collection of resources. - /// is null. - internal NameIdentifierCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of NameIdentifierCollection. - /// Collection of resources. - /// Link to next page of resources. - internal NameIdentifierCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.Serialization.cs deleted file mode 100644 index 673babb895cb..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class NameValuePair : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Value)) - { - writer.WritePropertyName("value"); - writer.WriteStringValue(Value); - } - writer.WriteEndObject(); - } - - internal static NameValuePair DeserializeNameValuePair(JsonElement element) - { - Optional name = default; - Optional value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("value")) - { - value = property.Value.GetString(); - continue; - } - } - return new NameValuePair(name.Value, value.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.cs index 4031cad8ef9a..81a8ac40a028 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NameValuePair.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Name value pair. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Name value pair. + /// public partial class NameValuePair { - /// Initializes a new instance of NameValuePair. + /// + /// Initializes a new instance of the NameValuePair class. + /// public NameValuePair() { + CustomInit(); } - /// Initializes a new instance of NameValuePair. - /// Pair name. - /// Pair value. - internal NameValuePair(string name, string value) + /// + /// Initializes a new instance of the NameValuePair class. + /// + /// Pair name. + /// Pair value. + public NameValuePair(string name = default(string), string value = default(string)) { Name = name; Value = value; + CustomInit(); } - /// Pair name. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets pair name. + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// Pair value. + + /// + /// Gets or sets pair value. + /// + [JsonProperty(PropertyName = "value")] public string Value { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.Serialization.cs deleted file mode 100644 index ef5b29a44762..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.Serialization.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class NetworkFeatures : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static NetworkFeatures DeserializeNetworkFeatures(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional virtualNetworkName = default; - Optional virtualNetworkConnection = default; - Optional> hybridConnections = default; - Optional> hybridConnectionsV2 = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("virtualNetworkName")) - { - virtualNetworkName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("virtualNetworkConnection")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - virtualNetworkConnection = VnetInfo.DeserializeVnetInfo(property0.Value); - continue; - } - if (property0.NameEquals("hybridConnections")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(item)); - } - hybridConnections = array; - continue; - } - if (property0.NameEquals("hybridConnectionsV2")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(HybridConnection.DeserializeHybridConnection(item)); - } - hybridConnectionsV2 = array; - continue; - } - } - continue; - } - } - return new NetworkFeatures(id.Value, name.Value, kind.Value, type.Value, virtualNetworkName.Value, virtualNetworkConnection.Value, Optional.ToList(hybridConnections), Optional.ToList(hybridConnectionsV2)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.cs index dff1a26a92d3..af9cf1928dac 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkFeatures.cs @@ -1,49 +1,89 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Full view of network features for an app (presently VNET integration and Hybrid Connections). + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Full view of network features for an app (presently VNET integration + /// and Hybrid Connections). + /// + [Rest.Serialization.JsonTransformation] public partial class NetworkFeatures : ProxyOnlyResource { - /// Initializes a new instance of NetworkFeatures. + /// + /// Initializes a new instance of the NetworkFeatures class. + /// public NetworkFeatures() { - HybridConnections = new ChangeTrackingList(); - HybridConnectionsV2 = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of NetworkFeatures. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Virtual Network name. - /// The Virtual Network summary view. - /// The Hybrid Connections summary view. - /// The Hybrid Connection V2 (Service Bus) view. - internal NetworkFeatures(string id, string name, string kind, string type, string virtualNetworkName, VnetInfo virtualNetworkConnection, IReadOnlyList hybridConnections, IReadOnlyList hybridConnectionsV2) : base(id, name, kind, type) + /// + /// Initializes a new instance of the NetworkFeatures class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Virtual Network name. + /// The Virtual Network summary + /// view. + /// The Hybrid Connections summary + /// view. + /// The Hybrid Connection V2 (Service + /// Bus) view. + public NetworkFeatures(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string virtualNetworkName = default(string), VnetInfo virtualNetworkConnection = default(VnetInfo), IList hybridConnections = default(IList), IList hybridConnectionsV2 = default(IList)) + : base(id, name, kind, type) { VirtualNetworkName = virtualNetworkName; VirtualNetworkConnection = virtualNetworkConnection; HybridConnections = hybridConnections; HybridConnectionsV2 = hybridConnectionsV2; + CustomInit(); } - /// The Virtual Network name. - public string VirtualNetworkName { get; } - /// The Virtual Network summary view. - public VnetInfo VirtualNetworkConnection { get; } - /// The Hybrid Connections summary view. - public IReadOnlyList HybridConnections { get; } - /// The Hybrid Connection V2 (Service Bus) view. - public IReadOnlyList HybridConnectionsV2 { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the Virtual Network name. + /// + [JsonProperty(PropertyName = "properties.virtualNetworkName")] + public string VirtualNetworkName { get; private set; } + + /// + /// Gets the Virtual Network summary view. + /// + [JsonProperty(PropertyName = "properties.virtualNetworkConnection")] + public VnetInfo VirtualNetworkConnection { get; private set; } + + /// + /// Gets the Hybrid Connections summary view. + /// + [JsonProperty(PropertyName = "properties.hybridConnections")] + public IList HybridConnections { get; private set; } + + /// + /// Gets the Hybrid Connection V2 (Service Bus) view. + /// + [JsonProperty(PropertyName = "properties.hybridConnectionsV2")] + public IList HybridConnectionsV2 { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.Serialization.cs deleted file mode 100644 index 93b903c56e47..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class NetworkTrace - { - internal static NetworkTrace DeserializeNetworkTrace(JsonElement element) - { - Optional path = default; - Optional status = default; - Optional message = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("path")) - { - path = property.Value.GetString(); - continue; - } - if (property.NameEquals("status")) - { - status = property.Value.GetString(); - continue; - } - if (property.NameEquals("message")) - { - message = property.Value.GetString(); - continue; - } - } - return new NetworkTrace(path.Value, status.Value, message.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.cs index 52ae1fb7c331..dd2aad70cd18 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkTrace.cs @@ -1,36 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Network trace. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Network trace + /// public partial class NetworkTrace { - /// Initializes a new instance of NetworkTrace. - internal NetworkTrace() + /// + /// Initializes a new instance of the NetworkTrace class. + /// + public NetworkTrace() { + CustomInit(); } - /// Initializes a new instance of NetworkTrace. - /// Local file path for the captured network trace file. - /// Current status of the network trace operation, same as Operation.Status (InProgress/Succeeded/Failed). - /// Detailed message of a network trace operation, e.g. error message in case of failure. - internal NetworkTrace(string path, string status, string message) + /// + /// Initializes a new instance of the NetworkTrace class. + /// + /// Local file path for the captured network trace + /// file. + /// Current status of the network trace operation, + /// same as Operation.Status (InProgress/Succeeded/Failed). + /// Detailed message of a network trace + /// operation, e.g. error message in case of failure. + public NetworkTrace(string path = default(string), string status = default(string), string message = default(string)) { Path = path; Status = status; Message = message; + CustomInit(); } - /// Local file path for the captured network trace file. - public string Path { get; } - /// Current status of the network trace operation, same as Operation.Status (InProgress/Succeeded/Failed). - public string Status { get; } - /// Detailed message of a network trace operation, e.g. error message in case of failure. - public string Message { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets local file path for the captured network trace file. + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + + /// + /// Gets or sets current status of the network trace operation, same as + /// Operation.Status (InProgress/Succeeded/Failed). + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets detailed message of a network trace operation, e.g. + /// error message in case of failure. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.Serialization.cs deleted file mode 100644 index 47c383e5f7d0..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Nonce : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ValidateNonce)) - { - writer.WritePropertyName("validateNonce"); - writer.WriteBooleanValue(ValidateNonce.Value); - } - if (Optional.IsDefined(NonceExpirationInterval)) - { - writer.WritePropertyName("nonceExpirationInterval"); - writer.WriteStringValue(NonceExpirationInterval); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Nonce DeserializeNonce(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional validateNonce = default; - Optional nonceExpirationInterval = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("validateNonce")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - validateNonce = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("nonceExpirationInterval")) - { - nonceExpirationInterval = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new Nonce(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(validateNonce), nonceExpirationInterval.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.cs index 5aa6cc1d80fe..0057825eab8b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.cs @@ -1,36 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the nonce used in the login flow. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class Nonce : ProxyOnlyResource { - /// Initializes a new instance of Nonce. + /// + /// Initializes a new instance of the Nonce class. + /// public Nonce() { + CustomInit(); } - /// Initializes a new instance of Nonce. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>false</code> if the nonce should not be validated while completing the login flow; otherwise, <code>true</code>. - /// The time after the request is made when the nonce should expire. - internal Nonce(string id, string name, string kind, string type, bool? validateNonce, string nonceExpirationInterval) : base(id, name, kind, type) + /// + /// Initializes a new instance of the Nonce class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public Nonce(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? validateNonce = default(bool?), string nonceExpirationInterval = default(string)) + : base(id, name, kind, type) { ValidateNonce = validateNonce; NonceExpirationInterval = nonceExpirationInterval; + CustomInit(); } - /// <code>false</code> if the nonce should not be validated while completing the login flow; otherwise, <code>true</code>. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.validateNonce")] public bool? ValidateNonce { get; set; } - /// The time after the request is made when the nonce should expire. + + /// + /// + [JsonProperty(PropertyName = "properties.nonceExpirationInterval")] public string NonceExpirationInterval { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.Serialization.cs deleted file mode 100644 index dcbe29656da6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.Serialization.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class NotificationLevelExtensions - { - public static string ToSerialString(this NotificationLevel value) => value switch - { - NotificationLevel.Critical => "Critical", - NotificationLevel.Warning => "Warning", - NotificationLevel.Information => "Information", - NotificationLevel.NonUrgentSuggestion => "NonUrgentSuggestion", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NotificationLevel value.") - }; - - public static NotificationLevel ToNotificationLevel(this string value) - { - if (string.Equals(value, "Critical", StringComparison.InvariantCultureIgnoreCase)) return NotificationLevel.Critical; - if (string.Equals(value, "Warning", StringComparison.InvariantCultureIgnoreCase)) return NotificationLevel.Warning; - if (string.Equals(value, "Information", StringComparison.InvariantCultureIgnoreCase)) return NotificationLevel.Information; - if (string.Equals(value, "NonUrgentSuggestion", StringComparison.InvariantCultureIgnoreCase)) return NotificationLevel.NonUrgentSuggestion; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NotificationLevel value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.cs index 8cedc4eed48d..467c91909fdd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NotificationLevel.cs @@ -1,22 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Level indicating how critical this recommendation can impact. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for NotificationLevel. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum NotificationLevel { - /// Critical. + [EnumMember(Value = "Critical")] Critical, - /// Warning. + [EnumMember(Value = "Warning")] Warning, - /// Information. + [EnumMember(Value = "Information")] Information, - /// NonUrgentSuggestion. + [EnumMember(Value = "NonUrgentSuggestion")] NonUrgentSuggestion } + internal static class NotificationLevelEnumExtension + { + internal static string ToSerializedValue(this NotificationLevel? value) + { + return value == null ? null : ((NotificationLevel)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this NotificationLevel value) + { + switch( value ) + { + case NotificationLevel.Critical: + return "Critical"; + case NotificationLevel.Warning: + return "Warning"; + case NotificationLevel.Information: + return "Information"; + case NotificationLevel.NonUrgentSuggestion: + return "NonUrgentSuggestion"; + } + return null; + } + + internal static NotificationLevel? ParseNotificationLevel(this string value) + { + switch( value ) + { + case "Critical": + return NotificationLevel.Critical; + case "Warning": + return NotificationLevel.Warning; + case "Information": + return NotificationLevel.Information; + case "NonUrgentSuggestion": + return NotificationLevel.NonUrgentSuggestion; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.Serialization.cs deleted file mode 100644 index 9f16180f1101..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.Serialization.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class OpenIdConnectClientCredential : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Method)) - { - writer.WritePropertyName("method"); - writer.WriteStringValue(Method); - } - if (Optional.IsDefined(ClientSecretSettingName)) - { - writer.WritePropertyName("clientSecretSettingName"); - writer.WriteStringValue(ClientSecretSettingName); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static OpenIdConnectClientCredential DeserializeOpenIdConnectClientCredential(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional method = default; - Optional clientSecretSettingName = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("method")) - { - method = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("clientSecretSettingName")) - { - clientSecretSettingName = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new OpenIdConnectClientCredential(id.Value, name.Value, kind.Value, type.Value, method.Value, clientSecretSettingName.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.cs index 7d302bd2f978..c0ce182af5cf 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.cs @@ -1,37 +1,65 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The authentication client credentials of the custom Open ID Connect provider. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class OpenIdConnectClientCredential : ProxyOnlyResource { - /// Initializes a new instance of OpenIdConnectClientCredential. + /// + /// Initializes a new instance of the OpenIdConnectClientCredential + /// class. + /// public OpenIdConnectClientCredential() { - Method = "ClientSecretPost"; + CustomInit(); } - /// Initializes a new instance of OpenIdConnectClientCredential. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The method that should be used to authenticate the user. - /// The app setting that contains the client secret for the custom Open ID Connect provider. - internal OpenIdConnectClientCredential(string id, string name, string kind, string type, string method, string clientSecretSettingName) : base(id, name, kind, type) + /// + /// Initializes a new instance of the OpenIdConnectClientCredential + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Possible values include: + /// 'ClientSecretPost' + public OpenIdConnectClientCredential(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ClientCredentialMethod? method = default(ClientCredentialMethod?), string clientSecretSettingName = default(string)) + : base(id, name, kind, type) { Method = method; ClientSecretSettingName = clientSecretSettingName; + CustomInit(); } - /// The method that should be used to authenticate the user. - public string Method { get; set; } - /// The app setting that contains the client secret for the custom Open ID Connect provider. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'ClientSecretPost' + /// + [JsonProperty(PropertyName = "properties.method")] + public ClientCredentialMethod? Method { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.clientSecretSettingName")] public string ClientSecretSettingName { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.Serialization.cs deleted file mode 100644 index b4d5038cf11b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.Serialization.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class OpenIdConnectConfig : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(AuthorizationEndpoint)) - { - writer.WritePropertyName("authorizationEndpoint"); - writer.WriteStringValue(AuthorizationEndpoint); - } - if (Optional.IsDefined(TokenEndpoint)) - { - writer.WritePropertyName("tokenEndpoint"); - writer.WriteStringValue(TokenEndpoint); - } - if (Optional.IsDefined(Issuer)) - { - writer.WritePropertyName("issuer"); - writer.WriteStringValue(Issuer); - } - if (Optional.IsDefined(CertificationUri)) - { - writer.WritePropertyName("certificationUri"); - writer.WriteStringValue(CertificationUri); - } - if (Optional.IsDefined(WellKnownOpenIdConfiguration)) - { - writer.WritePropertyName("wellKnownOpenIdConfiguration"); - writer.WriteStringValue(WellKnownOpenIdConfiguration); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static OpenIdConnectConfig DeserializeOpenIdConnectConfig(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional authorizationEndpoint = default; - Optional tokenEndpoint = default; - Optional issuer = default; - Optional certificationUri = default; - Optional wellKnownOpenIdConfiguration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("authorizationEndpoint")) - { - authorizationEndpoint = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("tokenEndpoint")) - { - tokenEndpoint = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("issuer")) - { - issuer = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("certificationUri")) - { - certificationUri = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("wellKnownOpenIdConfiguration")) - { - wellKnownOpenIdConfiguration = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new OpenIdConnectConfig(id.Value, name.Value, kind.Value, type.Value, authorizationEndpoint.Value, tokenEndpoint.Value, issuer.Value, certificationUri.Value, wellKnownOpenIdConfiguration.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.cs index af8c2cb93379..fe09ee1f099d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.cs @@ -1,48 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the endpoints used for the custom Open ID Connect provider. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class OpenIdConnectConfig : ProxyOnlyResource { - /// Initializes a new instance of OpenIdConnectConfig. + /// + /// Initializes a new instance of the OpenIdConnectConfig class. + /// public OpenIdConnectConfig() { + CustomInit(); } - /// Initializes a new instance of OpenIdConnectConfig. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The endpoint to be used to make an authorization request. - /// The endpoint to be used to request a token. - /// The endpoint that issues the token. - /// The endpoint that provides the keys necessary to validate the token. - /// The endpoint that contains all the configuration endpoints for the provider. - internal OpenIdConnectConfig(string id, string name, string kind, string type, string authorizationEndpoint, string tokenEndpoint, string issuer, string certificationUri, string wellKnownOpenIdConfiguration) : base(id, name, kind, type) + /// + /// Initializes a new instance of the OpenIdConnectConfig class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public OpenIdConnectConfig(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string authorizationEndpoint = default(string), string tokenEndpoint = default(string), string issuer = default(string), string certificationUri = default(string), string wellKnownOpenIdConfiguration = default(string)) + : base(id, name, kind, type) { AuthorizationEndpoint = authorizationEndpoint; TokenEndpoint = tokenEndpoint; Issuer = issuer; CertificationUri = certificationUri; WellKnownOpenIdConfiguration = wellKnownOpenIdConfiguration; + CustomInit(); } - /// The endpoint to be used to make an authorization request. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.authorizationEndpoint")] public string AuthorizationEndpoint { get; set; } - /// The endpoint to be used to request a token. + + /// + /// + [JsonProperty(PropertyName = "properties.tokenEndpoint")] public string TokenEndpoint { get; set; } - /// The endpoint that issues the token. + + /// + /// + [JsonProperty(PropertyName = "properties.issuer")] public string Issuer { get; set; } - /// The endpoint that provides the keys necessary to validate the token. + + /// + /// + [JsonProperty(PropertyName = "properties.certificationUri")] public string CertificationUri { get; set; } - /// The endpoint that contains all the configuration endpoints for the provider. + + /// + /// + [JsonProperty(PropertyName = "properties.wellKnownOpenIdConfiguration")] public string WellKnownOpenIdConfiguration { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.Serialization.cs deleted file mode 100644 index 7827cfc067dd..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class OpenIdConnectLogin : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(NameClaimType)) - { - writer.WritePropertyName("nameClaimType"); - writer.WriteStringValue(NameClaimType); - } - if (Optional.IsCollectionDefined(Scopes)) - { - writer.WritePropertyName("scopes"); - writer.WriteStartArray(); - foreach (var item in Scopes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static OpenIdConnectLogin DeserializeOpenIdConnectLogin(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional nameClaimType = default; - Optional> scopes = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("nameClaimType")) - { - nameClaimType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("scopes")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - scopes = array; - continue; - } - } - continue; - } - } - return new OpenIdConnectLogin(id.Value, name.Value, kind.Value, type.Value, nameClaimType.Value, Optional.ToList(scopes)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.cs index 5a580b507ff0..cc0fe8682df0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.cs @@ -1,40 +1,62 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// The configuration settings of the login flow of the custom Open ID Connect provider. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class OpenIdConnectLogin : ProxyOnlyResource { - /// Initializes a new instance of OpenIdConnectLogin. + /// + /// Initializes a new instance of the OpenIdConnectLogin class. + /// public OpenIdConnectLogin() { - Scopes = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of OpenIdConnectLogin. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The name of the claim that contains the users name. - /// A list of the scopes that should be requested while authenticating. - internal OpenIdConnectLogin(string id, string name, string kind, string type, string nameClaimType, IList scopes) : base(id, name, kind, type) + /// + /// Initializes a new instance of the OpenIdConnectLogin class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public OpenIdConnectLogin(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string nameClaimType = default(string), IList scopes = default(IList)) + : base(id, name, kind, type) { NameClaimType = nameClaimType; Scopes = scopes; + CustomInit(); } - /// The name of the claim that contains the users name. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.nameClaimType")] public string NameClaimType { get; set; } - /// A list of the scopes that should be requested while authenticating. - public IList Scopes { get; } + + /// + /// + [JsonProperty(PropertyName = "properties.scopes")] + public IList Scopes { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.Serialization.cs deleted file mode 100644 index 6b7061936151..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.Serialization.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class OpenIdConnectRegistration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ClientId)) - { - writer.WritePropertyName("clientId"); - writer.WriteStringValue(ClientId); - } - if (Optional.IsDefined(ClientCredential)) - { - writer.WritePropertyName("clientCredential"); - writer.WriteObjectValue(ClientCredential); - } - if (Optional.IsDefined(OpenIdConnectConfiguration)) - { - writer.WritePropertyName("openIdConnectConfiguration"); - writer.WriteObjectValue(OpenIdConnectConfiguration); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static OpenIdConnectRegistration DeserializeOpenIdConnectRegistration(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional clientId = default; - Optional clientCredential = default; - Optional openIdConnectConfiguration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("clientId")) - { - clientId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("clientCredential")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - clientCredential = OpenIdConnectClientCredential.DeserializeOpenIdConnectClientCredential(property0.Value); - continue; - } - if (property0.NameEquals("openIdConnectConfiguration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - openIdConnectConfiguration = OpenIdConnectConfig.DeserializeOpenIdConnectConfig(property0.Value); - continue; - } - } - continue; - } - } - return new OpenIdConnectRegistration(id.Value, name.Value, kind.Value, type.Value, clientId.Value, clientCredential.Value, openIdConnectConfiguration.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.cs index b69130a44134..810737d9830a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.cs @@ -1,40 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the app registration for the custom Open ID Connect provider. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class OpenIdConnectRegistration : ProxyOnlyResource { - /// Initializes a new instance of OpenIdConnectRegistration. + /// + /// Initializes a new instance of the OpenIdConnectRegistration class. + /// public OpenIdConnectRegistration() { + CustomInit(); } - /// Initializes a new instance of OpenIdConnectRegistration. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The client id of the custom Open ID Connect provider. - /// The authentication credentials of the custom Open ID Connect provider. - /// The configuration settings of the endpoints used for the custom Open ID Connect provider. - internal OpenIdConnectRegistration(string id, string name, string kind, string type, string clientId, OpenIdConnectClientCredential clientCredential, OpenIdConnectConfig openIdConnectConfiguration) : base(id, name, kind, type) + /// + /// Initializes a new instance of the OpenIdConnectRegistration class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public OpenIdConnectRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string clientId = default(string), OpenIdConnectClientCredential clientCredential = default(OpenIdConnectClientCredential), OpenIdConnectConfig openIdConnectConfiguration = default(OpenIdConnectConfig)) + : base(id, name, kind, type) { ClientId = clientId; ClientCredential = clientCredential; OpenIdConnectConfiguration = openIdConnectConfiguration; + CustomInit(); } - /// The client id of the custom Open ID Connect provider. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.clientId")] public string ClientId { get; set; } - /// The authentication credentials of the custom Open ID Connect provider. + + /// + /// + [JsonProperty(PropertyName = "properties.clientCredential")] public OpenIdConnectClientCredential ClientCredential { get; set; } - /// The configuration settings of the endpoints used for the custom Open ID Connect provider. + + /// + /// + [JsonProperty(PropertyName = "properties.openIdConnectConfiguration")] public OpenIdConnectConfig OpenIdConnectConfiguration { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.Serialization.cs deleted file mode 100644 index 4ca2900c20b5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.Serialization.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Operation - { - internal static Operation DeserializeOperation(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional status = default; - Optional> errors = default; - Optional createdTime = default; - Optional modifiedTime = default; - Optional expirationTime = default; - Optional geoMasterOperationId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("status")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property.Value.GetString().ToOperationStatus(); - continue; - } - if (property.NameEquals("errors")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ErrorEntity.DeserializeErrorEntity(item)); - } - errors = array; - continue; - } - if (property.NameEquals("createdTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - createdTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("modifiedTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - modifiedTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("expirationTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - expirationTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("geoMasterOperationId")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - geoMasterOperationId = property.Value.GetGuid(); - continue; - } - } - return new Operation(id.Value, name.Value, Optional.ToNullable(status), Optional.ToList(errors), Optional.ToNullable(createdTime), Optional.ToNullable(modifiedTime), Optional.ToNullable(expirationTime), Optional.ToNullable(geoMasterOperationId)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.cs index fd7964ef4360..3bc7056b44e8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Operation.cs @@ -1,35 +1,51 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// An operation on a resource. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An operation on a resource. + /// public partial class Operation { - /// Initializes a new instance of Operation. - internal Operation() + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() { - Errors = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of Operation. - /// Operation ID. - /// Operation name. - /// The current status of the operation. - /// Any errors associate with the operation. - /// Time when operation has started. - /// Time when operation has been updated. - /// Time when operation will expire. - /// Applicable only for stamp operation ids. - internal Operation(string id, string name, OperationStatus? status, IReadOnlyList errors, DateTimeOffset? createdTime, DateTimeOffset? modifiedTime, DateTimeOffset? expirationTime, Guid? geoMasterOperationId) + /// + /// Initializes a new instance of the Operation class. + /// + /// Operation ID. + /// Operation name. + /// The current status of the operation. Possible + /// values include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', + /// 'Created' + /// Any errors associate with the + /// operation. + /// Time when operation has started. + /// Time when operation has been + /// updated. + /// Time when operation will + /// expire. + /// Applicable only for stamp + /// operation ids. + public Operation(string id = default(string), string name = default(string), OperationStatus? status = default(OperationStatus?), IList errors = default(IList), System.DateTime? createdTime = default(System.DateTime?), System.DateTime? modifiedTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), System.Guid? geoMasterOperationId = default(System.Guid?)) { Id = id; Name = name; @@ -39,23 +55,62 @@ internal Operation(string id, string name, OperationStatus? status, IReadOnlyLis ModifiedTime = modifiedTime; ExpirationTime = expirationTime; GeoMasterOperationId = geoMasterOperationId; + CustomInit(); } - /// Operation ID. - public string Id { get; } - /// Operation name. - public string Name { get; } - /// The current status of the operation. - public OperationStatus? Status { get; } - /// Any errors associate with the operation. - public IReadOnlyList Errors { get; } - /// Time when operation has started. - public DateTimeOffset? CreatedTime { get; } - /// Time when operation has been updated. - public DateTimeOffset? ModifiedTime { get; } - /// Time when operation will expire. - public DateTimeOffset? ExpirationTime { get; } - /// Applicable only for stamp operation ids. - public Guid? GeoMasterOperationId { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets operation ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets operation name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the current status of the operation. Possible values + /// include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created' + /// + [JsonProperty(PropertyName = "status")] + public OperationStatus? Status { get; set; } + + /// + /// Gets or sets any errors associate with the operation. + /// + [JsonProperty(PropertyName = "errors")] + public IList Errors { get; set; } + + /// + /// Gets or sets time when operation has started. + /// + [JsonProperty(PropertyName = "createdTime")] + public System.DateTime? CreatedTime { get; set; } + + /// + /// Gets or sets time when operation has been updated. + /// + [JsonProperty(PropertyName = "modifiedTime")] + public System.DateTime? ModifiedTime { get; set; } + + /// + /// Gets or sets time when operation will expire. + /// + [JsonProperty(PropertyName = "expirationTime")] + public System.DateTime? ExpirationTime { get; set; } + + /// + /// Gets or sets applicable only for stamp operation ids. + /// + [JsonProperty(PropertyName = "geoMasterOperationId")] + public System.Guid? GeoMasterOperationId { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.Serialization.cs deleted file mode 100644 index 33ced43ca1fd..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class OperationStatusExtensions - { - public static string ToSerialString(this OperationStatus value) => value switch - { - OperationStatus.InProgress => "InProgress", - OperationStatus.Failed => "Failed", - OperationStatus.Succeeded => "Succeeded", - OperationStatus.TimedOut => "TimedOut", - OperationStatus.Created => "Created", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OperationStatus value.") - }; - - public static OperationStatus ToOperationStatus(this string value) - { - if (string.Equals(value, "InProgress", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.InProgress; - if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.Failed; - if (string.Equals(value, "Succeeded", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.Succeeded; - if (string.Equals(value, "TimedOut", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.TimedOut; - if (string.Equals(value, "Created", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.Created; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OperationStatus value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.cs index c1cd56a1bce2..2c2fdb31a3d3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OperationStatus.cs @@ -1,24 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The current status of the operation. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for OperationStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum OperationStatus { - /// InProgress. + [EnumMember(Value = "InProgress")] InProgress, - /// Failed. + [EnumMember(Value = "Failed")] Failed, - /// Succeeded. + [EnumMember(Value = "Succeeded")] Succeeded, - /// TimedOut. + [EnumMember(Value = "TimedOut")] TimedOut, - /// Created. + [EnumMember(Value = "Created")] Created } + internal static class OperationStatusEnumExtension + { + internal static string ToSerializedValue(this OperationStatus? value) + { + return value == null ? null : ((OperationStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this OperationStatus value) + { + switch( value ) + { + case OperationStatus.InProgress: + return "InProgress"; + case OperationStatus.Failed: + return "Failed"; + case OperationStatus.Succeeded: + return "Succeeded"; + case OperationStatus.TimedOut: + return "TimedOut"; + case OperationStatus.Created: + return "Created"; + } + return null; + } + + internal static OperationStatus? ParseOperationStatus(this string value) + { + switch( value ) + { + case "InProgress": + return OperationStatus.InProgress; + case "Failed": + return OperationStatus.Failed; + case "Succeeded": + return OperationStatus.Succeeded; + case "TimedOut": + return OperationStatus.TimedOut; + case "Created": + return OperationStatus.Created; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.Serialization.cs deleted file mode 100644 index 49a8e58a38df..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class OutboundEnvironmentEndpoint - { - internal static OutboundEnvironmentEndpoint DeserializeOutboundEnvironmentEndpoint(JsonElement element) - { - Optional category = default; - Optional> endpoints = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("category")) - { - category = property.Value.GetString(); - continue; - } - if (property.NameEquals("endpoints")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(EndpointDependency.DeserializeEndpointDependency(item)); - } - endpoints = array; - continue; - } - } - return new OutboundEnvironmentEndpoint(category.Value, Optional.ToList(endpoints)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.cs index 44314072d066..c7de2355e83d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpoint.cs @@ -1,36 +1,70 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Endpoints accessed for a common purpose that the App Service + /// Environment requires outbound network access to. + /// public partial class OutboundEnvironmentEndpoint { - /// Initializes a new instance of OutboundEnvironmentEndpoint. - internal OutboundEnvironmentEndpoint() + /// + /// Initializes a new instance of the OutboundEnvironmentEndpoint + /// class. + /// + public OutboundEnvironmentEndpoint() { - Endpoints = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of OutboundEnvironmentEndpoint. - /// The type of service accessed by the App Service Environment, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory. - /// The endpoints that the App Service Environment reaches the service at. - internal OutboundEnvironmentEndpoint(string category, IReadOnlyList endpoints) + /// + /// Initializes a new instance of the OutboundEnvironmentEndpoint + /// class. + /// + /// The type of service accessed by the App + /// Service Environment, e.g., Azure Storage, Azure SQL Database, and + /// Azure Active Directory. + /// The endpoints that the App Service + /// Environment reaches the service at. + public OutboundEnvironmentEndpoint(string category = default(string), IList endpoints = default(IList)) { Category = category; Endpoints = endpoints; + CustomInit(); } - /// The type of service accessed by the App Service Environment, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory. - public string Category { get; } - /// The endpoints that the App Service Environment reaches the service at. - public IReadOnlyList Endpoints { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the type of service accessed by the App Service + /// Environment, e.g., Azure Storage, Azure SQL Database, and Azure + /// Active Directory. + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// Gets or sets the endpoints that the App Service Environment reaches + /// the service at. + /// + [JsonProperty(PropertyName = "endpoints")] + public IList Endpoints { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.Serialization.cs deleted file mode 100644 index 5c277214f31e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class OutboundEnvironmentEndpointCollection - { - internal static OutboundEnvironmentEndpointCollection DeserializeOutboundEnvironmentEndpointCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(OutboundEnvironmentEndpoint.DeserializeOutboundEnvironmentEndpoint(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new OutboundEnvironmentEndpointCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.cs deleted file mode 100644 index 5eb3727dfa90..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OutboundEnvironmentEndpointCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Outbound Environment Endpoints. - internal partial class OutboundEnvironmentEndpointCollection - { - /// Initializes a new instance of OutboundEnvironmentEndpointCollection. - /// Collection of resources. - /// is null. - internal OutboundEnvironmentEndpointCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of OutboundEnvironmentEndpointCollection. - /// Collection of resources. - /// Link to next page of resources. - internal OutboundEnvironmentEndpointCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.Serialization.cs deleted file mode 100644 index 4b04103ac667..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class PerfMonCounterCollection - { - internal static PerfMonCounterCollection DeserializePerfMonCounterCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PerfMonResponse.DeserializePerfMonResponse(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new PerfMonCounterCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.cs deleted file mode 100644 index 95cd786f6a13..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonCounterCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of performance monitor counters. - internal partial class PerfMonCounterCollection - { - /// Initializes a new instance of PerfMonCounterCollection. - /// Collection of resources. - /// is null. - internal PerfMonCounterCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of PerfMonCounterCollection. - /// Collection of resources. - /// Link to next page of resources. - internal PerfMonCounterCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.Serialization.cs deleted file mode 100644 index aaa998c6fe9e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PerfMonResponse - { - internal static PerfMonResponse DeserializePerfMonResponse(JsonElement element) - { - Optional code = default; - Optional message = default; - Optional data = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code")) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message")) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("data")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - data = PerfMonSet.DeserializePerfMonSet(property.Value); - continue; - } - } - return new PerfMonResponse(code.Value, message.Value, data.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.cs index 3bc94eabcb3a..835f102738e4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonResponse.cs @@ -1,36 +1,67 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Performance monitor API response. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Performance monitor API response. + /// public partial class PerfMonResponse { - /// Initializes a new instance of PerfMonResponse. - internal PerfMonResponse() + /// + /// Initializes a new instance of the PerfMonResponse class. + /// + public PerfMonResponse() { + CustomInit(); } - /// Initializes a new instance of PerfMonResponse. - /// The response code. - /// The message. - /// The performance monitor counters. - internal PerfMonResponse(string code, string message, PerfMonSet data) + /// + /// Initializes a new instance of the PerfMonResponse class. + /// + /// The response code. + /// The message. + /// The performance monitor counters. + public PerfMonResponse(string code = default(string), string message = default(string), PerfMonSet data = default(PerfMonSet)) { Code = code; Message = message; Data = data; + CustomInit(); } - /// The response code. - public string Code { get; } - /// The message. - public string Message { get; } - /// The performance monitor counters. - public PerfMonSet Data { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the response code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets the message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets the performance monitor counters. + /// + [JsonProperty(PropertyName = "data")] + public PerfMonSet Data { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.Serialization.cs deleted file mode 100644 index 78427e23bb06..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PerfMonSample - { - internal static PerfMonSample DeserializePerfMonSample(JsonElement element) - { - Optional time = default; - Optional instanceName = default; - Optional value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("time")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - time = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("instanceName")) - { - instanceName = property.Value.GetString(); - continue; - } - if (property.NameEquals("value")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - value = property.Value.GetDouble(); - continue; - } - } - return new PerfMonSample(Optional.ToNullable(time), instanceName.Value, Optional.ToNullable(value)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.cs index a3eb357a6dac..7680bce28534 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSample.cs @@ -1,38 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Performance monitor sample in a set. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Performance monitor sample in a set. + /// public partial class PerfMonSample { - /// Initializes a new instance of PerfMonSample. - internal PerfMonSample() + /// + /// Initializes a new instance of the PerfMonSample class. + /// + public PerfMonSample() { + CustomInit(); } - /// Initializes a new instance of PerfMonSample. - /// Point in time for which counter was measured. - /// Name of the server on which the measurement is made. - /// Value of counter at a certain time. - internal PerfMonSample(DateTimeOffset? time, string instanceName, double? value) + /// + /// Initializes a new instance of the PerfMonSample class. + /// + /// Point in time for which counter was + /// measured. + /// Name of the server on which the + /// measurement is made. + /// Value of counter at a certain time. + public PerfMonSample(System.DateTime? time = default(System.DateTime?), string instanceName = default(string), double? value = default(double?)) { Time = time; InstanceName = instanceName; Value = value; + CustomInit(); } - /// Point in time for which counter was measured. - public DateTimeOffset? Time { get; } - /// Name of the server on which the measurement is made. - public string InstanceName { get; } - /// Value of counter at a certain time. - public double? Value { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets point in time for which counter was measured. + /// + [JsonProperty(PropertyName = "time")] + public System.DateTime? Time { get; set; } + + /// + /// Gets or sets name of the server on which the measurement is made. + /// + [JsonProperty(PropertyName = "instanceName")] + public string InstanceName { get; set; } + + /// + /// Gets or sets value of counter at a certain time. + /// + [JsonProperty(PropertyName = "value")] + public double? Value { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.Serialization.cs deleted file mode 100644 index 7604e383f000..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.Serialization.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PerfMonSet - { - internal static PerfMonSet DeserializePerfMonSet(JsonElement element) - { - Optional name = default; - Optional startTime = default; - Optional endTime = default; - Optional timeGrain = default; - Optional> values = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("startTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("endTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - endTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("timeGrain")) - { - timeGrain = property.Value.GetString(); - continue; - } - if (property.NameEquals("values")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PerfMonSample.DeserializePerfMonSample(item)); - } - values = array; - continue; - } - } - return new PerfMonSet(name.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), timeGrain.Value, Optional.ToList(values)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.cs index f6a60217cafb..3b7842c98441 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PerfMonSet.cs @@ -1,49 +1,87 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Metric information. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Metric information. + /// public partial class PerfMonSet { - /// Initializes a new instance of PerfMonSet. - internal PerfMonSet() + /// + /// Initializes a new instance of the PerfMonSet class. + /// + public PerfMonSet() { - Values = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of PerfMonSet. - /// Unique key name of the counter. - /// Start time of the period. - /// End time of the period. - /// Presented time grain. - /// Collection of workers that are active during this time. - internal PerfMonSet(string name, DateTimeOffset? startTime, DateTimeOffset? endTime, string timeGrain, IReadOnlyList values) + /// + /// Initializes a new instance of the PerfMonSet class. + /// + /// Unique key name of the counter. + /// Start time of the period. + /// End time of the period. + /// Presented time grain. + /// Collection of workers that are active during + /// this time. + public PerfMonSet(string name = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), IList values = default(IList)) { Name = name; StartTime = startTime; EndTime = endTime; TimeGrain = timeGrain; Values = values; + CustomInit(); } - /// Unique key name of the counter. - public string Name { get; } - /// Start time of the period. - public DateTimeOffset? StartTime { get; } - /// End time of the period. - public DateTimeOffset? EndTime { get; } - /// Presented time grain. - public string TimeGrain { get; } - /// Collection of workers that are active during this time. - public IReadOnlyList Values { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unique key name of the counter. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets start time of the period. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets end time of the period. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets presented time grain. + /// + [JsonProperty(PropertyName = "timeGrain")] + public string TimeGrain { get; set; } + + /// + /// Gets or sets collection of workers that are active during this + /// time. + /// + [JsonProperty(PropertyName = "values")] + public IList Values { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.Serialization.cs deleted file mode 100644 index 9191cb280d87..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.Serialization.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PremierAddOn : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"); - writer.WriteStringValue(Sku); - } - if (Optional.IsDefined(Product)) - { - writer.WritePropertyName("product"); - writer.WriteStringValue(Product); - } - if (Optional.IsDefined(Vendor)) - { - writer.WritePropertyName("vendor"); - writer.WriteStringValue(Vendor); - } - if (Optional.IsDefined(MarketplacePublisher)) - { - writer.WritePropertyName("marketplacePublisher"); - writer.WriteStringValue(MarketplacePublisher); - } - if (Optional.IsDefined(MarketplaceOffer)) - { - writer.WritePropertyName("marketplaceOffer"); - writer.WriteStringValue(MarketplaceOffer); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static PremierAddOn DeserializePremierAddOn(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - string location = default; - Optional type = default; - Optional> tags = default; - Optional sku = default; - Optional product = default; - Optional vendor = default; - Optional marketplacePublisher = default; - Optional marketplaceOffer = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("sku")) - { - sku = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("product")) - { - product = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("vendor")) - { - vendor = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("marketplacePublisher")) - { - marketplacePublisher = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("marketplaceOffer")) - { - marketplaceOffer = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new PremierAddOn(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), sku.Value, product.Value, vendor.Value, marketplacePublisher.Value, marketplaceOffer.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.cs index f76b6cb5c8df..680ea63fa64b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOn.cs @@ -1,59 +1,107 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; +// 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.WebSites.Models { - /// Premier add-on. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Premier add-on. + /// + [Rest.Serialization.JsonTransformation] public partial class PremierAddOn : Resource { - /// Initializes a new instance of PremierAddOn. - /// Resource Location. - /// is null. - public PremierAddOn(string location) : base(location) + /// + /// Initializes a new instance of the PremierAddOn class. + /// + public PremierAddOn() { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } + CustomInit(); } - /// Initializes a new instance of PremierAddOn. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource Location. - /// Resource type. - /// Resource tags. - /// Premier add on SKU. - /// Premier add on Product. - /// Premier add on Vendor. - /// Premier add on Marketplace publisher. - /// Premier add on Marketplace offer. - internal PremierAddOn(string id, string name, string kind, string location, string type, IDictionary tags, string sku, string product, string vendor, string marketplacePublisher, string marketplaceOffer) : base(id, name, kind, location, type, tags) + /// + /// Initializes a new instance of the PremierAddOn class. + /// + /// Resource Location. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Resource tags. + /// Premier add on SKU. + /// Premier add on Product. + /// Premier add on Vendor. + /// Premier add on Marketplace + /// publisher. + /// Premier add on Marketplace + /// offer. + public PremierAddOn(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string sku = default(string), string product = default(string), string vendor = default(string), string marketplacePublisher = default(string), string marketplaceOffer = default(string)) + : base(location, id, name, kind, type, tags) { Sku = sku; Product = product; Vendor = vendor; MarketplacePublisher = marketplacePublisher; MarketplaceOffer = marketplaceOffer; + CustomInit(); } - /// Premier add on SKU. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets premier add on SKU. + /// + [JsonProperty(PropertyName = "properties.sku")] public string Sku { get; set; } - /// Premier add on Product. + + /// + /// Gets or sets premier add on Product. + /// + [JsonProperty(PropertyName = "properties.product")] public string Product { get; set; } - /// Premier add on Vendor. + + /// + /// Gets or sets premier add on Vendor. + /// + [JsonProperty(PropertyName = "properties.vendor")] public string Vendor { get; set; } - /// Premier add on Marketplace publisher. + + /// + /// Gets or sets premier add on Marketplace publisher. + /// + [JsonProperty(PropertyName = "properties.marketplacePublisher")] public string MarketplacePublisher { get; set; } - /// Premier add on Marketplace offer. + + /// + /// Gets or sets premier add on Marketplace offer. + /// + [JsonProperty(PropertyName = "properties.marketplaceOffer")] public string MarketplaceOffer { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.Serialization.cs deleted file mode 100644 index 01d67a8ac027..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.Serialization.cs +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PremierAddOnOffer : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"); - writer.WriteStringValue(Sku); - } - if (Optional.IsDefined(Product)) - { - writer.WritePropertyName("product"); - writer.WriteStringValue(Product); - } - if (Optional.IsDefined(Vendor)) - { - writer.WritePropertyName("vendor"); - writer.WriteStringValue(Vendor); - } - if (Optional.IsDefined(PromoCodeRequired)) - { - writer.WritePropertyName("promoCodeRequired"); - writer.WriteBooleanValue(PromoCodeRequired.Value); - } - if (Optional.IsDefined(Quota)) - { - writer.WritePropertyName("quota"); - writer.WriteNumberValue(Quota.Value); - } - if (Optional.IsDefined(WebHostingPlanRestrictions)) - { - writer.WritePropertyName("webHostingPlanRestrictions"); - writer.WriteStringValue(WebHostingPlanRestrictions.Value.ToSerialString()); - } - if (Optional.IsDefined(PrivacyPolicyUrl)) - { - writer.WritePropertyName("privacyPolicyUrl"); - writer.WriteStringValue(PrivacyPolicyUrl); - } - if (Optional.IsDefined(LegalTermsUrl)) - { - writer.WritePropertyName("legalTermsUrl"); - writer.WriteStringValue(LegalTermsUrl); - } - if (Optional.IsDefined(MarketplacePublisher)) - { - writer.WritePropertyName("marketplacePublisher"); - writer.WriteStringValue(MarketplacePublisher); - } - if (Optional.IsDefined(MarketplaceOffer)) - { - writer.WritePropertyName("marketplaceOffer"); - writer.WriteStringValue(MarketplaceOffer); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static PremierAddOnOffer DeserializePremierAddOnOffer(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional sku = default; - Optional product = default; - Optional vendor = default; - Optional promoCodeRequired = default; - Optional quota = default; - Optional webHostingPlanRestrictions = default; - Optional privacyPolicyUrl = default; - Optional legalTermsUrl = default; - Optional marketplacePublisher = default; - Optional marketplaceOffer = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("sku")) - { - sku = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("product")) - { - product = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("vendor")) - { - vendor = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("promoCodeRequired")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - promoCodeRequired = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("quota")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - quota = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("webHostingPlanRestrictions")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - webHostingPlanRestrictions = property0.Value.GetString().ToAppServicePlanRestrictions(); - continue; - } - if (property0.NameEquals("privacyPolicyUrl")) - { - privacyPolicyUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("legalTermsUrl")) - { - legalTermsUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("marketplacePublisher")) - { - marketplacePublisher = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("marketplaceOffer")) - { - marketplaceOffer = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new PremierAddOnOffer(id.Value, name.Value, kind.Value, type.Value, sku.Value, product.Value, vendor.Value, Optional.ToNullable(promoCodeRequired), Optional.ToNullable(quota), Optional.ToNullable(webHostingPlanRestrictions), privacyPolicyUrl.Value, legalTermsUrl.Value, marketplacePublisher.Value, marketplaceOffer.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.cs index b1f8d7c61390..a81239aad5ef 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOffer.cs @@ -1,36 +1,57 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Premier add-on offer. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Premier add-on offer. + /// + [Rest.Serialization.JsonTransformation] public partial class PremierAddOnOffer : ProxyOnlyResource { - /// Initializes a new instance of PremierAddOnOffer. + /// + /// Initializes a new instance of the PremierAddOnOffer class. + /// public PremierAddOnOffer() { + CustomInit(); } - /// Initializes a new instance of PremierAddOnOffer. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Premier add on SKU. - /// Premier add on offer Product. - /// Premier add on offer Vendor. - /// <code>true</code> if promotion code is required; otherwise, <code>false</code>. - /// Premier add on offer Quota. - /// App Service plans this offer is restricted to. - /// Privacy policy URL. - /// Legal terms URL. - /// Marketplace publisher. - /// Marketplace offer. - internal PremierAddOnOffer(string id, string name, string kind, string type, string sku, string product, string vendor, bool? promoCodeRequired, int? quota, AppServicePlanRestrictions? webHostingPlanRestrictions, string privacyPolicyUrl, string legalTermsUrl, string marketplacePublisher, string marketplaceOffer) : base(id, name, kind, type) + /// + /// Initializes a new instance of the PremierAddOnOffer class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Premier add on SKU. + /// Premier add on offer Product. + /// Premier add on offer Vendor. + /// <code>true</code> if + /// promotion code is required; otherwise, + /// <code>false</code>. + /// Premier add on offer Quota. + /// App Service plans this + /// offer is restricted to. Possible values include: 'None', 'Free', + /// 'Shared', 'Basic', 'Standard', 'Premium' + /// Privacy policy URL. + /// Legal terms URL. + /// Marketplace publisher. + /// Marketplace offer. + public PremierAddOnOffer(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string sku = default(string), string product = default(string), string vendor = default(string), bool? promoCodeRequired = default(bool?), int? quota = default(int?), AppServicePlanRestrictions? webHostingPlanRestrictions = default(AppServicePlanRestrictions?), string privacyPolicyUrl = default(string), string legalTermsUrl = default(string), string marketplacePublisher = default(string), string marketplaceOffer = default(string)) + : base(id, name, kind, type) { Sku = sku; Product = product; @@ -42,27 +63,77 @@ internal PremierAddOnOffer(string id, string name, string kind, string type, str LegalTermsUrl = legalTermsUrl; MarketplacePublisher = marketplacePublisher; MarketplaceOffer = marketplaceOffer; + CustomInit(); } - /// Premier add on SKU. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets premier add on SKU. + /// + [JsonProperty(PropertyName = "properties.sku")] public string Sku { get; set; } - /// Premier add on offer Product. + + /// + /// Gets or sets premier add on offer Product. + /// + [JsonProperty(PropertyName = "properties.product")] public string Product { get; set; } - /// Premier add on offer Vendor. + + /// + /// Gets or sets premier add on offer Vendor. + /// + [JsonProperty(PropertyName = "properties.vendor")] public string Vendor { get; set; } - /// <code>true</code> if promotion code is required; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// promotion code is required; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.promoCodeRequired")] public bool? PromoCodeRequired { get; set; } - /// Premier add on offer Quota. + + /// + /// Gets or sets premier add on offer Quota. + /// + [JsonProperty(PropertyName = "properties.quota")] public int? Quota { get; set; } - /// App Service plans this offer is restricted to. + + /// + /// Gets or sets app Service plans this offer is restricted to. + /// Possible values include: 'None', 'Free', 'Shared', 'Basic', + /// 'Standard', 'Premium' + /// + [JsonProperty(PropertyName = "properties.webHostingPlanRestrictions")] public AppServicePlanRestrictions? WebHostingPlanRestrictions { get; set; } - /// Privacy policy URL. + + /// + /// Gets or sets privacy policy URL. + /// + [JsonProperty(PropertyName = "properties.privacyPolicyUrl")] public string PrivacyPolicyUrl { get; set; } - /// Legal terms URL. + + /// + /// Gets or sets legal terms URL. + /// + [JsonProperty(PropertyName = "properties.legalTermsUrl")] public string LegalTermsUrl { get; set; } - /// Marketplace publisher. + + /// + /// Gets or sets marketplace publisher. + /// + [JsonProperty(PropertyName = "properties.marketplacePublisher")] public string MarketplacePublisher { get; set; } - /// Marketplace offer. + + /// + /// Gets or sets marketplace offer. + /// + [JsonProperty(PropertyName = "properties.marketplaceOffer")] public string MarketplaceOffer { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.Serialization.cs deleted file mode 100644 index 1d60e24b46c6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class PremierAddOnOfferCollection - { - internal static PremierAddOnOfferCollection DeserializePremierAddOnOfferCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PremierAddOnOffer.DeserializePremierAddOnOffer(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new PremierAddOnOfferCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.cs deleted file mode 100644 index fa49335347a7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnOfferCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of premier add-on offers. - internal partial class PremierAddOnOfferCollection - { - /// Initializes a new instance of PremierAddOnOfferCollection. - /// Collection of resources. - /// is null. - internal PremierAddOnOfferCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of PremierAddOnOfferCollection. - /// Collection of resources. - /// Link to next page of resources. - internal PremierAddOnOfferCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.Serialization.cs deleted file mode 100644 index a7aa0c1a420c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.Serialization.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PremierAddOnPatchResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"); - writer.WriteStringValue(Sku); - } - if (Optional.IsDefined(Product)) - { - writer.WritePropertyName("product"); - writer.WriteStringValue(Product); - } - if (Optional.IsDefined(Vendor)) - { - writer.WritePropertyName("vendor"); - writer.WriteStringValue(Vendor); - } - if (Optional.IsDefined(MarketplacePublisher)) - { - writer.WritePropertyName("marketplacePublisher"); - writer.WriteStringValue(MarketplacePublisher); - } - if (Optional.IsDefined(MarketplaceOffer)) - { - writer.WritePropertyName("marketplaceOffer"); - writer.WriteStringValue(MarketplaceOffer); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static PremierAddOnPatchResource DeserializePremierAddOnPatchResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional sku = default; - Optional product = default; - Optional vendor = default; - Optional marketplacePublisher = default; - Optional marketplaceOffer = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("sku")) - { - sku = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("product")) - { - product = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("vendor")) - { - vendor = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("marketplacePublisher")) - { - marketplacePublisher = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("marketplaceOffer")) - { - marketplaceOffer = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new PremierAddOnPatchResource(id.Value, name.Value, kind.Value, type.Value, sku.Value, product.Value, vendor.Value, marketplacePublisher.Value, marketplaceOffer.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.cs index 04b2cfbd8b5b..db9df88b7a70 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PremierAddOnPatchResource.cs @@ -1,48 +1,93 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// ARM resource for a PremierAddOn. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// ARM resource for a PremierAddOn. + /// + [Rest.Serialization.JsonTransformation] public partial class PremierAddOnPatchResource : ProxyOnlyResource { - /// Initializes a new instance of PremierAddOnPatchResource. + /// + /// Initializes a new instance of the PremierAddOnPatchResource class. + /// public PremierAddOnPatchResource() { + CustomInit(); } - /// Initializes a new instance of PremierAddOnPatchResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Premier add on SKU. - /// Premier add on Product. - /// Premier add on Vendor. - /// Premier add on Marketplace publisher. - /// Premier add on Marketplace offer. - internal PremierAddOnPatchResource(string id, string name, string kind, string type, string sku, string product, string vendor, string marketplacePublisher, string marketplaceOffer) : base(id, name, kind, type) + /// + /// Initializes a new instance of the PremierAddOnPatchResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Premier add on SKU. + /// Premier add on Product. + /// Premier add on Vendor. + /// Premier add on Marketplace + /// publisher. + /// Premier add on Marketplace + /// offer. + public PremierAddOnPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string sku = default(string), string product = default(string), string vendor = default(string), string marketplacePublisher = default(string), string marketplaceOffer = default(string)) + : base(id, name, kind, type) { Sku = sku; Product = product; Vendor = vendor; MarketplacePublisher = marketplacePublisher; MarketplaceOffer = marketplaceOffer; + CustomInit(); } - /// Premier add on SKU. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets premier add on SKU. + /// + [JsonProperty(PropertyName = "properties.sku")] public string Sku { get; set; } - /// Premier add on Product. + + /// + /// Gets or sets premier add on Product. + /// + [JsonProperty(PropertyName = "properties.product")] public string Product { get; set; } - /// Premier add on Vendor. + + /// + /// Gets or sets premier add on Vendor. + /// + [JsonProperty(PropertyName = "properties.vendor")] public string Vendor { get; set; } - /// Premier add on Marketplace publisher. + + /// + /// Gets or sets premier add on Marketplace publisher. + /// + [JsonProperty(PropertyName = "properties.marketplacePublisher")] public string MarketplacePublisher { get; set; } - /// Premier add on Marketplace offer. + + /// + /// Gets or sets premier add on Marketplace offer. + /// + [JsonProperty(PropertyName = "properties.marketplaceOffer")] public string MarketplaceOffer { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.Serialization.cs deleted file mode 100644 index 551c4ed3a7ca..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.Serialization.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PrivateAccess : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsCollectionDefined(VirtualNetworks)) - { - writer.WritePropertyName("virtualNetworks"); - writer.WriteStartArray(); - foreach (var item in VirtualNetworks) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static PrivateAccess DeserializePrivateAccess(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional> virtualNetworks = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("virtualNetworks")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(PrivateAccessVirtualNetwork.DeserializePrivateAccessVirtualNetwork(item)); - } - virtualNetworks = array; - continue; - } - } - continue; - } - } - return new PrivateAccess(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), Optional.ToList(virtualNetworks)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.cs index 6bca1ca2c002..776a949db130 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccess.cs @@ -1,40 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Description of the parameters of Private Access for a Web Site. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Description of the parameters of Private Access for a Web Site. + /// + [Rest.Serialization.JsonTransformation] public partial class PrivateAccess : ProxyOnlyResource { - /// Initializes a new instance of PrivateAccess. + /// + /// Initializes a new instance of the PrivateAccess class. + /// public PrivateAccess() { - VirtualNetworks = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of PrivateAccess. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Whether private access is enabled or not. - /// The Virtual Networks (and subnets) allowed to access the site privately. - internal PrivateAccess(string id, string name, string kind, string type, bool? enabled, IList virtualNetworks) : base(id, name, kind, type) + /// + /// Initializes a new instance of the PrivateAccess class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Whether private access is enabled or + /// not. + /// The Virtual Networks (and subnets) + /// allowed to access the site privately. + public PrivateAccess(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), IList virtualNetworks = default(IList)) + : base(id, name, kind, type) { Enabled = enabled; VirtualNetworks = virtualNetworks; + CustomInit(); } - /// Whether private access is enabled or not. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets whether private access is enabled or not. + /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } - /// The Virtual Networks (and subnets) allowed to access the site privately. - public IList VirtualNetworks { get; } + + /// + /// Gets or sets the Virtual Networks (and subnets) allowed to access + /// the site privately. + /// + [JsonProperty(PropertyName = "properties.virtualNetworks")] + public IList VirtualNetworks { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.Serialization.cs deleted file mode 100644 index 47cf78a00d62..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.Serialization.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PrivateAccessSubnet : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Key)) - { - writer.WritePropertyName("key"); - writer.WriteNumberValue(Key.Value); - } - writer.WriteEndObject(); - } - - internal static PrivateAccessSubnet DeserializePrivateAccessSubnet(JsonElement element) - { - Optional name = default; - Optional key = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("key")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - key = property.Value.GetInt32(); - continue; - } - } - return new PrivateAccessSubnet(name.Value, Optional.ToNullable(key)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.cs index 4413fc4fcce6..ba29e37944d8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessSubnet.cs @@ -1,32 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Description of a Virtual Network subnet that is useable for private site access. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Description of a Virtual Network subnet that is useable for private + /// site access. + /// public partial class PrivateAccessSubnet { - /// Initializes a new instance of PrivateAccessSubnet. + /// + /// Initializes a new instance of the PrivateAccessSubnet class. + /// public PrivateAccessSubnet() { + CustomInit(); } - /// Initializes a new instance of PrivateAccessSubnet. - /// The name of the subnet. - /// The key (ID) of the subnet. - internal PrivateAccessSubnet(string name, int? key) + /// + /// Initializes a new instance of the PrivateAccessSubnet class. + /// + /// The name of the subnet. + /// The key (ID) of the subnet. + public PrivateAccessSubnet(string name = default(string), int? key = default(int?)) { Name = name; Key = key; + CustomInit(); } - /// The name of the subnet. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the subnet. + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// The key (ID) of the subnet. + + /// + /// Gets or sets the key (ID) of the subnet. + /// + [JsonProperty(PropertyName = "key")] public int? Key { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.Serialization.cs deleted file mode 100644 index f84bcbc24f37..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.Serialization.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PrivateAccessVirtualNetwork : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Key)) - { - writer.WritePropertyName("key"); - writer.WriteNumberValue(Key.Value); - } - if (Optional.IsDefined(ResourceId)) - { - writer.WritePropertyName("resourceId"); - writer.WriteStringValue(ResourceId); - } - if (Optional.IsCollectionDefined(Subnets)) - { - writer.WritePropertyName("subnets"); - writer.WriteStartArray(); - foreach (var item in Subnets) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static PrivateAccessVirtualNetwork DeserializePrivateAccessVirtualNetwork(JsonElement element) - { - Optional name = default; - Optional key = default; - Optional resourceId = default; - Optional> subnets = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("key")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - key = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("resourceId")) - { - resourceId = property.Value.GetString(); - continue; - } - if (property.NameEquals("subnets")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PrivateAccessSubnet.DeserializePrivateAccessSubnet(item)); - } - subnets = array; - continue; - } - } - return new PrivateAccessVirtualNetwork(name.Value, Optional.ToNullable(key), resourceId.Value, Optional.ToList(subnets)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.cs index c568a949bd4b..56c4af4f74f7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateAccessVirtualNetwork.cs @@ -1,44 +1,85 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Description of a Virtual Network that is useable for private site access. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Description of a Virtual Network that is useable for private site + /// access. + /// public partial class PrivateAccessVirtualNetwork { - /// Initializes a new instance of PrivateAccessVirtualNetwork. + /// + /// Initializes a new instance of the PrivateAccessVirtualNetwork + /// class. + /// public PrivateAccessVirtualNetwork() { - Subnets = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of PrivateAccessVirtualNetwork. - /// The name of the Virtual Network. - /// The key (ID) of the Virtual Network. - /// The ARM uri of the Virtual Network. - /// A List of subnets that access is allowed to on this Virtual Network. An empty array (but not null) is interpreted to mean that all subnets are allowed within this Virtual Network. - internal PrivateAccessVirtualNetwork(string name, int? key, string resourceId, IList subnets) + /// + /// Initializes a new instance of the PrivateAccessVirtualNetwork + /// class. + /// + /// The name of the Virtual Network. + /// The key (ID) of the Virtual Network. + /// The ARM uri of the Virtual Network + /// A List of subnets that access is allowed to + /// on this Virtual Network. An empty array (but not null) is + /// interpreted to mean that all subnets are allowed within this + /// Virtual Network. + public PrivateAccessVirtualNetwork(string name = default(string), int? key = default(int?), string resourceId = default(string), IList subnets = default(IList)) { Name = name; Key = key; ResourceId = resourceId; Subnets = subnets; + CustomInit(); } - /// The name of the Virtual Network. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the Virtual Network. + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// The key (ID) of the Virtual Network. + + /// + /// Gets or sets the key (ID) of the Virtual Network. + /// + [JsonProperty(PropertyName = "key")] public int? Key { get; set; } - /// The ARM uri of the Virtual Network. + + /// + /// Gets or sets the ARM uri of the Virtual Network + /// + [JsonProperty(PropertyName = "resourceId")] public string ResourceId { get; set; } - /// A List of subnets that access is allowed to on this Virtual Network. An empty array (but not null) is interpreted to mean that all subnets are allowed within this Virtual Network. - public IList Subnets { get; } + + /// + /// Gets or sets a List of subnets that access is allowed to on this + /// Virtual Network. An empty array (but not null) is interpreted to + /// mean that all subnets are allowed within this Virtual Network. + /// + [JsonProperty(PropertyName = "subnets")] + public IList Subnets { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.Serialization.cs deleted file mode 100644 index e9b0eea7adf3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class PrivateEndpointConnectionCollection - { - internal static PrivateEndpointConnectionCollection DeserializePrivateEndpointConnectionCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new PrivateEndpointConnectionCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.cs deleted file mode 100644 index 7acd559506dd..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The PrivateEndpointConnectionCollection. - internal partial class PrivateEndpointConnectionCollection - { - /// Initializes a new instance of PrivateEndpointConnectionCollection. - /// Collection of resources. - /// is null. - internal PrivateEndpointConnectionCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of PrivateEndpointConnectionCollection. - /// Collection of resources. - /// Link to next page of resources. - internal PrivateEndpointConnectionCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.Serialization.cs deleted file mode 100644 index a8c51d15e6ad..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.Serialization.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PrivateLinkConnectionApprovalRequestResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(PrivateLinkServiceConnectionState)) - { - writer.WritePropertyName("privateLinkServiceConnectionState"); - writer.WriteObjectValue(PrivateLinkServiceConnectionState); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static PrivateLinkConnectionApprovalRequestResource DeserializePrivateLinkConnectionApprovalRequestResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional privateLinkServiceConnectionState = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("privateLinkServiceConnectionState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - privateLinkServiceConnectionState = PrivateLinkConnectionState.DeserializePrivateLinkConnectionState(property0.Value); - continue; - } - } - continue; - } - } - return new PrivateLinkConnectionApprovalRequestResource(id.Value, name.Value, kind.Value, type.Value, privateLinkServiceConnectionState.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.cs index b80413e0e67f..ef3b3bd9df49 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionApprovalRequestResource.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Private Endpoint Connection Approval ARM resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Private Endpoint Connection Approval ARM resource. + /// + [Rest.Serialization.JsonTransformation] public partial class PrivateLinkConnectionApprovalRequestResource : ProxyOnlyResource { - /// Initializes a new instance of PrivateLinkConnectionApprovalRequestResource. + /// + /// Initializes a new instance of the + /// PrivateLinkConnectionApprovalRequestResource class. + /// public PrivateLinkConnectionApprovalRequestResource() { + CustomInit(); } - /// Initializes a new instance of PrivateLinkConnectionApprovalRequestResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The state of a private link connection. - internal PrivateLinkConnectionApprovalRequestResource(string id, string name, string kind, string type, PrivateLinkConnectionState privateLinkServiceConnectionState) : base(id, name, kind, type) + /// + /// Initializes a new instance of the + /// PrivateLinkConnectionApprovalRequestResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public PrivateLinkConnectionApprovalRequestResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), PrivateLinkConnectionState privateLinkServiceConnectionState = default(PrivateLinkConnectionState)) + : base(id, name, kind, type) { PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + CustomInit(); } - /// The state of a private link connection. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] public PrivateLinkConnectionState PrivateLinkServiceConnectionState { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.Serialization.cs deleted file mode 100644 index f5195018ddec..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.Serialization.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PrivateLinkConnectionState : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"); - writer.WriteStringValue(Status); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(ActionsRequired)) - { - writer.WritePropertyName("actionsRequired"); - writer.WriteStringValue(ActionsRequired); - } - writer.WriteEndObject(); - } - - internal static PrivateLinkConnectionState DeserializePrivateLinkConnectionState(JsonElement element) - { - Optional status = default; - Optional description = default; - Optional actionsRequired = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("status")) - { - status = property.Value.GetString(); - continue; - } - if (property.NameEquals("description")) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("actionsRequired")) - { - actionsRequired = property.Value.GetString(); - continue; - } - } - return new PrivateLinkConnectionState(status.Value, description.Value, actionsRequired.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.cs index bb409f6be32d..3b63407e7c0e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkConnectionState.cs @@ -1,36 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The state of a private link connection. + using Newtonsoft.Json; + using System.Linq; + + /// + /// The state of a private link connection + /// public partial class PrivateLinkConnectionState { - /// Initializes a new instance of PrivateLinkConnectionState. + /// + /// Initializes a new instance of the PrivateLinkConnectionState class. + /// public PrivateLinkConnectionState() { + CustomInit(); } - /// Initializes a new instance of PrivateLinkConnectionState. - /// Status of a private link connection. - /// Description of a private link connection. - /// ActionsRequired for a private link connection. - internal PrivateLinkConnectionState(string status, string description, string actionsRequired) + /// + /// Initializes a new instance of the PrivateLinkConnectionState class. + /// + /// Status of a private link connection + /// Description of a private link + /// connection + /// ActionsRequired for a private link + /// connection + public PrivateLinkConnectionState(string status = default(string), string description = default(string), string actionsRequired = default(string)) { Status = status; Description = description; ActionsRequired = actionsRequired; + CustomInit(); } - /// Status of a private link connection. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets status of a private link connection + /// + [JsonProperty(PropertyName = "status")] public string Status { get; set; } - /// Description of a private link connection. + + /// + /// Gets or sets description of a private link connection + /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } - /// ActionsRequired for a private link connection. + + /// + /// Gets or sets actionsRequired for a private link connection + /// + [JsonProperty(PropertyName = "actionsRequired")] public string ActionsRequired { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.Serialization.cs deleted file mode 100644 index ea62e1bde554..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PrivateLinkResource - { - internal static PrivateLinkResource DeserializePrivateLinkResource(JsonElement element) - { - string id = default; - string name = default; - string type = default; - PrivateLinkResourceProperties properties = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - properties = PrivateLinkResourceProperties.DeserializePrivateLinkResourceProperties(property.Value); - continue; - } - } - return new PrivateLinkResource(id, name, type, properties); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.cs index 3947310c8be2..16b30cfebcc3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResource.cs @@ -1,53 +1,98 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// A private link resource. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A private link resource + /// public partial class PrivateLinkResource { - /// Initializes a new instance of PrivateLinkResource. - /// . - /// Name of a private link resource. - /// . - /// Properties of a private link resource. - /// , , , or is null. - internal PrivateLinkResource(string id, string name, string type, PrivateLinkResourceProperties properties) + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + public PrivateLinkResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + /// Name of a private link resource + /// Properties of a private link + /// resource + public PrivateLinkResource(string id, string name, string type, PrivateLinkResourceProperties properties) { - if (id == null) + Id = id; + Name = name; + Type = type; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets name of a private link resource + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets properties of a private link resource + /// + [JsonProperty(PropertyName = "properties")] + public PrivateLinkResourceProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Id == null) { - throw new ArgumentNullException(nameof(id)); + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } - if (name == null) + if (Name == null) { - throw new ArgumentNullException(nameof(name)); + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } - if (type == null) + if (Type == null) { - throw new ArgumentNullException(nameof(type)); + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); } - if (properties == null) + if (Properties == null) { - throw new ArgumentNullException(nameof(properties)); + throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); } - - Id = id; - Name = name; - Type = type; - Properties = properties; } - - public string Id { get; } - /// Name of a private link resource. - public string Name { get; } - public string Type { get; } - /// Properties of a private link resource. - public PrivateLinkResourceProperties Properties { get; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.Serialization.cs deleted file mode 100644 index 05809f87e128..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.Serialization.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PrivateLinkResourceProperties - { - internal static PrivateLinkResourceProperties DeserializePrivateLinkResourceProperties(JsonElement element) - { - Optional groupId = default; - Optional> requiredMembers = default; - Optional> requiredZoneNames = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("groupId")) - { - groupId = property.Value.GetString(); - continue; - } - if (property.NameEquals("requiredMembers")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - requiredMembers = array; - continue; - } - if (property.NameEquals("requiredZoneNames")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - requiredZoneNames = array; - continue; - } - } - return new PrivateLinkResourceProperties(groupId.Value, Optional.ToList(requiredMembers), Optional.ToList(requiredZoneNames)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.cs index 7f7228168e03..e421a58138e6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourceProperties.cs @@ -1,41 +1,73 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Properties of a private link resource. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties of a private link resource + /// public partial class PrivateLinkResourceProperties { - /// Initializes a new instance of PrivateLinkResourceProperties. - internal PrivateLinkResourceProperties() + /// + /// Initializes a new instance of the PrivateLinkResourceProperties + /// class. + /// + public PrivateLinkResourceProperties() { - RequiredMembers = new ChangeTrackingList(); - RequiredZoneNames = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of PrivateLinkResourceProperties. - /// GroupId of a private link resource. - /// RequiredMembers of a private link resource. - /// RequiredZoneNames of a private link resource. - internal PrivateLinkResourceProperties(string groupId, IReadOnlyList requiredMembers, IReadOnlyList requiredZoneNames) + /// + /// Initializes a new instance of the PrivateLinkResourceProperties + /// class. + /// + /// GroupId of a private link resource + /// RequiredMembers of a private link + /// resource + /// RequiredZoneNames of a private link + /// resource + public PrivateLinkResourceProperties(string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList)) { GroupId = groupId; RequiredMembers = requiredMembers; RequiredZoneNames = requiredZoneNames; + CustomInit(); } - /// GroupId of a private link resource. - public string GroupId { get; } - /// RequiredMembers of a private link resource. - public IReadOnlyList RequiredMembers { get; } - /// RequiredZoneNames of a private link resource. - public IReadOnlyList RequiredZoneNames { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets groupId of a private link resource + /// + [JsonProperty(PropertyName = "groupId")] + public string GroupId { get; private set; } + + /// + /// Gets requiredMembers of a private link resource + /// + [JsonProperty(PropertyName = "requiredMembers")] + public IList RequiredMembers { get; private set; } + + /// + /// Gets requiredZoneNames of a private link resource + /// + [JsonProperty(PropertyName = "requiredZoneNames")] + public IList RequiredZoneNames { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs deleted file mode 100644 index 93e60333a262..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PrivateLinkResourcesWrapper - { - internal static PrivateLinkResourcesWrapper DeserializePrivateLinkResourcesWrapper(JsonElement element) - { - IReadOnlyList value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PrivateLinkResource.DeserializePrivateLinkResource(item)); - } - value = array; - continue; - } - } - return new PrivateLinkResourcesWrapper(value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.cs index 06b51d154804..0aed6d8e9f87 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateLinkResourcesWrapper.cs @@ -1,39 +1,77 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; +// 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.WebSites.Models { - /// Wrapper for a collection of private link resources. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Wrapper for a collection of private link resources + /// public partial class PrivateLinkResourcesWrapper { - /// Initializes a new instance of PrivateLinkResourcesWrapper. - /// . - /// is null. - internal PrivateLinkResourcesWrapper(IEnumerable value) + /// + /// Initializes a new instance of the PrivateLinkResourcesWrapper + /// class. + /// + public PrivateLinkResourcesWrapper() { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); + CustomInit(); } - /// Initializes a new instance of PrivateLinkResourcesWrapper. - /// . - internal PrivateLinkResourcesWrapper(IReadOnlyList value) + /// + /// Initializes a new instance of the PrivateLinkResourcesWrapper + /// class. + /// + public PrivateLinkResourcesWrapper(IList value) { Value = value; + CustomInit(); } - public IReadOnlyList Value { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + if (Value != null) + { + foreach (var element in Value) + { + if (element != null) + { + element.Validate(); + } + } + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.Serialization.cs deleted file mode 100644 index bfffa6b5fb31..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.Serialization.cs +++ /dev/null @@ -1,642 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ProcessInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(DeploymentName)) - { - writer.WritePropertyName("deployment_name"); - writer.WriteStringValue(DeploymentName); - } - if (Optional.IsDefined(Href)) - { - writer.WritePropertyName("href"); - writer.WriteStringValue(Href); - } - if (Optional.IsDefined(Minidump)) - { - writer.WritePropertyName("minidump"); - writer.WriteStringValue(Minidump); - } - if (Optional.IsDefined(IsProfileRunning)) - { - writer.WritePropertyName("is_profile_running"); - writer.WriteBooleanValue(IsProfileRunning.Value); - } - if (Optional.IsDefined(IsIisProfileRunning)) - { - writer.WritePropertyName("is_iis_profile_running"); - writer.WriteBooleanValue(IsIisProfileRunning.Value); - } - if (Optional.IsDefined(IisProfileTimeoutInSeconds)) - { - writer.WritePropertyName("iis_profile_timeout_in_seconds"); - writer.WriteNumberValue(IisProfileTimeoutInSeconds.Value); - } - if (Optional.IsDefined(Parent)) - { - writer.WritePropertyName("parent"); - writer.WriteStringValue(Parent); - } - if (Optional.IsCollectionDefined(Children)) - { - writer.WritePropertyName("children"); - writer.WriteStartArray(); - foreach (var item in Children) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Threads)) - { - writer.WritePropertyName("threads"); - writer.WriteStartArray(); - foreach (var item in Threads) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(OpenFileHandles)) - { - writer.WritePropertyName("open_file_handles"); - writer.WriteStartArray(); - foreach (var item in OpenFileHandles) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Modules)) - { - writer.WritePropertyName("modules"); - writer.WriteStartArray(); - foreach (var item in Modules) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(FileName)) - { - writer.WritePropertyName("file_name"); - writer.WriteStringValue(FileName); - } - if (Optional.IsDefined(CommandLine)) - { - writer.WritePropertyName("command_line"); - writer.WriteStringValue(CommandLine); - } - if (Optional.IsDefined(UserName)) - { - writer.WritePropertyName("user_name"); - writer.WriteStringValue(UserName); - } - if (Optional.IsDefined(HandleCount)) - { - writer.WritePropertyName("handle_count"); - writer.WriteNumberValue(HandleCount.Value); - } - if (Optional.IsDefined(ModuleCount)) - { - writer.WritePropertyName("module_count"); - writer.WriteNumberValue(ModuleCount.Value); - } - if (Optional.IsDefined(ThreadCount)) - { - writer.WritePropertyName("thread_count"); - writer.WriteNumberValue(ThreadCount.Value); - } - if (Optional.IsDefined(StartTime)) - { - writer.WritePropertyName("start_time"); - writer.WriteStringValue(StartTime.Value, "O"); - } - if (Optional.IsDefined(TotalCpuTime)) - { - writer.WritePropertyName("total_cpu_time"); - writer.WriteStringValue(TotalCpuTime); - } - if (Optional.IsDefined(UserCpuTime)) - { - writer.WritePropertyName("user_cpu_time"); - writer.WriteStringValue(UserCpuTime); - } - if (Optional.IsDefined(PrivilegedCpuTime)) - { - writer.WritePropertyName("privileged_cpu_time"); - writer.WriteStringValue(PrivilegedCpuTime); - } - if (Optional.IsDefined(WorkingSet)) - { - writer.WritePropertyName("working_set"); - writer.WriteNumberValue(WorkingSet.Value); - } - if (Optional.IsDefined(PeakWorkingSet)) - { - writer.WritePropertyName("peak_working_set"); - writer.WriteNumberValue(PeakWorkingSet.Value); - } - if (Optional.IsDefined(PrivateMemory)) - { - writer.WritePropertyName("private_memory"); - writer.WriteNumberValue(PrivateMemory.Value); - } - if (Optional.IsDefined(VirtualMemory)) - { - writer.WritePropertyName("virtual_memory"); - writer.WriteNumberValue(VirtualMemory.Value); - } - if (Optional.IsDefined(PeakVirtualMemory)) - { - writer.WritePropertyName("peak_virtual_memory"); - writer.WriteNumberValue(PeakVirtualMemory.Value); - } - if (Optional.IsDefined(PagedSystemMemory)) - { - writer.WritePropertyName("paged_system_memory"); - writer.WriteNumberValue(PagedSystemMemory.Value); - } - if (Optional.IsDefined(NonPagedSystemMemory)) - { - writer.WritePropertyName("non_paged_system_memory"); - writer.WriteNumberValue(NonPagedSystemMemory.Value); - } - if (Optional.IsDefined(PagedMemory)) - { - writer.WritePropertyName("paged_memory"); - writer.WriteNumberValue(PagedMemory.Value); - } - if (Optional.IsDefined(PeakPagedMemory)) - { - writer.WritePropertyName("peak_paged_memory"); - writer.WriteNumberValue(PeakPagedMemory.Value); - } - if (Optional.IsDefined(TimeStamp)) - { - writer.WritePropertyName("time_stamp"); - writer.WriteStringValue(TimeStamp.Value, "O"); - } - if (Optional.IsCollectionDefined(EnvironmentVariables)) - { - writer.WritePropertyName("environment_variables"); - writer.WriteStartObject(); - foreach (var item in EnvironmentVariables) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(IsScmSite)) - { - writer.WritePropertyName("is_scm_site"); - writer.WriteBooleanValue(IsScmSite.Value); - } - if (Optional.IsDefined(IsWebjob)) - { - writer.WritePropertyName("is_webjob"); - writer.WriteBooleanValue(IsWebjob.Value); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"); - writer.WriteStringValue(Description); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ProcessInfo DeserializeProcessInfo(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional identifier = default; - Optional deploymentName = default; - Optional href = default; - Optional minidump = default; - Optional isProfileRunning = default; - Optional isIisProfileRunning = default; - Optional iisProfileTimeoutInSeconds = default; - Optional parent = default; - Optional> children = default; - Optional> threads = default; - Optional> openFileHandles = default; - Optional> modules = default; - Optional fileName = default; - Optional commandLine = default; - Optional userName = default; - Optional handleCount = default; - Optional moduleCount = default; - Optional threadCount = default; - Optional startTime = default; - Optional totalCpuTime = default; - Optional userCpuTime = default; - Optional privilegedCpuTime = default; - Optional workingSet = default; - Optional peakWorkingSet = default; - Optional privateMemory = default; - Optional virtualMemory = default; - Optional peakVirtualMemory = default; - Optional pagedSystemMemory = default; - Optional nonPagedSystemMemory = default; - Optional pagedMemory = default; - Optional peakPagedMemory = default; - Optional timeStamp = default; - Optional> environmentVariables = default; - Optional isScmSite = default; - Optional isWebjob = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("identifier")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - identifier = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("deployment_name")) - { - deploymentName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("href")) - { - href = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("minidump")) - { - minidump = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("is_profile_running")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isProfileRunning = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("is_iis_profile_running")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isIisProfileRunning = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("iis_profile_timeout_in_seconds")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - iisProfileTimeoutInSeconds = property0.Value.GetDouble(); - continue; - } - if (property0.NameEquals("parent")) - { - parent = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("children")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - children = array; - continue; - } - if (property0.NameEquals("threads")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ProcessThreadInfo.DeserializeProcessThreadInfo(item)); - } - threads = array; - continue; - } - if (property0.NameEquals("open_file_handles")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - openFileHandles = array; - continue; - } - if (property0.NameEquals("modules")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ProcessModuleInfo.DeserializeProcessModuleInfo(item)); - } - modules = array; - continue; - } - if (property0.NameEquals("file_name")) - { - fileName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("command_line")) - { - commandLine = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("user_name")) - { - userName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("handle_count")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - handleCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("module_count")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - moduleCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("thread_count")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - threadCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("start_time")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("total_cpu_time")) - { - totalCpuTime = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("user_cpu_time")) - { - userCpuTime = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("privileged_cpu_time")) - { - privilegedCpuTime = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("working_set")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - workingSet = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("peak_working_set")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - peakWorkingSet = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("private_memory")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - privateMemory = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("virtual_memory")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - virtualMemory = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("peak_virtual_memory")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - peakVirtualMemory = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("paged_system_memory")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - pagedSystemMemory = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("non_paged_system_memory")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - nonPagedSystemMemory = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("paged_memory")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - pagedMemory = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("peak_paged_memory")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - peakPagedMemory = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("time_stamp")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - timeStamp = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("environment_variables")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetString()); - } - environmentVariables = dictionary; - continue; - } - if (property0.NameEquals("is_scm_site")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isScmSite = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("is_webjob")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isWebjob = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("description")) - { - description = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new ProcessInfo(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(identifier), deploymentName.Value, href.Value, minidump.Value, Optional.ToNullable(isProfileRunning), Optional.ToNullable(isIisProfileRunning), Optional.ToNullable(iisProfileTimeoutInSeconds), parent.Value, Optional.ToList(children), Optional.ToList(threads), Optional.ToList(openFileHandles), Optional.ToList(modules), fileName.Value, commandLine.Value, userName.Value, Optional.ToNullable(handleCount), Optional.ToNullable(moduleCount), Optional.ToNullable(threadCount), Optional.ToNullable(startTime), totalCpuTime.Value, userCpuTime.Value, privilegedCpuTime.Value, Optional.ToNullable(workingSet), Optional.ToNullable(peakWorkingSet), Optional.ToNullable(privateMemory), Optional.ToNullable(virtualMemory), Optional.ToNullable(peakVirtualMemory), Optional.ToNullable(pagedSystemMemory), Optional.ToNullable(nonPagedSystemMemory), Optional.ToNullable(pagedMemory), Optional.ToNullable(peakPagedMemory), Optional.ToNullable(timeStamp), Optional.ToDictionary(environmentVariables), Optional.ToNullable(isScmSite), Optional.ToNullable(isWebjob), description.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.cs index 4064f7e553f1..a8bf754df141 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfo.cs @@ -1,71 +1,84 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Process Information. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Process Information. + /// + [Rest.Serialization.JsonTransformation] public partial class ProcessInfo : ProxyOnlyResource { - /// Initializes a new instance of ProcessInfo. + /// + /// Initializes a new instance of the ProcessInfo class. + /// public ProcessInfo() { - Children = new ChangeTrackingList(); - Threads = new ChangeTrackingList(); - OpenFileHandles = new ChangeTrackingList(); - Modules = new ChangeTrackingList(); - EnvironmentVariables = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of ProcessInfo. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// ARM Identifier for deployment. - /// Deployment name. - /// HRef URI. - /// Minidump URI. - /// Is profile running?. - /// Is the IIS Profile running?. - /// IIS Profile timeout (seconds). - /// Parent process. - /// Child process list. - /// Thread list. - /// List of open files. - /// List of modules. - /// File name of this process. - /// Command line. - /// User name. - /// Handle count. - /// Module count. - /// Thread count. - /// Start time. - /// Total CPU time. - /// User CPU time. - /// Privileged CPU time. - /// Working set. - /// Peak working set. - /// Private memory size. - /// Virtual memory size. - /// Peak virtual memory usage. - /// Paged system memory. - /// Non-paged system memory. - /// Paged memory. - /// Peak paged memory. - /// Time stamp. - /// List of environment variables. - /// Is this the SCM site?. - /// Is this a Web Job?. - /// Description of process. - internal ProcessInfo(string id, string name, string kind, string type, int? identifier, string deploymentName, string href, string minidump, bool? isProfileRunning, bool? isIisProfileRunning, double? iisProfileTimeoutInSeconds, string parent, IList children, IList threads, IList openFileHandles, IList modules, string fileName, string commandLine, string userName, int? handleCount, int? moduleCount, int? threadCount, DateTimeOffset? startTime, string totalCpuTime, string userCpuTime, string privilegedCpuTime, long? workingSet, long? peakWorkingSet, long? privateMemory, long? virtualMemory, long? peakVirtualMemory, long? pagedSystemMemory, long? nonPagedSystemMemory, long? pagedMemory, long? peakPagedMemory, DateTimeOffset? timeStamp, IDictionary environmentVariables, bool? isScmSite, bool? isWebjob, string description) : base(id, name, kind, type) + /// + /// Initializes a new instance of the ProcessInfo class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// ARM Identifier for deployment. + /// Deployment name. + /// HRef URI. + /// Minidump URI. + /// Is profile running? + /// Is the IIS Profile + /// running? + /// IIS Profile timeout + /// (seconds). + /// Parent process. + /// Child process list. + /// Thread list. + /// List of open files. + /// List of modules. + /// File name of this process. + /// Command line. + /// User name. + /// Handle count. + /// Module count. + /// Thread count. + /// Start time. + /// Total CPU time. + /// User CPU time. + /// Privileged CPU time. + /// Working set. + /// Peak working set. + /// Private memory size. + /// Virtual memory size. + /// Peak virtual memory usage. + /// Paged system memory. + /// Non-paged system memory. + /// Paged memory. + /// Peak paged memory. + /// Time stamp. + /// List of environment + /// variables. + /// Is this the SCM site? + /// Is this a Web Job? + /// Description of process. + public ProcessInfo(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? identifier = default(int?), string deploymentName = default(string), string href = default(string), string minidump = default(string), bool? isProfileRunning = default(bool?), bool? isIisProfileRunning = default(bool?), double? iisProfileTimeoutInSeconds = default(double?), string parent = default(string), IList children = default(IList), IList threads = default(IList), IList openFileHandles = default(IList), IList modules = default(IList), string fileName = default(string), string commandLine = default(string), string userName = default(string), int? handleCount = default(int?), int? moduleCount = default(int?), int? threadCount = default(int?), System.DateTime? startTime = default(System.DateTime?), string totalCpuTime = default(string), string userCpuTime = default(string), string privilegedCpuTime = default(string), long? workingSet = default(long?), long? peakWorkingSet = default(long?), long? privateMemory = default(long?), long? virtualMemory = default(long?), long? peakVirtualMemory = default(long?), long? pagedSystemMemory = default(long?), long? nonPagedSystemMemory = default(long?), long? pagedMemory = default(long?), long? peakPagedMemory = default(long?), System.DateTime? timeStamp = default(System.DateTime?), IDictionary environmentVariables = default(IDictionary), bool? isScmSite = default(bool?), bool? isWebjob = default(bool?), string description = default(string)) + : base(id, name, kind, type) { Identifier = identifier; DeploymentName = deploymentName; @@ -103,79 +116,229 @@ internal ProcessInfo(string id, string name, string kind, string type, int? iden IsScmSite = isScmSite; IsWebjob = isWebjob; Description = description; + CustomInit(); } - /// ARM Identifier for deployment. - public int? Identifier { get; } - /// Deployment name. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets ARM Identifier for deployment. + /// + [JsonProperty(PropertyName = "properties.identifier")] + public int? Identifier { get; private set; } + + /// + /// Gets or sets deployment name. + /// + [JsonProperty(PropertyName = "properties.deployment_name")] public string DeploymentName { get; set; } - /// HRef URI. + + /// + /// Gets or sets hRef URI. + /// + [JsonProperty(PropertyName = "properties.href")] public string Href { get; set; } - /// Minidump URI. + + /// + /// Gets or sets minidump URI. + /// + [JsonProperty(PropertyName = "properties.minidump")] public string Minidump { get; set; } - /// Is profile running?. + + /// + /// Gets or sets is profile running? + /// + [JsonProperty(PropertyName = "properties.is_profile_running")] public bool? IsProfileRunning { get; set; } - /// Is the IIS Profile running?. + + /// + /// Gets or sets is the IIS Profile running? + /// + [JsonProperty(PropertyName = "properties.is_iis_profile_running")] public bool? IsIisProfileRunning { get; set; } - /// IIS Profile timeout (seconds). + + /// + /// Gets or sets IIS Profile timeout (seconds). + /// + [JsonProperty(PropertyName = "properties.iis_profile_timeout_in_seconds")] public double? IisProfileTimeoutInSeconds { get; set; } - /// Parent process. + + /// + /// Gets or sets parent process. + /// + [JsonProperty(PropertyName = "properties.parent")] public string Parent { get; set; } - /// Child process list. - public IList Children { get; } - /// Thread list. - public IList Threads { get; } - /// List of open files. - public IList OpenFileHandles { get; } - /// List of modules. - public IList Modules { get; } - /// File name of this process. + + /// + /// Gets or sets child process list. + /// + [JsonProperty(PropertyName = "properties.children")] + public IList Children { get; set; } + + /// + /// Gets or sets thread list. + /// + [JsonProperty(PropertyName = "properties.threads")] + public IList Threads { get; set; } + + /// + /// Gets or sets list of open files. + /// + [JsonProperty(PropertyName = "properties.open_file_handles")] + public IList OpenFileHandles { get; set; } + + /// + /// Gets or sets list of modules. + /// + [JsonProperty(PropertyName = "properties.modules")] + public IList Modules { get; set; } + + /// + /// Gets or sets file name of this process. + /// + [JsonProperty(PropertyName = "properties.file_name")] public string FileName { get; set; } - /// Command line. + + /// + /// Gets or sets command line. + /// + [JsonProperty(PropertyName = "properties.command_line")] public string CommandLine { get; set; } - /// User name. + + /// + /// Gets or sets user name. + /// + [JsonProperty(PropertyName = "properties.user_name")] public string UserName { get; set; } - /// Handle count. + + /// + /// Gets or sets handle count. + /// + [JsonProperty(PropertyName = "properties.handle_count")] public int? HandleCount { get; set; } - /// Module count. + + /// + /// Gets or sets module count. + /// + [JsonProperty(PropertyName = "properties.module_count")] public int? ModuleCount { get; set; } - /// Thread count. + + /// + /// Gets or sets thread count. + /// + [JsonProperty(PropertyName = "properties.thread_count")] public int? ThreadCount { get; set; } - /// Start time. - public DateTimeOffset? StartTime { get; set; } - /// Total CPU time. + + /// + /// Gets or sets start time. + /// + [JsonProperty(PropertyName = "properties.start_time")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets total CPU time. + /// + [JsonProperty(PropertyName = "properties.total_cpu_time")] public string TotalCpuTime { get; set; } - /// User CPU time. + + /// + /// Gets or sets user CPU time. + /// + [JsonProperty(PropertyName = "properties.user_cpu_time")] public string UserCpuTime { get; set; } - /// Privileged CPU time. + + /// + /// Gets or sets privileged CPU time. + /// + [JsonProperty(PropertyName = "properties.privileged_cpu_time")] public string PrivilegedCpuTime { get; set; } - /// Working set. + + /// + /// Gets or sets working set. + /// + [JsonProperty(PropertyName = "properties.working_set")] public long? WorkingSet { get; set; } - /// Peak working set. + + /// + /// Gets or sets peak working set. + /// + [JsonProperty(PropertyName = "properties.peak_working_set")] public long? PeakWorkingSet { get; set; } - /// Private memory size. + + /// + /// Gets or sets private memory size. + /// + [JsonProperty(PropertyName = "properties.private_memory")] public long? PrivateMemory { get; set; } - /// Virtual memory size. + + /// + /// Gets or sets virtual memory size. + /// + [JsonProperty(PropertyName = "properties.virtual_memory")] public long? VirtualMemory { get; set; } - /// Peak virtual memory usage. + + /// + /// Gets or sets peak virtual memory usage. + /// + [JsonProperty(PropertyName = "properties.peak_virtual_memory")] public long? PeakVirtualMemory { get; set; } - /// Paged system memory. + + /// + /// Gets or sets paged system memory. + /// + [JsonProperty(PropertyName = "properties.paged_system_memory")] public long? PagedSystemMemory { get; set; } - /// Non-paged system memory. + + /// + /// Gets or sets non-paged system memory. + /// + [JsonProperty(PropertyName = "properties.non_paged_system_memory")] public long? NonPagedSystemMemory { get; set; } - /// Paged memory. + + /// + /// Gets or sets paged memory. + /// + [JsonProperty(PropertyName = "properties.paged_memory")] public long? PagedMemory { get; set; } - /// Peak paged memory. + + /// + /// Gets or sets peak paged memory. + /// + [JsonProperty(PropertyName = "properties.peak_paged_memory")] public long? PeakPagedMemory { get; set; } - /// Time stamp. - public DateTimeOffset? TimeStamp { get; set; } - /// List of environment variables. - public IDictionary EnvironmentVariables { get; } - /// Is this the SCM site?. + + /// + /// Gets or sets time stamp. + /// + [JsonProperty(PropertyName = "properties.time_stamp")] + public System.DateTime? TimeStamp { get; set; } + + /// + /// Gets or sets list of environment variables. + /// + [JsonProperty(PropertyName = "properties.environment_variables")] + public IDictionary EnvironmentVariables { get; set; } + + /// + /// Gets or sets is this the SCM site? + /// + [JsonProperty(PropertyName = "properties.is_scm_site")] public bool? IsScmSite { get; set; } - /// Is this a Web Job?. + + /// + /// Gets or sets is this a Web Job? + /// + [JsonProperty(PropertyName = "properties.is_webjob")] public bool? IsWebjob { get; set; } - /// Description of process. + + /// + /// Gets or sets description of process. + /// + [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.Serialization.cs deleted file mode 100644 index 0f43cc2464d4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class ProcessInfoCollection - { - internal static ProcessInfoCollection DeserializeProcessInfoCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ProcessInfo.DeserializeProcessInfo(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ProcessInfoCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.cs deleted file mode 100644 index 712ff0ff45e0..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessInfoCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Kudu process information elements. - internal partial class ProcessInfoCollection - { - /// Initializes a new instance of ProcessInfoCollection. - /// Collection of resources. - /// is null. - internal ProcessInfoCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of ProcessInfoCollection. - /// Collection of resources. - /// Link to next page of resources. - internal ProcessInfoCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.Serialization.cs deleted file mode 100644 index f83ebdf1fb19..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.Serialization.cs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ProcessModuleInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(BaseAddress)) - { - writer.WritePropertyName("base_address"); - writer.WriteStringValue(BaseAddress); - } - if (Optional.IsDefined(FileName)) - { - writer.WritePropertyName("file_name"); - writer.WriteStringValue(FileName); - } - if (Optional.IsDefined(Href)) - { - writer.WritePropertyName("href"); - writer.WriteStringValue(Href); - } - if (Optional.IsDefined(FilePath)) - { - writer.WritePropertyName("file_path"); - writer.WriteStringValue(FilePath); - } - if (Optional.IsDefined(ModuleMemorySize)) - { - writer.WritePropertyName("module_memory_size"); - writer.WriteNumberValue(ModuleMemorySize.Value); - } - if (Optional.IsDefined(FileVersion)) - { - writer.WritePropertyName("file_version"); - writer.WriteStringValue(FileVersion); - } - if (Optional.IsDefined(FileDescription)) - { - writer.WritePropertyName("file_description"); - writer.WriteStringValue(FileDescription); - } - if (Optional.IsDefined(Product)) - { - writer.WritePropertyName("product"); - writer.WriteStringValue(Product); - } - if (Optional.IsDefined(ProductVersion)) - { - writer.WritePropertyName("product_version"); - writer.WriteStringValue(ProductVersion); - } - if (Optional.IsDefined(IsDebug)) - { - writer.WritePropertyName("is_debug"); - writer.WriteBooleanValue(IsDebug.Value); - } - if (Optional.IsDefined(Language)) - { - writer.WritePropertyName("language"); - writer.WriteStringValue(Language); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ProcessModuleInfo DeserializeProcessModuleInfo(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional baseAddress = default; - Optional fileName = default; - Optional href = default; - Optional filePath = default; - Optional moduleMemorySize = default; - Optional fileVersion = default; - Optional fileDescription = default; - Optional product = default; - Optional productVersion = default; - Optional isDebug = default; - Optional language = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("base_address")) - { - baseAddress = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("file_name")) - { - fileName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("href")) - { - href = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("file_path")) - { - filePath = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("module_memory_size")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - moduleMemorySize = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("file_version")) - { - fileVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("file_description")) - { - fileDescription = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("product")) - { - product = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("product_version")) - { - productVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("is_debug")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isDebug = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("language")) - { - language = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new ProcessModuleInfo(id.Value, name.Value, kind.Value, type.Value, baseAddress.Value, fileName.Value, href.Value, filePath.Value, Optional.ToNullable(moduleMemorySize), fileVersion.Value, fileDescription.Value, product.Value, productVersion.Value, Optional.ToNullable(isDebug), language.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.cs index b034571f20ee..3f3c4a14c836 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfo.cs @@ -1,37 +1,55 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Process Module Information. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Process Module Information. + /// + [Rest.Serialization.JsonTransformation] public partial class ProcessModuleInfo : ProxyOnlyResource { - /// Initializes a new instance of ProcessModuleInfo. + /// + /// Initializes a new instance of the ProcessModuleInfo class. + /// public ProcessModuleInfo() { + CustomInit(); } - /// Initializes a new instance of ProcessModuleInfo. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Base address. Used as module identifier in ARM resource URI. - /// File name. - /// HRef URI. - /// File path. - /// Module memory size. - /// File version. - /// File description. - /// Product name. - /// Product version. - /// Is debug?. - /// Module language (locale). - internal ProcessModuleInfo(string id, string name, string kind, string type, string baseAddress, string fileName, string href, string filePath, int? moduleMemorySize, string fileVersion, string fileDescription, string product, string productVersion, bool? isDebug, string language) : base(id, name, kind, type) + /// + /// Initializes a new instance of the ProcessModuleInfo class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Base address. Used as module identifier + /// in ARM resource URI. + /// File name. + /// HRef URI. + /// File path. + /// Module memory size. + /// File version. + /// File description. + /// Product name. + /// Product version. + /// Is debug? + /// Module language (locale). + public ProcessModuleInfo(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string baseAddress = default(string), string fileName = default(string), string href = default(string), string filePath = default(string), int? moduleMemorySize = default(int?), string fileVersion = default(string), string fileDescription = default(string), string product = default(string), string productVersion = default(string), bool? isDebug = default(bool?), string language = default(string)) + : base(id, name, kind, type) { BaseAddress = baseAddress; FileName = fileName; @@ -44,29 +62,80 @@ internal ProcessModuleInfo(string id, string name, string kind, string type, str ProductVersion = productVersion; IsDebug = isDebug; Language = language; + CustomInit(); } - /// Base address. Used as module identifier in ARM resource URI. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets base address. Used as module identifier in ARM + /// resource URI. + /// + [JsonProperty(PropertyName = "properties.base_address")] public string BaseAddress { get; set; } - /// File name. + + /// + /// Gets or sets file name. + /// + [JsonProperty(PropertyName = "properties.file_name")] public string FileName { get; set; } - /// HRef URI. + + /// + /// Gets or sets hRef URI. + /// + [JsonProperty(PropertyName = "properties.href")] public string Href { get; set; } - /// File path. + + /// + /// Gets or sets file path. + /// + [JsonProperty(PropertyName = "properties.file_path")] public string FilePath { get; set; } - /// Module memory size. + + /// + /// Gets or sets module memory size. + /// + [JsonProperty(PropertyName = "properties.module_memory_size")] public int? ModuleMemorySize { get; set; } - /// File version. + + /// + /// Gets or sets file version. + /// + [JsonProperty(PropertyName = "properties.file_version")] public string FileVersion { get; set; } - /// File description. + + /// + /// Gets or sets file description. + /// + [JsonProperty(PropertyName = "properties.file_description")] public string FileDescription { get; set; } - /// Product name. + + /// + /// Gets or sets product name. + /// + [JsonProperty(PropertyName = "properties.product")] public string Product { get; set; } - /// Product version. + + /// + /// Gets or sets product version. + /// + [JsonProperty(PropertyName = "properties.product_version")] public string ProductVersion { get; set; } - /// Is debug?. + + /// + /// Gets or sets is debug? + /// + [JsonProperty(PropertyName = "properties.is_debug")] public bool? IsDebug { get; set; } - /// Module language (locale). + + /// + /// Gets or sets module language (locale). + /// + [JsonProperty(PropertyName = "properties.language")] public string Language { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.Serialization.cs deleted file mode 100644 index 50f17470ed0a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class ProcessModuleInfoCollection - { - internal static ProcessModuleInfoCollection DeserializeProcessModuleInfoCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ProcessModuleInfo.DeserializeProcessModuleInfo(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ProcessModuleInfoCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.cs deleted file mode 100644 index a919e7df1722..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessModuleInfoCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Kudu thread information elements. - internal partial class ProcessModuleInfoCollection - { - /// Initializes a new instance of ProcessModuleInfoCollection. - /// Collection of resources. - /// is null. - internal ProcessModuleInfoCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of ProcessModuleInfoCollection. - /// Collection of resources. - /// Link to next page of resources. - internal ProcessModuleInfoCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.Serialization.cs deleted file mode 100644 index 30b10fb858ef..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.Serialization.cs +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ProcessThreadInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Href)) - { - writer.WritePropertyName("href"); - writer.WriteStringValue(Href); - } - if (Optional.IsDefined(Process)) - { - writer.WritePropertyName("process"); - writer.WriteStringValue(Process); - } - if (Optional.IsDefined(StartAddress)) - { - writer.WritePropertyName("start_address"); - writer.WriteStringValue(StartAddress); - } - if (Optional.IsDefined(CurrentPriority)) - { - writer.WritePropertyName("current_priority"); - writer.WriteNumberValue(CurrentPriority.Value); - } - if (Optional.IsDefined(PriorityLevel)) - { - writer.WritePropertyName("priority_level"); - writer.WriteStringValue(PriorityLevel); - } - if (Optional.IsDefined(BasePriority)) - { - writer.WritePropertyName("base_priority"); - writer.WriteNumberValue(BasePriority.Value); - } - if (Optional.IsDefined(StartTime)) - { - writer.WritePropertyName("start_time"); - writer.WriteStringValue(StartTime.Value, "O"); - } - if (Optional.IsDefined(TotalProcessorTime)) - { - writer.WritePropertyName("total_processor_time"); - writer.WriteStringValue(TotalProcessorTime); - } - if (Optional.IsDefined(UserProcessorTime)) - { - writer.WritePropertyName("user_processor_time"); - writer.WriteStringValue(UserProcessorTime); - } - if (Optional.IsDefined(State)) - { - writer.WritePropertyName("state"); - writer.WriteStringValue(State); - } - if (Optional.IsDefined(WaitReason)) - { - writer.WritePropertyName("wait_reason"); - writer.WriteStringValue(WaitReason); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ProcessThreadInfo DeserializeProcessThreadInfo(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional identifier = default; - Optional href = default; - Optional process = default; - Optional startAddress = default; - Optional currentPriority = default; - Optional priorityLevel = default; - Optional basePriority = default; - Optional startTime = default; - Optional totalProcessorTime = default; - Optional userProcessorTime = default; - Optional state = default; - Optional waitReason = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("identifier")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - identifier = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("href")) - { - href = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("process")) - { - process = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("start_address")) - { - startAddress = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("current_priority")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - currentPriority = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("priority_level")) - { - priorityLevel = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("base_priority")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - basePriority = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("start_time")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("total_processor_time")) - { - totalProcessorTime = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("user_processor_time")) - { - userProcessorTime = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("state")) - { - state = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("wait_reason")) - { - waitReason = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new ProcessThreadInfo(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(identifier), href.Value, process.Value, startAddress.Value, Optional.ToNullable(currentPriority), priorityLevel.Value, Optional.ToNullable(basePriority), Optional.ToNullable(startTime), totalProcessorTime.Value, userProcessorTime.Value, state.Value, waitReason.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.cs index 4869eb711739..7e37d356eccf 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfo.cs @@ -1,40 +1,55 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Process Thread Information. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Process Thread Information. + /// + [Rest.Serialization.JsonTransformation] public partial class ProcessThreadInfo : ProxyOnlyResource { - /// Initializes a new instance of ProcessThreadInfo. + /// + /// Initializes a new instance of the ProcessThreadInfo class. + /// public ProcessThreadInfo() { + CustomInit(); } - /// Initializes a new instance of ProcessThreadInfo. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Site extension ID. - /// HRef URI. - /// Process URI. - /// Start address. - /// Current thread priority. - /// Thread priority level. - /// Base priority. - /// Start time. - /// Total processor time. - /// User processor time. - /// Thread state. - /// Wait reason. - internal ProcessThreadInfo(string id, string name, string kind, string type, int? identifier, string href, string process, string startAddress, int? currentPriority, string priorityLevel, int? basePriority, DateTimeOffset? startTime, string totalProcessorTime, string userProcessorTime, string state, string waitReason) : base(id, name, kind, type) + /// + /// Initializes a new instance of the ProcessThreadInfo class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Site extension ID. + /// HRef URI. + /// Process URI. + /// Start address. + /// Current thread priority. + /// Thread priority level. + /// Base priority. + /// Start time. + /// Total processor time. + /// User processor time. + /// Thread state. + /// Wait reason. + public ProcessThreadInfo(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? identifier = default(int?), string href = default(string), string process = default(string), string startAddress = default(string), int? currentPriority = default(int?), string priorityLevel = default(string), int? basePriority = default(int?), System.DateTime? startTime = default(System.DateTime?), string totalProcessorTime = default(string), string userProcessorTime = default(string), string state = default(string), string waitReason = default(string)) + : base(id, name, kind, type) { Identifier = identifier; Href = href; @@ -48,31 +63,85 @@ internal ProcessThreadInfo(string id, string name, string kind, string type, int UserProcessorTime = userProcessorTime; State = state; WaitReason = waitReason; + CustomInit(); } - /// Site extension ID. - public int? Identifier { get; } - /// HRef URI. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets site extension ID. + /// + [JsonProperty(PropertyName = "properties.identifier")] + public int? Identifier { get; private set; } + + /// + /// Gets or sets hRef URI. + /// + [JsonProperty(PropertyName = "properties.href")] public string Href { get; set; } - /// Process URI. + + /// + /// Gets or sets process URI. + /// + [JsonProperty(PropertyName = "properties.process")] public string Process { get; set; } - /// Start address. + + /// + /// Gets or sets start address. + /// + [JsonProperty(PropertyName = "properties.start_address")] public string StartAddress { get; set; } - /// Current thread priority. + + /// + /// Gets or sets current thread priority. + /// + [JsonProperty(PropertyName = "properties.current_priority")] public int? CurrentPriority { get; set; } - /// Thread priority level. + + /// + /// Gets or sets thread priority level. + /// + [JsonProperty(PropertyName = "properties.priority_level")] public string PriorityLevel { get; set; } - /// Base priority. + + /// + /// Gets or sets base priority. + /// + [JsonProperty(PropertyName = "properties.base_priority")] public int? BasePriority { get; set; } - /// Start time. - public DateTimeOffset? StartTime { get; set; } - /// Total processor time. + + /// + /// Gets or sets start time. + /// + [JsonProperty(PropertyName = "properties.start_time")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets total processor time. + /// + [JsonProperty(PropertyName = "properties.total_processor_time")] public string TotalProcessorTime { get; set; } - /// User processor time. + + /// + /// Gets or sets user processor time. + /// + [JsonProperty(PropertyName = "properties.user_processor_time")] public string UserProcessorTime { get; set; } - /// Thread state. + + /// + /// Gets or sets thread state. + /// + [JsonProperty(PropertyName = "properties.state")] public string State { get; set; } - /// Wait reason. + + /// + /// Gets or sets wait reason. + /// + [JsonProperty(PropertyName = "properties.wait_reason")] public string WaitReason { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.Serialization.cs deleted file mode 100644 index 87a12ac57a96..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class ProcessThreadInfoCollection - { - internal static ProcessThreadInfoCollection DeserializeProcessThreadInfoCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ProcessThreadInfo.DeserializeProcessThreadInfo(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ProcessThreadInfoCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.cs deleted file mode 100644 index 97071bef2f43..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProcessThreadInfoCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Kudu thread information elements. - internal partial class ProcessThreadInfoCollection - { - /// Initializes a new instance of ProcessThreadInfoCollection. - /// Collection of resources. - /// is null. - internal ProcessThreadInfoCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of ProcessThreadInfoCollection. - /// Collection of resources. - /// Link to next page of resources. - internal ProcessThreadInfoCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.Serialization.cs deleted file mode 100644 index d54e90a2c03f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class ProvisioningStateExtensions - { - public static string ToSerialString(this ProvisioningState value) => value switch - { - ProvisioningState.Succeeded => "Succeeded", - ProvisioningState.Failed => "Failed", - ProvisioningState.Canceled => "Canceled", - ProvisioningState.InProgress => "InProgress", - ProvisioningState.Deleting => "Deleting", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ProvisioningState value.") - }; - - public static ProvisioningState ToProvisioningState(this string value) - { - if (string.Equals(value, "Succeeded", StringComparison.InvariantCultureIgnoreCase)) return ProvisioningState.Succeeded; - if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return ProvisioningState.Failed; - if (string.Equals(value, "Canceled", StringComparison.InvariantCultureIgnoreCase)) return ProvisioningState.Canceled; - if (string.Equals(value, "InProgress", StringComparison.InvariantCultureIgnoreCase)) return ProvisioningState.InProgress; - if (string.Equals(value, "Deleting", StringComparison.InvariantCultureIgnoreCase)) return ProvisioningState.Deleting; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ProvisioningState value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.cs index bacf943c99a0..7a208e971733 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProvisioningState.cs @@ -1,24 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Status of certificate order. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ProvisioningState. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum ProvisioningState { - /// Succeeded. + [EnumMember(Value = "Succeeded")] Succeeded, - /// Failed. + [EnumMember(Value = "Failed")] Failed, - /// Canceled. + [EnumMember(Value = "Canceled")] Canceled, - /// InProgress. + [EnumMember(Value = "InProgress")] InProgress, - /// Deleting. + [EnumMember(Value = "Deleting")] Deleting } + internal static class ProvisioningStateEnumExtension + { + internal static string ToSerializedValue(this ProvisioningState? value) + { + return value == null ? null : ((ProvisioningState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ProvisioningState value) + { + switch( value ) + { + case ProvisioningState.Succeeded: + return "Succeeded"; + case ProvisioningState.Failed: + return "Failed"; + case ProvisioningState.Canceled: + return "Canceled"; + case ProvisioningState.InProgress: + return "InProgress"; + case ProvisioningState.Deleting: + return "Deleting"; + } + return null; + } + + internal static ProvisioningState? ParseProvisioningState(this string value) + { + switch( value ) + { + case "Succeeded": + return ProvisioningState.Succeeded; + case "Failed": + return ProvisioningState.Failed; + case "Canceled": + return ProvisioningState.Canceled; + case "InProgress": + return ProvisioningState.InProgress; + case "Deleting": + return ProvisioningState.Deleting; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.Serialization.cs deleted file mode 100644 index 3148eea73ff3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.Serialization.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ProxyOnlyResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WriteEndObject(); - } - - internal static ProxyOnlyResource DeserializeProxyOnlyResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - } - return new ProxyOnlyResource(id.Value, name.Value, kind.Value, type.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.cs index 0c81fcbeb9b6..1f933160fd10 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ProxyOnlyResource.cs @@ -1,40 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Azure proxy only resource. This resource is not tracked by Azure Resource Manager. - public partial class ProxyOnlyResource + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure proxy only resource. This resource is not tracked by Azure + /// Resource Manager. + /// + public partial class ProxyOnlyResource : IResource { - /// Initializes a new instance of ProxyOnlyResource. + /// + /// Initializes a new instance of the ProxyOnlyResource class. + /// public ProxyOnlyResource() { + CustomInit(); } - /// Initializes a new instance of ProxyOnlyResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - internal ProxyOnlyResource(string id, string name, string kind, string type) + /// + /// Initializes a new instance of the ProxyOnlyResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public ProxyOnlyResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string)) { Id = id; Name = name; Kind = kind; Type = type; + CustomInit(); } - /// Resource Id. - public string Id { get; } - /// Resource Name. - public string Name { get; } - /// Kind of resource. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource Name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets kind of resource. + /// + [JsonProperty(PropertyName = "kind")] public string Kind { get; set; } - /// Resource type. - public string Type { get; } + + /// + /// Gets resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.Serialization.cs deleted file mode 100644 index 23123a63406c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.Serialization.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PublicCertificate : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Blob)) - { - writer.WritePropertyName("blob"); - writer.WriteBase64StringValue(Blob, "D"); - } - if (Optional.IsDefined(PublicCertificateLocation)) - { - writer.WritePropertyName("publicCertificateLocation"); - writer.WriteStringValue(PublicCertificateLocation.Value.ToSerialString()); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static PublicCertificate DeserializePublicCertificate(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional blob = default; - Optional publicCertificateLocation = default; - Optional thumbprint = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("blob")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - blob = property0.Value.GetBytesFromBase64("D"); - continue; - } - if (property0.NameEquals("publicCertificateLocation")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - publicCertificateLocation = property0.Value.GetString().ToPublicCertificateLocation(); - continue; - } - if (property0.NameEquals("thumbprint")) - { - thumbprint = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new PublicCertificate(id.Value, name.Value, kind.Value, type.Value, blob.Value, Optional.ToNullable(publicCertificateLocation), thumbprint.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.cs index 137aa90bf890..fd1011837ada 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificate.cs @@ -1,42 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Public certificate object. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Public certificate object + /// + [Rest.Serialization.JsonTransformation] public partial class PublicCertificate : ProxyOnlyResource { - /// Initializes a new instance of PublicCertificate. + /// + /// Initializes a new instance of the PublicCertificate class. + /// public PublicCertificate() { + CustomInit(); } - /// Initializes a new instance of PublicCertificate. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Public Certificate byte array. - /// Public Certificate Location. - /// Certificate Thumbprint. - internal PublicCertificate(string id, string name, string kind, string type, byte[] blob, PublicCertificateLocation? publicCertificateLocation, string thumbprint) : base(id, name, kind, type) + /// + /// Initializes a new instance of the PublicCertificate class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Public Certificate byte array + /// Public Certificate + /// Location. Possible values include: 'CurrentUserMy', + /// 'LocalMachineMy', 'Unknown' + /// Certificate Thumbprint + public PublicCertificate(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), byte[] blob = default(byte[]), PublicCertificateLocation? publicCertificateLocation = default(PublicCertificateLocation?), string thumbprint = default(string)) + : base(id, name, kind, type) { Blob = blob; PublicCertificateLocation = publicCertificateLocation; Thumbprint = thumbprint; + CustomInit(); } - /// Public Certificate byte array. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets public Certificate byte array + /// + [JsonProperty(PropertyName = "properties.blob")] public byte[] Blob { get; set; } - /// Public Certificate Location. + + /// + /// Gets or sets public Certificate Location. Possible values include: + /// 'CurrentUserMy', 'LocalMachineMy', 'Unknown' + /// + [JsonProperty(PropertyName = "properties.publicCertificateLocation")] public PublicCertificateLocation? PublicCertificateLocation { get; set; } - /// Certificate Thumbprint. - public string Thumbprint { get; } + + /// + /// Gets certificate Thumbprint + /// + [JsonProperty(PropertyName = "properties.thumbprint")] + public string Thumbprint { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.Serialization.cs deleted file mode 100644 index 637747f948d9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class PublicCertificateCollection - { - internal static PublicCertificateCollection DeserializePublicCertificateCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PublicCertificate.DeserializePublicCertificate(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new PublicCertificateCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.cs deleted file mode 100644 index c2ae93ffc5cd..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of public certificates. - internal partial class PublicCertificateCollection - { - /// Initializes a new instance of PublicCertificateCollection. - /// Collection of resources. - /// is null. - internal PublicCertificateCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of PublicCertificateCollection. - /// Collection of resources. - /// Link to next page of resources. - internal PublicCertificateCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.Serialization.cs deleted file mode 100644 index 880fd2c11c70..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class PublicCertificateLocationExtensions - { - public static string ToSerialString(this PublicCertificateLocation value) => value switch - { - PublicCertificateLocation.CurrentUserMy => "CurrentUserMy", - PublicCertificateLocation.LocalMachineMy => "LocalMachineMy", - PublicCertificateLocation.Unknown => "Unknown", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PublicCertificateLocation value.") - }; - - public static PublicCertificateLocation ToPublicCertificateLocation(this string value) - { - if (string.Equals(value, "CurrentUserMy", StringComparison.InvariantCultureIgnoreCase)) return PublicCertificateLocation.CurrentUserMy; - if (string.Equals(value, "LocalMachineMy", StringComparison.InvariantCultureIgnoreCase)) return PublicCertificateLocation.LocalMachineMy; - if (string.Equals(value, "Unknown", StringComparison.InvariantCultureIgnoreCase)) return PublicCertificateLocation.Unknown; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PublicCertificateLocation value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.cs index 43cf834470d9..c254bed35845 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublicCertificateLocation.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Public Certificate Location. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for PublicCertificateLocation. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum PublicCertificateLocation { - /// CurrentUserMy. + [EnumMember(Value = "CurrentUserMy")] CurrentUserMy, - /// LocalMachineMy. + [EnumMember(Value = "LocalMachineMy")] LocalMachineMy, - /// Unknown. + [EnumMember(Value = "Unknown")] Unknown } + internal static class PublicCertificateLocationEnumExtension + { + internal static string ToSerializedValue(this PublicCertificateLocation? value) + { + return value == null ? null : ((PublicCertificateLocation)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this PublicCertificateLocation value) + { + switch( value ) + { + case PublicCertificateLocation.CurrentUserMy: + return "CurrentUserMy"; + case PublicCertificateLocation.LocalMachineMy: + return "LocalMachineMy"; + case PublicCertificateLocation.Unknown: + return "Unknown"; + } + return null; + } + + internal static PublicCertificateLocation? ParsePublicCertificateLocation(this string value) + { + switch( value ) + { + case "CurrentUserMy": + return PublicCertificateLocation.CurrentUserMy; + case "LocalMachineMy": + return PublicCertificateLocation.LocalMachineMy; + case "Unknown": + return PublicCertificateLocation.Unknown; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublishingProfileFormat.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublishingProfileFormat.cs index 0d4ab5004eac..7d99293b079e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublishingProfileFormat.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PublishingProfileFormat.cs @@ -1,59 +1,23 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { + /// - /// Name of the format. Valid values are: - /// FileZilla3 - /// WebDeploy -- default - /// Ftp. + /// Defines values for PublishingProfileFormat. /// - public readonly partial struct PublishingProfileFormat : IEquatable + public static class PublishingProfileFormat { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public PublishingProfileFormat(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string FileZilla3Value = "FileZilla3"; - private const string WebDeployValue = "WebDeploy"; - private const string FtpValue = "Ftp"; - - /// FileZilla3. - public static PublishingProfileFormat FileZilla3 { get; } = new PublishingProfileFormat(FileZilla3Value); - /// WebDeploy. - public static PublishingProfileFormat WebDeploy { get; } = new PublishingProfileFormat(WebDeployValue); - /// Ftp. - public static PublishingProfileFormat Ftp { get; } = new PublishingProfileFormat(FtpValue); - /// Determines if two values are the same. - public static bool operator ==(PublishingProfileFormat left, PublishingProfileFormat right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PublishingProfileFormat left, PublishingProfileFormat right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PublishingProfileFormat(string value) => new PublishingProfileFormat(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PublishingProfileFormat other && Equals(other); - /// - public bool Equals(PublishingProfileFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + public const string FileZilla3 = "FileZilla3"; + public const string WebDeploy = "WebDeploy"; + public const string Ftp = "Ftp"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.Serialization.cs deleted file mode 100644 index 11d865bb8ba3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.Serialization.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class PushSettings : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(IsPushEnabled)) - { - writer.WritePropertyName("isPushEnabled"); - writer.WriteBooleanValue(IsPushEnabled.Value); - } - if (Optional.IsDefined(TagWhitelistJson)) - { - writer.WritePropertyName("tagWhitelistJson"); - writer.WriteStringValue(TagWhitelistJson); - } - if (Optional.IsDefined(TagsRequiringAuth)) - { - writer.WritePropertyName("tagsRequiringAuth"); - writer.WriteStringValue(TagsRequiringAuth); - } - if (Optional.IsDefined(DynamicTagsJson)) - { - writer.WritePropertyName("dynamicTagsJson"); - writer.WriteStringValue(DynamicTagsJson); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static PushSettings DeserializePushSettings(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional isPushEnabled = default; - Optional tagWhitelistJson = default; - Optional tagsRequiringAuth = default; - Optional dynamicTagsJson = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("isPushEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isPushEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("tagWhitelistJson")) - { - tagWhitelistJson = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("tagsRequiringAuth")) - { - tagsRequiringAuth = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("dynamicTagsJson")) - { - dynamicTagsJson = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new PushSettings(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(isPushEnabled), tagWhitelistJson.Value, tagsRequiringAuth.Value, dynamicTagsJson.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.cs index ff5f662320db..890d9b51bd1e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PushSettings.cs @@ -1,54 +1,111 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Push settings for the App. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Push settings for the App. + /// + [Rest.Serialization.JsonTransformation] public partial class PushSettings : ProxyOnlyResource { - /// Initializes a new instance of PushSettings. + /// + /// Initializes a new instance of the PushSettings class. + /// public PushSettings() { + CustomInit(); } - /// Initializes a new instance of PushSettings. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Gets or sets a flag indicating whether the Push endpoint is enabled. - /// Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint. - /// - /// Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint. + /// + /// Initializes a new instance of the PushSettings class. + /// + /// Gets or sets a flag indicating whether + /// the Push endpoint is enabled. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Gets or sets a JSON string + /// containing a list of tags that are whitelisted for use by the push + /// registration endpoint. + /// Gets or sets a JSON string + /// containing a list of tags that require user authentication to be + /// used in the push registration endpoint. /// Tags can consist of alphanumeric characters and the following: - /// '_', '@', '#', '.', ':', '-'. - /// Validation should be performed at the PushRequestHandler. - /// - /// Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint. - internal PushSettings(string id, string name, string kind, string type, bool? isPushEnabled, string tagWhitelistJson, string tagsRequiringAuth, string dynamicTagsJson) : base(id, name, kind, type) + /// '_', '@', '#', '.', ':', '-'. + /// Validation should be performed at the PushRequestHandler. + /// Gets or sets a JSON string containing + /// a list of dynamic tags that will be evaluated from user claims in + /// the push registration endpoint. + public PushSettings(bool isPushEnabled, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string tagWhitelistJson = default(string), string tagsRequiringAuth = default(string), string dynamicTagsJson = default(string)) + : base(id, name, kind, type) { IsPushEnabled = isPushEnabled; TagWhitelistJson = tagWhitelistJson; TagsRequiringAuth = tagsRequiringAuth; DynamicTagsJson = dynamicTagsJson; + CustomInit(); } - /// Gets or sets a flag indicating whether the Push endpoint is enabled. - public bool? IsPushEnabled { get; set; } - /// Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a flag indicating whether the Push endpoint is + /// enabled. + /// + [JsonProperty(PropertyName = "properties.isPushEnabled")] + public bool IsPushEnabled { get; set; } + + /// + /// Gets or sets a JSON string containing a list of tags that are + /// whitelisted for use by the push registration endpoint. + /// + [JsonProperty(PropertyName = "properties.tagWhitelistJson")] public string TagWhitelistJson { get; set; } + /// - /// Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint. + /// Gets or sets a JSON string containing a list of tags that require + /// user authentication to be used in the push registration endpoint. /// Tags can consist of alphanumeric characters and the following: - /// '_', '@', '#', '.', ':', '-'. + /// '_', '@', '#', '.', ':', '-'. /// Validation should be performed at the PushRequestHandler. /// + [JsonProperty(PropertyName = "properties.tagsRequiringAuth")] public string TagsRequiringAuth { get; set; } - /// Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint. + + /// + /// Gets or sets a JSON string containing a list of dynamic tags that + /// will be evaluated from user claims in the push registration + /// endpoint. + /// + [JsonProperty(PropertyName = "properties.dynamicTagsJson")] public string DynamicTagsJson { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.Serialization.cs deleted file mode 100644 index 530cd381e740..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.Serialization.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class QueryUtterancesResult : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(SampleUtterance)) - { - writer.WritePropertyName("sampleUtterance"); - writer.WriteObjectValue(SampleUtterance); - } - if (Optional.IsDefined(Score)) - { - writer.WritePropertyName("score"); - writer.WriteNumberValue(Score.Value); - } - writer.WriteEndObject(); - } - - internal static QueryUtterancesResult DeserializeQueryUtterancesResult(JsonElement element) - { - Optional sampleUtterance = default; - Optional score = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sampleUtterance")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - sampleUtterance = SampleUtterance.DeserializeSampleUtterance(property.Value); - continue; - } - if (property.NameEquals("score")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - score = property.Value.GetSingle(); - continue; - } - } - return new QueryUtterancesResult(sampleUtterance.Value, Optional.ToNullable(score)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs deleted file mode 100644 index eb75d14b6e94..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Result for utterances query. - public partial class QueryUtterancesResult - { - /// Initializes a new instance of QueryUtterancesResult. - public QueryUtterancesResult() - { - } - - /// Initializes a new instance of QueryUtterancesResult. - /// A sample utterance. - /// Score of a sample utterance. - internal QueryUtterancesResult(SampleUtterance sampleUtterance, float? score) - { - SampleUtterance = sampleUtterance; - Score = score; - } - - /// A sample utterance. - public SampleUtterance SampleUtterance { get; set; } - /// Score of a sample utterance. - public float? Score { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.Serialization.cs deleted file mode 100644 index 5f6e3eed8770..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.Serialization.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class QueryUtterancesResults : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Query)) - { - writer.WritePropertyName("query"); - writer.WriteStringValue(Query); - } - if (Optional.IsCollectionDefined(Results)) - { - writer.WritePropertyName("results"); - writer.WriteStartArray(); - foreach (var item in Results) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static QueryUtterancesResults DeserializeQueryUtterancesResults(JsonElement element) - { - Optional query = default; - Optional> results = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("query")) - { - query = property.Value.GetString(); - continue; - } - if (property.NameEquals("results")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(QueryUtterancesResult.DeserializeQueryUtterancesResult(item)); - } - results = array; - continue; - } - } - return new QueryUtterancesResults(query.Value, Optional.ToList(results)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs deleted file mode 100644 index 7368df322845..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Suggested utterances where the detector can be applicable. - public partial class QueryUtterancesResults - { - /// Initializes a new instance of QueryUtterancesResults. - public QueryUtterancesResults() - { - Results = new ChangeTrackingList(); - } - - /// Initializes a new instance of QueryUtterancesResults. - /// Search Query. - /// Array of utterance results for search query. - internal QueryUtterancesResults(string query, IList results) - { - Query = query; - Results = results; - } - - /// Search Query. - public string Query { get; set; } - /// Array of utterance results for search query. - public IList Results { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.Serialization.cs deleted file mode 100644 index e12c447681f3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class RampUpRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ActionHostName)) - { - writer.WritePropertyName("actionHostName"); - writer.WriteStringValue(ActionHostName); - } - if (Optional.IsDefined(ReroutePercentage)) - { - writer.WritePropertyName("reroutePercentage"); - writer.WriteNumberValue(ReroutePercentage.Value); - } - if (Optional.IsDefined(ChangeStep)) - { - writer.WritePropertyName("changeStep"); - writer.WriteNumberValue(ChangeStep.Value); - } - if (Optional.IsDefined(ChangeIntervalInMinutes)) - { - writer.WritePropertyName("changeIntervalInMinutes"); - writer.WriteNumberValue(ChangeIntervalInMinutes.Value); - } - if (Optional.IsDefined(MinReroutePercentage)) - { - writer.WritePropertyName("minReroutePercentage"); - writer.WriteNumberValue(MinReroutePercentage.Value); - } - if (Optional.IsDefined(MaxReroutePercentage)) - { - writer.WritePropertyName("maxReroutePercentage"); - writer.WriteNumberValue(MaxReroutePercentage.Value); - } - if (Optional.IsDefined(ChangeDecisionCallbackUrl)) - { - writer.WritePropertyName("changeDecisionCallbackUrl"); - writer.WriteStringValue(ChangeDecisionCallbackUrl); - } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - writer.WriteEndObject(); - } - - internal static RampUpRule DeserializeRampUpRule(JsonElement element) - { - Optional actionHostName = default; - Optional reroutePercentage = default; - Optional changeStep = default; - Optional changeIntervalInMinutes = default; - Optional minReroutePercentage = default; - Optional maxReroutePercentage = default; - Optional changeDecisionCallbackUrl = default; - Optional name = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("actionHostName")) - { - actionHostName = property.Value.GetString(); - continue; - } - if (property.NameEquals("reroutePercentage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - reroutePercentage = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("changeStep")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - changeStep = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("changeIntervalInMinutes")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - changeIntervalInMinutes = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("minReroutePercentage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - minReroutePercentage = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("maxReroutePercentage")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maxReroutePercentage = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("changeDecisionCallbackUrl")) - { - changeDecisionCallbackUrl = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - } - return new RampUpRule(actionHostName.Value, Optional.ToNullable(reroutePercentage), Optional.ToNullable(changeStep), Optional.ToNullable(changeIntervalInMinutes), Optional.ToNullable(minReroutePercentage), Optional.ToNullable(maxReroutePercentage), changeDecisionCallbackUrl.Value, name.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.cs index f71b3aee7a29..4647553a245d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RampUpRule.cs @@ -1,37 +1,67 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Routing rules for ramp up testing. This rule allows to redirect static + /// traffic % to a slot or to gradually change routing % based on + /// performance. + /// public partial class RampUpRule { - /// Initializes a new instance of RampUpRule. + /// + /// Initializes a new instance of the RampUpRule class. + /// public RampUpRule() { + CustomInit(); } - /// Initializes a new instance of RampUpRule. - /// Hostname of a slot to which the traffic will be redirected if decided to. E.g. myapp-stage.azurewebsites.net. - /// Percentage of the traffic which will be redirected to <code>ActionHostName</code>. - /// - /// In auto ramp up scenario this is the step to add/remove from <code>ReroutePercentage</code> until it reaches \n<code>MinReroutePercentage</code> or - /// <code>MaxReroutePercentage</code>. Site metrics are checked every N minutes specified in <code>ChangeIntervalInMinutes</code>.\nCustom decision algorithm - /// can be provided in TiPCallback site extension which URL can be specified in <code>ChangeDecisionCallbackUrl</code>. - /// - /// Specifies interval in minutes to reevaluate ReroutePercentage. - /// Specifies lower boundary above which ReroutePercentage will stay. - /// Specifies upper boundary below which ReroutePercentage will stay. - /// - /// Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified. See TiPCallback site extension for the scaffold and contracts. - /// https://www.siteextensions.net/packages/TiPCallback/. - /// - /// Name of the routing rule. The recommended name would be to point to the slot which will receive the traffic in the experiment. - internal RampUpRule(string actionHostName, double? reroutePercentage, double? changeStep, int? changeIntervalInMinutes, double? minReroutePercentage, double? maxReroutePercentage, string changeDecisionCallbackUrl, string name) + /// + /// Initializes a new instance of the RampUpRule class. + /// + /// Hostname of a slot to which the + /// traffic will be redirected if decided to. E.g. + /// myapp-stage.azurewebsites.net. + /// Percentage of the traffic which + /// will be redirected to + /// <code>ActionHostName</code>. + /// In auto ramp up scenario this is the step + /// to add/remove from <code>ReroutePercentage</code> until + /// it reaches \n<code>MinReroutePercentage</code> or + /// <code>MaxReroutePercentage</code>. Site metrics are + /// checked every N minutes specified in + /// <code>ChangeIntervalInMinutes</code>.\nCustom decision + /// algorithm + /// can be provided in TiPCallback site extension which URL can be + /// specified in + /// <code>ChangeDecisionCallbackUrl</code>. + /// Specifies interval in minutes + /// to reevaluate ReroutePercentage. + /// Specifies lower boundary above + /// which ReroutePercentage will stay. + /// Specifies upper boundary below + /// which ReroutePercentage will stay. + /// Custom decision algorithm + /// can be provided in TiPCallback site extension which URL can be + /// specified. See TiPCallback site extension for the scaffold and + /// contracts. + /// https://www.siteextensions.net/packages/TiPCallback/ + /// Name of the routing rule. The recommended name + /// would be to point to the slot which will receive the traffic in the + /// experiment. + public RampUpRule(string actionHostName = default(string), double? reroutePercentage = default(double?), double? changeStep = default(double?), int? changeIntervalInMinutes = default(int?), double? minReroutePercentage = default(double?), double? maxReroutePercentage = default(double?), string changeDecisionCallbackUrl = default(string), string name = default(string)) { ActionHostName = actionHostName; ReroutePercentage = reroutePercentage; @@ -41,30 +71,82 @@ internal RampUpRule(string actionHostName, double? reroutePercentage, double? ch MaxReroutePercentage = maxReroutePercentage; ChangeDecisionCallbackUrl = changeDecisionCallbackUrl; Name = name; + CustomInit(); } - /// Hostname of a slot to which the traffic will be redirected if decided to. E.g. myapp-stage.azurewebsites.net. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets hostname of a slot to which the traffic will be + /// redirected if decided to. E.g. myapp-stage.azurewebsites.net. + /// + [JsonProperty(PropertyName = "actionHostName")] public string ActionHostName { get; set; } - /// Percentage of the traffic which will be redirected to <code>ActionHostName</code>. + + /// + /// Gets or sets percentage of the traffic which will be redirected to + /// &lt;code&gt;ActionHostName&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "reroutePercentage")] public double? ReroutePercentage { get; set; } + /// - /// In auto ramp up scenario this is the step to add/remove from <code>ReroutePercentage</code> until it reaches \n<code>MinReroutePercentage</code> or - /// <code>MaxReroutePercentage</code>. Site metrics are checked every N minutes specified in <code>ChangeIntervalInMinutes</code>.\nCustom decision algorithm - /// can be provided in TiPCallback site extension which URL can be specified in <code>ChangeDecisionCallbackUrl</code>. + /// Gets or sets in auto ramp up scenario this is the step to + /// add/remove from + /// &lt;code&gt;ReroutePercentage&lt;/code&gt; until it + /// reaches + /// \n&lt;code&gt;MinReroutePercentage&lt;/code&gt; or + /// &lt;code&gt;MaxReroutePercentage&lt;/code&gt;. Site + /// metrics are checked every N minutes specified in + /// &lt;code&gt;ChangeIntervalInMinutes&lt;/code&gt;.\nCustom + /// decision algorithm + /// can be provided in TiPCallback site extension which URL can be + /// specified in + /// &lt;code&gt;ChangeDecisionCallbackUrl&lt;/code&gt;. /// + [JsonProperty(PropertyName = "changeStep")] public double? ChangeStep { get; set; } - /// Specifies interval in minutes to reevaluate ReroutePercentage. + + /// + /// Gets or sets specifies interval in minutes to reevaluate + /// ReroutePercentage. + /// + [JsonProperty(PropertyName = "changeIntervalInMinutes")] public int? ChangeIntervalInMinutes { get; set; } - /// Specifies lower boundary above which ReroutePercentage will stay. + + /// + /// Gets or sets specifies lower boundary above which ReroutePercentage + /// will stay. + /// + [JsonProperty(PropertyName = "minReroutePercentage")] public double? MinReroutePercentage { get; set; } - /// Specifies upper boundary below which ReroutePercentage will stay. + + /// + /// Gets or sets specifies upper boundary below which ReroutePercentage + /// will stay. + /// + [JsonProperty(PropertyName = "maxReroutePercentage")] public double? MaxReroutePercentage { get; set; } + /// - /// Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified. See TiPCallback site extension for the scaffold and contracts. - /// https://www.siteextensions.net/packages/TiPCallback/. + /// Gets or sets custom decision algorithm can be provided in + /// TiPCallback site extension which URL can be specified. See + /// TiPCallback site extension for the scaffold and contracts. + /// https://www.siteextensions.net/packages/TiPCallback/ /// + [JsonProperty(PropertyName = "changeDecisionCallbackUrl")] public string ChangeDecisionCallbackUrl { get; set; } - /// Name of the routing rule. The recommended name would be to point to the slot which will receive the traffic in the experiment. + + /// + /// Gets or sets name of the routing rule. The recommended name would + /// be to point to the slot which will receive the traffic in the + /// experiment. + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.Serialization.cs deleted file mode 100644 index 148b4d39f456..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.Serialization.cs +++ /dev/null @@ -1,413 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Recommendation : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(CreationTime)) - { - writer.WritePropertyName("creationTime"); - writer.WriteStringValue(CreationTime.Value, "O"); - } - if (Optional.IsDefined(RecommendationId)) - { - writer.WritePropertyName("recommendationId"); - writer.WriteStringValue(RecommendationId.Value); - } - if (Optional.IsDefined(ResourceId)) - { - writer.WritePropertyName("resourceId"); - writer.WriteStringValue(ResourceId); - } - if (Optional.IsDefined(ResourceScope)) - { - writer.WritePropertyName("resourceScope"); - writer.WriteStringValue(ResourceScope.Value.ToString()); - } - if (Optional.IsDefined(RuleName)) - { - writer.WritePropertyName("ruleName"); - writer.WriteStringValue(RuleName); - } - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"); - writer.WriteStringValue(Message); - } - if (Optional.IsDefined(Level)) - { - writer.WritePropertyName("level"); - writer.WriteStringValue(Level.Value.ToSerialString()); - } - if (Optional.IsDefined(Channels)) - { - writer.WritePropertyName("channels"); - writer.WriteStringValue(Channels.Value.ToSerialString()); - } - if (Optional.IsDefined(ActionName)) - { - writer.WritePropertyName("actionName"); - writer.WriteStringValue(ActionName); - } - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteNumberValue(Enabled.Value); - } - if (Optional.IsCollectionDefined(States)) - { - writer.WritePropertyName("states"); - writer.WriteStartArray(); - foreach (var item in States) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(StartTime)) - { - writer.WritePropertyName("startTime"); - writer.WriteStringValue(StartTime.Value, "O"); - } - if (Optional.IsDefined(EndTime)) - { - writer.WritePropertyName("endTime"); - writer.WriteStringValue(EndTime.Value, "O"); - } - if (Optional.IsDefined(NextNotificationTime)) - { - writer.WritePropertyName("nextNotificationTime"); - writer.WriteStringValue(NextNotificationTime.Value, "O"); - } - if (Optional.IsDefined(NotificationExpirationTime)) - { - writer.WritePropertyName("notificationExpirationTime"); - writer.WriteStringValue(NotificationExpirationTime.Value, "O"); - } - if (Optional.IsDefined(NotifiedTime)) - { - writer.WritePropertyName("notifiedTime"); - writer.WriteStringValue(NotifiedTime.Value, "O"); - } - if (Optional.IsDefined(Score)) - { - writer.WritePropertyName("score"); - writer.WriteNumberValue(Score.Value); - } - if (Optional.IsDefined(IsDynamic)) - { - writer.WritePropertyName("isDynamic"); - writer.WriteBooleanValue(IsDynamic.Value); - } - if (Optional.IsDefined(ExtensionName)) - { - writer.WritePropertyName("extensionName"); - writer.WriteStringValue(ExtensionName); - } - if (Optional.IsDefined(BladeName)) - { - writer.WritePropertyName("bladeName"); - writer.WriteStringValue(BladeName); - } - if (Optional.IsDefined(ForwardLink)) - { - writer.WritePropertyName("forwardLink"); - writer.WriteStringValue(ForwardLink); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Recommendation DeserializeRecommendation(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional creationTime = default; - Optional recommendationId = default; - Optional resourceId = default; - Optional resourceScope = default; - Optional ruleName = default; - Optional displayName = default; - Optional message = default; - Optional level = default; - Optional channels = default; - Optional> categoryTags = default; - Optional actionName = default; - Optional enabled = default; - Optional> states = default; - Optional startTime = default; - Optional endTime = default; - Optional nextNotificationTime = default; - Optional notificationExpirationTime = default; - Optional notifiedTime = default; - Optional score = default; - Optional isDynamic = default; - Optional extensionName = default; - Optional bladeName = default; - Optional forwardLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("creationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - creationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("recommendationId")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - recommendationId = property0.Value.GetGuid(); - continue; - } - if (property0.NameEquals("resourceId")) - { - resourceId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("resourceScope")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - resourceScope = new ResourceScopeType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("ruleName")) - { - ruleName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("displayName")) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("message")) - { - message = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("level")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - level = property0.Value.GetString().ToNotificationLevel(); - continue; - } - if (property0.NameEquals("channels")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - channels = property0.Value.GetString().ToChannels(); - continue; - } - if (property0.NameEquals("categoryTags")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - categoryTags = array; - continue; - } - if (property0.NameEquals("actionName")) - { - actionName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("states")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - states = array; - continue; - } - if (property0.NameEquals("startTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("endTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - endTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("nextNotificationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - nextNotificationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("notificationExpirationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - notificationExpirationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("notifiedTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - notifiedTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("score")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - score = property0.Value.GetDouble(); - continue; - } - if (property0.NameEquals("isDynamic")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isDynamic = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("extensionName")) - { - extensionName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("bladeName")) - { - bladeName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("forwardLink")) - { - forwardLink = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new Recommendation(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(creationTime), Optional.ToNullable(recommendationId), resourceId.Value, Optional.ToNullable(resourceScope), ruleName.Value, displayName.Value, message.Value, Optional.ToNullable(level), Optional.ToNullable(channels), Optional.ToList(categoryTags), actionName.Value, Optional.ToNullable(enabled), Optional.ToList(states), Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToNullable(nextNotificationTime), Optional.ToNullable(notificationExpirationTime), Optional.ToNullable(notifiedTime), Optional.ToNullable(score), Optional.ToNullable(isDynamic), extensionName.Value, bladeName.Value, forwardLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.cs index 0513a7a7afa8..91e53bd92e74 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Recommendation.cs @@ -1,55 +1,94 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Represents a recommendation result generated by the recommendation engine. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents a recommendation result generated by the recommendation + /// engine. + /// + [Rest.Serialization.JsonTransformation] public partial class Recommendation : ProxyOnlyResource { - /// Initializes a new instance of Recommendation. + /// + /// Initializes a new instance of the Recommendation class. + /// public Recommendation() { - CategoryTags = new ChangeTrackingList(); - States = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of Recommendation. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Timestamp when this instance was created. - /// A GUID value that each recommendation object is associated with. - /// Full ARM resource ID string that this recommendation object is associated with. - /// Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. - /// Unique name of the rule. - /// UI friendly name of the rule (may not be unique). - /// Recommendation text. - /// Level indicating how critical this recommendation can impact. - /// List of channels that this recommendation can apply. - /// The list of category tags that this recommendation belongs to. - /// Name of action recommended by this object. - /// True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. - /// The list of states of this recommendation. If it's null then it should be considered "Active". - /// The beginning time in UTC of a range that the recommendation refers to. - /// The end time in UTC of a range that the recommendation refers to. - /// When to notify this recommendation next in UTC. Null means that this will never be notified anymore. - /// Date and time in UTC when this notification expires. - /// Last timestamp in UTC this instance was actually notified. Null means that this recommendation hasn't been notified yet. - /// A metric value measured by the rule. - /// True if this is associated with a dynamically added rule. - /// Extension name of the portal if exists. - /// Deep link to a blade on the portal. - /// Forward link to an external document associated with the rule. - internal Recommendation(string id, string name, string kind, string type, DateTimeOffset? creationTime, Guid? recommendationId, string resourceId, ResourceScopeType? resourceScope, string ruleName, string displayName, string message, NotificationLevel? level, Channels? channels, IReadOnlyList categoryTags, string actionName, int? enabled, IList states, DateTimeOffset? startTime, DateTimeOffset? endTime, DateTimeOffset? nextNotificationTime, DateTimeOffset? notificationExpirationTime, DateTimeOffset? notifiedTime, double? score, bool? isDynamic, string extensionName, string bladeName, string forwardLink) : base(id, name, kind, type) + /// + /// Initializes a new instance of the Recommendation class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Timestamp when this instance was + /// created. + /// A GUID value that each + /// recommendation object is associated with. + /// Full ARM resource ID string that this + /// recommendation object is associated with. + /// Name of a resource type this + /// recommendation applies, e.g. Subscription, ServerFarm, Site. + /// Possible values include: 'ServerFarm', 'Subscription', + /// 'WebSite' + /// Unique name of the rule. + /// UI friendly name of the rule (may not be + /// unique). + /// Recommendation text. + /// Level indicating how critical this + /// recommendation can impact. Possible values include: 'Critical', + /// 'Warning', 'Information', 'NonUrgentSuggestion' + /// List of channels that this recommendation + /// can apply. Possible values include: 'Notification', 'Api', 'Email', + /// 'Webhook', 'All' + /// The list of category tags that this + /// recommendation belongs to. + /// Name of action recommended by this + /// object. + /// True if this recommendation is still valid + /// (i.e. "actionable"). False if it is invalid. + /// The list of states of this recommendation. If + /// it's null then it should be considered "Active". + /// The beginning time in UTC of a range that + /// the recommendation refers to. + /// The end time in UTC of a range that the + /// recommendation refers to. + /// When to notify this + /// recommendation next in UTC. Null means that this will never be + /// notified anymore. + /// Date and time in UTC when + /// this notification expires. + /// Last timestamp in UTC this instance was + /// actually notified. Null means that this recommendation hasn't been + /// notified yet. + /// A metric value measured by the rule. + /// True if this is associated with a + /// dynamically added rule + /// Extension name of the portal if + /// exists. + /// Deep link to a blade on the portal. + /// Forward link to an external document + /// associated with the rule. + public Recommendation(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), System.DateTime? creationTime = default(System.DateTime?), System.Guid? recommendationId = default(System.Guid?), string resourceId = default(string), string resourceScope = default(string), string ruleName = default(string), string displayName = default(string), string message = default(string), NotificationLevel? level = default(NotificationLevel?), Channels? channels = default(Channels?), IList categoryTags = default(IList), string actionName = default(string), int? enabled = default(int?), IList states = default(IList), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), System.DateTime? nextNotificationTime = default(System.DateTime?), System.DateTime? notificationExpirationTime = default(System.DateTime?), System.DateTime? notifiedTime = default(System.DateTime?), double? score = default(double?), bool? isDynamic = default(bool?), string extensionName = default(string), string bladeName = default(string), string forwardLink = default(string)) + : base(id, name, kind, type) { CreationTime = creationTime; RecommendationId = recommendationId; @@ -74,53 +113,168 @@ internal Recommendation(string id, string name, string kind, string type, DateTi ExtensionName = extensionName; BladeName = bladeName; ForwardLink = forwardLink; + CustomInit(); } - /// Timestamp when this instance was created. - public DateTimeOffset? CreationTime { get; set; } - /// A GUID value that each recommendation object is associated with. - public Guid? RecommendationId { get; set; } - /// Full ARM resource ID string that this recommendation object is associated with. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets timestamp when this instance was created. + /// + [JsonProperty(PropertyName = "properties.creationTime")] + public System.DateTime? CreationTime { get; set; } + + /// + /// Gets or sets a GUID value that each recommendation object is + /// associated with. + /// + [JsonProperty(PropertyName = "properties.recommendationId")] + public System.Guid? RecommendationId { get; set; } + + /// + /// Gets or sets full ARM resource ID string that this recommendation + /// object is associated with. + /// + [JsonProperty(PropertyName = "properties.resourceId")] public string ResourceId { get; set; } - /// Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. - public ResourceScopeType? ResourceScope { get; set; } - /// Unique name of the rule. + + /// + /// Gets or sets name of a resource type this recommendation applies, + /// e.g. Subscription, ServerFarm, Site. Possible values include: + /// 'ServerFarm', 'Subscription', 'WebSite' + /// + [JsonProperty(PropertyName = "properties.resourceScope")] + public string ResourceScope { get; set; } + + /// + /// Gets or sets unique name of the rule. + /// + [JsonProperty(PropertyName = "properties.ruleName")] public string RuleName { get; set; } - /// UI friendly name of the rule (may not be unique). + + /// + /// Gets or sets UI friendly name of the rule (may not be unique). + /// + [JsonProperty(PropertyName = "properties.displayName")] public string DisplayName { get; set; } - /// Recommendation text. + + /// + /// Gets or sets recommendation text. + /// + [JsonProperty(PropertyName = "properties.message")] public string Message { get; set; } - /// Level indicating how critical this recommendation can impact. + + /// + /// Gets or sets level indicating how critical this recommendation can + /// impact. Possible values include: 'Critical', 'Warning', + /// 'Information', 'NonUrgentSuggestion' + /// + [JsonProperty(PropertyName = "properties.level")] public NotificationLevel? Level { get; set; } - /// List of channels that this recommendation can apply. + + /// + /// Gets or sets list of channels that this recommendation can apply. + /// Possible values include: 'Notification', 'Api', 'Email', 'Webhook', + /// 'All' + /// + [JsonProperty(PropertyName = "properties.channels")] public Channels? Channels { get; set; } - /// The list of category tags that this recommendation belongs to. - public IReadOnlyList CategoryTags { get; } - /// Name of action recommended by this object. + + /// + /// Gets the list of category tags that this recommendation belongs to. + /// + [JsonProperty(PropertyName = "properties.categoryTags")] + public IList CategoryTags { get; private set; } + + /// + /// Gets or sets name of action recommended by this object. + /// + [JsonProperty(PropertyName = "properties.actionName")] public string ActionName { get; set; } - /// True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. + + /// + /// Gets or sets true if this recommendation is still valid (i.e. + /// "actionable"). False if it is invalid. + /// + [JsonProperty(PropertyName = "properties.enabled")] public int? Enabled { get; set; } - /// The list of states of this recommendation. If it's null then it should be considered "Active". - public IList States { get; } - /// The beginning time in UTC of a range that the recommendation refers to. - public DateTimeOffset? StartTime { get; set; } - /// The end time in UTC of a range that the recommendation refers to. - public DateTimeOffset? EndTime { get; set; } - /// When to notify this recommendation next in UTC. Null means that this will never be notified anymore. - public DateTimeOffset? NextNotificationTime { get; set; } - /// Date and time in UTC when this notification expires. - public DateTimeOffset? NotificationExpirationTime { get; set; } - /// Last timestamp in UTC this instance was actually notified. Null means that this recommendation hasn't been notified yet. - public DateTimeOffset? NotifiedTime { get; set; } - /// A metric value measured by the rule. + + /// + /// Gets or sets the list of states of this recommendation. If it's + /// null then it should be considered "Active". + /// + [JsonProperty(PropertyName = "properties.states")] + public IList States { get; set; } + + /// + /// Gets or sets the beginning time in UTC of a range that the + /// recommendation refers to. + /// + [JsonProperty(PropertyName = "properties.startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets the end time in UTC of a range that the recommendation + /// refers to. + /// + [JsonProperty(PropertyName = "properties.endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets when to notify this recommendation next in UTC. Null + /// means that this will never be notified anymore. + /// + [JsonProperty(PropertyName = "properties.nextNotificationTime")] + public System.DateTime? NextNotificationTime { get; set; } + + /// + /// Gets or sets date and time in UTC when this notification expires. + /// + [JsonProperty(PropertyName = "properties.notificationExpirationTime")] + public System.DateTime? NotificationExpirationTime { get; set; } + + /// + /// Gets or sets last timestamp in UTC this instance was actually + /// notified. Null means that this recommendation hasn't been notified + /// yet. + /// + [JsonProperty(PropertyName = "properties.notifiedTime")] + public System.DateTime? NotifiedTime { get; set; } + + /// + /// Gets or sets a metric value measured by the rule. + /// + [JsonProperty(PropertyName = "properties.score")] public double? Score { get; set; } - /// True if this is associated with a dynamically added rule. + + /// + /// Gets or sets true if this is associated with a dynamically added + /// rule + /// + [JsonProperty(PropertyName = "properties.isDynamic")] public bool? IsDynamic { get; set; } - /// Extension name of the portal if exists. + + /// + /// Gets or sets extension name of the portal if exists. + /// + [JsonProperty(PropertyName = "properties.extensionName")] public string ExtensionName { get; set; } - /// Deep link to a blade on the portal. + + /// + /// Gets or sets deep link to a blade on the portal. + /// + [JsonProperty(PropertyName = "properties.bladeName")] public string BladeName { get; set; } - /// Forward link to an external document associated with the rule. + + /// + /// Gets or sets forward link to an external document associated with + /// the rule. + /// + [JsonProperty(PropertyName = "properties.forwardLink")] public string ForwardLink { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.Serialization.cs deleted file mode 100644 index bc9037835d51..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class RecommendationCollection - { - internal static RecommendationCollection DeserializeRecommendationCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Recommendation.DeserializeRecommendation(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new RecommendationCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.cs deleted file mode 100644 index a1c4d0fbed30..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of recommendations. - internal partial class RecommendationCollection - { - /// Initializes a new instance of RecommendationCollection. - /// Collection of resources. - /// is null. - internal RecommendationCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of RecommendationCollection. - /// Collection of resources. - /// Link to next page of resources. - internal RecommendationCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.Serialization.cs deleted file mode 100644 index f942fe4bf221..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.Serialization.cs +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class RecommendationRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(RecommendationName)) - { - writer.WritePropertyName("recommendationName"); - writer.WriteStringValue(RecommendationName); - } - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"); - writer.WriteStringValue(Message); - } - if (Optional.IsDefined(RecommendationId)) - { - writer.WritePropertyName("recommendationId"); - writer.WriteStringValue(RecommendationId.Value); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(ActionName)) - { - writer.WritePropertyName("actionName"); - writer.WriteStringValue(ActionName); - } - if (Optional.IsDefined(Level)) - { - writer.WritePropertyName("level"); - writer.WriteStringValue(Level.Value.ToSerialString()); - } - if (Optional.IsDefined(Channels)) - { - writer.WritePropertyName("channels"); - writer.WriteStringValue(Channels.Value.ToSerialString()); - } - if (Optional.IsDefined(IsDynamic)) - { - writer.WritePropertyName("isDynamic"); - writer.WriteBooleanValue(IsDynamic.Value); - } - if (Optional.IsDefined(ExtensionName)) - { - writer.WritePropertyName("extensionName"); - writer.WriteStringValue(ExtensionName); - } - if (Optional.IsDefined(BladeName)) - { - writer.WritePropertyName("bladeName"); - writer.WriteStringValue(BladeName); - } - if (Optional.IsDefined(ForwardLink)) - { - writer.WritePropertyName("forwardLink"); - writer.WriteStringValue(ForwardLink); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static RecommendationRule DeserializeRecommendationRule(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional recommendationName = default; - Optional displayName = default; - Optional message = default; - Optional recommendationId = default; - Optional description = default; - Optional actionName = default; - Optional level = default; - Optional channels = default; - Optional> categoryTags = default; - Optional isDynamic = default; - Optional extensionName = default; - Optional bladeName = default; - Optional forwardLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("recommendationName")) - { - recommendationName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("displayName")) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("message")) - { - message = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("recommendationId")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - recommendationId = property0.Value.GetGuid(); - continue; - } - if (property0.NameEquals("description")) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("actionName")) - { - actionName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("level")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - level = property0.Value.GetString().ToNotificationLevel(); - continue; - } - if (property0.NameEquals("channels")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - channels = property0.Value.GetString().ToChannels(); - continue; - } - if (property0.NameEquals("categoryTags")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - categoryTags = array; - continue; - } - if (property0.NameEquals("isDynamic")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isDynamic = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("extensionName")) - { - extensionName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("bladeName")) - { - bladeName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("forwardLink")) - { - forwardLink = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new RecommendationRule(id.Value, name.Value, kind.Value, type.Value, recommendationName.Value, displayName.Value, message.Value, Optional.ToNullable(recommendationId), description.Value, actionName.Value, Optional.ToNullable(level), Optional.ToNullable(channels), Optional.ToList(categoryTags), Optional.ToNullable(isDynamic), extensionName.Value, bladeName.Value, forwardLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.cs index bc7b8d6a6687..79ad1c3a6199 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RecommendationRule.cs @@ -1,47 +1,73 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Represents a recommendation rule that the recommendation engine can perform. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents a recommendation rule that the recommendation engine can + /// perform. + /// + [Rest.Serialization.JsonTransformation] public partial class RecommendationRule : ProxyOnlyResource { - /// Initializes a new instance of RecommendationRule. + /// + /// Initializes a new instance of the RecommendationRule class. + /// public RecommendationRule() { - CategoryTags = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of RecommendationRule. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Unique name of the rule. - /// UI friendly name of the rule. - /// Localized name of the rule (Good for UI). - /// - /// Recommendation ID of an associated recommendation object tied to the rule, if exists. - /// If such an object doesn't exist, it is set to null. - /// - /// Localized detailed description of the rule. - /// Name of action that is recommended by this rule in string. - /// Level of impact indicating how critical this rule is. - /// List of available channels that this rule applies. - /// The list of category tags that this recommendation rule belongs to. - /// True if this is associated with a dynamically added rule. - /// Extension name of the portal if exists. Applicable to dynamic rule only. - /// Deep link to a blade on the portal. Applicable to dynamic rule only. - /// Forward link to an external document associated with the rule. Applicable to dynamic rule only. - internal RecommendationRule(string id, string name, string kind, string type, string recommendationName, string displayName, string message, Guid? recommendationId, string description, string actionName, NotificationLevel? level, Channels? channels, IReadOnlyList categoryTags, bool? isDynamic, string extensionName, string bladeName, string forwardLink) : base(id, name, kind, type) + /// + /// Initializes a new instance of the RecommendationRule class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Unique name of the rule. + /// UI friendly name of the rule. + /// Localized name of the rule (Good for + /// UI). + /// Recommendation ID of an associated + /// recommendation object tied to the rule, if exists. + /// If such an object doesn't exist, it is set to null. + /// Localized detailed description of the + /// rule. + /// Name of action that is recommended by this + /// rule in string. + /// Level of impact indicating how critical this + /// rule is. Possible values include: 'Critical', 'Warning', + /// 'Information', 'NonUrgentSuggestion' + /// List of available channels that this rule + /// applies. Possible values include: 'Notification', 'Api', 'Email', + /// 'Webhook', 'All' + /// The list of category tags that this + /// recommendation rule belongs to. + /// True if this is associated with a + /// dynamically added rule + /// Extension name of the portal if exists. + /// Applicable to dynamic rule only. + /// Deep link to a blade on the portal. + /// Applicable to dynamic rule only. + /// Forward link to an external document + /// associated with the rule. Applicable to dynamic rule only. + public RecommendationRule(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string recommendationName = default(string), string displayName = default(string), string message = default(string), System.Guid? recommendationId = default(System.Guid?), string description = default(string), string actionName = default(string), NotificationLevel? level = default(NotificationLevel?), Channels? channels = default(Channels?), IList categoryTags = default(IList), bool? isDynamic = default(bool?), string extensionName = default(string), string bladeName = default(string), string forwardLink = default(string)) + : base(id, name, kind, type) { RecommendationName = recommendationName; DisplayName = displayName; @@ -56,36 +82,103 @@ internal RecommendationRule(string id, string name, string kind, string type, st ExtensionName = extensionName; BladeName = bladeName; ForwardLink = forwardLink; + CustomInit(); } - /// Unique name of the rule. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unique name of the rule. + /// + [JsonProperty(PropertyName = "properties.recommendationName")] public string RecommendationName { get; set; } - /// UI friendly name of the rule. + + /// + /// Gets or sets UI friendly name of the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] public string DisplayName { get; set; } - /// Localized name of the rule (Good for UI). + + /// + /// Gets or sets localized name of the rule (Good for UI). + /// + [JsonProperty(PropertyName = "properties.message")] public string Message { get; set; } + + /// + /// Gets or sets recommendation ID of an associated recommendation + /// object tied to the rule, if exists. + /// If such an object doesn't exist, it is set to null. + /// + [JsonProperty(PropertyName = "properties.recommendationId")] + public System.Guid? RecommendationId { get; set; } + /// - /// Recommendation ID of an associated recommendation object tied to the rule, if exists. - /// If such an object doesn't exist, it is set to null. + /// Gets or sets localized detailed description of the rule. /// - public Guid? RecommendationId { get; set; } - /// Localized detailed description of the rule. + [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } - /// Name of action that is recommended by this rule in string. + + /// + /// Gets or sets name of action that is recommended by this rule in + /// string. + /// + [JsonProperty(PropertyName = "properties.actionName")] public string ActionName { get; set; } - /// Level of impact indicating how critical this rule is. + + /// + /// Gets or sets level of impact indicating how critical this rule is. + /// Possible values include: 'Critical', 'Warning', 'Information', + /// 'NonUrgentSuggestion' + /// + [JsonProperty(PropertyName = "properties.level")] public NotificationLevel? Level { get; set; } - /// List of available channels that this rule applies. + + /// + /// Gets or sets list of available channels that this rule applies. + /// Possible values include: 'Notification', 'Api', 'Email', 'Webhook', + /// 'All' + /// + [JsonProperty(PropertyName = "properties.channels")] public Channels? Channels { get; set; } - /// The list of category tags that this recommendation rule belongs to. - public IReadOnlyList CategoryTags { get; } - /// True if this is associated with a dynamically added rule. + + /// + /// Gets the list of category tags that this recommendation rule + /// belongs to. + /// + [JsonProperty(PropertyName = "properties.categoryTags")] + public IList CategoryTags { get; private set; } + + /// + /// Gets or sets true if this is associated with a dynamically added + /// rule + /// + [JsonProperty(PropertyName = "properties.isDynamic")] public bool? IsDynamic { get; set; } - /// Extension name of the portal if exists. Applicable to dynamic rule only. + + /// + /// Gets or sets extension name of the portal if exists. Applicable to + /// dynamic rule only. + /// + [JsonProperty(PropertyName = "properties.extensionName")] public string ExtensionName { get; set; } - /// Deep link to a blade on the portal. Applicable to dynamic rule only. + + /// + /// Gets or sets deep link to a blade on the portal. Applicable to + /// dynamic rule only. + /// + [JsonProperty(PropertyName = "properties.bladeName")] public string BladeName { get; set; } - /// Forward link to an external document associated with the rule. Applicable to dynamic rule only. + + /// + /// Gets or sets forward link to an external document associated with + /// the rule. Applicable to dynamic rule only. + /// + [JsonProperty(PropertyName = "properties.forwardLink")] public string ForwardLink { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.Serialization.cs deleted file mode 100644 index 381df8659031..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class RedundancyModeExtensions - { - public static string ToSerialString(this RedundancyMode value) => value switch - { - RedundancyMode.None => "None", - RedundancyMode.Manual => "Manual", - RedundancyMode.Failover => "Failover", - RedundancyMode.ActiveActive => "ActiveActive", - RedundancyMode.GeoRedundant => "GeoRedundant", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RedundancyMode value.") - }; - - public static RedundancyMode ToRedundancyMode(this string value) - { - if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return RedundancyMode.None; - if (string.Equals(value, "Manual", StringComparison.InvariantCultureIgnoreCase)) return RedundancyMode.Manual; - if (string.Equals(value, "Failover", StringComparison.InvariantCultureIgnoreCase)) return RedundancyMode.Failover; - if (string.Equals(value, "ActiveActive", StringComparison.InvariantCultureIgnoreCase)) return RedundancyMode.ActiveActive; - if (string.Equals(value, "GeoRedundant", StringComparison.InvariantCultureIgnoreCase)) return RedundancyMode.GeoRedundant; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RedundancyMode value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.cs index 38f8d2657210..555eec94aacc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RedundancyMode.cs @@ -1,24 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Site redundancy mode. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for RedundancyMode. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum RedundancyMode { - /// None. + [EnumMember(Value = "None")] None, - /// Manual. + [EnumMember(Value = "Manual")] Manual, - /// Failover. + [EnumMember(Value = "Failover")] Failover, - /// ActiveActive. + [EnumMember(Value = "ActiveActive")] ActiveActive, - /// GeoRedundant. + [EnumMember(Value = "GeoRedundant")] GeoRedundant } + internal static class RedundancyModeEnumExtension + { + internal static string ToSerializedValue(this RedundancyMode? value) + { + return value == null ? null : ((RedundancyMode)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this RedundancyMode value) + { + switch( value ) + { + case RedundancyMode.None: + return "None"; + case RedundancyMode.Manual: + return "Manual"; + case RedundancyMode.Failover: + return "Failover"; + case RedundancyMode.ActiveActive: + return "ActiveActive"; + case RedundancyMode.GeoRedundant: + return "GeoRedundant"; + } + return null; + } + + internal static RedundancyMode? ParseRedundancyMode(this string value) + { + switch( value ) + { + case "None": + return RedundancyMode.None; + case "Manual": + return RedundancyMode.Manual; + case "Failover": + return RedundancyMode.Failover; + case "ActiveActive": + return RedundancyMode.ActiveActive; + case "GeoRedundant": + return RedundancyMode.GeoRedundant; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.Serialization.cs deleted file mode 100644 index f72a8ce1b88a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.Serialization.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ReissueCertificateOrderRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(KeySize)) - { - writer.WritePropertyName("keySize"); - writer.WriteNumberValue(KeySize.Value); - } - if (Optional.IsDefined(DelayExistingRevokeInHours)) - { - writer.WritePropertyName("delayExistingRevokeInHours"); - writer.WriteNumberValue(DelayExistingRevokeInHours.Value); - } - if (Optional.IsDefined(Csr)) - { - writer.WritePropertyName("csr"); - writer.WriteStringValue(Csr); - } - if (Optional.IsDefined(IsPrivateKeyExternal)) - { - writer.WritePropertyName("isPrivateKeyExternal"); - writer.WriteBooleanValue(IsPrivateKeyExternal.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ReissueCertificateOrderRequest DeserializeReissueCertificateOrderRequest(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional keySize = default; - Optional delayExistingRevokeInHours = default; - Optional csr = default; - Optional isPrivateKeyExternal = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("keySize")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - keySize = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("delayExistingRevokeInHours")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - delayExistingRevokeInHours = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("csr")) - { - csr = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("isPrivateKeyExternal")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isPrivateKeyExternal = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new ReissueCertificateOrderRequest(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(keySize), Optional.ToNullable(delayExistingRevokeInHours), csr.Value, Optional.ToNullable(isPrivateKeyExternal)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.cs index fb729f84d907..6cc305676cc6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ReissueCertificateOrderRequest.cs @@ -1,44 +1,90 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Class representing certificate reissue request. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Class representing certificate reissue request. + /// + [Rest.Serialization.JsonTransformation] public partial class ReissueCertificateOrderRequest : ProxyOnlyResource { - /// Initializes a new instance of ReissueCertificateOrderRequest. + /// + /// Initializes a new instance of the ReissueCertificateOrderRequest + /// class. + /// public ReissueCertificateOrderRequest() { + CustomInit(); } - /// Initializes a new instance of ReissueCertificateOrderRequest. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Certificate Key Size. - /// Delay in hours to revoke existing certificate after the new certificate is issued. - /// Csr to be used for re-key operation. - /// Should we change the ASC type (from managed private key to external private key and vice versa). - internal ReissueCertificateOrderRequest(string id, string name, string kind, string type, int? keySize, int? delayExistingRevokeInHours, string csr, bool? isPrivateKeyExternal) : base(id, name, kind, type) + /// + /// Initializes a new instance of the ReissueCertificateOrderRequest + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Certificate Key Size. + /// Delay in hours to revoke + /// existing certificate after the new certificate is issued. + /// Csr to be used for re-key operation. + /// Should we change the ASC type + /// (from managed private key to external private key and vice + /// versa). + public ReissueCertificateOrderRequest(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? keySize = default(int?), int? delayExistingRevokeInHours = default(int?), string csr = default(string), bool? isPrivateKeyExternal = default(bool?)) + : base(id, name, kind, type) { KeySize = keySize; DelayExistingRevokeInHours = delayExistingRevokeInHours; Csr = csr; IsPrivateKeyExternal = isPrivateKeyExternal; + CustomInit(); } - /// Certificate Key Size. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets certificate Key Size. + /// + [JsonProperty(PropertyName = "properties.keySize")] public int? KeySize { get; set; } - /// Delay in hours to revoke existing certificate after the new certificate is issued. + + /// + /// Gets or sets delay in hours to revoke existing certificate after + /// the new certificate is issued. + /// + [JsonProperty(PropertyName = "properties.delayExistingRevokeInHours")] public int? DelayExistingRevokeInHours { get; set; } - /// Csr to be used for re-key operation. + + /// + /// Gets or sets csr to be used for re-key operation. + /// + [JsonProperty(PropertyName = "properties.csr")] public string Csr { get; set; } - /// Should we change the ASC type (from managed private key to external private key and vice versa). + + /// + /// Gets or sets should we change the ASC type (from managed private + /// key to external private key and vice versa). + /// + [JsonProperty(PropertyName = "properties.isPrivateKeyExternal")] public bool? IsPrivateKeyExternal { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.Serialization.cs deleted file mode 100644 index 5e0253c3058f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.Serialization.cs +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class RelayServiceConnectionEntity : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(EntityName)) - { - writer.WritePropertyName("entityName"); - writer.WriteStringValue(EntityName); - } - if (Optional.IsDefined(EntityConnectionString)) - { - writer.WritePropertyName("entityConnectionString"); - writer.WriteStringValue(EntityConnectionString); - } - if (Optional.IsDefined(ResourceType)) - { - writer.WritePropertyName("resourceType"); - writer.WriteStringValue(ResourceType); - } - if (Optional.IsDefined(ResourceConnectionString)) - { - writer.WritePropertyName("resourceConnectionString"); - writer.WriteStringValue(ResourceConnectionString); - } - if (Optional.IsDefined(Hostname)) - { - writer.WritePropertyName("hostname"); - writer.WriteStringValue(Hostname); - } - if (Optional.IsDefined(Port)) - { - writer.WritePropertyName("port"); - writer.WriteNumberValue(Port.Value); - } - if (Optional.IsDefined(BiztalkUri)) - { - writer.WritePropertyName("biztalkUri"); - writer.WriteStringValue(BiztalkUri); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static RelayServiceConnectionEntity DeserializeRelayServiceConnectionEntity(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional entityName = default; - Optional entityConnectionString = default; - Optional resourceType = default; - Optional resourceConnectionString = default; - Optional hostname = default; - Optional port = default; - Optional biztalkUri = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("entityName")) - { - entityName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("entityConnectionString")) - { - entityConnectionString = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("resourceType")) - { - resourceType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("resourceConnectionString")) - { - resourceConnectionString = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostname")) - { - hostname = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("port")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - port = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("biztalkUri")) - { - biztalkUri = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new RelayServiceConnectionEntity(id.Value, name.Value, kind.Value, type.Value, entityName.Value, entityConnectionString.Value, resourceType.Value, resourceConnectionString.Value, hostname.Value, Optional.ToNullable(port), biztalkUri.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.cs index 3613870848ef..9323d5b30647 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RelayServiceConnectionEntity.cs @@ -1,33 +1,45 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Hybrid Connection for an App Service app. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Hybrid Connection for an App Service app. + /// + [Rest.Serialization.JsonTransformation] public partial class RelayServiceConnectionEntity : ProxyOnlyResource { - /// Initializes a new instance of RelayServiceConnectionEntity. + /// + /// Initializes a new instance of the RelayServiceConnectionEntity + /// class. + /// public RelayServiceConnectionEntity() { + CustomInit(); } - /// Initializes a new instance of RelayServiceConnectionEntity. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// . - /// . - /// . - /// . - /// . - /// . - /// . - internal RelayServiceConnectionEntity(string id, string name, string kind, string type, string entityName, string entityConnectionString, string resourceType, string resourceConnectionString, string hostname, int? port, string biztalkUri) : base(id, name, kind, type) + /// + /// Initializes a new instance of the RelayServiceConnectionEntity + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public RelayServiceConnectionEntity(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string entityName = default(string), string entityConnectionString = default(string), string resourceType = default(string), string resourceConnectionString = default(string), string hostname = default(string), int? port = default(int?), string biztalkUri = default(string)) + : base(id, name, kind, type) { EntityName = entityName; EntityConnectionString = entityConnectionString; @@ -36,14 +48,48 @@ internal RelayServiceConnectionEntity(string id, string name, string kind, strin Hostname = hostname; Port = port; BiztalkUri = biztalkUri; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.entityName")] public string EntityName { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.entityConnectionString")] public string EntityConnectionString { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.resourceType")] public string ResourceType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.resourceConnectionString")] public string ResourceConnectionString { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.hostname")] public string Hostname { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.port")] public int? Port { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.biztalkUri")] public string BiztalkUri { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.Serialization.cs deleted file mode 100644 index b6fd9cfb3295..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.Serialization.cs +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class RemotePrivateEndpointConnection : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(PrivateEndpoint)) - { - writer.WritePropertyName("privateEndpoint"); - writer.WriteObjectValue(PrivateEndpoint); - } - if (Optional.IsDefined(PrivateLinkServiceConnectionState)) - { - writer.WritePropertyName("privateLinkServiceConnectionState"); - writer.WriteObjectValue(PrivateLinkServiceConnectionState); - } - if (Optional.IsCollectionDefined(IpAddresses)) - { - writer.WritePropertyName("ipAddresses"); - writer.WriteStartArray(); - foreach (var item in IpAddresses) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static RemotePrivateEndpointConnection DeserializeRemotePrivateEndpointConnection(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional provisioningState = default; - Optional privateEndpoint = default; - Optional privateLinkServiceConnectionState = default; - Optional> ipAddresses = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState")) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("privateEndpoint")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - privateEndpoint = ArmIdWrapper.DeserializeArmIdWrapper(property0.Value); - continue; - } - if (property0.NameEquals("privateLinkServiceConnectionState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - privateLinkServiceConnectionState = PrivateLinkConnectionState.DeserializePrivateLinkConnectionState(property0.Value); - continue; - } - if (property0.NameEquals("ipAddresses")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - ipAddresses = array; - continue; - } - } - continue; - } - } - return new RemotePrivateEndpointConnection(id.Value, name.Value, kind.Value, type.Value, provisioningState.Value, privateEndpoint.Value, privateLinkServiceConnectionState.Value, Optional.ToList(ipAddresses)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.cs deleted file mode 100644 index 41f522545c66..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// A remote private endpoint connection. - public partial class RemotePrivateEndpointConnection : ProxyOnlyResource - { - /// Initializes a new instance of RemotePrivateEndpointConnection. - public RemotePrivateEndpointConnection() - { - IpAddresses = new ChangeTrackingList(); - } - - /// Initializes a new instance of RemotePrivateEndpointConnection. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// . - /// PrivateEndpoint of a remote private endpoint connection. - /// The state of a private link connection. - /// Private IPAddresses mapped to the remote private endpoint. - internal RemotePrivateEndpointConnection(string id, string name, string kind, string type, string provisioningState, ArmIdWrapper privateEndpoint, PrivateLinkConnectionState privateLinkServiceConnectionState, IList ipAddresses) : base(id, name, kind, type) - { - ProvisioningState = provisioningState; - PrivateEndpoint = privateEndpoint; - PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; - IpAddresses = ipAddresses; - } - - public string ProvisioningState { get; } - /// PrivateEndpoint of a remote private endpoint connection. - public ArmIdWrapper PrivateEndpoint { get; set; } - /// The state of a private link connection. - public PrivateLinkConnectionState PrivateLinkServiceConnectionState { get; set; } - /// Private IPAddresses mapped to the remote private endpoint. - public IList IpAddresses { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.Serialization.cs deleted file mode 100644 index bbf0e4d10351..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.Serialization.cs +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class RemotePrivateEndpointConnectionARMResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(PrivateEndpoint)) - { - writer.WritePropertyName("privateEndpoint"); - writer.WriteObjectValue(PrivateEndpoint); - } - if (Optional.IsDefined(PrivateLinkServiceConnectionState)) - { - writer.WritePropertyName("privateLinkServiceConnectionState"); - writer.WriteObjectValue(PrivateLinkServiceConnectionState); - } - if (Optional.IsCollectionDefined(IpAddresses)) - { - writer.WritePropertyName("ipAddresses"); - writer.WriteStartArray(); - foreach (var item in IpAddresses) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static RemotePrivateEndpointConnectionARMResource DeserializeRemotePrivateEndpointConnectionARMResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional provisioningState = default; - Optional privateEndpoint = default; - Optional privateLinkServiceConnectionState = default; - Optional> ipAddresses = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState")) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("privateEndpoint")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - privateEndpoint = ArmIdWrapper.DeserializeArmIdWrapper(property0.Value); - continue; - } - if (property0.NameEquals("privateLinkServiceConnectionState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - privateLinkServiceConnectionState = PrivateLinkConnectionState.DeserializePrivateLinkConnectionState(property0.Value); - continue; - } - if (property0.NameEquals("ipAddresses")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - ipAddresses = array; - continue; - } - } - continue; - } - } - return new RemotePrivateEndpointConnectionARMResource(id.Value, name.Value, kind.Value, type.Value, provisioningState.Value, privateEndpoint.Value, privateLinkServiceConnectionState.Value, Optional.ToList(ipAddresses)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs deleted file mode 100644 index 9c662648dc07..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Remote Private Endpoint Connection ARM resource. - public partial class RemotePrivateEndpointConnectionARMResource : ProxyOnlyResource - { - /// Initializes a new instance of RemotePrivateEndpointConnectionARMResource. - public RemotePrivateEndpointConnectionARMResource() - { - IpAddresses = new ChangeTrackingList(); - } - - /// Initializes a new instance of RemotePrivateEndpointConnectionARMResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// . - /// PrivateEndpoint of a remote private endpoint connection. - /// The state of a private link connection. - /// Private IPAddresses mapped to the remote private endpoint. - internal RemotePrivateEndpointConnectionARMResource(string id, string name, string kind, string type, string provisioningState, ArmIdWrapper privateEndpoint, PrivateLinkConnectionState privateLinkServiceConnectionState, IList ipAddresses) : base(id, name, kind, type) - { - ProvisioningState = provisioningState; - PrivateEndpoint = privateEndpoint; - PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; - IpAddresses = ipAddresses; - } - - public string ProvisioningState { get; } - /// PrivateEndpoint of a remote private endpoint connection. - public ArmIdWrapper PrivateEndpoint { get; set; } - /// The state of a private link connection. - public PrivateLinkConnectionState PrivateLinkServiceConnectionState { get; set; } - /// Private IPAddresses mapped to the remote private endpoint. - public IList IpAddresses { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.Serialization.cs deleted file mode 100644 index 07fb54e2a310..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.Serialization.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Rendering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Type)) - { - writer.WritePropertyName("type"); - writer.WriteStringValue(Type.Value.ToSerialString()); - } - if (Optional.IsDefined(Title)) - { - writer.WritePropertyName("title"); - writer.WriteStringValue(Title); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"); - writer.WriteStringValue(Description); - } - writer.WriteEndObject(); - } - - internal static Rendering DeserializeRendering(JsonElement element) - { - Optional type = default; - Optional title = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = property.Value.GetString().ToRenderingType(); - continue; - } - if (property.NameEquals("title")) - { - title = property.Value.GetString(); - continue; - } - if (property.NameEquals("description")) - { - description = property.Value.GetString(); - continue; - } - } - return new Rendering(Optional.ToNullable(type), title.Value, description.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs index 41cb77b0eb31..8080fa872330 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs @@ -1,36 +1,71 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Instructions for rendering the data. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Instructions for rendering the data + /// public partial class Rendering { - /// Initializes a new instance of Rendering. + /// + /// Initializes a new instance of the Rendering class. + /// public Rendering() { + CustomInit(); } - /// Initializes a new instance of Rendering. - /// Rendering Type. - /// Title of data. - /// Description of the data that will help it be interpreted. - internal Rendering(RenderingType? type, string title, string description) + /// + /// Initializes a new instance of the Rendering class. + /// + /// Rendering Type. Possible values include: + /// 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + /// Title of data + /// Description of the data that will help it + /// be interpreted + public Rendering(RenderingType? type = default(RenderingType?), string title = default(string), string description = default(string)) { Type = type; Title = title; Description = description; + CustomInit(); } - /// Rendering Type. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets rendering Type. Possible values include: 'NoGraph', + /// 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + /// + [JsonProperty(PropertyName = "type")] public RenderingType? Type { get; set; } - /// Title of data. + + /// + /// Gets or sets title of data + /// + [JsonProperty(PropertyName = "title")] public string Title { get; set; } - /// Description of the data that will help it be interpreted. + + /// + /// Gets or sets description of the data that will help it be + /// interpreted + /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.Serialization.cs deleted file mode 100644 index b1634af3e465..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.Serialization.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class RenderingTypeExtensions - { - public static string ToSerialString(this RenderingType value) => value switch - { - RenderingType.NoGraph => "NoGraph", - RenderingType.Table => "Table", - RenderingType.TimeSeries => "TimeSeries", - RenderingType.TimeSeriesPerInstance => "TimeSeriesPerInstance", - RenderingType.PieChart => "PieChart", - RenderingType.DataSummary => "DataSummary", - RenderingType.Email => "Email", - RenderingType.Insights => "Insights", - RenderingType.DynamicInsight => "DynamicInsight", - RenderingType.Markdown => "Markdown", - RenderingType.Detector => "Detector", - RenderingType.DropDown => "DropDown", - RenderingType.Card => "Card", - RenderingType.Solution => "Solution", - RenderingType.Guage => "Guage", - RenderingType.Form => "Form", - RenderingType.ChangeSets => "ChangeSets", - RenderingType.ChangeAnalysisOnboarding => "ChangeAnalysisOnboarding", - RenderingType.ChangesView => "ChangesView", - RenderingType.AppInsight => "AppInsight", - RenderingType.DependencyGraph => "DependencyGraph", - RenderingType.DownTime => "DownTime", - RenderingType.SummaryCard => "SummaryCard", - RenderingType.SearchComponent => "SearchComponent", - RenderingType.AppInsightEnablement => "AppInsightEnablement", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RenderingType value.") - }; - - public static RenderingType ToRenderingType(this string value) - { - if (string.Equals(value, "NoGraph", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.NoGraph; - if (string.Equals(value, "Table", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Table; - if (string.Equals(value, "TimeSeries", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.TimeSeries; - if (string.Equals(value, "TimeSeriesPerInstance", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.TimeSeriesPerInstance; - if (string.Equals(value, "PieChart", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.PieChart; - if (string.Equals(value, "DataSummary", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.DataSummary; - if (string.Equals(value, "Email", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Email; - if (string.Equals(value, "Insights", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Insights; - if (string.Equals(value, "DynamicInsight", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.DynamicInsight; - if (string.Equals(value, "Markdown", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Markdown; - if (string.Equals(value, "Detector", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Detector; - if (string.Equals(value, "DropDown", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.DropDown; - if (string.Equals(value, "Card", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Card; - if (string.Equals(value, "Solution", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Solution; - if (string.Equals(value, "Guage", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Guage; - if (string.Equals(value, "Form", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.Form; - if (string.Equals(value, "ChangeSets", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.ChangeSets; - if (string.Equals(value, "ChangeAnalysisOnboarding", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.ChangeAnalysisOnboarding; - if (string.Equals(value, "ChangesView", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.ChangesView; - if (string.Equals(value, "AppInsight", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.AppInsight; - if (string.Equals(value, "DependencyGraph", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.DependencyGraph; - if (string.Equals(value, "DownTime", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.DownTime; - if (string.Equals(value, "SummaryCard", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.SummaryCard; - if (string.Equals(value, "SearchComponent", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.SearchComponent; - if (string.Equals(value, "AppInsightEnablement", StringComparison.InvariantCultureIgnoreCase)) return RenderingType.AppInsightEnablement; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RenderingType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs index 3c52520a9a95..bf0ebdff16f5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs @@ -1,64 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Rendering Type. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for RenderingType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum RenderingType { - /// NoGraph. + [EnumMember(Value = "NoGraph")] NoGraph, - /// Table. + [EnumMember(Value = "Table")] Table, - /// TimeSeries. + [EnumMember(Value = "TimeSeries")] TimeSeries, - /// TimeSeriesPerInstance. - TimeSeriesPerInstance, - /// PieChart. - PieChart, - /// DataSummary. - DataSummary, - /// Email. - Email, - /// Insights. - Insights, - /// DynamicInsight. - DynamicInsight, - /// Markdown. - Markdown, - /// Detector. - Detector, - /// DropDown. - DropDown, - /// Card. - Card, - /// Solution. - Solution, - /// Guage. - Guage, - /// Form. - Form, - /// ChangeSets. - ChangeSets, - /// ChangeAnalysisOnboarding. - ChangeAnalysisOnboarding, - /// ChangesView. - ChangesView, - /// AppInsight. - AppInsight, - /// DependencyGraph. - DependencyGraph, - /// DownTime. - DownTime, - /// SummaryCard. - SummaryCard, - /// SearchComponent. - SearchComponent, - /// AppInsightEnablement. - AppInsightEnablement + [EnumMember(Value = "TimeSeriesPerInstance")] + TimeSeriesPerInstance + } + internal static class RenderingTypeEnumExtension + { + internal static string ToSerializedValue(this RenderingType? value) + { + return value == null ? null : ((RenderingType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this RenderingType value) + { + switch( value ) + { + case RenderingType.NoGraph: + return "NoGraph"; + case RenderingType.Table: + return "Table"; + case RenderingType.TimeSeries: + return "TimeSeries"; + case RenderingType.TimeSeriesPerInstance: + return "TimeSeriesPerInstance"; + } + return null; + } + + internal static RenderingType? ParseRenderingType(this string value) + { + switch( value ) + { + case "NoGraph": + return RenderingType.NoGraph; + case "Table": + return RenderingType.Table; + case "TimeSeries": + return RenderingType.TimeSeries; + case "TimeSeriesPerInstance": + return RenderingType.TimeSeriesPerInstance; + } + return null; + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.Serialization.cs deleted file mode 100644 index 82799e125ff1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.Serialization.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class RenewCertificateOrderRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(KeySize)) - { - writer.WritePropertyName("keySize"); - writer.WriteNumberValue(KeySize.Value); - } - if (Optional.IsDefined(Csr)) - { - writer.WritePropertyName("csr"); - writer.WriteStringValue(Csr); - } - if (Optional.IsDefined(IsPrivateKeyExternal)) - { - writer.WritePropertyName("isPrivateKeyExternal"); - writer.WriteBooleanValue(IsPrivateKeyExternal.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static RenewCertificateOrderRequest DeserializeRenewCertificateOrderRequest(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional keySize = default; - Optional csr = default; - Optional isPrivateKeyExternal = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("keySize")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - keySize = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("csr")) - { - csr = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("isPrivateKeyExternal")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isPrivateKeyExternal = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new RenewCertificateOrderRequest(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(keySize), csr.Value, Optional.ToNullable(isPrivateKeyExternal)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.cs index d88ff1b218f9..cdd22b65c909 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenewCertificateOrderRequest.cs @@ -1,40 +1,80 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Class representing certificate renew request. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Class representing certificate renew request. + /// + [Rest.Serialization.JsonTransformation] public partial class RenewCertificateOrderRequest : ProxyOnlyResource { - /// Initializes a new instance of RenewCertificateOrderRequest. + /// + /// Initializes a new instance of the RenewCertificateOrderRequest + /// class. + /// public RenewCertificateOrderRequest() { + CustomInit(); } - /// Initializes a new instance of RenewCertificateOrderRequest. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Certificate Key Size. - /// Csr to be used for re-key operation. - /// Should we change the ASC type (from managed private key to external private key and vice versa). - internal RenewCertificateOrderRequest(string id, string name, string kind, string type, int? keySize, string csr, bool? isPrivateKeyExternal) : base(id, name, kind, type) + /// + /// Initializes a new instance of the RenewCertificateOrderRequest + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Certificate Key Size. + /// Csr to be used for re-key operation. + /// Should we change the ASC type + /// (from managed private key to external private key and vice + /// versa). + public RenewCertificateOrderRequest(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? keySize = default(int?), string csr = default(string), bool? isPrivateKeyExternal = default(bool?)) + : base(id, name, kind, type) { KeySize = keySize; Csr = csr; IsPrivateKeyExternal = isPrivateKeyExternal; + CustomInit(); } - /// Certificate Key Size. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets certificate Key Size. + /// + [JsonProperty(PropertyName = "properties.keySize")] public int? KeySize { get; set; } - /// Csr to be used for re-key operation. + + /// + /// Gets or sets csr to be used for re-key operation. + /// + [JsonProperty(PropertyName = "properties.csr")] public string Csr { get; set; } - /// Should we change the ASC type (from managed private key to external private key and vice versa). + + /// + /// Gets or sets should we change the ASC type (from managed private + /// key to external private key and vice versa). + /// + [JsonProperty(PropertyName = "properties.isPrivateKeyExternal")] public bool? IsPrivateKeyExternal { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.Serialization.cs deleted file mode 100644 index c6880c2534b1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.Serialization.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class RequestsBasedTrigger : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(TimeInterval)) - { - writer.WritePropertyName("timeInterval"); - writer.WriteStringValue(TimeInterval); - } - writer.WriteEndObject(); - } - - internal static RequestsBasedTrigger DeserializeRequestsBasedTrigger(JsonElement element) - { - Optional count = default; - Optional timeInterval = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("count")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - count = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("timeInterval")) - { - timeInterval = property.Value.GetString(); - continue; - } - } - return new RequestsBasedTrigger(Optional.ToNullable(count), timeInterval.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.cs index d1ec596fe3ec..d96750f47c95 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RequestsBasedTrigger.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Trigger based on total requests. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Trigger based on total requests. + /// public partial class RequestsBasedTrigger { - /// Initializes a new instance of RequestsBasedTrigger. + /// + /// Initializes a new instance of the RequestsBasedTrigger class. + /// public RequestsBasedTrigger() { + CustomInit(); } - /// Initializes a new instance of RequestsBasedTrigger. - /// Request Count. - /// Time interval. - internal RequestsBasedTrigger(int? count, string timeInterval) + /// + /// Initializes a new instance of the RequestsBasedTrigger class. + /// + /// Request Count. + /// Time interval. + public RequestsBasedTrigger(int? count = default(int?), string timeInterval = default(string)) { Count = count; TimeInterval = timeInterval; + CustomInit(); } - /// Request Count. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets request Count. + /// + [JsonProperty(PropertyName = "count")] public int? Count { get; set; } - /// Time interval. + + /// + /// Gets or sets time interval. + /// + [JsonProperty(PropertyName = "timeInterval")] public string TimeInterval { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.Serialization.cs deleted file mode 100644 index 841655b12455..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class ResolveStatusExtensions - { - public static string ToSerialString(this ResolveStatus value) => value switch - { - ResolveStatus.Initialized => "Initialized", - ResolveStatus.Resolved => "Resolved", - ResolveStatus.InvalidSyntax => "InvalidSyntax", - ResolveStatus.MSINotEnabled => "MSINotEnabled", - ResolveStatus.VaultNotFound => "VaultNotFound", - ResolveStatus.SecretNotFound => "SecretNotFound", - ResolveStatus.SecretVersionNotFound => "SecretVersionNotFound", - ResolveStatus.AccessToKeyVaultDenied => "AccessToKeyVaultDenied", - ResolveStatus.OtherReasons => "OtherReasons", - ResolveStatus.FetchTimedOut => "FetchTimedOut", - ResolveStatus.UnauthorizedClient => "UnauthorizedClient", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResolveStatus value.") - }; - - public static ResolveStatus ToResolveStatus(this string value) - { - if (string.Equals(value, "Initialized", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.Initialized; - if (string.Equals(value, "Resolved", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.Resolved; - if (string.Equals(value, "InvalidSyntax", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.InvalidSyntax; - if (string.Equals(value, "MSINotEnabled", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.MSINotEnabled; - if (string.Equals(value, "VaultNotFound", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.VaultNotFound; - if (string.Equals(value, "SecretNotFound", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.SecretNotFound; - if (string.Equals(value, "SecretVersionNotFound", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.SecretVersionNotFound; - if (string.Equals(value, "AccessToKeyVaultDenied", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.AccessToKeyVaultDenied; - if (string.Equals(value, "OtherReasons", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.OtherReasons; - if (string.Equals(value, "FetchTimedOut", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.FetchTimedOut; - if (string.Equals(value, "UnauthorizedClient", StringComparison.InvariantCultureIgnoreCase)) return ResolveStatus.UnauthorizedClient; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResolveStatus value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs deleted file mode 100644 index fdcf177c7557..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// The ResolveStatus. - public enum ResolveStatus - { - /// Initialized. - Initialized, - /// Resolved. - Resolved, - /// InvalidSyntax. - InvalidSyntax, - /// MSINotEnabled. - MSINotEnabled, - /// VaultNotFound. - VaultNotFound, - /// SecretNotFound. - SecretNotFound, - /// SecretVersionNotFound. - SecretVersionNotFound, - /// AccessToKeyVaultDenied. - AccessToKeyVaultDenied, - /// OtherReasons. - OtherReasons, - /// FetchTimedOut. - FetchTimedOut, - /// UnauthorizedClient. - UnauthorizedClient - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.Serialization.cs deleted file mode 100644 index ba43f587aaf2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.Serialization.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Resource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - - internal static Resource DeserializeResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - string location = default; - Optional type = default; - Optional> tags = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - } - return new Resource(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.cs index 568c2e461049..b9afb2fc04f6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Resource.cs @@ -1,41 +1,45 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Azure resource. This resource is tracked in Azure Resource Manager. - public partial class Resource + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure resource. This resource is tracked in Azure Resource Manager + /// + public partial class Resource : IResource { - /// Initializes a new instance of Resource. - /// Resource Location. - /// is null. - public Resource(string location) + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - Location = location; - Tags = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of Resource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource Location. - /// Resource type. - /// Resource tags. - internal Resource(string id, string name, string kind, string location, string type, IDictionary tags) + /// + /// Initializes a new instance of the Resource class. + /// + /// Resource Location. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Resource tags. + public Resource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary)) { Id = id; Name = name; @@ -43,19 +47,62 @@ internal Resource(string id, string name, string kind, string location, string t Location = location; Type = type; Tags = tags; + CustomInit(); } - /// Resource Id. - public string Id { get; } - /// Resource Name. - public string Name { get; } - /// Kind of resource. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource Name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets kind of resource. + /// + [JsonProperty(PropertyName = "kind")] public string Kind { get; set; } - /// Resource Location. + + /// + /// Gets or sets resource Location. + /// + [JsonProperty(PropertyName = "location")] public string Location { get; set; } - /// Resource type. - public string Type { get; } - /// Resource tags. - public IDictionary Tags { get; } + + /// + /// Gets resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.Serialization.cs deleted file mode 100644 index 346bc9146736..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class ResourceCollection - { - internal static ResourceCollection DeserializeResourceCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ResourceCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.cs deleted file mode 100644 index b52616340bfc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of resources. - internal partial class ResourceCollection - { - /// Initializes a new instance of ResourceCollection. - /// Collection of resources. - /// is null. - internal ResourceCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of ResourceCollection. - /// Collection of resources. - /// Link to next page of resources. - internal ResourceCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.Serialization.cs deleted file mode 100644 index d3a434e8e6b5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ResourceHealthMetadata : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Category)) - { - writer.WritePropertyName("category"); - writer.WriteStringValue(Category); - } - if (Optional.IsDefined(SignalAvailability)) - { - writer.WritePropertyName("signalAvailability"); - writer.WriteBooleanValue(SignalAvailability.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ResourceHealthMetadata DeserializeResourceHealthMetadata(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional category = default; - Optional signalAvailability = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("category")) - { - category = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("signalAvailability")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - signalAvailability = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new ResourceHealthMetadata(id.Value, name.Value, kind.Value, type.Value, category.Value, Optional.ToNullable(signalAvailability)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.cs index c01704979f68..d27a122a6915 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadata.cs @@ -1,36 +1,70 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Used for getting ResourceHealthCheck settings. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Used for getting ResourceHealthCheck settings. + /// + [Rest.Serialization.JsonTransformation] public partial class ResourceHealthMetadata : ProxyOnlyResource { - /// Initializes a new instance of ResourceHealthMetadata. + /// + /// Initializes a new instance of the ResourceHealthMetadata class. + /// public ResourceHealthMetadata() { + CustomInit(); } - /// Initializes a new instance of ResourceHealthMetadata. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The category that the resource matches in the RHC Policy File. - /// Is there a health signal for the resource. - internal ResourceHealthMetadata(string id, string name, string kind, string type, string category, bool? signalAvailability) : base(id, name, kind, type) + /// + /// Initializes a new instance of the ResourceHealthMetadata class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The category that the resource matches in + /// the RHC Policy File + /// Is there a health signal for the + /// resource + public ResourceHealthMetadata(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string category = default(string), bool? signalAvailability = default(bool?)) + : base(id, name, kind, type) { Category = category; SignalAvailability = signalAvailability; + CustomInit(); } - /// The category that the resource matches in the RHC Policy File. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the category that the resource matches in the RHC + /// Policy File + /// + [JsonProperty(PropertyName = "properties.category")] public string Category { get; set; } - /// Is there a health signal for the resource. + + /// + /// Gets or sets is there a health signal for the resource + /// + [JsonProperty(PropertyName = "properties.signalAvailability")] public bool? SignalAvailability { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.Serialization.cs deleted file mode 100644 index e980399e50cf..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class ResourceHealthMetadataCollection - { - internal static ResourceHealthMetadataCollection DeserializeResourceHealthMetadataCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ResourceHealthMetadata.DeserializeResourceHealthMetadata(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ResourceHealthMetadataCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.cs deleted file mode 100644 index 9ee25824870b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceHealthMetadataCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of resource health metadata. - internal partial class ResourceHealthMetadataCollection - { - /// Initializes a new instance of ResourceHealthMetadataCollection. - /// Collection of resources. - /// is null. - internal ResourceHealthMetadataCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of ResourceHealthMetadataCollection. - /// Collection of resources. - /// Link to next page of resources. - internal ResourceHealthMetadataCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.Serialization.cs deleted file mode 100644 index 0385710706f1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ResourceMetricAvailability - { - internal static ResourceMetricAvailability DeserializeResourceMetricAvailability(JsonElement element) - { - Optional timeGrain = default; - Optional retention = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeGrain")) - { - timeGrain = property.Value.GetString(); - continue; - } - if (property.NameEquals("retention")) - { - retention = property.Value.GetString(); - continue; - } - } - return new ResourceMetricAvailability(timeGrain.Value, retention.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.cs index caacb7de50e3..6a258b8f67f0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricAvailability.cs @@ -1,32 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Metrics availability and retention. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metrics availability and retention. + /// public partial class ResourceMetricAvailability { - /// Initializes a new instance of ResourceMetricAvailability. - internal ResourceMetricAvailability() + /// + /// Initializes a new instance of the ResourceMetricAvailability class. + /// + public ResourceMetricAvailability() { + CustomInit(); } - /// Initializes a new instance of ResourceMetricAvailability. - /// Time grain . - /// Retention period for the current time grain. - internal ResourceMetricAvailability(string timeGrain, string retention) + /// + /// Initializes a new instance of the ResourceMetricAvailability class. + /// + /// Time grain . + /// Retention period for the current time + /// grain. + public ResourceMetricAvailability(string timeGrain = default(string), string retention = default(string)) { TimeGrain = timeGrain; Retention = retention; + CustomInit(); } - /// Time grain . - public string TimeGrain { get; } - /// Retention period for the current time grain. - public string Retention { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets time grain . + /// + [JsonProperty(PropertyName = "timeGrain")] + public string TimeGrain { get; private set; } + + /// + /// Gets retention period for the current time grain. + /// + [JsonProperty(PropertyName = "retention")] + public string Retention { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.Serialization.cs deleted file mode 100644 index 9f7df2fcba04..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.Serialization.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ResourceMetricDefinition : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ResourceMetricDefinition DeserializeResourceMetricDefinition(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional unit = default; - Optional primaryAggregationType = default; - Optional> metricAvailabilities = default; - Optional resourceUri = default; - Optional> properties = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("unit")) - { - unit = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("primaryAggregationType")) - { - primaryAggregationType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("metricAvailabilities")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ResourceMetricAvailability.DeserializeResourceMetricAvailability(item)); - } - metricAvailabilities = array; - continue; - } - if (property0.NameEquals("resourceUri")) - { - resourceUri = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("properties")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetString()); - } - properties = dictionary; - continue; - } - } - continue; - } - } - return new ResourceMetricDefinition(id.Value, name.Value, kind.Value, type.Value, unit.Value, primaryAggregationType.Value, Optional.ToList(metricAvailabilities), resourceUri.Value, Optional.ToDictionary(properties)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.cs index 620f7a30dd23..022529f87010 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinition.cs @@ -1,53 +1,97 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Metadata for the metrics. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Metadata for the metrics. + /// + [Rest.Serialization.JsonTransformation] public partial class ResourceMetricDefinition : ProxyOnlyResource { - /// Initializes a new instance of ResourceMetricDefinition. + /// + /// Initializes a new instance of the ResourceMetricDefinition class. + /// public ResourceMetricDefinition() { - MetricAvailabilities = new ChangeTrackingList(); - Properties = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of ResourceMetricDefinition. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Unit of the metric. - /// Primary aggregation type. - /// List of time grains supported for the metric together with retention period. - /// Resource URI. - /// Resource metric definition properties. - internal ResourceMetricDefinition(string id, string name, string kind, string type, string unit, string primaryAggregationType, IReadOnlyList metricAvailabilities, string resourceUri, IReadOnlyDictionary properties) : base(id, name, kind, type) + /// + /// Initializes a new instance of the ResourceMetricDefinition class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Unit of the metric. + /// Primary aggregation + /// type. + /// List of time grains supported + /// for the metric together with retention period. + /// Resource URI. + /// Resource metric definition + /// properties. + public ResourceMetricDefinition(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string unit = default(string), string primaryAggregationType = default(string), IList metricAvailabilities = default(IList), string resourceUri = default(string), IDictionary properties = default(IDictionary)) + : base(id, name, kind, type) { Unit = unit; PrimaryAggregationType = primaryAggregationType; MetricAvailabilities = metricAvailabilities; ResourceUri = resourceUri; Properties = properties; + CustomInit(); } - /// Unit of the metric. - public string Unit { get; } - /// Primary aggregation type. - public string PrimaryAggregationType { get; } - /// List of time grains supported for the metric together with retention period. - public IReadOnlyList MetricAvailabilities { get; } - /// Resource URI. - public string ResourceUri { get; } - /// Resource metric definition properties. - public IReadOnlyDictionary Properties { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets unit of the metric. + /// + [JsonProperty(PropertyName = "properties.unit")] + public string Unit { get; private set; } + + /// + /// Gets primary aggregation type. + /// + [JsonProperty(PropertyName = "properties.primaryAggregationType")] + public string PrimaryAggregationType { get; private set; } + + /// + /// Gets list of time grains supported for the metric together with + /// retention period. + /// + [JsonProperty(PropertyName = "properties.metricAvailabilities")] + public IList MetricAvailabilities { get; private set; } + + /// + /// Gets resource URI. + /// + [JsonProperty(PropertyName = "properties.resourceUri")] + public string ResourceUri { get; private set; } + + /// + /// Gets resource metric definition properties. + /// + [JsonProperty(PropertyName = "properties.properties")] + public IDictionary Properties { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.Serialization.cs deleted file mode 100644 index bac1a00b74bb..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class ResourceMetricDefinitionCollection - { - internal static ResourceMetricDefinitionCollection DeserializeResourceMetricDefinitionCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ResourceMetricDefinition.DeserializeResourceMetricDefinition(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ResourceMetricDefinitionCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.cs deleted file mode 100644 index 6b8400c0fb76..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceMetricDefinitionCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of metric definitions. - internal partial class ResourceMetricDefinitionCollection - { - /// Initializes a new instance of ResourceMetricDefinitionCollection. - /// Collection of resources. - /// is null. - internal ResourceMetricDefinitionCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of ResourceMetricDefinitionCollection. - /// Collection of resources. - /// Link to next page of resources. - internal ResourceMetricDefinitionCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.Serialization.cs deleted file mode 100644 index 797a39c765f4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ResourceNameAvailability - { - internal static ResourceNameAvailability DeserializeResourceNameAvailability(JsonElement element) - { - Optional nameAvailable = default; - Optional reason = default; - Optional message = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("nameAvailable")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - nameAvailable = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("reason")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - reason = new InAvailabilityReasonType(property.Value.GetString()); - continue; - } - if (property.NameEquals("message")) - { - message = property.Value.GetString(); - continue; - } - } - return new ResourceNameAvailability(Optional.ToNullable(nameAvailable), Optional.ToNullable(reason), message.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.cs index 48c0037cf8ce..c199116b2ea1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailability.cs @@ -1,36 +1,89 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Information regarding availability of a resource name. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Information regarding availability of a resource name. + /// public partial class ResourceNameAvailability { - /// Initializes a new instance of ResourceNameAvailability. - internal ResourceNameAvailability() + /// + /// Initializes a new instance of the ResourceNameAvailability class. + /// + public ResourceNameAvailability() { + CustomInit(); } - /// Initializes a new instance of ResourceNameAvailability. - /// <code>true</code> indicates name is valid and available. <code>false</code> indicates the name is invalid, unavailable, or both. - /// <code>Invalid</code> indicates the name provided does not match Azure App Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and is therefore unavailable. - /// If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. - internal ResourceNameAvailability(bool? nameAvailable, InAvailabilityReasonType? reason, string message) + /// + /// Initializes a new instance of the ResourceNameAvailability class. + /// + /// <code>true</code> indicates + /// name is valid and available. <code>false</code> + /// indicates the name is invalid, unavailable, or both. + /// <code>Invalid</code> indicates the + /// name provided does not match Azure App Service naming requirements. + /// <code>AlreadyExists</code> indicates that the name is + /// already in use and is therefore unavailable. Possible values + /// include: 'Invalid', 'AlreadyExists' + /// If reason == invalid, provide the user with + /// the reason why the given name is invalid, and provide the resource + /// naming requirements so that the user can select a valid name. If + /// reason == AlreadyExists, explain that resource name is already in + /// use, and direct them to select a different name. + public ResourceNameAvailability(bool? nameAvailable = default(bool?), string reason = default(string), string message = default(string)) { NameAvailable = nameAvailable; Reason = reason; Message = message; + CustomInit(); } - /// <code>true</code> indicates name is valid and available. <code>false</code> indicates the name is invalid, unavailable, or both. - public bool? NameAvailable { get; } - /// <code>Invalid</code> indicates the name provided does not match Azure App Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and is therefore unavailable. - public InAvailabilityReasonType? Reason { get; } - /// If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. - public string Message { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; + /// indicates name is valid and available. + /// &lt;code&gt;false&lt;/code&gt; indicates the name + /// is invalid, unavailable, or both. + /// + [JsonProperty(PropertyName = "nameAvailable")] + public bool? NameAvailable { get; set; } + + /// + /// Gets or sets &lt;code&gt;Invalid&lt;/code&gt; + /// indicates the name provided does not match Azure App Service naming + /// requirements. + /// &lt;code&gt;AlreadyExists&lt;/code&gt; indicates + /// that the name is already in use and is therefore unavailable. + /// Possible values include: 'Invalid', 'AlreadyExists' + /// + [JsonProperty(PropertyName = "reason")] + public string Reason { get; set; } + + /// + /// Gets or sets if reason == invalid, provide the user with the reason + /// why the given name is invalid, and provide the resource naming + /// requirements so that the user can select a valid name. If reason == + /// AlreadyExists, explain that resource name is already in use, and + /// direct them to select a different name. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.Serialization.cs deleted file mode 100644 index 27577830594d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class ResourceNameAvailabilityRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - writer.WritePropertyName("type"); - writer.WriteStringValue(Type.ToString()); - if (Optional.IsDefined(IsFqdn)) - { - writer.WritePropertyName("isFqdn"); - writer.WriteBooleanValue(IsFqdn.Value); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.cs index 69bff60c9006..7269a0be5826 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceNameAvailabilityRequest.cs @@ -1,37 +1,95 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Resource name availability request content. - internal partial class ResourceNameAvailabilityRequest + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Resource name availability request content. + /// + public partial class ResourceNameAvailabilityRequest { - /// Initializes a new instance of ResourceNameAvailabilityRequest. - /// Resource name to verify. - /// Resource type used for verification. - /// is null. - public ResourceNameAvailabilityRequest(string name, CheckNameResourceTypes type) + /// + /// Initializes a new instance of the ResourceNameAvailabilityRequest + /// class. + /// + public ResourceNameAvailabilityRequest() { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } + CustomInit(); + } + /// + /// Initializes a new instance of the ResourceNameAvailabilityRequest + /// class. + /// + /// Resource name to verify. + /// Resource type used for verification. Possible + /// values include: 'Site', 'Slot', 'HostingEnvironment', + /// 'PublishingUser', 'Microsoft.Web/sites', + /// 'Microsoft.Web/sites/slots', 'Microsoft.Web/hostingEnvironments', + /// 'Microsoft.Web/publishingUsers' + /// Is fully qualified domain name. + public ResourceNameAvailabilityRequest(string name, string type, bool? isFqdn = default(bool?)) + { Name = name; Type = type; + IsFqdn = isFqdn; + CustomInit(); } - /// Resource name to verify. - public string Name { get; } - /// Resource type used for verification. - public CheckNameResourceTypes Type { get; } - /// Is fully qualified domain name. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource name to verify. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets resource type used for verification. Possible values + /// include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', + /// 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', + /// 'Microsoft.Web/hostingEnvironments', + /// 'Microsoft.Web/publishingUsers' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets is fully qualified domain name. + /// + [JsonProperty(PropertyName = "isFqdn")] public bool? IsFqdn { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceScopeType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceScopeType.cs index c4f1f52c8a63..42cd0d7da6b8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceScopeType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResourceScopeType.cs @@ -1,54 +1,23 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. - public readonly partial struct ResourceScopeType : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public ResourceScopeType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string ServerFarmValue = "ServerFarm"; - private const string SubscriptionValue = "Subscription"; - private const string WebSiteValue = "WebSite"; - - /// ServerFarm. - public static ResourceScopeType ServerFarm { get; } = new ResourceScopeType(ServerFarmValue); - /// Subscription. - public static ResourceScopeType Subscription { get; } = new ResourceScopeType(SubscriptionValue); - /// WebSite. - public static ResourceScopeType WebSite { get; } = new ResourceScopeType(WebSiteValue); - /// Determines if two values are the same. - public static bool operator ==(ResourceScopeType left, ResourceScopeType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ResourceScopeType left, ResourceScopeType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ResourceScopeType(string value) => new ResourceScopeType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ResourceScopeType other && Equals(other); - /// - public bool Equals(ResourceScopeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for ResourceScopeType. + /// + public static class ResourceScopeType + { + public const string ServerFarm = "ServerFarm"; + public const string Subscription = "Subscription"; + public const string WebSite = "WebSite"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.Serialization.cs deleted file mode 100644 index e9927973cba2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ResponseMessageEnvelopeRemotePrivateEndpointConnection - { - internal static ResponseMessageEnvelopeRemotePrivateEndpointConnection DeserializeResponseMessageEnvelopeRemotePrivateEndpointConnection(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional type = default; - Optional location = default; - Optional> tags = default; - Optional plan = default; - Optional properties = default; - Optional sku = default; - Optional status = default; - Optional error = default; - Optional identity = default; - Optional> zones = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("plan")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - plan = ArmPlan.DeserializeArmPlan(property.Value); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - properties = RemotePrivateEndpointConnection.DeserializeRemotePrivateEndpointConnection(property.Value); - continue; - } - if (property.NameEquals("sku")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - sku = SkuDescription.DeserializeSkuDescription(property.Value); - continue; - } - if (property.NameEquals("status")) - { - status = property.Value.GetString(); - continue; - } - if (property.NameEquals("error")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - error = ErrorEntity.DeserializeErrorEntity(property.Value); - continue; - } - if (property.NameEquals("identity")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value); - continue; - } - if (property.NameEquals("zones")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - zones = array; - continue; - } - } - return new ResponseMessageEnvelopeRemotePrivateEndpointConnection(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), plan.Value, properties.Value, sku.Value, status.Value, error.Value, identity.Value, Optional.ToList(zones)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs deleted file mode 100644 index dbe1f859a9ae..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Message envelope that contains the common Azure resource manager properties and the resource provider specific content. - public partial class ResponseMessageEnvelopeRemotePrivateEndpointConnection - { - /// Initializes a new instance of ResponseMessageEnvelopeRemotePrivateEndpointConnection. - internal ResponseMessageEnvelopeRemotePrivateEndpointConnection() - { - Tags = new ChangeTrackingDictionary(); - Zones = new ChangeTrackingList(); - } - - /// Initializes a new instance of ResponseMessageEnvelopeRemotePrivateEndpointConnection. - /// - /// Resource Id. Typically ID is populated only for responses to GET requests. Caller is responsible for passing in this - /// value for GET requests only. - /// For example: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupId}/providers/Microsoft.Web/sites/{sitename}. - /// - /// Name of resource. - /// Type of resource e.g "Microsoft.Web/sites". - /// Geographical region resource belongs to e.g. SouthCentralUS, SouthEastAsia. - /// Tags associated with resource. - /// Azure resource manager plan. - /// Resource specific properties. - /// SKU description of the resource. - /// Azure-AsyncOperation Status info. - /// Azure-AsyncOperation Error info. - /// MSI resource. - /// Logical Availability Zones the service is hosted in. - internal ResponseMessageEnvelopeRemotePrivateEndpointConnection(string id, string name, string type, string location, IReadOnlyDictionary tags, ArmPlan plan, RemotePrivateEndpointConnection properties, SkuDescription sku, string status, ErrorEntity error, ManagedServiceIdentity identity, IReadOnlyList zones) - { - Id = id; - Name = name; - Type = type; - Location = location; - Tags = tags; - Plan = plan; - Properties = properties; - Sku = sku; - Status = status; - Error = error; - Identity = identity; - Zones = zones; - } - - /// - /// Resource Id. Typically ID is populated only for responses to GET requests. Caller is responsible for passing in this - /// value for GET requests only. - /// For example: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupId}/providers/Microsoft.Web/sites/{sitename}. - /// - public string Id { get; } - /// Name of resource. - public string Name { get; } - /// Type of resource e.g "Microsoft.Web/sites". - public string Type { get; } - /// Geographical region resource belongs to e.g. SouthCentralUS, SouthEastAsia. - public string Location { get; } - /// Tags associated with resource. - public IReadOnlyDictionary Tags { get; } - /// Azure resource manager plan. - public ArmPlan Plan { get; } - /// Resource specific properties. - public RemotePrivateEndpointConnection Properties { get; } - /// SKU description of the resource. - public SkuDescription Sku { get; } - /// Azure-AsyncOperation Status info. - public string Status { get; } - /// Azure-AsyncOperation Error info. - public ErrorEntity Error { get; } - /// MSI resource. - public ManagedServiceIdentity Identity { get; } - /// Logical Availability Zones the service is hosted in. - public IReadOnlyList Zones { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.Serialization.cs deleted file mode 100644 index 138b66937622..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ResponseMetaData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(DataSource)) - { - writer.WritePropertyName("dataSource"); - writer.WriteObjectValue(DataSource); - } - writer.WriteEndObject(); - } - - internal static ResponseMetaData DeserializeResponseMetaData(JsonElement element) - { - Optional dataSource = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("dataSource")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - dataSource = DataSource.DeserializeDataSource(property.Value); - continue; - } - } - return new ResponseMetaData(dataSource.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.cs index d96155414591..e8846b26ab8c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMetaData.cs @@ -1,28 +1,48 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The ResponseMetaData. + using Newtonsoft.Json; + using System.Linq; + public partial class ResponseMetaData { - /// Initializes a new instance of ResponseMetaData. + /// + /// Initializes a new instance of the ResponseMetaData class. + /// public ResponseMetaData() { + CustomInit(); } - /// Initializes a new instance of ResponseMetaData. - /// Source of the Data. - internal ResponseMetaData(DataSource dataSource) + /// + /// Initializes a new instance of the ResponseMetaData class. + /// + /// Source of the Data + public ResponseMetaData(DataSource dataSource = default(DataSource)) { DataSource = dataSource; + CustomInit(); } - /// Source of the Data. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets source of the Data + /// + [JsonProperty(PropertyName = "dataSource")] public DataSource DataSource { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.Serialization.cs deleted file mode 100644 index 86f1a72955fd..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.Serialization.cs +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class RestoreRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(StorageAccountUrl)) - { - writer.WritePropertyName("storageAccountUrl"); - writer.WriteStringValue(StorageAccountUrl); - } - if (Optional.IsDefined(BlobName)) - { - writer.WritePropertyName("blobName"); - writer.WriteStringValue(BlobName); - } - if (Optional.IsDefined(Overwrite)) - { - writer.WritePropertyName("overwrite"); - writer.WriteBooleanValue(Overwrite.Value); - } - if (Optional.IsDefined(SiteName)) - { - writer.WritePropertyName("siteName"); - writer.WriteStringValue(SiteName); - } - if (Optional.IsCollectionDefined(Databases)) - { - writer.WritePropertyName("databases"); - writer.WriteStartArray(); - foreach (var item in Databases) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(IgnoreConflictingHostNames)) - { - writer.WritePropertyName("ignoreConflictingHostNames"); - writer.WriteBooleanValue(IgnoreConflictingHostNames.Value); - } - if (Optional.IsDefined(IgnoreDatabases)) - { - writer.WritePropertyName("ignoreDatabases"); - writer.WriteBooleanValue(IgnoreDatabases.Value); - } - if (Optional.IsDefined(AppServicePlan)) - { - writer.WritePropertyName("appServicePlan"); - writer.WriteStringValue(AppServicePlan); - } - if (Optional.IsDefined(OperationType)) - { - writer.WritePropertyName("operationType"); - writer.WriteStringValue(OperationType.Value.ToSerialString()); - } - if (Optional.IsDefined(AdjustConnectionStrings)) - { - writer.WritePropertyName("adjustConnectionStrings"); - writer.WriteBooleanValue(AdjustConnectionStrings.Value); - } - if (Optional.IsDefined(HostingEnvironment)) - { - writer.WritePropertyName("hostingEnvironment"); - writer.WriteStringValue(HostingEnvironment); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static RestoreRequest DeserializeRestoreRequest(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional storageAccountUrl = default; - Optional blobName = default; - Optional overwrite = default; - Optional siteName = default; - Optional> databases = default; - Optional ignoreConflictingHostNames = default; - Optional ignoreDatabases = default; - Optional appServicePlan = default; - Optional operationType = default; - Optional adjustConnectionStrings = default; - Optional hostingEnvironment = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("storageAccountUrl")) - { - storageAccountUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("blobName")) - { - blobName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("overwrite")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - overwrite = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("siteName")) - { - siteName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("databases")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(DatabaseBackupSetting.DeserializeDatabaseBackupSetting(item)); - } - databases = array; - continue; - } - if (property0.NameEquals("ignoreConflictingHostNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - ignoreConflictingHostNames = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("ignoreDatabases")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - ignoreDatabases = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("appServicePlan")) - { - appServicePlan = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("operationType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - operationType = property0.Value.GetString().ToBackupRestoreOperationType(); - continue; - } - if (property0.NameEquals("adjustConnectionStrings")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - adjustConnectionStrings = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("hostingEnvironment")) - { - hostingEnvironment = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new RestoreRequest(id.Value, name.Value, kind.Value, type.Value, storageAccountUrl.Value, blobName.Value, Optional.ToNullable(overwrite), siteName.Value, Optional.ToList(databases), Optional.ToNullable(ignoreConflictingHostNames), Optional.ToNullable(ignoreDatabases), appServicePlan.Value, Optional.ToNullable(operationType), Optional.ToNullable(adjustConnectionStrings), hostingEnvironment.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.cs index 52f9f09516d1..7f9f46f4791e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RestoreRequest.cs @@ -1,44 +1,75 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Description of a restore request. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Description of a restore request. + /// + [Rest.Serialization.JsonTransformation] public partial class RestoreRequest : ProxyOnlyResource { - /// Initializes a new instance of RestoreRequest. + /// + /// Initializes a new instance of the RestoreRequest class. + /// public RestoreRequest() { - Databases = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of RestoreRequest. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// SAS URL to the container. - /// Name of a blob which contains the backup. - /// <code>true</code> if the restore operation can overwrite target app; otherwise, <code>false</code>. <code>true</code> is needed if trying to restore over an existing app. - /// Name of an app. - /// Collection of databases which should be restored. This list has to match the list of databases included in the backup. - /// - /// Changes a logic when restoring an app with custom domains. <code>true</code> to remove custom domains automatically. If <code>false</code>, custom domains are added to - /// the app's object when it is being restored, but that might fail due to conflicts during the operation. - /// - /// Ignore the databases and only restore the site content. - /// Specify app service plan that will own restored site. - /// Operation type. - /// <code>true</code> if SiteConfig.ConnectionStrings should be set in new app; otherwise, <code>false</code>. - /// App Service Environment name, if needed (only when restoring an app to an App Service Environment). - internal RestoreRequest(string id, string name, string kind, string type, string storageAccountUrl, string blobName, bool? overwrite, string siteName, IList databases, bool? ignoreConflictingHostNames, bool? ignoreDatabases, string appServicePlan, BackupRestoreOperationType? operationType, bool? adjustConnectionStrings, string hostingEnvironment) : base(id, name, kind, type) + /// + /// Initializes a new instance of the RestoreRequest class. + /// + /// SAS URL to the container. + /// <code>true</code> if the + /// restore operation can overwrite target app; otherwise, + /// <code>false</code>. <code>true</code> is + /// needed if trying to restore over an existing app. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Name of a blob which contains the + /// backup. + /// Name of an app. + /// Collection of databases which should be + /// restored. This list has to match the list of databases included in + /// the backup. + /// Changes a logic when + /// restoring an app with custom domains. <code>true</code> + /// to remove custom domains automatically. If + /// <code>false</code>, custom domains are added to + /// the app's object when it is being restored, but that might fail due + /// to conflicts during the operation. + /// Ignore the databases and only restore + /// the site content + /// Specify app service plan that will own + /// restored site. + /// Operation type. Possible values + /// include: 'Default', 'Clone', 'Relocation', 'Snapshot', + /// 'CloudFS' + /// <code>true</code> + /// if SiteConfig.ConnectionStrings should be set in new app; + /// otherwise, <code>false</code>. + /// App Service Environment name, if + /// needed (only when restoring an app to an App Service + /// Environment). + public RestoreRequest(string storageAccountUrl, bool overwrite, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string blobName = default(string), string siteName = default(string), IList databases = default(IList), bool? ignoreConflictingHostNames = default(bool?), bool? ignoreDatabases = default(bool?), string appServicePlan = default(string), BackupRestoreOperationType? operationType = default(BackupRestoreOperationType?), bool? adjustConnectionStrings = default(bool?), string hostingEnvironment = default(string)) + : base(id, name, kind, type) { StorageAccountUrl = storageAccountUrl; BlobName = blobName; @@ -51,32 +82,117 @@ internal RestoreRequest(string id, string name, string kind, string type, string OperationType = operationType; AdjustConnectionStrings = adjustConnectionStrings; HostingEnvironment = hostingEnvironment; + CustomInit(); } - /// SAS URL to the container. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets SAS URL to the container. + /// + [JsonProperty(PropertyName = "properties.storageAccountUrl")] public string StorageAccountUrl { get; set; } - /// Name of a blob which contains the backup. + + /// + /// Gets or sets name of a blob which contains the backup. + /// + [JsonProperty(PropertyName = "properties.blobName")] public string BlobName { get; set; } - /// <code>true</code> if the restore operation can overwrite target app; otherwise, <code>false</code>. <code>true</code> is needed if trying to restore over an existing app. - public bool? Overwrite { get; set; } - /// Name of an app. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// restore operation can overwrite target app; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// &lt;code&gt;true&lt;/code&gt; is needed if trying + /// to restore over an existing app. + /// + [JsonProperty(PropertyName = "properties.overwrite")] + public bool Overwrite { get; set; } + + /// + /// Gets or sets name of an app. + /// + [JsonProperty(PropertyName = "properties.siteName")] public string SiteName { get; set; } - /// Collection of databases which should be restored. This list has to match the list of databases included in the backup. - public IList Databases { get; } + /// - /// Changes a logic when restoring an app with custom domains. <code>true</code> to remove custom domains automatically. If <code>false</code>, custom domains are added to - /// the app's object when it is being restored, but that might fail due to conflicts during the operation. + /// Gets or sets collection of databases which should be restored. This + /// list has to match the list of databases included in the backup. /// + [JsonProperty(PropertyName = "properties.databases")] + public IList Databases { get; set; } + + /// + /// Gets or sets changes a logic when restoring an app with custom + /// domains. &lt;code&gt;true&lt;/code&gt; to remove + /// custom domains automatically. If + /// &lt;code&gt;false&lt;/code&gt;, custom domains are + /// added to + /// the app's object when it is being restored, but that might fail due + /// to conflicts during the operation. + /// + [JsonProperty(PropertyName = "properties.ignoreConflictingHostNames")] public bool? IgnoreConflictingHostNames { get; set; } - /// Ignore the databases and only restore the site content. + + /// + /// Gets or sets ignore the databases and only restore the site content + /// + [JsonProperty(PropertyName = "properties.ignoreDatabases")] public bool? IgnoreDatabases { get; set; } - /// Specify app service plan that will own restored site. + + /// + /// Gets or sets specify app service plan that will own restored site. + /// + [JsonProperty(PropertyName = "properties.appServicePlan")] public string AppServicePlan { get; set; } - /// Operation type. + + /// + /// Gets or sets operation type. Possible values include: 'Default', + /// 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + /// + [JsonProperty(PropertyName = "properties.operationType")] public BackupRestoreOperationType? OperationType { get; set; } - /// <code>true</code> if SiteConfig.ConnectionStrings should be set in new app; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// SiteConfig.ConnectionStrings should be set in new app; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.adjustConnectionStrings")] public bool? AdjustConnectionStrings { get; set; } - /// App Service Environment name, if needed (only when restoring an app to an App Service Environment). + + /// + /// Gets or sets app Service Environment name, if needed (only when + /// restoring an app to an App Service Environment). + /// + [JsonProperty(PropertyName = "properties.hostingEnvironment")] public string HostingEnvironment { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StorageAccountUrl == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccountUrl"); + } + if (Databases != null) + { + foreach (var element in Databases) + { + if (element != null) + { + element.Validate(); + } + } + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RouteType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RouteType.cs index 2fd2a4b912b4..45453b399b4e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RouteType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RouteType.cs @@ -1,61 +1,23 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { + /// - /// The type of route this is: - /// DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 - /// INHERITED - Routes inherited from the real Virtual Network routes - /// STATIC - Static route set on the app only - /// - /// These values will be used for syncing an app's routes with those from a Virtual Network. + /// Defines values for RouteType. /// - public readonly partial struct RouteType : IEquatable + public static class RouteType { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public RouteType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DefaultValue = "DEFAULT"; - private const string InheritedValue = "INHERITED"; - private const string StaticValue = "STATIC"; - - /// DEFAULT. - public static RouteType Default { get; } = new RouteType(DefaultValue); - /// INHERITED. - public static RouteType Inherited { get; } = new RouteType(InheritedValue); - /// STATIC. - public static RouteType Static { get; } = new RouteType(StaticValue); - /// Determines if two values are the same. - public static bool operator ==(RouteType left, RouteType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RouteType left, RouteType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator RouteType(string value) => new RouteType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RouteType other && Equals(other); - /// - public bool Equals(RouteType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + public const string DEFAULT = "DEFAULT"; + public const string INHERITED = "INHERITED"; + public const string STATIC = "STATIC"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.Serialization.cs deleted file mode 100644 index 26a9cd059abd..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.Serialization.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SampleUtterance : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Text)) - { - writer.WritePropertyName("text"); - writer.WriteStringValue(Text); - } - if (Optional.IsCollectionDefined(Links)) - { - writer.WritePropertyName("links"); - writer.WriteStartArray(); - foreach (var item in Links) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(Qid)) - { - writer.WritePropertyName("qid"); - writer.WriteStringValue(Qid); - } - writer.WriteEndObject(); - } - - internal static SampleUtterance DeserializeSampleUtterance(JsonElement element) - { - Optional text = default; - Optional> links = default; - Optional qid = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("text")) - { - text = property.Value.GetString(); - continue; - } - if (property.NameEquals("links")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - links = array; - continue; - } - if (property.NameEquals("qid")) - { - qid = property.Value.GetString(); - continue; - } - } - return new SampleUtterance(text.Value, Optional.ToList(links), qid.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs deleted file mode 100644 index 40dcdb9e9359..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Sample utterance. - public partial class SampleUtterance - { - /// Initializes a new instance of SampleUtterance. - public SampleUtterance() - { - Links = new ChangeTrackingList(); - } - - /// Initializes a new instance of SampleUtterance. - /// Text attribute of sample utterance. - /// Links attribute of sample utterance. - /// Question id of sample utterance (for stackoverflow questions titles). - internal SampleUtterance(string text, IList links, string qid) - { - Text = text; - Links = links; - Qid = qid; - } - - /// Text attribute of sample utterance. - public string Text { get; set; } - /// Links attribute of sample utterance. - public IList Links { get; } - /// Question id of sample utterance (for stackoverflow questions titles). - public string Qid { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ScmType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ScmType.cs index 730117af6b46..20a633dd2b81 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ScmType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ScmType.cs @@ -1,87 +1,34 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// SCM type. - public readonly partial struct ScmType : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public ScmType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string NoneValue = "None"; - private const string DropboxValue = "Dropbox"; - private const string TfsValue = "Tfs"; - private const string LocalGitValue = "LocalGit"; - private const string GitHubValue = "GitHub"; - private const string CodePlexGitValue = "CodePlexGit"; - private const string CodePlexHgValue = "CodePlexHg"; - private const string BitbucketGitValue = "BitbucketGit"; - private const string BitbucketHgValue = "BitbucketHg"; - private const string ExternalGitValue = "ExternalGit"; - private const string ExternalHgValue = "ExternalHg"; - private const string OneDriveValue = "OneDrive"; - private const string VSOValue = "VSO"; - private const string VstsrmValue = "VSTSRM"; - - /// None. - public static ScmType None { get; } = new ScmType(NoneValue); - /// Dropbox. - public static ScmType Dropbox { get; } = new ScmType(DropboxValue); - /// Tfs. - public static ScmType Tfs { get; } = new ScmType(TfsValue); - /// LocalGit. - public static ScmType LocalGit { get; } = new ScmType(LocalGitValue); - /// GitHub. - public static ScmType GitHub { get; } = new ScmType(GitHubValue); - /// CodePlexGit. - public static ScmType CodePlexGit { get; } = new ScmType(CodePlexGitValue); - /// CodePlexHg. - public static ScmType CodePlexHg { get; } = new ScmType(CodePlexHgValue); - /// BitbucketGit. - public static ScmType BitbucketGit { get; } = new ScmType(BitbucketGitValue); - /// BitbucketHg. - public static ScmType BitbucketHg { get; } = new ScmType(BitbucketHgValue); - /// ExternalGit. - public static ScmType ExternalGit { get; } = new ScmType(ExternalGitValue); - /// ExternalHg. - public static ScmType ExternalHg { get; } = new ScmType(ExternalHgValue); - /// OneDrive. - public static ScmType OneDrive { get; } = new ScmType(OneDriveValue); - /// VSO. - public static ScmType VSO { get; } = new ScmType(VSOValue); - /// VSTSRM. - public static ScmType Vstsrm { get; } = new ScmType(VstsrmValue); - /// Determines if two values are the same. - public static bool operator ==(ScmType left, ScmType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ScmType left, ScmType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ScmType(string value) => new ScmType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ScmType other && Equals(other); - /// - public bool Equals(ScmType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for ScmType. + /// + public static class ScmType + { + public const string None = "None"; + public const string Dropbox = "Dropbox"; + public const string Tfs = "Tfs"; + public const string LocalGit = "LocalGit"; + public const string GitHub = "GitHub"; + public const string CodePlexGit = "CodePlexGit"; + public const string CodePlexHg = "CodePlexHg"; + public const string BitbucketGit = "BitbucketGit"; + public const string BitbucketHg = "BitbucketHg"; + public const string ExternalGit = "ExternalGit"; + public const string ExternalHg = "ExternalHg"; + public const string OneDrive = "OneDrive"; + public const string VSO = "VSO"; + public const string VSTSRM = "VSTSRM"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.Serialization.cs deleted file mode 100644 index 201d34a1d527..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.Serialization.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ServiceSpecification - { - internal static ServiceSpecification DeserializeServiceSpecification(JsonElement element) - { - Optional> metricSpecifications = default; - Optional> logSpecifications = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("metricSpecifications")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MetricSpecification.DeserializeMetricSpecification(item)); - } - metricSpecifications = array; - continue; - } - if (property.NameEquals("logSpecifications")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(LogSpecification.DeserializeLogSpecification(item)); - } - logSpecifications = array; - continue; - } - } - return new ServiceSpecification(Optional.ToList(metricSpecifications), Optional.ToList(logSpecifications)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.cs index 5a9ff4d0457d..5fa815145211 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ServiceSpecification.cs @@ -1,35 +1,58 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Resource metrics service provided by Microsoft.Insights resource provider. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Resource metrics service provided by Microsoft.Insights resource + /// provider. + /// public partial class ServiceSpecification { - /// Initializes a new instance of ServiceSpecification. - internal ServiceSpecification() + /// + /// Initializes a new instance of the ServiceSpecification class. + /// + public ServiceSpecification() { - MetricSpecifications = new ChangeTrackingList(); - LogSpecifications = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of ServiceSpecification. - /// . - /// . - internal ServiceSpecification(IReadOnlyList metricSpecifications, IReadOnlyList logSpecifications) + /// + /// Initializes a new instance of the ServiceSpecification class. + /// + public ServiceSpecification(IList metricSpecifications = default(IList), IList logSpecifications = default(IList)) { MetricSpecifications = metricSpecifications; LogSpecifications = logSpecifications; + CustomInit(); } - public IReadOnlyList MetricSpecifications { get; } - public IReadOnlyList LogSpecifications { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "metricSpecifications")] + public IList MetricSpecifications { get; set; } + + /// + /// + [JsonProperty(PropertyName = "logSpecifications")] + public IList LogSpecifications { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.Serialization.cs deleted file mode 100644 index 7fd2d393e144..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.Serialization.cs +++ /dev/null @@ -1,657 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Site : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"); - writer.WriteObjectValue(Identity); - } - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsCollectionDefined(HostNameSslStates)) - { - writer.WritePropertyName("hostNameSslStates"); - writer.WriteStartArray(); - foreach (var item in HostNameSslStates) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ServerFarmId)) - { - writer.WritePropertyName("serverFarmId"); - writer.WriteStringValue(ServerFarmId); - } - if (Optional.IsDefined(Reserved)) - { - writer.WritePropertyName("reserved"); - writer.WriteBooleanValue(Reserved.Value); - } - if (Optional.IsDefined(IsXenon)) - { - writer.WritePropertyName("isXenon"); - writer.WriteBooleanValue(IsXenon.Value); - } - if (Optional.IsDefined(HyperV)) - { - writer.WritePropertyName("hyperV"); - writer.WriteBooleanValue(HyperV.Value); - } - if (Optional.IsDefined(SiteConfig)) - { - writer.WritePropertyName("siteConfig"); - writer.WriteObjectValue(SiteConfig); - } - if (Optional.IsDefined(ScmSiteAlsoStopped)) - { - writer.WritePropertyName("scmSiteAlsoStopped"); - writer.WriteBooleanValue(ScmSiteAlsoStopped.Value); - } - if (Optional.IsDefined(HostingEnvironmentProfile)) - { - writer.WritePropertyName("hostingEnvironmentProfile"); - writer.WriteObjectValue(HostingEnvironmentProfile); - } - if (Optional.IsDefined(ClientAffinityEnabled)) - { - writer.WritePropertyName("clientAffinityEnabled"); - writer.WriteBooleanValue(ClientAffinityEnabled.Value); - } - if (Optional.IsDefined(ClientCertEnabled)) - { - writer.WritePropertyName("clientCertEnabled"); - writer.WriteBooleanValue(ClientCertEnabled.Value); - } - if (Optional.IsDefined(ClientCertMode)) - { - writer.WritePropertyName("clientCertMode"); - writer.WriteStringValue(ClientCertMode.Value.ToSerialString()); - } - if (Optional.IsDefined(ClientCertExclusionPaths)) - { - writer.WritePropertyName("clientCertExclusionPaths"); - writer.WriteStringValue(ClientCertExclusionPaths); - } - if (Optional.IsDefined(HostNamesDisabled)) - { - writer.WritePropertyName("hostNamesDisabled"); - writer.WriteBooleanValue(HostNamesDisabled.Value); - } - if (Optional.IsDefined(CustomDomainVerificationId)) - { - writer.WritePropertyName("customDomainVerificationId"); - writer.WriteStringValue(CustomDomainVerificationId); - } - if (Optional.IsDefined(ContainerSize)) - { - writer.WritePropertyName("containerSize"); - writer.WriteNumberValue(ContainerSize.Value); - } - if (Optional.IsDefined(DailyMemoryTimeQuota)) - { - writer.WritePropertyName("dailyMemoryTimeQuota"); - writer.WriteNumberValue(DailyMemoryTimeQuota.Value); - } - if (Optional.IsDefined(CloningInfo)) - { - writer.WritePropertyName("cloningInfo"); - writer.WriteObjectValue(CloningInfo); - } - if (Optional.IsDefined(HttpsOnly)) - { - writer.WritePropertyName("httpsOnly"); - writer.WriteBooleanValue(HttpsOnly.Value); - } - if (Optional.IsDefined(RedundancyMode)) - { - writer.WritePropertyName("redundancyMode"); - writer.WriteStringValue(RedundancyMode.Value.ToSerialString()); - } - if (Optional.IsDefined(StorageAccountRequired)) - { - writer.WritePropertyName("storageAccountRequired"); - writer.WriteBooleanValue(StorageAccountRequired.Value); - } - if (Optional.IsDefined(KeyVaultReferenceIdentity)) - { - writer.WritePropertyName("keyVaultReferenceIdentity"); - writer.WriteStringValue(KeyVaultReferenceIdentity); - } - if (Optional.IsDefined(VirtualNetworkSubnetId)) - { - writer.WritePropertyName("virtualNetworkSubnetId"); - writer.WriteStringValue(VirtualNetworkSubnetId); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Site DeserializeSite(JsonElement element) - { - Optional identity = default; - Optional id = default; - Optional name = default; - Optional kind = default; - string location = default; - Optional type = default; - Optional> tags = default; - Optional state = default; - Optional> hostNames = default; - Optional repositorySiteName = default; - Optional usageState = default; - Optional enabled = default; - Optional> enabledHostNames = default; - Optional availabilityState = default; - Optional> hostNameSslStates = default; - Optional serverFarmId = default; - Optional reserved = default; - Optional isXenon = default; - Optional hyperV = default; - Optional lastModifiedTimeUtc = default; - Optional siteConfig = default; - Optional> trafficManagerHostNames = default; - Optional scmSiteAlsoStopped = default; - Optional targetSwapSlot = default; - Optional hostingEnvironmentProfile = default; - Optional clientAffinityEnabled = default; - Optional clientCertEnabled = default; - Optional clientCertMode = default; - Optional clientCertExclusionPaths = default; - Optional hostNamesDisabled = default; - Optional customDomainVerificationId = default; - Optional outboundIpAddresses = default; - Optional possibleOutboundIpAddresses = default; - Optional containerSize = default; - Optional dailyMemoryTimeQuota = default; - Optional suspendedTill = default; - Optional maxNumberOfWorkers = default; - Optional cloningInfo = default; - Optional resourceGroup = default; - Optional isDefaultContainer = default; - Optional defaultHostName = default; - Optional slotSwapStatus = default; - Optional httpsOnly = default; - Optional redundancyMode = default; - Optional inProgressOperationId = default; - Optional storageAccountRequired = default; - Optional keyVaultReferenceIdentity = default; - Optional virtualNetworkSubnetId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value); - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("state")) - { - state = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - hostNames = array; - continue; - } - if (property0.NameEquals("repositorySiteName")) - { - repositorySiteName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("usageState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - usageState = property0.Value.GetString().ToUsageState(); - continue; - } - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("enabledHostNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - enabledHostNames = array; - continue; - } - if (property0.NameEquals("availabilityState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - availabilityState = property0.Value.GetString().ToSiteAvailabilityState(); - continue; - } - if (property0.NameEquals("hostNameSslStates")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(HostNameSslState.DeserializeHostNameSslState(item)); - } - hostNameSslStates = array; - continue; - } - if (property0.NameEquals("serverFarmId")) - { - serverFarmId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("reserved")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - reserved = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("isXenon")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isXenon = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("hyperV")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hyperV = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("lastModifiedTimeUtc")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - lastModifiedTimeUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("siteConfig")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - siteConfig = SiteConfig.DeserializeSiteConfig(property0.Value); - continue; - } - if (property0.NameEquals("trafficManagerHostNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - trafficManagerHostNames = array; - continue; - } - if (property0.NameEquals("scmSiteAlsoStopped")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - scmSiteAlsoStopped = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("targetSwapSlot")) - { - targetSwapSlot = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostingEnvironmentProfile")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); - continue; - } - if (property0.NameEquals("clientAffinityEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - clientAffinityEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("clientCertEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - clientCertEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("clientCertMode")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - clientCertMode = property0.Value.GetString().ToClientCertMode(); - continue; - } - if (property0.NameEquals("clientCertExclusionPaths")) - { - clientCertExclusionPaths = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostNamesDisabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hostNamesDisabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("customDomainVerificationId")) - { - customDomainVerificationId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("outboundIpAddresses")) - { - outboundIpAddresses = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("possibleOutboundIpAddresses")) - { - possibleOutboundIpAddresses = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("containerSize")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - containerSize = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("dailyMemoryTimeQuota")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - dailyMemoryTimeQuota = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("suspendedTill")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - suspendedTill = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("maxNumberOfWorkers")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - maxNumberOfWorkers = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("cloningInfo")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - cloningInfo = CloningInfo.DeserializeCloningInfo(property0.Value); - continue; - } - if (property0.NameEquals("resourceGroup")) - { - resourceGroup = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("isDefaultContainer")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isDefaultContainer = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("defaultHostName")) - { - defaultHostName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("slotSwapStatus")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - slotSwapStatus = SlotSwapStatus.DeserializeSlotSwapStatus(property0.Value); - continue; - } - if (property0.NameEquals("httpsOnly")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - httpsOnly = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("redundancyMode")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - redundancyMode = property0.Value.GetString().ToRedundancyMode(); - continue; - } - if (property0.NameEquals("inProgressOperationId")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - inProgressOperationId = property0.Value.GetGuid(); - continue; - } - if (property0.NameEquals("storageAccountRequired")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - storageAccountRequired = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("keyVaultReferenceIdentity")) - { - keyVaultReferenceIdentity = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("virtualNetworkSubnetId")) - { - virtualNetworkSubnetId = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new Site(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), identity.Value, state.Value, Optional.ToList(hostNames), repositorySiteName.Value, Optional.ToNullable(usageState), Optional.ToNullable(enabled), Optional.ToList(enabledHostNames), Optional.ToNullable(availabilityState), Optional.ToList(hostNameSslStates), serverFarmId.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(lastModifiedTimeUtc), siteConfig.Value, Optional.ToList(trafficManagerHostNames), Optional.ToNullable(scmSiteAlsoStopped), targetSwapSlot.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(clientAffinityEnabled), Optional.ToNullable(clientCertEnabled), Optional.ToNullable(clientCertMode), clientCertExclusionPaths.Value, Optional.ToNullable(hostNamesDisabled), customDomainVerificationId.Value, outboundIpAddresses.Value, possibleOutboundIpAddresses.Value, Optional.ToNullable(containerSize), Optional.ToNullable(dailyMemoryTimeQuota), Optional.ToNullable(suspendedTill), Optional.ToNullable(maxNumberOfWorkers), cloningInfo.Value, resourceGroup.Value, Optional.ToNullable(isDefaultContainer), defaultHostName.Value, slotSwapStatus.Value, Optional.ToNullable(httpsOnly), Optional.ToNullable(redundancyMode), Optional.ToNullable(inProgressOperationId), Optional.ToNullable(storageAccountRequired), keyVaultReferenceIdentity.Value, virtualNetworkSubnetId.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs index 8b089f4af305..5a5d96d804c3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs @@ -1,107 +1,148 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// A web app, a mobile app backend, or an API app. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A web app, a mobile app backend, or an API app. + /// + [Rest.Serialization.JsonTransformation] public partial class Site : Resource { - /// Initializes a new instance of Site. - /// Resource Location. - /// is null. - public Site(string location) : base(location) + /// + /// Initializes a new instance of the Site class. + /// + public Site() { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - HostNames = new ChangeTrackingList(); - EnabledHostNames = new ChangeTrackingList(); - HostNameSslStates = new ChangeTrackingList(); - TrafficManagerHostNames = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of Site. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource Location. - /// Resource type. - /// Resource tags. - /// Managed service identity. - /// Current state of the app. - /// Hostnames associated with the app. - /// Name of the repository site. - /// State indicating whether the app has exceeded its quota usage. Read-only. - /// <code>true</code> if the app is enabled; otherwise, <code>false</code>. Setting this value to false disables the app (takes the app offline). - /// - /// Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, - /// the app is not served on those hostnames. - /// - /// Management information availability state for the app. - /// Hostname SSL states are used to manage the SSL bindings for app's hostnames. - /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - /// <code>true</code> if reserved; otherwise, <code>false</code>. - /// Obsolete: Hyper-V sandbox. - /// Hyper-V sandbox. - /// Last time the app was modified, in UTC. Read-only. - /// Configuration of the app. - /// Azure Traffic Manager hostnames associated with the app. Read-only. - /// <code>true</code> to stop SCM (KUDU) site when the app is stopped; otherwise, <code>false</code>. The default is <code>false</code>. - /// Specifies which deployment slot this app will swap into. Read-only. - /// App Service Environment to use for the app. - /// <code>true</code> to enable client affinity; <code>false</code> to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is <code>true</code>. - /// <code>true</code> to enable client certificate authentication (TLS mutual authentication); otherwise, <code>false</code>. Default is <code>false</code>. - /// - /// This composes with ClientCertEnabled setting. + /// + /// Initializes a new instance of the Site class. + /// + /// Resource Location. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Resource tags. + /// Current state of the app. + /// Hostnames associated with the app. + /// Name of the repository + /// site. + /// State indicating whether the app has + /// exceeded its quota usage. Read-only. Possible values include: + /// 'Normal', 'Exceeded' + /// <code>true</code> if the app is + /// enabled; otherwise, <code>false</code>. Setting this + /// value to false disables the app (takes the app offline). + /// Enabled hostnames for the + /// app.Hostnames need to be assigned (see HostNames) AND enabled. + /// Otherwise, + /// the app is not served on those hostnames. + /// Management information availability + /// state for the app. Possible values include: 'Normal', 'Limited', + /// 'DisasterRecoveryMode' + /// Hostname SSL states are used to + /// manage the SSL bindings for app's hostnames. + /// Resource ID of the associated App + /// Service plan, formatted as: + /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + /// <code>true</code> if reserved; + /// otherwise, <code>false</code>. + /// Obsolete: Hyper-V sandbox. + /// Hyper-V sandbox. + /// Last time the app was modified, + /// in UTC. Read-only. + /// Configuration of the app. + /// Azure Traffic Manager + /// hostnames associated with the app. Read-only. + /// <code>true</code> to + /// stop SCM (KUDU) site when the app is stopped; otherwise, + /// <code>false</code>. The default is + /// <code>false</code>. + /// Specifies which deployment slot this + /// app will swap into. Read-only. + /// App Service Environment to + /// use for the app. + /// <code>true</code> + /// to enable client affinity; <code>false</code> to stop + /// sending session affinity cookies, which route client requests in + /// the same session to the same instance. Default is + /// <code>true</code>. + /// <code>true</code> to + /// enable client certificate authentication (TLS mutual + /// authentication); otherwise, <code>false</code>. Default + /// is <code>false</code>. + /// This composes with ClientCertEnabled + /// setting. /// - ClientCertEnabled: false means ClientCert is ignored. - /// - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. - /// - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. - /// - /// client certificate authentication comma-separated exclusion paths. - /// - /// <code>true</code> to disable the public hostnames of the app; otherwise, <code>false</code>. - /// If <code>true</code>, the app is only accessible via API management process. - /// - /// Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. - /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. - /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. - /// Size of the function container. - /// Maximum allowed daily memory-time quota (applicable on dynamic apps only). - /// App suspended till in case memory-time quota is exceeded. - /// - /// Maximum number of workers. - /// This only applies to Functions container. - /// - /// If specified during app creation, the app is cloned from a source app. - /// Name of the resource group the app belongs to. Read-only. - /// <code>true</code> if the app is a default container; otherwise, <code>false</code>. - /// Default hostname of the app. Read-only. - /// Status of the last deployment slot swap operation. - /// - /// HttpsOnly: configures a web site to accept only https requests. Issues redirect for - /// http requests. - /// - /// Site redundancy mode. - /// Specifies an operation id if this site has a pending operation. - /// Checks if Customer provided storage account is required. - /// Identity to use for Key Vault Reference authentication. - /// - /// Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. - /// This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - /// - internal Site(string id, string name, string kind, string location, string type, IDictionary tags, ManagedServiceIdentity identity, string state, IReadOnlyList hostNames, string repositorySiteName, UsageState? usageState, bool? enabled, IReadOnlyList enabledHostNames, SiteAvailabilityState? availabilityState, IList hostNameSslStates, string serverFarmId, bool? reserved, bool? isXenon, bool? hyperV, DateTimeOffset? lastModifiedTimeUtc, SiteConfig siteConfig, IReadOnlyList trafficManagerHostNames, bool? scmSiteAlsoStopped, string targetSwapSlot, HostingEnvironmentProfile hostingEnvironmentProfile, bool? clientAffinityEnabled, bool? clientCertEnabled, ClientCertMode? clientCertMode, string clientCertExclusionPaths, bool? hostNamesDisabled, string customDomainVerificationId, string outboundIpAddresses, string possibleOutboundIpAddresses, int? containerSize, int? dailyMemoryTimeQuota, DateTimeOffset? suspendedTill, int? maxNumberOfWorkers, CloningInfo cloningInfo, string resourceGroup, bool? isDefaultContainer, string defaultHostName, SlotSwapStatus slotSwapStatus, bool? httpsOnly, RedundancyMode? redundancyMode, Guid? inProgressOperationId, bool? storageAccountRequired, string keyVaultReferenceIdentity, string virtualNetworkSubnetId) : base(id, name, kind, location, type, tags) + /// - ClientCertEnabled: true and ClientCertMode: Required means + /// ClientCert is required. + /// - ClientCertEnabled: true and ClientCertMode: Optional means + /// ClientCert is optional or accepted. Possible values include: + /// 'Required', 'Optional' + /// client certificate + /// authentication comma-separated exclusion paths + /// <code>true</code> to + /// disable the public hostnames of the app; otherwise, + /// <code>false</code>. + /// If <code>true</code>, the app is only accessible via + /// API management process. + /// Unique identifier that + /// verifies the custom domains assigned to the app. Customer will add + /// this id to a txt record for verification. + /// List of IP addresses that the app + /// uses for outbound connections (e.g. database access). Includes VIPs + /// from tenants that site can be hosted with current settings. + /// Read-only. + /// List of IP addresses that + /// the app uses for outbound connections (e.g. database access). + /// Includes VIPs from all tenants except dataComponent. + /// Read-only. + /// Size of the function container. + /// Maximum allowed daily + /// memory-time quota (applicable on dynamic apps only). + /// App suspended till in case memory-time + /// quota is exceeded. + /// Maximum number of workers. + /// This only applies to Functions container. + /// If specified during app creation, the app + /// is cloned from a source app. + /// Name of the resource group the app + /// belongs to. Read-only. + /// <code>true</code> if + /// the app is a default container; otherwise, + /// <code>false</code>. + /// Default hostname of the app. + /// Read-only. + /// Status of the last deployment slot + /// swap operation. + /// HttpsOnly: configures a web site to accept + /// only https requests. Issues redirect for + /// http requests + /// Site redundancy mode. Possible values + /// include: 'None', 'Manual', 'Failover', 'ActiveActive', + /// 'GeoRedundant' + /// Specifies an operation id if + /// this site has a pending operation. + public Site(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + : base(location, id, name, kind, type, tags) { - Identity = identity; State = state; HostNames = hostNames; RepositorySiteName = repositorySiteName; @@ -140,114 +181,318 @@ internal Site(string id, string name, string kind, string location, string type, HttpsOnly = httpsOnly; RedundancyMode = redundancyMode; InProgressOperationId = inProgressOperationId; - StorageAccountRequired = storageAccountRequired; - KeyVaultReferenceIdentity = keyVaultReferenceIdentity; - VirtualNetworkSubnetId = virtualNetworkSubnetId; + Identity = identity; + CustomInit(); } - /// Managed service identity. - public ManagedServiceIdentity Identity { get; set; } - /// Current state of the app. - public string State { get; } - /// Hostnames associated with the app. - public IReadOnlyList HostNames { get; } - /// Name of the repository site. - public string RepositorySiteName { get; } - /// State indicating whether the app has exceeded its quota usage. Read-only. - public UsageState? UsageState { get; } - /// <code>true</code> if the app is enabled; otherwise, <code>false</code>. Setting this value to false disables the app (takes the app offline). + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets current state of the app. + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; private set; } + + /// + /// Gets hostnames associated with the app. + /// + [JsonProperty(PropertyName = "properties.hostNames")] + public IList HostNames { get; private set; } + + /// + /// Gets name of the repository site. + /// + [JsonProperty(PropertyName = "properties.repositorySiteName")] + public string RepositorySiteName { get; private set; } + + /// + /// Gets state indicating whether the app has exceeded its quota usage. + /// Read-only. Possible values include: 'Normal', 'Exceeded' + /// + [JsonProperty(PropertyName = "properties.usageState")] + public UsageState? UsageState { get; private set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// app is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. Setting this value + /// to false disables the app (takes the app offline). + /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } + /// - /// Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, + /// Gets enabled hostnames for the app.Hostnames need to be assigned + /// (see HostNames) AND enabled. Otherwise, /// the app is not served on those hostnames. /// - public IReadOnlyList EnabledHostNames { get; } - /// Management information availability state for the app. - public SiteAvailabilityState? AvailabilityState { get; } - /// Hostname SSL states are used to manage the SSL bindings for app's hostnames. - public IList HostNameSslStates { get; } - /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + [JsonProperty(PropertyName = "properties.enabledHostNames")] + public IList EnabledHostNames { get; private set; } + + /// + /// Gets management information availability state for the app. + /// Possible values include: 'Normal', 'Limited', + /// 'DisasterRecoveryMode' + /// + [JsonProperty(PropertyName = "properties.availabilityState")] + public SiteAvailabilityState? AvailabilityState { get; private set; } + + /// + /// Gets or sets hostname SSL states are used to manage the SSL + /// bindings for app's hostnames. + /// + [JsonProperty(PropertyName = "properties.hostNameSslStates")] + public IList HostNameSslStates { get; set; } + + /// + /// Gets or sets resource ID of the associated App Service plan, + /// formatted as: + /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + /// + [JsonProperty(PropertyName = "properties.serverFarmId")] public string ServerFarmId { get; set; } - /// <code>true</code> if reserved; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// reserved; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.reserved")] public bool? Reserved { get; set; } - /// Obsolete: Hyper-V sandbox. + + /// + /// Gets or sets obsolete: Hyper-V sandbox. + /// + [JsonProperty(PropertyName = "properties.isXenon")] public bool? IsXenon { get; set; } - /// Hyper-V sandbox. + + /// + /// Gets or sets hyper-V sandbox. + /// + [JsonProperty(PropertyName = "properties.hyperV")] public bool? HyperV { get; set; } - /// Last time the app was modified, in UTC. Read-only. - public DateTimeOffset? LastModifiedTimeUtc { get; } - /// Configuration of the app. + + /// + /// Gets last time the app was modified, in UTC. Read-only. + /// + [JsonProperty(PropertyName = "properties.lastModifiedTimeUtc")] + public System.DateTime? LastModifiedTimeUtc { get; private set; } + + /// + /// Gets or sets configuration of the app. + /// + [JsonProperty(PropertyName = "properties.siteConfig")] public SiteConfig SiteConfig { get; set; } - /// Azure Traffic Manager hostnames associated with the app. Read-only. - public IReadOnlyList TrafficManagerHostNames { get; } - /// <code>true</code> to stop SCM (KUDU) site when the app is stopped; otherwise, <code>false</code>. The default is <code>false</code>. + + /// + /// Gets azure Traffic Manager hostnames associated with the app. + /// Read-only. + /// + [JsonProperty(PropertyName = "properties.trafficManagerHostNames")] + public IList TrafficManagerHostNames { get; private set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to stop + /// SCM (KUDU) site when the app is stopped; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. The default is + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.scmSiteAlsoStopped")] public bool? ScmSiteAlsoStopped { get; set; } - /// Specifies which deployment slot this app will swap into. Read-only. - public string TargetSwapSlot { get; } - /// App Service Environment to use for the app. + + /// + /// Gets specifies which deployment slot this app will swap into. + /// Read-only. + /// + [JsonProperty(PropertyName = "properties.targetSwapSlot")] + public string TargetSwapSlot { get; private set; } + + /// + /// Gets or sets app Service Environment to use for the app. + /// + [JsonProperty(PropertyName = "properties.hostingEnvironmentProfile")] public HostingEnvironmentProfile HostingEnvironmentProfile { get; set; } - /// <code>true</code> to enable client affinity; <code>false</code> to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is <code>true</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// enable client affinity; + /// &lt;code&gt;false&lt;/code&gt; to stop sending + /// session affinity cookies, which route client requests in the same + /// session to the same instance. Default is + /// &lt;code&gt;true&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.clientAffinityEnabled")] public bool? ClientAffinityEnabled { get; set; } - /// <code>true</code> to enable client certificate authentication (TLS mutual authentication); otherwise, <code>false</code>. Default is <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// enable client certificate authentication (TLS mutual + /// authentication); otherwise, + /// &lt;code&gt;false&lt;/code&gt;. Default is + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.clientCertEnabled")] public bool? ClientCertEnabled { get; set; } + /// - /// This composes with ClientCertEnabled setting. + /// Gets or sets this composes with ClientCertEnabled setting. /// - ClientCertEnabled: false means ClientCert is ignored. - /// - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. - /// - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. + /// - ClientCertEnabled: true and ClientCertMode: Required means + /// ClientCert is required. + /// - ClientCertEnabled: true and ClientCertMode: Optional means + /// ClientCert is optional or accepted. Possible values include: + /// 'Required', 'Optional' /// + [JsonProperty(PropertyName = "properties.clientCertMode")] public ClientCertMode? ClientCertMode { get; set; } - /// client certificate authentication comma-separated exclusion paths. + + /// + /// Gets or sets client certificate authentication comma-separated + /// exclusion paths + /// + [JsonProperty(PropertyName = "properties.clientCertExclusionPaths")] public string ClientCertExclusionPaths { get; set; } + /// - /// <code>true</code> to disable the public hostnames of the app; otherwise, <code>false</code>. - /// If <code>true</code>, the app is only accessible via API management process. + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// disable the public hostnames of the app; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// If &lt;code&gt;true&lt;/code&gt;, the app is only + /// accessible via API management process. /// + [JsonProperty(PropertyName = "properties.hostNamesDisabled")] public bool? HostNamesDisabled { get; set; } - /// Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. + + /// + /// Gets or sets unique identifier that verifies the custom domains + /// assigned to the app. Customer will add this id to a txt record for + /// verification. + /// + [JsonProperty(PropertyName = "properties.customDomainVerificationId")] public string CustomDomainVerificationId { get; set; } - /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. - public string OutboundIpAddresses { get; } - /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. - public string PossibleOutboundIpAddresses { get; } - /// Size of the function container. + + /// + /// Gets list of IP addresses that the app uses for outbound + /// connections (e.g. database access). Includes VIPs from tenants that + /// site can be hosted with current settings. Read-only. + /// + [JsonProperty(PropertyName = "properties.outboundIpAddresses")] + public string OutboundIpAddresses { get; private set; } + + /// + /// Gets list of IP addresses that the app uses for outbound + /// connections (e.g. database access). Includes VIPs from all tenants + /// except dataComponent. Read-only. + /// + [JsonProperty(PropertyName = "properties.possibleOutboundIpAddresses")] + public string PossibleOutboundIpAddresses { get; private set; } + + /// + /// Gets or sets size of the function container. + /// + [JsonProperty(PropertyName = "properties.containerSize")] public int? ContainerSize { get; set; } - /// Maximum allowed daily memory-time quota (applicable on dynamic apps only). + + /// + /// Gets or sets maximum allowed daily memory-time quota (applicable on + /// dynamic apps only). + /// + [JsonProperty(PropertyName = "properties.dailyMemoryTimeQuota")] public int? DailyMemoryTimeQuota { get; set; } - /// App suspended till in case memory-time quota is exceeded. - public DateTimeOffset? SuspendedTill { get; } + /// - /// Maximum number of workers. + /// Gets app suspended till in case memory-time quota is exceeded. + /// + [JsonProperty(PropertyName = "properties.suspendedTill")] + public System.DateTime? SuspendedTill { get; private set; } + + /// + /// Gets maximum number of workers. /// This only applies to Functions container. /// - public int? MaxNumberOfWorkers { get; } - /// If specified during app creation, the app is cloned from a source app. + [JsonProperty(PropertyName = "properties.maxNumberOfWorkers")] + public int? MaxNumberOfWorkers { get; private set; } + + /// + /// Gets or sets if specified during app creation, the app is cloned + /// from a source app. + /// + [JsonProperty(PropertyName = "properties.cloningInfo")] public CloningInfo CloningInfo { get; set; } - /// Name of the resource group the app belongs to. Read-only. - public string ResourceGroup { get; } - /// <code>true</code> if the app is a default container; otherwise, <code>false</code>. - public bool? IsDefaultContainer { get; } - /// Default hostname of the app. Read-only. - public string DefaultHostName { get; } - /// Status of the last deployment slot swap operation. - public SlotSwapStatus SlotSwapStatus { get; } - /// - /// HttpsOnly: configures a web site to accept only https requests. Issues redirect for - /// http requests. + + /// + /// Gets name of the resource group the app belongs to. Read-only. /// + [JsonProperty(PropertyName = "properties.resourceGroup")] + public string ResourceGroup { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the app is a + /// default container; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.isDefaultContainer")] + public bool? IsDefaultContainer { get; private set; } + + /// + /// Gets default hostname of the app. Read-only. + /// + [JsonProperty(PropertyName = "properties.defaultHostName")] + public string DefaultHostName { get; private set; } + + /// + /// Gets status of the last deployment slot swap operation. + /// + [JsonProperty(PropertyName = "properties.slotSwapStatus")] + public SlotSwapStatus SlotSwapStatus { get; private set; } + + /// + /// Gets or sets httpsOnly: configures a web site to accept only https + /// requests. Issues redirect for + /// http requests + /// + [JsonProperty(PropertyName = "properties.httpsOnly")] public bool? HttpsOnly { get; set; } - /// Site redundancy mode. + + /// + /// Gets or sets site redundancy mode. Possible values include: 'None', + /// 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + /// + [JsonProperty(PropertyName = "properties.redundancyMode")] public RedundancyMode? RedundancyMode { get; set; } - /// Specifies an operation id if this site has a pending operation. - public Guid? InProgressOperationId { get; } - /// Checks if Customer provided storage account is required. - public bool? StorageAccountRequired { get; set; } - /// Identity to use for Key Vault Reference authentication. - public string KeyVaultReferenceIdentity { get; set; } + + /// + /// Gets specifies an operation id if this site has a pending + /// operation. + /// + [JsonProperty(PropertyName = "properties.inProgressOperationId")] + public System.Guid? InProgressOperationId { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity { get; set; } + /// - /// Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. - /// This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + /// Validate the object. /// - public string VirtualNetworkSubnetId { get; set; } + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (SiteConfig != null) + { + SiteConfig.Validate(); + } + if (CloningInfo != null) + { + CloningInfo.Validate(); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.Serialization.cs deleted file mode 100644 index f818556ff007..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.Serialization.cs +++ /dev/null @@ -1,627 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteAuthSettings : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(RuntimeVersion)) - { - writer.WritePropertyName("runtimeVersion"); - writer.WriteStringValue(RuntimeVersion); - } - if (Optional.IsDefined(UnauthenticatedClientAction)) - { - writer.WritePropertyName("unauthenticatedClientAction"); - writer.WriteStringValue(UnauthenticatedClientAction.Value.ToSerialString()); - } - if (Optional.IsDefined(TokenStoreEnabled)) - { - writer.WritePropertyName("tokenStoreEnabled"); - writer.WriteBooleanValue(TokenStoreEnabled.Value); - } - if (Optional.IsCollectionDefined(AllowedExternalRedirectUrls)) - { - writer.WritePropertyName("allowedExternalRedirectUrls"); - writer.WriteStartArray(); - foreach (var item in AllowedExternalRedirectUrls) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(DefaultProvider)) - { - writer.WritePropertyName("defaultProvider"); - writer.WriteStringValue(DefaultProvider.Value.ToSerialString()); - } - if (Optional.IsDefined(TokenRefreshExtensionHours)) - { - writer.WritePropertyName("tokenRefreshExtensionHours"); - writer.WriteNumberValue(TokenRefreshExtensionHours.Value); - } - if (Optional.IsDefined(ClientId)) - { - writer.WritePropertyName("clientId"); - writer.WriteStringValue(ClientId); - } - if (Optional.IsDefined(ClientSecret)) - { - writer.WritePropertyName("clientSecret"); - writer.WriteStringValue(ClientSecret); - } - if (Optional.IsDefined(ClientSecretSettingName)) - { - writer.WritePropertyName("clientSecretSettingName"); - writer.WriteStringValue(ClientSecretSettingName); - } - if (Optional.IsDefined(ClientSecretCertificateThumbprint)) - { - writer.WritePropertyName("clientSecretCertificateThumbprint"); - writer.WriteStringValue(ClientSecretCertificateThumbprint); - } - if (Optional.IsDefined(Issuer)) - { - writer.WritePropertyName("issuer"); - writer.WriteStringValue(Issuer); - } - if (Optional.IsDefined(ValidateIssuer)) - { - writer.WritePropertyName("validateIssuer"); - writer.WriteBooleanValue(ValidateIssuer.Value); - } - if (Optional.IsCollectionDefined(AllowedAudiences)) - { - writer.WritePropertyName("allowedAudiences"); - writer.WriteStartArray(); - foreach (var item in AllowedAudiences) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(AdditionalLoginParams)) - { - writer.WritePropertyName("additionalLoginParams"); - writer.WriteStartArray(); - foreach (var item in AdditionalLoginParams) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(AadClaimsAuthorization)) - { - writer.WritePropertyName("aadClaimsAuthorization"); - writer.WriteStringValue(AadClaimsAuthorization); - } - if (Optional.IsDefined(GoogleClientId)) - { - writer.WritePropertyName("googleClientId"); - writer.WriteStringValue(GoogleClientId); - } - if (Optional.IsDefined(GoogleClientSecret)) - { - writer.WritePropertyName("googleClientSecret"); - writer.WriteStringValue(GoogleClientSecret); - } - if (Optional.IsDefined(GoogleClientSecretSettingName)) - { - writer.WritePropertyName("googleClientSecretSettingName"); - writer.WriteStringValue(GoogleClientSecretSettingName); - } - if (Optional.IsCollectionDefined(GoogleOAuthScopes)) - { - writer.WritePropertyName("googleOAuthScopes"); - writer.WriteStartArray(); - foreach (var item in GoogleOAuthScopes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(FacebookAppId)) - { - writer.WritePropertyName("facebookAppId"); - writer.WriteStringValue(FacebookAppId); - } - if (Optional.IsDefined(FacebookAppSecret)) - { - writer.WritePropertyName("facebookAppSecret"); - writer.WriteStringValue(FacebookAppSecret); - } - if (Optional.IsDefined(FacebookAppSecretSettingName)) - { - writer.WritePropertyName("facebookAppSecretSettingName"); - writer.WriteStringValue(FacebookAppSecretSettingName); - } - if (Optional.IsCollectionDefined(FacebookOAuthScopes)) - { - writer.WritePropertyName("facebookOAuthScopes"); - writer.WriteStartArray(); - foreach (var item in FacebookOAuthScopes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(GitHubClientId)) - { - writer.WritePropertyName("gitHubClientId"); - writer.WriteStringValue(GitHubClientId); - } - if (Optional.IsDefined(GitHubClientSecret)) - { - writer.WritePropertyName("gitHubClientSecret"); - writer.WriteStringValue(GitHubClientSecret); - } - if (Optional.IsDefined(GitHubClientSecretSettingName)) - { - writer.WritePropertyName("gitHubClientSecretSettingName"); - writer.WriteStringValue(GitHubClientSecretSettingName); - } - if (Optional.IsCollectionDefined(GitHubOAuthScopes)) - { - writer.WritePropertyName("gitHubOAuthScopes"); - writer.WriteStartArray(); - foreach (var item in GitHubOAuthScopes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(TwitterConsumerKey)) - { - writer.WritePropertyName("twitterConsumerKey"); - writer.WriteStringValue(TwitterConsumerKey); - } - if (Optional.IsDefined(TwitterConsumerSecret)) - { - writer.WritePropertyName("twitterConsumerSecret"); - writer.WriteStringValue(TwitterConsumerSecret); - } - if (Optional.IsDefined(TwitterConsumerSecretSettingName)) - { - writer.WritePropertyName("twitterConsumerSecretSettingName"); - writer.WriteStringValue(TwitterConsumerSecretSettingName); - } - if (Optional.IsDefined(MicrosoftAccountClientId)) - { - writer.WritePropertyName("microsoftAccountClientId"); - writer.WriteStringValue(MicrosoftAccountClientId); - } - if (Optional.IsDefined(MicrosoftAccountClientSecret)) - { - writer.WritePropertyName("microsoftAccountClientSecret"); - writer.WriteStringValue(MicrosoftAccountClientSecret); - } - if (Optional.IsDefined(MicrosoftAccountClientSecretSettingName)) - { - writer.WritePropertyName("microsoftAccountClientSecretSettingName"); - writer.WriteStringValue(MicrosoftAccountClientSecretSettingName); - } - if (Optional.IsCollectionDefined(MicrosoftAccountOAuthScopes)) - { - writer.WritePropertyName("microsoftAccountOAuthScopes"); - writer.WriteStartArray(); - foreach (var item in MicrosoftAccountOAuthScopes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(IsAuthFromFile)) - { - writer.WritePropertyName("isAuthFromFile"); - writer.WriteStringValue(IsAuthFromFile); - } - if (Optional.IsDefined(AuthFilePath)) - { - writer.WritePropertyName("authFilePath"); - writer.WriteStringValue(AuthFilePath); - } - if (Optional.IsDefined(ConfigVersion)) - { - writer.WritePropertyName("configVersion"); - writer.WriteStringValue(ConfigVersion); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SiteAuthSettings DeserializeSiteAuthSettings(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional runtimeVersion = default; - Optional unauthenticatedClientAction = default; - Optional tokenStoreEnabled = default; - Optional> allowedExternalRedirectUrls = default; - Optional defaultProvider = default; - Optional tokenRefreshExtensionHours = default; - Optional clientId = default; - Optional clientSecret = default; - Optional clientSecretSettingName = default; - Optional clientSecretCertificateThumbprint = default; - Optional issuer = default; - Optional validateIssuer = default; - Optional> allowedAudiences = default; - Optional> additionalLoginParams = default; - Optional aadClaimsAuthorization = default; - Optional googleClientId = default; - Optional googleClientSecret = default; - Optional googleClientSecretSettingName = default; - Optional> googleOAuthScopes = default; - Optional facebookAppId = default; - Optional facebookAppSecret = default; - Optional facebookAppSecretSettingName = default; - Optional> facebookOAuthScopes = default; - Optional gitHubClientId = default; - Optional gitHubClientSecret = default; - Optional gitHubClientSecretSettingName = default; - Optional> gitHubOAuthScopes = default; - Optional twitterConsumerKey = default; - Optional twitterConsumerSecret = default; - Optional twitterConsumerSecretSettingName = default; - Optional microsoftAccountClientId = default; - Optional microsoftAccountClientSecret = default; - Optional microsoftAccountClientSecretSettingName = default; - Optional> microsoftAccountOAuthScopes = default; - Optional isAuthFromFile = default; - Optional authFilePath = default; - Optional configVersion = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("runtimeVersion")) - { - runtimeVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("unauthenticatedClientAction")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - unauthenticatedClientAction = property0.Value.GetString().ToUnauthenticatedClientAction(); - continue; - } - if (property0.NameEquals("tokenStoreEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - tokenStoreEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("allowedExternalRedirectUrls")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedExternalRedirectUrls = array; - continue; - } - if (property0.NameEquals("defaultProvider")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - defaultProvider = property0.Value.GetString().ToBuiltInAuthenticationProvider(); - continue; - } - if (property0.NameEquals("tokenRefreshExtensionHours")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - tokenRefreshExtensionHours = property0.Value.GetDouble(); - continue; - } - if (property0.NameEquals("clientId")) - { - clientId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("clientSecret")) - { - clientSecret = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("clientSecretSettingName")) - { - clientSecretSettingName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("clientSecretCertificateThumbprint")) - { - clientSecretCertificateThumbprint = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("issuer")) - { - issuer = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("validateIssuer")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - validateIssuer = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("allowedAudiences")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedAudiences = array; - continue; - } - if (property0.NameEquals("additionalLoginParams")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - additionalLoginParams = array; - continue; - } - if (property0.NameEquals("aadClaimsAuthorization")) - { - aadClaimsAuthorization = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("googleClientId")) - { - googleClientId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("googleClientSecret")) - { - googleClientSecret = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("googleClientSecretSettingName")) - { - googleClientSecretSettingName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("googleOAuthScopes")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - googleOAuthScopes = array; - continue; - } - if (property0.NameEquals("facebookAppId")) - { - facebookAppId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("facebookAppSecret")) - { - facebookAppSecret = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("facebookAppSecretSettingName")) - { - facebookAppSecretSettingName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("facebookOAuthScopes")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - facebookOAuthScopes = array; - continue; - } - if (property0.NameEquals("gitHubClientId")) - { - gitHubClientId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("gitHubClientSecret")) - { - gitHubClientSecret = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("gitHubClientSecretSettingName")) - { - gitHubClientSecretSettingName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("gitHubOAuthScopes")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - gitHubOAuthScopes = array; - continue; - } - if (property0.NameEquals("twitterConsumerKey")) - { - twitterConsumerKey = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("twitterConsumerSecret")) - { - twitterConsumerSecret = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("twitterConsumerSecretSettingName")) - { - twitterConsumerSecretSettingName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("microsoftAccountClientId")) - { - microsoftAccountClientId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("microsoftAccountClientSecret")) - { - microsoftAccountClientSecret = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("microsoftAccountClientSecretSettingName")) - { - microsoftAccountClientSecretSettingName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("microsoftAccountOAuthScopes")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - microsoftAccountOAuthScopes = array; - continue; - } - if (property0.NameEquals("isAuthFromFile")) - { - isAuthFromFile = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("authFilePath")) - { - authFilePath = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("configVersion")) - { - configVersion = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new SiteAuthSettings(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), runtimeVersion.Value, Optional.ToNullable(unauthenticatedClientAction), Optional.ToNullable(tokenStoreEnabled), Optional.ToList(allowedExternalRedirectUrls), Optional.ToNullable(defaultProvider), Optional.ToNullable(tokenRefreshExtensionHours), clientId.Value, clientSecret.Value, clientSecretSettingName.Value, clientSecretCertificateThumbprint.Value, issuer.Value, Optional.ToNullable(validateIssuer), Optional.ToList(allowedAudiences), Optional.ToList(additionalLoginParams), aadClaimsAuthorization.Value, googleClientId.Value, googleClientSecret.Value, googleClientSecretSettingName.Value, Optional.ToList(googleOAuthScopes), facebookAppId.Value, facebookAppSecret.Value, facebookAppSecretSettingName.Value, Optional.ToList(facebookOAuthScopes), gitHubClientId.Value, gitHubClientSecret.Value, gitHubClientSecretSettingName.Value, Optional.ToList(gitHubOAuthScopes), twitterConsumerKey.Value, twitterConsumerSecret.Value, twitterConsumerSecretSettingName.Value, microsoftAccountClientId.Value, microsoftAccountClientSecret.Value, microsoftAccountClientSecretSettingName.Value, Optional.ToList(microsoftAccountOAuthScopes), isAuthFromFile.Value, authFilePath.Value, configVersion.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs index 1dbdc0c614e3..a87bf293faac 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs @@ -1,190 +1,212 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Configuration settings for the Azure App Service Authentication / Authorization feature. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Configuration settings for the Azure App Service Authentication / + /// Authorization feature. + /// + [Rest.Serialization.JsonTransformation] public partial class SiteAuthSettings : ProxyOnlyResource { - /// Initializes a new instance of SiteAuthSettings. + /// + /// Initializes a new instance of the SiteAuthSettings class. + /// public SiteAuthSettings() { - AllowedExternalRedirectUrls = new ChangeTrackingList(); - AllowedAudiences = new ChangeTrackingList(); - AdditionalLoginParams = new ChangeTrackingList(); - GoogleOAuthScopes = new ChangeTrackingList(); - FacebookOAuthScopes = new ChangeTrackingList(); - GitHubOAuthScopes = new ChangeTrackingList(); - MicrosoftAccountOAuthScopes = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of SiteAuthSettings. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>true</code> if the Authentication / Authorization feature is enabled for the current app; otherwise, <code>false</code>. - /// - /// The RuntimeVersion of the Authentication / Authorization feature in use for the current app. - /// The setting in this value can control the behavior of certain features in the Authentication / Authorization module. - /// - /// The action to take when an unauthenticated client attempts to access the app. - /// - /// <code>true</code> to durably store platform-specific security tokens that are obtained during login flows; otherwise, <code>false</code>. - /// The default is <code>false</code>. - /// - /// - /// External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. - /// This is an advanced setting typically only needed by Windows Store application backends. - /// Note that URLs within the current domain are always implicitly allowed. - /// - /// - /// The default authentication provider to use when multiple providers are configured. - /// This setting is only needed if multiple providers are configured and the unauthenticated client - /// action is set to "RedirectToLoginPage". - /// - /// - /// The number of hours after session token expiration that a session token can be used to - /// call the token refresh API. The default is 72 hours. - /// - /// - /// The Client ID of this relying party application, known as the client_id. - /// This setting is required for enabling OpenID Connection authentication with Azure Active Directory or + /// + /// Initializes a new instance of the SiteAuthSettings class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>true</code> if the + /// Authentication / Authorization feature is enabled for the current + /// app; otherwise, <code>false</code>. + /// The RuntimeVersion of the + /// Authentication / Authorization feature in use for the current app. + /// The setting in this value can control the behavior of certain + /// features in the Authentication / Authorization module. + /// The action to take when + /// an unauthenticated client attempts to access the app. Possible + /// values include: 'RedirectToLoginPage', 'AllowAnonymous' + /// <code>true</code> to + /// durably store platform-specific security tokens that are obtained + /// during login flows; otherwise, <code>false</code>. + /// The default is <code>false</code>. + /// External URLs that can be + /// redirected to as part of logging in or logging out of the app. Note + /// that the query string part of the URL is ignored. + /// This is an advanced setting typically only needed by Windows Store + /// application backends. + /// Note that URLs within the current domain are always implicitly + /// allowed. + /// The default authentication provider + /// to use when multiple providers are configured. + /// This setting is only needed if multiple providers are configured + /// and the unauthenticated client + /// action is set to "RedirectToLoginPage". Possible values include: + /// 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', + /// 'Twitter', 'Github' + /// The number of hours after + /// session token expiration that a session token can be used to + /// call the token refresh API. The default is 72 hours. + /// The Client ID of this relying party + /// application, known as the client_id. + /// This setting is required for enabling OpenID Connection + /// authentication with Azure Active Directory or /// other 3rd party OpenID Connect providers. - /// More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. - /// - /// - /// The Client Secret of this relying party application (in Azure Active Directory, this is also referred to as the Key). - /// This setting is optional. If no client secret is configured, the OpenID Connect implicit auth flow is used to authenticate end users. - /// Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. - /// More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. - /// - /// The app setting name that contains the client secret of the relying party application. - /// - /// An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as - /// a replacement for the Client Secret. It is also optional. - /// - /// - /// The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. - /// When using Azure Active Directory, this value is the URI of the directory tenant, e.g. https://sts.windows.net/{tenant-guid}/. + /// More information on OpenID Connect: + /// http://openid.net/specs/openid-connect-core-1_0.html + /// The Client Secret of this relying party + /// application (in Azure Active Directory, this is also referred to as + /// the Key). + /// This setting is optional. If no client secret is configured, the + /// OpenID Connect implicit auth flow is used to authenticate end + /// users. + /// Otherwise, the OpenID Connect Authorization Code Flow is used to + /// authenticate end users. + /// More information on OpenID Connect: + /// http://openid.net/specs/openid-connect-core-1_0.html + /// The app setting name that + /// contains the client secret of the relying party + /// application. + /// An alternative to + /// the client secret, that is the thumbprint of a certificate used for + /// signing purposes. This property acts as + /// a replacement for the Client Secret. It is also optional. + /// The OpenID Connect Issuer URI that represents + /// the entity which issues access tokens for this application. + /// When using Azure Active Directory, this value is the URI of the + /// directory tenant, e.g. https://sts.windows.net/{tenant-guid}/. /// This URI is a case-sensitive identifier for the token issuer. - /// More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. - /// - /// Gets a value indicating whether the issuer should be a valid HTTPS url and be validated as such. - /// - /// Allowed audience values to consider when validating JWTs issued by - /// Azure Active Directory. Note that the <code>ClientID</code> value is always considered an - /// allowed audience, regardless of this setting. - /// - /// - /// Login parameters to send to the OpenID Connect authorization endpoint when - /// a user logs in. Each parameter must be in the form "key=value". - /// - /// Gets a JSON string containing the Azure AD Acl settings. - /// - /// The OpenID Connect Client ID for the Google web application. + /// More information on OpenID Connect Discovery: + /// http://openid.net/specs/openid-connect-discovery-1_0.html + /// Gets a value indicating whether the + /// issuer should be a valid HTTPS url and be validated as + /// such. + /// Allowed audience values to consider + /// when validating JWTs issued by + /// Azure Active Directory. Note that the + /// <code>ClientID</code> value is always considered an + /// allowed audience, regardless of this setting. + /// Login parameters to send to the + /// OpenID Connect authorization endpoint when + /// a user logs in. Each parameter must be in the form + /// "key=value". + /// Gets a JSON string containing + /// the Azure AD Acl settings. + /// The OpenID Connect Client ID for the + /// Google web application. /// This setting is required for enabling Google Sign-In. - /// Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. - /// - /// - /// The client secret associated with the Google web application. - /// This setting is required for enabling Google Sign-In. - /// Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. - /// - /// - /// The app setting name that contains the client secret associated with + /// Google Sign-In documentation: + /// https://developers.google.com/identity/sign-in/web/ + /// The client secret associated with /// the Google web application. - /// - /// - /// The OAuth 2.0 scopes that will be requested as part of Google Sign-In authentication. - /// This setting is optional. If not specified, "openid", "profile", and "email" are used as default scopes. - /// Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. - /// - /// - /// The App ID of the Facebook app used for login. + /// This setting is required for enabling Google Sign-In. + /// Google Sign-In documentation: + /// https://developers.google.com/identity/sign-in/web/ + /// The app setting name + /// that contains the client secret associated with + /// the Google web application. + /// The OAuth 2.0 scopes that will be + /// requested as part of Google Sign-In authentication. + /// This setting is optional. If not specified, "openid", "profile", + /// and "email" are used as default scopes. + /// Google Sign-In documentation: + /// https://developers.google.com/identity/sign-in/web/ + /// The App ID of the Facebook app used for + /// login. /// This setting is required for enabling Facebook Login. - /// Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. - /// - /// - /// The App Secret of the Facebook app used for Facebook Login. + /// Facebook Login documentation: + /// https://developers.facebook.com/docs/facebook-login + /// The App Secret of the Facebook app + /// used for Facebook Login. /// This setting is required for enabling Facebook Login. - /// Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. - /// - /// The app setting name that contains the app secret used for Facebook Login. - /// - /// The OAuth 2.0 scopes that will be requested as part of Facebook Login authentication. - /// This setting is optional. - /// Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. - /// - /// - /// The Client Id of the GitHub app used for login. - /// This setting is required for enabling Github login. - /// - /// - /// The Client Secret of the GitHub app used for Github Login. - /// This setting is required for enabling Github login. - /// - /// - /// The app setting name that contains the client secret of the Github - /// app used for GitHub Login. - /// - /// - /// The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. + /// Facebook Login documentation: + /// https://developers.facebook.com/docs/facebook-login + /// The app setting name + /// that contains the app secret used for Facebook Login. + /// The OAuth 2.0 scopes that will be + /// requested as part of Facebook Login authentication. /// This setting is optional. - /// - /// - /// The OAuth 1.0a consumer key of the Twitter application used for sign-in. + /// Facebook Login documentation: + /// https://developers.facebook.com/docs/facebook-login + /// The Client Id of the GitHub app used + /// for login. + /// This setting is required for enabling Github login + /// The Client Secret of the GitHub + /// app used for Github Login. + /// This setting is required for enabling Github login. + /// The app setting name + /// that contains the client secret of the Github + /// app used for GitHub Login. + /// The OAuth 2.0 scopes that will be + /// requested as part of GitHub Login authentication. + /// This setting is optional + /// The OAuth 1.0a consumer key of the + /// Twitter application used for sign-in. /// This setting is required for enabling Twitter Sign-In. - /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. - /// - /// - /// The OAuth 1.0a consumer secret of the Twitter application used for sign-in. + /// Twitter Sign-In documentation: + /// https://dev.twitter.com/web/sign-in + /// The OAuth 1.0a consumer secret + /// of the Twitter application used for sign-in. /// This setting is required for enabling Twitter Sign-In. - /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. - /// - /// - /// The app setting name that contains the OAuth 1.0a consumer secret of the Twitter - /// application used for sign-in. - /// - /// - /// The OAuth 2.0 client ID that was created for the app used for authentication. - /// This setting is required for enabling Microsoft Account authentication. - /// Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. - /// - /// - /// The OAuth 2.0 client secret that was created for the app used for authentication. - /// This setting is required for enabling Microsoft Account authentication. - /// Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. - /// - /// - /// The app setting name containing the OAuth 2.0 client secret that was created for the - /// app used for authentication. - /// - /// - /// The OAuth 2.0 scopes that will be requested as part of Microsoft Account authentication. - /// This setting is optional. If not specified, "wl.basic" is used as the default scope. - /// Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en-us/library/dn631845.aspx. - /// - /// - /// "true" if the auth config settings should be read from a file, - /// "false" otherwise. - /// - /// - /// The path of the config file containing auth settings. - /// If the path is relative, base will the site's root directory. - /// - /// - /// The ConfigVersion of the Authentication / Authorization feature in use for the current app. - /// The setting in this value can control the behavior of the control plane for Authentication / Authorization. - /// - internal SiteAuthSettings(string id, string name, string kind, string type, bool? enabled, string runtimeVersion, UnauthenticatedClientAction? unauthenticatedClientAction, bool? tokenStoreEnabled, IList allowedExternalRedirectUrls, BuiltInAuthenticationProvider? defaultProvider, double? tokenRefreshExtensionHours, string clientId, string clientSecret, string clientSecretSettingName, string clientSecretCertificateThumbprint, string issuer, bool? validateIssuer, IList allowedAudiences, IList additionalLoginParams, string aadClaimsAuthorization, string googleClientId, string googleClientSecret, string googleClientSecretSettingName, IList googleOAuthScopes, string facebookAppId, string facebookAppSecret, string facebookAppSecretSettingName, IList facebookOAuthScopes, string gitHubClientId, string gitHubClientSecret, string gitHubClientSecretSettingName, IList gitHubOAuthScopes, string twitterConsumerKey, string twitterConsumerSecret, string twitterConsumerSecretSettingName, string microsoftAccountClientId, string microsoftAccountClientSecret, string microsoftAccountClientSecretSettingName, IList microsoftAccountOAuthScopes, string isAuthFromFile, string authFilePath, string configVersion) : base(id, name, kind, type) + /// Twitter Sign-In documentation: + /// https://dev.twitter.com/web/sign-in + /// The app setting name + /// that contains the OAuth 1.0a consumer secret of the Twitter + /// application used for sign-in. + /// The OAuth 2.0 client ID that + /// was created for the app used for authentication. + /// This setting is required for enabling Microsoft Account + /// authentication. + /// Microsoft Account OAuth documentation: + /// https://dev.onedrive.com/auth/msa_oauth.htm + /// The OAuth 2.0 client + /// secret that was created for the app used for authentication. + /// This setting is required for enabling Microsoft Account + /// authentication. + /// Microsoft Account OAuth documentation: + /// https://dev.onedrive.com/auth/msa_oauth.htm + /// The app + /// setting name containing the OAuth 2.0 client secret that was + /// created for the + /// app used for authentication. + /// The OAuth 2.0 scopes that + /// will be requested as part of Microsoft Account authentication. + /// This setting is optional. If not specified, "wl.basic" is used as + /// the default scope. + /// Microsoft Account Scopes and permissions documentation: + /// https://msdn.microsoft.com/en-us/library/dn631845.aspx + /// "true" if the auth config settings + /// should be read from a file, + /// "false" otherwise + /// The path of the config file containing + /// auth settings. + /// If the path is relative, base will the site's root + /// directory. + public SiteAuthSettings(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), string runtimeVersion = default(string), UnauthenticatedClientAction? unauthenticatedClientAction = default(UnauthenticatedClientAction?), bool? tokenStoreEnabled = default(bool?), IList allowedExternalRedirectUrls = default(IList), BuiltInAuthenticationProvider? defaultProvider = default(BuiltInAuthenticationProvider?), double? tokenRefreshExtensionHours = default(double?), string clientId = default(string), string clientSecret = default(string), string clientSecretSettingName = default(string), string clientSecretCertificateThumbprint = default(string), string issuer = default(string), bool? validateIssuer = default(bool?), IList allowedAudiences = default(IList), IList additionalLoginParams = default(IList), string aadClaimsAuthorization = default(string), string googleClientId = default(string), string googleClientSecret = default(string), string googleClientSecretSettingName = default(string), IList googleOAuthScopes = default(IList), string facebookAppId = default(string), string facebookAppSecret = default(string), string facebookAppSecretSettingName = default(string), IList facebookOAuthScopes = default(IList), string gitHubClientId = default(string), string gitHubClientSecret = default(string), string gitHubClientSecretSettingName = default(string), IList gitHubOAuthScopes = default(IList), string twitterConsumerKey = default(string), string twitterConsumerSecret = default(string), string twitterConsumerSecretSettingName = default(string), string microsoftAccountClientId = default(string), string microsoftAccountClientSecret = default(string), string microsoftAccountClientSecretSettingName = default(string), IList microsoftAccountOAuthScopes = default(IList), string isAuthFromFile = default(string), string authFilePath = default(string)) + : base(id, name, kind, type) { Enabled = enabled; RuntimeVersion = runtimeVersion; @@ -223,200 +245,354 @@ internal SiteAuthSettings(string id, string name, string kind, string type, bool MicrosoftAccountOAuthScopes = microsoftAccountOAuthScopes; IsAuthFromFile = isAuthFromFile; AuthFilePath = authFilePath; - ConfigVersion = configVersion; + CustomInit(); } - /// <code>true</code> if the Authentication / Authorization feature is enabled for the current app; otherwise, <code>false</code>. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// Authentication / Authorization feature is enabled for the current + /// app; otherwise, &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } + /// - /// The RuntimeVersion of the Authentication / Authorization feature in use for the current app. - /// The setting in this value can control the behavior of certain features in the Authentication / Authorization module. + /// Gets or sets the RuntimeVersion of the Authentication / + /// Authorization feature in use for the current app. + /// The setting in this value can control the behavior of certain + /// features in the Authentication / Authorization module. /// + [JsonProperty(PropertyName = "properties.runtimeVersion")] public string RuntimeVersion { get; set; } - /// The action to take when an unauthenticated client attempts to access the app. + + /// + /// Gets or sets the action to take when an unauthenticated client + /// attempts to access the app. Possible values include: + /// 'RedirectToLoginPage', 'AllowAnonymous' + /// + [JsonProperty(PropertyName = "properties.unauthenticatedClientAction")] public UnauthenticatedClientAction? UnauthenticatedClientAction { get; set; } + /// - /// <code>true</code> to durably store platform-specific security tokens that are obtained during login flows; otherwise, <code>false</code>. - /// The default is <code>false</code>. + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// durably store platform-specific security tokens that are obtained + /// during login flows; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// The default is &lt;code&gt;false&lt;/code&gt;. /// + [JsonProperty(PropertyName = "properties.tokenStoreEnabled")] public bool? TokenStoreEnabled { get; set; } + /// - /// External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. - /// This is an advanced setting typically only needed by Windows Store application backends. - /// Note that URLs within the current domain are always implicitly allowed. + /// Gets or sets external URLs that can be redirected to as part of + /// logging in or logging out of the app. Note that the query string + /// part of the URL is ignored. + /// This is an advanced setting typically only needed by Windows Store + /// application backends. + /// Note that URLs within the current domain are always implicitly + /// allowed. /// - public IList AllowedExternalRedirectUrls { get; } + [JsonProperty(PropertyName = "properties.allowedExternalRedirectUrls")] + public IList AllowedExternalRedirectUrls { get; set; } + /// - /// The default authentication provider to use when multiple providers are configured. - /// This setting is only needed if multiple providers are configured and the unauthenticated client - /// action is set to "RedirectToLoginPage". + /// Gets or sets the default authentication provider to use when + /// multiple providers are configured. + /// This setting is only needed if multiple providers are configured + /// and the unauthenticated client + /// action is set to "RedirectToLoginPage". Possible values include: + /// 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', + /// 'Twitter', 'Github' /// + [JsonProperty(PropertyName = "properties.defaultProvider")] public BuiltInAuthenticationProvider? DefaultProvider { get; set; } + /// - /// The number of hours after session token expiration that a session token can be used to + /// Gets or sets the number of hours after session token expiration + /// that a session token can be used to /// call the token refresh API. The default is 72 hours. /// + [JsonProperty(PropertyName = "properties.tokenRefreshExtensionHours")] public double? TokenRefreshExtensionHours { get; set; } + /// - /// The Client ID of this relying party application, known as the client_id. - /// This setting is required for enabling OpenID Connection authentication with Azure Active Directory or + /// Gets or sets the Client ID of this relying party application, known + /// as the client_id. + /// This setting is required for enabling OpenID Connection + /// authentication with Azure Active Directory or /// other 3rd party OpenID Connect providers. - /// More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + /// More information on OpenID Connect: + /// http://openid.net/specs/openid-connect-core-1_0.html /// + [JsonProperty(PropertyName = "properties.clientId")] public string ClientId { get; set; } + /// - /// The Client Secret of this relying party application (in Azure Active Directory, this is also referred to as the Key). - /// This setting is optional. If no client secret is configured, the OpenID Connect implicit auth flow is used to authenticate end users. - /// Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. - /// More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. - /// + /// Gets or sets the Client Secret of this relying party application + /// (in Azure Active Directory, this is also referred to as the Key). + /// This setting is optional. If no client secret is configured, the + /// OpenID Connect implicit auth flow is used to authenticate end + /// users. + /// Otherwise, the OpenID Connect Authorization Code Flow is used to + /// authenticate end users. + /// More information on OpenID Connect: + /// http://openid.net/specs/openid-connect-core-1_0.html + /// + [JsonProperty(PropertyName = "properties.clientSecret")] public string ClientSecret { get; set; } - /// The app setting name that contains the client secret of the relying party application. + + /// + /// Gets or sets the app setting name that contains the client secret + /// of the relying party application. + /// + [JsonProperty(PropertyName = "properties.clientSecretSettingName")] public string ClientSecretSettingName { get; set; } + /// - /// An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as + /// Gets or sets an alternative to the client secret, that is the + /// thumbprint of a certificate used for signing purposes. This + /// property acts as /// a replacement for the Client Secret. It is also optional. /// + [JsonProperty(PropertyName = "properties.clientSecretCertificateThumbprint")] public string ClientSecretCertificateThumbprint { get; set; } + /// - /// The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. - /// When using Azure Active Directory, this value is the URI of the directory tenant, e.g. https://sts.windows.net/{tenant-guid}/. + /// Gets or sets the OpenID Connect Issuer URI that represents the + /// entity which issues access tokens for this application. + /// When using Azure Active Directory, this value is the URI of the + /// directory tenant, e.g. https://sts.windows.net/{tenant-guid}/. /// This URI is a case-sensitive identifier for the token issuer. - /// More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. + /// More information on OpenID Connect Discovery: + /// http://openid.net/specs/openid-connect-discovery-1_0.html /// + [JsonProperty(PropertyName = "properties.issuer")] public string Issuer { get; set; } - /// Gets a value indicating whether the issuer should be a valid HTTPS url and be validated as such. + + /// + /// Gets a value indicating whether the issuer should be a valid HTTPS + /// url and be validated as such. + /// + [JsonProperty(PropertyName = "properties.validateIssuer")] public bool? ValidateIssuer { get; set; } + /// - /// Allowed audience values to consider when validating JWTs issued by - /// Azure Active Directory. Note that the <code>ClientID</code> value is always considered an + /// Gets or sets allowed audience values to consider when validating + /// JWTs issued by + /// Azure Active Directory. Note that the + /// &lt;code&gt;ClientID&lt;/code&gt; value is always + /// considered an /// allowed audience, regardless of this setting. /// - public IList AllowedAudiences { get; } + [JsonProperty(PropertyName = "properties.allowedAudiences")] + public IList AllowedAudiences { get; set; } + + /// + /// Gets or sets login parameters to send to the OpenID Connect + /// authorization endpoint when + /// a user logs in. Each parameter must be in the form "key=value". + /// + [JsonProperty(PropertyName = "properties.additionalLoginParams")] + public IList AdditionalLoginParams { get; set; } + /// - /// Login parameters to send to the OpenID Connect authorization endpoint when - /// a user logs in. Each parameter must be in the form "key=value". + /// Gets a JSON string containing the Azure AD Acl settings. /// - public IList AdditionalLoginParams { get; } - /// Gets a JSON string containing the Azure AD Acl settings. + [JsonProperty(PropertyName = "properties.aadClaimsAuthorization")] public string AadClaimsAuthorization { get; set; } + /// - /// The OpenID Connect Client ID for the Google web application. + /// Gets or sets the OpenID Connect Client ID for the Google web + /// application. /// This setting is required for enabling Google Sign-In. - /// Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + /// Google Sign-In documentation: + /// https://developers.google.com/identity/sign-in/web/ /// + [JsonProperty(PropertyName = "properties.googleClientId")] public string GoogleClientId { get; set; } + /// - /// The client secret associated with the Google web application. + /// Gets or sets the client secret associated with the Google web + /// application. /// This setting is required for enabling Google Sign-In. - /// Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + /// Google Sign-In documentation: + /// https://developers.google.com/identity/sign-in/web/ /// + [JsonProperty(PropertyName = "properties.googleClientSecret")] public string GoogleClientSecret { get; set; } + /// - /// The app setting name that contains the client secret associated with + /// Gets or sets the app setting name that contains the client secret + /// associated with /// the Google web application. /// + [JsonProperty(PropertyName = "properties.googleClientSecretSettingName")] public string GoogleClientSecretSettingName { get; set; } + /// - /// The OAuth 2.0 scopes that will be requested as part of Google Sign-In authentication. - /// This setting is optional. If not specified, "openid", "profile", and "email" are used as default scopes. - /// Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + /// Gets or sets the OAuth 2.0 scopes that will be requested as part of + /// Google Sign-In authentication. + /// This setting is optional. If not specified, "openid", "profile", + /// and "email" are used as default scopes. + /// Google Sign-In documentation: + /// https://developers.google.com/identity/sign-in/web/ /// - public IList GoogleOAuthScopes { get; } + [JsonProperty(PropertyName = "properties.googleOAuthScopes")] + public IList GoogleOAuthScopes { get; set; } + /// - /// The App ID of the Facebook app used for login. + /// Gets or sets the App ID of the Facebook app used for login. /// This setting is required for enabling Facebook Login. - /// Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + /// Facebook Login documentation: + /// https://developers.facebook.com/docs/facebook-login /// + [JsonProperty(PropertyName = "properties.facebookAppId")] public string FacebookAppId { get; set; } + /// - /// The App Secret of the Facebook app used for Facebook Login. + /// Gets or sets the App Secret of the Facebook app used for Facebook + /// Login. /// This setting is required for enabling Facebook Login. - /// Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + /// Facebook Login documentation: + /// https://developers.facebook.com/docs/facebook-login /// + [JsonProperty(PropertyName = "properties.facebookAppSecret")] public string FacebookAppSecret { get; set; } - /// The app setting name that contains the app secret used for Facebook Login. + + /// + /// Gets or sets the app setting name that contains the app secret used + /// for Facebook Login. + /// + [JsonProperty(PropertyName = "properties.facebookAppSecretSettingName")] public string FacebookAppSecretSettingName { get; set; } + /// - /// The OAuth 2.0 scopes that will be requested as part of Facebook Login authentication. + /// Gets or sets the OAuth 2.0 scopes that will be requested as part of + /// Facebook Login authentication. /// This setting is optional. - /// Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + /// Facebook Login documentation: + /// https://developers.facebook.com/docs/facebook-login /// - public IList FacebookOAuthScopes { get; } + [JsonProperty(PropertyName = "properties.facebookOAuthScopes")] + public IList FacebookOAuthScopes { get; set; } + /// - /// The Client Id of the GitHub app used for login. - /// This setting is required for enabling Github login. + /// Gets or sets the Client Id of the GitHub app used for login. + /// This setting is required for enabling Github login /// + [JsonProperty(PropertyName = "properties.gitHubClientId")] public string GitHubClientId { get; set; } + /// - /// The Client Secret of the GitHub app used for Github Login. + /// Gets or sets the Client Secret of the GitHub app used for Github + /// Login. /// This setting is required for enabling Github login. /// + [JsonProperty(PropertyName = "properties.gitHubClientSecret")] public string GitHubClientSecret { get; set; } + /// - /// The app setting name that contains the client secret of the Github + /// Gets or sets the app setting name that contains the client secret + /// of the Github /// app used for GitHub Login. /// + [JsonProperty(PropertyName = "properties.gitHubClientSecretSettingName")] public string GitHubClientSecretSettingName { get; set; } + /// - /// The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. - /// This setting is optional. + /// Gets or sets the OAuth 2.0 scopes that will be requested as part of + /// GitHub Login authentication. + /// This setting is optional /// - public IList GitHubOAuthScopes { get; } + [JsonProperty(PropertyName = "properties.gitHubOAuthScopes")] + public IList GitHubOAuthScopes { get; set; } + /// - /// The OAuth 1.0a consumer key of the Twitter application used for sign-in. + /// Gets or sets the OAuth 1.0a consumer key of the Twitter application + /// used for sign-in. /// This setting is required for enabling Twitter Sign-In. - /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in /// + [JsonProperty(PropertyName = "properties.twitterConsumerKey")] public string TwitterConsumerKey { get; set; } + /// - /// The OAuth 1.0a consumer secret of the Twitter application used for sign-in. + /// Gets or sets the OAuth 1.0a consumer secret of the Twitter + /// application used for sign-in. /// This setting is required for enabling Twitter Sign-In. - /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in /// + [JsonProperty(PropertyName = "properties.twitterConsumerSecret")] public string TwitterConsumerSecret { get; set; } + /// - /// The app setting name that contains the OAuth 1.0a consumer secret of the Twitter + /// Gets or sets the app setting name that contains the OAuth 1.0a + /// consumer secret of the Twitter /// application used for sign-in. /// + [JsonProperty(PropertyName = "properties.twitterConsumerSecretSettingName")] public string TwitterConsumerSecretSettingName { get; set; } + /// - /// The OAuth 2.0 client ID that was created for the app used for authentication. - /// This setting is required for enabling Microsoft Account authentication. - /// Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + /// Gets or sets the OAuth 2.0 client ID that was created for the app + /// used for authentication. + /// This setting is required for enabling Microsoft Account + /// authentication. + /// Microsoft Account OAuth documentation: + /// https://dev.onedrive.com/auth/msa_oauth.htm /// + [JsonProperty(PropertyName = "properties.microsoftAccountClientId")] public string MicrosoftAccountClientId { get; set; } + /// - /// The OAuth 2.0 client secret that was created for the app used for authentication. - /// This setting is required for enabling Microsoft Account authentication. - /// Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + /// Gets or sets the OAuth 2.0 client secret that was created for the + /// app used for authentication. + /// This setting is required for enabling Microsoft Account + /// authentication. + /// Microsoft Account OAuth documentation: + /// https://dev.onedrive.com/auth/msa_oauth.htm /// + [JsonProperty(PropertyName = "properties.microsoftAccountClientSecret")] public string MicrosoftAccountClientSecret { get; set; } + /// - /// The app setting name containing the OAuth 2.0 client secret that was created for the + /// Gets or sets the app setting name containing the OAuth 2.0 client + /// secret that was created for the /// app used for authentication. /// + [JsonProperty(PropertyName = "properties.microsoftAccountClientSecretSettingName")] public string MicrosoftAccountClientSecretSettingName { get; set; } + /// - /// The OAuth 2.0 scopes that will be requested as part of Microsoft Account authentication. - /// This setting is optional. If not specified, "wl.basic" is used as the default scope. - /// Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en-us/library/dn631845.aspx. + /// Gets or sets the OAuth 2.0 scopes that will be requested as part of + /// Microsoft Account authentication. + /// This setting is optional. If not specified, "wl.basic" is used as + /// the default scope. + /// Microsoft Account Scopes and permissions documentation: + /// https://msdn.microsoft.com/en-us/library/dn631845.aspx /// - public IList MicrosoftAccountOAuthScopes { get; } + [JsonProperty(PropertyName = "properties.microsoftAccountOAuthScopes")] + public IList MicrosoftAccountOAuthScopes { get; set; } + /// - /// "true" if the auth config settings should be read from a file, - /// "false" otherwise. + /// Gets or sets "true" if the auth config settings should be read from + /// a file, + /// "false" otherwise /// + [JsonProperty(PropertyName = "properties.isAuthFromFile")] public string IsAuthFromFile { get; set; } + /// - /// The path of the config file containing auth settings. - /// If the path is relative, base will the site's root directory. + /// Gets or sets the path of the config file containing auth settings. + /// If the path is relative, base will the site's root directory. /// + [JsonProperty(PropertyName = "properties.authFilePath")] public string AuthFilePath { get; set; } - /// - /// The ConfigVersion of the Authentication / Authorization feature in use for the current app. - /// The setting in this value can control the behavior of the control plane for Authentication / Authorization. - /// - public string ConfigVersion { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.Serialization.cs deleted file mode 100644 index d22c8503d8a9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.Serialization.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteAuthSettingsV2 : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Platform)) - { - writer.WritePropertyName("platform"); - writer.WriteObjectValue(Platform); - } - if (Optional.IsDefined(GlobalValidation)) - { - writer.WritePropertyName("globalValidation"); - writer.WriteObjectValue(GlobalValidation); - } - if (Optional.IsDefined(IdentityProviders)) - { - writer.WritePropertyName("identityProviders"); - writer.WriteObjectValue(IdentityProviders); - } - if (Optional.IsDefined(Login)) - { - writer.WritePropertyName("login"); - writer.WriteObjectValue(Login); - } - if (Optional.IsDefined(HttpSettings)) - { - writer.WritePropertyName("httpSettings"); - writer.WriteObjectValue(HttpSettings); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SiteAuthSettingsV2 DeserializeSiteAuthSettingsV2(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional platform = default; - Optional globalValidation = default; - Optional identityProviders = default; - Optional login = default; - Optional httpSettings = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("platform")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - platform = AuthPlatform.DeserializeAuthPlatform(property0.Value); - continue; - } - if (property0.NameEquals("globalValidation")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - globalValidation = GlobalValidation.DeserializeGlobalValidation(property0.Value); - continue; - } - if (property0.NameEquals("identityProviders")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - identityProviders = IdentityProviders.DeserializeIdentityProviders(property0.Value); - continue; - } - if (property0.NameEquals("login")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - login = Login.DeserializeLogin(property0.Value); - continue; - } - if (property0.NameEquals("httpSettings")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - httpSettings = HttpSettings.DeserializeHttpSettings(property0.Value); - continue; - } - } - continue; - } - } - return new SiteAuthSettingsV2(id.Value, name.Value, kind.Value, type.Value, platform.Value, globalValidation.Value, identityProviders.Value, login.Value, httpSettings.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.cs index 60c545410612..5a587a3976c4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.cs @@ -1,48 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Configuration settings for the Azure App Service Authentication / Authorization V2 feature. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class SiteAuthSettingsV2 : ProxyOnlyResource { - /// Initializes a new instance of SiteAuthSettingsV2. + /// + /// Initializes a new instance of the SiteAuthSettingsV2 class. + /// public SiteAuthSettingsV2() { + CustomInit(); } - /// Initializes a new instance of SiteAuthSettingsV2. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The configuration settings of the platform of App Service Authentication/Authorization. - /// The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. - /// The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. - /// The configuration settings of the login flow of users using App Service Authentication/Authorization. - /// The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. - internal SiteAuthSettingsV2(string id, string name, string kind, string type, AuthPlatform platform, GlobalValidation globalValidation, IdentityProviders identityProviders, Login login, HttpSettings httpSettings) : base(id, name, kind, type) + /// + /// Initializes a new instance of the SiteAuthSettingsV2 class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public SiteAuthSettingsV2(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), AuthPlatform platform = default(AuthPlatform), GlobalValidation globalValidation = default(GlobalValidation), IdentityProviders identityProviders = default(IdentityProviders), Login login = default(Login), HttpSettings httpSettings = default(HttpSettings)) + : base(id, name, kind, type) { Platform = platform; GlobalValidation = globalValidation; IdentityProviders = identityProviders; Login = login; HttpSettings = httpSettings; + CustomInit(); } - /// The configuration settings of the platform of App Service Authentication/Authorization. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.platform")] public AuthPlatform Platform { get; set; } - /// The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. + + /// + /// + [JsonProperty(PropertyName = "properties.globalValidation")] public GlobalValidation GlobalValidation { get; set; } - /// The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. + + /// + /// + [JsonProperty(PropertyName = "properties.identityProviders")] public IdentityProviders IdentityProviders { get; set; } - /// The configuration settings of the login flow of users using App Service Authentication/Authorization. + + /// + /// + [JsonProperty(PropertyName = "properties.login")] public Login Login { get; set; } - /// The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. + + /// + /// + [JsonProperty(PropertyName = "properties.httpSettings")] public HttpSettings HttpSettings { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.Serialization.cs deleted file mode 100644 index 37a381d67c3a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class SiteAvailabilityStateExtensions - { - public static string ToSerialString(this SiteAvailabilityState value) => value switch - { - SiteAvailabilityState.Normal => "Normal", - SiteAvailabilityState.Limited => "Limited", - SiteAvailabilityState.DisasterRecoveryMode => "DisasterRecoveryMode", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteAvailabilityState value.") - }; - - public static SiteAvailabilityState ToSiteAvailabilityState(this string value) - { - if (string.Equals(value, "Normal", StringComparison.InvariantCultureIgnoreCase)) return SiteAvailabilityState.Normal; - if (string.Equals(value, "Limited", StringComparison.InvariantCultureIgnoreCase)) return SiteAvailabilityState.Limited; - if (string.Equals(value, "DisasterRecoveryMode", StringComparison.InvariantCultureIgnoreCase)) return SiteAvailabilityState.DisasterRecoveryMode; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteAvailabilityState value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.cs index 6518e2769952..022c239de27e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAvailabilityState.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Management information availability state for the app. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SiteAvailabilityState. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum SiteAvailabilityState { - /// Normal. + [EnumMember(Value = "Normal")] Normal, - /// Limited. + [EnumMember(Value = "Limited")] Limited, - /// DisasterRecoveryMode. + [EnumMember(Value = "DisasterRecoveryMode")] DisasterRecoveryMode } + internal static class SiteAvailabilityStateEnumExtension + { + internal static string ToSerializedValue(this SiteAvailabilityState? value) + { + return value == null ? null : ((SiteAvailabilityState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SiteAvailabilityState value) + { + switch( value ) + { + case SiteAvailabilityState.Normal: + return "Normal"; + case SiteAvailabilityState.Limited: + return "Limited"; + case SiteAvailabilityState.DisasterRecoveryMode: + return "DisasterRecoveryMode"; + } + return null; + } + + internal static SiteAvailabilityState? ParseSiteAvailabilityState(this string value) + { + switch( value ) + { + case "Normal": + return SiteAvailabilityState.Normal; + case "Limited": + return SiteAvailabilityState.Limited; + case "DisasterRecoveryMode": + return SiteAvailabilityState.DisasterRecoveryMode; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.Serialization.cs deleted file mode 100644 index 4f3b63a5a05d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.Serialization.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteCloneability - { - internal static SiteCloneability DeserializeSiteCloneability(JsonElement element) - { - Optional result = default; - Optional> blockingFeatures = default; - Optional> unsupportedFeatures = default; - Optional> blockingCharacteristics = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("result")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - result = property.Value.GetString().ToCloneAbilityResult(); - continue; - } - if (property.NameEquals("blockingFeatures")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SiteCloneabilityCriterion.DeserializeSiteCloneabilityCriterion(item)); - } - blockingFeatures = array; - continue; - } - if (property.NameEquals("unsupportedFeatures")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SiteCloneabilityCriterion.DeserializeSiteCloneabilityCriterion(item)); - } - unsupportedFeatures = array; - continue; - } - if (property.NameEquals("blockingCharacteristics")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SiteCloneabilityCriterion.DeserializeSiteCloneabilityCriterion(item)); - } - blockingCharacteristics = array; - continue; - } - } - return new SiteCloneability(Optional.ToNullable(result), Optional.ToList(blockingFeatures), Optional.ToList(unsupportedFeatures), Optional.ToList(blockingCharacteristics)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.cs index a67bde43077c..aceacabea031 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneability.cs @@ -1,52 +1,87 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Represents whether or not an app is cloneable. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents whether or not an app is cloneable. + /// public partial class SiteCloneability { - /// Initializes a new instance of SiteCloneability. - internal SiteCloneability() + /// + /// Initializes a new instance of the SiteCloneability class. + /// + public SiteCloneability() { - BlockingFeatures = new ChangeTrackingList(); - UnsupportedFeatures = new ChangeTrackingList(); - BlockingCharacteristics = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of SiteCloneability. - /// Name of app. - /// List of features enabled on app that prevent cloning. - /// - /// List of features enabled on app that are non-blocking but cannot be cloned. The app can still be cloned - /// but the features in this list will not be set up on cloned app. - /// - /// List of blocking application characteristics. - internal SiteCloneability(CloneAbilityResult? result, IReadOnlyList blockingFeatures, IReadOnlyList unsupportedFeatures, IReadOnlyList blockingCharacteristics) + /// + /// Initializes a new instance of the SiteCloneability class. + /// + /// Name of app. Possible values include: + /// 'Cloneable', 'PartiallyCloneable', 'NotCloneable' + /// List of features enabled on app that + /// prevent cloning. + /// List of features enabled on app + /// that are non-blocking but cannot be cloned. The app can still be + /// cloned + /// but the features in this list will not be set up on cloned + /// app. + /// List of blocking application + /// characteristics. + public SiteCloneability(CloneAbilityResult? result = default(CloneAbilityResult?), IList blockingFeatures = default(IList), IList unsupportedFeatures = default(IList), IList blockingCharacteristics = default(IList)) { Result = result; BlockingFeatures = blockingFeatures; UnsupportedFeatures = unsupportedFeatures; BlockingCharacteristics = blockingCharacteristics; + CustomInit(); } - /// Name of app. - public CloneAbilityResult? Result { get; } - /// List of features enabled on app that prevent cloning. - public IReadOnlyList BlockingFeatures { get; } /// - /// List of features enabled on app that are non-blocking but cannot be cloned. The app can still be cloned + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of app. Possible values include: 'Cloneable', + /// 'PartiallyCloneable', 'NotCloneable' + /// + [JsonProperty(PropertyName = "result")] + public CloneAbilityResult? Result { get; set; } + + /// + /// Gets or sets list of features enabled on app that prevent cloning. + /// + [JsonProperty(PropertyName = "blockingFeatures")] + public IList BlockingFeatures { get; set; } + + /// + /// Gets or sets list of features enabled on app that are non-blocking + /// but cannot be cloned. The app can still be cloned /// but the features in this list will not be set up on cloned app. /// - public IReadOnlyList UnsupportedFeatures { get; } - /// List of blocking application characteristics. - public IReadOnlyList BlockingCharacteristics { get; } + [JsonProperty(PropertyName = "unsupportedFeatures")] + public IList UnsupportedFeatures { get; set; } + + /// + /// Gets or sets list of blocking application characteristics. + /// + [JsonProperty(PropertyName = "blockingCharacteristics")] + public IList BlockingCharacteristics { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.Serialization.cs deleted file mode 100644 index 1d912820208b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteCloneabilityCriterion - { - internal static SiteCloneabilityCriterion DeserializeSiteCloneabilityCriterion(JsonElement element) - { - Optional name = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("description")) - { - description = property.Value.GetString(); - continue; - } - } - return new SiteCloneabilityCriterion(name.Value, description.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.cs index ced08085b3d6..eab80a8c1a0c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteCloneabilityCriterion.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// An app cloneability criterion. + using Newtonsoft.Json; + using System.Linq; + + /// + /// An app cloneability criterion. + /// public partial class SiteCloneabilityCriterion { - /// Initializes a new instance of SiteCloneabilityCriterion. - internal SiteCloneabilityCriterion() + /// + /// Initializes a new instance of the SiteCloneabilityCriterion class. + /// + public SiteCloneabilityCriterion() { + CustomInit(); } - /// Initializes a new instance of SiteCloneabilityCriterion. - /// Name of criterion. - /// Description of criterion. - internal SiteCloneabilityCriterion(string name, string description) + /// + /// Initializes a new instance of the SiteCloneabilityCriterion class. + /// + /// Name of criterion. + /// Description of criterion. + public SiteCloneabilityCriterion(string name = default(string), string description = default(string)) { Name = name; Description = description; + CustomInit(); } - /// Name of criterion. - public string Name { get; } - /// Description of criterion. - public string Description { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of criterion. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets description of criterion. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.Serialization.cs deleted file mode 100644 index c895aa768bb8..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.Serialization.cs +++ /dev/null @@ -1,1042 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteConfig : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(NumberOfWorkers)) - { - writer.WritePropertyName("numberOfWorkers"); - writer.WriteNumberValue(NumberOfWorkers.Value); - } - if (Optional.IsCollectionDefined(DefaultDocuments)) - { - writer.WritePropertyName("defaultDocuments"); - writer.WriteStartArray(); - foreach (var item in DefaultDocuments) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NetFrameworkVersion)) - { - writer.WritePropertyName("netFrameworkVersion"); - writer.WriteStringValue(NetFrameworkVersion); - } - if (Optional.IsDefined(PhpVersion)) - { - writer.WritePropertyName("phpVersion"); - writer.WriteStringValue(PhpVersion); - } - if (Optional.IsDefined(PythonVersion)) - { - writer.WritePropertyName("pythonVersion"); - writer.WriteStringValue(PythonVersion); - } - if (Optional.IsDefined(NodeVersion)) - { - writer.WritePropertyName("nodeVersion"); - writer.WriteStringValue(NodeVersion); - } - if (Optional.IsDefined(PowerShellVersion)) - { - writer.WritePropertyName("powerShellVersion"); - writer.WriteStringValue(PowerShellVersion); - } - if (Optional.IsDefined(LinuxFxVersion)) - { - writer.WritePropertyName("linuxFxVersion"); - writer.WriteStringValue(LinuxFxVersion); - } - if (Optional.IsDefined(WindowsFxVersion)) - { - writer.WritePropertyName("windowsFxVersion"); - writer.WriteStringValue(WindowsFxVersion); - } - if (Optional.IsDefined(RequestTracingEnabled)) - { - writer.WritePropertyName("requestTracingEnabled"); - writer.WriteBooleanValue(RequestTracingEnabled.Value); - } - if (Optional.IsDefined(RequestTracingExpirationTime)) - { - writer.WritePropertyName("requestTracingExpirationTime"); - writer.WriteStringValue(RequestTracingExpirationTime.Value, "O"); - } - if (Optional.IsDefined(RemoteDebuggingEnabled)) - { - writer.WritePropertyName("remoteDebuggingEnabled"); - writer.WriteBooleanValue(RemoteDebuggingEnabled.Value); - } - if (Optional.IsDefined(RemoteDebuggingVersion)) - { - writer.WritePropertyName("remoteDebuggingVersion"); - writer.WriteStringValue(RemoteDebuggingVersion); - } - if (Optional.IsDefined(HttpLoggingEnabled)) - { - writer.WritePropertyName("httpLoggingEnabled"); - writer.WriteBooleanValue(HttpLoggingEnabled.Value); - } - if (Optional.IsDefined(LogsDirectorySizeLimit)) - { - writer.WritePropertyName("logsDirectorySizeLimit"); - writer.WriteNumberValue(LogsDirectorySizeLimit.Value); - } - if (Optional.IsDefined(DetailedErrorLoggingEnabled)) - { - writer.WritePropertyName("detailedErrorLoggingEnabled"); - writer.WriteBooleanValue(DetailedErrorLoggingEnabled.Value); - } - if (Optional.IsDefined(PublishingUsername)) - { - writer.WritePropertyName("publishingUsername"); - writer.WriteStringValue(PublishingUsername); - } - if (Optional.IsCollectionDefined(AppSettings)) - { - writer.WritePropertyName("appSettings"); - writer.WriteStartArray(); - foreach (var item in AppSettings) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ConnectionStrings)) - { - writer.WritePropertyName("connectionStrings"); - writer.WriteStartArray(); - foreach (var item in ConnectionStrings) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(HandlerMappings)) - { - writer.WritePropertyName("handlerMappings"); - writer.WriteStartArray(); - foreach (var item in HandlerMappings) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(DocumentRoot)) - { - writer.WritePropertyName("documentRoot"); - writer.WriteStringValue(DocumentRoot); - } - if (Optional.IsDefined(ScmType)) - { - writer.WritePropertyName("scmType"); - writer.WriteStringValue(ScmType.Value.ToString()); - } - if (Optional.IsDefined(Use32BitWorkerProcess)) - { - writer.WritePropertyName("use32BitWorkerProcess"); - writer.WriteBooleanValue(Use32BitWorkerProcess.Value); - } - if (Optional.IsDefined(WebSocketsEnabled)) - { - writer.WritePropertyName("webSocketsEnabled"); - writer.WriteBooleanValue(WebSocketsEnabled.Value); - } - if (Optional.IsDefined(AlwaysOn)) - { - writer.WritePropertyName("alwaysOn"); - writer.WriteBooleanValue(AlwaysOn.Value); - } - if (Optional.IsDefined(JavaVersion)) - { - writer.WritePropertyName("javaVersion"); - writer.WriteStringValue(JavaVersion); - } - if (Optional.IsDefined(JavaContainer)) - { - writer.WritePropertyName("javaContainer"); - writer.WriteStringValue(JavaContainer); - } - if (Optional.IsDefined(JavaContainerVersion)) - { - writer.WritePropertyName("javaContainerVersion"); - writer.WriteStringValue(JavaContainerVersion); - } - if (Optional.IsDefined(AppCommandLine)) - { - writer.WritePropertyName("appCommandLine"); - writer.WriteStringValue(AppCommandLine); - } - if (Optional.IsDefined(ManagedPipelineMode)) - { - writer.WritePropertyName("managedPipelineMode"); - writer.WriteStringValue(ManagedPipelineMode.Value.ToSerialString()); - } - if (Optional.IsCollectionDefined(VirtualApplications)) - { - writer.WritePropertyName("virtualApplications"); - writer.WriteStartArray(); - foreach (var item in VirtualApplications) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(LoadBalancing)) - { - writer.WritePropertyName("loadBalancing"); - writer.WriteStringValue(LoadBalancing.Value.ToSerialString()); - } - if (Optional.IsDefined(Experiments)) - { - writer.WritePropertyName("experiments"); - writer.WriteObjectValue(Experiments); - } - if (Optional.IsDefined(Limits)) - { - writer.WritePropertyName("limits"); - writer.WriteObjectValue(Limits); - } - if (Optional.IsDefined(AutoHealEnabled)) - { - writer.WritePropertyName("autoHealEnabled"); - writer.WriteBooleanValue(AutoHealEnabled.Value); - } - if (Optional.IsDefined(AutoHealRules)) - { - writer.WritePropertyName("autoHealRules"); - writer.WriteObjectValue(AutoHealRules); - } - if (Optional.IsDefined(TracingOptions)) - { - writer.WritePropertyName("tracingOptions"); - writer.WriteStringValue(TracingOptions); - } - if (Optional.IsDefined(VnetName)) - { - writer.WritePropertyName("vnetName"); - writer.WriteStringValue(VnetName); - } - if (Optional.IsDefined(VnetRouteAllEnabled)) - { - writer.WritePropertyName("vnetRouteAllEnabled"); - writer.WriteBooleanValue(VnetRouteAllEnabled.Value); - } - if (Optional.IsDefined(VnetPrivatePortsCount)) - { - writer.WritePropertyName("vnetPrivatePortsCount"); - writer.WriteNumberValue(VnetPrivatePortsCount.Value); - } - if (Optional.IsDefined(Cors)) - { - writer.WritePropertyName("cors"); - writer.WriteObjectValue(Cors); - } - if (Optional.IsDefined(Push)) - { - writer.WritePropertyName("push"); - writer.WriteObjectValue(Push); - } - if (Optional.IsDefined(ApiDefinition)) - { - writer.WritePropertyName("apiDefinition"); - writer.WriteObjectValue(ApiDefinition); - } - if (Optional.IsDefined(ApiManagementConfig)) - { - writer.WritePropertyName("apiManagementConfig"); - writer.WriteObjectValue(ApiManagementConfig); - } - if (Optional.IsDefined(AutoSwapSlotName)) - { - writer.WritePropertyName("autoSwapSlotName"); - writer.WriteStringValue(AutoSwapSlotName); - } - if (Optional.IsDefined(LocalMySqlEnabled)) - { - writer.WritePropertyName("localMySqlEnabled"); - writer.WriteBooleanValue(LocalMySqlEnabled.Value); - } - if (Optional.IsDefined(ManagedServiceIdentityId)) - { - writer.WritePropertyName("managedServiceIdentityId"); - writer.WriteNumberValue(ManagedServiceIdentityId.Value); - } - if (Optional.IsDefined(XManagedServiceIdentityId)) - { - writer.WritePropertyName("xManagedServiceIdentityId"); - writer.WriteNumberValue(XManagedServiceIdentityId.Value); - } - if (Optional.IsDefined(KeyVaultReferenceIdentity)) - { - writer.WritePropertyName("keyVaultReferenceIdentity"); - writer.WriteStringValue(KeyVaultReferenceIdentity); - } - if (Optional.IsCollectionDefined(IpSecurityRestrictions)) - { - writer.WritePropertyName("ipSecurityRestrictions"); - writer.WriteStartArray(); - foreach (var item in IpSecurityRestrictions) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ScmIpSecurityRestrictions)) - { - writer.WritePropertyName("scmIpSecurityRestrictions"); - writer.WriteStartArray(); - foreach (var item in ScmIpSecurityRestrictions) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ScmIpSecurityRestrictionsUseMain)) - { - writer.WritePropertyName("scmIpSecurityRestrictionsUseMain"); - writer.WriteBooleanValue(ScmIpSecurityRestrictionsUseMain.Value); - } - if (Optional.IsDefined(Http20Enabled)) - { - writer.WritePropertyName("http20Enabled"); - writer.WriteBooleanValue(Http20Enabled.Value); - } - if (Optional.IsDefined(MinTlsVersion)) - { - writer.WritePropertyName("minTlsVersion"); - writer.WriteStringValue(MinTlsVersion.Value.ToString()); - } - if (Optional.IsDefined(ScmMinTlsVersion)) - { - writer.WritePropertyName("scmMinTlsVersion"); - writer.WriteStringValue(ScmMinTlsVersion.Value.ToString()); - } - if (Optional.IsDefined(FtpsState)) - { - writer.WritePropertyName("ftpsState"); - writer.WriteStringValue(FtpsState.Value.ToString()); - } - if (Optional.IsDefined(PreWarmedInstanceCount)) - { - writer.WritePropertyName("preWarmedInstanceCount"); - writer.WriteNumberValue(PreWarmedInstanceCount.Value); - } - if (Optional.IsDefined(FunctionAppScaleLimit)) - { - writer.WritePropertyName("functionAppScaleLimit"); - writer.WriteNumberValue(FunctionAppScaleLimit.Value); - } - if (Optional.IsDefined(HealthCheckPath)) - { - writer.WritePropertyName("healthCheckPath"); - writer.WriteStringValue(HealthCheckPath); - } - if (Optional.IsDefined(FunctionsRuntimeScaleMonitoringEnabled)) - { - writer.WritePropertyName("functionsRuntimeScaleMonitoringEnabled"); - writer.WriteBooleanValue(FunctionsRuntimeScaleMonitoringEnabled.Value); - } - if (Optional.IsDefined(WebsiteTimeZone)) - { - writer.WritePropertyName("websiteTimeZone"); - writer.WriteStringValue(WebsiteTimeZone); - } - if (Optional.IsDefined(MinimumElasticInstanceCount)) - { - writer.WritePropertyName("minimumElasticInstanceCount"); - writer.WriteNumberValue(MinimumElasticInstanceCount.Value); - } - if (Optional.IsCollectionDefined(AzureStorageAccounts)) - { - writer.WritePropertyName("azureStorageAccounts"); - writer.WriteStartObject(); - foreach (var item in AzureStorageAccounts) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(PublicNetworkAccess)) - { - writer.WritePropertyName("publicNetworkAccess"); - writer.WriteStringValue(PublicNetworkAccess); - } - writer.WriteEndObject(); - } - - internal static SiteConfig DeserializeSiteConfig(JsonElement element) - { - Optional numberOfWorkers = default; - Optional> defaultDocuments = default; - Optional netFrameworkVersion = default; - Optional phpVersion = default; - Optional pythonVersion = default; - Optional nodeVersion = default; - Optional powerShellVersion = default; - Optional linuxFxVersion = default; - Optional windowsFxVersion = default; - Optional requestTracingEnabled = default; - Optional requestTracingExpirationTime = default; - Optional remoteDebuggingEnabled = default; - Optional remoteDebuggingVersion = default; - Optional httpLoggingEnabled = default; - Optional logsDirectorySizeLimit = default; - Optional detailedErrorLoggingEnabled = default; - Optional publishingUsername = default; - Optional> appSettings = default; - Optional> connectionStrings = default; - Optional machineKey = default; - Optional> handlerMappings = default; - Optional documentRoot = default; - Optional scmType = default; - Optional use32BitWorkerProcess = default; - Optional webSocketsEnabled = default; - Optional alwaysOn = default; - Optional javaVersion = default; - Optional javaContainer = default; - Optional javaContainerVersion = default; - Optional appCommandLine = default; - Optional managedPipelineMode = default; - Optional> virtualApplications = default; - Optional loadBalancing = default; - Optional experiments = default; - Optional limits = default; - Optional autoHealEnabled = default; - Optional autoHealRules = default; - Optional tracingOptions = default; - Optional vnetName = default; - Optional vnetRouteAllEnabled = default; - Optional vnetPrivatePortsCount = default; - Optional cors = default; - Optional push = default; - Optional apiDefinition = default; - Optional apiManagementConfig = default; - Optional autoSwapSlotName = default; - Optional localMySqlEnabled = default; - Optional managedServiceIdentityId = default; - Optional xManagedServiceIdentityId = default; - Optional keyVaultReferenceIdentity = default; - Optional> ipSecurityRestrictions = default; - Optional> scmIpSecurityRestrictions = default; - Optional scmIpSecurityRestrictionsUseMain = default; - Optional http20Enabled = default; - Optional minTlsVersion = default; - Optional scmMinTlsVersion = default; - Optional ftpsState = default; - Optional preWarmedInstanceCount = default; - Optional functionAppScaleLimit = default; - Optional healthCheckPath = default; - Optional functionsRuntimeScaleMonitoringEnabled = default; - Optional websiteTimeZone = default; - Optional minimumElasticInstanceCount = default; - Optional> azureStorageAccounts = default; - Optional publicNetworkAccess = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("numberOfWorkers")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - numberOfWorkers = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("defaultDocuments")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - defaultDocuments = array; - continue; - } - if (property.NameEquals("netFrameworkVersion")) - { - netFrameworkVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("phpVersion")) - { - phpVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("pythonVersion")) - { - pythonVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("nodeVersion")) - { - nodeVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("powerShellVersion")) - { - powerShellVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("linuxFxVersion")) - { - linuxFxVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("windowsFxVersion")) - { - windowsFxVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("requestTracingEnabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - requestTracingEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("requestTracingExpirationTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - requestTracingExpirationTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("remoteDebuggingEnabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - remoteDebuggingEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("remoteDebuggingVersion")) - { - remoteDebuggingVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("httpLoggingEnabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - httpLoggingEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("logsDirectorySizeLimit")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - logsDirectorySizeLimit = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("detailedErrorLoggingEnabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - detailedErrorLoggingEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("publishingUsername")) - { - publishingUsername = property.Value.GetString(); - continue; - } - if (property.NameEquals("appSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NameValuePair.DeserializeNameValuePair(item)); - } - appSettings = array; - continue; - } - if (property.NameEquals("connectionStrings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ConnStringInfo.DeserializeConnStringInfo(item)); - } - connectionStrings = array; - continue; - } - if (property.NameEquals("machineKey")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - machineKey = SiteMachineKey.DeserializeSiteMachineKey(property.Value); - continue; - } - if (property.NameEquals("handlerMappings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(HandlerMapping.DeserializeHandlerMapping(item)); - } - handlerMappings = array; - continue; - } - if (property.NameEquals("documentRoot")) - { - documentRoot = property.Value.GetString(); - continue; - } - if (property.NameEquals("scmType")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - scmType = new ScmType(property.Value.GetString()); - continue; - } - if (property.NameEquals("use32BitWorkerProcess")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - use32BitWorkerProcess = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("webSocketsEnabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - webSocketsEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("alwaysOn")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - alwaysOn = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("javaVersion")) - { - javaVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("javaContainer")) - { - javaContainer = property.Value.GetString(); - continue; - } - if (property.NameEquals("javaContainerVersion")) - { - javaContainerVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("appCommandLine")) - { - appCommandLine = property.Value.GetString(); - continue; - } - if (property.NameEquals("managedPipelineMode")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - managedPipelineMode = property.Value.GetString().ToManagedPipelineMode(); - continue; - } - if (property.NameEquals("virtualApplications")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(VirtualApplication.DeserializeVirtualApplication(item)); - } - virtualApplications = array; - continue; - } - if (property.NameEquals("loadBalancing")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - loadBalancing = property.Value.GetString().ToSiteLoadBalancing(); - continue; - } - if (property.NameEquals("experiments")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - experiments = Experiments.DeserializeExperiments(property.Value); - continue; - } - if (property.NameEquals("limits")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - limits = SiteLimits.DeserializeSiteLimits(property.Value); - continue; - } - if (property.NameEquals("autoHealEnabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - autoHealEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("autoHealRules")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - autoHealRules = AutoHealRules.DeserializeAutoHealRules(property.Value); - continue; - } - if (property.NameEquals("tracingOptions")) - { - tracingOptions = property.Value.GetString(); - continue; - } - if (property.NameEquals("vnetName")) - { - vnetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("vnetRouteAllEnabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - vnetRouteAllEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("vnetPrivatePortsCount")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - vnetPrivatePortsCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("cors")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - cors = CorsSettings.DeserializeCorsSettings(property.Value); - continue; - } - if (property.NameEquals("push")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - push = PushSettings.DeserializePushSettings(property.Value); - continue; - } - if (property.NameEquals("apiDefinition")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - apiDefinition = ApiDefinitionInfo.DeserializeApiDefinitionInfo(property.Value); - continue; - } - if (property.NameEquals("apiManagementConfig")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - apiManagementConfig = ApiManagementConfig.DeserializeApiManagementConfig(property.Value); - continue; - } - if (property.NameEquals("autoSwapSlotName")) - { - autoSwapSlotName = property.Value.GetString(); - continue; - } - if (property.NameEquals("localMySqlEnabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - localMySqlEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("managedServiceIdentityId")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - managedServiceIdentityId = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("xManagedServiceIdentityId")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - xManagedServiceIdentityId = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("keyVaultReferenceIdentity")) - { - keyVaultReferenceIdentity = property.Value.GetString(); - continue; - } - if (property.NameEquals("ipSecurityRestrictions")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(IpSecurityRestriction.DeserializeIpSecurityRestriction(item)); - } - ipSecurityRestrictions = array; - continue; - } - if (property.NameEquals("scmIpSecurityRestrictions")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(IpSecurityRestriction.DeserializeIpSecurityRestriction(item)); - } - scmIpSecurityRestrictions = array; - continue; - } - if (property.NameEquals("scmIpSecurityRestrictionsUseMain")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - scmIpSecurityRestrictionsUseMain = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("http20Enabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - http20Enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("minTlsVersion")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - minTlsVersion = new SupportedTlsVersions(property.Value.GetString()); - continue; - } - if (property.NameEquals("scmMinTlsVersion")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - scmMinTlsVersion = new SupportedTlsVersions(property.Value.GetString()); - continue; - } - if (property.NameEquals("ftpsState")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - ftpsState = new FtpsState(property.Value.GetString()); - continue; - } - if (property.NameEquals("preWarmedInstanceCount")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - preWarmedInstanceCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("functionAppScaleLimit")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - functionAppScaleLimit = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("healthCheckPath")) - { - healthCheckPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("functionsRuntimeScaleMonitoringEnabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - functionsRuntimeScaleMonitoringEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("websiteTimeZone")) - { - websiteTimeZone = property.Value.GetString(); - continue; - } - if (property.NameEquals("minimumElasticInstanceCount")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - minimumElasticInstanceCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("azureStorageAccounts")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, AzureStorageInfoValue.DeserializeAzureStorageInfoValue(property0.Value)); - } - azureStorageAccounts = dictionary; - continue; - } - if (property.NameEquals("publicNetworkAccess")) - { - publicNetworkAccess = property.Value.GetString(); - continue; - } - } - return new SiteConfig(Optional.ToNullable(numberOfWorkers), Optional.ToList(defaultDocuments), netFrameworkVersion.Value, phpVersion.Value, pythonVersion.Value, nodeVersion.Value, powerShellVersion.Value, linuxFxVersion.Value, windowsFxVersion.Value, Optional.ToNullable(requestTracingEnabled), Optional.ToNullable(requestTracingExpirationTime), Optional.ToNullable(remoteDebuggingEnabled), remoteDebuggingVersion.Value, Optional.ToNullable(httpLoggingEnabled), Optional.ToNullable(logsDirectorySizeLimit), Optional.ToNullable(detailedErrorLoggingEnabled), publishingUsername.Value, Optional.ToList(appSettings), Optional.ToList(connectionStrings), machineKey.Value, Optional.ToList(handlerMappings), documentRoot.Value, Optional.ToNullable(scmType), Optional.ToNullable(use32BitWorkerProcess), Optional.ToNullable(webSocketsEnabled), Optional.ToNullable(alwaysOn), javaVersion.Value, javaContainer.Value, javaContainerVersion.Value, appCommandLine.Value, Optional.ToNullable(managedPipelineMode), Optional.ToList(virtualApplications), Optional.ToNullable(loadBalancing), experiments.Value, limits.Value, Optional.ToNullable(autoHealEnabled), autoHealRules.Value, tracingOptions.Value, vnetName.Value, Optional.ToNullable(vnetRouteAllEnabled), Optional.ToNullable(vnetPrivatePortsCount), cors.Value, push.Value, apiDefinition.Value, apiManagementConfig.Value, autoSwapSlotName.Value, Optional.ToNullable(localMySqlEnabled), Optional.ToNullable(managedServiceIdentityId), Optional.ToNullable(xManagedServiceIdentityId), keyVaultReferenceIdentity.Value, Optional.ToList(ipSecurityRestrictions), Optional.ToList(scmIpSecurityRestrictions), Optional.ToNullable(scmIpSecurityRestrictionsUseMain), Optional.ToNullable(http20Enabled), Optional.ToNullable(minTlsVersion), Optional.ToNullable(scmMinTlsVersion), Optional.ToNullable(ftpsState), Optional.ToNullable(preWarmedInstanceCount), Optional.ToNullable(functionAppScaleLimit), healthCheckPath.Value, Optional.ToNullable(functionsRuntimeScaleMonitoringEnabled), websiteTimeZone.Value, Optional.ToNullable(minimumElasticInstanceCount), Optional.ToDictionary(azureStorageAccounts), publicNetworkAccess.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs index 89c4ac9f7114..09a72225be37 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs @@ -1,112 +1,136 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Configuration of an App Service app. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Configuration of an App Service app. + /// public partial class SiteConfig { - /// Initializes a new instance of SiteConfig. + /// + /// Initializes a new instance of the SiteConfig class. + /// public SiteConfig() { - DefaultDocuments = new ChangeTrackingList(); - AppSettings = new ChangeTrackingList(); - ConnectionStrings = new ChangeTrackingList(); - HandlerMappings = new ChangeTrackingList(); - VirtualApplications = new ChangeTrackingList(); - IpSecurityRestrictions = new ChangeTrackingList(); - ScmIpSecurityRestrictions = new ChangeTrackingList(); - AzureStorageAccounts = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of SiteConfig. - /// Number of workers. - /// Default documents. - /// .NET Framework version. - /// Version of PHP. - /// Version of Python. - /// Version of Node.js. - /// Version of PowerShell. - /// Linux App Framework and version. - /// Xenon App Framework and version. - /// <code>true</code> if request tracing is enabled; otherwise, <code>false</code>. - /// Request tracing expiration time. - /// <code>true</code> if remote debugging is enabled; otherwise, <code>false</code>. - /// Remote debugging version. - /// <code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>. - /// HTTP logs directory size limit. - /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. - /// Publishing user name. - /// Application settings. - /// Connection strings. - /// Site MachineKey. - /// Handler mappings. - /// Document root. - /// SCM type. - /// <code>true</code> to use 32-bit worker process; otherwise, <code>false</code>. - /// <code>true</code> if WebSocket is enabled; otherwise, <code>false</code>. - /// <code>true</code> if Always On is enabled; otherwise, <code>false</code>. - /// Java version. - /// Java container. - /// Java container version. - /// App command line to launch. - /// Managed pipeline mode. - /// Virtual applications. - /// Site load balancing. - /// This is work around for polymorphic types. - /// Site limits. - /// <code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>. - /// Auto Heal rules. - /// Tracing options. - /// Virtual Network name. - /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. - /// The number of private ports assigned to this app. These will be assigned dynamically on runtime. - /// Cross-Origin Resource Sharing (CORS) settings. - /// Push endpoint settings. - /// Information about the formal API definition for the app. - /// Azure API management settings linked to the app. - /// Auto-swap slot name. - /// <code>true</code> to enable local MySQL; otherwise, <code>false</code>. - /// Managed Service Identity Id. - /// Explicit Managed Service Identity Id. - /// Identity to use for Key Vault Reference authentication. - /// IP security restrictions for main. - /// IP security restrictions for scm. - /// IP security restrictions for scm to use main. - /// Http20Enabled: configures a web site to allow clients to connect over http2.0. - /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. - /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. - /// State of FTP / FTPS service. - /// - /// Number of preWarmed instances. - /// This setting only applies to the Consumption and Elastic Plans. - /// - /// - /// Maximum number of workers that a site can scale out to. - /// This setting only applies to the Consumption and Elastic Premium Plans. - /// - /// Health check path. - /// - /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, - /// the ScaleController will not monitor event sources directly, but will instead call to the - /// runtime to get scale status. - /// - /// Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. - /// - /// Number of minimum instance count for a site - /// This setting only applies to the Elastic Plans. - /// - /// List of Azure Storage Accounts. - /// Property to allow or block all public traffic. - internal SiteConfig(int? numberOfWorkers, IList defaultDocuments, string netFrameworkVersion, string phpVersion, string pythonVersion, string nodeVersion, string powerShellVersion, string linuxFxVersion, string windowsFxVersion, bool? requestTracingEnabled, DateTimeOffset? requestTracingExpirationTime, bool? remoteDebuggingEnabled, string remoteDebuggingVersion, bool? httpLoggingEnabled, int? logsDirectorySizeLimit, bool? detailedErrorLoggingEnabled, string publishingUsername, IList appSettings, IList connectionStrings, SiteMachineKey machineKey, IList handlerMappings, string documentRoot, ScmType? scmType, bool? use32BitWorkerProcess, bool? webSocketsEnabled, bool? alwaysOn, string javaVersion, string javaContainer, string javaContainerVersion, string appCommandLine, ManagedPipelineMode? managedPipelineMode, IList virtualApplications, SiteLoadBalancing? loadBalancing, Experiments experiments, SiteLimits limits, bool? autoHealEnabled, AutoHealRules autoHealRules, string tracingOptions, string vnetName, bool? vnetRouteAllEnabled, int? vnetPrivatePortsCount, CorsSettings cors, PushSettings push, ApiDefinitionInfo apiDefinition, ApiManagementConfig apiManagementConfig, string autoSwapSlotName, bool? localMySqlEnabled, int? managedServiceIdentityId, int? xManagedServiceIdentityId, string keyVaultReferenceIdentity, IList ipSecurityRestrictions, IList scmIpSecurityRestrictions, bool? scmIpSecurityRestrictionsUseMain, bool? http20Enabled, SupportedTlsVersions? minTlsVersion, SupportedTlsVersions? scmMinTlsVersion, FtpsState? ftpsState, int? preWarmedInstanceCount, int? functionAppScaleLimit, string healthCheckPath, bool? functionsRuntimeScaleMonitoringEnabled, string websiteTimeZone, int? minimumElasticInstanceCount, IDictionary azureStorageAccounts, string publicNetworkAccess) + /// + /// Initializes a new instance of the SiteConfig class. + /// + /// Number of workers. + /// Default documents. + /// .NET Framework version. + /// Version of PHP. + /// Version of Python. + /// Version of Node.js. + /// Version of PowerShell. + /// Linux App Framework and + /// version + /// Xenon App Framework and + /// version + /// <code>true</code> + /// if request tracing is enabled; otherwise, + /// <code>false</code>. + /// Request tracing + /// expiration time. + /// <code>true</code> + /// if remote debugging is enabled; otherwise, + /// <code>false</code>. + /// Remote debugging + /// version. + /// <code>true</code> if + /// HTTP logging is enabled; otherwise, + /// <code>false</code>. + /// HTTP logs directory size + /// limit. + /// <code>true</code> if + /// detailed error logging is enabled; otherwise, + /// <code>false</code>. + /// Publishing user name. + /// Application settings. + /// Connection strings. + /// Site MachineKey. + /// Handler mappings. + /// Document root. + /// SCM type. Possible values include: 'None', + /// 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + /// 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', + /// 'ExternalHg', 'OneDrive', 'VSO', 'VSTSRM' + /// <code>true</code> + /// to use 32-bit worker process; otherwise, + /// <code>false</code>. + /// <code>true</code> if + /// WebSocket is enabled; otherwise, + /// <code>false</code>. + /// <code>true</code> if Always On + /// is enabled; otherwise, <code>false</code>. + /// Java version. + /// Java container. + /// Java container version. + /// App command line to launch. + /// Managed pipeline mode. Possible + /// values include: 'Integrated', 'Classic' + /// Virtual applications. + /// Site load balancing. Possible values + /// include: 'WeightedRoundRobin', 'LeastRequests', + /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + /// This is work around for polymorphic + /// types. + /// Site limits. + /// <code>true</code> if Auto + /// Heal is enabled; otherwise, <code>false</code>. + /// Auto Heal rules. + /// Tracing options. + /// Virtual Network name. + /// Cross-Origin Resource Sharing (CORS) + /// settings. + /// Push endpoint settings. + /// Information about the formal API + /// definition for the app. + /// Azure API management settings + /// linked to the app. + /// Auto-swap slot name. + /// <code>true</code> to + /// enable local MySQL; otherwise, + /// <code>false</code>. + /// Managed Service Identity + /// Id + /// Explicit Managed Service + /// Identity Id + /// IP security restrictions for + /// main. + /// IP security restrictions + /// for scm. + /// IP security + /// restrictions for scm to use main. + /// Http20Enabled: configures a web site to + /// allow clients to connect over http2.0 + /// MinTlsVersion: configures the minimum + /// version of TLS required for SSL requests. Possible values include: + /// '1.0', '1.1', '1.2' + /// State of FTP / FTPS service. Possible + /// values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + /// Number of preWarmed instances. + /// This setting only applies to the Consumption and Elastic + /// Plans + /// Health check path + public SiteConfig(int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), string healthCheckPath = default(string)) { NumberOfWorkers = numberOfWorkers; DefaultDocuments = defaultDocuments; @@ -147,8 +171,6 @@ internal SiteConfig(int? numberOfWorkers, IList defaultDocuments, string AutoHealRules = autoHealRules; TracingOptions = tracingOptions; VnetName = vnetName; - VnetRouteAllEnabled = vnetRouteAllEnabled; - VnetPrivatePortsCount = vnetPrivatePortsCount; Cors = cors; Push = push; ApiDefinition = apiDefinition; @@ -157,166 +179,402 @@ internal SiteConfig(int? numberOfWorkers, IList defaultDocuments, string LocalMySqlEnabled = localMySqlEnabled; ManagedServiceIdentityId = managedServiceIdentityId; XManagedServiceIdentityId = xManagedServiceIdentityId; - KeyVaultReferenceIdentity = keyVaultReferenceIdentity; IpSecurityRestrictions = ipSecurityRestrictions; ScmIpSecurityRestrictions = scmIpSecurityRestrictions; ScmIpSecurityRestrictionsUseMain = scmIpSecurityRestrictionsUseMain; Http20Enabled = http20Enabled; MinTlsVersion = minTlsVersion; - ScmMinTlsVersion = scmMinTlsVersion; FtpsState = ftpsState; PreWarmedInstanceCount = preWarmedInstanceCount; - FunctionAppScaleLimit = functionAppScaleLimit; HealthCheckPath = healthCheckPath; - FunctionsRuntimeScaleMonitoringEnabled = functionsRuntimeScaleMonitoringEnabled; - WebsiteTimeZone = websiteTimeZone; - MinimumElasticInstanceCount = minimumElasticInstanceCount; - AzureStorageAccounts = azureStorageAccounts; - PublicNetworkAccess = publicNetworkAccess; + CustomInit(); } - /// Number of workers. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets number of workers. + /// + [JsonProperty(PropertyName = "numberOfWorkers")] public int? NumberOfWorkers { get; set; } - /// Default documents. - public IList DefaultDocuments { get; } - /// .NET Framework version. + + /// + /// Gets or sets default documents. + /// + [JsonProperty(PropertyName = "defaultDocuments")] + public IList DefaultDocuments { get; set; } + + /// + /// Gets or sets .NET Framework version. + /// + [JsonProperty(PropertyName = "netFrameworkVersion")] public string NetFrameworkVersion { get; set; } - /// Version of PHP. + + /// + /// Gets or sets version of PHP. + /// + [JsonProperty(PropertyName = "phpVersion")] public string PhpVersion { get; set; } - /// Version of Python. + + /// + /// Gets or sets version of Python. + /// + [JsonProperty(PropertyName = "pythonVersion")] public string PythonVersion { get; set; } - /// Version of Node.js. + + /// + /// Gets or sets version of Node.js. + /// + [JsonProperty(PropertyName = "nodeVersion")] public string NodeVersion { get; set; } - /// Version of PowerShell. + + /// + /// Gets or sets version of PowerShell. + /// + [JsonProperty(PropertyName = "powerShellVersion")] public string PowerShellVersion { get; set; } - /// Linux App Framework and version. + + /// + /// Gets or sets linux App Framework and version + /// + [JsonProperty(PropertyName = "linuxFxVersion")] public string LinuxFxVersion { get; set; } - /// Xenon App Framework and version. + + /// + /// Gets or sets xenon App Framework and version + /// + [JsonProperty(PropertyName = "windowsFxVersion")] public string WindowsFxVersion { get; set; } - /// <code>true</code> if request tracing is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// request tracing is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "requestTracingEnabled")] public bool? RequestTracingEnabled { get; set; } - /// Request tracing expiration time. - public DateTimeOffset? RequestTracingExpirationTime { get; set; } - /// <code>true</code> if remote debugging is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets request tracing expiration time. + /// + [JsonProperty(PropertyName = "requestTracingExpirationTime")] + public System.DateTime? RequestTracingExpirationTime { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// remote debugging is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "remoteDebuggingEnabled")] public bool? RemoteDebuggingEnabled { get; set; } - /// Remote debugging version. + + /// + /// Gets or sets remote debugging version. + /// + [JsonProperty(PropertyName = "remoteDebuggingVersion")] public string RemoteDebuggingVersion { get; set; } - /// <code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if HTTP + /// logging is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "httpLoggingEnabled")] public bool? HttpLoggingEnabled { get; set; } - /// HTTP logs directory size limit. + + /// + /// Gets or sets HTTP logs directory size limit. + /// + [JsonProperty(PropertyName = "logsDirectorySizeLimit")] public int? LogsDirectorySizeLimit { get; set; } - /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// detailed error logging is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "detailedErrorLoggingEnabled")] public bool? DetailedErrorLoggingEnabled { get; set; } - /// Publishing user name. + + /// + /// Gets or sets publishing user name. + /// + [JsonProperty(PropertyName = "publishingUsername")] public string PublishingUsername { get; set; } - /// Application settings. - public IList AppSettings { get; } - /// Connection strings. - public IList ConnectionStrings { get; } - /// Site MachineKey. - public SiteMachineKey MachineKey { get; } - /// Handler mappings. - public IList HandlerMappings { get; } - /// Document root. + + /// + /// Gets or sets application settings. + /// + [JsonProperty(PropertyName = "appSettings")] + public IList AppSettings { get; set; } + + /// + /// Gets or sets connection strings. + /// + [JsonProperty(PropertyName = "connectionStrings")] + public IList ConnectionStrings { get; set; } + + /// + /// Gets site MachineKey. + /// + [JsonProperty(PropertyName = "machineKey")] + public SiteMachineKey MachineKey { get; private set; } + + /// + /// Gets or sets handler mappings. + /// + [JsonProperty(PropertyName = "handlerMappings")] + public IList HandlerMappings { get; set; } + + /// + /// Gets or sets document root. + /// + [JsonProperty(PropertyName = "documentRoot")] public string DocumentRoot { get; set; } - /// SCM type. - public ScmType? ScmType { get; set; } - /// <code>true</code> to use 32-bit worker process; otherwise, <code>false</code>. + + /// + /// Gets or sets SCM type. Possible values include: 'None', 'Dropbox', + /// 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + /// 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + /// 'OneDrive', 'VSO', 'VSTSRM' + /// + [JsonProperty(PropertyName = "scmType")] + public string ScmType { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to use + /// 32-bit worker process; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "use32BitWorkerProcess")] public bool? Use32BitWorkerProcess { get; set; } - /// <code>true</code> if WebSocket is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// WebSocket is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "webSocketsEnabled")] public bool? WebSocketsEnabled { get; set; } - /// <code>true</code> if Always On is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// Always On is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "alwaysOn")] public bool? AlwaysOn { get; set; } - /// Java version. + + /// + /// Gets or sets java version. + /// + [JsonProperty(PropertyName = "javaVersion")] public string JavaVersion { get; set; } - /// Java container. + + /// + /// Gets or sets java container. + /// + [JsonProperty(PropertyName = "javaContainer")] public string JavaContainer { get; set; } - /// Java container version. + + /// + /// Gets or sets java container version. + /// + [JsonProperty(PropertyName = "javaContainerVersion")] public string JavaContainerVersion { get; set; } - /// App command line to launch. + + /// + /// Gets or sets app command line to launch. + /// + [JsonProperty(PropertyName = "appCommandLine")] public string AppCommandLine { get; set; } - /// Managed pipeline mode. + + /// + /// Gets or sets managed pipeline mode. Possible values include: + /// 'Integrated', 'Classic' + /// + [JsonProperty(PropertyName = "managedPipelineMode")] public ManagedPipelineMode? ManagedPipelineMode { get; set; } - /// Virtual applications. - public IList VirtualApplications { get; } - /// Site load balancing. + + /// + /// Gets or sets virtual applications. + /// + [JsonProperty(PropertyName = "virtualApplications")] + public IList VirtualApplications { get; set; } + + /// + /// Gets or sets site load balancing. Possible values include: + /// 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + /// 'WeightedTotalTraffic', 'RequestHash' + /// + [JsonProperty(PropertyName = "loadBalancing")] public SiteLoadBalancing? LoadBalancing { get; set; } - /// This is work around for polymorphic types. + + /// + /// Gets or sets this is work around for polymorphic types. + /// + [JsonProperty(PropertyName = "experiments")] public Experiments Experiments { get; set; } - /// Site limits. + + /// + /// Gets or sets site limits. + /// + [JsonProperty(PropertyName = "limits")] public SiteLimits Limits { get; set; } - /// <code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if Auto + /// Heal is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "autoHealEnabled")] public bool? AutoHealEnabled { get; set; } - /// Auto Heal rules. + + /// + /// Gets or sets auto Heal rules. + /// + [JsonProperty(PropertyName = "autoHealRules")] public AutoHealRules AutoHealRules { get; set; } - /// Tracing options. + + /// + /// Gets or sets tracing options. + /// + [JsonProperty(PropertyName = "tracingOptions")] public string TracingOptions { get; set; } - /// Virtual Network name. + + /// + /// Gets or sets virtual Network name. + /// + [JsonProperty(PropertyName = "vnetName")] public string VnetName { get; set; } - /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. - public bool? VnetRouteAllEnabled { get; set; } - /// The number of private ports assigned to this app. These will be assigned dynamically on runtime. - public int? VnetPrivatePortsCount { get; set; } - /// Cross-Origin Resource Sharing (CORS) settings. + + /// + /// Gets or sets cross-Origin Resource Sharing (CORS) settings. + /// + [JsonProperty(PropertyName = "cors")] public CorsSettings Cors { get; set; } - /// Push endpoint settings. + + /// + /// Gets or sets push endpoint settings. + /// + [JsonProperty(PropertyName = "push")] public PushSettings Push { get; set; } - /// Information about the formal API definition for the app. + + /// + /// Gets or sets information about the formal API definition for the + /// app. + /// + [JsonProperty(PropertyName = "apiDefinition")] public ApiDefinitionInfo ApiDefinition { get; set; } - /// Azure API management settings linked to the app. + + /// + /// Gets or sets azure API management settings linked to the app. + /// + [JsonProperty(PropertyName = "apiManagementConfig")] public ApiManagementConfig ApiManagementConfig { get; set; } - /// Auto-swap slot name. + + /// + /// Gets or sets auto-swap slot name. + /// + [JsonProperty(PropertyName = "autoSwapSlotName")] public string AutoSwapSlotName { get; set; } - /// <code>true</code> to enable local MySQL; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// enable local MySQL; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "localMySqlEnabled")] public bool? LocalMySqlEnabled { get; set; } - /// Managed Service Identity Id. + + /// + /// Gets or sets managed Service Identity Id + /// + [JsonProperty(PropertyName = "managedServiceIdentityId")] public int? ManagedServiceIdentityId { get; set; } - /// Explicit Managed Service Identity Id. + + /// + /// Gets or sets explicit Managed Service Identity Id + /// + [JsonProperty(PropertyName = "xManagedServiceIdentityId")] public int? XManagedServiceIdentityId { get; set; } - /// Identity to use for Key Vault Reference authentication. - public string KeyVaultReferenceIdentity { get; set; } - /// IP security restrictions for main. - public IList IpSecurityRestrictions { get; } - /// IP security restrictions for scm. - public IList ScmIpSecurityRestrictions { get; } - /// IP security restrictions for scm to use main. + + /// + /// Gets or sets IP security restrictions for main. + /// + [JsonProperty(PropertyName = "ipSecurityRestrictions")] + public IList IpSecurityRestrictions { get; set; } + + /// + /// Gets or sets IP security restrictions for scm. + /// + [JsonProperty(PropertyName = "scmIpSecurityRestrictions")] + public IList ScmIpSecurityRestrictions { get; set; } + + /// + /// Gets or sets IP security restrictions for scm to use main. + /// + [JsonProperty(PropertyName = "scmIpSecurityRestrictionsUseMain")] public bool? ScmIpSecurityRestrictionsUseMain { get; set; } - /// Http20Enabled: configures a web site to allow clients to connect over http2.0. + + /// + /// Gets or sets http20Enabled: configures a web site to allow clients + /// to connect over http2.0 + /// + [JsonProperty(PropertyName = "http20Enabled")] public bool? Http20Enabled { get; set; } - /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. - public SupportedTlsVersions? MinTlsVersion { get; set; } - /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. - public SupportedTlsVersions? ScmMinTlsVersion { get; set; } - /// State of FTP / FTPS service. - public FtpsState? FtpsState { get; set; } + /// - /// Number of preWarmed instances. - /// This setting only applies to the Consumption and Elastic Plans. + /// Gets or sets minTlsVersion: configures the minimum version of TLS + /// required for SSL requests. Possible values include: '1.0', '1.1', + /// '1.2' /// - public int? PreWarmedInstanceCount { get; set; } + [JsonProperty(PropertyName = "minTlsVersion")] + public string MinTlsVersion { get; set; } + /// - /// Maximum number of workers that a site can scale out to. - /// This setting only applies to the Consumption and Elastic Premium Plans. + /// Gets or sets state of FTP / FTPS service. Possible values include: + /// 'AllAllowed', 'FtpsOnly', 'Disabled' /// - public int? FunctionAppScaleLimit { get; set; } - /// Health check path. - public string HealthCheckPath { get; set; } + [JsonProperty(PropertyName = "ftpsState")] + public string FtpsState { get; set; } + /// - /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, - /// the ScaleController will not monitor event sources directly, but will instead call to the - /// runtime to get scale status. + /// Gets or sets number of preWarmed instances. + /// This setting only applies to the Consumption and Elastic Plans /// - public bool? FunctionsRuntimeScaleMonitoringEnabled { get; set; } - /// Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. - public string WebsiteTimeZone { get; set; } + [JsonProperty(PropertyName = "preWarmedInstanceCount")] + public int? PreWarmedInstanceCount { get; set; } + /// - /// Number of minimum instance count for a site - /// This setting only applies to the Elastic Plans. + /// Gets or sets health check path /// - public int? MinimumElasticInstanceCount { get; set; } - /// List of Azure Storage Accounts. - public IDictionary AzureStorageAccounts { get; } - /// Property to allow or block all public traffic. - public string PublicNetworkAccess { get; set; } + [JsonProperty(PropertyName = "healthCheckPath")] + public string HealthCheckPath { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Push != null) + { + Push.Validate(); + } + if (PreWarmedInstanceCount > 10) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "PreWarmedInstanceCount", 10); + } + if (PreWarmedInstanceCount < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "PreWarmedInstanceCount", 0); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.Serialization.cs deleted file mode 100644 index bde4435a29a7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteConfigPropertiesDictionary - { - internal static SiteConfigPropertiesDictionary DeserializeSiteConfigPropertiesDictionary(JsonElement element) - { - Optional use32BitWorkerProcess = default; - Optional linuxFxVersion = default; - Optional javaVersion = default; - Optional powerShellVersion = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("use32BitWorkerProcess")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - use32BitWorkerProcess = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("linuxFxVersion")) - { - linuxFxVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("javaVersion")) - { - javaVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("powerShellVersion")) - { - powerShellVersion = property.Value.GetString(); - continue; - } - } - return new SiteConfigPropertiesDictionary(Optional.ToNullable(use32BitWorkerProcess), linuxFxVersion.Value, javaVersion.Value, powerShellVersion.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs deleted file mode 100644 index 12358f470f1f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Site config properties dictionary. - public partial class SiteConfigPropertiesDictionary - { - /// Initializes a new instance of SiteConfigPropertiesDictionary. - internal SiteConfigPropertiesDictionary() - { - } - - /// Initializes a new instance of SiteConfigPropertiesDictionary. - /// <code>true</code> if use32BitWorkerProcess should be set to true for the stack; otherwise, <code>false</code>. - /// LinuxFxVersion configuration setting. - /// JavaVersion configuration setting. - /// PowerShellVersion configuration setting. - internal SiteConfigPropertiesDictionary(bool? use32BitWorkerProcess, string linuxFxVersion, string javaVersion, string powerShellVersion) - { - Use32BitWorkerProcess = use32BitWorkerProcess; - LinuxFxVersion = linuxFxVersion; - JavaVersion = javaVersion; - PowerShellVersion = powerShellVersion; - } - - /// <code>true</code> if use32BitWorkerProcess should be set to true for the stack; otherwise, <code>false</code>. - public bool? Use32BitWorkerProcess { get; } - /// LinuxFxVersion configuration setting. - public string LinuxFxVersion { get; } - /// JavaVersion configuration setting. - public string JavaVersion { get; } - /// PowerShellVersion configuration setting. - public string PowerShellVersion { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.Serialization.cs deleted file mode 100644 index 0febe3afd474..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.Serialization.cs +++ /dev/null @@ -1,1086 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteConfigResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(NumberOfWorkers)) - { - writer.WritePropertyName("numberOfWorkers"); - writer.WriteNumberValue(NumberOfWorkers.Value); - } - if (Optional.IsCollectionDefined(DefaultDocuments)) - { - writer.WritePropertyName("defaultDocuments"); - writer.WriteStartArray(); - foreach (var item in DefaultDocuments) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NetFrameworkVersion)) - { - writer.WritePropertyName("netFrameworkVersion"); - writer.WriteStringValue(NetFrameworkVersion); - } - if (Optional.IsDefined(PhpVersion)) - { - writer.WritePropertyName("phpVersion"); - writer.WriteStringValue(PhpVersion); - } - if (Optional.IsDefined(PythonVersion)) - { - writer.WritePropertyName("pythonVersion"); - writer.WriteStringValue(PythonVersion); - } - if (Optional.IsDefined(NodeVersion)) - { - writer.WritePropertyName("nodeVersion"); - writer.WriteStringValue(NodeVersion); - } - if (Optional.IsDefined(PowerShellVersion)) - { - writer.WritePropertyName("powerShellVersion"); - writer.WriteStringValue(PowerShellVersion); - } - if (Optional.IsDefined(LinuxFxVersion)) - { - writer.WritePropertyName("linuxFxVersion"); - writer.WriteStringValue(LinuxFxVersion); - } - if (Optional.IsDefined(WindowsFxVersion)) - { - writer.WritePropertyName("windowsFxVersion"); - writer.WriteStringValue(WindowsFxVersion); - } - if (Optional.IsDefined(RequestTracingEnabled)) - { - writer.WritePropertyName("requestTracingEnabled"); - writer.WriteBooleanValue(RequestTracingEnabled.Value); - } - if (Optional.IsDefined(RequestTracingExpirationTime)) - { - writer.WritePropertyName("requestTracingExpirationTime"); - writer.WriteStringValue(RequestTracingExpirationTime.Value, "O"); - } - if (Optional.IsDefined(RemoteDebuggingEnabled)) - { - writer.WritePropertyName("remoteDebuggingEnabled"); - writer.WriteBooleanValue(RemoteDebuggingEnabled.Value); - } - if (Optional.IsDefined(RemoteDebuggingVersion)) - { - writer.WritePropertyName("remoteDebuggingVersion"); - writer.WriteStringValue(RemoteDebuggingVersion); - } - if (Optional.IsDefined(HttpLoggingEnabled)) - { - writer.WritePropertyName("httpLoggingEnabled"); - writer.WriteBooleanValue(HttpLoggingEnabled.Value); - } - if (Optional.IsDefined(LogsDirectorySizeLimit)) - { - writer.WritePropertyName("logsDirectorySizeLimit"); - writer.WriteNumberValue(LogsDirectorySizeLimit.Value); - } - if (Optional.IsDefined(DetailedErrorLoggingEnabled)) - { - writer.WritePropertyName("detailedErrorLoggingEnabled"); - writer.WriteBooleanValue(DetailedErrorLoggingEnabled.Value); - } - if (Optional.IsDefined(PublishingUsername)) - { - writer.WritePropertyName("publishingUsername"); - writer.WriteStringValue(PublishingUsername); - } - if (Optional.IsCollectionDefined(AppSettings)) - { - writer.WritePropertyName("appSettings"); - writer.WriteStartArray(); - foreach (var item in AppSettings) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ConnectionStrings)) - { - writer.WritePropertyName("connectionStrings"); - writer.WriteStartArray(); - foreach (var item in ConnectionStrings) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(HandlerMappings)) - { - writer.WritePropertyName("handlerMappings"); - writer.WriteStartArray(); - foreach (var item in HandlerMappings) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(DocumentRoot)) - { - writer.WritePropertyName("documentRoot"); - writer.WriteStringValue(DocumentRoot); - } - if (Optional.IsDefined(ScmType)) - { - writer.WritePropertyName("scmType"); - writer.WriteStringValue(ScmType.Value.ToString()); - } - if (Optional.IsDefined(Use32BitWorkerProcess)) - { - writer.WritePropertyName("use32BitWorkerProcess"); - writer.WriteBooleanValue(Use32BitWorkerProcess.Value); - } - if (Optional.IsDefined(WebSocketsEnabled)) - { - writer.WritePropertyName("webSocketsEnabled"); - writer.WriteBooleanValue(WebSocketsEnabled.Value); - } - if (Optional.IsDefined(AlwaysOn)) - { - writer.WritePropertyName("alwaysOn"); - writer.WriteBooleanValue(AlwaysOn.Value); - } - if (Optional.IsDefined(JavaVersion)) - { - writer.WritePropertyName("javaVersion"); - writer.WriteStringValue(JavaVersion); - } - if (Optional.IsDefined(JavaContainer)) - { - writer.WritePropertyName("javaContainer"); - writer.WriteStringValue(JavaContainer); - } - if (Optional.IsDefined(JavaContainerVersion)) - { - writer.WritePropertyName("javaContainerVersion"); - writer.WriteStringValue(JavaContainerVersion); - } - if (Optional.IsDefined(AppCommandLine)) - { - writer.WritePropertyName("appCommandLine"); - writer.WriteStringValue(AppCommandLine); - } - if (Optional.IsDefined(ManagedPipelineMode)) - { - writer.WritePropertyName("managedPipelineMode"); - writer.WriteStringValue(ManagedPipelineMode.Value.ToSerialString()); - } - if (Optional.IsCollectionDefined(VirtualApplications)) - { - writer.WritePropertyName("virtualApplications"); - writer.WriteStartArray(); - foreach (var item in VirtualApplications) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(LoadBalancing)) - { - writer.WritePropertyName("loadBalancing"); - writer.WriteStringValue(LoadBalancing.Value.ToSerialString()); - } - if (Optional.IsDefined(Experiments)) - { - writer.WritePropertyName("experiments"); - writer.WriteObjectValue(Experiments); - } - if (Optional.IsDefined(Limits)) - { - writer.WritePropertyName("limits"); - writer.WriteObjectValue(Limits); - } - if (Optional.IsDefined(AutoHealEnabled)) - { - writer.WritePropertyName("autoHealEnabled"); - writer.WriteBooleanValue(AutoHealEnabled.Value); - } - if (Optional.IsDefined(AutoHealRules)) - { - writer.WritePropertyName("autoHealRules"); - writer.WriteObjectValue(AutoHealRules); - } - if (Optional.IsDefined(TracingOptions)) - { - writer.WritePropertyName("tracingOptions"); - writer.WriteStringValue(TracingOptions); - } - if (Optional.IsDefined(VnetName)) - { - writer.WritePropertyName("vnetName"); - writer.WriteStringValue(VnetName); - } - if (Optional.IsDefined(VnetRouteAllEnabled)) - { - writer.WritePropertyName("vnetRouteAllEnabled"); - writer.WriteBooleanValue(VnetRouteAllEnabled.Value); - } - if (Optional.IsDefined(VnetPrivatePortsCount)) - { - writer.WritePropertyName("vnetPrivatePortsCount"); - writer.WriteNumberValue(VnetPrivatePortsCount.Value); - } - if (Optional.IsDefined(Cors)) - { - writer.WritePropertyName("cors"); - writer.WriteObjectValue(Cors); - } - if (Optional.IsDefined(Push)) - { - writer.WritePropertyName("push"); - writer.WriteObjectValue(Push); - } - if (Optional.IsDefined(ApiDefinition)) - { - writer.WritePropertyName("apiDefinition"); - writer.WriteObjectValue(ApiDefinition); - } - if (Optional.IsDefined(ApiManagementConfig)) - { - writer.WritePropertyName("apiManagementConfig"); - writer.WriteObjectValue(ApiManagementConfig); - } - if (Optional.IsDefined(AutoSwapSlotName)) - { - writer.WritePropertyName("autoSwapSlotName"); - writer.WriteStringValue(AutoSwapSlotName); - } - if (Optional.IsDefined(LocalMySqlEnabled)) - { - writer.WritePropertyName("localMySqlEnabled"); - writer.WriteBooleanValue(LocalMySqlEnabled.Value); - } - if (Optional.IsDefined(ManagedServiceIdentityId)) - { - writer.WritePropertyName("managedServiceIdentityId"); - writer.WriteNumberValue(ManagedServiceIdentityId.Value); - } - if (Optional.IsDefined(XManagedServiceIdentityId)) - { - writer.WritePropertyName("xManagedServiceIdentityId"); - writer.WriteNumberValue(XManagedServiceIdentityId.Value); - } - if (Optional.IsDefined(KeyVaultReferenceIdentity)) - { - writer.WritePropertyName("keyVaultReferenceIdentity"); - writer.WriteStringValue(KeyVaultReferenceIdentity); - } - if (Optional.IsCollectionDefined(IpSecurityRestrictions)) - { - writer.WritePropertyName("ipSecurityRestrictions"); - writer.WriteStartArray(); - foreach (var item in IpSecurityRestrictions) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ScmIpSecurityRestrictions)) - { - writer.WritePropertyName("scmIpSecurityRestrictions"); - writer.WriteStartArray(); - foreach (var item in ScmIpSecurityRestrictions) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ScmIpSecurityRestrictionsUseMain)) - { - writer.WritePropertyName("scmIpSecurityRestrictionsUseMain"); - writer.WriteBooleanValue(ScmIpSecurityRestrictionsUseMain.Value); - } - if (Optional.IsDefined(Http20Enabled)) - { - writer.WritePropertyName("http20Enabled"); - writer.WriteBooleanValue(Http20Enabled.Value); - } - if (Optional.IsDefined(MinTlsVersion)) - { - writer.WritePropertyName("minTlsVersion"); - writer.WriteStringValue(MinTlsVersion.Value.ToString()); - } - if (Optional.IsDefined(ScmMinTlsVersion)) - { - writer.WritePropertyName("scmMinTlsVersion"); - writer.WriteStringValue(ScmMinTlsVersion.Value.ToString()); - } - if (Optional.IsDefined(FtpsState)) - { - writer.WritePropertyName("ftpsState"); - writer.WriteStringValue(FtpsState.Value.ToString()); - } - if (Optional.IsDefined(PreWarmedInstanceCount)) - { - writer.WritePropertyName("preWarmedInstanceCount"); - writer.WriteNumberValue(PreWarmedInstanceCount.Value); - } - if (Optional.IsDefined(FunctionAppScaleLimit)) - { - writer.WritePropertyName("functionAppScaleLimit"); - writer.WriteNumberValue(FunctionAppScaleLimit.Value); - } - if (Optional.IsDefined(HealthCheckPath)) - { - writer.WritePropertyName("healthCheckPath"); - writer.WriteStringValue(HealthCheckPath); - } - if (Optional.IsDefined(FunctionsRuntimeScaleMonitoringEnabled)) - { - writer.WritePropertyName("functionsRuntimeScaleMonitoringEnabled"); - writer.WriteBooleanValue(FunctionsRuntimeScaleMonitoringEnabled.Value); - } - if (Optional.IsDefined(WebsiteTimeZone)) - { - writer.WritePropertyName("websiteTimeZone"); - writer.WriteStringValue(WebsiteTimeZone); - } - if (Optional.IsDefined(MinimumElasticInstanceCount)) - { - writer.WritePropertyName("minimumElasticInstanceCount"); - writer.WriteNumberValue(MinimumElasticInstanceCount.Value); - } - if (Optional.IsCollectionDefined(AzureStorageAccounts)) - { - writer.WritePropertyName("azureStorageAccounts"); - writer.WriteStartObject(); - foreach (var item in AzureStorageAccounts) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(PublicNetworkAccess)) - { - writer.WritePropertyName("publicNetworkAccess"); - writer.WriteStringValue(PublicNetworkAccess); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SiteConfigResource DeserializeSiteConfigResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional numberOfWorkers = default; - Optional> defaultDocuments = default; - Optional netFrameworkVersion = default; - Optional phpVersion = default; - Optional pythonVersion = default; - Optional nodeVersion = default; - Optional powerShellVersion = default; - Optional linuxFxVersion = default; - Optional windowsFxVersion = default; - Optional requestTracingEnabled = default; - Optional requestTracingExpirationTime = default; - Optional remoteDebuggingEnabled = default; - Optional remoteDebuggingVersion = default; - Optional httpLoggingEnabled = default; - Optional logsDirectorySizeLimit = default; - Optional detailedErrorLoggingEnabled = default; - Optional publishingUsername = default; - Optional> appSettings = default; - Optional> connectionStrings = default; - Optional machineKey = default; - Optional> handlerMappings = default; - Optional documentRoot = default; - Optional scmType = default; - Optional use32BitWorkerProcess = default; - Optional webSocketsEnabled = default; - Optional alwaysOn = default; - Optional javaVersion = default; - Optional javaContainer = default; - Optional javaContainerVersion = default; - Optional appCommandLine = default; - Optional managedPipelineMode = default; - Optional> virtualApplications = default; - Optional loadBalancing = default; - Optional experiments = default; - Optional limits = default; - Optional autoHealEnabled = default; - Optional autoHealRules = default; - Optional tracingOptions = default; - Optional vnetName = default; - Optional vnetRouteAllEnabled = default; - Optional vnetPrivatePortsCount = default; - Optional cors = default; - Optional push = default; - Optional apiDefinition = default; - Optional apiManagementConfig = default; - Optional autoSwapSlotName = default; - Optional localMySqlEnabled = default; - Optional managedServiceIdentityId = default; - Optional xManagedServiceIdentityId = default; - Optional keyVaultReferenceIdentity = default; - Optional> ipSecurityRestrictions = default; - Optional> scmIpSecurityRestrictions = default; - Optional scmIpSecurityRestrictionsUseMain = default; - Optional http20Enabled = default; - Optional minTlsVersion = default; - Optional scmMinTlsVersion = default; - Optional ftpsState = default; - Optional preWarmedInstanceCount = default; - Optional functionAppScaleLimit = default; - Optional healthCheckPath = default; - Optional functionsRuntimeScaleMonitoringEnabled = default; - Optional websiteTimeZone = default; - Optional minimumElasticInstanceCount = default; - Optional> azureStorageAccounts = default; - Optional publicNetworkAccess = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("numberOfWorkers")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - numberOfWorkers = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("defaultDocuments")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - defaultDocuments = array; - continue; - } - if (property0.NameEquals("netFrameworkVersion")) - { - netFrameworkVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("phpVersion")) - { - phpVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("pythonVersion")) - { - pythonVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("nodeVersion")) - { - nodeVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("powerShellVersion")) - { - powerShellVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("linuxFxVersion")) - { - linuxFxVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("windowsFxVersion")) - { - windowsFxVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("requestTracingEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - requestTracingEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("requestTracingExpirationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - requestTracingExpirationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("remoteDebuggingEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - remoteDebuggingEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("remoteDebuggingVersion")) - { - remoteDebuggingVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("httpLoggingEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - httpLoggingEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("logsDirectorySizeLimit")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - logsDirectorySizeLimit = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("detailedErrorLoggingEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - detailedErrorLoggingEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("publishingUsername")) - { - publishingUsername = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("appSettings")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(NameValuePair.DeserializeNameValuePair(item)); - } - appSettings = array; - continue; - } - if (property0.NameEquals("connectionStrings")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ConnStringInfo.DeserializeConnStringInfo(item)); - } - connectionStrings = array; - continue; - } - if (property0.NameEquals("machineKey")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - machineKey = SiteMachineKey.DeserializeSiteMachineKey(property0.Value); - continue; - } - if (property0.NameEquals("handlerMappings")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(HandlerMapping.DeserializeHandlerMapping(item)); - } - handlerMappings = array; - continue; - } - if (property0.NameEquals("documentRoot")) - { - documentRoot = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("scmType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - scmType = new ScmType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("use32BitWorkerProcess")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - use32BitWorkerProcess = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("webSocketsEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - webSocketsEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("alwaysOn")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - alwaysOn = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("javaVersion")) - { - javaVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("javaContainer")) - { - javaContainer = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("javaContainerVersion")) - { - javaContainerVersion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("appCommandLine")) - { - appCommandLine = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("managedPipelineMode")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - managedPipelineMode = property0.Value.GetString().ToManagedPipelineMode(); - continue; - } - if (property0.NameEquals("virtualApplications")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(VirtualApplication.DeserializeVirtualApplication(item)); - } - virtualApplications = array; - continue; - } - if (property0.NameEquals("loadBalancing")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - loadBalancing = property0.Value.GetString().ToSiteLoadBalancing(); - continue; - } - if (property0.NameEquals("experiments")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - experiments = Experiments.DeserializeExperiments(property0.Value); - continue; - } - if (property0.NameEquals("limits")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - limits = SiteLimits.DeserializeSiteLimits(property0.Value); - continue; - } - if (property0.NameEquals("autoHealEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - autoHealEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("autoHealRules")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - autoHealRules = AutoHealRules.DeserializeAutoHealRules(property0.Value); - continue; - } - if (property0.NameEquals("tracingOptions")) - { - tracingOptions = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("vnetName")) - { - vnetName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("vnetRouteAllEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - vnetRouteAllEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("vnetPrivatePortsCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - vnetPrivatePortsCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("cors")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - cors = CorsSettings.DeserializeCorsSettings(property0.Value); - continue; - } - if (property0.NameEquals("push")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - push = PushSettings.DeserializePushSettings(property0.Value); - continue; - } - if (property0.NameEquals("apiDefinition")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - apiDefinition = ApiDefinitionInfo.DeserializeApiDefinitionInfo(property0.Value); - continue; - } - if (property0.NameEquals("apiManagementConfig")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - apiManagementConfig = ApiManagementConfig.DeserializeApiManagementConfig(property0.Value); - continue; - } - if (property0.NameEquals("autoSwapSlotName")) - { - autoSwapSlotName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("localMySqlEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - localMySqlEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("managedServiceIdentityId")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - managedServiceIdentityId = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("xManagedServiceIdentityId")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - xManagedServiceIdentityId = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("keyVaultReferenceIdentity")) - { - keyVaultReferenceIdentity = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("ipSecurityRestrictions")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IpSecurityRestriction.DeserializeIpSecurityRestriction(item)); - } - ipSecurityRestrictions = array; - continue; - } - if (property0.NameEquals("scmIpSecurityRestrictions")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IpSecurityRestriction.DeserializeIpSecurityRestriction(item)); - } - scmIpSecurityRestrictions = array; - continue; - } - if (property0.NameEquals("scmIpSecurityRestrictionsUseMain")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - scmIpSecurityRestrictionsUseMain = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("http20Enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - http20Enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("minTlsVersion")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - minTlsVersion = new SupportedTlsVersions(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("scmMinTlsVersion")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - scmMinTlsVersion = new SupportedTlsVersions(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("ftpsState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - ftpsState = new FtpsState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("preWarmedInstanceCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - preWarmedInstanceCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("functionAppScaleLimit")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - functionAppScaleLimit = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("healthCheckPath")) - { - healthCheckPath = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("functionsRuntimeScaleMonitoringEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - functionsRuntimeScaleMonitoringEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("websiteTimeZone")) - { - websiteTimeZone = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("minimumElasticInstanceCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - minimumElasticInstanceCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("azureStorageAccounts")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, AzureStorageInfoValue.DeserializeAzureStorageInfoValue(property1.Value)); - } - azureStorageAccounts = dictionary; - continue; - } - if (property0.NameEquals("publicNetworkAccess")) - { - publicNetworkAccess = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new SiteConfigResource(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(numberOfWorkers), Optional.ToList(defaultDocuments), netFrameworkVersion.Value, phpVersion.Value, pythonVersion.Value, nodeVersion.Value, powerShellVersion.Value, linuxFxVersion.Value, windowsFxVersion.Value, Optional.ToNullable(requestTracingEnabled), Optional.ToNullable(requestTracingExpirationTime), Optional.ToNullable(remoteDebuggingEnabled), remoteDebuggingVersion.Value, Optional.ToNullable(httpLoggingEnabled), Optional.ToNullable(logsDirectorySizeLimit), Optional.ToNullable(detailedErrorLoggingEnabled), publishingUsername.Value, Optional.ToList(appSettings), Optional.ToList(connectionStrings), machineKey.Value, Optional.ToList(handlerMappings), documentRoot.Value, Optional.ToNullable(scmType), Optional.ToNullable(use32BitWorkerProcess), Optional.ToNullable(webSocketsEnabled), Optional.ToNullable(alwaysOn), javaVersion.Value, javaContainer.Value, javaContainerVersion.Value, appCommandLine.Value, Optional.ToNullable(managedPipelineMode), Optional.ToList(virtualApplications), Optional.ToNullable(loadBalancing), experiments.Value, limits.Value, Optional.ToNullable(autoHealEnabled), autoHealRules.Value, tracingOptions.Value, vnetName.Value, Optional.ToNullable(vnetRouteAllEnabled), Optional.ToNullable(vnetPrivatePortsCount), cors.Value, push.Value, apiDefinition.Value, apiManagementConfig.Value, autoSwapSlotName.Value, Optional.ToNullable(localMySqlEnabled), Optional.ToNullable(managedServiceIdentityId), Optional.ToNullable(xManagedServiceIdentityId), keyVaultReferenceIdentity.Value, Optional.ToList(ipSecurityRestrictions), Optional.ToList(scmIpSecurityRestrictions), Optional.ToNullable(scmIpSecurityRestrictionsUseMain), Optional.ToNullable(http20Enabled), Optional.ToNullable(minTlsVersion), Optional.ToNullable(scmMinTlsVersion), Optional.ToNullable(ftpsState), Optional.ToNullable(preWarmedInstanceCount), Optional.ToNullable(functionAppScaleLimit), healthCheckPath.Value, Optional.ToNullable(functionsRuntimeScaleMonitoringEnabled), websiteTimeZone.Value, Optional.ToNullable(minimumElasticInstanceCount), Optional.ToDictionary(azureStorageAccounts), publicNetworkAccess.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs index 0481298a9d6f..c51daa41c62e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs @@ -1,116 +1,143 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Web app configuration ARM resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Web app configuration ARM resource. + /// + [Rest.Serialization.JsonTransformation] public partial class SiteConfigResource : ProxyOnlyResource { - /// Initializes a new instance of SiteConfigResource. + /// + /// Initializes a new instance of the SiteConfigResource class. + /// public SiteConfigResource() { - DefaultDocuments = new ChangeTrackingList(); - AppSettings = new ChangeTrackingList(); - ConnectionStrings = new ChangeTrackingList(); - HandlerMappings = new ChangeTrackingList(); - VirtualApplications = new ChangeTrackingList(); - IpSecurityRestrictions = new ChangeTrackingList(); - ScmIpSecurityRestrictions = new ChangeTrackingList(); - AzureStorageAccounts = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of SiteConfigResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Number of workers. - /// Default documents. - /// .NET Framework version. - /// Version of PHP. - /// Version of Python. - /// Version of Node.js. - /// Version of PowerShell. - /// Linux App Framework and version. - /// Xenon App Framework and version. - /// <code>true</code> if request tracing is enabled; otherwise, <code>false</code>. - /// Request tracing expiration time. - /// <code>true</code> if remote debugging is enabled; otherwise, <code>false</code>. - /// Remote debugging version. - /// <code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>. - /// HTTP logs directory size limit. - /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. - /// Publishing user name. - /// Application settings. - /// Connection strings. - /// Site MachineKey. - /// Handler mappings. - /// Document root. - /// SCM type. - /// <code>true</code> to use 32-bit worker process; otherwise, <code>false</code>. - /// <code>true</code> if WebSocket is enabled; otherwise, <code>false</code>. - /// <code>true</code> if Always On is enabled; otherwise, <code>false</code>. - /// Java version. - /// Java container. - /// Java container version. - /// App command line to launch. - /// Managed pipeline mode. - /// Virtual applications. - /// Site load balancing. - /// This is work around for polymorphic types. - /// Site limits. - /// <code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>. - /// Auto Heal rules. - /// Tracing options. - /// Virtual Network name. - /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. - /// The number of private ports assigned to this app. These will be assigned dynamically on runtime. - /// Cross-Origin Resource Sharing (CORS) settings. - /// Push endpoint settings. - /// Information about the formal API definition for the app. - /// Azure API management settings linked to the app. - /// Auto-swap slot name. - /// <code>true</code> to enable local MySQL; otherwise, <code>false</code>. - /// Managed Service Identity Id. - /// Explicit Managed Service Identity Id. - /// Identity to use for Key Vault Reference authentication. - /// IP security restrictions for main. - /// IP security restrictions for scm. - /// IP security restrictions for scm to use main. - /// Http20Enabled: configures a web site to allow clients to connect over http2.0. - /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. - /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. - /// State of FTP / FTPS service. - /// - /// Number of preWarmed instances. - /// This setting only applies to the Consumption and Elastic Plans. - /// - /// - /// Maximum number of workers that a site can scale out to. - /// This setting only applies to the Consumption and Elastic Premium Plans. - /// - /// Health check path. - /// - /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, - /// the ScaleController will not monitor event sources directly, but will instead call to the - /// runtime to get scale status. - /// - /// Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. - /// - /// Number of minimum instance count for a site - /// This setting only applies to the Elastic Plans. - /// - /// List of Azure Storage Accounts. - /// Property to allow or block all public traffic. - internal SiteConfigResource(string id, string name, string kind, string type, int? numberOfWorkers, IList defaultDocuments, string netFrameworkVersion, string phpVersion, string pythonVersion, string nodeVersion, string powerShellVersion, string linuxFxVersion, string windowsFxVersion, bool? requestTracingEnabled, DateTimeOffset? requestTracingExpirationTime, bool? remoteDebuggingEnabled, string remoteDebuggingVersion, bool? httpLoggingEnabled, int? logsDirectorySizeLimit, bool? detailedErrorLoggingEnabled, string publishingUsername, IList appSettings, IList connectionStrings, SiteMachineKey machineKey, IList handlerMappings, string documentRoot, ScmType? scmType, bool? use32BitWorkerProcess, bool? webSocketsEnabled, bool? alwaysOn, string javaVersion, string javaContainer, string javaContainerVersion, string appCommandLine, ManagedPipelineMode? managedPipelineMode, IList virtualApplications, SiteLoadBalancing? loadBalancing, Experiments experiments, SiteLimits limits, bool? autoHealEnabled, AutoHealRules autoHealRules, string tracingOptions, string vnetName, bool? vnetRouteAllEnabled, int? vnetPrivatePortsCount, CorsSettings cors, PushSettings push, ApiDefinitionInfo apiDefinition, ApiManagementConfig apiManagementConfig, string autoSwapSlotName, bool? localMySqlEnabled, int? managedServiceIdentityId, int? xManagedServiceIdentityId, string keyVaultReferenceIdentity, IList ipSecurityRestrictions, IList scmIpSecurityRestrictions, bool? scmIpSecurityRestrictionsUseMain, bool? http20Enabled, SupportedTlsVersions? minTlsVersion, SupportedTlsVersions? scmMinTlsVersion, FtpsState? ftpsState, int? preWarmedInstanceCount, int? functionAppScaleLimit, string healthCheckPath, bool? functionsRuntimeScaleMonitoringEnabled, string websiteTimeZone, int? minimumElasticInstanceCount, IDictionary azureStorageAccounts, string publicNetworkAccess) : base(id, name, kind, type) + /// + /// Initializes a new instance of the SiteConfigResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Number of workers. + /// Default documents. + /// .NET Framework version. + /// Version of PHP. + /// Version of Python. + /// Version of Node.js. + /// Version of PowerShell. + /// Linux App Framework and + /// version + /// Xenon App Framework and + /// version + /// <code>true</code> + /// if request tracing is enabled; otherwise, + /// <code>false</code>. + /// Request tracing + /// expiration time. + /// <code>true</code> + /// if remote debugging is enabled; otherwise, + /// <code>false</code>. + /// Remote debugging + /// version. + /// <code>true</code> if + /// HTTP logging is enabled; otherwise, + /// <code>false</code>. + /// HTTP logs directory size + /// limit. + /// <code>true</code> if + /// detailed error logging is enabled; otherwise, + /// <code>false</code>. + /// Publishing user name. + /// Application settings. + /// Connection strings. + /// Site MachineKey. + /// Handler mappings. + /// Document root. + /// SCM type. Possible values include: 'None', + /// 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + /// 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', + /// 'ExternalHg', 'OneDrive', 'VSO', 'VSTSRM' + /// <code>true</code> + /// to use 32-bit worker process; otherwise, + /// <code>false</code>. + /// <code>true</code> if + /// WebSocket is enabled; otherwise, + /// <code>false</code>. + /// <code>true</code> if Always On + /// is enabled; otherwise, <code>false</code>. + /// Java version. + /// Java container. + /// Java container version. + /// App command line to launch. + /// Managed pipeline mode. Possible + /// values include: 'Integrated', 'Classic' + /// Virtual applications. + /// Site load balancing. Possible values + /// include: 'WeightedRoundRobin', 'LeastRequests', + /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + /// This is work around for polymorphic + /// types. + /// Site limits. + /// <code>true</code> if Auto + /// Heal is enabled; otherwise, <code>false</code>. + /// Auto Heal rules. + /// Tracing options. + /// Virtual Network name. + /// Cross-Origin Resource Sharing (CORS) + /// settings. + /// Push endpoint settings. + /// Information about the formal API + /// definition for the app. + /// Azure API management settings + /// linked to the app. + /// Auto-swap slot name. + /// <code>true</code> to + /// enable local MySQL; otherwise, + /// <code>false</code>. + /// Managed Service Identity + /// Id + /// Explicit Managed Service + /// Identity Id + /// IP security restrictions for + /// main. + /// IP security restrictions + /// for scm. + /// IP security + /// restrictions for scm to use main. + /// Http20Enabled: configures a web site to + /// allow clients to connect over http2.0 + /// MinTlsVersion: configures the minimum + /// version of TLS required for SSL requests. Possible values include: + /// '1.0', '1.1', '1.2' + /// State of FTP / FTPS service. Possible + /// values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + /// Number of preWarmed instances. + /// This setting only applies to the Consumption and Elastic + /// Plans + /// Health check path + public SiteConfigResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), string healthCheckPath = default(string)) + : base(id, name, kind, type) { NumberOfWorkers = numberOfWorkers; DefaultDocuments = defaultDocuments; @@ -151,8 +178,6 @@ internal SiteConfigResource(string id, string name, string kind, string type, in AutoHealRules = autoHealRules; TracingOptions = tracingOptions; VnetName = vnetName; - VnetRouteAllEnabled = vnetRouteAllEnabled; - VnetPrivatePortsCount = vnetPrivatePortsCount; Cors = cors; Push = push; ApiDefinition = apiDefinition; @@ -161,166 +186,402 @@ internal SiteConfigResource(string id, string name, string kind, string type, in LocalMySqlEnabled = localMySqlEnabled; ManagedServiceIdentityId = managedServiceIdentityId; XManagedServiceIdentityId = xManagedServiceIdentityId; - KeyVaultReferenceIdentity = keyVaultReferenceIdentity; IpSecurityRestrictions = ipSecurityRestrictions; ScmIpSecurityRestrictions = scmIpSecurityRestrictions; ScmIpSecurityRestrictionsUseMain = scmIpSecurityRestrictionsUseMain; Http20Enabled = http20Enabled; MinTlsVersion = minTlsVersion; - ScmMinTlsVersion = scmMinTlsVersion; FtpsState = ftpsState; PreWarmedInstanceCount = preWarmedInstanceCount; - FunctionAppScaleLimit = functionAppScaleLimit; HealthCheckPath = healthCheckPath; - FunctionsRuntimeScaleMonitoringEnabled = functionsRuntimeScaleMonitoringEnabled; - WebsiteTimeZone = websiteTimeZone; - MinimumElasticInstanceCount = minimumElasticInstanceCount; - AzureStorageAccounts = azureStorageAccounts; - PublicNetworkAccess = publicNetworkAccess; + CustomInit(); } - /// Number of workers. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets number of workers. + /// + [JsonProperty(PropertyName = "properties.numberOfWorkers")] public int? NumberOfWorkers { get; set; } - /// Default documents. - public IList DefaultDocuments { get; } - /// .NET Framework version. + + /// + /// Gets or sets default documents. + /// + [JsonProperty(PropertyName = "properties.defaultDocuments")] + public IList DefaultDocuments { get; set; } + + /// + /// Gets or sets .NET Framework version. + /// + [JsonProperty(PropertyName = "properties.netFrameworkVersion")] public string NetFrameworkVersion { get; set; } - /// Version of PHP. + + /// + /// Gets or sets version of PHP. + /// + [JsonProperty(PropertyName = "properties.phpVersion")] public string PhpVersion { get; set; } - /// Version of Python. + + /// + /// Gets or sets version of Python. + /// + [JsonProperty(PropertyName = "properties.pythonVersion")] public string PythonVersion { get; set; } - /// Version of Node.js. + + /// + /// Gets or sets version of Node.js. + /// + [JsonProperty(PropertyName = "properties.nodeVersion")] public string NodeVersion { get; set; } - /// Version of PowerShell. + + /// + /// Gets or sets version of PowerShell. + /// + [JsonProperty(PropertyName = "properties.powerShellVersion")] public string PowerShellVersion { get; set; } - /// Linux App Framework and version. + + /// + /// Gets or sets linux App Framework and version + /// + [JsonProperty(PropertyName = "properties.linuxFxVersion")] public string LinuxFxVersion { get; set; } - /// Xenon App Framework and version. + + /// + /// Gets or sets xenon App Framework and version + /// + [JsonProperty(PropertyName = "properties.windowsFxVersion")] public string WindowsFxVersion { get; set; } - /// <code>true</code> if request tracing is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// request tracing is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.requestTracingEnabled")] public bool? RequestTracingEnabled { get; set; } - /// Request tracing expiration time. - public DateTimeOffset? RequestTracingExpirationTime { get; set; } - /// <code>true</code> if remote debugging is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets request tracing expiration time. + /// + [JsonProperty(PropertyName = "properties.requestTracingExpirationTime")] + public System.DateTime? RequestTracingExpirationTime { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// remote debugging is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.remoteDebuggingEnabled")] public bool? RemoteDebuggingEnabled { get; set; } - /// Remote debugging version. + + /// + /// Gets or sets remote debugging version. + /// + [JsonProperty(PropertyName = "properties.remoteDebuggingVersion")] public string RemoteDebuggingVersion { get; set; } - /// <code>true</code> if HTTP logging is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if HTTP + /// logging is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.httpLoggingEnabled")] public bool? HttpLoggingEnabled { get; set; } - /// HTTP logs directory size limit. + + /// + /// Gets or sets HTTP logs directory size limit. + /// + [JsonProperty(PropertyName = "properties.logsDirectorySizeLimit")] public int? LogsDirectorySizeLimit { get; set; } - /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// detailed error logging is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.detailedErrorLoggingEnabled")] public bool? DetailedErrorLoggingEnabled { get; set; } - /// Publishing user name. + + /// + /// Gets or sets publishing user name. + /// + [JsonProperty(PropertyName = "properties.publishingUsername")] public string PublishingUsername { get; set; } - /// Application settings. - public IList AppSettings { get; } - /// Connection strings. - public IList ConnectionStrings { get; } - /// Site MachineKey. - public SiteMachineKey MachineKey { get; } - /// Handler mappings. - public IList HandlerMappings { get; } - /// Document root. + + /// + /// Gets or sets application settings. + /// + [JsonProperty(PropertyName = "properties.appSettings")] + public IList AppSettings { get; set; } + + /// + /// Gets or sets connection strings. + /// + [JsonProperty(PropertyName = "properties.connectionStrings")] + public IList ConnectionStrings { get; set; } + + /// + /// Gets site MachineKey. + /// + [JsonProperty(PropertyName = "properties.machineKey")] + public SiteMachineKey MachineKey { get; private set; } + + /// + /// Gets or sets handler mappings. + /// + [JsonProperty(PropertyName = "properties.handlerMappings")] + public IList HandlerMappings { get; set; } + + /// + /// Gets or sets document root. + /// + [JsonProperty(PropertyName = "properties.documentRoot")] public string DocumentRoot { get; set; } - /// SCM type. - public ScmType? ScmType { get; set; } - /// <code>true</code> to use 32-bit worker process; otherwise, <code>false</code>. + + /// + /// Gets or sets SCM type. Possible values include: 'None', 'Dropbox', + /// 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + /// 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + /// 'OneDrive', 'VSO', 'VSTSRM' + /// + [JsonProperty(PropertyName = "properties.scmType")] + public string ScmType { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to use + /// 32-bit worker process; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.use32BitWorkerProcess")] public bool? Use32BitWorkerProcess { get; set; } - /// <code>true</code> if WebSocket is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// WebSocket is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.webSocketsEnabled")] public bool? WebSocketsEnabled { get; set; } - /// <code>true</code> if Always On is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// Always On is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.alwaysOn")] public bool? AlwaysOn { get; set; } - /// Java version. + + /// + /// Gets or sets java version. + /// + [JsonProperty(PropertyName = "properties.javaVersion")] public string JavaVersion { get; set; } - /// Java container. + + /// + /// Gets or sets java container. + /// + [JsonProperty(PropertyName = "properties.javaContainer")] public string JavaContainer { get; set; } - /// Java container version. + + /// + /// Gets or sets java container version. + /// + [JsonProperty(PropertyName = "properties.javaContainerVersion")] public string JavaContainerVersion { get; set; } - /// App command line to launch. + + /// + /// Gets or sets app command line to launch. + /// + [JsonProperty(PropertyName = "properties.appCommandLine")] public string AppCommandLine { get; set; } - /// Managed pipeline mode. + + /// + /// Gets or sets managed pipeline mode. Possible values include: + /// 'Integrated', 'Classic' + /// + [JsonProperty(PropertyName = "properties.managedPipelineMode")] public ManagedPipelineMode? ManagedPipelineMode { get; set; } - /// Virtual applications. - public IList VirtualApplications { get; } - /// Site load balancing. + + /// + /// Gets or sets virtual applications. + /// + [JsonProperty(PropertyName = "properties.virtualApplications")] + public IList VirtualApplications { get; set; } + + /// + /// Gets or sets site load balancing. Possible values include: + /// 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + /// 'WeightedTotalTraffic', 'RequestHash' + /// + [JsonProperty(PropertyName = "properties.loadBalancing")] public SiteLoadBalancing? LoadBalancing { get; set; } - /// This is work around for polymorphic types. + + /// + /// Gets or sets this is work around for polymorphic types. + /// + [JsonProperty(PropertyName = "properties.experiments")] public Experiments Experiments { get; set; } - /// Site limits. + + /// + /// Gets or sets site limits. + /// + [JsonProperty(PropertyName = "properties.limits")] public SiteLimits Limits { get; set; } - /// <code>true</code> if Auto Heal is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if Auto + /// Heal is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.autoHealEnabled")] public bool? AutoHealEnabled { get; set; } - /// Auto Heal rules. + + /// + /// Gets or sets auto Heal rules. + /// + [JsonProperty(PropertyName = "properties.autoHealRules")] public AutoHealRules AutoHealRules { get; set; } - /// Tracing options. + + /// + /// Gets or sets tracing options. + /// + [JsonProperty(PropertyName = "properties.tracingOptions")] public string TracingOptions { get; set; } - /// Virtual Network name. + + /// + /// Gets or sets virtual Network name. + /// + [JsonProperty(PropertyName = "properties.vnetName")] public string VnetName { get; set; } - /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. - public bool? VnetRouteAllEnabled { get; set; } - /// The number of private ports assigned to this app. These will be assigned dynamically on runtime. - public int? VnetPrivatePortsCount { get; set; } - /// Cross-Origin Resource Sharing (CORS) settings. + + /// + /// Gets or sets cross-Origin Resource Sharing (CORS) settings. + /// + [JsonProperty(PropertyName = "properties.cors")] public CorsSettings Cors { get; set; } - /// Push endpoint settings. + + /// + /// Gets or sets push endpoint settings. + /// + [JsonProperty(PropertyName = "properties.push")] public PushSettings Push { get; set; } - /// Information about the formal API definition for the app. + + /// + /// Gets or sets information about the formal API definition for the + /// app. + /// + [JsonProperty(PropertyName = "properties.apiDefinition")] public ApiDefinitionInfo ApiDefinition { get; set; } - /// Azure API management settings linked to the app. + + /// + /// Gets or sets azure API management settings linked to the app. + /// + [JsonProperty(PropertyName = "properties.apiManagementConfig")] public ApiManagementConfig ApiManagementConfig { get; set; } - /// Auto-swap slot name. + + /// + /// Gets or sets auto-swap slot name. + /// + [JsonProperty(PropertyName = "properties.autoSwapSlotName")] public string AutoSwapSlotName { get; set; } - /// <code>true</code> to enable local MySQL; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// enable local MySQL; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.localMySqlEnabled")] public bool? LocalMySqlEnabled { get; set; } - /// Managed Service Identity Id. + + /// + /// Gets or sets managed Service Identity Id + /// + [JsonProperty(PropertyName = "properties.managedServiceIdentityId")] public int? ManagedServiceIdentityId { get; set; } - /// Explicit Managed Service Identity Id. + + /// + /// Gets or sets explicit Managed Service Identity Id + /// + [JsonProperty(PropertyName = "properties.xManagedServiceIdentityId")] public int? XManagedServiceIdentityId { get; set; } - /// Identity to use for Key Vault Reference authentication. - public string KeyVaultReferenceIdentity { get; set; } - /// IP security restrictions for main. - public IList IpSecurityRestrictions { get; } - /// IP security restrictions for scm. - public IList ScmIpSecurityRestrictions { get; } - /// IP security restrictions for scm to use main. + + /// + /// Gets or sets IP security restrictions for main. + /// + [JsonProperty(PropertyName = "properties.ipSecurityRestrictions")] + public IList IpSecurityRestrictions { get; set; } + + /// + /// Gets or sets IP security restrictions for scm. + /// + [JsonProperty(PropertyName = "properties.scmIpSecurityRestrictions")] + public IList ScmIpSecurityRestrictions { get; set; } + + /// + /// Gets or sets IP security restrictions for scm to use main. + /// + [JsonProperty(PropertyName = "properties.scmIpSecurityRestrictionsUseMain")] public bool? ScmIpSecurityRestrictionsUseMain { get; set; } - /// Http20Enabled: configures a web site to allow clients to connect over http2.0. + + /// + /// Gets or sets http20Enabled: configures a web site to allow clients + /// to connect over http2.0 + /// + [JsonProperty(PropertyName = "properties.http20Enabled")] public bool? Http20Enabled { get; set; } - /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. - public SupportedTlsVersions? MinTlsVersion { get; set; } - /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. - public SupportedTlsVersions? ScmMinTlsVersion { get; set; } - /// State of FTP / FTPS service. - public FtpsState? FtpsState { get; set; } + /// - /// Number of preWarmed instances. - /// This setting only applies to the Consumption and Elastic Plans. + /// Gets or sets minTlsVersion: configures the minimum version of TLS + /// required for SSL requests. Possible values include: '1.0', '1.1', + /// '1.2' /// - public int? PreWarmedInstanceCount { get; set; } + [JsonProperty(PropertyName = "properties.minTlsVersion")] + public string MinTlsVersion { get; set; } + /// - /// Maximum number of workers that a site can scale out to. - /// This setting only applies to the Consumption and Elastic Premium Plans. + /// Gets or sets state of FTP / FTPS service. Possible values include: + /// 'AllAllowed', 'FtpsOnly', 'Disabled' /// - public int? FunctionAppScaleLimit { get; set; } - /// Health check path. - public string HealthCheckPath { get; set; } + [JsonProperty(PropertyName = "properties.ftpsState")] + public string FtpsState { get; set; } + /// - /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, - /// the ScaleController will not monitor event sources directly, but will instead call to the - /// runtime to get scale status. + /// Gets or sets number of preWarmed instances. + /// This setting only applies to the Consumption and Elastic Plans /// - public bool? FunctionsRuntimeScaleMonitoringEnabled { get; set; } - /// Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. - public string WebsiteTimeZone { get; set; } + [JsonProperty(PropertyName = "properties.preWarmedInstanceCount")] + public int? PreWarmedInstanceCount { get; set; } + /// - /// Number of minimum instance count for a site - /// This setting only applies to the Elastic Plans. + /// Gets or sets health check path /// - public int? MinimumElasticInstanceCount { get; set; } - /// List of Azure Storage Accounts. - public IDictionary AzureStorageAccounts { get; } - /// Property to allow or block all public traffic. - public string PublicNetworkAccess { get; set; } + [JsonProperty(PropertyName = "properties.healthCheckPath")] + public string HealthCheckPath { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Push != null) + { + Push.Validate(); + } + if (PreWarmedInstanceCount > 10) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "PreWarmedInstanceCount", 10); + } + if (PreWarmedInstanceCount < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "PreWarmedInstanceCount", 0); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.Serialization.cs deleted file mode 100644 index 256a52412710..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class SiteConfigResourceCollection - { - internal static SiteConfigResourceCollection DeserializeSiteConfigResourceCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SiteConfigResource.DeserializeSiteConfigResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SiteConfigResourceCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.cs deleted file mode 100644 index 111bebf697d2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResourceCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of site configurations. - internal partial class SiteConfigResourceCollection - { - /// Initializes a new instance of SiteConfigResourceCollection. - /// Collection of resources. - /// is null. - internal SiteConfigResourceCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of SiteConfigResourceCollection. - /// Collection of resources. - /// Link to next page of resources. - internal SiteConfigResourceCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.Serialization.cs deleted file mode 100644 index 922e8abe71f7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.Serialization.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteConfigurationSnapshotInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SiteConfigurationSnapshotInfo DeserializeSiteConfigurationSnapshotInfo(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional time = default; - Optional snapshotId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("time")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - time = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("snapshotId")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - snapshotId = property0.Value.GetInt32(); - continue; - } - } - continue; - } - } - return new SiteConfigurationSnapshotInfo(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(time), Optional.ToNullable(snapshotId)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.cs index 8f62027ab9be..8223f04b14fe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfo.cs @@ -1,38 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// A snapshot of a web app configuration. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A snapshot of a web app configuration. + /// + [Rest.Serialization.JsonTransformation] public partial class SiteConfigurationSnapshotInfo : ProxyOnlyResource { - /// Initializes a new instance of SiteConfigurationSnapshotInfo. + /// + /// Initializes a new instance of the SiteConfigurationSnapshotInfo + /// class. + /// public SiteConfigurationSnapshotInfo() { + CustomInit(); } - /// Initializes a new instance of SiteConfigurationSnapshotInfo. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The time the snapshot was taken. - /// The id of the snapshot. - internal SiteConfigurationSnapshotInfo(string id, string name, string kind, string type, DateTimeOffset? time, int? snapshotId) : base(id, name, kind, type) + /// + /// Initializes a new instance of the SiteConfigurationSnapshotInfo + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The time the snapshot was taken. + /// The id of the snapshot + public SiteConfigurationSnapshotInfo(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), System.DateTime? time = default(System.DateTime?), int? snapshotId = default(int?)) + : base(id, name, kind, type) { Time = time; SnapshotId = snapshotId; + CustomInit(); } - /// The time the snapshot was taken. - public DateTimeOffset? Time { get; } - /// The id of the snapshot. - public int? SnapshotId { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the time the snapshot was taken. + /// + [JsonProperty(PropertyName = "properties.time")] + public System.DateTime? Time { get; private set; } + + /// + /// Gets the id of the snapshot + /// + [JsonProperty(PropertyName = "properties.snapshotId")] + public int? SnapshotId { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.Serialization.cs deleted file mode 100644 index bd63a5f971a3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class SiteConfigurationSnapshotInfoCollection - { - internal static SiteConfigurationSnapshotInfoCollection DeserializeSiteConfigurationSnapshotInfoCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SiteConfigurationSnapshotInfo.DeserializeSiteConfigurationSnapshotInfo(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SiteConfigurationSnapshotInfoCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.cs deleted file mode 100644 index d16563d6ca4b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigurationSnapshotInfoCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of metadata for the app configuration snapshots that can be restored. - internal partial class SiteConfigurationSnapshotInfoCollection - { - /// Initializes a new instance of SiteConfigurationSnapshotInfoCollection. - /// Collection of resources. - /// is null. - internal SiteConfigurationSnapshotInfoCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of SiteConfigurationSnapshotInfoCollection. - /// Collection of resources. - /// Link to next page of resources. - internal SiteConfigurationSnapshotInfoCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.Serialization.cs deleted file mode 100644 index d43b3f8aacb1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.Serialization.cs +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteExtensionInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ExtensionId)) - { - writer.WritePropertyName("extension_id"); - writer.WriteStringValue(ExtensionId); - } - if (Optional.IsDefined(Title)) - { - writer.WritePropertyName("title"); - writer.WriteStringValue(Title); - } - if (Optional.IsDefined(ExtensionType)) - { - writer.WritePropertyName("extension_type"); - writer.WriteStringValue(ExtensionType.Value.ToSerialString()); - } - if (Optional.IsDefined(Summary)) - { - writer.WritePropertyName("summary"); - writer.WriteStringValue(Summary); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("version"); - writer.WriteStringValue(Version); - } - if (Optional.IsDefined(ExtensionUrl)) - { - writer.WritePropertyName("extension_url"); - writer.WriteStringValue(ExtensionUrl); - } - if (Optional.IsDefined(ProjectUrl)) - { - writer.WritePropertyName("project_url"); - writer.WriteStringValue(ProjectUrl); - } - if (Optional.IsDefined(IconUrl)) - { - writer.WritePropertyName("icon_url"); - writer.WriteStringValue(IconUrl); - } - if (Optional.IsDefined(LicenseUrl)) - { - writer.WritePropertyName("license_url"); - writer.WriteStringValue(LicenseUrl); - } - if (Optional.IsDefined(FeedUrl)) - { - writer.WritePropertyName("feed_url"); - writer.WriteStringValue(FeedUrl); - } - if (Optional.IsCollectionDefined(Authors)) - { - writer.WritePropertyName("authors"); - writer.WriteStartArray(); - foreach (var item in Authors) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(InstallerCommandLineParams)) - { - writer.WritePropertyName("installer_command_line_params"); - writer.WriteStringValue(InstallerCommandLineParams); - } - if (Optional.IsDefined(PublishedDateTime)) - { - writer.WritePropertyName("published_date_time"); - writer.WriteStringValue(PublishedDateTime.Value, "O"); - } - if (Optional.IsDefined(DownloadCount)) - { - writer.WritePropertyName("download_count"); - writer.WriteNumberValue(DownloadCount.Value); - } - if (Optional.IsDefined(LocalIsLatestVersion)) - { - writer.WritePropertyName("local_is_latest_version"); - writer.WriteBooleanValue(LocalIsLatestVersion.Value); - } - if (Optional.IsDefined(LocalPath)) - { - writer.WritePropertyName("local_path"); - writer.WriteStringValue(LocalPath); - } - if (Optional.IsDefined(InstalledDateTime)) - { - writer.WritePropertyName("installed_date_time"); - writer.WriteStringValue(InstalledDateTime.Value, "O"); - } - if (Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"); - writer.WriteStringValue(ProvisioningState); - } - if (Optional.IsDefined(Comment)) - { - writer.WritePropertyName("comment"); - writer.WriteStringValue(Comment); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SiteExtensionInfo DeserializeSiteExtensionInfo(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional extensionId = default; - Optional title = default; - Optional extensionType = default; - Optional summary = default; - Optional description = default; - Optional version = default; - Optional extensionUrl = default; - Optional projectUrl = default; - Optional iconUrl = default; - Optional licenseUrl = default; - Optional feedUrl = default; - Optional> authors = default; - Optional installerCommandLineParams = default; - Optional publishedDateTime = default; - Optional downloadCount = default; - Optional localIsLatestVersion = default; - Optional localPath = default; - Optional installedDateTime = default; - Optional provisioningState = default; - Optional comment = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("extension_id")) - { - extensionId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("title")) - { - title = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("extension_type")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - extensionType = property0.Value.GetString().ToSiteExtensionType(); - continue; - } - if (property0.NameEquals("summary")) - { - summary = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description")) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("version")) - { - version = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("extension_url")) - { - extensionUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("project_url")) - { - projectUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("icon_url")) - { - iconUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("license_url")) - { - licenseUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("feed_url")) - { - feedUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("authors")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - authors = array; - continue; - } - if (property0.NameEquals("installer_command_line_params")) - { - installerCommandLineParams = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("published_date_time")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - publishedDateTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("download_count")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - downloadCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("local_is_latest_version")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - localIsLatestVersion = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("local_path")) - { - localPath = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("installed_date_time")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - installedDateTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("provisioningState")) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("comment")) - { - comment = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new SiteExtensionInfo(id.Value, name.Value, kind.Value, type.Value, extensionId.Value, title.Value, Optional.ToNullable(extensionType), summary.Value, description.Value, version.Value, extensionUrl.Value, projectUrl.Value, iconUrl.Value, licenseUrl.Value, feedUrl.Value, Optional.ToList(authors), installerCommandLineParams.Value, Optional.ToNullable(publishedDateTime), Optional.ToNullable(downloadCount), Optional.ToNullable(localIsLatestVersion), localPath.Value, Optional.ToNullable(installedDateTime), provisioningState.Value, comment.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.cs index cb5d86445a53..e7a3772cee59 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfo.cs @@ -1,51 +1,68 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Site Extension Information. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Site Extension Information. + /// + [Rest.Serialization.JsonTransformation] public partial class SiteExtensionInfo : ProxyOnlyResource { - /// Initializes a new instance of SiteExtensionInfo. + /// + /// Initializes a new instance of the SiteExtensionInfo class. + /// public SiteExtensionInfo() { - Authors = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of SiteExtensionInfo. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Site extension ID. - /// . - /// Site extension type. - /// Summary description. - /// Detailed description. - /// Version information. - /// Extension URL. - /// Project URL. - /// Icon URL. - /// License URL. - /// Feed URL. - /// List of authors. - /// Installer command line parameters. - /// Published timestamp. - /// Count of downloads. - /// <code>true</code> if the local version is the latest version; <code>false</code> otherwise. - /// Local path. - /// Installed timestamp. - /// Provisioning state. - /// Site Extension comment. - internal SiteExtensionInfo(string id, string name, string kind, string type, string extensionId, string title, SiteExtensionType? extensionType, string summary, string description, string version, string extensionUrl, string projectUrl, string iconUrl, string licenseUrl, string feedUrl, IList authors, string installerCommandLineParams, DateTimeOffset? publishedDateTime, int? downloadCount, bool? localIsLatestVersion, string localPath, DateTimeOffset? installedDateTime, string provisioningState, string comment) : base(id, name, kind, type) + /// + /// Initializes a new instance of the SiteExtensionInfo class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Site extension ID. + /// Site extension type. Possible values + /// include: 'Gallery', 'WebRoot' + /// Summary description. + /// Detailed description. + /// Version information. + /// Extension URL. + /// Project URL. + /// Icon URL. + /// License URL. + /// Feed URL. + /// List of authors. + /// Installer command line + /// parameters. + /// Published timestamp. + /// Count of downloads. + /// <code>true</code> if + /// the local version is the latest version; + /// <code>false</code> otherwise. + /// Local path. + /// Installed timestamp. + /// Provisioning state. + /// Site Extension comment. + public SiteExtensionInfo(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string extensionId = default(string), string title = default(string), SiteExtensionType? extensionType = default(SiteExtensionType?), string summary = default(string), string description = default(string), string version = default(string), string extensionUrl = default(string), string projectUrl = default(string), string iconUrl = default(string), string licenseUrl = default(string), string feedUrl = default(string), IList authors = default(IList), string installerCommandLineParams = default(string), System.DateTime? publishedDateTime = default(System.DateTime?), int? downloadCount = default(int?), bool? localIsLatestVersion = default(bool?), string localPath = default(string), System.DateTime? installedDateTime = default(System.DateTime?), string provisioningState = default(string), string comment = default(string)) + : base(id, name, kind, type) { ExtensionId = extensionId; Title = title; @@ -67,46 +84,135 @@ internal SiteExtensionInfo(string id, string name, string kind, string type, str InstalledDateTime = installedDateTime; ProvisioningState = provisioningState; Comment = comment; + CustomInit(); } - /// Site extension ID. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets site extension ID. + /// + [JsonProperty(PropertyName = "properties.extension_id")] public string ExtensionId { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.title")] public string Title { get; set; } - /// Site extension type. + + /// + /// Gets or sets site extension type. Possible values include: + /// 'Gallery', 'WebRoot' + /// + [JsonProperty(PropertyName = "properties.extension_type")] public SiteExtensionType? ExtensionType { get; set; } - /// Summary description. + + /// + /// Gets or sets summary description. + /// + [JsonProperty(PropertyName = "properties.summary")] public string Summary { get; set; } - /// Detailed description. + + /// + /// Gets or sets detailed description. + /// + [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } - /// Version information. + + /// + /// Gets or sets version information. + /// + [JsonProperty(PropertyName = "properties.version")] public string Version { get; set; } - /// Extension URL. + + /// + /// Gets or sets extension URL. + /// + [JsonProperty(PropertyName = "properties.extension_url")] public string ExtensionUrl { get; set; } - /// Project URL. + + /// + /// Gets or sets project URL. + /// + [JsonProperty(PropertyName = "properties.project_url")] public string ProjectUrl { get; set; } - /// Icon URL. + + /// + /// Gets or sets icon URL. + /// + [JsonProperty(PropertyName = "properties.icon_url")] public string IconUrl { get; set; } - /// License URL. + + /// + /// Gets or sets license URL. + /// + [JsonProperty(PropertyName = "properties.license_url")] public string LicenseUrl { get; set; } - /// Feed URL. + + /// + /// Gets or sets feed URL. + /// + [JsonProperty(PropertyName = "properties.feed_url")] public string FeedUrl { get; set; } - /// List of authors. - public IList Authors { get; } - /// Installer command line parameters. + + /// + /// Gets or sets list of authors. + /// + [JsonProperty(PropertyName = "properties.authors")] + public IList Authors { get; set; } + + /// + /// Gets or sets installer command line parameters. + /// + [JsonProperty(PropertyName = "properties.installer_command_line_params")] public string InstallerCommandLineParams { get; set; } - /// Published timestamp. - public DateTimeOffset? PublishedDateTime { get; set; } - /// Count of downloads. + + /// + /// Gets or sets published timestamp. + /// + [JsonProperty(PropertyName = "properties.published_date_time")] + public System.DateTime? PublishedDateTime { get; set; } + + /// + /// Gets or sets count of downloads. + /// + [JsonProperty(PropertyName = "properties.download_count")] public int? DownloadCount { get; set; } - /// <code>true</code> if the local version is the latest version; <code>false</code> otherwise. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// local version is the latest version; + /// &lt;code&gt;false&lt;/code&gt; otherwise. + /// + [JsonProperty(PropertyName = "properties.local_is_latest_version")] public bool? LocalIsLatestVersion { get; set; } - /// Local path. + + /// + /// Gets or sets local path. + /// + [JsonProperty(PropertyName = "properties.local_path")] public string LocalPath { get; set; } - /// Installed timestamp. - public DateTimeOffset? InstalledDateTime { get; set; } - /// Provisioning state. + + /// + /// Gets or sets installed timestamp. + /// + [JsonProperty(PropertyName = "properties.installed_date_time")] + public System.DateTime? InstalledDateTime { get; set; } + + /// + /// Gets or sets provisioning state. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } - /// Site Extension comment. + + /// + /// Gets or sets site Extension comment. + /// + [JsonProperty(PropertyName = "properties.comment")] public string Comment { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.Serialization.cs deleted file mode 100644 index c23a781aa1e9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class SiteExtensionInfoCollection - { - internal static SiteExtensionInfoCollection DeserializeSiteExtensionInfoCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SiteExtensionInfo.DeserializeSiteExtensionInfo(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SiteExtensionInfoCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.cs deleted file mode 100644 index 51e6593fada7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionInfoCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Kudu site extension information elements. - internal partial class SiteExtensionInfoCollection - { - /// Initializes a new instance of SiteExtensionInfoCollection. - /// Collection of resources. - /// is null. - internal SiteExtensionInfoCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of SiteExtensionInfoCollection. - /// Collection of resources. - /// Link to next page of resources. - internal SiteExtensionInfoCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.Serialization.cs deleted file mode 100644 index 37fea7aaf785..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class SiteExtensionTypeExtensions - { - public static string ToSerialString(this SiteExtensionType value) => value switch - { - SiteExtensionType.Gallery => "Gallery", - SiteExtensionType.WebRoot => "WebRoot", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteExtensionType value.") - }; - - public static SiteExtensionType ToSiteExtensionType(this string value) - { - if (string.Equals(value, "Gallery", StringComparison.InvariantCultureIgnoreCase)) return SiteExtensionType.Gallery; - if (string.Equals(value, "WebRoot", StringComparison.InvariantCultureIgnoreCase)) return SiteExtensionType.WebRoot; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteExtensionType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.cs index d83c49bc9642..70c406c4d640 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteExtensionType.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Site extension type. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SiteExtensionType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum SiteExtensionType { - /// Gallery. + [EnumMember(Value = "Gallery")] Gallery, - /// WebRoot. + [EnumMember(Value = "WebRoot")] WebRoot } + internal static class SiteExtensionTypeEnumExtension + { + internal static string ToSerializedValue(this SiteExtensionType? value) + { + return value == null ? null : ((SiteExtensionType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SiteExtensionType value) + { + switch( value ) + { + case SiteExtensionType.Gallery: + return "Gallery"; + case SiteExtensionType.WebRoot: + return "WebRoot"; + } + return null; + } + + internal static SiteExtensionType? ParseSiteExtensionType(this string value) + { + switch( value ) + { + case "Gallery": + return SiteExtensionType.Gallery; + case "WebRoot": + return SiteExtensionType.WebRoot; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.Serialization.cs deleted file mode 100644 index 6e51e73b2af3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.Serialization.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteLimits : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(MaxPercentageCpu)) - { - writer.WritePropertyName("maxPercentageCpu"); - writer.WriteNumberValue(MaxPercentageCpu.Value); - } - if (Optional.IsDefined(MaxMemoryInMb)) - { - writer.WritePropertyName("maxMemoryInMb"); - writer.WriteNumberValue(MaxMemoryInMb.Value); - } - if (Optional.IsDefined(MaxDiskSizeInMb)) - { - writer.WritePropertyName("maxDiskSizeInMb"); - writer.WriteNumberValue(MaxDiskSizeInMb.Value); - } - writer.WriteEndObject(); - } - - internal static SiteLimits DeserializeSiteLimits(JsonElement element) - { - Optional maxPercentageCpu = default; - Optional maxMemoryInMb = default; - Optional maxDiskSizeInMb = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("maxPercentageCpu")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maxPercentageCpu = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("maxMemoryInMb")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maxMemoryInMb = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("maxDiskSizeInMb")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maxDiskSizeInMb = property.Value.GetInt64(); - continue; - } - } - return new SiteLimits(Optional.ToNullable(maxPercentageCpu), Optional.ToNullable(maxMemoryInMb), Optional.ToNullable(maxDiskSizeInMb)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.cs index c91e211d704c..384ed21eb59f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLimits.cs @@ -1,36 +1,70 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Metric limits set on an app. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metric limits set on an app. + /// public partial class SiteLimits { - /// Initializes a new instance of SiteLimits. + /// + /// Initializes a new instance of the SiteLimits class. + /// public SiteLimits() { + CustomInit(); } - /// Initializes a new instance of SiteLimits. - /// Maximum allowed CPU usage percentage. - /// Maximum allowed memory usage in MB. - /// Maximum allowed disk size usage in MB. - internal SiteLimits(double? maxPercentageCpu, long? maxMemoryInMb, long? maxDiskSizeInMb) + /// + /// Initializes a new instance of the SiteLimits class. + /// + /// Maximum allowed CPU usage + /// percentage. + /// Maximum allowed memory usage in + /// MB. + /// Maximum allowed disk size usage in + /// MB. + public SiteLimits(double? maxPercentageCpu = default(double?), long? maxMemoryInMb = default(long?), long? maxDiskSizeInMb = default(long?)) { MaxPercentageCpu = maxPercentageCpu; MaxMemoryInMb = maxMemoryInMb; MaxDiskSizeInMb = maxDiskSizeInMb; + CustomInit(); } - /// Maximum allowed CPU usage percentage. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets maximum allowed CPU usage percentage. + /// + [JsonProperty(PropertyName = "maxPercentageCpu")] public double? MaxPercentageCpu { get; set; } - /// Maximum allowed memory usage in MB. + + /// + /// Gets or sets maximum allowed memory usage in MB. + /// + [JsonProperty(PropertyName = "maxMemoryInMb")] public long? MaxMemoryInMb { get; set; } - /// Maximum allowed disk size usage in MB. + + /// + /// Gets or sets maximum allowed disk size usage in MB. + /// + [JsonProperty(PropertyName = "maxDiskSizeInMb")] public long? MaxDiskSizeInMb { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.Serialization.cs deleted file mode 100644 index 71fb8603f597..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class SiteLoadBalancingExtensions - { - public static string ToSerialString(this SiteLoadBalancing value) => value switch - { - SiteLoadBalancing.WeightedRoundRobin => "WeightedRoundRobin", - SiteLoadBalancing.LeastRequests => "LeastRequests", - SiteLoadBalancing.LeastResponseTime => "LeastResponseTime", - SiteLoadBalancing.WeightedTotalTraffic => "WeightedTotalTraffic", - SiteLoadBalancing.RequestHash => "RequestHash", - SiteLoadBalancing.PerSiteRoundRobin => "PerSiteRoundRobin", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteLoadBalancing value.") - }; - - public static SiteLoadBalancing ToSiteLoadBalancing(this string value) - { - if (string.Equals(value, "WeightedRoundRobin", StringComparison.InvariantCultureIgnoreCase)) return SiteLoadBalancing.WeightedRoundRobin; - if (string.Equals(value, "LeastRequests", StringComparison.InvariantCultureIgnoreCase)) return SiteLoadBalancing.LeastRequests; - if (string.Equals(value, "LeastResponseTime", StringComparison.InvariantCultureIgnoreCase)) return SiteLoadBalancing.LeastResponseTime; - if (string.Equals(value, "WeightedTotalTraffic", StringComparison.InvariantCultureIgnoreCase)) return SiteLoadBalancing.WeightedTotalTraffic; - if (string.Equals(value, "RequestHash", StringComparison.InvariantCultureIgnoreCase)) return SiteLoadBalancing.RequestHash; - if (string.Equals(value, "PerSiteRoundRobin", StringComparison.InvariantCultureIgnoreCase)) return SiteLoadBalancing.PerSiteRoundRobin; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteLoadBalancing value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs index 49196d582e58..f7bae36f84b6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs @@ -1,26 +1,78 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Site load balancing. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SiteLoadBalancing. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum SiteLoadBalancing { - /// WeightedRoundRobin. + [EnumMember(Value = "WeightedRoundRobin")] WeightedRoundRobin, - /// LeastRequests. + [EnumMember(Value = "LeastRequests")] LeastRequests, - /// LeastResponseTime. + [EnumMember(Value = "LeastResponseTime")] LeastResponseTime, - /// WeightedTotalTraffic. + [EnumMember(Value = "WeightedTotalTraffic")] WeightedTotalTraffic, - /// RequestHash. - RequestHash, - /// PerSiteRoundRobin. - PerSiteRoundRobin + [EnumMember(Value = "RequestHash")] + RequestHash + } + internal static class SiteLoadBalancingEnumExtension + { + internal static string ToSerializedValue(this SiteLoadBalancing? value) + { + return value == null ? null : ((SiteLoadBalancing)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SiteLoadBalancing value) + { + switch( value ) + { + case SiteLoadBalancing.WeightedRoundRobin: + return "WeightedRoundRobin"; + case SiteLoadBalancing.LeastRequests: + return "LeastRequests"; + case SiteLoadBalancing.LeastResponseTime: + return "LeastResponseTime"; + case SiteLoadBalancing.WeightedTotalTraffic: + return "WeightedTotalTraffic"; + case SiteLoadBalancing.RequestHash: + return "RequestHash"; + } + return null; + } + + internal static SiteLoadBalancing? ParseSiteLoadBalancing(this string value) + { + switch( value ) + { + case "WeightedRoundRobin": + return SiteLoadBalancing.WeightedRoundRobin; + case "LeastRequests": + return SiteLoadBalancing.LeastRequests; + case "LeastResponseTime": + return SiteLoadBalancing.LeastResponseTime; + case "WeightedTotalTraffic": + return SiteLoadBalancing.WeightedTotalTraffic; + case "RequestHash": + return SiteLoadBalancing.RequestHash; + } + return null; + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.Serialization.cs deleted file mode 100644 index 6fb27c5226a7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteLogsConfig : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ApplicationLogs)) - { - writer.WritePropertyName("applicationLogs"); - writer.WriteObjectValue(ApplicationLogs); - } - if (Optional.IsDefined(HttpLogs)) - { - writer.WritePropertyName("httpLogs"); - writer.WriteObjectValue(HttpLogs); - } - if (Optional.IsDefined(FailedRequestsTracing)) - { - writer.WritePropertyName("failedRequestsTracing"); - writer.WriteObjectValue(FailedRequestsTracing); - } - if (Optional.IsDefined(DetailedErrorMessages)) - { - writer.WritePropertyName("detailedErrorMessages"); - writer.WriteObjectValue(DetailedErrorMessages); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SiteLogsConfig DeserializeSiteLogsConfig(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional applicationLogs = default; - Optional httpLogs = default; - Optional failedRequestsTracing = default; - Optional detailedErrorMessages = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("applicationLogs")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - applicationLogs = ApplicationLogsConfig.DeserializeApplicationLogsConfig(property0.Value); - continue; - } - if (property0.NameEquals("httpLogs")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - httpLogs = HttpLogsConfig.DeserializeHttpLogsConfig(property0.Value); - continue; - } - if (property0.NameEquals("failedRequestsTracing")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - failedRequestsTracing = EnabledConfig.DeserializeEnabledConfig(property0.Value); - continue; - } - if (property0.NameEquals("detailedErrorMessages")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - detailedErrorMessages = EnabledConfig.DeserializeEnabledConfig(property0.Value); - continue; - } - } - continue; - } - } - return new SiteLogsConfig(id.Value, name.Value, kind.Value, type.Value, applicationLogs.Value, httpLogs.Value, failedRequestsTracing.Value, detailedErrorMessages.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.cs index 839a01fcd912..79c82b86b0e1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLogsConfig.cs @@ -1,44 +1,103 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Configuration of App Service site logs. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Configuration of App Service site logs. + /// + [Rest.Serialization.JsonTransformation] public partial class SiteLogsConfig : ProxyOnlyResource { - /// Initializes a new instance of SiteLogsConfig. + /// + /// Initializes a new instance of the SiteLogsConfig class. + /// public SiteLogsConfig() { + CustomInit(); } - /// Initializes a new instance of SiteLogsConfig. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Application logs configuration. - /// HTTP logs configuration. - /// Failed requests tracing configuration. - /// Detailed error messages configuration. - internal SiteLogsConfig(string id, string name, string kind, string type, ApplicationLogsConfig applicationLogs, HttpLogsConfig httpLogs, EnabledConfig failedRequestsTracing, EnabledConfig detailedErrorMessages) : base(id, name, kind, type) + /// + /// Initializes a new instance of the SiteLogsConfig class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Application logs + /// configuration. + /// HTTP logs configuration. + /// Failed requests tracing + /// configuration. + /// Detailed error messages + /// configuration. + public SiteLogsConfig(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ApplicationLogsConfig applicationLogs = default(ApplicationLogsConfig), HttpLogsConfig httpLogs = default(HttpLogsConfig), EnabledConfig failedRequestsTracing = default(EnabledConfig), EnabledConfig detailedErrorMessages = default(EnabledConfig)) + : base(id, name, kind, type) { ApplicationLogs = applicationLogs; HttpLogs = httpLogs; FailedRequestsTracing = failedRequestsTracing; DetailedErrorMessages = detailedErrorMessages; + CustomInit(); } - /// Application logs configuration. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets application logs configuration. + /// + [JsonProperty(PropertyName = "properties.applicationLogs")] public ApplicationLogsConfig ApplicationLogs { get; set; } - /// HTTP logs configuration. + + /// + /// Gets or sets HTTP logs configuration. + /// + [JsonProperty(PropertyName = "properties.httpLogs")] public HttpLogsConfig HttpLogs { get; set; } - /// Failed requests tracing configuration. + + /// + /// Gets or sets failed requests tracing configuration. + /// + [JsonProperty(PropertyName = "properties.failedRequestsTracing")] public EnabledConfig FailedRequestsTracing { get; set; } - /// Detailed error messages configuration. + + /// + /// Gets or sets detailed error messages configuration. + /// + [JsonProperty(PropertyName = "properties.detailedErrorMessages")] public EnabledConfig DetailedErrorMessages { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ApplicationLogs != null) + { + ApplicationLogs.Validate(); + } + if (HttpLogs != null) + { + HttpLogs.Validate(); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.Serialization.cs deleted file mode 100644 index 357853af7a1b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteMachineKey - { - internal static SiteMachineKey DeserializeSiteMachineKey(JsonElement element) - { - Optional validation = default; - Optional validationKey = default; - Optional decryption = default; - Optional decryptionKey = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("validation")) - { - validation = property.Value.GetString(); - continue; - } - if (property.NameEquals("validationKey")) - { - validationKey = property.Value.GetString(); - continue; - } - if (property.NameEquals("decryption")) - { - decryption = property.Value.GetString(); - continue; - } - if (property.NameEquals("decryptionKey")) - { - decryptionKey = property.Value.GetString(); - continue; - } - } - return new SiteMachineKey(validation.Value, validationKey.Value, decryption.Value, decryptionKey.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.cs index 8018ee373b54..5e6f9dc351cd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteMachineKey.cs @@ -1,40 +1,75 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// MachineKey of an app. + using Newtonsoft.Json; + using System.Linq; + + /// + /// MachineKey of an app. + /// public partial class SiteMachineKey { - /// Initializes a new instance of SiteMachineKey. - internal SiteMachineKey() + /// + /// Initializes a new instance of the SiteMachineKey class. + /// + public SiteMachineKey() { + CustomInit(); } - /// Initializes a new instance of SiteMachineKey. - /// MachineKey validation. - /// Validation key. - /// Algorithm used for decryption. - /// Decryption key. - internal SiteMachineKey(string validation, string validationKey, string decryption, string decryptionKey) + /// + /// Initializes a new instance of the SiteMachineKey class. + /// + /// MachineKey validation. + /// Validation key. + /// Algorithm used for decryption. + /// Decryption key. + public SiteMachineKey(string validation = default(string), string validationKey = default(string), string decryption = default(string), string decryptionKey = default(string)) { Validation = validation; ValidationKey = validationKey; Decryption = decryption; DecryptionKey = decryptionKey; + CustomInit(); } - /// MachineKey validation. - public string Validation { get; } - /// Validation key. - public string ValidationKey { get; } - /// Algorithm used for decryption. - public string Decryption { get; } - /// Decryption key. - public string DecryptionKey { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets machineKey validation. + /// + [JsonProperty(PropertyName = "validation")] + public string Validation { get; set; } + + /// + /// Gets or sets validation key. + /// + [JsonProperty(PropertyName = "validationKey")] + public string ValidationKey { get; set; } + + /// + /// Gets or sets algorithm used for decryption. + /// + [JsonProperty(PropertyName = "decryption")] + public string Decryption { get; set; } + + /// + /// Gets or sets decryption key. + /// + [JsonProperty(PropertyName = "decryptionKey")] + public string DecryptionKey { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.Serialization.cs deleted file mode 100644 index ceb4fd8203f2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.Serialization.cs +++ /dev/null @@ -1,622 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SitePatchResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"); - writer.WriteObjectValue(Identity); - } - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsCollectionDefined(HostNameSslStates)) - { - writer.WritePropertyName("hostNameSslStates"); - writer.WriteStartArray(); - foreach (var item in HostNameSslStates) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ServerFarmId)) - { - writer.WritePropertyName("serverFarmId"); - writer.WriteStringValue(ServerFarmId); - } - if (Optional.IsDefined(Reserved)) - { - writer.WritePropertyName("reserved"); - writer.WriteBooleanValue(Reserved.Value); - } - if (Optional.IsDefined(IsXenon)) - { - writer.WritePropertyName("isXenon"); - writer.WriteBooleanValue(IsXenon.Value); - } - if (Optional.IsDefined(HyperV)) - { - writer.WritePropertyName("hyperV"); - writer.WriteBooleanValue(HyperV.Value); - } - if (Optional.IsDefined(SiteConfig)) - { - writer.WritePropertyName("siteConfig"); - writer.WriteObjectValue(SiteConfig); - } - if (Optional.IsDefined(ScmSiteAlsoStopped)) - { - writer.WritePropertyName("scmSiteAlsoStopped"); - writer.WriteBooleanValue(ScmSiteAlsoStopped.Value); - } - if (Optional.IsDefined(HostingEnvironmentProfile)) - { - writer.WritePropertyName("hostingEnvironmentProfile"); - writer.WriteObjectValue(HostingEnvironmentProfile); - } - if (Optional.IsDefined(ClientAffinityEnabled)) - { - writer.WritePropertyName("clientAffinityEnabled"); - writer.WriteBooleanValue(ClientAffinityEnabled.Value); - } - if (Optional.IsDefined(ClientCertEnabled)) - { - writer.WritePropertyName("clientCertEnabled"); - writer.WriteBooleanValue(ClientCertEnabled.Value); - } - if (Optional.IsDefined(ClientCertMode)) - { - writer.WritePropertyName("clientCertMode"); - writer.WriteStringValue(ClientCertMode.Value.ToSerialString()); - } - if (Optional.IsDefined(ClientCertExclusionPaths)) - { - writer.WritePropertyName("clientCertExclusionPaths"); - writer.WriteStringValue(ClientCertExclusionPaths); - } - if (Optional.IsDefined(HostNamesDisabled)) - { - writer.WritePropertyName("hostNamesDisabled"); - writer.WriteBooleanValue(HostNamesDisabled.Value); - } - if (Optional.IsDefined(CustomDomainVerificationId)) - { - writer.WritePropertyName("customDomainVerificationId"); - writer.WriteStringValue(CustomDomainVerificationId); - } - if (Optional.IsDefined(ContainerSize)) - { - writer.WritePropertyName("containerSize"); - writer.WriteNumberValue(ContainerSize.Value); - } - if (Optional.IsDefined(DailyMemoryTimeQuota)) - { - writer.WritePropertyName("dailyMemoryTimeQuota"); - writer.WriteNumberValue(DailyMemoryTimeQuota.Value); - } - if (Optional.IsDefined(CloningInfo)) - { - writer.WritePropertyName("cloningInfo"); - writer.WriteObjectValue(CloningInfo); - } - if (Optional.IsDefined(HttpsOnly)) - { - writer.WritePropertyName("httpsOnly"); - writer.WriteBooleanValue(HttpsOnly.Value); - } - if (Optional.IsDefined(RedundancyMode)) - { - writer.WritePropertyName("redundancyMode"); - writer.WriteStringValue(RedundancyMode.Value.ToSerialString()); - } - if (Optional.IsDefined(StorageAccountRequired)) - { - writer.WritePropertyName("storageAccountRequired"); - writer.WriteBooleanValue(StorageAccountRequired.Value); - } - if (Optional.IsDefined(KeyVaultReferenceIdentity)) - { - writer.WritePropertyName("keyVaultReferenceIdentity"); - writer.WriteStringValue(KeyVaultReferenceIdentity); - } - if (Optional.IsDefined(VirtualNetworkSubnetId)) - { - writer.WritePropertyName("virtualNetworkSubnetId"); - writer.WriteStringValue(VirtualNetworkSubnetId); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SitePatchResource DeserializeSitePatchResource(JsonElement element) - { - Optional identity = default; - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional state = default; - Optional> hostNames = default; - Optional repositorySiteName = default; - Optional usageState = default; - Optional enabled = default; - Optional> enabledHostNames = default; - Optional availabilityState = default; - Optional> hostNameSslStates = default; - Optional serverFarmId = default; - Optional reserved = default; - Optional isXenon = default; - Optional hyperV = default; - Optional lastModifiedTimeUtc = default; - Optional siteConfig = default; - Optional> trafficManagerHostNames = default; - Optional scmSiteAlsoStopped = default; - Optional targetSwapSlot = default; - Optional hostingEnvironmentProfile = default; - Optional clientAffinityEnabled = default; - Optional clientCertEnabled = default; - Optional clientCertMode = default; - Optional clientCertExclusionPaths = default; - Optional hostNamesDisabled = default; - Optional customDomainVerificationId = default; - Optional outboundIpAddresses = default; - Optional possibleOutboundIpAddresses = default; - Optional containerSize = default; - Optional dailyMemoryTimeQuota = default; - Optional suspendedTill = default; - Optional maxNumberOfWorkers = default; - Optional cloningInfo = default; - Optional resourceGroup = default; - Optional isDefaultContainer = default; - Optional defaultHostName = default; - Optional slotSwapStatus = default; - Optional httpsOnly = default; - Optional redundancyMode = default; - Optional inProgressOperationId = default; - Optional storageAccountRequired = default; - Optional keyVaultReferenceIdentity = default; - Optional virtualNetworkSubnetId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value); - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("state")) - { - state = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - hostNames = array; - continue; - } - if (property0.NameEquals("repositorySiteName")) - { - repositorySiteName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("usageState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - usageState = property0.Value.GetString().ToUsageState(); - continue; - } - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("enabledHostNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - enabledHostNames = array; - continue; - } - if (property0.NameEquals("availabilityState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - availabilityState = property0.Value.GetString().ToSiteAvailabilityState(); - continue; - } - if (property0.NameEquals("hostNameSslStates")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(HostNameSslState.DeserializeHostNameSslState(item)); - } - hostNameSslStates = array; - continue; - } - if (property0.NameEquals("serverFarmId")) - { - serverFarmId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("reserved")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - reserved = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("isXenon")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isXenon = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("hyperV")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hyperV = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("lastModifiedTimeUtc")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - lastModifiedTimeUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("siteConfig")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - siteConfig = SiteConfig.DeserializeSiteConfig(property0.Value); - continue; - } - if (property0.NameEquals("trafficManagerHostNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - trafficManagerHostNames = array; - continue; - } - if (property0.NameEquals("scmSiteAlsoStopped")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - scmSiteAlsoStopped = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("targetSwapSlot")) - { - targetSwapSlot = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostingEnvironmentProfile")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); - continue; - } - if (property0.NameEquals("clientAffinityEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - clientAffinityEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("clientCertEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - clientCertEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("clientCertMode")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - clientCertMode = property0.Value.GetString().ToClientCertMode(); - continue; - } - if (property0.NameEquals("clientCertExclusionPaths")) - { - clientCertExclusionPaths = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostNamesDisabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hostNamesDisabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("customDomainVerificationId")) - { - customDomainVerificationId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("outboundIpAddresses")) - { - outboundIpAddresses = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("possibleOutboundIpAddresses")) - { - possibleOutboundIpAddresses = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("containerSize")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - containerSize = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("dailyMemoryTimeQuota")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - dailyMemoryTimeQuota = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("suspendedTill")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - suspendedTill = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("maxNumberOfWorkers")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - maxNumberOfWorkers = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("cloningInfo")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - cloningInfo = CloningInfo.DeserializeCloningInfo(property0.Value); - continue; - } - if (property0.NameEquals("resourceGroup")) - { - resourceGroup = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("isDefaultContainer")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isDefaultContainer = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("defaultHostName")) - { - defaultHostName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("slotSwapStatus")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - slotSwapStatus = SlotSwapStatus.DeserializeSlotSwapStatus(property0.Value); - continue; - } - if (property0.NameEquals("httpsOnly")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - httpsOnly = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("redundancyMode")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - redundancyMode = property0.Value.GetString().ToRedundancyMode(); - continue; - } - if (property0.NameEquals("inProgressOperationId")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - inProgressOperationId = property0.Value.GetGuid(); - continue; - } - if (property0.NameEquals("storageAccountRequired")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - storageAccountRequired = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("keyVaultReferenceIdentity")) - { - keyVaultReferenceIdentity = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("virtualNetworkSubnetId")) - { - virtualNetworkSubnetId = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new SitePatchResource(id.Value, name.Value, kind.Value, type.Value, identity.Value, state.Value, Optional.ToList(hostNames), repositorySiteName.Value, Optional.ToNullable(usageState), Optional.ToNullable(enabled), Optional.ToList(enabledHostNames), Optional.ToNullable(availabilityState), Optional.ToList(hostNameSslStates), serverFarmId.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(lastModifiedTimeUtc), siteConfig.Value, Optional.ToList(trafficManagerHostNames), Optional.ToNullable(scmSiteAlsoStopped), targetSwapSlot.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(clientAffinityEnabled), Optional.ToNullable(clientCertEnabled), Optional.ToNullable(clientCertMode), clientCertExclusionPaths.Value, Optional.ToNullable(hostNamesDisabled), customDomainVerificationId.Value, outboundIpAddresses.Value, possibleOutboundIpAddresses.Value, Optional.ToNullable(containerSize), Optional.ToNullable(dailyMemoryTimeQuota), Optional.ToNullable(suspendedTill), Optional.ToNullable(maxNumberOfWorkers), cloningInfo.Value, resourceGroup.Value, Optional.ToNullable(isDefaultContainer), defaultHostName.Value, slotSwapStatus.Value, Optional.ToNullable(httpsOnly), Optional.ToNullable(redundancyMode), Optional.ToNullable(inProgressOperationId), Optional.ToNullable(storageAccountRequired), keyVaultReferenceIdentity.Value, virtualNetworkSubnetId.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs index b3f5cb562a80..567a5fb54af7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs @@ -1,98 +1,146 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// ARM resource for a site. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// ARM resource for a site. + /// + [Rest.Serialization.JsonTransformation] public partial class SitePatchResource : ProxyOnlyResource { - /// Initializes a new instance of SitePatchResource. + /// + /// Initializes a new instance of the SitePatchResource class. + /// public SitePatchResource() { - HostNames = new ChangeTrackingList(); - EnabledHostNames = new ChangeTrackingList(); - HostNameSslStates = new ChangeTrackingList(); - TrafficManagerHostNames = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of SitePatchResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Managed service identity. - /// Current state of the app. - /// Hostnames associated with the app. - /// Name of the repository site. - /// State indicating whether the app has exceeded its quota usage. Read-only. - /// <code>true</code> if the app is enabled; otherwise, <code>false</code>. Setting this value to false disables the app (takes the app offline). - /// - /// Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, - /// the app is not served on those hostnames. - /// - /// Management information availability state for the app. - /// Hostname SSL states are used to manage the SSL bindings for app's hostnames. - /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - /// <code>true</code> if reserved; otherwise, <code>false</code>. - /// Obsolete: Hyper-V sandbox. - /// Hyper-V sandbox. - /// Last time the app was modified, in UTC. Read-only. - /// Configuration of the app. - /// Azure Traffic Manager hostnames associated with the app. Read-only. - /// <code>true</code> to stop SCM (KUDU) site when the app is stopped; otherwise, <code>false</code>. The default is <code>false</code>. - /// Specifies which deployment slot this app will swap into. Read-only. - /// App Service Environment to use for the app. - /// <code>true</code> to enable client affinity; <code>false</code> to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is <code>true</code>. - /// <code>true</code> to enable client certificate authentication (TLS mutual authentication); otherwise, <code>false</code>. Default is <code>false</code>. - /// - /// This composes with ClientCertEnabled setting. + /// + /// Initializes a new instance of the SitePatchResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Current state of the app. + /// Hostnames associated with the app. + /// Name of the repository + /// site. + /// State indicating whether the app has + /// exceeded its quota usage. Read-only. Possible values include: + /// 'Normal', 'Exceeded' + /// <code>true</code> if the app is + /// enabled; otherwise, <code>false</code>. Setting this + /// value to false disables the app (takes the app offline). + /// Enabled hostnames for the + /// app.Hostnames need to be assigned (see HostNames) AND enabled. + /// Otherwise, + /// the app is not served on those hostnames. + /// Management information availability + /// state for the app. Possible values include: 'Normal', 'Limited', + /// 'DisasterRecoveryMode' + /// Hostname SSL states are used to + /// manage the SSL bindings for app's hostnames. + /// Resource ID of the associated App + /// Service plan, formatted as: + /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + /// <code>true</code> if reserved; + /// otherwise, <code>false</code>. + /// Obsolete: Hyper-V sandbox. + /// Hyper-V sandbox. + /// Last time the app was modified, + /// in UTC. Read-only. + /// Configuration of the app. + /// Azure Traffic Manager + /// hostnames associated with the app. Read-only. + /// <code>true</code> to + /// stop SCM (KUDU) site when the app is stopped; otherwise, + /// <code>false</code>. The default is + /// <code>false</code>. + /// Specifies which deployment slot this + /// app will swap into. Read-only. + /// App Service Environment to + /// use for the app. + /// <code>true</code> + /// to enable client affinity; <code>false</code> to stop + /// sending session affinity cookies, which route client requests in + /// the same session to the same instance. Default is + /// <code>true</code>. + /// <code>true</code> to + /// enable client certificate authentication (TLS mutual + /// authentication); otherwise, <code>false</code>. Default + /// is <code>false</code>. + /// This composes with ClientCertEnabled + /// setting. /// - ClientCertEnabled: false means ClientCert is ignored. - /// - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. - /// - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. - /// - /// client certificate authentication comma-separated exclusion paths. - /// - /// <code>true</code> to disable the public hostnames of the app; otherwise, <code>false</code>. - /// If <code>true</code>, the app is only accessible via API management process. - /// - /// Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. - /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. - /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. - /// Size of the function container. - /// Maximum allowed daily memory-time quota (applicable on dynamic apps only). - /// App suspended till in case memory-time quota is exceeded. - /// - /// Maximum number of workers. - /// This only applies to Functions container. - /// - /// If specified during app creation, the app is cloned from a source app. - /// Name of the resource group the app belongs to. Read-only. - /// <code>true</code> if the app is a default container; otherwise, <code>false</code>. - /// Default hostname of the app. Read-only. - /// Status of the last deployment slot swap operation. - /// - /// HttpsOnly: configures a web site to accept only https requests. Issues redirect for - /// http requests. - /// - /// Site redundancy mode. - /// Specifies an operation id if this site has a pending operation. - /// Checks if Customer provided storage account is required. - /// Identity to use for Key Vault Reference authentication. - /// - /// Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. - /// This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - /// - internal SitePatchResource(string id, string name, string kind, string type, ManagedServiceIdentity identity, string state, IReadOnlyList hostNames, string repositorySiteName, UsageState? usageState, bool? enabled, IReadOnlyList enabledHostNames, SiteAvailabilityState? availabilityState, IList hostNameSslStates, string serverFarmId, bool? reserved, bool? isXenon, bool? hyperV, DateTimeOffset? lastModifiedTimeUtc, SiteConfig siteConfig, IReadOnlyList trafficManagerHostNames, bool? scmSiteAlsoStopped, string targetSwapSlot, HostingEnvironmentProfile hostingEnvironmentProfile, bool? clientAffinityEnabled, bool? clientCertEnabled, ClientCertMode? clientCertMode, string clientCertExclusionPaths, bool? hostNamesDisabled, string customDomainVerificationId, string outboundIpAddresses, string possibleOutboundIpAddresses, int? containerSize, int? dailyMemoryTimeQuota, DateTimeOffset? suspendedTill, int? maxNumberOfWorkers, CloningInfo cloningInfo, string resourceGroup, bool? isDefaultContainer, string defaultHostName, SlotSwapStatus slotSwapStatus, bool? httpsOnly, RedundancyMode? redundancyMode, Guid? inProgressOperationId, bool? storageAccountRequired, string keyVaultReferenceIdentity, string virtualNetworkSubnetId) : base(id, name, kind, type) + /// - ClientCertEnabled: true and ClientCertMode: Required means + /// ClientCert is required. + /// - ClientCertEnabled: true and ClientCertMode: Optional means + /// ClientCert is optional or accepted. Possible values include: + /// 'Required', 'Optional' + /// client certificate + /// authentication comma-separated exclusion paths + /// <code>true</code> to + /// disable the public hostnames of the app; otherwise, + /// <code>false</code>. + /// If <code>true</code>, the app is only accessible via + /// API management process. + /// Unique identifier that + /// verifies the custom domains assigned to the app. Customer will add + /// this id to a txt record for verification. + /// List of IP addresses that the app + /// uses for outbound connections (e.g. database access). Includes VIPs + /// from tenants that site can be hosted with current settings. + /// Read-only. + /// List of IP addresses that + /// the app uses for outbound connections (e.g. database access). + /// Includes VIPs from all tenants except dataComponent. + /// Read-only. + /// Size of the function container. + /// Maximum allowed daily + /// memory-time quota (applicable on dynamic apps only). + /// App suspended till in case memory-time + /// quota is exceeded. + /// Maximum number of workers. + /// This only applies to Functions container. + /// If specified during app creation, the app + /// is cloned from a source app. + /// Name of the resource group the app + /// belongs to. Read-only. + /// <code>true</code> if + /// the app is a default container; otherwise, + /// <code>false</code>. + /// Default hostname of the app. + /// Read-only. + /// Status of the last deployment slot + /// swap operation. + /// HttpsOnly: configures a web site to accept + /// only https requests. Issues redirect for + /// http requests + /// Site redundancy mode. Possible values + /// include: 'None', 'Manual', 'Failover', 'ActiveActive', + /// 'GeoRedundant' + /// Specifies an operation id if + /// this site has a pending operation. + public SitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + : base(id, name, kind, type) { - Identity = identity; State = state; HostNames = hostNames; RepositorySiteName = repositorySiteName; @@ -131,114 +179,317 @@ internal SitePatchResource(string id, string name, string kind, string type, Man HttpsOnly = httpsOnly; RedundancyMode = redundancyMode; InProgressOperationId = inProgressOperationId; - StorageAccountRequired = storageAccountRequired; - KeyVaultReferenceIdentity = keyVaultReferenceIdentity; - VirtualNetworkSubnetId = virtualNetworkSubnetId; + Identity = identity; + CustomInit(); } - /// Managed service identity. - public ManagedServiceIdentity Identity { get; set; } - /// Current state of the app. - public string State { get; } - /// Hostnames associated with the app. - public IReadOnlyList HostNames { get; } - /// Name of the repository site. - public string RepositorySiteName { get; } - /// State indicating whether the app has exceeded its quota usage. Read-only. - public UsageState? UsageState { get; } - /// <code>true</code> if the app is enabled; otherwise, <code>false</code>. Setting this value to false disables the app (takes the app offline). + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets current state of the app. + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; private set; } + + /// + /// Gets hostnames associated with the app. + /// + [JsonProperty(PropertyName = "properties.hostNames")] + public IList HostNames { get; private set; } + + /// + /// Gets name of the repository site. + /// + [JsonProperty(PropertyName = "properties.repositorySiteName")] + public string RepositorySiteName { get; private set; } + + /// + /// Gets state indicating whether the app has exceeded its quota usage. + /// Read-only. Possible values include: 'Normal', 'Exceeded' + /// + [JsonProperty(PropertyName = "properties.usageState")] + public UsageState? UsageState { get; private set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// app is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. Setting this value + /// to false disables the app (takes the app offline). + /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } + /// - /// Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, + /// Gets enabled hostnames for the app.Hostnames need to be assigned + /// (see HostNames) AND enabled. Otherwise, /// the app is not served on those hostnames. /// - public IReadOnlyList EnabledHostNames { get; } - /// Management information availability state for the app. - public SiteAvailabilityState? AvailabilityState { get; } - /// Hostname SSL states are used to manage the SSL bindings for app's hostnames. - public IList HostNameSslStates { get; } - /// Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + [JsonProperty(PropertyName = "properties.enabledHostNames")] + public IList EnabledHostNames { get; private set; } + + /// + /// Gets management information availability state for the app. + /// Possible values include: 'Normal', 'Limited', + /// 'DisasterRecoveryMode' + /// + [JsonProperty(PropertyName = "properties.availabilityState")] + public SiteAvailabilityState? AvailabilityState { get; private set; } + + /// + /// Gets or sets hostname SSL states are used to manage the SSL + /// bindings for app's hostnames. + /// + [JsonProperty(PropertyName = "properties.hostNameSslStates")] + public IList HostNameSslStates { get; set; } + + /// + /// Gets or sets resource ID of the associated App Service plan, + /// formatted as: + /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + /// + [JsonProperty(PropertyName = "properties.serverFarmId")] public string ServerFarmId { get; set; } - /// <code>true</code> if reserved; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// reserved; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.reserved")] public bool? Reserved { get; set; } - /// Obsolete: Hyper-V sandbox. + + /// + /// Gets or sets obsolete: Hyper-V sandbox. + /// + [JsonProperty(PropertyName = "properties.isXenon")] public bool? IsXenon { get; set; } - /// Hyper-V sandbox. + + /// + /// Gets or sets hyper-V sandbox. + /// + [JsonProperty(PropertyName = "properties.hyperV")] public bool? HyperV { get; set; } - /// Last time the app was modified, in UTC. Read-only. - public DateTimeOffset? LastModifiedTimeUtc { get; } - /// Configuration of the app. + + /// + /// Gets last time the app was modified, in UTC. Read-only. + /// + [JsonProperty(PropertyName = "properties.lastModifiedTimeUtc")] + public System.DateTime? LastModifiedTimeUtc { get; private set; } + + /// + /// Gets or sets configuration of the app. + /// + [JsonProperty(PropertyName = "properties.siteConfig")] public SiteConfig SiteConfig { get; set; } - /// Azure Traffic Manager hostnames associated with the app. Read-only. - public IReadOnlyList TrafficManagerHostNames { get; } - /// <code>true</code> to stop SCM (KUDU) site when the app is stopped; otherwise, <code>false</code>. The default is <code>false</code>. + + /// + /// Gets azure Traffic Manager hostnames associated with the app. + /// Read-only. + /// + [JsonProperty(PropertyName = "properties.trafficManagerHostNames")] + public IList TrafficManagerHostNames { get; private set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to stop + /// SCM (KUDU) site when the app is stopped; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. The default is + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.scmSiteAlsoStopped")] public bool? ScmSiteAlsoStopped { get; set; } - /// Specifies which deployment slot this app will swap into. Read-only. - public string TargetSwapSlot { get; } - /// App Service Environment to use for the app. + + /// + /// Gets specifies which deployment slot this app will swap into. + /// Read-only. + /// + [JsonProperty(PropertyName = "properties.targetSwapSlot")] + public string TargetSwapSlot { get; private set; } + + /// + /// Gets or sets app Service Environment to use for the app. + /// + [JsonProperty(PropertyName = "properties.hostingEnvironmentProfile")] public HostingEnvironmentProfile HostingEnvironmentProfile { get; set; } - /// <code>true</code> to enable client affinity; <code>false</code> to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is <code>true</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// enable client affinity; + /// &lt;code&gt;false&lt;/code&gt; to stop sending + /// session affinity cookies, which route client requests in the same + /// session to the same instance. Default is + /// &lt;code&gt;true&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.clientAffinityEnabled")] public bool? ClientAffinityEnabled { get; set; } - /// <code>true</code> to enable client certificate authentication (TLS mutual authentication); otherwise, <code>false</code>. Default is <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// enable client certificate authentication (TLS mutual + /// authentication); otherwise, + /// &lt;code&gt;false&lt;/code&gt;. Default is + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.clientCertEnabled")] public bool? ClientCertEnabled { get; set; } + /// - /// This composes with ClientCertEnabled setting. + /// Gets or sets this composes with ClientCertEnabled setting. /// - ClientCertEnabled: false means ClientCert is ignored. - /// - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. - /// - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. + /// - ClientCertEnabled: true and ClientCertMode: Required means + /// ClientCert is required. + /// - ClientCertEnabled: true and ClientCertMode: Optional means + /// ClientCert is optional or accepted. Possible values include: + /// 'Required', 'Optional' /// + [JsonProperty(PropertyName = "properties.clientCertMode")] public ClientCertMode? ClientCertMode { get; set; } - /// client certificate authentication comma-separated exclusion paths. + + /// + /// Gets or sets client certificate authentication comma-separated + /// exclusion paths + /// + [JsonProperty(PropertyName = "properties.clientCertExclusionPaths")] public string ClientCertExclusionPaths { get; set; } + /// - /// <code>true</code> to disable the public hostnames of the app; otherwise, <code>false</code>. - /// If <code>true</code>, the app is only accessible via API management process. + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// disable the public hostnames of the app; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// If &lt;code&gt;true&lt;/code&gt;, the app is only + /// accessible via API management process. /// + [JsonProperty(PropertyName = "properties.hostNamesDisabled")] public bool? HostNamesDisabled { get; set; } - /// Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. + + /// + /// Gets or sets unique identifier that verifies the custom domains + /// assigned to the app. Customer will add this id to a txt record for + /// verification. + /// + [JsonProperty(PropertyName = "properties.customDomainVerificationId")] public string CustomDomainVerificationId { get; set; } - /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. - public string OutboundIpAddresses { get; } - /// List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. - public string PossibleOutboundIpAddresses { get; } - /// Size of the function container. + + /// + /// Gets list of IP addresses that the app uses for outbound + /// connections (e.g. database access). Includes VIPs from tenants that + /// site can be hosted with current settings. Read-only. + /// + [JsonProperty(PropertyName = "properties.outboundIpAddresses")] + public string OutboundIpAddresses { get; private set; } + + /// + /// Gets list of IP addresses that the app uses for outbound + /// connections (e.g. database access). Includes VIPs from all tenants + /// except dataComponent. Read-only. + /// + [JsonProperty(PropertyName = "properties.possibleOutboundIpAddresses")] + public string PossibleOutboundIpAddresses { get; private set; } + + /// + /// Gets or sets size of the function container. + /// + [JsonProperty(PropertyName = "properties.containerSize")] public int? ContainerSize { get; set; } - /// Maximum allowed daily memory-time quota (applicable on dynamic apps only). + + /// + /// Gets or sets maximum allowed daily memory-time quota (applicable on + /// dynamic apps only). + /// + [JsonProperty(PropertyName = "properties.dailyMemoryTimeQuota")] public int? DailyMemoryTimeQuota { get; set; } - /// App suspended till in case memory-time quota is exceeded. - public DateTimeOffset? SuspendedTill { get; } + /// - /// Maximum number of workers. + /// Gets app suspended till in case memory-time quota is exceeded. + /// + [JsonProperty(PropertyName = "properties.suspendedTill")] + public System.DateTime? SuspendedTill { get; private set; } + + /// + /// Gets maximum number of workers. /// This only applies to Functions container. /// - public int? MaxNumberOfWorkers { get; } - /// If specified during app creation, the app is cloned from a source app. + [JsonProperty(PropertyName = "properties.maxNumberOfWorkers")] + public int? MaxNumberOfWorkers { get; private set; } + + /// + /// Gets or sets if specified during app creation, the app is cloned + /// from a source app. + /// + [JsonProperty(PropertyName = "properties.cloningInfo")] public CloningInfo CloningInfo { get; set; } - /// Name of the resource group the app belongs to. Read-only. - public string ResourceGroup { get; } - /// <code>true</code> if the app is a default container; otherwise, <code>false</code>. - public bool? IsDefaultContainer { get; } - /// Default hostname of the app. Read-only. - public string DefaultHostName { get; } - /// Status of the last deployment slot swap operation. - public SlotSwapStatus SlotSwapStatus { get; } - /// - /// HttpsOnly: configures a web site to accept only https requests. Issues redirect for - /// http requests. + + /// + /// Gets name of the resource group the app belongs to. Read-only. + /// + [JsonProperty(PropertyName = "properties.resourceGroup")] + public string ResourceGroup { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the app is a + /// default container; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.isDefaultContainer")] + public bool? IsDefaultContainer { get; private set; } + + /// + /// Gets default hostname of the app. Read-only. /// + [JsonProperty(PropertyName = "properties.defaultHostName")] + public string DefaultHostName { get; private set; } + + /// + /// Gets status of the last deployment slot swap operation. + /// + [JsonProperty(PropertyName = "properties.slotSwapStatus")] + public SlotSwapStatus SlotSwapStatus { get; private set; } + + /// + /// Gets or sets httpsOnly: configures a web site to accept only https + /// requests. Issues redirect for + /// http requests + /// + [JsonProperty(PropertyName = "properties.httpsOnly")] public bool? HttpsOnly { get; set; } - /// Site redundancy mode. + + /// + /// Gets or sets site redundancy mode. Possible values include: 'None', + /// 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + /// + [JsonProperty(PropertyName = "properties.redundancyMode")] public RedundancyMode? RedundancyMode { get; set; } - /// Specifies an operation id if this site has a pending operation. - public Guid? InProgressOperationId { get; } - /// Checks if Customer provided storage account is required. - public bool? StorageAccountRequired { get; set; } - /// Identity to use for Key Vault Reference authentication. - public string KeyVaultReferenceIdentity { get; set; } + /// - /// Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. - /// This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + /// Gets specifies an operation id if this site has a pending + /// operation. /// - public string VirtualNetworkSubnetId { get; set; } + [JsonProperty(PropertyName = "properties.inProgressOperationId")] + public System.Guid? InProgressOperationId { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SiteConfig != null) + { + SiteConfig.Validate(); + } + if (CloningInfo != null) + { + CloningInfo.Validate(); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.Serialization.cs deleted file mode 100644 index 0067f529a258..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.Serialization.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SitePhpErrorLogFlag : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(LocalLogErrors)) - { - writer.WritePropertyName("localLogErrors"); - writer.WriteStringValue(LocalLogErrors); - } - if (Optional.IsDefined(MasterLogErrors)) - { - writer.WritePropertyName("masterLogErrors"); - writer.WriteStringValue(MasterLogErrors); - } - if (Optional.IsDefined(LocalLogErrorsMaxLength)) - { - writer.WritePropertyName("localLogErrorsMaxLength"); - writer.WriteStringValue(LocalLogErrorsMaxLength); - } - if (Optional.IsDefined(MasterLogErrorsMaxLength)) - { - writer.WritePropertyName("masterLogErrorsMaxLength"); - writer.WriteStringValue(MasterLogErrorsMaxLength); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SitePhpErrorLogFlag DeserializeSitePhpErrorLogFlag(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional localLogErrors = default; - Optional masterLogErrors = default; - Optional localLogErrorsMaxLength = default; - Optional masterLogErrorsMaxLength = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("localLogErrors")) - { - localLogErrors = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("masterLogErrors")) - { - masterLogErrors = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("localLogErrorsMaxLength")) - { - localLogErrorsMaxLength = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("masterLogErrorsMaxLength")) - { - masterLogErrorsMaxLength = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new SitePhpErrorLogFlag(id.Value, name.Value, kind.Value, type.Value, localLogErrors.Value, masterLogErrors.Value, localLogErrorsMaxLength.Value, masterLogErrorsMaxLength.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.cs index ca199b15a722..8d7fc1abb334 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePhpErrorLogFlag.cs @@ -1,44 +1,85 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Used for getting PHP error logging flag. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Used for getting PHP error logging flag. + /// + [Rest.Serialization.JsonTransformation] public partial class SitePhpErrorLogFlag : ProxyOnlyResource { - /// Initializes a new instance of SitePhpErrorLogFlag. + /// + /// Initializes a new instance of the SitePhpErrorLogFlag class. + /// public SitePhpErrorLogFlag() { + CustomInit(); } - /// Initializes a new instance of SitePhpErrorLogFlag. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Local log_errors setting. - /// Master log_errors setting. - /// Local log_errors_max_len setting. - /// Master log_errors_max_len setting. - internal SitePhpErrorLogFlag(string id, string name, string kind, string type, string localLogErrors, string masterLogErrors, string localLogErrorsMaxLength, string masterLogErrorsMaxLength) : base(id, name, kind, type) + /// + /// Initializes a new instance of the SitePhpErrorLogFlag class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Local log_errors setting. + /// Master log_errors setting. + /// Local log_errors_max_len + /// setting. + /// Master log_errors_max_len + /// setting. + public SitePhpErrorLogFlag(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string localLogErrors = default(string), string masterLogErrors = default(string), string localLogErrorsMaxLength = default(string), string masterLogErrorsMaxLength = default(string)) + : base(id, name, kind, type) { LocalLogErrors = localLogErrors; MasterLogErrors = masterLogErrors; LocalLogErrorsMaxLength = localLogErrorsMaxLength; MasterLogErrorsMaxLength = masterLogErrorsMaxLength; + CustomInit(); } - /// Local log_errors setting. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets local log_errors setting. + /// + [JsonProperty(PropertyName = "properties.localLogErrors")] public string LocalLogErrors { get; set; } - /// Master log_errors setting. + + /// + /// Gets or sets master log_errors setting. + /// + [JsonProperty(PropertyName = "properties.masterLogErrors")] public string MasterLogErrors { get; set; } - /// Local log_errors_max_len setting. + + /// + /// Gets or sets local log_errors_max_len setting. + /// + [JsonProperty(PropertyName = "properties.localLogErrorsMaxLength")] public string LocalLogErrorsMaxLength { get; set; } - /// Master log_errors_max_len setting. + + /// + /// Gets or sets master log_errors_max_len setting. + /// + [JsonProperty(PropertyName = "properties.masterLogErrorsMaxLength")] public string MasterLogErrorsMaxLength { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.Serialization.cs deleted file mode 100644 index 7dfb38f285f5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class SiteRuntimeStateExtensions - { - public static string ToSerialString(this SiteRuntimeState value) => value switch - { - SiteRuntimeState.Ready => "READY", - SiteRuntimeState.Stopped => "STOPPED", - SiteRuntimeState.Unknown => "UNKNOWN", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteRuntimeState value.") - }; - - public static SiteRuntimeState ToSiteRuntimeState(this string value) - { - if (string.Equals(value, "READY", StringComparison.InvariantCultureIgnoreCase)) return SiteRuntimeState.Ready; - if (string.Equals(value, "STOPPED", StringComparison.InvariantCultureIgnoreCase)) return SiteRuntimeState.Stopped; - if (string.Equals(value, "UNKNOWN", StringComparison.InvariantCultureIgnoreCase)) return SiteRuntimeState.Unknown; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteRuntimeState value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.cs index 789a50cea84b..06ddc43c58fe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteRuntimeState.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The SiteRuntimeState. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SiteRuntimeState. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum SiteRuntimeState { - /// READY. - Ready, - /// STOPPED. - Stopped, - /// UNKNOWN. - Unknown + [EnumMember(Value = "READY")] + READY, + [EnumMember(Value = "STOPPED")] + STOPPED, + [EnumMember(Value = "UNKNOWN")] + UNKNOWN + } + internal static class SiteRuntimeStateEnumExtension + { + internal static string ToSerializedValue(this SiteRuntimeState? value) + { + return value == null ? null : ((SiteRuntimeState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SiteRuntimeState value) + { + switch( value ) + { + case SiteRuntimeState.READY: + return "READY"; + case SiteRuntimeState.STOPPED: + return "STOPPED"; + case SiteRuntimeState.UNKNOWN: + return "UNKNOWN"; + } + return null; + } + + internal static SiteRuntimeState? ParseSiteRuntimeState(this string value) + { + switch( value ) + { + case "READY": + return SiteRuntimeState.READY; + case "STOPPED": + return SiteRuntimeState.STOPPED; + case "UNKNOWN": + return SiteRuntimeState.UNKNOWN; + } + return null; + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.Serialization.cs deleted file mode 100644 index 9ddf8a89abe5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.Serialization.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteSeal - { - internal static SiteSeal DeserializeSiteSeal(JsonElement element) - { - string html = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("html")) - { - html = property.Value.GetString(); - continue; - } - } - return new SiteSeal(html); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.cs index e83623b66716..01aa7283ffa6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSeal.cs @@ -1,31 +1,65 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Site seal. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Site seal + /// public partial class SiteSeal { - /// Initializes a new instance of SiteSeal. - /// HTML snippet. - /// is null. - internal SiteSeal(string html) + /// + /// Initializes a new instance of the SiteSeal class. + /// + public SiteSeal() { - if (html == null) - { - throw new ArgumentNullException(nameof(html)); - } + CustomInit(); + } + /// + /// Initializes a new instance of the SiteSeal class. + /// + /// HTML snippet + public SiteSeal(string html) + { Html = html; + CustomInit(); } - /// HTML snippet. - public string Html { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets HTML snippet + /// + [JsonProperty(PropertyName = "html")] + public string Html { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Html == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Html"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.Serialization.cs deleted file mode 100644 index 0caea3b63d24..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.Serialization.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteSealRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(LightTheme)) - { - writer.WritePropertyName("lightTheme"); - writer.WriteBooleanValue(LightTheme.Value); - } - if (Optional.IsDefined(Locale)) - { - writer.WritePropertyName("locale"); - writer.WriteStringValue(Locale); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.cs index fe2111dd4d2c..e21b9e048ed2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSealRequest.cs @@ -1,23 +1,63 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Site seal request. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Site seal request. + /// public partial class SiteSealRequest { - /// Initializes a new instance of SiteSealRequest. + /// + /// Initializes a new instance of the SiteSealRequest class. + /// public SiteSealRequest() { + CustomInit(); } - /// If <code>true</code> use the light color theme for site seal; otherwise, use the default color theme. + /// + /// Initializes a new instance of the SiteSealRequest class. + /// + /// If <code>true</code> use the + /// light color theme for site seal; otherwise, use the default color + /// theme. + /// Locale of site seal. + public SiteSealRequest(bool? lightTheme = default(bool?), string locale = default(string)) + { + LightTheme = lightTheme; + Locale = locale; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets if &lt;code&gt;true&lt;/code&gt; use + /// the light color theme for site seal; otherwise, use the default + /// color theme. + /// + [JsonProperty(PropertyName = "lightTheme")] public bool? LightTheme { get; set; } - /// Locale of site seal. + + /// + /// Gets or sets locale of site seal. + /// + [JsonProperty(PropertyName = "locale")] public string Locale { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.Serialization.cs deleted file mode 100644 index 958d7683256b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.Serialization.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SiteSourceControl : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(RepoUrl)) - { - writer.WritePropertyName("repoUrl"); - writer.WriteStringValue(RepoUrl); - } - if (Optional.IsDefined(Branch)) - { - writer.WritePropertyName("branch"); - writer.WriteStringValue(Branch); - } - if (Optional.IsDefined(IsManualIntegration)) - { - writer.WritePropertyName("isManualIntegration"); - writer.WriteBooleanValue(IsManualIntegration.Value); - } - if (Optional.IsDefined(IsGitHubAction)) - { - writer.WritePropertyName("isGitHubAction"); - writer.WriteBooleanValue(IsGitHubAction.Value); - } - if (Optional.IsDefined(DeploymentRollbackEnabled)) - { - writer.WritePropertyName("deploymentRollbackEnabled"); - writer.WriteBooleanValue(DeploymentRollbackEnabled.Value); - } - if (Optional.IsDefined(IsMercurial)) - { - writer.WritePropertyName("isMercurial"); - writer.WriteBooleanValue(IsMercurial.Value); - } - if (Optional.IsDefined(GitHubActionConfiguration)) - { - writer.WritePropertyName("gitHubActionConfiguration"); - writer.WriteObjectValue(GitHubActionConfiguration); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SiteSourceControl DeserializeSiteSourceControl(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional repoUrl = default; - Optional branch = default; - Optional isManualIntegration = default; - Optional isGitHubAction = default; - Optional deploymentRollbackEnabled = default; - Optional isMercurial = default; - Optional gitHubActionConfiguration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("repoUrl")) - { - repoUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("branch")) - { - branch = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("isManualIntegration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isManualIntegration = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("isGitHubAction")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isGitHubAction = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("deploymentRollbackEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - deploymentRollbackEnabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("isMercurial")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isMercurial = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("gitHubActionConfiguration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - gitHubActionConfiguration = GitHubActionConfiguration.DeserializeGitHubActionConfiguration(property0.Value); - continue; - } - } - continue; - } - } - return new SiteSourceControl(id.Value, name.Value, kind.Value, type.Value, repoUrl.Value, branch.Value, Optional.ToNullable(isManualIntegration), Optional.ToNullable(isGitHubAction), Optional.ToNullable(deploymentRollbackEnabled), Optional.ToNullable(isMercurial), gitHubActionConfiguration.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs index 791a1ebd4a28..c2544d5f558f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs @@ -1,33 +1,58 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Source control configuration for an app. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Source control configuration for an app. + /// + [Rest.Serialization.JsonTransformation] public partial class SiteSourceControl : ProxyOnlyResource { - /// Initializes a new instance of SiteSourceControl. + /// + /// Initializes a new instance of the SiteSourceControl class. + /// public SiteSourceControl() { + CustomInit(); } - /// Initializes a new instance of SiteSourceControl. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Repository or source control URL. - /// Name of branch to use for deployment. - /// <code>true</code> to limit to manual integration; <code>false</code> to enable continuous integration (which configures webhooks into online repos like GitHub). - /// <code>true</code> if this is deployed via GitHub action. - /// <code>true</code> to enable deployment rollback; otherwise, <code>false</code>. - /// <code>true</code> for a Mercurial repository; <code>false</code> for a Git repository. - /// If GitHub Action is selected, than the associated configuration. - internal SiteSourceControl(string id, string name, string kind, string type, string repoUrl, string branch, bool? isManualIntegration, bool? isGitHubAction, bool? deploymentRollbackEnabled, bool? isMercurial, GitHubActionConfiguration gitHubActionConfiguration) : base(id, name, kind, type) + /// + /// Initializes a new instance of the SiteSourceControl class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Repository or source control URL. + /// Name of branch to use for deployment. + /// <code>true</code> to + /// limit to manual integration; <code>false</code> to + /// enable continuous integration (which configures webhooks into + /// online repos like GitHub). + /// <code>true</code> if this + /// is deployed via GitHub action. + /// <code>true</code> to + /// enable deployment rollback; otherwise, + /// <code>false</code>. + /// <code>true</code> for a + /// Mercurial repository; <code>false</code> for a Git + /// repository. + public SiteSourceControl(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repoUrl = default(string), string branch = default(string), bool? isManualIntegration = default(bool?), bool? isGitHubAction = default(bool?), bool? deploymentRollbackEnabled = default(bool?), bool? isMercurial = default(bool?)) + : base(id, name, kind, type) { RepoUrl = repoUrl; Branch = branch; @@ -35,22 +60,59 @@ internal SiteSourceControl(string id, string name, string kind, string type, str IsGitHubAction = isGitHubAction; DeploymentRollbackEnabled = deploymentRollbackEnabled; IsMercurial = isMercurial; - GitHubActionConfiguration = gitHubActionConfiguration; + CustomInit(); } - /// Repository or source control URL. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets repository or source control URL. + /// + [JsonProperty(PropertyName = "properties.repoUrl")] public string RepoUrl { get; set; } - /// Name of branch to use for deployment. + + /// + /// Gets or sets name of branch to use for deployment. + /// + [JsonProperty(PropertyName = "properties.branch")] public string Branch { get; set; } - /// <code>true</code> to limit to manual integration; <code>false</code> to enable continuous integration (which configures webhooks into online repos like GitHub). + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to limit + /// to manual integration; + /// &lt;code&gt;false&lt;/code&gt; to enable continuous + /// integration (which configures webhooks into online repos like + /// GitHub). + /// + [JsonProperty(PropertyName = "properties.isManualIntegration")] public bool? IsManualIntegration { get; set; } - /// <code>true</code> if this is deployed via GitHub action. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this + /// is deployed via GitHub action. + /// + [JsonProperty(PropertyName = "properties.isGitHubAction")] public bool? IsGitHubAction { get; set; } - /// <code>true</code> to enable deployment rollback; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// enable deployment rollback; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.deploymentRollbackEnabled")] public bool? DeploymentRollbackEnabled { get; set; } - /// <code>true</code> for a Mercurial repository; <code>false</code> for a Git repository. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; for a + /// Mercurial repository; + /// &lt;code&gt;false&lt;/code&gt; for a Git + /// repository. + /// + [JsonProperty(PropertyName = "properties.isMercurial")] public bool? IsMercurial { get; set; } - /// If GitHub Action is selected, than the associated configuration. - public GitHubActionConfiguration GitHubActionConfiguration { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.Serialization.cs deleted file mode 100644 index b8bdd44e96d2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.Serialization.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SkuCapacity : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Minimum)) - { - writer.WritePropertyName("minimum"); - writer.WriteNumberValue(Minimum.Value); - } - if (Optional.IsDefined(Maximum)) - { - writer.WritePropertyName("maximum"); - writer.WriteNumberValue(Maximum.Value); - } - if (Optional.IsDefined(ElasticMaximum)) - { - writer.WritePropertyName("elasticMaximum"); - writer.WriteNumberValue(ElasticMaximum.Value); - } - if (Optional.IsDefined(Default)) - { - writer.WritePropertyName("default"); - writer.WriteNumberValue(Default.Value); - } - if (Optional.IsDefined(ScaleType)) - { - writer.WritePropertyName("scaleType"); - writer.WriteStringValue(ScaleType); - } - writer.WriteEndObject(); - } - - internal static SkuCapacity DeserializeSkuCapacity(JsonElement element) - { - Optional minimum = default; - Optional maximum = default; - Optional elasticMaximum = default; - Optional @default = default; - Optional scaleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("minimum")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - minimum = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maximum")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maximum = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("elasticMaximum")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - elasticMaximum = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("default")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - @default = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("scaleType")) - { - scaleType = property.Value.GetString(); - continue; - } - } - return new SkuCapacity(Optional.ToNullable(minimum), Optional.ToNullable(maximum), Optional.ToNullable(elasticMaximum), Optional.ToNullable(@default), scaleType.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs index e6915a5cfe1a..87d1de6bc667 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs @@ -1,44 +1,83 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Description of the App Service plan scale options. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Description of the App Service plan scale options. + /// public partial class SkuCapacity { - /// Initializes a new instance of SkuCapacity. + /// + /// Initializes a new instance of the SkuCapacity class. + /// public SkuCapacity() { + CustomInit(); } - /// Initializes a new instance of SkuCapacity. - /// Minimum number of workers for this App Service plan SKU. - /// Maximum number of workers for this App Service plan SKU. - /// Maximum number of Elastic workers for this App Service plan SKU. - /// Default number of workers for this App Service plan SKU. - /// Available scale configurations for an App Service plan. - internal SkuCapacity(int? minimum, int? maximum, int? elasticMaximum, int? @default, string scaleType) + /// + /// Initializes a new instance of the SkuCapacity class. + /// + /// Minimum number of workers for this App + /// Service plan SKU. + /// Maximum number of workers for this App + /// Service plan SKU. + /// Default number of workers for this + /// App Service plan SKU. + /// Available scale configurations for an App + /// Service plan. + public SkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string)) { Minimum = minimum; Maximum = maximum; - ElasticMaximum = elasticMaximum; - Default = @default; + DefaultProperty = defaultProperty; ScaleType = scaleType; + CustomInit(); } - /// Minimum number of workers for this App Service plan SKU. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets minimum number of workers for this App Service plan + /// SKU. + /// + [JsonProperty(PropertyName = "minimum")] public int? Minimum { get; set; } - /// Maximum number of workers for this App Service plan SKU. + + /// + /// Gets or sets maximum number of workers for this App Service plan + /// SKU. + /// + [JsonProperty(PropertyName = "maximum")] public int? Maximum { get; set; } - /// Maximum number of Elastic workers for this App Service plan SKU. - public int? ElasticMaximum { get; set; } - /// Default number of workers for this App Service plan SKU. - public int? Default { get; set; } - /// Available scale configurations for an App Service plan. + + /// + /// Gets or sets default number of workers for this App Service plan + /// SKU. + /// + [JsonProperty(PropertyName = "default")] + public int? DefaultProperty { get; set; } + + /// + /// Gets or sets available scale configurations for an App Service + /// plan. + /// + [JsonProperty(PropertyName = "scaleType")] public string ScaleType { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.Serialization.cs deleted file mode 100644 index 1ef09d479463..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.Serialization.cs +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SkuDescription : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Tier)) - { - writer.WritePropertyName("tier"); - writer.WriteStringValue(Tier); - } - if (Optional.IsDefined(Size)) - { - writer.WritePropertyName("size"); - writer.WriteStringValue(Size); - } - if (Optional.IsDefined(Family)) - { - writer.WritePropertyName("family"); - writer.WriteStringValue(Family); - } - if (Optional.IsDefined(Capacity)) - { - writer.WritePropertyName("capacity"); - writer.WriteNumberValue(Capacity.Value); - } - if (Optional.IsDefined(SkuCapacity)) - { - writer.WritePropertyName("skuCapacity"); - writer.WriteObjectValue(SkuCapacity); - } - if (Optional.IsCollectionDefined(Locations)) - { - writer.WritePropertyName("locations"); - writer.WriteStartArray(); - foreach (var item in Locations) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Capabilities)) - { - writer.WritePropertyName("capabilities"); - writer.WriteStartArray(); - foreach (var item in Capabilities) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static SkuDescription DeserializeSkuDescription(JsonElement element) - { - Optional name = default; - Optional tier = default; - Optional size = default; - Optional family = default; - Optional capacity = default; - Optional skuCapacity = default; - Optional> locations = default; - Optional> capabilities = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("tier")) - { - tier = property.Value.GetString(); - continue; - } - if (property.NameEquals("size")) - { - size = property.Value.GetString(); - continue; - } - if (property.NameEquals("family")) - { - family = property.Value.GetString(); - continue; - } - if (property.NameEquals("capacity")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - capacity = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("skuCapacity")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - skuCapacity = SkuCapacity.DeserializeSkuCapacity(property.Value); - continue; - } - if (property.NameEquals("locations")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - locations = array; - continue; - } - if (property.NameEquals("capabilities")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Capability.DeserializeCapability(item)); - } - capabilities = array; - continue; - } - } - return new SkuDescription(name.Value, tier.Value, size.Value, family.Value, Optional.ToNullable(capacity), skuCapacity.Value, Optional.ToList(locations), Optional.ToList(capabilities)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.cs index 0a9c4311e7c3..9fc08123d409 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuDescription.cs @@ -1,35 +1,48 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Description of a SKU for a scalable resource. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Description of a SKU for a scalable resource. + /// public partial class SkuDescription { - /// Initializes a new instance of SkuDescription. + /// + /// Initializes a new instance of the SkuDescription class. + /// public SkuDescription() { - Locations = new ChangeTrackingList(); - Capabilities = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of SkuDescription. - /// Name of the resource SKU. - /// Service tier of the resource SKU. - /// Size specifier of the resource SKU. - /// Family code of the resource SKU. - /// Current number of instances assigned to the resource. - /// Min, max, and default scale values of the SKU. - /// Locations of the SKU. - /// Capabilities of the SKU, e.g., is traffic manager enabled?. - internal SkuDescription(string name, string tier, string size, string family, int? capacity, SkuCapacity skuCapacity, IList locations, IList capabilities) + /// + /// Initializes a new instance of the SkuDescription class. + /// + /// Name of the resource SKU. + /// Service tier of the resource SKU. + /// Size specifier of the resource SKU. + /// Family code of the resource SKU. + /// Current number of instances assigned to the + /// resource. + /// Min, max, and default scale values of the + /// SKU. + /// Locations of the SKU. + /// Capabilities of the SKU, e.g., is + /// traffic manager enabled? + public SkuDescription(string name = default(string), string tier = default(string), string size = default(string), string family = default(string), int? capacity = default(int?), SkuCapacity skuCapacity = default(SkuCapacity), IList locations = default(IList), IList capabilities = default(IList)) { Name = name; Tier = tier; @@ -39,23 +52,62 @@ internal SkuDescription(string name, string tier, string size, string family, in SkuCapacity = skuCapacity; Locations = locations; Capabilities = capabilities; + CustomInit(); } - /// Name of the resource SKU. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the resource SKU. + /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } - /// Service tier of the resource SKU. + + /// + /// Gets or sets service tier of the resource SKU. + /// + [JsonProperty(PropertyName = "tier")] public string Tier { get; set; } - /// Size specifier of the resource SKU. + + /// + /// Gets or sets size specifier of the resource SKU. + /// + [JsonProperty(PropertyName = "size")] public string Size { get; set; } - /// Family code of the resource SKU. + + /// + /// Gets or sets family code of the resource SKU. + /// + [JsonProperty(PropertyName = "family")] public string Family { get; set; } - /// Current number of instances assigned to the resource. + + /// + /// Gets or sets current number of instances assigned to the resource. + /// + [JsonProperty(PropertyName = "capacity")] public int? Capacity { get; set; } - /// Min, max, and default scale values of the SKU. + + /// + /// Gets or sets min, max, and default scale values of the SKU. + /// + [JsonProperty(PropertyName = "skuCapacity")] public SkuCapacity SkuCapacity { get; set; } - /// Locations of the SKU. - public IList Locations { get; } - /// Capabilities of the SKU, e.g., is traffic manager enabled?. - public IList Capabilities { get; } + + /// + /// Gets or sets locations of the SKU. + /// + [JsonProperty(PropertyName = "locations")] + public IList Locations { get; set; } + + /// + /// Gets or sets capabilities of the SKU, e.g., is traffic manager + /// enabled? + /// + [JsonProperty(PropertyName = "capabilities")] + public IList Capabilities { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.Serialization.cs deleted file mode 100644 index f46e966c4425..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SkuInfo - { - internal static SkuInfo DeserializeSkuInfo(JsonElement element) - { - Optional resourceType = default; - Optional sku = default; - Optional capacity = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("resourceType")) - { - resourceType = property.Value.GetString(); - continue; - } - if (property.NameEquals("sku")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - sku = SkuDescription.DeserializeSkuDescription(property.Value); - continue; - } - if (property.NameEquals("capacity")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - capacity = SkuCapacity.DeserializeSkuCapacity(property.Value); - continue; - } - } - return new SkuInfo(resourceType.Value, sku.Value, capacity.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.cs index c984169bc7ce..1b9dd76cabad 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfo.cs @@ -1,36 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// SKU discovery information. + using Newtonsoft.Json; + using System.Linq; + + /// + /// SKU discovery information. + /// public partial class SkuInfo { - /// Initializes a new instance of SkuInfo. - internal SkuInfo() + /// + /// Initializes a new instance of the SkuInfo class. + /// + public SkuInfo() { + CustomInit(); } - /// Initializes a new instance of SkuInfo. - /// Resource type that this SKU applies to. - /// Name and tier of the SKU. - /// Min, max, and default scale values of the SKU. - internal SkuInfo(string resourceType, SkuDescription sku, SkuCapacity capacity) + /// + /// Initializes a new instance of the SkuInfo class. + /// + /// Resource type that this SKU applies + /// to. + /// Name and tier of the SKU. + /// Min, max, and default scale values of the + /// SKU. + public SkuInfo(string resourceType = default(string), SkuDescription sku = default(SkuDescription), SkuCapacity capacity = default(SkuCapacity)) { ResourceType = resourceType; Sku = sku; Capacity = capacity; + CustomInit(); } - /// Resource type that this SKU applies to. - public string ResourceType { get; } - /// Name and tier of the SKU. - public SkuDescription Sku { get; } - /// Min, max, and default scale values of the SKU. - public SkuCapacity Capacity { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource type that this SKU applies to. + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; set; } + + /// + /// Gets or sets name and tier of the SKU. + /// + [JsonProperty(PropertyName = "sku")] + public SkuDescription Sku { get; set; } + + /// + /// Gets or sets min, max, and default scale values of the SKU. + /// + [JsonProperty(PropertyName = "capacity")] + public SkuCapacity Capacity { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.Serialization.cs deleted file mode 100644 index 1bc3b620ae25..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class SkuInfoCollection - { - internal static SkuInfoCollection DeserializeSkuInfoCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SkuInfo.DeserializeSkuInfo(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SkuInfoCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.cs deleted file mode 100644 index 1a8fce00a241..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfoCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of SKU information. - internal partial class SkuInfoCollection - { - /// Initializes a new instance of SkuInfoCollection. - /// Collection of resources. - /// is null. - internal SkuInfoCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of SkuInfoCollection. - /// Collection of resources. - /// Link to next page of resources. - internal SkuInfoCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.Serialization.cs deleted file mode 100644 index 29616d7d3a42..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SkuInfos - { - internal static SkuInfos DeserializeSkuInfos(JsonElement element) - { - Optional resourceType = default; - Optional> skus = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("resourceType")) - { - resourceType = property.Value.GetString(); - continue; - } - if (property.NameEquals("skus")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(GlobalCsmSkuDescription.DeserializeGlobalCsmSkuDescription(item)); - } - skus = array; - continue; - } - } - return new SkuInfos(resourceType.Value, Optional.ToList(skus)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.cs index 9bdb8674e441..43c105bcf20b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuInfos.cs @@ -1,36 +1,63 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Collection of SKU information. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Collection of SKU information. + /// public partial class SkuInfos { - /// Initializes a new instance of SkuInfos. - internal SkuInfos() + /// + /// Initializes a new instance of the SkuInfos class. + /// + public SkuInfos() { - Skus = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of SkuInfos. - /// Resource type that this SKU applies to. - /// List of SKUs the subscription is able to use. - internal SkuInfos(string resourceType, IReadOnlyList skus) + /// + /// Initializes a new instance of the SkuInfos class. + /// + /// Resource type that this SKU applies + /// to. + /// List of SKUs the subscription is able to + /// use. + public SkuInfos(string resourceType = default(string), IList skus = default(IList)) { ResourceType = resourceType; Skus = skus; + CustomInit(); } - /// Resource type that this SKU applies to. - public string ResourceType { get; } - /// List of SKUs the subscription is able to use. - public IReadOnlyList Skus { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource type that this SKU applies to. + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; set; } + + /// + /// Gets or sets list of SKUs the subscription is able to use. + /// + [JsonProperty(PropertyName = "skus")] + public IList Skus { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs index 4afa83336033..a990199a9a26 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs @@ -1,84 +1,30 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// The SkuName. - public readonly partial struct SkuName : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public SkuName(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string FreeValue = "Free"; - private const string SharedValue = "Shared"; - private const string BasicValue = "Basic"; - private const string StandardValue = "Standard"; - private const string PremiumValue = "Premium"; - private const string DynamicValue = "Dynamic"; - private const string IsolatedValue = "Isolated"; - private const string IsolatedV2Value = "IsolatedV2"; - private const string PremiumV2Value = "PremiumV2"; - private const string PremiumV3Value = "PremiumV3"; - private const string PremiumContainerValue = "PremiumContainer"; - private const string ElasticPremiumValue = "ElasticPremium"; - private const string ElasticIsolatedValue = "ElasticIsolated"; - - /// Free. - public static SkuName Free { get; } = new SkuName(FreeValue); - /// Shared. - public static SkuName Shared { get; } = new SkuName(SharedValue); - /// Basic. - public static SkuName Basic { get; } = new SkuName(BasicValue); - /// Standard. - public static SkuName Standard { get; } = new SkuName(StandardValue); - /// Premium. - public static SkuName Premium { get; } = new SkuName(PremiumValue); - /// Dynamic. - public static SkuName Dynamic { get; } = new SkuName(DynamicValue); - /// Isolated. - public static SkuName Isolated { get; } = new SkuName(IsolatedValue); - /// IsolatedV2. - public static SkuName IsolatedV2 { get; } = new SkuName(IsolatedV2Value); - /// PremiumV2. - public static SkuName PremiumV2 { get; } = new SkuName(PremiumV2Value); - /// PremiumV3. - public static SkuName PremiumV3 { get; } = new SkuName(PremiumV3Value); - /// PremiumContainer. - public static SkuName PremiumContainer { get; } = new SkuName(PremiumContainerValue); - /// ElasticPremium. - public static SkuName ElasticPremium { get; } = new SkuName(ElasticPremiumValue); - /// ElasticIsolated. - public static SkuName ElasticIsolated { get; } = new SkuName(ElasticIsolatedValue); - /// Determines if two values are the same. - public static bool operator ==(SkuName left, SkuName right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SkuName left, SkuName right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SkuName(string value) => new SkuName(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SkuName other && Equals(other); - /// - public bool Equals(SkuName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for SkuName. + /// + public static class SkuName + { + public const string Free = "Free"; + public const string Shared = "Shared"; + public const string Basic = "Basic"; + public const string Standard = "Standard"; + public const string Premium = "Premium"; + public const string Dynamic = "Dynamic"; + public const string Isolated = "Isolated"; + public const string PremiumV2 = "PremiumV2"; + public const string ElasticPremium = "ElasticPremium"; + public const string ElasticIsolated = "ElasticIsolated"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.Serialization.cs deleted file mode 100644 index cfcac0489bca..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.Serialization.cs +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SlotConfigNamesResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(ConnectionStringNames)) - { - writer.WritePropertyName("connectionStringNames"); - writer.WriteStartArray(); - foreach (var item in ConnectionStringNames) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(AppSettingNames)) - { - writer.WritePropertyName("appSettingNames"); - writer.WriteStartArray(); - foreach (var item in AppSettingNames) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(AzureStorageConfigNames)) - { - writer.WritePropertyName("azureStorageConfigNames"); - writer.WriteStartArray(); - foreach (var item in AzureStorageConfigNames) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SlotConfigNamesResource DeserializeSlotConfigNamesResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional> connectionStringNames = default; - Optional> appSettingNames = default; - Optional> azureStorageConfigNames = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("connectionStringNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - connectionStringNames = array; - continue; - } - if (property0.NameEquals("appSettingNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - appSettingNames = array; - continue; - } - if (property0.NameEquals("azureStorageConfigNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - azureStorageConfigNames = array; - continue; - } - } - continue; - } - } - return new SlotConfigNamesResource(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(connectionStringNames), Optional.ToList(appSettingNames), Optional.ToList(azureStorageConfigNames)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.cs index a4b623e35b63..a994ab81d947 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotConfigNamesResource.cs @@ -1,46 +1,80 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Slot Config names azure resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Slot Config names azure resource. + /// + [Rest.Serialization.JsonTransformation] public partial class SlotConfigNamesResource : ProxyOnlyResource { - /// Initializes a new instance of SlotConfigNamesResource. + /// + /// Initializes a new instance of the SlotConfigNamesResource class. + /// public SlotConfigNamesResource() { - ConnectionStringNames = new ChangeTrackingList(); - AppSettingNames = new ChangeTrackingList(); - AzureStorageConfigNames = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of SlotConfigNamesResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// List of connection string names. - /// List of application settings names. - /// List of external Azure storage account identifiers. - internal SlotConfigNamesResource(string id, string name, string kind, string type, IList connectionStringNames, IList appSettingNames, IList azureStorageConfigNames) : base(id, name, kind, type) + /// + /// Initializes a new instance of the SlotConfigNamesResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// List of connection string + /// names. + /// List of application settings + /// names. + /// List of external Azure + /// storage account identifiers. + public SlotConfigNamesResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList connectionStringNames = default(IList), IList appSettingNames = default(IList), IList azureStorageConfigNames = default(IList)) + : base(id, name, kind, type) { ConnectionStringNames = connectionStringNames; AppSettingNames = appSettingNames; AzureStorageConfigNames = azureStorageConfigNames; + CustomInit(); } - /// List of connection string names. - public IList ConnectionStringNames { get; } - /// List of application settings names. - public IList AppSettingNames { get; } - /// List of external Azure storage account identifiers. - public IList AzureStorageConfigNames { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of connection string names. + /// + [JsonProperty(PropertyName = "properties.connectionStringNames")] + public IList ConnectionStringNames { get; set; } + + /// + /// Gets or sets list of application settings names. + /// + [JsonProperty(PropertyName = "properties.appSettingNames")] + public IList AppSettingNames { get; set; } + + /// + /// Gets or sets list of external Azure storage account identifiers. + /// + [JsonProperty(PropertyName = "properties.azureStorageConfigNames")] + public IList AzureStorageConfigNames { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.Serialization.cs deleted file mode 100644 index 9df9aa2732d9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.Serialization.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SlotDifference : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SlotDifference DeserializeSlotDifference(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional level = default; - Optional settingType = default; - Optional diffRule = default; - Optional settingName = default; - Optional valueInCurrentSlot = default; - Optional valueInTargetSlot = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("level")) - { - level = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("settingType")) - { - settingType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("diffRule")) - { - diffRule = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("settingName")) - { - settingName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("valueInCurrentSlot")) - { - valueInCurrentSlot = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("valueInTargetSlot")) - { - valueInTargetSlot = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description")) - { - description = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new SlotDifference(id.Value, name.Value, kind.Value, type.Value, level.Value, settingType.Value, diffRule.Value, settingName.Value, valueInCurrentSlot.Value, valueInTargetSlot.Value, description.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.cs index 5bd375245270..247330959681 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifference.cs @@ -1,33 +1,56 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// A setting difference between two deployment slots of an app. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A setting difference between two deployment slots of an app. + /// + [Rest.Serialization.JsonTransformation] public partial class SlotDifference : ProxyOnlyResource { - /// Initializes a new instance of SlotDifference. + /// + /// Initializes a new instance of the SlotDifference class. + /// public SlotDifference() { + CustomInit(); } - /// Initializes a new instance of SlotDifference. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Level of the difference: Information, Warning or Error. - /// The type of the setting: General, AppSetting or ConnectionString. - /// Rule that describes how to process the setting difference during a slot swap. - /// Name of the setting. - /// Value of the setting in the current slot. - /// Value of the setting in the target slot. - /// Description of the setting difference. - internal SlotDifference(string id, string name, string kind, string type, string level, string settingType, string diffRule, string settingName, string valueInCurrentSlot, string valueInTargetSlot, string description) : base(id, name, kind, type) + /// + /// Initializes a new instance of the SlotDifference class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Level of the difference: Information, Warning + /// or Error. + /// The type of the setting: General, + /// AppSetting or ConnectionString. + /// Rule that describes how to process the + /// setting difference during a slot swap. + /// Name of the setting. + /// Value of the setting in the + /// current slot. + /// Value of the setting in the target + /// slot. + /// Description of the setting + /// difference. + public SlotDifference(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string level = default(string), string settingType = default(string), string diffRule = default(string), string settingName = default(string), string valueInCurrentSlot = default(string), string valueInTargetSlot = default(string), string description = default(string)) + : base(id, name, kind, type) { Level = level; SettingType = settingType; @@ -36,21 +59,57 @@ internal SlotDifference(string id, string name, string kind, string type, string ValueInCurrentSlot = valueInCurrentSlot; ValueInTargetSlot = valueInTargetSlot; Description = description; + CustomInit(); } - /// Level of the difference: Information, Warning or Error. - public string Level { get; } - /// The type of the setting: General, AppSetting or ConnectionString. - public string SettingType { get; } - /// Rule that describes how to process the setting difference during a slot swap. - public string DiffRule { get; } - /// Name of the setting. - public string SettingName { get; } - /// Value of the setting in the current slot. - public string ValueInCurrentSlot { get; } - /// Value of the setting in the target slot. - public string ValueInTargetSlot { get; } - /// Description of the setting difference. - public string Description { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets level of the difference: Information, Warning or Error. + /// + [JsonProperty(PropertyName = "properties.level")] + public string Level { get; private set; } + + /// + /// Gets the type of the setting: General, AppSetting or + /// ConnectionString. + /// + [JsonProperty(PropertyName = "properties.settingType")] + public string SettingType { get; private set; } + + /// + /// Gets rule that describes how to process the setting difference + /// during a slot swap. + /// + [JsonProperty(PropertyName = "properties.diffRule")] + public string DiffRule { get; private set; } + + /// + /// Gets name of the setting. + /// + [JsonProperty(PropertyName = "properties.settingName")] + public string SettingName { get; private set; } + + /// + /// Gets value of the setting in the current slot. + /// + [JsonProperty(PropertyName = "properties.valueInCurrentSlot")] + public string ValueInCurrentSlot { get; private set; } + + /// + /// Gets value of the setting in the target slot. + /// + [JsonProperty(PropertyName = "properties.valueInTargetSlot")] + public string ValueInTargetSlot { get; private set; } + + /// + /// Gets description of the setting difference. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.Serialization.cs deleted file mode 100644 index 943480d12041..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class SlotDifferenceCollection - { - internal static SlotDifferenceCollection DeserializeSlotDifferenceCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SlotDifference.DeserializeSlotDifference(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SlotDifferenceCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.cs deleted file mode 100644 index eacd40a9cf33..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotDifferenceCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of slot differences. - internal partial class SlotDifferenceCollection - { - /// Initializes a new instance of SlotDifferenceCollection. - /// Collection of resources. - /// is null. - internal SlotDifferenceCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of SlotDifferenceCollection. - /// Collection of resources. - /// Link to next page of resources. - internal SlotDifferenceCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.Serialization.cs deleted file mode 100644 index e411892cdf6a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SlotSwapStatus - { - internal static SlotSwapStatus DeserializeSlotSwapStatus(JsonElement element) - { - Optional timestampUtc = default; - Optional sourceSlotName = default; - Optional destinationSlotName = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timestampUtc")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - timestampUtc = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("sourceSlotName")) - { - sourceSlotName = property.Value.GetString(); - continue; - } - if (property.NameEquals("destinationSlotName")) - { - destinationSlotName = property.Value.GetString(); - continue; - } - } - return new SlotSwapStatus(Optional.ToNullable(timestampUtc), sourceSlotName.Value, destinationSlotName.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.cs index caec69ea45b8..10b3546ea071 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlotSwapStatus.cs @@ -1,38 +1,70 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// The status of the last successful slot swap operation. + using Newtonsoft.Json; + using System.Linq; + + /// + /// The status of the last successful slot swap operation. + /// public partial class SlotSwapStatus { - /// Initializes a new instance of SlotSwapStatus. - internal SlotSwapStatus() + /// + /// Initializes a new instance of the SlotSwapStatus class. + /// + public SlotSwapStatus() { + CustomInit(); } - /// Initializes a new instance of SlotSwapStatus. - /// The time the last successful slot swap completed. - /// The source slot of the last swap operation. - /// The destination slot of the last swap operation. - internal SlotSwapStatus(DateTimeOffset? timestampUtc, string sourceSlotName, string destinationSlotName) + /// + /// Initializes a new instance of the SlotSwapStatus class. + /// + /// The time the last successful slot swap + /// completed. + /// The source slot of the last swap + /// operation. + /// The destination slot of the last + /// swap operation. + public SlotSwapStatus(System.DateTime? timestampUtc = default(System.DateTime?), string sourceSlotName = default(string), string destinationSlotName = default(string)) { TimestampUtc = timestampUtc; SourceSlotName = sourceSlotName; DestinationSlotName = destinationSlotName; + CustomInit(); } - /// The time the last successful slot swap completed. - public DateTimeOffset? TimestampUtc { get; } - /// The source slot of the last swap operation. - public string SourceSlotName { get; } - /// The destination slot of the last swap operation. - public string DestinationSlotName { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the time the last successful slot swap completed. + /// + [JsonProperty(PropertyName = "timestampUtc")] + public System.DateTime? TimestampUtc { get; private set; } + + /// + /// Gets the source slot of the last swap operation. + /// + [JsonProperty(PropertyName = "sourceSlotName")] + public string SourceSlotName { get; private set; } + + /// + /// Gets the destination slot of the last swap operation. + /// + [JsonProperty(PropertyName = "destinationSlotName")] + public string DestinationSlotName { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.Serialization.cs deleted file mode 100644 index 6220904a34ce..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.Serialization.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SlowRequestsBasedTrigger : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(TimeTaken)) - { - writer.WritePropertyName("timeTaken"); - writer.WriteStringValue(TimeTaken); - } - if (Optional.IsDefined(Path)) - { - writer.WritePropertyName("path"); - writer.WriteStringValue(Path); - } - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(TimeInterval)) - { - writer.WritePropertyName("timeInterval"); - writer.WriteStringValue(TimeInterval); - } - writer.WriteEndObject(); - } - - internal static SlowRequestsBasedTrigger DeserializeSlowRequestsBasedTrigger(JsonElement element) - { - Optional timeTaken = default; - Optional path = default; - Optional count = default; - Optional timeInterval = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeTaken")) - { - timeTaken = property.Value.GetString(); - continue; - } - if (property.NameEquals("path")) - { - path = property.Value.GetString(); - continue; - } - if (property.NameEquals("count")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - count = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("timeInterval")) - { - timeInterval = property.Value.GetString(); - continue; - } - } - return new SlowRequestsBasedTrigger(timeTaken.Value, path.Value, Optional.ToNullable(count), timeInterval.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs index b98d5268f453..72d2b4cc304e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs @@ -1,40 +1,67 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Trigger based on request execution time. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Trigger based on request execution time. + /// public partial class SlowRequestsBasedTrigger { - /// Initializes a new instance of SlowRequestsBasedTrigger. + /// + /// Initializes a new instance of the SlowRequestsBasedTrigger class. + /// public SlowRequestsBasedTrigger() { + CustomInit(); } - /// Initializes a new instance of SlowRequestsBasedTrigger. - /// Time taken. - /// Request Path. - /// Request Count. - /// Time interval. - internal SlowRequestsBasedTrigger(string timeTaken, string path, int? count, string timeInterval) + /// + /// Initializes a new instance of the SlowRequestsBasedTrigger class. + /// + /// Time taken. + /// Request Count. + /// Time interval. + public SlowRequestsBasedTrigger(string timeTaken = default(string), int? count = default(int?), string timeInterval = default(string)) { TimeTaken = timeTaken; - Path = path; Count = count; TimeInterval = timeInterval; + CustomInit(); } - /// Time taken. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets time taken. + /// + [JsonProperty(PropertyName = "timeTaken")] public string TimeTaken { get; set; } - /// Request Path. - public string Path { get; set; } - /// Request Count. + + /// + /// Gets or sets request Count. + /// + [JsonProperty(PropertyName = "count")] public int? Count { get; set; } - /// Time interval. + + /// + /// Gets or sets time interval. + /// + [JsonProperty(PropertyName = "timeInterval")] public string TimeInterval { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.Serialization.cs deleted file mode 100644 index 59f632daa9d4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.Serialization.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Snapshot : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Snapshot DeserializeSnapshot(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional time = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("time")) - { - time = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new Snapshot(id.Value, name.Value, kind.Value, type.Value, time.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.cs index 5303d58447d1..c0bb80c070d2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Snapshot.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// A snapshot of an app. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A snapshot of an app. + /// + [Rest.Serialization.JsonTransformation] public partial class Snapshot : ProxyOnlyResource { - /// Initializes a new instance of Snapshot. + /// + /// Initializes a new instance of the Snapshot class. + /// public Snapshot() { + CustomInit(); } - /// Initializes a new instance of Snapshot. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The time the snapshot was taken. - internal Snapshot(string id, string name, string kind, string type, string time) : base(id, name, kind, type) + /// + /// Initializes a new instance of the Snapshot class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The time the snapshot was taken. + public Snapshot(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string time = default(string)) + : base(id, name, kind, type) { Time = time; + CustomInit(); } - /// The time the snapshot was taken. - public string Time { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the time the snapshot was taken. + /// + [JsonProperty(PropertyName = "properties.time")] + public string Time { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.Serialization.cs deleted file mode 100644 index 930e6deddc72..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class SnapshotCollection - { - internal static SnapshotCollection DeserializeSnapshotCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Snapshot.DeserializeSnapshot(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SnapshotCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.cs deleted file mode 100644 index 1985c2637314..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of snapshots which can be used to revert an app to a previous time. - internal partial class SnapshotCollection - { - /// Initializes a new instance of SnapshotCollection. - /// Collection of resources. - /// is null. - internal SnapshotCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of SnapshotCollection. - /// Collection of resources. - /// Link to next page of resources. - internal SnapshotCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.Serialization.cs deleted file mode 100644 index b74969d75f9f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SnapshotRecoverySource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"); - writer.WriteStringValue(Id); - } - writer.WriteEndObject(); - } - - internal static SnapshotRecoverySource DeserializeSnapshotRecoverySource(JsonElement element) - { - Optional location = default; - Optional id = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - } - return new SnapshotRecoverySource(location.Value, id.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.cs index 2682bfc3df6b..4353300da633 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRecoverySource.cs @@ -1,40 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Specifies the web app that snapshot contents will be retrieved from. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specifies the web app that snapshot contents will be retrieved from. + /// public partial class SnapshotRecoverySource { - /// Initializes a new instance of SnapshotRecoverySource. + /// + /// Initializes a new instance of the SnapshotRecoverySource class. + /// public SnapshotRecoverySource() { + CustomInit(); } - /// Initializes a new instance of SnapshotRecoverySource. - /// Geographical location of the source web app, e.g. SouthEastAsia, SouthCentralUS. - /// - /// ARM resource ID of the source app. - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. - /// - internal SnapshotRecoverySource(string location, string id) + /// + /// Initializes a new instance of the SnapshotRecoverySource class. + /// + /// Geographical location of the source web app, + /// e.g. SouthEastAsia, SouthCentralUS + /// ARM resource ID of the source app. + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + /// for production slots and + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + /// for other slots. + public SnapshotRecoverySource(string location = default(string), string id = default(string)) { Location = location; Id = id; + CustomInit(); } - /// Geographical location of the source web app, e.g. SouthEastAsia, SouthCentralUS. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets geographical location of the source web app, e.g. + /// SouthEastAsia, SouthCentralUS + /// + [JsonProperty(PropertyName = "location")] public string Location { get; set; } + /// - /// ARM resource ID of the source app. - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and - /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. + /// Gets or sets ARM resource ID of the source app. + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + /// for production slots and + /// /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + /// for other slots. /// + [JsonProperty(PropertyName = "id")] public string Id { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.Serialization.cs deleted file mode 100644 index ac224f0d936d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.Serialization.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SnapshotRestoreRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(SnapshotTime)) - { - writer.WritePropertyName("snapshotTime"); - writer.WriteStringValue(SnapshotTime); - } - if (Optional.IsDefined(RecoverySource)) - { - writer.WritePropertyName("recoverySource"); - writer.WriteObjectValue(RecoverySource); - } - if (Optional.IsDefined(Overwrite)) - { - writer.WritePropertyName("overwrite"); - writer.WriteBooleanValue(Overwrite.Value); - } - if (Optional.IsDefined(RecoverConfiguration)) - { - writer.WritePropertyName("recoverConfiguration"); - writer.WriteBooleanValue(RecoverConfiguration.Value); - } - if (Optional.IsDefined(IgnoreConflictingHostNames)) - { - writer.WritePropertyName("ignoreConflictingHostNames"); - writer.WriteBooleanValue(IgnoreConflictingHostNames.Value); - } - if (Optional.IsDefined(UseDRSecondary)) - { - writer.WritePropertyName("useDRSecondary"); - writer.WriteBooleanValue(UseDRSecondary.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SnapshotRestoreRequest DeserializeSnapshotRestoreRequest(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional snapshotTime = default; - Optional recoverySource = default; - Optional overwrite = default; - Optional recoverConfiguration = default; - Optional ignoreConflictingHostNames = default; - Optional useDRSecondary = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("snapshotTime")) - { - snapshotTime = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("recoverySource")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - recoverySource = SnapshotRecoverySource.DeserializeSnapshotRecoverySource(property0.Value); - continue; - } - if (property0.NameEquals("overwrite")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - overwrite = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("recoverConfiguration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - recoverConfiguration = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("ignoreConflictingHostNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - ignoreConflictingHostNames = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("useDRSecondary")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - useDRSecondary = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new SnapshotRestoreRequest(id.Value, name.Value, kind.Value, type.Value, snapshotTime.Value, recoverySource.Value, Optional.ToNullable(overwrite), Optional.ToNullable(recoverConfiguration), Optional.ToNullable(ignoreConflictingHostNames), Optional.ToNullable(useDRSecondary)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.cs index b235ae042677..2b4e6097d617 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SnapshotRestoreRequest.cs @@ -1,38 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Details about app recovery operation. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details about app recovery operation. + /// + [Rest.Serialization.JsonTransformation] public partial class SnapshotRestoreRequest : ProxyOnlyResource { - /// Initializes a new instance of SnapshotRestoreRequest. + /// + /// Initializes a new instance of the SnapshotRestoreRequest class. + /// public SnapshotRestoreRequest() { + CustomInit(); } - /// Initializes a new instance of SnapshotRestoreRequest. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Point in time in which the app restore should be done, formatted as a DateTime string. - /// - /// Optional. Specifies the web app that snapshot contents will be retrieved from. - /// If empty, the targeted web app will be used as the source. - /// - /// If <code>true</code> the restore operation can overwrite source app; otherwise, <code>false</code>. - /// If true, site configuration, in addition to content, will be reverted. - /// - /// If true, custom hostname conflicts will be ignored when recovering to a target web app. - /// This setting is only necessary when RecoverConfiguration is enabled. - /// - /// If true, the snapshot is retrieved from DRSecondary endpoint. - internal SnapshotRestoreRequest(string id, string name, string kind, string type, string snapshotTime, SnapshotRecoverySource recoverySource, bool? overwrite, bool? recoverConfiguration, bool? ignoreConflictingHostNames, bool? useDRSecondary) : base(id, name, kind, type) + /// + /// Initializes a new instance of the SnapshotRestoreRequest class. + /// + /// If <code>true</code> the + /// restore operation can overwrite source app; otherwise, + /// <code>false</code>. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Point in time in which the app restore + /// should be done, formatted as a DateTime string. + /// Optional. Specifies the web app that + /// snapshot contents will be retrieved from. + /// If empty, the targeted web app will be used as the source. + /// If true, site configuration, in + /// addition to content, will be reverted. + /// If true, custom hostname + /// conflicts will be ignored when recovering to a target web app. + /// This setting is only necessary when RecoverConfiguration is + /// enabled. + /// If true, the snapshot is retrieved + /// from DRSecondary endpoint. + public SnapshotRestoreRequest(bool overwrite, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string snapshotTime = default(string), SnapshotRecoverySource recoverySource = default(SnapshotRecoverySource), bool? recoverConfiguration = default(bool?), bool? ignoreConflictingHostNames = default(bool?), bool? useDRSecondary = default(bool?)) + : base(id, name, kind, type) { SnapshotTime = snapshotTime; RecoverySource = recoverySource; @@ -40,25 +61,68 @@ internal SnapshotRestoreRequest(string id, string name, string kind, string type RecoverConfiguration = recoverConfiguration; IgnoreConflictingHostNames = ignoreConflictingHostNames; UseDRSecondary = useDRSecondary; + CustomInit(); } - /// Point in time in which the app restore should be done, formatted as a DateTime string. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets point in time in which the app restore should be done, + /// formatted as a DateTime string. + /// + [JsonProperty(PropertyName = "properties.snapshotTime")] public string SnapshotTime { get; set; } + /// - /// Optional. Specifies the web app that snapshot contents will be retrieved from. + /// Gets or sets optional. Specifies the web app that snapshot contents + /// will be retrieved from. /// If empty, the targeted web app will be used as the source. /// + [JsonProperty(PropertyName = "properties.recoverySource")] public SnapshotRecoverySource RecoverySource { get; set; } - /// If <code>true</code> the restore operation can overwrite source app; otherwise, <code>false</code>. - public bool? Overwrite { get; set; } - /// If true, site configuration, in addition to content, will be reverted. + + /// + /// Gets or sets if &lt;code&gt;true&lt;/code&gt; the + /// restore operation can overwrite source app; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.overwrite")] + public bool Overwrite { get; set; } + + /// + /// Gets or sets if true, site configuration, in addition to content, + /// will be reverted. + /// + [JsonProperty(PropertyName = "properties.recoverConfiguration")] public bool? RecoverConfiguration { get; set; } + /// - /// If true, custom hostname conflicts will be ignored when recovering to a target web app. - /// This setting is only necessary when RecoverConfiguration is enabled. + /// Gets or sets if true, custom hostname conflicts will be ignored + /// when recovering to a target web app. + /// This setting is only necessary when RecoverConfiguration is + /// enabled. /// + [JsonProperty(PropertyName = "properties.ignoreConflictingHostNames")] public bool? IgnoreConflictingHostNames { get; set; } - /// If true, the snapshot is retrieved from DRSecondary endpoint. + + /// + /// Gets or sets if true, the snapshot is retrieved from DRSecondary + /// endpoint. + /// + [JsonProperty(PropertyName = "properties.useDRSecondary")] public bool? UseDRSecondary { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.Serialization.cs deleted file mode 100644 index 872056b87f6b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.Serialization.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Solution : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"); - writer.WriteNumberValue(Id.Value); - } - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Order)) - { - writer.WritePropertyName("order"); - writer.WriteNumberValue(Order.Value); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(Type)) - { - writer.WritePropertyName("type"); - writer.WriteStringValue(Type.Value.ToSerialString()); - } - if (Optional.IsCollectionDefined(Data)) - { - writer.WritePropertyName("data"); - writer.WriteStartArray(); - foreach (var item in Data) - { - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteObjectValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Metadata)) - { - writer.WritePropertyName("metadata"); - writer.WriteStartArray(); - foreach (var item in Metadata) - { - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteObjectValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static Solution DeserializeSolution(JsonElement element) - { - Optional id = default; - Optional displayName = default; - Optional order = default; - Optional description = default; - Optional type = default; - Optional>> data = default; - Optional>> metadata = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - id = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("displayName")) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("order")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - order = property.Value.GetDouble(); - continue; - } - if (property.NameEquals("description")) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = property.Value.GetString().ToSolutionType(); - continue; - } - if (property.NameEquals("data")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - List array0 = new List(); - foreach (var item0 in item.EnumerateArray()) - { - array0.Add(NameValuePair.DeserializeNameValuePair(item0)); - } - array.Add(array0); - } - data = array; - continue; - } - if (property.NameEquals("metadata")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - List array0 = new List(); - foreach (var item0 in item.EnumerateArray()) - { - array0.Add(NameValuePair.DeserializeNameValuePair(item0)); - } - array.Add(array0); - } - metadata = array; - continue; - } - } - return new Solution(Optional.ToNullable(id), displayName.Value, Optional.ToNullable(order), description.Value, Optional.ToNullable(type), Optional.ToList(data), Optional.ToList(metadata)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.cs index c3a7a3fb9b8f..99a1b4a7070c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Solution.cs @@ -1,34 +1,45 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Class Representing Solution for problems detected. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Class Representing Solution for problems detected. + /// public partial class Solution { - /// Initializes a new instance of Solution. + /// + /// Initializes a new instance of the Solution class. + /// public Solution() { - Data = new ChangeTrackingList>(); - Metadata = new ChangeTrackingList>(); + CustomInit(); } - /// Initializes a new instance of Solution. - /// Solution Id. - /// Display Name of the solution. - /// Order of the solution. - /// Description of the solution. - /// Type of Solution. - /// Solution Data. - /// Solution Metadata. - internal Solution(double? id, string displayName, double? order, string description, SolutionType? type, IList> data, IList> metadata) + /// + /// Initializes a new instance of the Solution class. + /// + /// Solution Id. + /// Display Name of the solution + /// Order of the solution. + /// Description of the solution + /// Type of Solution. Possible values include: + /// 'QuickSolution', 'DeepInvestigation', 'BestPractices' + /// Solution Data. + /// Solution Metadata. + public Solution(double? id = default(double?), string displayName = default(string), double? order = default(double?), string description = default(string), SolutionType? type = default(SolutionType?), IList> data = default(IList>), IList> metadata = default(IList>)) { Id = id; DisplayName = displayName; @@ -37,21 +48,56 @@ internal Solution(double? id, string displayName, double? order, string descript Type = type; Data = data; Metadata = metadata; + CustomInit(); } - /// Solution Id. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets solution Id. + /// + [JsonProperty(PropertyName = "id")] public double? Id { get; set; } - /// Display Name of the solution. + + /// + /// Gets or sets display Name of the solution + /// + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } - /// Order of the solution. + + /// + /// Gets or sets order of the solution. + /// + [JsonProperty(PropertyName = "order")] public double? Order { get; set; } - /// Description of the solution. + + /// + /// Gets or sets description of the solution + /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } - /// Type of Solution. + + /// + /// Gets or sets type of Solution. Possible values include: + /// 'QuickSolution', 'DeepInvestigation', 'BestPractices' + /// + [JsonProperty(PropertyName = "type")] public SolutionType? Type { get; set; } - /// Solution Data. - public IList> Data { get; } - /// Solution Metadata. - public IList> Metadata { get; } + + /// + /// Gets or sets solution Data. + /// + [JsonProperty(PropertyName = "data")] + public IList> Data { get; set; } + + /// + /// Gets or sets solution Metadata. + /// + [JsonProperty(PropertyName = "metadata")] + public IList> Metadata { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.Serialization.cs deleted file mode 100644 index ec51ffa199d6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class SolutionTypeExtensions - { - public static string ToSerialString(this SolutionType value) => value switch - { - SolutionType.QuickSolution => "QuickSolution", - SolutionType.DeepInvestigation => "DeepInvestigation", - SolutionType.BestPractices => "BestPractices", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SolutionType value.") - }; - - public static SolutionType ToSolutionType(this string value) - { - if (string.Equals(value, "QuickSolution", StringComparison.InvariantCultureIgnoreCase)) return SolutionType.QuickSolution; - if (string.Equals(value, "DeepInvestigation", StringComparison.InvariantCultureIgnoreCase)) return SolutionType.DeepInvestigation; - if (string.Equals(value, "BestPractices", StringComparison.InvariantCultureIgnoreCase)) return SolutionType.BestPractices; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SolutionType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.cs index 72941290e7fb..9ea01159dd10 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SolutionType.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Type of Solution. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SolutionType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum SolutionType { - /// QuickSolution. + [EnumMember(Value = "QuickSolution")] QuickSolution, - /// DeepInvestigation. + [EnumMember(Value = "DeepInvestigation")] DeepInvestigation, - /// BestPractices. + [EnumMember(Value = "BestPractices")] BestPractices } + internal static class SolutionTypeEnumExtension + { + internal static string ToSerializedValue(this SolutionType? value) + { + return value == null ? null : ((SolutionType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SolutionType value) + { + switch( value ) + { + case SolutionType.QuickSolution: + return "QuickSolution"; + case SolutionType.DeepInvestigation: + return "DeepInvestigation"; + case SolutionType.BestPractices: + return "BestPractices"; + } + return null; + } + + internal static SolutionType? ParseSolutionType(this string value) + { + switch( value ) + { + case "QuickSolution": + return SolutionType.QuickSolution; + case "DeepInvestigation": + return SolutionType.DeepInvestigation; + case "BestPractices": + return SolutionType.BestPractices; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.Serialization.cs deleted file mode 100644 index 2a132d96be0a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.Serialization.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SourceControl : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Token)) - { - writer.WritePropertyName("token"); - writer.WriteStringValue(Token); - } - if (Optional.IsDefined(TokenSecret)) - { - writer.WritePropertyName("tokenSecret"); - writer.WriteStringValue(TokenSecret); - } - if (Optional.IsDefined(RefreshToken)) - { - writer.WritePropertyName("refreshToken"); - writer.WriteStringValue(RefreshToken); - } - if (Optional.IsDefined(ExpirationTime)) - { - writer.WritePropertyName("expirationTime"); - writer.WriteStringValue(ExpirationTime.Value, "O"); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SourceControl DeserializeSourceControl(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional token = default; - Optional tokenSecret = default; - Optional refreshToken = default; - Optional expirationTime = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("token")) - { - token = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("tokenSecret")) - { - tokenSecret = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("refreshToken")) - { - refreshToken = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("expirationTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - expirationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - } - continue; - } - } - return new SourceControl(id.Value, name.Value, kind.Value, type.Value, token.Value, tokenSecret.Value, refreshToken.Value, Optional.ToNullable(expirationTime)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.cs index 6d9c9499b652..6aed94a10774 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControl.cs @@ -1,46 +1,83 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// The source control OAuth token. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The source control OAuth token. + /// + [Rest.Serialization.JsonTransformation] public partial class SourceControl : ProxyOnlyResource { - /// Initializes a new instance of SourceControl. + /// + /// Initializes a new instance of the SourceControl class. + /// public SourceControl() { + CustomInit(); } - /// Initializes a new instance of SourceControl. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// OAuth access token. - /// OAuth access token secret. - /// OAuth refresh token. - /// OAuth token expiration. - internal SourceControl(string id, string name, string kind, string type, string token, string tokenSecret, string refreshToken, DateTimeOffset? expirationTime) : base(id, name, kind, type) + /// + /// Initializes a new instance of the SourceControl class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// OAuth access token. + /// OAuth access token secret. + /// OAuth refresh token. + /// OAuth token expiration. + public SourceControl(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string token = default(string), string tokenSecret = default(string), string refreshToken = default(string), System.DateTime? expirationTime = default(System.DateTime?)) + : base(id, name, kind, type) { Token = token; TokenSecret = tokenSecret; RefreshToken = refreshToken; ExpirationTime = expirationTime; + CustomInit(); } - /// OAuth access token. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets oAuth access token. + /// + [JsonProperty(PropertyName = "properties.token")] public string Token { get; set; } - /// OAuth access token secret. + + /// + /// Gets or sets oAuth access token secret. + /// + [JsonProperty(PropertyName = "properties.tokenSecret")] public string TokenSecret { get; set; } - /// OAuth refresh token. + + /// + /// Gets or sets oAuth refresh token. + /// + [JsonProperty(PropertyName = "properties.refreshToken")] public string RefreshToken { get; set; } - /// OAuth token expiration. - public DateTimeOffset? ExpirationTime { get; set; } + + /// + /// Gets or sets oAuth token expiration. + /// + [JsonProperty(PropertyName = "properties.expirationTime")] + public System.DateTime? ExpirationTime { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.Serialization.cs deleted file mode 100644 index bf4a6c8f05db..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class SourceControlCollection - { - internal static SourceControlCollection DeserializeSourceControlCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SourceControl.DeserializeSourceControl(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SourceControlCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.cs deleted file mode 100644 index b22b29ed7611..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SourceControlCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of source controls. - internal partial class SourceControlCollection - { - /// Initializes a new instance of SourceControlCollection. - /// Collection of resources. - /// is null. - internal SourceControlCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of SourceControlCollection. - /// Collection of resources. - /// Link to next page of resources. - internal SourceControlCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.Serialization.cs deleted file mode 100644 index 71cf1b0b7220..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class SslStateExtensions - { - public static string ToSerialString(this SslState value) => value switch - { - SslState.Disabled => "Disabled", - SslState.SniEnabled => "SniEnabled", - SslState.IpBasedEnabled => "IpBasedEnabled", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SslState value.") - }; - - public static SslState ToSslState(this string value) - { - if (string.Equals(value, "Disabled", StringComparison.InvariantCultureIgnoreCase)) return SslState.Disabled; - if (string.Equals(value, "SniEnabled", StringComparison.InvariantCultureIgnoreCase)) return SslState.SniEnabled; - if (string.Equals(value, "IpBasedEnabled", StringComparison.InvariantCultureIgnoreCase)) return SslState.IpBasedEnabled; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SslState value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.cs index 1a4af4ca74e3..70fae077e8e2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SslState.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// SSL type. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SslState. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum SslState { - /// Disabled. + [EnumMember(Value = "Disabled")] Disabled, - /// SniEnabled. + [EnumMember(Value = "SniEnabled")] SniEnabled, - /// IpBasedEnabled. + [EnumMember(Value = "IpBasedEnabled")] IpBasedEnabled } + internal static class SslStateEnumExtension + { + internal static string ToSerializedValue(this SslState? value) + { + return value == null ? null : ((SslState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SslState value) + { + switch( value ) + { + case SslState.Disabled: + return "Disabled"; + case SslState.SniEnabled: + return "SniEnabled"; + case SslState.IpBasedEnabled: + return "IpBasedEnabled"; + } + return null; + } + + internal static SslState? ParseSslState(this string value) + { + switch( value ) + { + case "Disabled": + return SslState.Disabled; + case "SniEnabled": + return SslState.SniEnabled; + case "IpBasedEnabled": + return SslState.IpBasedEnabled; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.Serialization.cs deleted file mode 100644 index 211ef8f3dfd8..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.Serialization.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StackMajorVersion : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(DisplayVersion)) - { - writer.WritePropertyName("displayVersion"); - writer.WriteStringValue(DisplayVersion); - } - if (Optional.IsDefined(RuntimeVersion)) - { - writer.WritePropertyName("runtimeVersion"); - writer.WriteStringValue(RuntimeVersion); - } - if (Optional.IsDefined(IsDefault)) - { - writer.WritePropertyName("isDefault"); - writer.WriteBooleanValue(IsDefault.Value); - } - if (Optional.IsCollectionDefined(MinorVersions)) - { - writer.WritePropertyName("minorVersions"); - writer.WriteStartArray(); - foreach (var item in MinorVersions) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ApplicationInsights)) - { - writer.WritePropertyName("applicationInsights"); - writer.WriteBooleanValue(ApplicationInsights.Value); - } - if (Optional.IsDefined(IsPreview)) - { - writer.WritePropertyName("isPreview"); - writer.WriteBooleanValue(IsPreview.Value); - } - if (Optional.IsDefined(IsDeprecated)) - { - writer.WritePropertyName("isDeprecated"); - writer.WriteBooleanValue(IsDeprecated.Value); - } - if (Optional.IsDefined(IsHidden)) - { - writer.WritePropertyName("isHidden"); - writer.WriteBooleanValue(IsHidden.Value); - } - if (Optional.IsCollectionDefined(AppSettingsDictionary)) - { - writer.WritePropertyName("appSettingsDictionary"); - writer.WriteStartObject(); - foreach (var item in AppSettingsDictionary) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(SiteConfigPropertiesDictionary)) - { - writer.WritePropertyName("siteConfigPropertiesDictionary"); - writer.WriteStartObject(); - foreach (var item in SiteConfigPropertiesDictionary) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - - internal static StackMajorVersion DeserializeStackMajorVersion(JsonElement element) - { - Optional displayVersion = default; - Optional runtimeVersion = default; - Optional isDefault = default; - Optional> minorVersions = default; - Optional applicationInsights = default; - Optional isPreview = default; - Optional isDeprecated = default; - Optional isHidden = default; - Optional> appSettingsDictionary = default; - Optional> siteConfigPropertiesDictionary = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("displayVersion")) - { - displayVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("runtimeVersion")) - { - runtimeVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("isDefault")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isDefault = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("minorVersions")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(StackMinorVersion.DeserializeStackMinorVersion(item)); - } - minorVersions = array; - continue; - } - if (property.NameEquals("applicationInsights")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - applicationInsights = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isPreview")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isPreview = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isDeprecated")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isDeprecated = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isHidden")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isHidden = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("appSettingsDictionary")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetObject()); - } - appSettingsDictionary = dictionary; - continue; - } - if (property.NameEquals("siteConfigPropertiesDictionary")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetObject()); - } - siteConfigPropertiesDictionary = dictionary; - continue; - } - } - return new StackMajorVersion(displayVersion.Value, runtimeVersion.Value, Optional.ToNullable(isDefault), Optional.ToList(minorVersions), Optional.ToNullable(applicationInsights), Optional.ToNullable(isPreview), Optional.ToNullable(isDeprecated), Optional.ToNullable(isHidden), Optional.ToDictionary(appSettingsDictionary), Optional.ToDictionary(siteConfigPropertiesDictionary)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs index 811b2755530a..4bc2716c9e59 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs @@ -1,48 +1,57 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Application stack major version. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Application stack major version. + /// public partial class StackMajorVersion { - /// Initializes a new instance of StackMajorVersion. + /// + /// Initializes a new instance of the StackMajorVersion class. + /// public StackMajorVersion() { - MinorVersions = new ChangeTrackingList(); - AppSettingsDictionary = new ChangeTrackingDictionary(); - SiteConfigPropertiesDictionary = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of StackMajorVersion. - /// Application stack major version (display only). - /// Application stack major version (runtime only). - /// <code>true</code> if this is the default major version; otherwise, <code>false</code>. - /// Minor versions associated with the major version. - /// <code>true</code> if this supports Application Insights; otherwise, <code>false</code>. - /// <code>true</code> if this stack is in Preview, otherwise <code>false</code>. - /// <code>true</code> if this stack has been deprecated, otherwise <code>false</code>. - /// <code>true</code> if this stack should be hidden for new customers on portal, otherwise <code>false</code>. - /// - /// <appSettings> - /// <appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" /> - /// </appSettings> - /// Example: All the function apps need AppSetting: "FUNCTIONS_WORKER_RUNTIME" to be set stack name. - /// - /// - /// <siteConfigProperties> - /// <siteConfigProperty name="Use32BitWorkerProcess" value="false" /> - /// </siteConfigProperties> - /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be set to 0. - /// - internal StackMajorVersion(string displayVersion, string runtimeVersion, bool? isDefault, IList minorVersions, bool? applicationInsights, bool? isPreview, bool? isDeprecated, bool? isHidden, IDictionary appSettingsDictionary, IDictionary siteConfigPropertiesDictionary) + /// + /// Initializes a new instance of the StackMajorVersion class. + /// + /// Application stack major version + /// (display only). + /// Application stack major version + /// (runtime only). + /// <code>true</code> if this is + /// the default major version; otherwise, + /// <code>false</code>. + /// Minor versions associated with the + /// major version. + /// <code>true</code> if + /// this supports Application Insights; otherwise, + /// <code>false</code>. + /// <code>true</code> if this stack + /// is in Preview, otherwise <code>false</code>. + /// <code>true</code> if this + /// stack has been deprecated, otherwise + /// <code>false</code>. + /// <code>true</code> if this stack + /// should be hidden for new customers on portal, otherwise + /// <code>false</code>. + public StackMajorVersion(string displayVersion = default(string), string runtimeVersion = default(string), bool? isDefault = default(bool?), IList minorVersions = default(IList), bool? applicationInsights = default(bool?), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?)) { DisplayVersion = displayVersion; RuntimeVersion = runtimeVersion; @@ -52,39 +61,71 @@ internal StackMajorVersion(string displayVersion, string runtimeVersion, bool? i IsPreview = isPreview; IsDeprecated = isDeprecated; IsHidden = isHidden; - AppSettingsDictionary = appSettingsDictionary; - SiteConfigPropertiesDictionary = siteConfigPropertiesDictionary; + CustomInit(); } - /// Application stack major version (display only). + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets application stack major version (display only). + /// + [JsonProperty(PropertyName = "displayVersion")] public string DisplayVersion { get; set; } - /// Application stack major version (runtime only). + + /// + /// Gets or sets application stack major version (runtime only). + /// + [JsonProperty(PropertyName = "runtimeVersion")] public string RuntimeVersion { get; set; } - /// <code>true</code> if this is the default major version; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this + /// is the default major version; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDefault")] public bool? IsDefault { get; set; } - /// Minor versions associated with the major version. - public IList MinorVersions { get; } - /// <code>true</code> if this supports Application Insights; otherwise, <code>false</code>. + + /// + /// Gets or sets minor versions associated with the major version. + /// + [JsonProperty(PropertyName = "minorVersions")] + public IList MinorVersions { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this + /// supports Application Insights; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "applicationInsights")] public bool? ApplicationInsights { get; set; } - /// <code>true</code> if this stack is in Preview, otherwise <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this + /// stack is in Preview, otherwise + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isPreview")] public bool? IsPreview { get; set; } - /// <code>true</code> if this stack has been deprecated, otherwise <code>false</code>. - public bool? IsDeprecated { get; set; } - /// <code>true</code> if this stack should be hidden for new customers on portal, otherwise <code>false</code>. - public bool? IsHidden { get; set; } + /// - /// <appSettings> - /// <appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" /> - /// </appSettings> - /// Example: All the function apps need AppSetting: "FUNCTIONS_WORKER_RUNTIME" to be set stack name. + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this + /// stack has been deprecated, otherwise + /// &lt;code&gt;false&lt;/code&gt;. /// - public IDictionary AppSettingsDictionary { get; } + [JsonProperty(PropertyName = "isDeprecated")] + public bool? IsDeprecated { get; set; } + /// - /// <siteConfigProperties> - /// <siteConfigProperty name="Use32BitWorkerProcess" value="false" /> - /// </siteConfigProperties> - /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be set to 0. + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this + /// stack should be hidden for new customers on portal, otherwise + /// &lt;code&gt;false&lt;/code&gt;. /// - public IDictionary SiteConfigPropertiesDictionary { get; } + [JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.Serialization.cs deleted file mode 100644 index 4ea6b51c615a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.Serialization.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StackMinorVersion : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(DisplayVersion)) - { - writer.WritePropertyName("displayVersion"); - writer.WriteStringValue(DisplayVersion); - } - if (Optional.IsDefined(RuntimeVersion)) - { - writer.WritePropertyName("runtimeVersion"); - writer.WriteStringValue(RuntimeVersion); - } - if (Optional.IsDefined(IsDefault)) - { - writer.WritePropertyName("isDefault"); - writer.WriteBooleanValue(IsDefault.Value); - } - if (Optional.IsDefined(IsRemoteDebuggingEnabled)) - { - writer.WritePropertyName("isRemoteDebuggingEnabled"); - writer.WriteBooleanValue(IsRemoteDebuggingEnabled.Value); - } - writer.WriteEndObject(); - } - - internal static StackMinorVersion DeserializeStackMinorVersion(JsonElement element) - { - Optional displayVersion = default; - Optional runtimeVersion = default; - Optional isDefault = default; - Optional isRemoteDebuggingEnabled = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("displayVersion")) - { - displayVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("runtimeVersion")) - { - runtimeVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("isDefault")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isDefault = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isRemoteDebuggingEnabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isRemoteDebuggingEnabled = property.Value.GetBoolean(); - continue; - } - } - return new StackMinorVersion(displayVersion.Value, runtimeVersion.Value, Optional.ToNullable(isDefault), Optional.ToNullable(isRemoteDebuggingEnabled)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.cs index 15d211ff9809..a4671b857f50 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMinorVersion.cs @@ -1,40 +1,86 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Application stack minor version. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Application stack minor version. + /// public partial class StackMinorVersion { - /// Initializes a new instance of StackMinorVersion. + /// + /// Initializes a new instance of the StackMinorVersion class. + /// public StackMinorVersion() { + CustomInit(); } - /// Initializes a new instance of StackMinorVersion. - /// Application stack minor version (display only). - /// Application stack minor version (runtime only). - /// <code>true</code> if this is the default minor version; otherwise, <code>false</code>. - /// <code>true</code> if this supports Remote Debugging, otherwise <code>false</code>. - internal StackMinorVersion(string displayVersion, string runtimeVersion, bool? isDefault, bool? isRemoteDebuggingEnabled) + /// + /// Initializes a new instance of the StackMinorVersion class. + /// + /// Application stack minor version + /// (display only). + /// Application stack minor version + /// (runtime only). + /// <code>true</code> if this is + /// the default minor version; otherwise, + /// <code>false</code>. + /// <code>true</code> if + /// this supports Remote Debugging, otherwise + /// <code>false</code>. + public StackMinorVersion(string displayVersion = default(string), string runtimeVersion = default(string), bool? isDefault = default(bool?), bool? isRemoteDebuggingEnabled = default(bool?)) { DisplayVersion = displayVersion; RuntimeVersion = runtimeVersion; IsDefault = isDefault; IsRemoteDebuggingEnabled = isRemoteDebuggingEnabled; + CustomInit(); } - /// Application stack minor version (display only). + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets application stack minor version (display only). + /// + [JsonProperty(PropertyName = "displayVersion")] public string DisplayVersion { get; set; } - /// Application stack minor version (runtime only). + + /// + /// Gets or sets application stack minor version (runtime only). + /// + [JsonProperty(PropertyName = "runtimeVersion")] public string RuntimeVersion { get; set; } - /// <code>true</code> if this is the default minor version; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this + /// is the default minor version; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDefault")] public bool? IsDefault { get; set; } - /// <code>true</code> if this supports Remote Debugging, otherwise <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this + /// supports Remote Debugging, otherwise + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isRemoteDebuggingEnabled")] public bool? IsRemoteDebuggingEnabled { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.Serialization.cs deleted file mode 100644 index 723c7a5bc333..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class StackPreferredOsExtensions - { - public static string ToSerialString(this StackPreferredOs value) => value switch - { - StackPreferredOs.Windows => "Windows", - StackPreferredOs.Linux => "Linux", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StackPreferredOs value.") - }; - - public static StackPreferredOs ToStackPreferredOs(this string value) - { - if (string.Equals(value, "Windows", StringComparison.InvariantCultureIgnoreCase)) return StackPreferredOs.Windows; - if (string.Equals(value, "Linux", StringComparison.InvariantCultureIgnoreCase)) return StackPreferredOs.Linux; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StackPreferredOs value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs deleted file mode 100644 index 725794c9304c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Function App stack preferred OS. - public enum StackPreferredOs - { - /// Windows. - Windows, - /// Linux. - Linux - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.Serialization.cs deleted file mode 100644 index f6767cfc0f1d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class StagingEnvironmentPolicyExtensions - { - public static string ToSerialString(this StagingEnvironmentPolicy value) => value switch - { - StagingEnvironmentPolicy.Enabled => "Enabled", - StagingEnvironmentPolicy.Disabled => "Disabled", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StagingEnvironmentPolicy value.") - }; - - public static StagingEnvironmentPolicy ToStagingEnvironmentPolicy(this string value) - { - if (string.Equals(value, "Enabled", StringComparison.InvariantCultureIgnoreCase)) return StagingEnvironmentPolicy.Enabled; - if (string.Equals(value, "Disabled", StringComparison.InvariantCultureIgnoreCase)) return StagingEnvironmentPolicy.Disabled; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StagingEnvironmentPolicy value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.cs deleted file mode 100644 index 95be687043b6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// State indicating whether staging environments are allowed or not allowed for a static web app. - public enum StagingEnvironmentPolicy - { - /// Enabled. - Enabled, - /// Disabled. - Disabled - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.Serialization.cs deleted file mode 100644 index b79fdec480da..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.Serialization.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StampCapacity - { - internal static StampCapacity DeserializeStampCapacity(JsonElement element) - { - Optional name = default; - Optional availableCapacity = default; - Optional totalCapacity = default; - Optional unit = default; - Optional computeMode = default; - Optional workerSize = default; - Optional workerSizeId = default; - Optional excludeFromCapacityAllocation = default; - Optional isApplicableForAllComputeModes = default; - Optional siteMode = default; - Optional isLinux = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("availableCapacity")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - availableCapacity = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("totalCapacity")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - totalCapacity = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("unit")) - { - unit = property.Value.GetString(); - continue; - } - if (property.NameEquals("computeMode")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - computeMode = property.Value.GetString().ToComputeModeOptions(); - continue; - } - if (property.NameEquals("workerSize")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - workerSize = property.Value.GetString().ToWorkerSizeOptions(); - continue; - } - if (property.NameEquals("workerSizeId")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - workerSizeId = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("excludeFromCapacityAllocation")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - excludeFromCapacityAllocation = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isApplicableForAllComputeModes")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isApplicableForAllComputeModes = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("siteMode")) - { - siteMode = property.Value.GetString(); - continue; - } - if (property.NameEquals("isLinux")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isLinux = property.Value.GetBoolean(); - continue; - } - } - return new StampCapacity(name.Value, Optional.ToNullable(availableCapacity), Optional.ToNullable(totalCapacity), unit.Value, Optional.ToNullable(computeMode), Optional.ToNullable(workerSize), Optional.ToNullable(workerSizeId), Optional.ToNullable(excludeFromCapacityAllocation), Optional.ToNullable(isApplicableForAllComputeModes), siteMode.Value, Optional.ToNullable(isLinux)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs index c81c71e766bd..c775cdc8eb11 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs @@ -1,41 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Stamp capacity information. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Stamp capacity information. + /// public partial class StampCapacity { - /// Initializes a new instance of StampCapacity. - internal StampCapacity() + /// + /// Initializes a new instance of the StampCapacity class. + /// + public StampCapacity() { + CustomInit(); } - /// Initializes a new instance of StampCapacity. - /// Name of the stamp. - /// Available capacity (# of machines, bytes of storage etc...). - /// Total capacity (# of machines, bytes of storage etc...). - /// Name of the unit. - /// Shared/dedicated workers. - /// Size of the machines. - /// - /// Size ID of machines: + /// + /// Initializes a new instance of the StampCapacity class. + /// + /// Name of the stamp. + /// Available capacity (# of machines, + /// bytes of storage etc...). + /// Total capacity (# of machines, bytes of + /// storage etc...). + /// Name of the unit. + /// Shared/dedicated workers. Possible values + /// include: 'Shared', 'Dedicated', 'Dynamic' + /// Size of the machines. Possible values + /// include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', + /// 'NestedSmall', 'Default' + /// Size ID of machines: /// 0 - Small /// 1 - Medium - /// 2 - Large. - /// - /// - /// If <code>true</code>, it includes basic apps. - /// Basic apps are not used for capacity allocation. - /// - /// <code>true</code> if capacity is applicable for all apps; otherwise, <code>false</code>. - /// Shared or Dedicated. - /// Is this a linux stamp capacity. - internal StampCapacity(string name, long? availableCapacity, long? totalCapacity, string unit, ComputeModeOptions? computeMode, WorkerSizeOptions? workerSize, int? workerSizeId, bool? excludeFromCapacityAllocation, bool? isApplicableForAllComputeModes, string siteMode, bool? isLinux) + /// 2 - Large + /// If + /// <code>true</code>, it includes basic apps. + /// Basic apps are not used for capacity allocation. + /// <code>true</code> + /// if capacity is applicable for all apps; otherwise, + /// <code>false</code>. + /// Shared or Dedicated. + /// Is this a linux stamp capacity + public StampCapacity(string name = default(string), long? availableCapacity = default(long?), long? totalCapacity = default(long?), string unit = default(string), ComputeModeOptions? computeMode = default(ComputeModeOptions?), WorkerSizeOptions? workerSize = default(WorkerSizeOptions?), int? workerSizeId = default(int?), bool? excludeFromCapacityAllocation = default(bool?), bool? isApplicableForAllComputeModes = default(bool?), string siteMode = default(string), bool? isLinux = default(bool?)) { Name = name; AvailableCapacity = availableCapacity; @@ -48,37 +66,91 @@ internal StampCapacity(string name, long? availableCapacity, long? totalCapacity IsApplicableForAllComputeModes = isApplicableForAllComputeModes; SiteMode = siteMode; IsLinux = isLinux; + CustomInit(); } - /// Name of the stamp. - public string Name { get; } - /// Available capacity (# of machines, bytes of storage etc...). - public long? AvailableCapacity { get; } - /// Total capacity (# of machines, bytes of storage etc...). - public long? TotalCapacity { get; } - /// Name of the unit. - public string Unit { get; } - /// Shared/dedicated workers. - public ComputeModeOptions? ComputeMode { get; } - /// Size of the machines. - public WorkerSizeOptions? WorkerSize { get; } /// - /// Size ID of machines: + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the stamp. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets available capacity (# of machines, bytes of storage + /// etc...). + /// + [JsonProperty(PropertyName = "availableCapacity")] + public long? AvailableCapacity { get; set; } + + /// + /// Gets or sets total capacity (# of machines, bytes of storage + /// etc...). + /// + [JsonProperty(PropertyName = "totalCapacity")] + public long? TotalCapacity { get; set; } + + /// + /// Gets or sets name of the unit. + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + /// + /// Gets or sets shared/dedicated workers. Possible values include: + /// 'Shared', 'Dedicated', 'Dynamic' + /// + [JsonProperty(PropertyName = "computeMode")] + public ComputeModeOptions? ComputeMode { get; set; } + + /// + /// Gets or sets size of the machines. Possible values include: + /// 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'NestedSmall', + /// 'Default' + /// + [JsonProperty(PropertyName = "workerSize")] + public WorkerSizeOptions? WorkerSize { get; set; } + + /// + /// Gets or sets size ID of machines: /// 0 - Small /// 1 - Medium - /// 2 - Large. + /// 2 - Large /// - public int? WorkerSizeId { get; } + [JsonProperty(PropertyName = "workerSizeId")] + public int? WorkerSizeId { get; set; } + /// - /// If <code>true</code>, it includes basic apps. + /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, it + /// includes basic apps. /// Basic apps are not used for capacity allocation. /// - public bool? ExcludeFromCapacityAllocation { get; } - /// <code>true</code> if capacity is applicable for all apps; otherwise, <code>false</code>. - public bool? IsApplicableForAllComputeModes { get; } - /// Shared or Dedicated. - public string SiteMode { get; } - /// Is this a linux stamp capacity. - public bool? IsLinux { get; } + [JsonProperty(PropertyName = "excludeFromCapacityAllocation")] + public bool? ExcludeFromCapacityAllocation { get; set; } + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// capacity is applicable for all apps; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isApplicableForAllComputeModes")] + public bool? IsApplicableForAllComputeModes { get; set; } + + /// + /// Gets or sets shared or Dedicated. + /// + [JsonProperty(PropertyName = "siteMode")] + public string SiteMode { get; set; } + + /// + /// Gets or sets is this a linux stamp capacity + /// + [JsonProperty(PropertyName = "isLinux")] + public bool? IsLinux { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.Serialization.cs deleted file mode 100644 index e1b915a18d78..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class StampCapacityCollection - { - internal static StampCapacityCollection DeserializeStampCapacityCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(StampCapacity.DeserializeStampCapacity(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new StampCapacityCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.cs deleted file mode 100644 index 09cb7dc9f83d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacityCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of stamp capacities. - internal partial class StampCapacityCollection - { - /// Initializes a new instance of StampCapacityCollection. - /// Collection of resources. - /// is null. - internal StampCapacityCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of StampCapacityCollection. - /// Collection of resources. - /// Link to next page of resources. - internal StampCapacityCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.Serialization.cs deleted file mode 100644 index b529acf121d4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.Serialization.cs +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteARMResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"); - writer.WriteObjectValue(Sku); - } - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"); - writer.WriteObjectValue(Identity); - } - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(RepositoryUrl)) - { - writer.WritePropertyName("repositoryUrl"); - writer.WriteStringValue(RepositoryUrl); - } - if (Optional.IsDefined(Branch)) - { - writer.WritePropertyName("branch"); - writer.WriteStringValue(Branch); - } - if (Optional.IsDefined(RepositoryToken)) - { - writer.WritePropertyName("repositoryToken"); - writer.WriteStringValue(RepositoryToken); - } - if (Optional.IsDefined(BuildProperties)) - { - writer.WritePropertyName("buildProperties"); - writer.WriteObjectValue(BuildProperties); - } - if (Optional.IsDefined(StagingEnvironmentPolicy)) - { - writer.WritePropertyName("stagingEnvironmentPolicy"); - writer.WriteStringValue(StagingEnvironmentPolicy.Value.ToSerialString()); - } - if (Optional.IsDefined(AllowConfigFileUpdates)) - { - writer.WritePropertyName("allowConfigFileUpdates"); - writer.WriteBooleanValue(AllowConfigFileUpdates.Value); - } - if (Optional.IsDefined(TemplateProperties)) - { - writer.WritePropertyName("templateProperties"); - writer.WriteObjectValue(TemplateProperties); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteARMResource DeserializeStaticSiteARMResource(JsonElement element) - { - Optional sku = default; - Optional identity = default; - Optional id = default; - Optional name = default; - Optional kind = default; - string location = default; - Optional type = default; - Optional> tags = default; - Optional defaultHostname = default; - Optional repositoryUrl = default; - Optional branch = default; - Optional> customDomains = default; - Optional repositoryToken = default; - Optional buildProperties = default; - Optional> privateEndpointConnections = default; - Optional stagingEnvironmentPolicy = default; - Optional allowConfigFileUpdates = default; - Optional templateProperties = default; - Optional contentDistributionEndpoint = default; - Optional keyVaultReferenceIdentity = default; - Optional> userProvidedFunctionApps = default; - Optional provider = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sku")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - sku = SkuDescription.DeserializeSkuDescription(property.Value); - continue; - } - if (property.NameEquals("identity")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value); - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("defaultHostname")) - { - defaultHostname = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("repositoryUrl")) - { - repositoryUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("branch")) - { - branch = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("customDomains")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - customDomains = array; - continue; - } - if (property0.NameEquals("repositoryToken")) - { - repositoryToken = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("buildProperties")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - buildProperties = StaticSiteBuildProperties.DeserializeStaticSiteBuildProperties(property0.Value); - continue; - } - if (property0.NameEquals("privateEndpointConnections")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ResponseMessageEnvelopeRemotePrivateEndpointConnection.DeserializeResponseMessageEnvelopeRemotePrivateEndpointConnection(item)); - } - privateEndpointConnections = array; - continue; - } - if (property0.NameEquals("stagingEnvironmentPolicy")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - stagingEnvironmentPolicy = property0.Value.GetString().ToStagingEnvironmentPolicy(); - continue; - } - if (property0.NameEquals("allowConfigFileUpdates")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - allowConfigFileUpdates = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("templateProperties")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - templateProperties = StaticSiteTemplateOptions.DeserializeStaticSiteTemplateOptions(property0.Value); - continue; - } - if (property0.NameEquals("contentDistributionEndpoint")) - { - contentDistributionEndpoint = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("keyVaultReferenceIdentity")) - { - keyVaultReferenceIdentity = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("userProvidedFunctionApps")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(StaticSiteUserProvidedFunctionApp.DeserializeStaticSiteUserProvidedFunctionApp(item)); - } - userProvidedFunctionApps = array; - continue; - } - if (property0.NameEquals("provider")) - { - provider = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new StaticSiteARMResource(id.Value, name.Value, kind.Value, location, type.Value, Optional.ToDictionary(tags), sku.Value, identity.Value, defaultHostname.Value, repositoryUrl.Value, branch.Value, Optional.ToList(customDomains), repositoryToken.Value, buildProperties.Value, Optional.ToList(privateEndpointConnections), Optional.ToNullable(stagingEnvironmentPolicy), Optional.ToNullable(allowConfigFileUpdates), templateProperties.Value, contentDistributionEndpoint.Value, keyVaultReferenceIdentity.Value, Optional.ToList(userProvidedFunctionApps), provider.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs index 321472445547..656ca9e54a50 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs @@ -1,108 +1,126 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Static Site ARM resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Static Site ARM resource. + /// + [Rest.Serialization.JsonTransformation] public partial class StaticSiteARMResource : Resource { - /// Initializes a new instance of StaticSiteARMResource. - /// Resource Location. - /// is null. - public StaticSiteARMResource(string location) : base(location) + /// + /// Initializes a new instance of the StaticSiteARMResource class. + /// + public StaticSiteARMResource() { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - CustomDomains = new ChangeTrackingList(); - PrivateEndpointConnections = new ChangeTrackingList(); - UserProvidedFunctionApps = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of StaticSiteARMResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource Location. - /// Resource type. - /// Resource tags. - /// Description of a SKU for a scalable resource. - /// Managed service identity. - /// The default autogenerated hostname for the static site. - /// URL for the repository of the static site. - /// The target branch in the repository. - /// The custom domains associated with this static site. - /// A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. - /// Build properties to configure on the repository. - /// Private endpoint connections. - /// State indicating whether staging environments are allowed or not allowed for a static web app. - /// <code>false</code> if config file is locked for this static web app; otherwise, <code>true</code>. - /// Template options for generating a new repository. - /// The content distribution endpoint for the static site. - /// Identity to use for Key Vault Reference authentication. - /// User provided function apps registered with the static site. - /// The provider that submitted the last deployment to the primary environment of the static site. - internal StaticSiteARMResource(string id, string name, string kind, string location, string type, IDictionary tags, SkuDescription sku, ManagedServiceIdentity identity, string defaultHostname, string repositoryUrl, string branch, IReadOnlyList customDomains, string repositoryToken, StaticSiteBuildProperties buildProperties, IReadOnlyList privateEndpointConnections, StagingEnvironmentPolicy? stagingEnvironmentPolicy, bool? allowConfigFileUpdates, StaticSiteTemplateOptions templateProperties, string contentDistributionEndpoint, string keyVaultReferenceIdentity, IReadOnlyList userProvidedFunctionApps, string provider) : base(id, name, kind, location, type, tags) + /// + /// Initializes a new instance of the StaticSiteARMResource class. + /// + /// Resource Location. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Resource tags. + /// The default autogenerated hostname + /// for the static site. + /// URL for the repository of the static + /// site. + /// The target branch in the repository. + /// The custom domains associated with this + /// static site. + /// A user's github repository token. + /// This is used to setup the Github Actions workflow file and API + /// secrets. + /// Build properties to configure on the + /// repository. + public StaticSiteARMResource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), SkuDescription sku = default(SkuDescription)) + : base(location, id, name, kind, type, tags) { - Sku = sku; - Identity = identity; DefaultHostname = defaultHostname; RepositoryUrl = repositoryUrl; Branch = branch; CustomDomains = customDomains; RepositoryToken = repositoryToken; BuildProperties = buildProperties; - PrivateEndpointConnections = privateEndpointConnections; - StagingEnvironmentPolicy = stagingEnvironmentPolicy; - AllowConfigFileUpdates = allowConfigFileUpdates; - TemplateProperties = templateProperties; - ContentDistributionEndpoint = contentDistributionEndpoint; - KeyVaultReferenceIdentity = keyVaultReferenceIdentity; - UserProvidedFunctionApps = userProvidedFunctionApps; - Provider = provider; + Sku = sku; + CustomInit(); } - /// Description of a SKU for a scalable resource. - public SkuDescription Sku { get; set; } - /// Managed service identity. - public ManagedServiceIdentity Identity { get; set; } - /// The default autogenerated hostname for the static site. - public string DefaultHostname { get; } - /// URL for the repository of the static site. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the default autogenerated hostname for the static site. + /// + [JsonProperty(PropertyName = "properties.defaultHostname")] + public string DefaultHostname { get; private set; } + + /// + /// Gets or sets URL for the repository of the static site. + /// + [JsonProperty(PropertyName = "properties.repositoryUrl")] public string RepositoryUrl { get; set; } - /// The target branch in the repository. + + /// + /// Gets or sets the target branch in the repository. + /// + [JsonProperty(PropertyName = "properties.branch")] public string Branch { get; set; } - /// The custom domains associated with this static site. - public IReadOnlyList CustomDomains { get; } - /// A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. + + /// + /// Gets the custom domains associated with this static site. + /// + [JsonProperty(PropertyName = "properties.customDomains")] + public IList CustomDomains { get; private set; } + + /// + /// Gets or sets a user's github repository token. This is used to + /// setup the Github Actions workflow file and API secrets. + /// + [JsonProperty(PropertyName = "properties.repositoryToken")] public string RepositoryToken { get; set; } - /// Build properties to configure on the repository. + + /// + /// Gets or sets build properties to configure on the repository. + /// + [JsonProperty(PropertyName = "properties.buildProperties")] public StaticSiteBuildProperties BuildProperties { get; set; } - /// Private endpoint connections. - public IReadOnlyList PrivateEndpointConnections { get; } - /// State indicating whether staging environments are allowed or not allowed for a static web app. - public StagingEnvironmentPolicy? StagingEnvironmentPolicy { get; set; } - /// <code>false</code> if config file is locked for this static web app; otherwise, <code>true</code>. - public bool? AllowConfigFileUpdates { get; set; } - /// Template options for generating a new repository. - public StaticSiteTemplateOptions TemplateProperties { get; set; } - /// The content distribution endpoint for the static site. - public string ContentDistributionEndpoint { get; } - /// Identity to use for Key Vault Reference authentication. - public string KeyVaultReferenceIdentity { get; } - /// User provided function apps registered with the static site. - public IReadOnlyList UserProvidedFunctionApps { get; } - /// The provider that submitted the last deployment to the primary environment of the static site. - public string Provider { get; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public SkuDescription Sku { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.Serialization.cs deleted file mode 100644 index 714d796eed3d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.Serialization.cs +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteBuildARMResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteBuildARMResource DeserializeStaticSiteBuildARMResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional buildId = default; - Optional sourceBranch = default; - Optional pullRequestTitle = default; - Optional hostname = default; - Optional createdTimeUtc = default; - Optional lastUpdatedOn = default; - Optional status = default; - Optional> userProvidedFunctionApps = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("buildId")) - { - buildId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("sourceBranch")) - { - sourceBranch = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("pullRequestTitle")) - { - pullRequestTitle = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("hostname")) - { - hostname = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("createdTimeUtc")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - createdTimeUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("lastUpdatedOn")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - lastUpdatedOn = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = new BuildStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("userProvidedFunctionApps")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(StaticSiteUserProvidedFunctionApp.DeserializeStaticSiteUserProvidedFunctionApp(item)); - } - userProvidedFunctionApps = array; - continue; - } - } - continue; - } - } - return new StaticSiteBuildARMResource(id.Value, name.Value, kind.Value, type.Value, buildId.Value, sourceBranch.Value, pullRequestTitle.Value, hostname.Value, Optional.ToNullable(createdTimeUtc), Optional.ToNullable(lastUpdatedOn), Optional.ToNullable(status), Optional.ToList(userProvidedFunctionApps)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs index 6eca514f8673..b82f1efcf925 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs @@ -1,39 +1,55 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Static Site Build ARM resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static Site Build ARM resource. + /// + [Rest.Serialization.JsonTransformation] public partial class StaticSiteBuildARMResource : ProxyOnlyResource { - /// Initializes a new instance of StaticSiteBuildARMResource. + /// + /// Initializes a new instance of the StaticSiteBuildARMResource class. + /// public StaticSiteBuildARMResource() { - UserProvidedFunctionApps = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of StaticSiteBuildARMResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// An identifier for the static site build. - /// The source branch. - /// The title of a pull request that a static site build is related to. - /// The hostname for a static site build. - /// When this build was created. - /// When this build was updated. - /// The status of the static site build. - /// User provided function apps registered with the static site build. - internal StaticSiteBuildARMResource(string id, string name, string kind, string type, string buildId, string sourceBranch, string pullRequestTitle, string hostname, DateTimeOffset? createdTimeUtc, DateTimeOffset? lastUpdatedOn, BuildStatus? status, IReadOnlyList userProvidedFunctionApps) : base(id, name, kind, type) + /// + /// Initializes a new instance of the StaticSiteBuildARMResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// An identifier for the static site + /// build. + /// The source branch. + /// The title of a pull request that a + /// static site build is related to. + /// The hostname for a static site + /// build. + /// When this build was created. + /// When this build was updated. + /// The status of the static site build. Possible + /// values include: 'WaitingForDeployment', 'Uploading', 'Deploying', + /// 'Ready', 'Failed', 'Deleting', 'Detached' + public StaticSiteBuildARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string buildId = default(string), string sourceBranch = default(string), string pullRequestTitle = default(string), string hostname = default(string), System.DateTime? createdTimeUtc = default(System.DateTime?), System.DateTime? lastUpdatedOn = default(System.DateTime?), string status = default(string)) + : base(id, name, kind, type) { BuildId = buildId; SourceBranch = sourceBranch; @@ -42,24 +58,58 @@ internal StaticSiteBuildARMResource(string id, string name, string kind, string CreatedTimeUtc = createdTimeUtc; LastUpdatedOn = lastUpdatedOn; Status = status; - UserProvidedFunctionApps = userProvidedFunctionApps; + CustomInit(); } - /// An identifier for the static site build. - public string BuildId { get; } - /// The source branch. - public string SourceBranch { get; } - /// The title of a pull request that a static site build is related to. - public string PullRequestTitle { get; } - /// The hostname for a static site build. - public string Hostname { get; } - /// When this build was created. - public DateTimeOffset? CreatedTimeUtc { get; } - /// When this build was updated. - public DateTimeOffset? LastUpdatedOn { get; } - /// The status of the static site build. - public BuildStatus? Status { get; } - /// User provided function apps registered with the static site build. - public IReadOnlyList UserProvidedFunctionApps { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets an identifier for the static site build. + /// + [JsonProperty(PropertyName = "properties.buildId")] + public string BuildId { get; private set; } + + /// + /// Gets the source branch. + /// + [JsonProperty(PropertyName = "properties.sourceBranch")] + public string SourceBranch { get; private set; } + + /// + /// Gets the title of a pull request that a static site build is + /// related to. + /// + [JsonProperty(PropertyName = "properties.pullRequestTitle")] + public string PullRequestTitle { get; private set; } + + /// + /// Gets the hostname for a static site build. + /// + [JsonProperty(PropertyName = "properties.hostname")] + public string Hostname { get; private set; } + + /// + /// Gets when this build was created. + /// + [JsonProperty(PropertyName = "properties.createdTimeUtc")] + public System.DateTime? CreatedTimeUtc { get; private set; } + + /// + /// Gets when this build was updated. + /// + [JsonProperty(PropertyName = "properties.lastUpdatedOn")] + public System.DateTime? LastUpdatedOn { get; private set; } + + /// + /// Gets the status of the static site build. Possible values include: + /// 'WaitingForDeployment', 'Uploading', 'Deploying', 'Ready', + /// 'Failed', 'Deleting', 'Detached' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.Serialization.cs deleted file mode 100644 index 8b0eb0a80046..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class StaticSiteBuildCollection - { - internal static StaticSiteBuildCollection DeserializeStaticSiteBuildCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(StaticSiteBuildARMResource.DeserializeStaticSiteBuildARMResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new StaticSiteBuildCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.cs deleted file mode 100644 index ffe81f6dee66..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of static site builds. - internal partial class StaticSiteBuildCollection - { - /// Initializes a new instance of StaticSiteBuildCollection. - /// Collection of resources. - /// is null. - internal StaticSiteBuildCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of StaticSiteBuildCollection. - /// Collection of resources. - /// Link to next page of resources. - internal StaticSiteBuildCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.Serialization.cs deleted file mode 100644 index adea64d70e44..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.Serialization.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteBuildProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(AppLocation)) - { - writer.WritePropertyName("appLocation"); - writer.WriteStringValue(AppLocation); - } - if (Optional.IsDefined(ApiLocation)) - { - writer.WritePropertyName("apiLocation"); - writer.WriteStringValue(ApiLocation); - } - if (Optional.IsDefined(AppArtifactLocation)) - { - writer.WritePropertyName("appArtifactLocation"); - writer.WriteStringValue(AppArtifactLocation); - } - if (Optional.IsDefined(OutputLocation)) - { - writer.WritePropertyName("outputLocation"); - writer.WriteStringValue(OutputLocation); - } - if (Optional.IsDefined(AppBuildCommand)) - { - writer.WritePropertyName("appBuildCommand"); - writer.WriteStringValue(AppBuildCommand); - } - if (Optional.IsDefined(ApiBuildCommand)) - { - writer.WritePropertyName("apiBuildCommand"); - writer.WriteStringValue(ApiBuildCommand); - } - if (Optional.IsDefined(SkipGithubActionWorkflowGeneration)) - { - writer.WritePropertyName("skipGithubActionWorkflowGeneration"); - writer.WriteBooleanValue(SkipGithubActionWorkflowGeneration.Value); - } - if (Optional.IsDefined(GithubActionSecretNameOverride)) - { - writer.WritePropertyName("githubActionSecretNameOverride"); - writer.WriteStringValue(GithubActionSecretNameOverride); - } - writer.WriteEndObject(); - } - - internal static StaticSiteBuildProperties DeserializeStaticSiteBuildProperties(JsonElement element) - { - Optional appLocation = default; - Optional apiLocation = default; - Optional appArtifactLocation = default; - Optional outputLocation = default; - Optional appBuildCommand = default; - Optional apiBuildCommand = default; - Optional skipGithubActionWorkflowGeneration = default; - Optional githubActionSecretNameOverride = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("appLocation")) - { - appLocation = property.Value.GetString(); - continue; - } - if (property.NameEquals("apiLocation")) - { - apiLocation = property.Value.GetString(); - continue; - } - if (property.NameEquals("appArtifactLocation")) - { - appArtifactLocation = property.Value.GetString(); - continue; - } - if (property.NameEquals("outputLocation")) - { - outputLocation = property.Value.GetString(); - continue; - } - if (property.NameEquals("appBuildCommand")) - { - appBuildCommand = property.Value.GetString(); - continue; - } - if (property.NameEquals("apiBuildCommand")) - { - apiBuildCommand = property.Value.GetString(); - continue; - } - if (property.NameEquals("skipGithubActionWorkflowGeneration")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - skipGithubActionWorkflowGeneration = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("githubActionSecretNameOverride")) - { - githubActionSecretNameOverride = property.Value.GetString(); - continue; - } - } - return new StaticSiteBuildProperties(appLocation.Value, apiLocation.Value, appArtifactLocation.Value, outputLocation.Value, appBuildCommand.Value, apiBuildCommand.Value, Optional.ToNullable(skipGithubActionWorkflowGeneration), githubActionSecretNameOverride.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs index 363e4d68fc52..be1c6117947d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs @@ -1,56 +1,70 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Build properties for the static site. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Build properties for the static site. + /// public partial class StaticSiteBuildProperties { - /// Initializes a new instance of StaticSiteBuildProperties. + /// + /// Initializes a new instance of the StaticSiteBuildProperties class. + /// public StaticSiteBuildProperties() { + CustomInit(); } - /// Initializes a new instance of StaticSiteBuildProperties. - /// The path to the app code within the repository. - /// The path to the api code within the repository. - /// Deprecated: The path of the app artifacts after building (deprecated in favor of OutputLocation). - /// The output path of the app after building. - /// A custom command to run during deployment of the static content application. - /// A custom command to run during deployment of the Azure Functions API application. - /// Skip Github Action workflow generation. - /// Github Action secret name override. - internal StaticSiteBuildProperties(string appLocation, string apiLocation, string appArtifactLocation, string outputLocation, string appBuildCommand, string apiBuildCommand, bool? skipGithubActionWorkflowGeneration, string githubActionSecretNameOverride) + /// + /// Initializes a new instance of the StaticSiteBuildProperties class. + /// + /// The path to the app code within the + /// repository. + /// The path to the api code within the + /// repository. + /// The path of the app artifacts + /// after building. + public StaticSiteBuildProperties(string appLocation = default(string), string apiLocation = default(string), string appArtifactLocation = default(string)) { AppLocation = appLocation; ApiLocation = apiLocation; AppArtifactLocation = appArtifactLocation; - OutputLocation = outputLocation; - AppBuildCommand = appBuildCommand; - ApiBuildCommand = apiBuildCommand; - SkipGithubActionWorkflowGeneration = skipGithubActionWorkflowGeneration; - GithubActionSecretNameOverride = githubActionSecretNameOverride; + CustomInit(); } - /// The path to the app code within the repository. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the path to the app code within the repository. + /// + [JsonProperty(PropertyName = "appLocation")] public string AppLocation { get; set; } - /// The path to the api code within the repository. + + /// + /// Gets or sets the path to the api code within the repository. + /// + [JsonProperty(PropertyName = "apiLocation")] public string ApiLocation { get; set; } - /// Deprecated: The path of the app artifacts after building (deprecated in favor of OutputLocation). + + /// + /// Gets or sets the path of the app artifacts after building. + /// + [JsonProperty(PropertyName = "appArtifactLocation")] public string AppArtifactLocation { get; set; } - /// The output path of the app after building. - public string OutputLocation { get; set; } - /// A custom command to run during deployment of the static content application. - public string AppBuildCommand { get; set; } - /// A custom command to run during deployment of the Azure Functions API application. - public string ApiBuildCommand { get; set; } - /// Skip Github Action workflow generation. - public bool? SkipGithubActionWorkflowGeneration { get; set; } - /// Github Action secret name override. - public string GithubActionSecretNameOverride { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.Serialization.cs deleted file mode 100644 index 54dd76de86f6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class StaticSiteCollection - { - internal static StaticSiteCollection DeserializeStaticSiteCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(StaticSiteARMResource.DeserializeStaticSiteARMResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new StaticSiteCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.cs deleted file mode 100644 index c372436d424f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of static sites. - internal partial class StaticSiteCollection - { - /// Initializes a new instance of StaticSiteCollection. - /// Collection of resources. - /// is null. - internal StaticSiteCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of StaticSiteCollection. - /// Collection of resources. - /// Link to next page of resources. - internal StaticSiteCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.Serialization.cs deleted file mode 100644 index 33985a82ac1a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.Serialization.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteCustomDomainOverviewARMResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteCustomDomainOverviewARMResource DeserializeStaticSiteCustomDomainOverviewARMResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional domainName = default; - Optional createdOn = default; - Optional status = default; - Optional validationToken = default; - Optional errorMessage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("domainName")) - { - domainName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("createdOn")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - createdOn = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = new CustomDomainStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("validationToken")) - { - validationToken = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("errorMessage")) - { - errorMessage = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new StaticSiteCustomDomainOverviewARMResource(id.Value, name.Value, kind.Value, type.Value, domainName.Value, Optional.ToNullable(createdOn), Optional.ToNullable(status), validationToken.Value, errorMessage.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs index 3e7cc0b173d4..b2dca77065cf 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs @@ -1,49 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Static Site Custom Domain Overview ARM resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static Site Custom Domain Overview ARM resource. + /// + [Rest.Serialization.JsonTransformation] public partial class StaticSiteCustomDomainOverviewARMResource : ProxyOnlyResource { - /// Initializes a new instance of StaticSiteCustomDomainOverviewARMResource. + /// + /// Initializes a new instance of the + /// StaticSiteCustomDomainOverviewARMResource class. + /// public StaticSiteCustomDomainOverviewARMResource() { + CustomInit(); } - /// Initializes a new instance of StaticSiteCustomDomainOverviewARMResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The domain name for the static site custom domain. - /// The date and time on which the custom domain was created for the static site. - /// The status of the custom domain. - /// The TXT record validation token. - /// . - internal StaticSiteCustomDomainOverviewARMResource(string id, string name, string kind, string type, string domainName, DateTimeOffset? createdOn, CustomDomainStatus? status, string validationToken, string errorMessage) : base(id, name, kind, type) + /// + /// Initializes a new instance of the + /// StaticSiteCustomDomainOverviewARMResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The domain name for the static site custom + /// domain. + /// The date and time on which the custom + /// domain was created for the static site. + public StaticSiteCustomDomainOverviewARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string domainName = default(string), System.DateTime? createdOn = default(System.DateTime?)) + : base(id, name, kind, type) { DomainName = domainName; CreatedOn = createdOn; - Status = status; - ValidationToken = validationToken; - ErrorMessage = errorMessage; + CustomInit(); } - /// The domain name for the static site custom domain. - public string DomainName { get; } - /// The date and time on which the custom domain was created for the static site. - public DateTimeOffset? CreatedOn { get; } - /// The status of the custom domain. - public CustomDomainStatus? Status { get; } - /// The TXT record validation token. - public string ValidationToken { get; } - public string ErrorMessage { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the domain name for the static site custom domain. + /// + [JsonProperty(PropertyName = "properties.domainName")] + public string DomainName { get; private set; } + + /// + /// Gets the date and time on which the custom domain was created for + /// the static site. + /// + [JsonProperty(PropertyName = "properties.createdOn")] + public System.DateTime? CreatedOn { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.Serialization.cs deleted file mode 100644 index 2ae7279b2b5e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class StaticSiteCustomDomainOverviewCollection - { - internal static StaticSiteCustomDomainOverviewCollection DeserializeStaticSiteCustomDomainOverviewCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(StaticSiteCustomDomainOverviewARMResource.DeserializeStaticSiteCustomDomainOverviewARMResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new StaticSiteCustomDomainOverviewCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.cs deleted file mode 100644 index 1038bd43b795..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of static site custom domains. - internal partial class StaticSiteCustomDomainOverviewCollection - { - /// Initializes a new instance of StaticSiteCustomDomainOverviewCollection. - /// Collection of resources. - /// is null. - internal StaticSiteCustomDomainOverviewCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of StaticSiteCustomDomainOverviewCollection. - /// Collection of resources. - /// Link to next page of resources. - internal StaticSiteCustomDomainOverviewCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.Serialization.cs deleted file mode 100644 index 8841a96a7236..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteCustomDomainRequestPropertiesARMResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ValidationMethod)) - { - writer.WritePropertyName("validationMethod"); - writer.WriteStringValue(ValidationMethod); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteCustomDomainRequestPropertiesARMResource DeserializeStaticSiteCustomDomainRequestPropertiesARMResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional validationMethod = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("validationMethod")) - { - validationMethod = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new StaticSiteCustomDomainRequestPropertiesARMResource(id.Value, name.Value, kind.Value, type.Value, validationMethod.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs deleted file mode 100644 index a0dfa1d3477f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Static Site Custom Domain Request Properties ARM resource. - public partial class StaticSiteCustomDomainRequestPropertiesARMResource : ProxyOnlyResource - { - /// Initializes a new instance of StaticSiteCustomDomainRequestPropertiesARMResource. - public StaticSiteCustomDomainRequestPropertiesARMResource() - { - } - - /// Initializes a new instance of StaticSiteCustomDomainRequestPropertiesARMResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Validation method for adding a custom domain. - internal StaticSiteCustomDomainRequestPropertiesARMResource(string id, string name, string kind, string type, string validationMethod) : base(id, name, kind, type) - { - ValidationMethod = validationMethod; - } - - /// Validation method for adding a custom domain. - public string ValidationMethod { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.Serialization.cs deleted file mode 100644 index ce83bb607f33..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.Serialization.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteFunctionOverviewARMResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteFunctionOverviewARMResource DeserializeStaticSiteFunctionOverviewARMResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional functionName = default; - Optional triggerType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("functionName")) - { - functionName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("triggerType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - triggerType = new TriggerTypes(property0.Value.GetString()); - continue; - } - } - continue; - } - } - return new StaticSiteFunctionOverviewARMResource(id.Value, name.Value, kind.Value, type.Value, functionName.Value, Optional.ToNullable(triggerType)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.cs index a5efa8c206da..2e39a7c18f36 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewARMResource.cs @@ -1,36 +1,71 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Static Site Function Overview ARM resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static Site Function Overview ARM resource. + /// + [Rest.Serialization.JsonTransformation] public partial class StaticSiteFunctionOverviewARMResource : ProxyOnlyResource { - /// Initializes a new instance of StaticSiteFunctionOverviewARMResource. + /// + /// Initializes a new instance of the + /// StaticSiteFunctionOverviewARMResource class. + /// public StaticSiteFunctionOverviewARMResource() { + CustomInit(); } - /// Initializes a new instance of StaticSiteFunctionOverviewARMResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The name for the function. - /// The trigger type of the function. - internal StaticSiteFunctionOverviewARMResource(string id, string name, string kind, string type, string functionName, TriggerTypes? triggerType) : base(id, name, kind, type) + /// + /// Initializes a new instance of the + /// StaticSiteFunctionOverviewARMResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The name for the function + /// The trigger type of the function. + /// Possible values include: 'HttpTrigger', 'Unknown' + public StaticSiteFunctionOverviewARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string functionName = default(string), string triggerType = default(string)) + : base(id, name, kind, type) { FunctionName = functionName; TriggerType = triggerType; + CustomInit(); } - /// The name for the function. - public string FunctionName { get; } - /// The trigger type of the function. - public TriggerTypes? TriggerType { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name for the function + /// + [JsonProperty(PropertyName = "properties.functionName")] + public string FunctionName { get; private set; } + + /// + /// Gets the trigger type of the function. Possible values include: + /// 'HttpTrigger', 'Unknown' + /// + [JsonProperty(PropertyName = "properties.triggerType")] + public string TriggerType { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.Serialization.cs deleted file mode 100644 index 4de0bf500aef..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class StaticSiteFunctionOverviewCollection - { - internal static StaticSiteFunctionOverviewCollection DeserializeStaticSiteFunctionOverviewCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(StaticSiteFunctionOverviewARMResource.DeserializeStaticSiteFunctionOverviewARMResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new StaticSiteFunctionOverviewCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.cs deleted file mode 100644 index 966520ac7c43..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteFunctionOverviewCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of static site functions. - internal partial class StaticSiteFunctionOverviewCollection - { - /// Initializes a new instance of StaticSiteFunctionOverviewCollection. - /// Collection of resources. - /// is null. - internal StaticSiteFunctionOverviewCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of StaticSiteFunctionOverviewCollection. - /// Collection of resources. - /// Link to next page of resources. - internal StaticSiteFunctionOverviewCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.Serialization.cs deleted file mode 100644 index a0043415ad1e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.Serialization.cs +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSitePatchResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(RepositoryUrl)) - { - writer.WritePropertyName("repositoryUrl"); - writer.WriteStringValue(RepositoryUrl); - } - if (Optional.IsDefined(Branch)) - { - writer.WritePropertyName("branch"); - writer.WriteStringValue(Branch); - } - if (Optional.IsDefined(RepositoryToken)) - { - writer.WritePropertyName("repositoryToken"); - writer.WriteStringValue(RepositoryToken); - } - if (Optional.IsDefined(BuildProperties)) - { - writer.WritePropertyName("buildProperties"); - writer.WriteObjectValue(BuildProperties); - } - if (Optional.IsDefined(StagingEnvironmentPolicy)) - { - writer.WritePropertyName("stagingEnvironmentPolicy"); - writer.WriteStringValue(StagingEnvironmentPolicy.Value.ToSerialString()); - } - if (Optional.IsDefined(AllowConfigFileUpdates)) - { - writer.WritePropertyName("allowConfigFileUpdates"); - writer.WriteBooleanValue(AllowConfigFileUpdates.Value); - } - if (Optional.IsDefined(TemplateProperties)) - { - writer.WritePropertyName("templateProperties"); - writer.WriteObjectValue(TemplateProperties); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSitePatchResource DeserializeStaticSitePatchResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional defaultHostname = default; - Optional repositoryUrl = default; - Optional branch = default; - Optional> customDomains = default; - Optional repositoryToken = default; - Optional buildProperties = default; - Optional> privateEndpointConnections = default; - Optional stagingEnvironmentPolicy = default; - Optional allowConfigFileUpdates = default; - Optional templateProperties = default; - Optional contentDistributionEndpoint = default; - Optional keyVaultReferenceIdentity = default; - Optional> userProvidedFunctionApps = default; - Optional provider = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("defaultHostname")) - { - defaultHostname = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("repositoryUrl")) - { - repositoryUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("branch")) - { - branch = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("customDomains")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - customDomains = array; - continue; - } - if (property0.NameEquals("repositoryToken")) - { - repositoryToken = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("buildProperties")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - buildProperties = StaticSiteBuildProperties.DeserializeStaticSiteBuildProperties(property0.Value); - continue; - } - if (property0.NameEquals("privateEndpointConnections")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ResponseMessageEnvelopeRemotePrivateEndpointConnection.DeserializeResponseMessageEnvelopeRemotePrivateEndpointConnection(item)); - } - privateEndpointConnections = array; - continue; - } - if (property0.NameEquals("stagingEnvironmentPolicy")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - stagingEnvironmentPolicy = property0.Value.GetString().ToStagingEnvironmentPolicy(); - continue; - } - if (property0.NameEquals("allowConfigFileUpdates")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - allowConfigFileUpdates = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("templateProperties")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - templateProperties = StaticSiteTemplateOptions.DeserializeStaticSiteTemplateOptions(property0.Value); - continue; - } - if (property0.NameEquals("contentDistributionEndpoint")) - { - contentDistributionEndpoint = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("keyVaultReferenceIdentity")) - { - keyVaultReferenceIdentity = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("userProvidedFunctionApps")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(StaticSiteUserProvidedFunctionApp.DeserializeStaticSiteUserProvidedFunctionApp(item)); - } - userProvidedFunctionApps = array; - continue; - } - if (property0.NameEquals("provider")) - { - provider = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new StaticSitePatchResource(id.Value, name.Value, kind.Value, type.Value, defaultHostname.Value, repositoryUrl.Value, branch.Value, Optional.ToList(customDomains), repositoryToken.Value, buildProperties.Value, Optional.ToList(privateEndpointConnections), Optional.ToNullable(stagingEnvironmentPolicy), Optional.ToNullable(allowConfigFileUpdates), templateProperties.Value, contentDistributionEndpoint.Value, keyVaultReferenceIdentity.Value, Optional.ToList(userProvidedFunctionApps), provider.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs index ed3c08001991..a4de50863546 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs @@ -1,46 +1,57 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// ARM resource for a static site when patching. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// ARM resource for a static site when patching + /// + [Rest.Serialization.JsonTransformation] public partial class StaticSitePatchResource : ProxyOnlyResource { - /// Initializes a new instance of StaticSitePatchResource. + /// + /// Initializes a new instance of the StaticSitePatchResource class. + /// public StaticSitePatchResource() { - CustomDomains = new ChangeTrackingList(); - PrivateEndpointConnections = new ChangeTrackingList(); - UserProvidedFunctionApps = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of StaticSitePatchResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The default autogenerated hostname for the static site. - /// URL for the repository of the static site. - /// The target branch in the repository. - /// The custom domains associated with this static site. - /// A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. - /// Build properties to configure on the repository. - /// Private endpoint connections. - /// State indicating whether staging environments are allowed or not allowed for a static web app. - /// <code>false</code> if config file is locked for this static web app; otherwise, <code>true</code>. - /// Template options for generating a new repository. - /// The content distribution endpoint for the static site. - /// Identity to use for Key Vault Reference authentication. - /// User provided function apps registered with the static site. - /// The provider that submitted the last deployment to the primary environment of the static site. - internal StaticSitePatchResource(string id, string name, string kind, string type, string defaultHostname, string repositoryUrl, string branch, IReadOnlyList customDomains, string repositoryToken, StaticSiteBuildProperties buildProperties, IReadOnlyList privateEndpointConnections, StagingEnvironmentPolicy? stagingEnvironmentPolicy, bool? allowConfigFileUpdates, StaticSiteTemplateOptions templateProperties, string contentDistributionEndpoint, string keyVaultReferenceIdentity, IReadOnlyList userProvidedFunctionApps, string provider) : base(id, name, kind, type) + /// + /// Initializes a new instance of the StaticSitePatchResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The default autogenerated hostname + /// for the static site. + /// URL for the repository of the static + /// site. + /// The target branch in the repository. + /// The custom domains associated with this + /// static site. + /// A user's github repository token. + /// This is used to setup the Github Actions workflow file and API + /// secrets. + /// Build properties to configure on the + /// repository. + public StaticSitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties)) + : base(id, name, kind, type) { DefaultHostname = defaultHostname; RepositoryUrl = repositoryUrl; @@ -48,43 +59,50 @@ internal StaticSitePatchResource(string id, string name, string kind, string typ CustomDomains = customDomains; RepositoryToken = repositoryToken; BuildProperties = buildProperties; - PrivateEndpointConnections = privateEndpointConnections; - StagingEnvironmentPolicy = stagingEnvironmentPolicy; - AllowConfigFileUpdates = allowConfigFileUpdates; - TemplateProperties = templateProperties; - ContentDistributionEndpoint = contentDistributionEndpoint; - KeyVaultReferenceIdentity = keyVaultReferenceIdentity; - UserProvidedFunctionApps = userProvidedFunctionApps; - Provider = provider; + CustomInit(); } - /// The default autogenerated hostname for the static site. - public string DefaultHostname { get; } - /// URL for the repository of the static site. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the default autogenerated hostname for the static site. + /// + [JsonProperty(PropertyName = "properties.defaultHostname")] + public string DefaultHostname { get; private set; } + + /// + /// Gets or sets URL for the repository of the static site. + /// + [JsonProperty(PropertyName = "properties.repositoryUrl")] public string RepositoryUrl { get; set; } - /// The target branch in the repository. + + /// + /// Gets or sets the target branch in the repository. + /// + [JsonProperty(PropertyName = "properties.branch")] public string Branch { get; set; } - /// The custom domains associated with this static site. - public IReadOnlyList CustomDomains { get; } - /// A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. + + /// + /// Gets the custom domains associated with this static site. + /// + [JsonProperty(PropertyName = "properties.customDomains")] + public IList CustomDomains { get; private set; } + + /// + /// Gets or sets a user's github repository token. This is used to + /// setup the Github Actions workflow file and API secrets. + /// + [JsonProperty(PropertyName = "properties.repositoryToken")] public string RepositoryToken { get; set; } - /// Build properties to configure on the repository. + + /// + /// Gets or sets build properties to configure on the repository. + /// + [JsonProperty(PropertyName = "properties.buildProperties")] public StaticSiteBuildProperties BuildProperties { get; set; } - /// Private endpoint connections. - public IReadOnlyList PrivateEndpointConnections { get; } - /// State indicating whether staging environments are allowed or not allowed for a static web app. - public StagingEnvironmentPolicy? StagingEnvironmentPolicy { get; set; } - /// <code>false</code> if config file is locked for this static web app; otherwise, <code>true</code>. - public bool? AllowConfigFileUpdates { get; set; } - /// Template options for generating a new repository. - public StaticSiteTemplateOptions TemplateProperties { get; set; } - /// The content distribution endpoint for the static site. - public string ContentDistributionEndpoint { get; } - /// Identity to use for Key Vault Reference authentication. - public string KeyVaultReferenceIdentity { get; } - /// User provided function apps registered with the static site. - public IReadOnlyList UserProvidedFunctionApps { get; } - /// The provider that submitted the last deployment to the primary environment of the static site. - public string Provider { get; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.Serialization.cs deleted file mode 100644 index 33065f48684e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteResetPropertiesARMResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(RepositoryToken)) - { - writer.WritePropertyName("repositoryToken"); - writer.WriteStringValue(RepositoryToken); - } - if (Optional.IsDefined(ShouldUpdateRepository)) - { - writer.WritePropertyName("shouldUpdateRepository"); - writer.WriteBooleanValue(ShouldUpdateRepository.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteResetPropertiesARMResource DeserializeStaticSiteResetPropertiesARMResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional repositoryToken = default; - Optional shouldUpdateRepository = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("repositoryToken")) - { - repositoryToken = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("shouldUpdateRepository")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - shouldUpdateRepository = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new StaticSiteResetPropertiesARMResource(id.Value, name.Value, kind.Value, type.Value, repositoryToken.Value, Optional.ToNullable(shouldUpdateRepository)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.cs index 4c2daac6a921..337b9ceedcbb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteResetPropertiesARMResource.cs @@ -1,36 +1,73 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Static Site Reset Properties ARM resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static Site Reset Properties ARM resource. + /// + [Rest.Serialization.JsonTransformation] public partial class StaticSiteResetPropertiesARMResource : ProxyOnlyResource { - /// Initializes a new instance of StaticSiteResetPropertiesARMResource. + /// + /// Initializes a new instance of the + /// StaticSiteResetPropertiesARMResource class. + /// public StaticSiteResetPropertiesARMResource() { + CustomInit(); } - /// Initializes a new instance of StaticSiteResetPropertiesARMResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The token which proves admin privileges to the repository. - /// Determines whether the repository should be updated with the new properties. - internal StaticSiteResetPropertiesARMResource(string id, string name, string kind, string type, string repositoryToken, bool? shouldUpdateRepository) : base(id, name, kind, type) + /// + /// Initializes a new instance of the + /// StaticSiteResetPropertiesARMResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The token which proves admin + /// privileges to the repository. + /// Determines whether the + /// repository should be updated with the new properties. + public StaticSiteResetPropertiesARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repositoryToken = default(string), bool? shouldUpdateRepository = default(bool?)) + : base(id, name, kind, type) { RepositoryToken = repositoryToken; ShouldUpdateRepository = shouldUpdateRepository; + CustomInit(); } - /// The token which proves admin privileges to the repository. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the token which proves admin privileges to the + /// repository. + /// + [JsonProperty(PropertyName = "properties.repositoryToken")] public string RepositoryToken { get; set; } - /// Determines whether the repository should be updated with the new properties. + + /// + /// Gets or sets determines whether the repository should be updated + /// with the new properties. + /// + [JsonProperty(PropertyName = "properties.shouldUpdateRepository")] public bool? ShouldUpdateRepository { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.Serialization.cs deleted file mode 100644 index 34b2733cb303..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.Serialization.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteTemplateOptions : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(TemplateRepositoryUrl)) - { - writer.WritePropertyName("templateRepositoryUrl"); - writer.WriteStringValue(TemplateRepositoryUrl); - } - if (Optional.IsDefined(Owner)) - { - writer.WritePropertyName("owner"); - writer.WriteStringValue(Owner); - } - if (Optional.IsDefined(RepositoryName)) - { - writer.WritePropertyName("repositoryName"); - writer.WriteStringValue(RepositoryName); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(IsPrivate)) - { - writer.WritePropertyName("isPrivate"); - writer.WriteBooleanValue(IsPrivate.Value); - } - writer.WriteEndObject(); - } - - internal static StaticSiteTemplateOptions DeserializeStaticSiteTemplateOptions(JsonElement element) - { - Optional templateRepositoryUrl = default; - Optional owner = default; - Optional repositoryName = default; - Optional description = default; - Optional isPrivate = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("templateRepositoryUrl")) - { - templateRepositoryUrl = property.Value.GetString(); - continue; - } - if (property.NameEquals("owner")) - { - owner = property.Value.GetString(); - continue; - } - if (property.NameEquals("repositoryName")) - { - repositoryName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description")) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isPrivate")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isPrivate = property.Value.GetBoolean(); - continue; - } - } - return new StaticSiteTemplateOptions(templateRepositoryUrl.Value, owner.Value, repositoryName.Value, description.Value, Optional.ToNullable(isPrivate)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs deleted file mode 100644 index 5d3fef51cbe3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Template Options for the static site. - public partial class StaticSiteTemplateOptions - { - /// Initializes a new instance of StaticSiteTemplateOptions. - public StaticSiteTemplateOptions() - { - } - - /// Initializes a new instance of StaticSiteTemplateOptions. - /// URL of the template repository. The newly generated repository will be based on this one. - /// Owner of the newly generated repository. - /// Name of the newly generated repository. - /// Description of the newly generated repository. - /// Whether or not the newly generated repository is a private repository. Defaults to false (i.e. public). - internal StaticSiteTemplateOptions(string templateRepositoryUrl, string owner, string repositoryName, string description, bool? isPrivate) - { - TemplateRepositoryUrl = templateRepositoryUrl; - Owner = owner; - RepositoryName = repositoryName; - Description = description; - IsPrivate = isPrivate; - } - - /// URL of the template repository. The newly generated repository will be based on this one. - public string TemplateRepositoryUrl { get; set; } - /// Owner of the newly generated repository. - public string Owner { get; set; } - /// Name of the newly generated repository. - public string RepositoryName { get; set; } - /// Description of the newly generated repository. - public string Description { get; set; } - /// Whether or not the newly generated repository is a private repository. Defaults to false (i.e. public). - public bool? IsPrivate { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.Serialization.cs deleted file mode 100644 index b5b82e3694a6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.Serialization.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteUserARMResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Roles)) - { - writer.WritePropertyName("roles"); - writer.WriteStringValue(Roles); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteUserARMResource DeserializeStaticSiteUserARMResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional provider = default; - Optional userId = default; - Optional displayName = default; - Optional roles = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provider")) - { - provider = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("userId")) - { - userId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("displayName")) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("roles")) - { - roles = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new StaticSiteUserARMResource(id.Value, name.Value, kind.Value, type.Value, provider.Value, userId.Value, displayName.Value, roles.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.cs index aa5d2712746a..4999de01981e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserARMResource.cs @@ -1,44 +1,87 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Static Site User ARM resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static Site User ARM resource. + /// + [Rest.Serialization.JsonTransformation] public partial class StaticSiteUserARMResource : ProxyOnlyResource { - /// Initializes a new instance of StaticSiteUserARMResource. + /// + /// Initializes a new instance of the StaticSiteUserARMResource class. + /// public StaticSiteUserARMResource() { + CustomInit(); } - /// Initializes a new instance of StaticSiteUserARMResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The identity provider for the static site user. - /// The user id for the static site user. - /// The display name for the static site user. - /// The roles for the static site user, in free-form string format. - internal StaticSiteUserARMResource(string id, string name, string kind, string type, string provider, string userId, string displayName, string roles) : base(id, name, kind, type) + /// + /// Initializes a new instance of the StaticSiteUserARMResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The identity provider for the static site + /// user. + /// The user id for the static site user. + /// The display name for the static site + /// user. + /// The roles for the static site user, in + /// free-form string format + public StaticSiteUserARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string provider = default(string), string userId = default(string), string displayName = default(string), string roles = default(string)) + : base(id, name, kind, type) { Provider = provider; UserId = userId; DisplayName = displayName; Roles = roles; + CustomInit(); } - /// The identity provider for the static site user. - public string Provider { get; } - /// The user id for the static site user. - public string UserId { get; } - /// The display name for the static site user. - public string DisplayName { get; } - /// The roles for the static site user, in free-form string format. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the identity provider for the static site user. + /// + [JsonProperty(PropertyName = "properties.provider")] + public string Provider { get; private set; } + + /// + /// Gets the user id for the static site user. + /// + [JsonProperty(PropertyName = "properties.userId")] + public string UserId { get; private set; } + + /// + /// Gets the display name for the static site user. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets or sets the roles for the static site user, in free-form + /// string format + /// + [JsonProperty(PropertyName = "properties.roles")] public string Roles { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.Serialization.cs deleted file mode 100644 index 3624fc23d416..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class StaticSiteUserCollection - { - internal static StaticSiteUserCollection DeserializeStaticSiteUserCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(StaticSiteUserARMResource.DeserializeStaticSiteUserARMResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new StaticSiteUserCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.cs deleted file mode 100644 index f59cf0057fb1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of static site custom users. - internal partial class StaticSiteUserCollection - { - /// Initializes a new instance of StaticSiteUserCollection. - /// Collection of resources. - /// is null. - internal StaticSiteUserCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of StaticSiteUserCollection. - /// Collection of resources. - /// Link to next page of resources. - internal StaticSiteUserCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.Serialization.cs deleted file mode 100644 index 2a3f352db0da..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.Serialization.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteUserInvitationRequestResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Domain)) - { - writer.WritePropertyName("domain"); - writer.WriteStringValue(Domain); - } - if (Optional.IsDefined(Provider)) - { - writer.WritePropertyName("provider"); - writer.WriteStringValue(Provider); - } - if (Optional.IsDefined(UserDetails)) - { - writer.WritePropertyName("userDetails"); - writer.WriteStringValue(UserDetails); - } - if (Optional.IsDefined(Roles)) - { - writer.WritePropertyName("roles"); - writer.WriteStringValue(Roles); - } - if (Optional.IsDefined(NumHoursToExpiration)) - { - writer.WritePropertyName("numHoursToExpiration"); - writer.WriteNumberValue(NumHoursToExpiration.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteUserInvitationRequestResource DeserializeStaticSiteUserInvitationRequestResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional domain = default; - Optional provider = default; - Optional userDetails = default; - Optional roles = default; - Optional numHoursToExpiration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("domain")) - { - domain = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("provider")) - { - provider = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("userDetails")) - { - userDetails = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("roles")) - { - roles = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("numHoursToExpiration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - numHoursToExpiration = property0.Value.GetInt32(); - continue; - } - } - continue; - } - } - return new StaticSiteUserInvitationRequestResource(id.Value, name.Value, kind.Value, type.Value, domain.Value, provider.Value, userDetails.Value, roles.Value, Optional.ToNullable(numHoursToExpiration)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.cs index 12c8d0ca5cb9..1d33056a11c8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationRequestResource.cs @@ -1,48 +1,99 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Static sites user roles invitation resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static sites user roles invitation resource. + /// + [Rest.Serialization.JsonTransformation] public partial class StaticSiteUserInvitationRequestResource : ProxyOnlyResource { - /// Initializes a new instance of StaticSiteUserInvitationRequestResource. + /// + /// Initializes a new instance of the + /// StaticSiteUserInvitationRequestResource class. + /// public StaticSiteUserInvitationRequestResource() { + CustomInit(); } - /// Initializes a new instance of StaticSiteUserInvitationRequestResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The domain name for the static site custom domain. - /// The identity provider for the static site user. - /// The user id for the static site user. - /// The roles for the static site user, in free-form string format. - /// The number of hours the sas token stays valid. - internal StaticSiteUserInvitationRequestResource(string id, string name, string kind, string type, string domain, string provider, string userDetails, string roles, int? numHoursToExpiration) : base(id, name, kind, type) + /// + /// Initializes a new instance of the + /// StaticSiteUserInvitationRequestResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The domain name for the static site custom + /// domain. + /// The identity provider for the static site + /// user. + /// The user id for the static site + /// user. + /// The roles for the static site user, in + /// free-form string format + /// The number of hours the sas + /// token stays valid + public StaticSiteUserInvitationRequestResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string domain = default(string), string provider = default(string), string userDetails = default(string), string roles = default(string), int? numHoursToExpiration = default(int?)) + : base(id, name, kind, type) { Domain = domain; Provider = provider; UserDetails = userDetails; Roles = roles; NumHoursToExpiration = numHoursToExpiration; + CustomInit(); } - /// The domain name for the static site custom domain. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the domain name for the static site custom domain. + /// + [JsonProperty(PropertyName = "properties.domain")] public string Domain { get; set; } - /// The identity provider for the static site user. + + /// + /// Gets or sets the identity provider for the static site user. + /// + [JsonProperty(PropertyName = "properties.provider")] public string Provider { get; set; } - /// The user id for the static site user. + + /// + /// Gets or sets the user id for the static site user. + /// + [JsonProperty(PropertyName = "properties.userDetails")] public string UserDetails { get; set; } - /// The roles for the static site user, in free-form string format. + + /// + /// Gets or sets the roles for the static site user, in free-form + /// string format + /// + [JsonProperty(PropertyName = "properties.roles")] public string Roles { get; set; } - /// The number of hours the sas token stays valid. + + /// + /// Gets or sets the number of hours the sas token stays valid + /// + [JsonProperty(PropertyName = "properties.numHoursToExpiration")] public int? NumHoursToExpiration { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.Serialization.cs deleted file mode 100644 index a55a5542a015..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.Serialization.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteUserInvitationResponseResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteUserInvitationResponseResource DeserializeStaticSiteUserInvitationResponseResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional expiresOn = default; - Optional invitationUrl = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("expiresOn")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - expiresOn = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("invitationUrl")) - { - invitationUrl = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new StaticSiteUserInvitationResponseResource(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(expiresOn), invitationUrl.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.cs index e5d98d822eae..dfd32c63e2ce 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserInvitationResponseResource.cs @@ -1,38 +1,70 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Static sites user roles invitation link resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static sites user roles invitation link resource. + /// + [Rest.Serialization.JsonTransformation] public partial class StaticSiteUserInvitationResponseResource : ProxyOnlyResource { - /// Initializes a new instance of StaticSiteUserInvitationResponseResource. + /// + /// Initializes a new instance of the + /// StaticSiteUserInvitationResponseResource class. + /// public StaticSiteUserInvitationResponseResource() { + CustomInit(); } - /// Initializes a new instance of StaticSiteUserInvitationResponseResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The expiration time of the invitation. - /// The url for the invitation link. - internal StaticSiteUserInvitationResponseResource(string id, string name, string kind, string type, DateTimeOffset? expiresOn, string invitationUrl) : base(id, name, kind, type) + /// + /// Initializes a new instance of the + /// StaticSiteUserInvitationResponseResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The expiration time of the + /// invitation + /// The url for the invitation link + public StaticSiteUserInvitationResponseResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), System.DateTime? expiresOn = default(System.DateTime?), string invitationUrl = default(string)) + : base(id, name, kind, type) { ExpiresOn = expiresOn; InvitationUrl = invitationUrl; + CustomInit(); } - /// The expiration time of the invitation. - public DateTimeOffset? ExpiresOn { get; } - /// The url for the invitation link. - public string InvitationUrl { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the expiration time of the invitation + /// + [JsonProperty(PropertyName = "properties.expiresOn")] + public System.DateTime? ExpiresOn { get; private set; } + + /// + /// Gets the url for the invitation link + /// + [JsonProperty(PropertyName = "properties.invitationUrl")] + public string InvitationUrl { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.Serialization.cs deleted file mode 100644 index 921baeabce49..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.Serialization.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteUserProvidedFunctionApp : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(FunctionAppResourceId)) - { - writer.WritePropertyName("functionAppResourceId"); - writer.WriteStringValue(FunctionAppResourceId); - } - if (Optional.IsDefined(FunctionAppRegion)) - { - writer.WritePropertyName("functionAppRegion"); - writer.WriteStringValue(FunctionAppRegion); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteUserProvidedFunctionApp DeserializeStaticSiteUserProvidedFunctionApp(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional functionAppResourceId = default; - Optional functionAppRegion = default; - Optional createdOn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("functionAppResourceId")) - { - functionAppResourceId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("functionAppRegion")) - { - functionAppRegion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("createdOn")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - createdOn = property0.Value.GetDateTimeOffset("O"); - continue; - } - } - continue; - } - } - return new StaticSiteUserProvidedFunctionApp(id.Value, name.Value, kind.Value, type.Value, functionAppResourceId.Value, functionAppRegion.Value, Optional.ToNullable(createdOn)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs deleted file mode 100644 index 2076860ef54a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// A static site user provided function. - public partial class StaticSiteUserProvidedFunctionApp : ProxyOnlyResource - { - /// Initializes a new instance of StaticSiteUserProvidedFunctionApp. - public StaticSiteUserProvidedFunctionApp() - { - } - - /// Initializes a new instance of StaticSiteUserProvidedFunctionApp. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The resource id of the function app registered with the static site. - /// The region of the function app registered with the static site. - /// The date and time on which the function app was registered with the static site. - internal StaticSiteUserProvidedFunctionApp(string id, string name, string kind, string type, string functionAppResourceId, string functionAppRegion, DateTimeOffset? createdOn) : base(id, name, kind, type) - { - FunctionAppResourceId = functionAppResourceId; - FunctionAppRegion = functionAppRegion; - CreatedOn = createdOn; - } - - /// The resource id of the function app registered with the static site. - public string FunctionAppResourceId { get; set; } - /// The region of the function app registered with the static site. - public string FunctionAppRegion { get; set; } - /// The date and time on which the function app was registered with the static site. - public DateTimeOffset? CreatedOn { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.Serialization.cs deleted file mode 100644 index 97c5950fa37e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.Serialization.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteUserProvidedFunctionAppARMResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(FunctionAppResourceId)) - { - writer.WritePropertyName("functionAppResourceId"); - writer.WriteStringValue(FunctionAppResourceId); - } - if (Optional.IsDefined(FunctionAppRegion)) - { - writer.WritePropertyName("functionAppRegion"); - writer.WriteStringValue(FunctionAppRegion); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteUserProvidedFunctionAppARMResource DeserializeStaticSiteUserProvidedFunctionAppARMResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional functionAppResourceId = default; - Optional functionAppRegion = default; - Optional createdOn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("functionAppResourceId")) - { - functionAppResourceId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("functionAppRegion")) - { - functionAppRegion = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("createdOn")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - createdOn = property0.Value.GetDateTimeOffset("O"); - continue; - } - } - continue; - } - } - return new StaticSiteUserProvidedFunctionAppARMResource(id.Value, name.Value, kind.Value, type.Value, functionAppResourceId.Value, functionAppRegion.Value, Optional.ToNullable(createdOn)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs deleted file mode 100644 index 26cc516d9ee8..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Static Site User Provided Function App ARM resource. - public partial class StaticSiteUserProvidedFunctionAppARMResource : ProxyOnlyResource - { - /// Initializes a new instance of StaticSiteUserProvidedFunctionAppARMResource. - public StaticSiteUserProvidedFunctionAppARMResource() - { - } - - /// Initializes a new instance of StaticSiteUserProvidedFunctionAppARMResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The resource id of the function app registered with the static site. - /// The region of the function app registered with the static site. - /// The date and time on which the function app was registered with the static site. - internal StaticSiteUserProvidedFunctionAppARMResource(string id, string name, string kind, string type, string functionAppResourceId, string functionAppRegion, DateTimeOffset? createdOn) : base(id, name, kind, type) - { - FunctionAppResourceId = functionAppResourceId; - FunctionAppRegion = functionAppRegion; - CreatedOn = createdOn; - } - - /// The resource id of the function app registered with the static site. - public string FunctionAppResourceId { get; set; } - /// The region of the function app registered with the static site. - public string FunctionAppRegion { get; set; } - /// The date and time on which the function app was registered with the static site. - public DateTimeOffset? CreatedOn { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.Serialization.cs deleted file mode 100644 index 70aaf95f38c5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class StaticSiteUserProvidedFunctionAppsCollection - { - internal static StaticSiteUserProvidedFunctionAppsCollection DeserializeStaticSiteUserProvidedFunctionAppsCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(StaticSiteUserProvidedFunctionAppARMResource.DeserializeStaticSiteUserProvidedFunctionAppARMResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new StaticSiteUserProvidedFunctionAppsCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.cs deleted file mode 100644 index 02eb549f178d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppsCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of static site user provided function apps. - internal partial class StaticSiteUserProvidedFunctionAppsCollection - { - /// Initializes a new instance of StaticSiteUserProvidedFunctionAppsCollection. - /// Collection of resources. - /// is null. - internal StaticSiteUserProvidedFunctionAppsCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of StaticSiteUserProvidedFunctionAppsCollection. - /// Collection of resources. - /// Link to next page of resources. - internal StaticSiteUserProvidedFunctionAppsCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.Serialization.cs deleted file mode 100644 index 95008b3cdd7b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.Serialization.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSiteZipDeploymentARMResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(AppZipUrl)) - { - writer.WritePropertyName("appZipUrl"); - writer.WriteStringValue(AppZipUrl); - } - if (Optional.IsDefined(ApiZipUrl)) - { - writer.WritePropertyName("apiZipUrl"); - writer.WriteStringValue(ApiZipUrl); - } - if (Optional.IsDefined(DeploymentTitle)) - { - writer.WritePropertyName("deploymentTitle"); - writer.WriteStringValue(DeploymentTitle); - } - if (Optional.IsDefined(Provider)) - { - writer.WritePropertyName("provider"); - writer.WriteStringValue(Provider); - } - if (Optional.IsDefined(FunctionLanguage)) - { - writer.WritePropertyName("functionLanguage"); - writer.WriteStringValue(FunctionLanguage); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSiteZipDeploymentARMResource DeserializeStaticSiteZipDeploymentARMResource(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional appZipUrl = default; - Optional apiZipUrl = default; - Optional deploymentTitle = default; - Optional provider = default; - Optional functionLanguage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("appZipUrl")) - { - appZipUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("apiZipUrl")) - { - apiZipUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("deploymentTitle")) - { - deploymentTitle = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("provider")) - { - provider = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("functionLanguage")) - { - functionLanguage = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new StaticSiteZipDeploymentARMResource(id.Value, name.Value, kind.Value, type.Value, appZipUrl.Value, apiZipUrl.Value, deploymentTitle.Value, provider.Value, functionLanguage.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs deleted file mode 100644 index f5d27cb64938..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Static site zip deployment ARM resource. - public partial class StaticSiteZipDeploymentARMResource : ProxyOnlyResource - { - /// Initializes a new instance of StaticSiteZipDeploymentARMResource. - public StaticSiteZipDeploymentARMResource() - { - } - - /// Initializes a new instance of StaticSiteZipDeploymentARMResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// URL for the zipped app content. - /// URL for the zipped api content. - /// A title to label the deployment. - /// The provider submitting this deployment. - /// The language of the api content, if it exists. - internal StaticSiteZipDeploymentARMResource(string id, string name, string kind, string type, string appZipUrl, string apiZipUrl, string deploymentTitle, string provider, string functionLanguage) : base(id, name, kind, type) - { - AppZipUrl = appZipUrl; - ApiZipUrl = apiZipUrl; - DeploymentTitle = deploymentTitle; - Provider = provider; - FunctionLanguage = functionLanguage; - } - - /// URL for the zipped app content. - public string AppZipUrl { get; set; } - /// URL for the zipped api content. - public string ApiZipUrl { get; set; } - /// A title to label the deployment. - public string DeploymentTitle { get; set; } - /// The provider submitting this deployment. - public string Provider { get; set; } - /// The language of the api content, if it exists. - public string FunctionLanguage { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.Serialization.cs deleted file mode 100644 index 744d281102ca..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.Serialization.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSitesWorkflowPreview : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSitesWorkflowPreview DeserializeStaticSitesWorkflowPreview(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional path = default; - Optional contents = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("path")) - { - path = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("contents")) - { - contents = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new StaticSitesWorkflowPreview(id.Value, name.Value, kind.Value, type.Value, path.Value, contents.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs deleted file mode 100644 index 95415e4e85ee..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Preview for the Static Site Workflow to be generated. - public partial class StaticSitesWorkflowPreview : ProxyOnlyResource - { - /// Initializes a new instance of StaticSitesWorkflowPreview. - public StaticSitesWorkflowPreview() - { - } - - /// Initializes a new instance of StaticSitesWorkflowPreview. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The path for the workflow file to be generated. - /// The contents for the workflow file to be generated. - internal StaticSitesWorkflowPreview(string id, string name, string kind, string type, string path, string contents) : base(id, name, kind, type) - { - Path = path; - Contents = contents; - } - - /// The path for the workflow file to be generated. - public string Path { get; } - /// The contents for the workflow file to be generated. - public string Contents { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.Serialization.cs deleted file mode 100644 index fcbf28a17151..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StaticSitesWorkflowPreviewRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(RepositoryUrl)) - { - writer.WritePropertyName("repositoryUrl"); - writer.WriteStringValue(RepositoryUrl); - } - if (Optional.IsDefined(Branch)) - { - writer.WritePropertyName("branch"); - writer.WriteStringValue(Branch); - } - if (Optional.IsDefined(BuildProperties)) - { - writer.WritePropertyName("buildProperties"); - writer.WriteObjectValue(BuildProperties); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StaticSitesWorkflowPreviewRequest DeserializeStaticSitesWorkflowPreviewRequest(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional repositoryUrl = default; - Optional branch = default; - Optional buildProperties = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("repositoryUrl")) - { - repositoryUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("branch")) - { - branch = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("buildProperties")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - buildProperties = StaticSiteBuildProperties.DeserializeStaticSiteBuildProperties(property0.Value); - continue; - } - } - continue; - } - } - return new StaticSitesWorkflowPreviewRequest(id.Value, name.Value, kind.Value, type.Value, repositoryUrl.Value, branch.Value, buildProperties.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs deleted file mode 100644 index fe3f3371fa0b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Request entity for previewing the Static Site workflow. - public partial class StaticSitesWorkflowPreviewRequest : ProxyOnlyResource - { - /// Initializes a new instance of StaticSitesWorkflowPreviewRequest. - public StaticSitesWorkflowPreviewRequest() - { - } - - /// Initializes a new instance of StaticSitesWorkflowPreviewRequest. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// URL for the repository of the static site. - /// The target branch in the repository. - /// Build properties to configure on the repository. - internal StaticSitesWorkflowPreviewRequest(string id, string name, string kind, string type, string repositoryUrl, string branch, StaticSiteBuildProperties buildProperties) : base(id, name, kind, type) - { - RepositoryUrl = repositoryUrl; - Branch = branch; - BuildProperties = buildProperties; - } - - /// URL for the repository of the static site. - public string RepositoryUrl { get; set; } - /// The target branch in the repository. - public string Branch { get; set; } - /// Build properties to configure on the repository. - public StaticSiteBuildProperties BuildProperties { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.Serialization.cs deleted file mode 100644 index 9197782b8c93..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.Serialization.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Status : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"); - writer.WriteStringValue(Message); - } - if (Optional.IsDefined(StatusId)) - { - writer.WritePropertyName("statusId"); - writer.WriteStringValue(StatusId.Value.ToSerialString()); - } - writer.WriteEndObject(); - } - - internal static Status DeserializeStatus(JsonElement element) - { - Optional message = default; - Optional statusId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("message")) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("statusId")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - statusId = property.Value.GetString().ToInsightStatus(); - continue; - } - } - return new Status(message.Value, Optional.ToNullable(statusId)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs deleted file mode 100644 index fb86a3551c8f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Identify the status of the most severe insight generated by the detector. - public partial class Status - { - /// Initializes a new instance of Status. - public Status() - { - } - - /// Initializes a new instance of Status. - /// Descriptive message. - /// Level of the most severe insight generated by the detector. - internal Status(string message, InsightStatus? statusId) - { - Message = message; - StatusId = statusId; - } - - /// Descriptive message. - public string Message { get; set; } - /// Level of the most severe insight generated by the detector. - public InsightStatus? StatusId { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.Serialization.cs deleted file mode 100644 index 82bc2551eb10..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.Serialization.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StatusCodesBasedTrigger : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"); - writer.WriteNumberValue(Status.Value); - } - if (Optional.IsDefined(SubStatus)) - { - writer.WritePropertyName("subStatus"); - writer.WriteNumberValue(SubStatus.Value); - } - if (Optional.IsDefined(Win32Status)) - { - writer.WritePropertyName("win32Status"); - writer.WriteNumberValue(Win32Status.Value); - } - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(TimeInterval)) - { - writer.WritePropertyName("timeInterval"); - writer.WriteStringValue(TimeInterval); - } - if (Optional.IsDefined(Path)) - { - writer.WritePropertyName("path"); - writer.WriteStringValue(Path); - } - writer.WriteEndObject(); - } - - internal static StatusCodesBasedTrigger DeserializeStatusCodesBasedTrigger(JsonElement element) - { - Optional status = default; - Optional subStatus = default; - Optional win32Status = default; - Optional count = default; - Optional timeInterval = default; - Optional path = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("status")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("subStatus")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - subStatus = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("win32Status")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - win32Status = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("count")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - count = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("timeInterval")) - { - timeInterval = property.Value.GetString(); - continue; - } - if (property.NameEquals("path")) - { - path = property.Value.GetString(); - continue; - } - } - return new StatusCodesBasedTrigger(Optional.ToNullable(status), Optional.ToNullable(subStatus), Optional.ToNullable(win32Status), Optional.ToNullable(count), timeInterval.Value, path.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs index 88827a442542..f5a0016591e9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs @@ -1,48 +1,83 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Trigger based on status code. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Trigger based on status code. + /// public partial class StatusCodesBasedTrigger { - /// Initializes a new instance of StatusCodesBasedTrigger. + /// + /// Initializes a new instance of the StatusCodesBasedTrigger class. + /// public StatusCodesBasedTrigger() { + CustomInit(); } - /// Initializes a new instance of StatusCodesBasedTrigger. - /// HTTP status code. - /// Request Sub Status. - /// Win32 error code. - /// Request Count. - /// Time interval. - /// Request Path. - internal StatusCodesBasedTrigger(int? status, int? subStatus, int? win32Status, int? count, string timeInterval, string path) + /// + /// Initializes a new instance of the StatusCodesBasedTrigger class. + /// + /// HTTP status code. + /// Request Sub Status. + /// Win32 error code. + /// Request Count. + /// Time interval. + public StatusCodesBasedTrigger(int? status = default(int?), int? subStatus = default(int?), int? win32Status = default(int?), int? count = default(int?), string timeInterval = default(string)) { Status = status; SubStatus = subStatus; Win32Status = win32Status; Count = count; TimeInterval = timeInterval; - Path = path; + CustomInit(); } - /// HTTP status code. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets HTTP status code. + /// + [JsonProperty(PropertyName = "status")] public int? Status { get; set; } - /// Request Sub Status. + + /// + /// Gets or sets request Sub Status. + /// + [JsonProperty(PropertyName = "subStatus")] public int? SubStatus { get; set; } - /// Win32 error code. + + /// + /// Gets or sets win32 error code. + /// + [JsonProperty(PropertyName = "win32Status")] public int? Win32Status { get; set; } - /// Request Count. + + /// + /// Gets or sets request Count. + /// + [JsonProperty(PropertyName = "count")] public int? Count { get; set; } - /// Time interval. + + /// + /// Gets or sets time interval. + /// + [JsonProperty(PropertyName = "timeInterval")] public string TimeInterval { get; set; } - /// Request Path. - public string Path { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.Serialization.cs deleted file mode 100644 index e8ad71b1c171..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.Serialization.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StatusCodesRangeBasedTrigger : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(StatusCodes)) - { - writer.WritePropertyName("statusCodes"); - writer.WriteStringValue(StatusCodes); - } - if (Optional.IsDefined(Path)) - { - writer.WritePropertyName("path"); - writer.WriteStringValue(Path); - } - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(TimeInterval)) - { - writer.WritePropertyName("timeInterval"); - writer.WriteStringValue(TimeInterval); - } - writer.WriteEndObject(); - } - - internal static StatusCodesRangeBasedTrigger DeserializeStatusCodesRangeBasedTrigger(JsonElement element) - { - Optional statusCodes = default; - Optional path = default; - Optional count = default; - Optional timeInterval = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("statusCodes")) - { - statusCodes = property.Value.GetString(); - continue; - } - if (property.NameEquals("path")) - { - path = property.Value.GetString(); - continue; - } - if (property.NameEquals("count")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - count = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("timeInterval")) - { - timeInterval = property.Value.GetString(); - continue; - } - } - return new StatusCodesRangeBasedTrigger(statusCodes.Value, path.Value, Optional.ToNullable(count), timeInterval.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs deleted file mode 100644 index 414f94a7e25e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Trigger based on range of status codes. - public partial class StatusCodesRangeBasedTrigger - { - /// Initializes a new instance of StatusCodesRangeBasedTrigger. - public StatusCodesRangeBasedTrigger() - { - } - - /// Initializes a new instance of StatusCodesRangeBasedTrigger. - /// HTTP status code. - /// . - /// Request Count. - /// Time interval. - internal StatusCodesRangeBasedTrigger(string statusCodes, string path, int? count, string timeInterval) - { - StatusCodes = statusCodes; - Path = path; - Count = count; - TimeInterval = timeInterval; - } - - /// HTTP status code. - public string StatusCodes { get; set; } - public string Path { get; set; } - /// Request Count. - public int? Count { get; set; } - /// Time interval. - public string TimeInterval { get; set; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.Serialization.cs deleted file mode 100644 index 10cd881303a9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class StatusOptionsExtensions - { - public static string ToSerialString(this StatusOptions value) => value switch - { - StatusOptions.Ready => "Ready", - StatusOptions.Pending => "Pending", - StatusOptions.Creating => "Creating", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StatusOptions value.") - }; - - public static StatusOptions ToStatusOptions(this string value) - { - if (string.Equals(value, "Ready", StringComparison.InvariantCultureIgnoreCase)) return StatusOptions.Ready; - if (string.Equals(value, "Pending", StringComparison.InvariantCultureIgnoreCase)) return StatusOptions.Pending; - if (string.Equals(value, "Creating", StringComparison.InvariantCultureIgnoreCase)) return StatusOptions.Creating; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StatusOptions value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.cs index 9cadcf73d7e3..979f68191d86 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusOptions.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// App Service plan status. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for StatusOptions. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum StatusOptions { - /// Ready. + [EnumMember(Value = "Ready")] Ready, - /// Pending. + [EnumMember(Value = "Pending")] Pending, - /// Creating. + [EnumMember(Value = "Creating")] Creating } + internal static class StatusOptionsEnumExtension + { + internal static string ToSerializedValue(this StatusOptions? value) + { + return value == null ? null : ((StatusOptions)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this StatusOptions value) + { + switch( value ) + { + case StatusOptions.Ready: + return "Ready"; + case StatusOptions.Pending: + return "Pending"; + case StatusOptions.Creating: + return "Creating"; + } + return null; + } + + internal static StatusOptions? ParseStatusOptions(this string value) + { + switch( value ) + { + case "Ready": + return StatusOptions.Ready; + case "Pending": + return StatusOptions.Pending; + case "Creating": + return StatusOptions.Creating; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.Serialization.cs deleted file mode 100644 index 8a347a382339..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StorageMigrationOptions : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(AzurefilesConnectionString)) - { - writer.WritePropertyName("azurefilesConnectionString"); - writer.WriteStringValue(AzurefilesConnectionString); - } - if (Optional.IsDefined(AzurefilesShare)) - { - writer.WritePropertyName("azurefilesShare"); - writer.WriteStringValue(AzurefilesShare); - } - if (Optional.IsDefined(SwitchSiteAfterMigration)) - { - writer.WritePropertyName("switchSiteAfterMigration"); - writer.WriteBooleanValue(SwitchSiteAfterMigration.Value); - } - if (Optional.IsDefined(BlockWriteAccessToSite)) - { - writer.WritePropertyName("blockWriteAccessToSite"); - writer.WriteBooleanValue(BlockWriteAccessToSite.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StorageMigrationOptions DeserializeStorageMigrationOptions(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional azurefilesConnectionString = default; - Optional azurefilesShare = default; - Optional switchSiteAfterMigration = default; - Optional blockWriteAccessToSite = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("azurefilesConnectionString")) - { - azurefilesConnectionString = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("azurefilesShare")) - { - azurefilesShare = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("switchSiteAfterMigration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - switchSiteAfterMigration = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("blockWriteAccessToSite")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - blockWriteAccessToSite = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new StorageMigrationOptions(id.Value, name.Value, kind.Value, type.Value, azurefilesConnectionString.Value, azurefilesShare.Value, Optional.ToNullable(switchSiteAfterMigration), Optional.ToNullable(blockWriteAccessToSite)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.cs index 0cfe6ff29093..7b046b435230 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationOptions.cs @@ -1,44 +1,110 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Options for app content migration. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Options for app content migration. + /// + [Rest.Serialization.JsonTransformation] public partial class StorageMigrationOptions : ProxyOnlyResource { - /// Initializes a new instance of StorageMigrationOptions. + /// + /// Initializes a new instance of the StorageMigrationOptions class. + /// public StorageMigrationOptions() { + CustomInit(); } - /// Initializes a new instance of StorageMigrationOptions. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// AzureFiles connection string. - /// AzureFiles share. - /// <code>true</code>if the app should be switched over; otherwise, <code>false</code>. - /// <code>true</code> if the app should be read only during copy operation; otherwise, <code>false</code>. - internal StorageMigrationOptions(string id, string name, string kind, string type, string azurefilesConnectionString, string azurefilesShare, bool? switchSiteAfterMigration, bool? blockWriteAccessToSite) : base(id, name, kind, type) + /// + /// Initializes a new instance of the StorageMigrationOptions class. + /// + /// AzureFiles connection + /// string. + /// AzureFiles share. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>true</code>if the + /// app should be switched over; otherwise, + /// <code>false</code>. + /// <code>true</code> + /// if the app should be read only during copy operation; otherwise, + /// <code>false</code>. + public StorageMigrationOptions(string azurefilesConnectionString, string azurefilesShare, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? switchSiteAfterMigration = default(bool?), bool? blockWriteAccessToSite = default(bool?)) + : base(id, name, kind, type) { AzurefilesConnectionString = azurefilesConnectionString; AzurefilesShare = azurefilesShare; SwitchSiteAfterMigration = switchSiteAfterMigration; BlockWriteAccessToSite = blockWriteAccessToSite; + CustomInit(); } - /// AzureFiles connection string. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets azureFiles connection string. + /// + [JsonProperty(PropertyName = "properties.azurefilesConnectionString")] public string AzurefilesConnectionString { get; set; } - /// AzureFiles share. + + /// + /// Gets or sets azureFiles share. + /// + [JsonProperty(PropertyName = "properties.azurefilesShare")] public string AzurefilesShare { get; set; } - /// <code>true</code>if the app should be switched over; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt;if the + /// app should be switched over; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.switchSiteAfterMigration")] public bool? SwitchSiteAfterMigration { get; set; } - /// <code>true</code> if the app should be read only during copy operation; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// app should be read only during copy operation; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.blockWriteAccessToSite")] public bool? BlockWriteAccessToSite { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AzurefilesConnectionString == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AzurefilesConnectionString"); + } + if (AzurefilesShare == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AzurefilesShare"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.Serialization.cs deleted file mode 100644 index 8aa6f6787d24..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.Serialization.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StorageMigrationResponse : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static StorageMigrationResponse DeserializeStorageMigrationResponse(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional operationId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("operationId")) - { - operationId = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new StorageMigrationResponse(id.Value, name.Value, kind.Value, type.Value, operationId.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.cs index 26b1df78e880..e40f907ac262 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StorageMigrationResponse.cs @@ -1,32 +1,62 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Response for a migration of app content request. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Response for a migration of app content request. + /// + [Rest.Serialization.JsonTransformation] public partial class StorageMigrationResponse : ProxyOnlyResource { - /// Initializes a new instance of StorageMigrationResponse. + /// + /// Initializes a new instance of the StorageMigrationResponse class. + /// public StorageMigrationResponse() { + CustomInit(); } - /// Initializes a new instance of StorageMigrationResponse. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// When server starts the migration process, it will return an operation ID identifying that particular migration operation. - internal StorageMigrationResponse(string id, string name, string kind, string type, string operationId) : base(id, name, kind, type) + /// + /// Initializes a new instance of the StorageMigrationResponse class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// When server starts the migration process, + /// it will return an operation ID identifying that particular + /// migration operation. + public StorageMigrationResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string operationId = default(string)) + : base(id, name, kind, type) { OperationId = operationId; + CustomInit(); } - /// When server starts the migration process, it will return an operation ID identifying that particular migration operation. - public string OperationId { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets when server starts the migration process, it will return an + /// operation ID identifying that particular migration operation. + /// + [JsonProperty(PropertyName = "properties.operationId")] + public string OperationId { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.Serialization.cs deleted file mode 100644 index 038b485b70d7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StringDictionary : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Properties)) - { - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - foreach (var item in Properties) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WriteEndObject(); - } - - internal static StringDictionary DeserializeStringDictionary(JsonElement element) - { - Optional> properties = default; - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - properties = dictionary; - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - } - return new StringDictionary(id.Value, name.Value, kind.Value, type.Value, Optional.ToDictionary(properties)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.cs index 34dd4fafee7c..99192936fc6d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringDictionary.cs @@ -1,36 +1,58 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// String dictionary resource. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// String dictionary resource. + /// public partial class StringDictionary : ProxyOnlyResource { - /// Initializes a new instance of StringDictionary. + /// + /// Initializes a new instance of the StringDictionary class. + /// public StringDictionary() { - Properties = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of StringDictionary. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Settings. - internal StringDictionary(string id, string name, string kind, string type, IDictionary properties) : base(id, name, kind, type) + /// + /// Initializes a new instance of the StringDictionary class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Settings. + public StringDictionary(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary properties = default(IDictionary)) + : base(id, name, kind, type) { Properties = properties; + CustomInit(); } - /// Settings. - public IDictionary Properties { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets settings. + /// + [JsonProperty(PropertyName = "properties")] + public IDictionary Properties { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.Serialization.cs deleted file mode 100644 index 532f227681c7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.Serialization.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class StringList : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Properties)) - { - writer.WritePropertyName("properties"); - writer.WriteStartArray(); - foreach (var item in Properties) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WriteEndObject(); - } - - internal static StringList DeserializeStringList(JsonElement element) - { - Optional> properties = default; - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - properties = array; - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - } - return new StringList(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(properties)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs deleted file mode 100644 index 23de588bc6bc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// String list resource. - public partial class StringList : ProxyOnlyResource - { - /// Initializes a new instance of StringList. - public StringList() - { - Properties = new ChangeTrackingList(); - } - - /// Initializes a new instance of StringList. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// List of string resources. - internal StringList(string id, string name, string kind, string type, IList properties) : base(id, name, kind, type) - { - Properties = properties; - } - - /// List of string resources. - public IList Properties { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.Serialization.cs deleted file mode 100644 index 83cc3edc9d9f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SupportTopic - { - internal static SupportTopic DeserializeSupportTopic(JsonElement element) - { - Optional id = default; - Optional pesId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("pesId")) - { - pesId = property.Value.GetString(); - continue; - } - } - return new SupportTopic(id.Value, pesId.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs deleted file mode 100644 index f571ab899a45..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Defines a unique Support Topic. - public partial class SupportTopic - { - /// Initializes a new instance of SupportTopic. - internal SupportTopic() - { - } - - /// Initializes a new instance of SupportTopic. - /// Support Topic Id. - /// Unique resource Id. - internal SupportTopic(string id, string pesId) - { - Id = id; - PesId = pesId; - } - - /// Support Topic Id. - public string Id { get; } - /// Unique resource Id. - public string PesId { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportedTlsVersions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportedTlsVersions.cs index c2db3d673121..2981b1a26125 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportedTlsVersions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportedTlsVersions.cs @@ -1,54 +1,23 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. - public readonly partial struct SupportedTlsVersions : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public SupportedTlsVersions(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string One0Value = "1.0"; - private const string One1Value = "1.1"; - private const string One2Value = "1.2"; - - /// 1.0. - public static SupportedTlsVersions One0 { get; } = new SupportedTlsVersions(One0Value); - /// 1.1. - public static SupportedTlsVersions One1 { get; } = new SupportedTlsVersions(One1Value); - /// 1.2. - public static SupportedTlsVersions One2 { get; } = new SupportedTlsVersions(One2Value); - /// Determines if two values are the same. - public static bool operator ==(SupportedTlsVersions left, SupportedTlsVersions right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SupportedTlsVersions left, SupportedTlsVersions right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SupportedTlsVersions(string value) => new SupportedTlsVersions(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SupportedTlsVersions other && Equals(other); - /// - public bool Equals(SupportedTlsVersions other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for SupportedTlsVersions. + /// + public static class SupportedTlsVersions + { + public const string OneFullStopZero = "1.0"; + public const string OneFullStopOne = "1.1"; + public const string OneFullStopTwo = "1.2"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.Serialization.cs deleted file mode 100644 index 1cf884105a80..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class SwiftVirtualNetwork : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(SubnetResourceId)) - { - writer.WritePropertyName("subnetResourceId"); - writer.WriteStringValue(SubnetResourceId); - } - if (Optional.IsDefined(SwiftSupported)) - { - writer.WritePropertyName("swiftSupported"); - writer.WriteBooleanValue(SwiftSupported.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SwiftVirtualNetwork DeserializeSwiftVirtualNetwork(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional subnetResourceId = default; - Optional swiftSupported = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("subnetResourceId")) - { - subnetResourceId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("swiftSupported")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - swiftSupported = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new SwiftVirtualNetwork(id.Value, name.Value, kind.Value, type.Value, subnetResourceId.Value, Optional.ToNullable(swiftSupported)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.cs index 0d2b1ca36818..6237c01beb53 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SwiftVirtualNetwork.cs @@ -1,36 +1,75 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Swift Virtual Network Contract. This is used to enable the new Swift way of doing virtual network integration. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Swift Virtual Network Contract. This is used to enable the new Swift + /// way of doing virtual network integration. + /// + [Rest.Serialization.JsonTransformation] public partial class SwiftVirtualNetwork : ProxyOnlyResource { - /// Initializes a new instance of SwiftVirtualNetwork. + /// + /// Initializes a new instance of the SwiftVirtualNetwork class. + /// public SwiftVirtualNetwork() { + CustomInit(); } - /// Initializes a new instance of SwiftVirtualNetwork. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Virtual Network subnet's resource ID. This is the subnet that this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined first. - /// A flag that specifies if the scale unit this Web App is on supports Swift integration. - internal SwiftVirtualNetwork(string id, string name, string kind, string type, string subnetResourceId, bool? swiftSupported) : base(id, name, kind, type) + /// + /// Initializes a new instance of the SwiftVirtualNetwork class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Virtual Network subnet's + /// resource ID. This is the subnet that this Web App will join. This + /// subnet must have a delegation to Microsoft.Web/serverFarms defined + /// first. + /// A flag that specifies if the scale + /// unit this Web App is on supports Swift integration. + public SwiftVirtualNetwork(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string subnetResourceId = default(string), bool? swiftSupported = default(bool?)) + : base(id, name, kind, type) { SubnetResourceId = subnetResourceId; SwiftSupported = swiftSupported; + CustomInit(); } - /// The Virtual Network subnet's resource ID. This is the subnet that this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined first. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Virtual Network subnet's resource ID. This is the + /// subnet that this Web App will join. This subnet must have a + /// delegation to Microsoft.Web/serverFarms defined first. + /// + [JsonProperty(PropertyName = "properties.subnetResourceId")] public string SubnetResourceId { get; set; } - /// A flag that specifies if the scale unit this Web App is on supports Swift integration. + + /// + /// Gets or sets a flag that specifies if the scale unit this Web App + /// is on supports Swift integration. + /// + [JsonProperty(PropertyName = "properties.swiftSupported")] public bool? SwiftSupported { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.Serialization.cs deleted file mode 100644 index e012ad85aace..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class TldLegalAgreement - { - internal static TldLegalAgreement DeserializeTldLegalAgreement(JsonElement element) - { - string agreementKey = default; - string title = default; - string content = default; - Optional url = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("agreementKey")) - { - agreementKey = property.Value.GetString(); - continue; - } - if (property.NameEquals("title")) - { - title = property.Value.GetString(); - continue; - } - if (property.NameEquals("content")) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("url")) - { - url = property.Value.GetString(); - continue; - } - } - return new TldLegalAgreement(agreementKey, title, content, url.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.cs index e578624585d8..c5e9fd72b89a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreement.cs @@ -1,62 +1,99 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Legal agreement for a top level domain. + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Legal agreement for a top level domain. + /// public partial class TldLegalAgreement { - /// Initializes a new instance of TldLegalAgreement. - /// Unique identifier for the agreement. - /// Agreement title. - /// Agreement details. - /// , , or is null. - internal TldLegalAgreement(string agreementKey, string title, string content) + /// + /// Initializes a new instance of the TldLegalAgreement class. + /// + public TldLegalAgreement() { - if (agreementKey == null) - { - throw new ArgumentNullException(nameof(agreementKey)); - } - if (title == null) - { - throw new ArgumentNullException(nameof(title)); - } - if (content == null) - { - throw new ArgumentNullException(nameof(content)); - } - - AgreementKey = agreementKey; - Title = title; - Content = content; + CustomInit(); } - /// Initializes a new instance of TldLegalAgreement. - /// Unique identifier for the agreement. - /// Agreement title. - /// Agreement details. - /// URL where a copy of the agreement details is hosted. - internal TldLegalAgreement(string agreementKey, string title, string content, string url) + /// + /// Initializes a new instance of the TldLegalAgreement class. + /// + /// Unique identifier for the + /// agreement. + /// Agreement title. + /// Agreement details. + /// URL where a copy of the agreement details is + /// hosted. + public TldLegalAgreement(string agreementKey, string title, string content, string url = default(string)) { AgreementKey = agreementKey; Title = title; Content = content; Url = url; + CustomInit(); } - /// Unique identifier for the agreement. - public string AgreementKey { get; } - /// Agreement title. - public string Title { get; } - /// Agreement details. - public string Content { get; } - /// URL where a copy of the agreement details is hosted. - public string Url { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unique identifier for the agreement. + /// + [JsonProperty(PropertyName = "agreementKey")] + public string AgreementKey { get; set; } + + /// + /// Gets or sets agreement title. + /// + [JsonProperty(PropertyName = "title")] + public string Title { get; set; } + + /// + /// Gets or sets agreement details. + /// + [JsonProperty(PropertyName = "content")] + public string Content { get; set; } + + /// + /// Gets or sets URL where a copy of the agreement details is hosted. + /// + [JsonProperty(PropertyName = "url")] + public string Url { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AgreementKey == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AgreementKey"); + } + if (Title == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Title"); + } + if (Content == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Content"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.Serialization.cs deleted file mode 100644 index db1c41b403a9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class TldLegalAgreementCollection - { - internal static TldLegalAgreementCollection DeserializeTldLegalAgreementCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TldLegalAgreement.DeserializeTldLegalAgreement(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new TldLegalAgreementCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.cs deleted file mode 100644 index 233f473d9138..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TldLegalAgreementCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of top-level domain legal agreements. - internal partial class TldLegalAgreementCollection - { - /// Initializes a new instance of TldLegalAgreementCollection. - /// Collection of resources. - /// is null. - internal TldLegalAgreementCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of TldLegalAgreementCollection. - /// Collection of resources. - /// Link to next page of resources. - internal TldLegalAgreementCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.Serialization.cs deleted file mode 100644 index 22819023754d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.Serialization.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class TokenStore : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(TokenRefreshExtensionHours)) - { - writer.WritePropertyName("tokenRefreshExtensionHours"); - writer.WriteNumberValue(TokenRefreshExtensionHours.Value); - } - if (Optional.IsDefined(FileSystem)) - { - writer.WritePropertyName("fileSystem"); - writer.WriteObjectValue(FileSystem); - } - if (Optional.IsDefined(AzureBlobStorage)) - { - writer.WritePropertyName("azureBlobStorage"); - writer.WriteObjectValue(AzureBlobStorage); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static TokenStore DeserializeTokenStore(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional tokenRefreshExtensionHours = default; - Optional fileSystem = default; - Optional azureBlobStorage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("tokenRefreshExtensionHours")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - tokenRefreshExtensionHours = property0.Value.GetDouble(); - continue; - } - if (property0.NameEquals("fileSystem")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - fileSystem = FileSystemTokenStore.DeserializeFileSystemTokenStore(property0.Value); - continue; - } - if (property0.NameEquals("azureBlobStorage")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - azureBlobStorage = BlobStorageTokenStore.DeserializeBlobStorageTokenStore(property0.Value); - continue; - } - } - continue; - } - } - return new TokenStore(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), Optional.ToNullable(tokenRefreshExtensionHours), fileSystem.Value, azureBlobStorage.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.cs index f711823d219d..ffe3edf35446 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.cs @@ -1,56 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the token store. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class TokenStore : ProxyOnlyResource { - /// Initializes a new instance of TokenStore. + /// + /// Initializes a new instance of the TokenStore class. + /// public TokenStore() { + CustomInit(); } - /// Initializes a new instance of TokenStore. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// - /// <code>true</code> to durably store platform-specific security tokens that are obtained during login flows; otherwise, <code>false</code>. - /// The default is <code>false</code>. - /// - /// - /// The number of hours after session token expiration that a session token can be used to - /// call the token refresh API. The default is 72 hours. - /// - /// The configuration settings of the storage of the tokens if a file system is used. - /// The configuration settings of the storage of the tokens if blob storage is used. - internal TokenStore(string id, string name, string kind, string type, bool? enabled, double? tokenRefreshExtensionHours, FileSystemTokenStore fileSystem, BlobStorageTokenStore azureBlobStorage) : base(id, name, kind, type) + /// + /// Initializes a new instance of the TokenStore class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public TokenStore(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), double? tokenRefreshExtensionHours = default(double?), FileSystemTokenStore fileSystem = default(FileSystemTokenStore), BlobStorageTokenStore azureBlobStorage = default(BlobStorageTokenStore)) + : base(id, name, kind, type) { Enabled = enabled; TokenRefreshExtensionHours = tokenRefreshExtensionHours; FileSystem = fileSystem; AzureBlobStorage = azureBlobStorage; + CustomInit(); } /// - /// <code>true</code> to durably store platform-specific security tokens that are obtained during login flows; otherwise, <code>false</code>. - /// The default is <code>false</code>. + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } + /// - /// The number of hours after session token expiration that a session token can be used to - /// call the token refresh API. The default is 72 hours. /// + [JsonProperty(PropertyName = "properties.tokenRefreshExtensionHours")] public double? TokenRefreshExtensionHours { get; set; } - /// The configuration settings of the storage of the tokens if a file system is used. + + /// + /// + [JsonProperty(PropertyName = "properties.fileSystem")] public FileSystemTokenStore FileSystem { get; set; } - /// The configuration settings of the storage of the tokens if blob storage is used. + + /// + /// + [JsonProperty(PropertyName = "properties.azureBlobStorage")] public BlobStorageTokenStore AzureBlobStorage { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.Serialization.cs deleted file mode 100644 index d21f64f034f6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.Serialization.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class TopLevelDomain : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Privacy)) - { - writer.WritePropertyName("privacy"); - writer.WriteBooleanValue(Privacy.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static TopLevelDomain DeserializeTopLevelDomain(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional privacy = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("privacy")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - privacy = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new TopLevelDomain(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(privacy)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.cs index 0b71866e4774..6dec6fc5f030 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomain.cs @@ -1,32 +1,63 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// A top level domain object. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A top level domain object. + /// + [Rest.Serialization.JsonTransformation] public partial class TopLevelDomain : ProxyOnlyResource { - /// Initializes a new instance of TopLevelDomain. + /// + /// Initializes a new instance of the TopLevelDomain class. + /// public TopLevelDomain() { + CustomInit(); } - /// Initializes a new instance of TopLevelDomain. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// If <code>true</code>, then the top level domain supports domain privacy; otherwise, <code>false</code>. - internal TopLevelDomain(string id, string name, string kind, string type, bool? privacy) : base(id, name, kind, type) + /// + /// Initializes a new instance of the TopLevelDomain class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// If <code>true</code>, then the + /// top level domain supports domain privacy; otherwise, + /// <code>false</code>. + public TopLevelDomain(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? privacy = default(bool?)) + : base(id, name, kind, type) { Privacy = privacy; + CustomInit(); } - /// If <code>true</code>, then the top level domain supports domain privacy; otherwise, <code>false</code>. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, then + /// the top level domain supports domain privacy; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.privacy")] public bool? Privacy { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.Serialization.cs deleted file mode 100644 index a4315ad6cb3f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.Serialization.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class TopLevelDomainAgreementOption : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IncludePrivacy)) - { - writer.WritePropertyName("includePrivacy"); - writer.WriteBooleanValue(IncludePrivacy.Value); - } - if (Optional.IsDefined(ForTransfer)) - { - writer.WritePropertyName("forTransfer"); - writer.WriteBooleanValue(ForTransfer.Value); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.cs index 019b490963b4..668cbcf92351 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainAgreementOption.cs @@ -1,23 +1,69 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Options for retrieving the list of top level domain legal agreements. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Options for retrieving the list of top level domain legal agreements. + /// public partial class TopLevelDomainAgreementOption { - /// Initializes a new instance of TopLevelDomainAgreementOption. + /// + /// Initializes a new instance of the TopLevelDomainAgreementOption + /// class. + /// public TopLevelDomainAgreementOption() { + CustomInit(); } - /// If <code>true</code>, then the list of agreements will include agreements for domain privacy as well; otherwise, <code>false</code>. + /// + /// Initializes a new instance of the TopLevelDomainAgreementOption + /// class. + /// + /// If <code>true</code>, then + /// the list of agreements will include agreements for domain privacy + /// as well; otherwise, <code>false</code>. + /// If <code>true</code>, then + /// the list of agreements will include agreements for domain transfer + /// as well; otherwise, <code>false</code>. + public TopLevelDomainAgreementOption(bool? includePrivacy = default(bool?), bool? forTransfer = default(bool?)) + { + IncludePrivacy = includePrivacy; + ForTransfer = forTransfer; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, then + /// the list of agreements will include agreements for domain privacy + /// as well; otherwise, &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "includePrivacy")] public bool? IncludePrivacy { get; set; } - /// If <code>true</code>, then the list of agreements will include agreements for domain transfer as well; otherwise, <code>false</code>. + + /// + /// Gets or sets if &lt;code&gt;true&lt;/code&gt;, then + /// the list of agreements will include agreements for domain transfer + /// as well; otherwise, &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "forTransfer")] public bool? ForTransfer { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.Serialization.cs deleted file mode 100644 index 6e32272c6aac..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class TopLevelDomainCollection - { - internal static TopLevelDomainCollection DeserializeTopLevelDomainCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TopLevelDomain.DeserializeTopLevelDomain(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new TopLevelDomainCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.cs deleted file mode 100644 index 8d5e53c37ff9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TopLevelDomainCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Top-level domains. - internal partial class TopLevelDomainCollection - { - /// Initializes a new instance of TopLevelDomainCollection. - /// Collection of resources. - /// is null. - internal TopLevelDomainCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of TopLevelDomainCollection. - /// Collection of resources. - /// Link to next page of resources. - internal TopLevelDomainCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggerTypes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggerTypes.cs index 0cf8331ce0c9..e957c41f46ed 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggerTypes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggerTypes.cs @@ -1,51 +1,22 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// The trigger type of the function. - public readonly partial struct TriggerTypes : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public TriggerTypes(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string HttpTriggerValue = "HttpTrigger"; - private const string UnknownValue = "Unknown"; - - /// HttpTrigger. - public static TriggerTypes HttpTrigger { get; } = new TriggerTypes(HttpTriggerValue); - /// Unknown. - public static TriggerTypes Unknown { get; } = new TriggerTypes(UnknownValue); - /// Determines if two values are the same. - public static bool operator ==(TriggerTypes left, TriggerTypes right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(TriggerTypes left, TriggerTypes right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator TriggerTypes(string value) => new TriggerTypes(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is TriggerTypes other && Equals(other); - /// - public bool Equals(TriggerTypes other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for TriggerTypes. + /// + public static class TriggerTypes + { + public const string HttpTrigger = "HttpTrigger"; + public const string Unknown = "Unknown"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.Serialization.cs deleted file mode 100644 index fdf41774c593..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class TriggeredJobHistory : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Runs)) - { - writer.WritePropertyName("runs"); - writer.WriteStartArray(); - foreach (var item in Runs) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static TriggeredJobHistory DeserializeTriggeredJobHistory(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional> runs = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("runs")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(TriggeredJobRun.DeserializeTriggeredJobRun(item)); - } - runs = array; - continue; - } - } - continue; - } - } - return new TriggeredJobHistory(id.Value, name.Value, kind.Value, type.Value, Optional.ToList(runs)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.cs index 3a91c572fe62..cb058d3cd9c3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistory.cs @@ -1,36 +1,62 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Triggered Web Job History. List of Triggered Web Job Run Information elements. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Triggered Web Job History. List of Triggered Web Job Run Information + /// elements. + /// + [Rest.Serialization.JsonTransformation] public partial class TriggeredJobHistory : ProxyOnlyResource { - /// Initializes a new instance of TriggeredJobHistory. + /// + /// Initializes a new instance of the TriggeredJobHistory class. + /// public TriggeredJobHistory() { - Runs = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of TriggeredJobHistory. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// List of triggered web job runs. - internal TriggeredJobHistory(string id, string name, string kind, string type, IList runs) : base(id, name, kind, type) + /// + /// Initializes a new instance of the TriggeredJobHistory class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// List of triggered web job runs. + public TriggeredJobHistory(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList runs = default(IList)) + : base(id, name, kind, type) { Runs = runs; + CustomInit(); } - /// List of triggered web job runs. - public IList Runs { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of triggered web job runs. + /// + [JsonProperty(PropertyName = "properties.runs")] + public IList Runs { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.Serialization.cs deleted file mode 100644 index 06e5c46c9ab1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class TriggeredJobHistoryCollection - { - internal static TriggeredJobHistoryCollection DeserializeTriggeredJobHistoryCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TriggeredJobHistory.DeserializeTriggeredJobHistory(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new TriggeredJobHistoryCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.cs deleted file mode 100644 index c23859f212bf..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobHistoryCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Kudu continuous web job information elements. - internal partial class TriggeredJobHistoryCollection - { - /// Initializes a new instance of TriggeredJobHistoryCollection. - /// Collection of resources. - /// is null. - internal TriggeredJobHistoryCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of TriggeredJobHistoryCollection. - /// Collection of resources. - /// Link to next page of resources. - internal TriggeredJobHistoryCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.Serialization.cs deleted file mode 100644 index 52a9f291dbb7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.Serialization.cs +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class TriggeredJobRun : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(WebJobId)) - { - writer.WritePropertyName("web_job_id"); - writer.WriteStringValue(WebJobId); - } - if (Optional.IsDefined(WebJobName)) - { - writer.WritePropertyName("web_job_name"); - writer.WriteStringValue(WebJobName); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"); - writer.WriteStringValue(Status.Value.ToSerialString()); - } - if (Optional.IsDefined(StartTime)) - { - writer.WritePropertyName("start_time"); - writer.WriteStringValue(StartTime.Value, "O"); - } - if (Optional.IsDefined(EndTime)) - { - writer.WritePropertyName("end_time"); - writer.WriteStringValue(EndTime.Value, "O"); - } - if (Optional.IsDefined(Duration)) - { - writer.WritePropertyName("duration"); - writer.WriteStringValue(Duration); - } - if (Optional.IsDefined(OutputUrl)) - { - writer.WritePropertyName("output_url"); - writer.WriteStringValue(OutputUrl); - } - if (Optional.IsDefined(ErrorUrl)) - { - writer.WritePropertyName("error_url"); - writer.WriteStringValue(ErrorUrl); - } - if (Optional.IsDefined(Url)) - { - writer.WritePropertyName("url"); - writer.WriteStringValue(Url); - } - if (Optional.IsDefined(JobName)) - { - writer.WritePropertyName("job_name"); - writer.WriteStringValue(JobName); - } - if (Optional.IsDefined(Trigger)) - { - writer.WritePropertyName("trigger"); - writer.WriteStringValue(Trigger); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static TriggeredJobRun DeserializeTriggeredJobRun(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional webJobId = default; - Optional webJobName = default; - Optional status = default; - Optional startTime = default; - Optional endTime = default; - Optional duration = default; - Optional outputUrl = default; - Optional errorUrl = default; - Optional url = default; - Optional jobName = default; - Optional trigger = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("web_job_id")) - { - webJobId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("web_job_name")) - { - webJobName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("status")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = property0.Value.GetString().ToTriggeredWebJobStatus(); - continue; - } - if (property0.NameEquals("start_time")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("end_time")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - endTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("duration")) - { - duration = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("output_url")) - { - outputUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("error_url")) - { - errorUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("url")) - { - url = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("job_name")) - { - jobName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("trigger")) - { - trigger = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new TriggeredJobRun(id.Value, name.Value, kind.Value, type.Value, webJobId.Value, webJobName.Value, Optional.ToNullable(status), Optional.ToNullable(startTime), Optional.ToNullable(endTime), duration.Value, outputUrl.Value, errorUrl.Value, url.Value, jobName.Value, trigger.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.cs index db2f3b0a263f..976e997acb80 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredJobRun.cs @@ -1,39 +1,55 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Triggered Web Job Run Information. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Triggered Web Job Run Information. + /// + [Rest.Serialization.JsonTransformation] public partial class TriggeredJobRun : ProxyOnlyResource { - /// Initializes a new instance of TriggeredJobRun. + /// + /// Initializes a new instance of the TriggeredJobRun class. + /// public TriggeredJobRun() { + CustomInit(); } - /// Initializes a new instance of TriggeredJobRun. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Job ID. - /// Job name. - /// Job status. - /// Start time. - /// End time. - /// Job duration. - /// Output URL. - /// Error URL. - /// Job URL. - /// Job name. - /// Job trigger. - internal TriggeredJobRun(string id, string name, string kind, string type, string webJobId, string webJobName, TriggeredWebJobStatus? status, DateTimeOffset? startTime, DateTimeOffset? endTime, string duration, string outputUrl, string errorUrl, string url, string jobName, string trigger) : base(id, name, kind, type) + /// + /// Initializes a new instance of the TriggeredJobRun class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Job ID. + /// Job name. + /// Job status. Possible values include: + /// 'Success', 'Failed', 'Error' + /// Start time. + /// End time. + /// Job duration. + /// Output URL. + /// Error URL. + /// Job URL. + /// Job name. + /// Job trigger. + public TriggeredJobRun(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string webJobId = default(string), string webJobName = default(string), TriggeredWebJobStatus? status = default(TriggeredWebJobStatus?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string duration = default(string), string outputUrl = default(string), string errorUrl = default(string), string url = default(string), string jobName = default(string), string trigger = default(string)) + : base(id, name, kind, type) { WebJobId = webJobId; WebJobName = webJobName; @@ -46,29 +62,80 @@ internal TriggeredJobRun(string id, string name, string kind, string type, strin Url = url; JobName = jobName; Trigger = trigger; + CustomInit(); } - /// Job ID. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets job ID. + /// + [JsonProperty(PropertyName = "properties.web_job_id")] public string WebJobId { get; set; } - /// Job name. + + /// + /// Gets or sets job name. + /// + [JsonProperty(PropertyName = "properties.web_job_name")] public string WebJobName { get; set; } - /// Job status. + + /// + /// Gets or sets job status. Possible values include: 'Success', + /// 'Failed', 'Error' + /// + [JsonProperty(PropertyName = "properties.status")] public TriggeredWebJobStatus? Status { get; set; } - /// Start time. - public DateTimeOffset? StartTime { get; set; } - /// End time. - public DateTimeOffset? EndTime { get; set; } - /// Job duration. + + /// + /// Gets or sets start time. + /// + [JsonProperty(PropertyName = "properties.start_time")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets end time. + /// + [JsonProperty(PropertyName = "properties.end_time")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets job duration. + /// + [JsonProperty(PropertyName = "properties.duration")] public string Duration { get; set; } - /// Output URL. + + /// + /// Gets or sets output URL. + /// + [JsonProperty(PropertyName = "properties.output_url")] public string OutputUrl { get; set; } - /// Error URL. + + /// + /// Gets or sets error URL. + /// + [JsonProperty(PropertyName = "properties.error_url")] public string ErrorUrl { get; set; } - /// Job URL. + + /// + /// Gets or sets job URL. + /// + [JsonProperty(PropertyName = "properties.url")] public string Url { get; set; } - /// Job name. + + /// + /// Gets or sets job name. + /// + [JsonProperty(PropertyName = "properties.job_name")] public string JobName { get; set; } - /// Job trigger. + + /// + /// Gets or sets job trigger. + /// + [JsonProperty(PropertyName = "properties.trigger")] public string Trigger { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.Serialization.cs deleted file mode 100644 index b72698b240b9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.Serialization.cs +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class TriggeredWebJob : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(LatestRun)) - { - writer.WritePropertyName("latest_run"); - writer.WriteObjectValue(LatestRun); - } - if (Optional.IsDefined(HistoryUrl)) - { - writer.WritePropertyName("history_url"); - writer.WriteStringValue(HistoryUrl); - } - if (Optional.IsDefined(SchedulerLogsUrl)) - { - writer.WritePropertyName("scheduler_logs_url"); - writer.WriteStringValue(SchedulerLogsUrl); - } - if (Optional.IsDefined(RunCommand)) - { - writer.WritePropertyName("run_command"); - writer.WriteStringValue(RunCommand); - } - if (Optional.IsDefined(Url)) - { - writer.WritePropertyName("url"); - writer.WriteStringValue(Url); - } - if (Optional.IsDefined(ExtraInfoUrl)) - { - writer.WritePropertyName("extra_info_url"); - writer.WriteStringValue(ExtraInfoUrl); - } - if (Optional.IsDefined(WebJobType)) - { - writer.WritePropertyName("web_job_type"); - writer.WriteStringValue(WebJobType.Value.ToSerialString()); - } - if (Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"); - writer.WriteStringValue(Error); - } - if (Optional.IsDefined(UsingSdk)) - { - writer.WritePropertyName("using_sdk"); - writer.WriteBooleanValue(UsingSdk.Value); - } - if (Optional.IsCollectionDefined(Settings)) - { - writer.WritePropertyName("settings"); - writer.WriteStartObject(); - foreach (var item in Settings) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static TriggeredWebJob DeserializeTriggeredWebJob(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional latestRun = default; - Optional historyUrl = default; - Optional schedulerLogsUrl = default; - Optional runCommand = default; - Optional url = default; - Optional extraInfoUrl = default; - Optional webJobType = default; - Optional error = default; - Optional usingSdk = default; - Optional> settings = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("latest_run")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - latestRun = TriggeredJobRun.DeserializeTriggeredJobRun(property0.Value); - continue; - } - if (property0.NameEquals("history_url")) - { - historyUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("scheduler_logs_url")) - { - schedulerLogsUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("run_command")) - { - runCommand = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("url")) - { - url = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("extra_info_url")) - { - extraInfoUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("web_job_type")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - webJobType = property0.Value.GetString().ToWebJobType(); - continue; - } - if (property0.NameEquals("error")) - { - error = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("using_sdk")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - usingSdk = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("settings")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetObject()); - } - settings = dictionary; - continue; - } - } - continue; - } - } - return new TriggeredWebJob(id.Value, name.Value, kind.Value, type.Value, latestRun.Value, historyUrl.Value, schedulerLogsUrl.Value, runCommand.Value, url.Value, extraInfoUrl.Value, Optional.ToNullable(webJobType), error.Value, Optional.ToNullable(usingSdk), Optional.ToDictionary(settings)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.cs index 400a54f47923..e22db3b35e2e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJob.cs @@ -1,40 +1,56 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Triggered Web Job Information. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Triggered Web Job Information. + /// + [Rest.Serialization.JsonTransformation] public partial class TriggeredWebJob : ProxyOnlyResource { - /// Initializes a new instance of TriggeredWebJob. + /// + /// Initializes a new instance of the TriggeredWebJob class. + /// public TriggeredWebJob() { - Settings = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of TriggeredWebJob. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Latest job run information. - /// History URL. - /// Scheduler Logs URL. - /// Run command. - /// Job URL. - /// Extra Info URL. - /// Job type. - /// Error information. - /// Using SDK?. - /// Job settings. - internal TriggeredWebJob(string id, string name, string kind, string type, TriggeredJobRun latestRun, string historyUrl, string schedulerLogsUrl, string runCommand, string url, string extraInfoUrl, WebJobType? webJobType, string error, bool? usingSdk, IDictionary settings) : base(id, name, kind, type) + /// + /// Initializes a new instance of the TriggeredWebJob class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Latest job run information. + /// History URL. + /// Scheduler Logs URL. + /// Run command. + /// Job URL. + /// Extra Info URL. + /// Job type. Possible values include: + /// 'Continuous', 'Triggered' + /// Error information. + /// Using SDK? + /// Job settings. + public TriggeredWebJob(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), TriggeredJobRun latestRun = default(TriggeredJobRun), string historyUrl = default(string), string schedulerLogsUrl = default(string), string runCommand = default(string), string url = default(string), string extraInfoUrl = default(string), WebJobType? webJobType = default(WebJobType?), string error = default(string), bool? usingSdk = default(bool?), IDictionary settings = default(IDictionary)) + : base(id, name, kind, type) { LatestRun = latestRun; HistoryUrl = historyUrl; @@ -46,27 +62,74 @@ internal TriggeredWebJob(string id, string name, string kind, string type, Trigg Error = error; UsingSdk = usingSdk; Settings = settings; + CustomInit(); } - /// Latest job run information. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets latest job run information. + /// + [JsonProperty(PropertyName = "properties.latest_run")] public TriggeredJobRun LatestRun { get; set; } - /// History URL. + + /// + /// Gets or sets history URL. + /// + [JsonProperty(PropertyName = "properties.history_url")] public string HistoryUrl { get; set; } - /// Scheduler Logs URL. + + /// + /// Gets or sets scheduler Logs URL. + /// + [JsonProperty(PropertyName = "properties.scheduler_logs_url")] public string SchedulerLogsUrl { get; set; } - /// Run command. + + /// + /// Gets or sets run command. + /// + [JsonProperty(PropertyName = "properties.run_command")] public string RunCommand { get; set; } - /// Job URL. + + /// + /// Gets or sets job URL. + /// + [JsonProperty(PropertyName = "properties.url")] public string Url { get; set; } - /// Extra Info URL. + + /// + /// Gets or sets extra Info URL. + /// + [JsonProperty(PropertyName = "properties.extra_info_url")] public string ExtraInfoUrl { get; set; } - /// Job type. + + /// + /// Gets or sets job type. Possible values include: 'Continuous', + /// 'Triggered' + /// + [JsonProperty(PropertyName = "properties.web_job_type")] public WebJobType? WebJobType { get; set; } - /// Error information. + + /// + /// Gets or sets error information. + /// + [JsonProperty(PropertyName = "properties.error")] public string Error { get; set; } - /// Using SDK?. + + /// + /// Gets or sets using SDK? + /// + [JsonProperty(PropertyName = "properties.using_sdk")] public bool? UsingSdk { get; set; } - /// Job settings. - public IDictionary Settings { get; } + + /// + /// Gets or sets job settings. + /// + [JsonProperty(PropertyName = "properties.settings")] + public IDictionary Settings { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.Serialization.cs deleted file mode 100644 index 0370be720ced..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class TriggeredWebJobCollection - { - internal static TriggeredWebJobCollection DeserializeTriggeredWebJobCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TriggeredWebJob.DeserializeTriggeredWebJob(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new TriggeredWebJobCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.cs deleted file mode 100644 index 74a0f5a38db3..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Kudu continuous web job information elements. - internal partial class TriggeredWebJobCollection - { - /// Initializes a new instance of TriggeredWebJobCollection. - /// Collection of resources. - /// is null. - internal TriggeredWebJobCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of TriggeredWebJobCollection. - /// Collection of resources. - /// Link to next page of resources. - internal TriggeredWebJobCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.Serialization.cs deleted file mode 100644 index 1867a800f757..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class TriggeredWebJobStatusExtensions - { - public static string ToSerialString(this TriggeredWebJobStatus value) => value switch - { - TriggeredWebJobStatus.Success => "Success", - TriggeredWebJobStatus.Failed => "Failed", - TriggeredWebJobStatus.Error => "Error", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TriggeredWebJobStatus value.") - }; - - public static TriggeredWebJobStatus ToTriggeredWebJobStatus(this string value) - { - if (string.Equals(value, "Success", StringComparison.InvariantCultureIgnoreCase)) return TriggeredWebJobStatus.Success; - if (string.Equals(value, "Failed", StringComparison.InvariantCultureIgnoreCase)) return TriggeredWebJobStatus.Failed; - if (string.Equals(value, "Error", StringComparison.InvariantCultureIgnoreCase)) return TriggeredWebJobStatus.Error; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TriggeredWebJobStatus value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.cs index 82b71c0adf06..9afa65b95772 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TriggeredWebJobStatus.cs @@ -1,20 +1,66 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Job status. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for TriggeredWebJobStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum TriggeredWebJobStatus { - /// Success. + [EnumMember(Value = "Success")] Success, - /// Failed. + [EnumMember(Value = "Failed")] Failed, - /// Error. + [EnumMember(Value = "Error")] Error } + internal static class TriggeredWebJobStatusEnumExtension + { + internal static string ToSerializedValue(this TriggeredWebJobStatus? value) + { + return value == null ? null : ((TriggeredWebJobStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this TriggeredWebJobStatus value) + { + switch( value ) + { + case TriggeredWebJobStatus.Success: + return "Success"; + case TriggeredWebJobStatus.Failed: + return "Failed"; + case TriggeredWebJobStatus.Error: + return "Error"; + } + return null; + } + + internal static TriggeredWebJobStatus? ParseTriggeredWebJobStatus(this string value) + { + switch( value ) + { + case "Success": + return TriggeredWebJobStatus.Success; + case "Failed": + return TriggeredWebJobStatus.Failed; + case "Error": + return TriggeredWebJobStatus.Error; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.Serialization.cs deleted file mode 100644 index b8bf8690acd6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.Serialization.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Twitter : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(Registration)) - { - writer.WritePropertyName("registration"); - writer.WriteObjectValue(Registration); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Twitter DeserializeTwitter(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional enabled = default; - Optional registration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("registration")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - registration = TwitterRegistration.DeserializeTwitterRegistration(property0.Value); - continue; - } - } - continue; - } - } - return new Twitter(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(enabled), registration.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.cs index 20a1247a5adb..c2c7bdf49b9c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.cs @@ -1,36 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the Twitter provider. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class Twitter : ProxyOnlyResource { - /// Initializes a new instance of Twitter. + /// + /// Initializes a new instance of the Twitter class. + /// public Twitter() { + CustomInit(); } - /// Initializes a new instance of Twitter. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// <code>false</code> if the Twitter provider should not be enabled despite the set registration; otherwise, <code>true</code>. - /// The configuration settings of the app registration for the Twitter provider. - internal Twitter(string id, string name, string kind, string type, bool? enabled, TwitterRegistration registration) : base(id, name, kind, type) + /// + /// Initializes a new instance of the Twitter class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public Twitter(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), TwitterRegistration registration = default(TwitterRegistration)) + : base(id, name, kind, type) { Enabled = enabled; Registration = registration; + CustomInit(); } - /// <code>false</code> if the Twitter provider should not be enabled despite the set registration; otherwise, <code>true</code>. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } - /// The configuration settings of the app registration for the Twitter provider. + + /// + /// + [JsonProperty(PropertyName = "properties.registration")] public TwitterRegistration Registration { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.Serialization.cs deleted file mode 100644 index 9b03609323b4..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.Serialization.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class TwitterRegistration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ConsumerKey)) - { - writer.WritePropertyName("consumerKey"); - writer.WriteStringValue(ConsumerKey); - } - if (Optional.IsDefined(ConsumerSecretSettingName)) - { - writer.WritePropertyName("consumerSecretSettingName"); - writer.WriteStringValue(ConsumerSecretSettingName); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static TwitterRegistration DeserializeTwitterRegistration(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional consumerKey = default; - Optional consumerSecretSettingName = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("consumerKey")) - { - consumerKey = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("consumerSecretSettingName")) - { - consumerSecretSettingName = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new TwitterRegistration(id.Value, name.Value, kind.Value, type.Value, consumerKey.Value, consumerSecretSettingName.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.cs index 7d6cc985d837..92b77941cf02 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.cs @@ -1,50 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The configuration settings of the app registration for the Twitter provider. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class TwitterRegistration : ProxyOnlyResource { - /// Initializes a new instance of TwitterRegistration. + /// + /// Initializes a new instance of the TwitterRegistration class. + /// public TwitterRegistration() { + CustomInit(); } - /// Initializes a new instance of TwitterRegistration. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// - /// The OAuth 1.0a consumer key of the Twitter application used for sign-in. - /// This setting is required for enabling Twitter Sign-In. - /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. - /// - /// - /// The app setting name that contains the OAuth 1.0a consumer secret of the Twitter - /// application used for sign-in. - /// - internal TwitterRegistration(string id, string name, string kind, string type, string consumerKey, string consumerSecretSettingName) : base(id, name, kind, type) + /// + /// Initializes a new instance of the TwitterRegistration class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + public TwitterRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string consumerKey = default(string), string consumerSecretSettingName = default(string)) + : base(id, name, kind, type) { ConsumerKey = consumerKey; ConsumerSecretSettingName = consumerSecretSettingName; + CustomInit(); } /// - /// The OAuth 1.0a consumer key of the Twitter application used for sign-in. - /// This setting is required for enabling Twitter Sign-In. - /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// /// + [JsonProperty(PropertyName = "properties.consumerKey")] public string ConsumerKey { get; set; } + /// - /// The app setting name that contains the OAuth 1.0a consumer secret of the Twitter - /// application used for sign-in. /// + [JsonProperty(PropertyName = "properties.consumerSecretSettingName")] public string ConsumerSecretSettingName { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.Serialization.cs deleted file mode 100644 index a8dce821f942..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class UnauthenticatedClientActionExtensions - { - public static string ToSerialString(this UnauthenticatedClientAction value) => value switch - { - UnauthenticatedClientAction.RedirectToLoginPage => "RedirectToLoginPage", - UnauthenticatedClientAction.AllowAnonymous => "AllowAnonymous", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UnauthenticatedClientAction value.") - }; - - public static UnauthenticatedClientAction ToUnauthenticatedClientAction(this string value) - { - if (string.Equals(value, "RedirectToLoginPage", StringComparison.InvariantCultureIgnoreCase)) return UnauthenticatedClientAction.RedirectToLoginPage; - if (string.Equals(value, "AllowAnonymous", StringComparison.InvariantCultureIgnoreCase)) return UnauthenticatedClientAction.AllowAnonymous; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UnauthenticatedClientAction value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.cs index 7703e8bb2735..631531f54026 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientAction.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The action to take when an unauthenticated client attempts to access the app. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for UnauthenticatedClientAction. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum UnauthenticatedClientAction { - /// RedirectToLoginPage. + [EnumMember(Value = "RedirectToLoginPage")] RedirectToLoginPage, - /// AllowAnonymous. + [EnumMember(Value = "AllowAnonymous")] AllowAnonymous } + internal static class UnauthenticatedClientActionEnumExtension + { + internal static string ToSerializedValue(this UnauthenticatedClientAction? value) + { + return value == null ? null : ((UnauthenticatedClientAction)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this UnauthenticatedClientAction value) + { + switch( value ) + { + case UnauthenticatedClientAction.RedirectToLoginPage: + return "RedirectToLoginPage"; + case UnauthenticatedClientAction.AllowAnonymous: + return "AllowAnonymous"; + } + return null; + } + + internal static UnauthenticatedClientAction? ParseUnauthenticatedClientAction(this string value) + { + switch( value ) + { + case "RedirectToLoginPage": + return UnauthenticatedClientAction.RedirectToLoginPage; + case "AllowAnonymous": + return UnauthenticatedClientAction.AllowAnonymous; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.Serialization.cs deleted file mode 100644 index cd0283626921..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.Serialization.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class UnauthenticatedClientActionV2Extensions - { - public static string ToSerialString(this UnauthenticatedClientActionV2 value) => value switch - { - UnauthenticatedClientActionV2.RedirectToLoginPage => "RedirectToLoginPage", - UnauthenticatedClientActionV2.AllowAnonymous => "AllowAnonymous", - UnauthenticatedClientActionV2.Return401 => "Return401", - UnauthenticatedClientActionV2.Return403 => "Return403", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UnauthenticatedClientActionV2 value.") - }; - - public static UnauthenticatedClientActionV2 ToUnauthenticatedClientActionV2(this string value) - { - if (string.Equals(value, "RedirectToLoginPage", StringComparison.InvariantCultureIgnoreCase)) return UnauthenticatedClientActionV2.RedirectToLoginPage; - if (string.Equals(value, "AllowAnonymous", StringComparison.InvariantCultureIgnoreCase)) return UnauthenticatedClientActionV2.AllowAnonymous; - if (string.Equals(value, "Return401", StringComparison.InvariantCultureIgnoreCase)) return UnauthenticatedClientActionV2.Return401; - if (string.Equals(value, "Return403", StringComparison.InvariantCultureIgnoreCase)) return UnauthenticatedClientActionV2.Return403; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UnauthenticatedClientActionV2 value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.cs index 0e152de73fc1..c9ec41bec5ee 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UnauthenticatedClientActionV2.cs @@ -1,22 +1,72 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The action to take when an unauthenticated client attempts to access the app. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for UnauthenticatedClientActionV2. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum UnauthenticatedClientActionV2 { - /// RedirectToLoginPage. + [EnumMember(Value = "RedirectToLoginPage")] RedirectToLoginPage, - /// AllowAnonymous. + [EnumMember(Value = "AllowAnonymous")] AllowAnonymous, - /// Return401. + [EnumMember(Value = "Return401")] Return401, - /// Return403. + [EnumMember(Value = "Return403")] Return403 } + internal static class UnauthenticatedClientActionV2EnumExtension + { + internal static string ToSerializedValue(this UnauthenticatedClientActionV2? value) + { + return value == null ? null : ((UnauthenticatedClientActionV2)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this UnauthenticatedClientActionV2 value) + { + switch( value ) + { + case UnauthenticatedClientActionV2.RedirectToLoginPage: + return "RedirectToLoginPage"; + case UnauthenticatedClientActionV2.AllowAnonymous: + return "AllowAnonymous"; + case UnauthenticatedClientActionV2.Return401: + return "Return401"; + case UnauthenticatedClientActionV2.Return403: + return "Return403"; + } + return null; + } + + internal static UnauthenticatedClientActionV2? ParseUnauthenticatedClientActionV2(this string value) + { + switch( value ) + { + case "RedirectToLoginPage": + return UnauthenticatedClientActionV2.RedirectToLoginPage; + case "AllowAnonymous": + return UnauthenticatedClientActionV2.AllowAnonymous; + case "Return401": + return UnauthenticatedClientActionV2.Return401; + case "Return403": + return UnauthenticatedClientActionV2.Return403; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.Serialization.cs deleted file mode 100644 index 0b5bfdf8144a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class Usage : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static Usage DeserializeUsage(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional displayName = default; - Optional resourceName = default; - Optional unit = default; - Optional currentValue = default; - Optional limit = default; - Optional nextResetTime = default; - Optional computeMode = default; - Optional siteMode = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("displayName")) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("resourceName")) - { - resourceName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("unit")) - { - unit = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("currentValue")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - currentValue = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("limit")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - limit = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("nextResetTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - nextResetTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("computeMode")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - computeMode = property0.Value.GetString().ToComputeModeOptions(); - continue; - } - if (property0.NameEquals("siteMode")) - { - siteMode = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new Usage(id.Value, name.Value, kind.Value, type.Value, displayName.Value, resourceName.Value, unit.Value, Optional.ToNullable(currentValue), Optional.ToNullable(limit), Optional.ToNullable(nextResetTime), Optional.ToNullable(computeMode), siteMode.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.cs index 8732299b0cbe..3a3b84a8828b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Usage.cs @@ -1,36 +1,55 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Usage of the quota resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Usage of the quota resource. + /// + [Rest.Serialization.JsonTransformation] public partial class Usage : ProxyOnlyResource { - /// Initializes a new instance of Usage. + /// + /// Initializes a new instance of the Usage class. + /// public Usage() { + CustomInit(); } - /// Initializes a new instance of Usage. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Friendly name shown in the UI. - /// Name of the quota resource. - /// Units of measurement for the quota resource. - /// The current value of the resource counter. - /// The resource limit. - /// Next reset time for the resource counter. - /// Compute mode used for this usage. - /// Site mode used for this usage. - internal Usage(string id, string name, string kind, string type, string displayName, string resourceName, string unit, long? currentValue, long? limit, DateTimeOffset? nextResetTime, ComputeModeOptions? computeMode, string siteMode) : base(id, name, kind, type) + /// + /// Initializes a new instance of the Usage class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Friendly name shown in the UI. + /// Name of the quota resource. + /// Units of measurement for the quota + /// resource. + /// The current value of the resource + /// counter. + /// The resource limit. + /// Next reset time for the resource + /// counter. + /// Compute mode used for this usage. + /// Possible values include: 'Shared', 'Dedicated', 'Dynamic' + /// Site mode used for this usage. + public Usage(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string displayName = default(string), string resourceName = default(string), string unit = default(string), long? currentValue = default(long?), long? limit = default(long?), System.DateTime? nextResetTime = default(System.DateTime?), ComputeModeOptions? computeMode = default(ComputeModeOptions?), string siteMode = default(string)) + : base(id, name, kind, type) { DisplayName = displayName; ResourceName = resourceName; @@ -40,23 +59,62 @@ internal Usage(string id, string name, string kind, string type, string displayN NextResetTime = nextResetTime; ComputeMode = computeMode; SiteMode = siteMode; + CustomInit(); } - /// Friendly name shown in the UI. - public string DisplayName { get; } - /// Name of the quota resource. - public string ResourceName { get; } - /// Units of measurement for the quota resource. - public string Unit { get; } - /// The current value of the resource counter. - public long? CurrentValue { get; } - /// The resource limit. - public long? Limit { get; } - /// Next reset time for the resource counter. - public DateTimeOffset? NextResetTime { get; } - /// Compute mode used for this usage. - public ComputeModeOptions? ComputeMode { get; } - /// Site mode used for this usage. - public string SiteMode { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets friendly name shown in the UI. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets name of the quota resource. + /// + [JsonProperty(PropertyName = "properties.resourceName")] + public string ResourceName { get; private set; } + + /// + /// Gets units of measurement for the quota resource. + /// + [JsonProperty(PropertyName = "properties.unit")] + public string Unit { get; private set; } + + /// + /// Gets the current value of the resource counter. + /// + [JsonProperty(PropertyName = "properties.currentValue")] + public long? CurrentValue { get; private set; } + + /// + /// Gets the resource limit. + /// + [JsonProperty(PropertyName = "properties.limit")] + public long? Limit { get; private set; } + + /// + /// Gets next reset time for the resource counter. + /// + [JsonProperty(PropertyName = "properties.nextResetTime")] + public System.DateTime? NextResetTime { get; private set; } + + /// + /// Gets compute mode used for this usage. Possible values include: + /// 'Shared', 'Dedicated', 'Dynamic' + /// + [JsonProperty(PropertyName = "properties.computeMode")] + public ComputeModeOptions? ComputeMode { get; private set; } + + /// + /// Gets site mode used for this usage. + /// + [JsonProperty(PropertyName = "properties.siteMode")] + public string SiteMode { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.Serialization.cs deleted file mode 100644 index b39a87577f9f..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class UsageCollection - { - internal static UsageCollection DeserializeUsageCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Usage.DeserializeUsage(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new UsageCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.cs deleted file mode 100644 index 74d2721c3d50..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of usages. - internal partial class UsageCollection - { - /// Initializes a new instance of UsageCollection. - /// Collection of resources. - /// is null. - internal UsageCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of UsageCollection. - /// Collection of resources. - /// Link to next page of resources. - internal UsageCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.Serialization.cs deleted file mode 100644 index b94340b0acdf..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class UsageStateExtensions - { - public static string ToSerialString(this UsageState value) => value switch - { - UsageState.Normal => "Normal", - UsageState.Exceeded => "Exceeded", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UsageState value.") - }; - - public static UsageState ToUsageState(this string value) - { - if (string.Equals(value, "Normal", StringComparison.InvariantCultureIgnoreCase)) return UsageState.Normal; - if (string.Equals(value, "Exceeded", StringComparison.InvariantCultureIgnoreCase)) return UsageState.Exceeded; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UsageState value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.cs index 87547962ff42..ec63bc2a7d9d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/UsageState.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// State indicating whether the app has exceeded its quota usage. Read-only. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for UsageState. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum UsageState { - /// Normal. + [EnumMember(Value = "Normal")] Normal, - /// Exceeded. + [EnumMember(Value = "Exceeded")] Exceeded } + internal static class UsageStateEnumExtension + { + internal static string ToSerializedValue(this UsageState? value) + { + return value == null ? null : ((UsageState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this UsageState value) + { + switch( value ) + { + case UsageState.Normal: + return "Normal"; + case UsageState.Exceeded: + return "Exceeded"; + } + return null; + } + + internal static UsageState? ParseUsageState(this string value) + { + switch( value ) + { + case "Normal": + return UsageState.Normal; + case "Exceeded": + return UsageState.Exceeded; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.Serialization.cs deleted file mode 100644 index 7904d0828b32..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.Serialization.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class User : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(PublishingUserName)) - { - writer.WritePropertyName("publishingUserName"); - writer.WriteStringValue(PublishingUserName); - } - if (Optional.IsDefined(PublishingPassword)) - { - writer.WritePropertyName("publishingPassword"); - writer.WriteStringValue(PublishingPassword); - } - if (Optional.IsDefined(PublishingPasswordHash)) - { - writer.WritePropertyName("publishingPasswordHash"); - writer.WriteStringValue(PublishingPasswordHash); - } - if (Optional.IsDefined(PublishingPasswordHashSalt)) - { - writer.WritePropertyName("publishingPasswordHashSalt"); - writer.WriteStringValue(PublishingPasswordHashSalt); - } - if (Optional.IsDefined(ScmUri)) - { - writer.WritePropertyName("scmUri"); - writer.WriteStringValue(ScmUri); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static User DeserializeUser(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional publishingUserName = default; - Optional publishingPassword = default; - Optional publishingPasswordHash = default; - Optional publishingPasswordHashSalt = default; - Optional scmUri = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("publishingUserName")) - { - publishingUserName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("publishingPassword")) - { - publishingPassword = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("publishingPasswordHash")) - { - publishingPasswordHash = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("publishingPasswordHashSalt")) - { - publishingPasswordHashSalt = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("scmUri")) - { - scmUri = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new User(id.Value, name.Value, kind.Value, type.Value, publishingUserName.Value, publishingPassword.Value, publishingPasswordHash.Value, publishingPasswordHashSalt.Value, scmUri.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.cs index 73e4fe3f9bc9..c35bdf513eca 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/User.cs @@ -1,48 +1,108 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// User credentials used for publishing activity. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// User credentials used for publishing activity. + /// + [Rest.Serialization.JsonTransformation] public partial class User : ProxyOnlyResource { - /// Initializes a new instance of User. + /// + /// Initializes a new instance of the User class. + /// public User() { + CustomInit(); } - /// Initializes a new instance of User. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Username used for publishing. - /// Password used for publishing. - /// Password hash used for publishing. - /// Password hash salt used for publishing. - /// Url of SCM site. - internal User(string id, string name, string kind, string type, string publishingUserName, string publishingPassword, string publishingPasswordHash, string publishingPasswordHashSalt, string scmUri) : base(id, name, kind, type) + /// + /// Initializes a new instance of the User class. + /// + /// Username used for + /// publishing. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Password used for + /// publishing. + /// Password hash used for + /// publishing. + /// Password hash salt used + /// for publishing. + /// Url of SCM site. + public User(string publishingUserName, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string publishingPassword = default(string), string publishingPasswordHash = default(string), string publishingPasswordHashSalt = default(string), string scmUri = default(string)) + : base(id, name, kind, type) { PublishingUserName = publishingUserName; PublishingPassword = publishingPassword; PublishingPasswordHash = publishingPasswordHash; PublishingPasswordHashSalt = publishingPasswordHashSalt; ScmUri = scmUri; + CustomInit(); } - /// Username used for publishing. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets username used for publishing. + /// + [JsonProperty(PropertyName = "properties.publishingUserName")] public string PublishingUserName { get; set; } - /// Password used for publishing. + + /// + /// Gets or sets password used for publishing. + /// + [JsonProperty(PropertyName = "properties.publishingPassword")] public string PublishingPassword { get; set; } - /// Password hash used for publishing. + + /// + /// Gets or sets password hash used for publishing. + /// + [JsonProperty(PropertyName = "properties.publishingPasswordHash")] public string PublishingPasswordHash { get; set; } - /// Password hash salt used for publishing. + + /// + /// Gets or sets password hash salt used for publishing. + /// + [JsonProperty(PropertyName = "properties.publishingPasswordHashSalt")] public string PublishingPasswordHashSalt { get; set; } - /// Url of SCM site. + + /// + /// Gets or sets url of SCM site. + /// + [JsonProperty(PropertyName = "properties.scmUri")] public string ScmUri { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PublishingUserName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PublishingUserName"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.Serialization.cs deleted file mode 100644 index 955a98cf2e35..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ValidateRequest : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - writer.WritePropertyName("type"); - writer.WriteStringValue(Type.ToString()); - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(ServerFarmId)) - { - writer.WritePropertyName("serverFarmId"); - writer.WriteStringValue(ServerFarmId); - } - if (Optional.IsDefined(SkuName)) - { - writer.WritePropertyName("skuName"); - writer.WriteStringValue(SkuName); - } - if (Optional.IsDefined(NeedLinuxWorkers)) - { - writer.WritePropertyName("needLinuxWorkers"); - writer.WriteBooleanValue(NeedLinuxWorkers.Value); - } - if (Optional.IsDefined(IsSpot)) - { - writer.WritePropertyName("isSpot"); - writer.WriteBooleanValue(IsSpot.Value); - } - if (Optional.IsDefined(Capacity)) - { - writer.WritePropertyName("capacity"); - writer.WriteNumberValue(Capacity.Value); - } - if (Optional.IsDefined(HostingEnvironment)) - { - writer.WritePropertyName("hostingEnvironment"); - writer.WriteStringValue(HostingEnvironment); - } - if (Optional.IsDefined(IsXenon)) - { - writer.WritePropertyName("isXenon"); - writer.WriteBooleanValue(IsXenon.Value); - } - if (Optional.IsDefined(ContainerRegistryBaseUrl)) - { - writer.WritePropertyName("containerRegistryBaseUrl"); - writer.WriteStringValue(ContainerRegistryBaseUrl); - } - if (Optional.IsDefined(ContainerRegistryUsername)) - { - writer.WritePropertyName("containerRegistryUsername"); - writer.WriteStringValue(ContainerRegistryUsername); - } - if (Optional.IsDefined(ContainerRegistryPassword)) - { - writer.WritePropertyName("containerRegistryPassword"); - writer.WriteStringValue(ContainerRegistryPassword); - } - if (Optional.IsDefined(ContainerImageRepository)) - { - writer.WritePropertyName("containerImageRepository"); - writer.WriteStringValue(ContainerImageRepository); - } - if (Optional.IsDefined(ContainerImageTag)) - { - writer.WritePropertyName("containerImageTag"); - writer.WriteStringValue(ContainerImageTag); - } - if (Optional.IsDefined(ContainerImagePlatform)) - { - writer.WritePropertyName("containerImagePlatform"); - writer.WriteStringValue(ContainerImagePlatform); - } - if (Optional.IsDefined(AppServiceEnvironment)) - { - writer.WritePropertyName("appServiceEnvironment"); - writer.WriteObjectValue(AppServiceEnvironment); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs index 4e5377b4b339..a582a0780b0e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs @@ -1,71 +1,223 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Resource validation request content. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Resource validation request content. + /// + [Rest.Serialization.JsonTransformation] public partial class ValidateRequest { - /// Initializes a new instance of ValidateRequest. - /// Resource name to verify. - /// Resource type used for verification. - /// Expected location of the resource. - /// or is null. - public ValidateRequest(string name, ValidateResourceTypes type, string location) + /// + /// Initializes a new instance of the ValidateRequest class. + /// + public ValidateRequest() { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } + CustomInit(); + } + /// + /// Initializes a new instance of the ValidateRequest class. + /// + /// Resource name to verify. + /// Resource type used for verification. Possible + /// values include: 'ServerFarm', 'Site' + /// Expected location of the resource. + /// ARM resource ID of an App Service plan + /// that would host the app. + /// Name of the target SKU for the App Service + /// plan. + /// <code>true</code> if App + /// Service plan is for Linux workers; otherwise, + /// <code>false</code>. + /// <code>true</code> if App Service + /// plan is for Spot instances; otherwise, + /// <code>false</code>. + /// Target capacity of the App Service plan + /// (number of VMs). + /// Name of App Service Environment + /// where app or App Service plan should be created. + /// <code>true</code> if App Service + /// plan is running as a windows container + /// Base URL of the container + /// registry + /// Username for to access the + /// container registry + /// Password for to access the + /// container registry + /// Repository name (image + /// name) + /// Image tag + /// Platform (windows or + /// linux) + public ValidateRequest(string name, string type, string location, string serverFarmId = default(string), string skuName = default(string), bool? needLinuxWorkers = default(bool?), bool? isSpot = default(bool?), int? capacity = default(int?), string hostingEnvironment = default(string), bool? isXenon = default(bool?), string containerRegistryBaseUrl = default(string), string containerRegistryUsername = default(string), string containerRegistryPassword = default(string), string containerImageRepository = default(string), string containerImageTag = default(string), string containerImagePlatform = default(string)) + { Name = name; Type = type; Location = location; + ServerFarmId = serverFarmId; + SkuName = skuName; + NeedLinuxWorkers = needLinuxWorkers; + IsSpot = isSpot; + Capacity = capacity; + HostingEnvironment = hostingEnvironment; + IsXenon = isXenon; + ContainerRegistryBaseUrl = containerRegistryBaseUrl; + ContainerRegistryUsername = containerRegistryUsername; + ContainerRegistryPassword = containerRegistryPassword; + ContainerImageRepository = containerImageRepository; + ContainerImageTag = containerImageTag; + ContainerImagePlatform = containerImagePlatform; + CustomInit(); } - /// Resource name to verify. - public string Name { get; } - /// Resource type used for verification. - public ValidateResourceTypes Type { get; } - /// Expected location of the resource. - public string Location { get; } - /// ARM resource ID of an App Service plan that would host the app. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource name to verify. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets resource type used for verification. Possible values + /// include: 'ServerFarm', 'Site' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets expected location of the resource. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets ARM resource ID of an App Service plan that would host + /// the app. + /// + [JsonProperty(PropertyName = "properties.serverFarmId")] public string ServerFarmId { get; set; } - /// Name of the target SKU for the App Service plan. + + /// + /// Gets or sets name of the target SKU for the App Service plan. + /// + [JsonProperty(PropertyName = "properties.skuName")] public string SkuName { get; set; } - /// <code>true</code> if App Service plan is for Linux workers; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if App + /// Service plan is for Linux workers; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.needLinuxWorkers")] public bool? NeedLinuxWorkers { get; set; } - /// <code>true</code> if App Service plan is for Spot instances; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if App + /// Service plan is for Spot instances; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.isSpot")] public bool? IsSpot { get; set; } - /// Target capacity of the App Service plan (number of VMs). + + /// + /// Gets or sets target capacity of the App Service plan (number of + /// VMs). + /// + [JsonProperty(PropertyName = "properties.capacity")] public int? Capacity { get; set; } - /// Name of App Service Environment where app or App Service plan should be created. + + /// + /// Gets or sets name of App Service Environment where app or App + /// Service plan should be created. + /// + [JsonProperty(PropertyName = "properties.hostingEnvironment")] public string HostingEnvironment { get; set; } - /// <code>true</code> if App Service plan is running as a windows container. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if App + /// Service plan is running as a windows container + /// + [JsonProperty(PropertyName = "properties.isXenon")] public bool? IsXenon { get; set; } - /// Base URL of the container registry. + + /// + /// Gets or sets base URL of the container registry + /// + [JsonProperty(PropertyName = "properties.containerRegistryBaseUrl")] public string ContainerRegistryBaseUrl { get; set; } - /// Username for to access the container registry. + + /// + /// Gets or sets username for to access the container registry + /// + [JsonProperty(PropertyName = "properties.containerRegistryUsername")] public string ContainerRegistryUsername { get; set; } - /// Password for to access the container registry. + + /// + /// Gets or sets password for to access the container registry + /// + [JsonProperty(PropertyName = "properties.containerRegistryPassword")] public string ContainerRegistryPassword { get; set; } - /// Repository name (image name). + + /// + /// Gets or sets repository name (image name) + /// + [JsonProperty(PropertyName = "properties.containerImageRepository")] public string ContainerImageRepository { get; set; } - /// Image tag. + + /// + /// Gets or sets image tag + /// + [JsonProperty(PropertyName = "properties.containerImageTag")] public string ContainerImageTag { get; set; } - /// Platform (windows or linux). + + /// + /// Gets or sets platform (windows or linux) + /// + [JsonProperty(PropertyName = "properties.containerImagePlatform")] public string ContainerImagePlatform { get; set; } - /// App Service Environment Properties. - public AppServiceEnvironment AppServiceEnvironment { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + if (Capacity < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Capacity", 1); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs index 7f72e52a24f2..511049be371b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs @@ -1,54 +1,22 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; +// 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.WebSites.Models { - /// Resource type used for verification. - public readonly partial struct ValidateResourceTypes : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public ValidateResourceTypes(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string ServerFarmValue = "ServerFarm"; - private const string SiteValue = "Site"; - private const string MicrosoftWebHostingEnvironmentsValue = "Microsoft.Web/hostingEnvironments"; - - /// ServerFarm. - public static ValidateResourceTypes ServerFarm { get; } = new ValidateResourceTypes(ServerFarmValue); - /// Site. - public static ValidateResourceTypes Site { get; } = new ValidateResourceTypes(SiteValue); - /// Microsoft.Web/hostingEnvironments. - public static ValidateResourceTypes MicrosoftWebHostingEnvironments { get; } = new ValidateResourceTypes(MicrosoftWebHostingEnvironmentsValue); - /// Determines if two values are the same. - public static bool operator ==(ValidateResourceTypes left, ValidateResourceTypes right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ValidateResourceTypes left, ValidateResourceTypes right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ValidateResourceTypes(string value) => new ValidateResourceTypes(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ValidateResourceTypes other && Equals(other); - /// - public bool Equals(ValidateResourceTypes other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; + /// + /// Defines values for ValidateResourceTypes. + /// + public static class ValidateResourceTypes + { + public const string ServerFarm = "ServerFarm"; + public const string Site = "Site"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.Serialization.cs deleted file mode 100644 index ca07b0f2a129..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.Serialization.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ValidateResponse - { - internal static ValidateResponse DeserializeValidateResponse(JsonElement element) - { - Optional status = default; - Optional error = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("status")) - { - status = property.Value.GetString(); - continue; - } - if (property.NameEquals("error")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - error = ValidateResponseError.DeserializeValidateResponseError(property.Value); - continue; - } - } - return new ValidateResponse(status.Value, error.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.cs index 67c54ad1aec1..303a58c68912 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponse.cs @@ -1,32 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Describes the result of resource validation. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the result of resource validation. + /// public partial class ValidateResponse { - /// Initializes a new instance of ValidateResponse. - internal ValidateResponse() + /// + /// Initializes a new instance of the ValidateResponse class. + /// + public ValidateResponse() { + CustomInit(); } - /// Initializes a new instance of ValidateResponse. - /// Result of validation. - /// Error details for the case when validation fails. - internal ValidateResponse(string status, ValidateResponseError error) + /// + /// Initializes a new instance of the ValidateResponse class. + /// + /// Result of validation. + /// Error details for the case when validation + /// fails. + public ValidateResponse(string status = default(string), ValidateResponseError error = default(ValidateResponseError)) { Status = status; Error = error; + CustomInit(); } - /// Result of validation. - public string Status { get; } - /// Error details for the case when validation fails. - public ValidateResponseError Error { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets result of validation. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets error details for the case when validation fails. + /// + [JsonProperty(PropertyName = "error")] + public ValidateResponseError Error { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.Serialization.cs deleted file mode 100644 index 84c9d92e60ba..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class ValidateResponseError - { - internal static ValidateResponseError DeserializeValidateResponseError(JsonElement element) - { - Optional code = default; - Optional message = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code")) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message")) - { - message = property.Value.GetString(); - continue; - } - } - return new ValidateResponseError(code.Value, message.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.cs index 6e59077e7d0d..6833ce082cb9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResponseError.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Error details for when validation fails. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error details for when validation fails. + /// public partial class ValidateResponseError { - /// Initializes a new instance of ValidateResponseError. - internal ValidateResponseError() + /// + /// Initializes a new instance of the ValidateResponseError class. + /// + public ValidateResponseError() { + CustomInit(); } - /// Initializes a new instance of ValidateResponseError. - /// Validation error code. - /// Validation error message. - internal ValidateResponseError(string code, string message) + /// + /// Initializes a new instance of the ValidateResponseError class. + /// + /// Validation error code. + /// Validation error message. + public ValidateResponseError(string code = default(string), string message = default(string)) { Code = code; Message = message; + CustomInit(); } - /// Validation error code. - public string Code { get; } - /// Validation error message. - public string Message { get; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets validation error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets validation error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.Serialization.cs deleted file mode 100644 index 2ef8f66b54fb..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.Serialization.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class VirtualApplication : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(VirtualPath)) - { - writer.WritePropertyName("virtualPath"); - writer.WriteStringValue(VirtualPath); - } - if (Optional.IsDefined(PhysicalPath)) - { - writer.WritePropertyName("physicalPath"); - writer.WriteStringValue(PhysicalPath); - } - if (Optional.IsDefined(PreloadEnabled)) - { - writer.WritePropertyName("preloadEnabled"); - writer.WriteBooleanValue(PreloadEnabled.Value); - } - if (Optional.IsCollectionDefined(VirtualDirectories)) - { - writer.WritePropertyName("virtualDirectories"); - writer.WriteStartArray(); - foreach (var item in VirtualDirectories) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static VirtualApplication DeserializeVirtualApplication(JsonElement element) - { - Optional virtualPath = default; - Optional physicalPath = default; - Optional preloadEnabled = default; - Optional> virtualDirectories = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("virtualPath")) - { - virtualPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("physicalPath")) - { - physicalPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("preloadEnabled")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - preloadEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("virtualDirectories")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(VirtualDirectory.DeserializeVirtualDirectory(item)); - } - virtualDirectories = array; - continue; - } - } - return new VirtualApplication(virtualPath.Value, physicalPath.Value, Optional.ToNullable(preloadEnabled), Optional.ToList(virtualDirectories)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.cs index 150961554bef..d9c0900c3687 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualApplication.cs @@ -1,44 +1,82 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Virtual application in an app. + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Virtual application in an app. + /// public partial class VirtualApplication { - /// Initializes a new instance of VirtualApplication. + /// + /// Initializes a new instance of the VirtualApplication class. + /// public VirtualApplication() { - VirtualDirectories = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of VirtualApplication. - /// Virtual path. - /// Physical path. - /// <code>true</code> if preloading is enabled; otherwise, <code>false</code>. - /// Virtual directories for virtual application. - internal VirtualApplication(string virtualPath, string physicalPath, bool? preloadEnabled, IList virtualDirectories) + /// + /// Initializes a new instance of the VirtualApplication class. + /// + /// Virtual path. + /// Physical path. + /// <code>true</code> if + /// preloading is enabled; otherwise, + /// <code>false</code>. + /// Virtual directories for virtual + /// application. + public VirtualApplication(string virtualPath = default(string), string physicalPath = default(string), bool? preloadEnabled = default(bool?), IList virtualDirectories = default(IList)) { VirtualPath = virtualPath; PhysicalPath = physicalPath; PreloadEnabled = preloadEnabled; VirtualDirectories = virtualDirectories; + CustomInit(); } - /// Virtual path. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual path. + /// + [JsonProperty(PropertyName = "virtualPath")] public string VirtualPath { get; set; } - /// Physical path. + + /// + /// Gets or sets physical path. + /// + [JsonProperty(PropertyName = "physicalPath")] public string PhysicalPath { get; set; } - /// <code>true</code> if preloading is enabled; otherwise, <code>false</code>. + + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if + /// preloading is enabled; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "preloadEnabled")] public bool? PreloadEnabled { get; set; } - /// Virtual directories for virtual application. - public IList VirtualDirectories { get; } + + /// + /// Gets or sets virtual directories for virtual application. + /// + [JsonProperty(PropertyName = "virtualDirectories")] + public IList VirtualDirectories { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.Serialization.cs deleted file mode 100644 index fa8e1d179093..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class VirtualDirectory : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(VirtualPath)) - { - writer.WritePropertyName("virtualPath"); - writer.WriteStringValue(VirtualPath); - } - if (Optional.IsDefined(PhysicalPath)) - { - writer.WritePropertyName("physicalPath"); - writer.WriteStringValue(PhysicalPath); - } - writer.WriteEndObject(); - } - - internal static VirtualDirectory DeserializeVirtualDirectory(JsonElement element) - { - Optional virtualPath = default; - Optional physicalPath = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("virtualPath")) - { - virtualPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("physicalPath")) - { - physicalPath = property.Value.GetString(); - continue; - } - } - return new VirtualDirectory(virtualPath.Value, physicalPath.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.cs index ab1acfbdec53..16fbc5f1d8b9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualDirectory.cs @@ -1,32 +1,59 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Directory for virtual application. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Directory for virtual application. + /// public partial class VirtualDirectory { - /// Initializes a new instance of VirtualDirectory. + /// + /// Initializes a new instance of the VirtualDirectory class. + /// public VirtualDirectory() { + CustomInit(); } - /// Initializes a new instance of VirtualDirectory. - /// Path to virtual application. - /// Physical path. - internal VirtualDirectory(string virtualPath, string physicalPath) + /// + /// Initializes a new instance of the VirtualDirectory class. + /// + /// Path to virtual application. + /// Physical path. + public VirtualDirectory(string virtualPath = default(string), string physicalPath = default(string)) { VirtualPath = virtualPath; PhysicalPath = physicalPath; + CustomInit(); } - /// Path to virtual application. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets path to virtual application. + /// + [JsonProperty(PropertyName = "virtualPath")] public string VirtualPath { get; set; } - /// Physical path. + + /// + /// Gets or sets physical path. + /// + [JsonProperty(PropertyName = "physicalPath")] public string PhysicalPath { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.Serialization.cs deleted file mode 100644 index 4c5984f5c4d6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.Serialization.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class VirtualIPMapping : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(VirtualIP)) - { - writer.WritePropertyName("virtualIP"); - writer.WriteStringValue(VirtualIP); - } - if (Optional.IsDefined(InternalHttpPort)) - { - writer.WritePropertyName("internalHttpPort"); - writer.WriteNumberValue(InternalHttpPort.Value); - } - if (Optional.IsDefined(InternalHttpsPort)) - { - writer.WritePropertyName("internalHttpsPort"); - writer.WriteNumberValue(InternalHttpsPort.Value); - } - if (Optional.IsDefined(InUse)) - { - writer.WritePropertyName("inUse"); - writer.WriteBooleanValue(InUse.Value); - } - if (Optional.IsDefined(ServiceName)) - { - writer.WritePropertyName("serviceName"); - writer.WriteStringValue(ServiceName); - } - writer.WriteEndObject(); - } - - internal static VirtualIPMapping DeserializeVirtualIPMapping(JsonElement element) - { - Optional virtualIP = default; - Optional internalHttpPort = default; - Optional internalHttpsPort = default; - Optional inUse = default; - Optional serviceName = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("virtualIP")) - { - virtualIP = property.Value.GetString(); - continue; - } - if (property.NameEquals("internalHttpPort")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - internalHttpPort = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("internalHttpsPort")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - internalHttpsPort = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("inUse")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - inUse = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("serviceName")) - { - serviceName = property.Value.GetString(); - continue; - } - } - return new VirtualIPMapping(virtualIP.Value, Optional.ToNullable(internalHttpPort), Optional.ToNullable(internalHttpsPort), Optional.ToNullable(inUse), serviceName.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.cs index 39ec150cf38b..c5d70ef7c71e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualIPMapping.cs @@ -1,44 +1,84 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Virtual IP mapping. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Virtual IP mapping. + /// public partial class VirtualIPMapping { - /// Initializes a new instance of VirtualIPMapping. + /// + /// Initializes a new instance of the VirtualIPMapping class. + /// public VirtualIPMapping() { + CustomInit(); } - /// Initializes a new instance of VirtualIPMapping. - /// Virtual IP address. - /// Internal HTTP port. - /// Internal HTTPS port. - /// Is virtual IP mapping in use. - /// name of the service that virtual IP is assigned to. - internal VirtualIPMapping(string virtualIP, int? internalHttpPort, int? internalHttpsPort, bool? inUse, string serviceName) + /// + /// Initializes a new instance of the VirtualIPMapping class. + /// + /// Virtual IP address. + /// Internal HTTP port. + /// Internal HTTPS port. + /// Is virtual IP mapping in use. + /// name of the service that virtual IP is + /// assigned to + public VirtualIPMapping(string virtualIP = default(string), int? internalHttpPort = default(int?), int? internalHttpsPort = default(int?), bool? inUse = default(bool?), string serviceName = default(string)) { VirtualIP = virtualIP; InternalHttpPort = internalHttpPort; InternalHttpsPort = internalHttpsPort; InUse = inUse; ServiceName = serviceName; + CustomInit(); } - /// Virtual IP address. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets virtual IP address. + /// + [JsonProperty(PropertyName = "virtualIP")] public string VirtualIP { get; set; } - /// Internal HTTP port. + + /// + /// Gets or sets internal HTTP port. + /// + [JsonProperty(PropertyName = "internalHttpPort")] public int? InternalHttpPort { get; set; } - /// Internal HTTPS port. + + /// + /// Gets or sets internal HTTPS port. + /// + [JsonProperty(PropertyName = "internalHttpsPort")] public int? InternalHttpsPort { get; set; } - /// Is virtual IP mapping in use. + + /// + /// Gets or sets is virtual IP mapping in use. + /// + [JsonProperty(PropertyName = "inUse")] public bool? InUse { get; set; } - /// name of the service that virtual IP is assigned to. + + /// + /// Gets or sets name of the service that virtual IP is assigned to + /// + [JsonProperty(PropertyName = "serviceName")] public string ServiceName { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.Serialization.cs deleted file mode 100644 index 4425e199cf41..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.Serialization.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class VirtualNetworkProfile : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("id"); - writer.WriteStringValue(Id); - if (Optional.IsDefined(Subnet)) - { - writer.WritePropertyName("subnet"); - writer.WriteStringValue(Subnet); - } - writer.WriteEndObject(); - } - - internal static VirtualNetworkProfile DeserializeVirtualNetworkProfile(JsonElement element) - { - string id = default; - Optional name = default; - Optional type = default; - Optional subnet = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("subnet")) - { - subnet = property.Value.GetString(); - continue; - } - } - return new VirtualNetworkProfile(id, name.Value, type.Value, subnet.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs index 3bf66d3d73ca..a9162d3a1626 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs @@ -1,50 +1,76 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; +// 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.WebSites.Models { - /// Specification for using a Virtual Network. + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specification for using a Virtual Network. + /// public partial class VirtualNetworkProfile { - /// Initializes a new instance of VirtualNetworkProfile. - /// Resource id of the Virtual Network. - /// is null. - public VirtualNetworkProfile(string id) + /// + /// Initializes a new instance of the VirtualNetworkProfile class. + /// + public VirtualNetworkProfile() { - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - - Id = id; + CustomInit(); } - /// Initializes a new instance of VirtualNetworkProfile. - /// Resource id of the Virtual Network. - /// Name of the Virtual Network (read-only). - /// Resource type of the Virtual Network (read-only). - /// Subnet within the Virtual Network. - internal VirtualNetworkProfile(string id, string name, string type, string subnet) + /// + /// Initializes a new instance of the VirtualNetworkProfile class. + /// + /// Resource id of the Virtual Network. + /// Name of the Virtual Network (read-only). + /// Resource type of the Virtual Network + /// (read-only). + /// Subnet within the Virtual Network. + public VirtualNetworkProfile(string id = default(string), string name = default(string), string type = default(string), string subnet = default(string)) { Id = id; Name = name; Type = type; Subnet = subnet; + CustomInit(); } - /// Resource id of the Virtual Network. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource id of the Virtual Network. + /// + [JsonProperty(PropertyName = "id")] public string Id { get; set; } - /// Name of the Virtual Network (read-only). - public string Name { get; } - /// Resource type of the Virtual Network (read-only). - public string Type { get; } - /// Subnet within the Virtual Network. + + /// + /// Gets name of the Virtual Network (read-only). + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type of the Virtual Network (read-only). + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets subnet within the Virtual Network. + /// + [JsonProperty(PropertyName = "subnet")] public string Subnet { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.Serialization.cs deleted file mode 100644 index 4f40dff1d962..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.Serialization.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class VnetGateway : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(VnetName)) - { - writer.WritePropertyName("vnetName"); - writer.WriteStringValue(VnetName); - } - if (Optional.IsDefined(VpnPackageUri)) - { - writer.WritePropertyName("vpnPackageUri"); - writer.WriteStringValue(VpnPackageUri); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static VnetGateway DeserializeVnetGateway(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional vnetName = default; - Optional vpnPackageUri = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("vnetName")) - { - vnetName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("vpnPackageUri")) - { - vpnPackageUri = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new VnetGateway(id.Value, name.Value, kind.Value, type.Value, vnetName.Value, vpnPackageUri.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.cs index 545140e6af99..f1e125c9e20d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetGateway.cs @@ -1,36 +1,82 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The Virtual Network gateway contract. This is used to give the Virtual Network gateway access to the VPN package. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Virtual Network gateway contract. This is used to give the Virtual + /// Network gateway access to the VPN package. + /// + [Rest.Serialization.JsonTransformation] public partial class VnetGateway : ProxyOnlyResource { - /// Initializes a new instance of VnetGateway. + /// + /// Initializes a new instance of the VnetGateway class. + /// public VnetGateway() { + CustomInit(); } - /// Initializes a new instance of VnetGateway. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Virtual Network name. - /// The URI where the VPN package can be downloaded. - internal VnetGateway(string id, string name, string kind, string type, string vnetName, string vpnPackageUri) : base(id, name, kind, type) + /// + /// Initializes a new instance of the VnetGateway class. + /// + /// The URI where the VPN package can be + /// downloaded. + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Virtual Network name. + public VnetGateway(string vpnPackageUri, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string vnetName = default(string)) + : base(id, name, kind, type) { VnetName = vnetName; VpnPackageUri = vpnPackageUri; + CustomInit(); } - /// The Virtual Network name. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Virtual Network name. + /// + [JsonProperty(PropertyName = "properties.vnetName")] public string VnetName { get; set; } - /// The URI where the VPN package can be downloaded. + + /// + /// Gets or sets the URI where the VPN package can be downloaded. + /// + [JsonProperty(PropertyName = "properties.vpnPackageUri")] public string VpnPackageUri { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VpnPackageUri == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VpnPackageUri"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.Serialization.cs deleted file mode 100644 index 3b264f85c43e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.Serialization.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class VnetInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(VnetResourceId)) - { - writer.WritePropertyName("vnetResourceId"); - writer.WriteStringValue(VnetResourceId); - } - if (Optional.IsDefined(CertBlob)) - { - writer.WritePropertyName("certBlob"); - writer.WriteStringValue(CertBlob); - } - if (Optional.IsDefined(DnsServers)) - { - writer.WritePropertyName("dnsServers"); - writer.WriteStringValue(DnsServers); - } - if (Optional.IsDefined(IsSwift)) - { - writer.WritePropertyName("isSwift"); - writer.WriteBooleanValue(IsSwift.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static VnetInfo DeserializeVnetInfo(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional vnetResourceId = default; - Optional certThumbprint = default; - Optional certBlob = default; - Optional> routes = default; - Optional resyncRequired = default; - Optional dnsServers = default; - Optional isSwift = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("vnetResourceId")) - { - vnetResourceId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("certThumbprint")) - { - certThumbprint = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("certBlob")) - { - certBlob = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("routes")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(VnetRoute.DeserializeVnetRoute(item)); - } - routes = array; - continue; - } - if (property0.NameEquals("resyncRequired")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - resyncRequired = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("dnsServers")) - { - dnsServers = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("isSwift")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isSwift = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new VnetInfo(id.Value, name.Value, kind.Value, type.Value, vnetResourceId.Value, certThumbprint.Value, certBlob.Value, Optional.ToList(routes), Optional.ToNullable(resyncRequired), dnsServers.Value, Optional.ToNullable(isSwift)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.cs index 9f5a9bb20361..9105621d291e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetInfo.cs @@ -1,40 +1,62 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Virtual Network information contract. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Virtual Network information contract. + /// + [Rest.Serialization.JsonTransformation] public partial class VnetInfo : ProxyOnlyResource { - /// Initializes a new instance of VnetInfo. + /// + /// Initializes a new instance of the VnetInfo class. + /// public VnetInfo() { - Routes = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of VnetInfo. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Virtual Network's resource ID. - /// The client certificate thumbprint. - /// - /// A certificate file (.cer) blob containing the public key of the private key used to authenticate a - /// Point-To-Site VPN connection. - /// - /// The routes that this Virtual Network connection uses. - /// <code>true</code> if a resync is required; otherwise, <code>false</code>. - /// DNS servers to be used by this Virtual Network. This should be a comma-separated list of IP addresses. - /// Flag that is used to denote if this is VNET injection. - internal VnetInfo(string id, string name, string kind, string type, string vnetResourceId, string certThumbprint, string certBlob, IReadOnlyList routes, bool? resyncRequired, string dnsServers, bool? isSwift) : base(id, name, kind, type) + /// + /// Initializes a new instance of the VnetInfo class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Virtual Network's resource + /// ID. + /// The client certificate + /// thumbprint. + /// A certificate file (.cer) blob containing + /// the public key of the private key used to authenticate a + /// Point-To-Site VPN connection. + /// The routes that this Virtual Network + /// connection uses. + /// <code>true</code> if a + /// resync is required; otherwise, + /// <code>false</code>. + /// DNS servers to be used by this Virtual + /// Network. This should be a comma-separated list of IP + /// addresses. + /// Flag that is used to denote if this is VNET + /// injection + public VnetInfo(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string vnetResourceId = default(string), string certThumbprint = default(string), string certBlob = default(string), IList routes = default(IList), bool? resyncRequired = default(bool?), string dnsServers = default(string), bool? isSwift = default(bool?)) + : base(id, name, kind, type) { VnetResourceId = vnetResourceId; CertThumbprint = certThumbprint; @@ -43,24 +65,60 @@ internal VnetInfo(string id, string name, string kind, string type, string vnetR ResyncRequired = resyncRequired; DnsServers = dnsServers; IsSwift = isSwift; + CustomInit(); } - /// The Virtual Network's resource ID. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Virtual Network's resource ID. + /// + [JsonProperty(PropertyName = "properties.vnetResourceId")] public string VnetResourceId { get; set; } - /// The client certificate thumbprint. - public string CertThumbprint { get; } + /// - /// A certificate file (.cer) blob containing the public key of the private key used to authenticate a + /// Gets the client certificate thumbprint. + /// + [JsonProperty(PropertyName = "properties.certThumbprint")] + public string CertThumbprint { get; private set; } + + /// + /// Gets or sets a certificate file (.cer) blob containing the public + /// key of the private key used to authenticate a /// Point-To-Site VPN connection. /// + [JsonProperty(PropertyName = "properties.certBlob")] public string CertBlob { get; set; } - /// The routes that this Virtual Network connection uses. - public IReadOnlyList Routes { get; } - /// <code>true</code> if a resync is required; otherwise, <code>false</code>. - public bool? ResyncRequired { get; } - /// DNS servers to be used by this Virtual Network. This should be a comma-separated list of IP addresses. + + /// + /// Gets the routes that this Virtual Network connection uses. + /// + [JsonProperty(PropertyName = "properties.routes")] + public IList Routes { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if a resync is + /// required; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.resyncRequired")] + public bool? ResyncRequired { get; private set; } + + /// + /// Gets or sets DNS servers to be used by this Virtual Network. This + /// should be a comma-separated list of IP addresses. + /// + [JsonProperty(PropertyName = "properties.dnsServers")] public string DnsServers { get; set; } - /// Flag that is used to denote if this is VNET injection. + + /// + /// Gets or sets flag that is used to denote if this is VNET injection + /// + [JsonProperty(PropertyName = "properties.isSwift")] public bool? IsSwift { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.Serialization.cs deleted file mode 100644 index 5176a968bd44..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.Serialization.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class VnetParameters : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(VnetResourceGroup)) - { - writer.WritePropertyName("vnetResourceGroup"); - writer.WriteStringValue(VnetResourceGroup); - } - if (Optional.IsDefined(VnetName)) - { - writer.WritePropertyName("vnetName"); - writer.WriteStringValue(VnetName); - } - if (Optional.IsDefined(VnetSubnetName)) - { - writer.WritePropertyName("vnetSubnetName"); - writer.WriteStringValue(VnetSubnetName); - } - if (Optional.IsDefined(SubnetResourceId)) - { - writer.WritePropertyName("subnetResourceId"); - writer.WriteStringValue(SubnetResourceId); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static VnetParameters DeserializeVnetParameters(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional vnetResourceGroup = default; - Optional vnetName = default; - Optional vnetSubnetName = default; - Optional subnetResourceId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("vnetResourceGroup")) - { - vnetResourceGroup = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("vnetName")) - { - vnetName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("vnetSubnetName")) - { - vnetSubnetName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("subnetResourceId")) - { - subnetResourceId = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new VnetParameters(id.Value, name.Value, kind.Value, type.Value, vnetResourceGroup.Value, vnetName.Value, vnetSubnetName.Value, subnetResourceId.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs index 533ed01355a0..0afb85613b5f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs @@ -1,44 +1,77 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// The required set of inputs to validate a VNET. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The required set of inputs to validate a VNET + /// + [Rest.Serialization.JsonTransformation] public partial class VnetParameters : ProxyOnlyResource { - /// Initializes a new instance of VnetParameters. + /// + /// Initializes a new instance of the VnetParameters class. + /// public VnetParameters() { + CustomInit(); } - /// Initializes a new instance of VnetParameters. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The Resource Group of the VNET to be validated. - /// The name of the VNET to be validated. - /// The subnet name to be validated. - /// The ARM Resource ID of the subnet to validate. - internal VnetParameters(string id, string name, string kind, string type, string vnetResourceGroup, string vnetName, string vnetSubnetName, string subnetResourceId) : base(id, name, kind, type) + /// + /// Initializes a new instance of the VnetParameters class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Resource Group of the VNET to + /// be validated + /// The name of the VNET to be validated + /// The subnet name to be + /// validated + public VnetParameters(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string vnetResourceGroup = default(string), string vnetName = default(string), string vnetSubnetName = default(string)) + : base(id, name, kind, type) { VnetResourceGroup = vnetResourceGroup; VnetName = vnetName; VnetSubnetName = vnetSubnetName; - SubnetResourceId = subnetResourceId; + CustomInit(); } - /// The Resource Group of the VNET to be validated. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Resource Group of the VNET to be validated + /// + [JsonProperty(PropertyName = "properties.vnetResourceGroup")] public string VnetResourceGroup { get; set; } - /// The name of the VNET to be validated. + + /// + /// Gets or sets the name of the VNET to be validated + /// + [JsonProperty(PropertyName = "properties.vnetName")] public string VnetName { get; set; } - /// The subnet name to be validated. + + /// + /// Gets or sets the subnet name to be validated + /// + [JsonProperty(PropertyName = "properties.vnetSubnetName")] public string VnetSubnetName { get; set; } - /// The ARM Resource ID of the subnet to validate. - public string SubnetResourceId { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.Serialization.cs deleted file mode 100644 index fca082a7abca..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class VnetRoute : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(StartAddress)) - { - writer.WritePropertyName("startAddress"); - writer.WriteStringValue(StartAddress); - } - if (Optional.IsDefined(EndAddress)) - { - writer.WritePropertyName("endAddress"); - writer.WriteStringValue(EndAddress); - } - if (Optional.IsDefined(RouteType)) - { - writer.WritePropertyName("routeType"); - writer.WriteStringValue(RouteType.Value.ToString()); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static VnetRoute DeserializeVnetRoute(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional startAddress = default; - Optional endAddress = default; - Optional routeType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("startAddress")) - { - startAddress = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("endAddress")) - { - endAddress = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("routeType")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - routeType = new RouteType(property0.Value.GetString()); - continue; - } - } - continue; - } - } - return new VnetRoute(id.Value, name.Value, kind.Value, type.Value, startAddress.Value, endAddress.Value, Optional.ToNullable(routeType)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.cs index f5f09fc8a0a7..5d89d8ccbcf9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetRoute.cs @@ -1,54 +1,99 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Virtual Network route contract used to pass routing information for a Virtual Network. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Virtual Network route contract used to pass routing information for a + /// Virtual Network. + /// + [Rest.Serialization.JsonTransformation] public partial class VnetRoute : ProxyOnlyResource { - /// Initializes a new instance of VnetRoute. + /// + /// Initializes a new instance of the VnetRoute class. + /// public VnetRoute() { + CustomInit(); } - /// Initializes a new instance of VnetRoute. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The starting address for this route. This may also include a CIDR notation, in which case the end address must not be specified. - /// The ending address for this route. If the start address is specified in CIDR notation, this must be omitted. - /// - /// The type of route this is: - /// DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + /// + /// Initializes a new instance of the VnetRoute class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The starting address for this route. + /// This may also include a CIDR notation, in which case the end + /// address must not be specified. + /// The ending address for this route. If the + /// start address is specified in CIDR notation, this must be + /// omitted. + /// The type of route this is: + /// DEFAULT - By default, every app has routes to the local address + /// ranges specified by RFC1918 /// INHERITED - Routes inherited from the real Virtual Network routes /// STATIC - Static route set on the app only - /// - /// These values will be used for syncing an app's routes with those from a Virtual Network. - /// - internal VnetRoute(string id, string name, string kind, string type, string startAddress, string endAddress, RouteType? routeType) : base(id, name, kind, type) + /// + /// These values will be used for syncing an app's routes with those + /// from a Virtual Network. Possible values include: 'DEFAULT', + /// 'INHERITED', 'STATIC' + public VnetRoute(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string startAddress = default(string), string endAddress = default(string), string routeType = default(string)) + : base(id, name, kind, type) { StartAddress = startAddress; EndAddress = endAddress; RouteType = routeType; + CustomInit(); } - /// The starting address for this route. This may also include a CIDR notation, in which case the end address must not be specified. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the starting address for this route. This may also + /// include a CIDR notation, in which case the end address must not be + /// specified. + /// + [JsonProperty(PropertyName = "properties.startAddress")] public string StartAddress { get; set; } - /// The ending address for this route. If the start address is specified in CIDR notation, this must be omitted. + + /// + /// Gets or sets the ending address for this route. If the start + /// address is specified in CIDR notation, this must be omitted. + /// + [JsonProperty(PropertyName = "properties.endAddress")] public string EndAddress { get; set; } + /// - /// The type of route this is: - /// DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + /// Gets or sets the type of route this is: + /// DEFAULT - By default, every app has routes to the local address + /// ranges specified by RFC1918 /// INHERITED - Routes inherited from the real Virtual Network routes /// STATIC - Static route set on the app only - /// - /// These values will be used for syncing an app's routes with those from a Virtual Network. + /// + /// These values will be used for syncing an app's routes with those + /// from a Virtual Network. Possible values include: 'DEFAULT', + /// 'INHERITED', 'STATIC' /// - public RouteType? RouteType { get; set; } + [JsonProperty(PropertyName = "properties.routeType")] + public string RouteType { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.Serialization.cs deleted file mode 100644 index 83200ae7fe3c..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.Serialization.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class VnetValidationFailureDetails : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"); - writer.WriteStringValue(Message); - } - if (Optional.IsDefined(Failed)) - { - writer.WritePropertyName("failed"); - writer.WriteBooleanValue(Failed.Value); - } - if (Optional.IsCollectionDefined(FailedTests)) - { - writer.WritePropertyName("failedTests"); - writer.WriteStartArray(); - foreach (var item in FailedTests) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Warnings)) - { - writer.WritePropertyName("warnings"); - writer.WriteStartArray(); - foreach (var item in Warnings) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static VnetValidationFailureDetails DeserializeVnetValidationFailureDetails(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional message = default; - Optional failed = default; - Optional> failedTests = default; - Optional> warnings = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("message")) - { - message = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("failed")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - failed = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("failedTests")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(VnetValidationTestFailure.DeserializeVnetValidationTestFailure(item)); - } - failedTests = array; - continue; - } - if (property0.NameEquals("warnings")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(VnetValidationTestFailure.DeserializeVnetValidationTestFailure(item)); - } - warnings = array; - continue; - } - } - continue; - } - } - return new VnetValidationFailureDetails(id.Value, name.Value, kind.Value, type.Value, message.Value, Optional.ToNullable(failed), Optional.ToList(failedTests), Optional.ToList(warnings)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs index dcb6234ff5b5..f72ab080b2cf 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs @@ -1,49 +1,73 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// A class that describes the reason for a validation failure. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A class that describes the reason for a validation failure. + /// + [Rest.Serialization.JsonTransformation] public partial class VnetValidationFailureDetails : ProxyOnlyResource { - /// Initializes a new instance of VnetValidationFailureDetails. + /// + /// Initializes a new instance of the VnetValidationFailureDetails + /// class. + /// public VnetValidationFailureDetails() { - FailedTests = new ChangeTrackingList(); - Warnings = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of VnetValidationFailureDetails. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Text describing the validation outcome. - /// A flag describing whether or not validation failed. - /// A list of tests that failed in the validation. - /// A list of warnings generated during validation. - internal VnetValidationFailureDetails(string id, string name, string kind, string type, string message, bool? failed, IList failedTests, IList warnings) : base(id, name, kind, type) + /// + /// Initializes a new instance of the VnetValidationFailureDetails + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// A flag describing whether or not validation + /// failed. + /// A list of tests that failed in the + /// validation. + public VnetValidationFailureDetails(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? failed = default(bool?), IList failedTests = default(IList)) + : base(id, name, kind, type) { - Message = message; Failed = failed; FailedTests = failedTests; - Warnings = warnings; + CustomInit(); } - /// Text describing the validation outcome. - public string Message { get; set; } - /// A flag describing whether or not validation failed. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a flag describing whether or not validation failed. + /// + [JsonProperty(PropertyName = "properties.failed")] public bool? Failed { get; set; } - /// A list of tests that failed in the validation. - public IList FailedTests { get; } - /// A list of warnings generated during validation. - public IList Warnings { get; } + + /// + /// Gets or sets a list of tests that failed in the validation. + /// + [JsonProperty(PropertyName = "properties.failedTests")] + public IList FailedTests { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.Serialization.cs deleted file mode 100644 index 6ac4b9925a91..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.Serialization.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class VnetValidationTestFailure : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(TestName)) - { - writer.WritePropertyName("testName"); - writer.WriteStringValue(TestName); - } - if (Optional.IsDefined(Details)) - { - writer.WritePropertyName("details"); - writer.WriteStringValue(Details); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static VnetValidationTestFailure DeserializeVnetValidationTestFailure(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional testName = default; - Optional details = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("testName")) - { - testName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("details")) - { - details = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new VnetValidationTestFailure(id.Value, name.Value, kind.Value, type.Value, testName.Value, details.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.cs index d2f0febba963..b0c504e4ebd9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationTestFailure.cs @@ -1,36 +1,70 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// A class that describes a test that failed during NSG and UDR validation. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A class that describes a test that failed during NSG and UDR + /// validation. + /// + [Rest.Serialization.JsonTransformation] public partial class VnetValidationTestFailure : ProxyOnlyResource { - /// Initializes a new instance of VnetValidationTestFailure. + /// + /// Initializes a new instance of the VnetValidationTestFailure class. + /// public VnetValidationTestFailure() { + CustomInit(); } - /// Initializes a new instance of VnetValidationTestFailure. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// The name of the test that failed. - /// The details of what caused the failure, e.g. the blocking rule name, etc. - internal VnetValidationTestFailure(string id, string name, string kind, string type, string testName, string details) : base(id, name, kind, type) + /// + /// Initializes a new instance of the VnetValidationTestFailure class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The name of the test that failed. + /// The details of what caused the failure, e.g. + /// the blocking rule name, etc. + public VnetValidationTestFailure(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string testName = default(string), string details = default(string)) + : base(id, name, kind, type) { TestName = testName; Details = details; + CustomInit(); } - /// The name of the test that failed. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the test that failed. + /// + [JsonProperty(PropertyName = "properties.testName")] public string TestName { get; set; } - /// The details of what caused the failure, e.g. the blocking rule name, etc. + + /// + /// Gets or sets the details of what caused the failure, e.g. the + /// blocking rule name, etc. + /// + [JsonProperty(PropertyName = "properties.details")] public string Details { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.Serialization.cs deleted file mode 100644 index 6c8a5c116afc..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class WebAppCollection - { - internal static WebAppCollection DeserializeWebAppCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(Site.DeserializeSite(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new WebAppCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.cs deleted file mode 100644 index 19b30d87c18e..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of App Service apps. - internal partial class WebAppCollection - { - /// Initializes a new instance of WebAppCollection. - /// Collection of resources. - /// is null. - internal WebAppCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of WebAppCollection. - /// Collection of resources. - /// Link to next page of resources. - internal WebAppCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.Serialization.cs deleted file mode 100644 index 0fb1bd6c0435..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class WebAppInstanceStatusCollection - { - internal static WebAppInstanceStatusCollection DeserializeWebAppInstanceStatusCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(WebSiteInstanceStatus.DeserializeWebSiteInstanceStatus(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new WebAppInstanceStatusCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.cs deleted file mode 100644 index a774393b9ea0..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppInstanceStatusCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of app instances. - internal partial class WebAppInstanceStatusCollection - { - /// Initializes a new instance of WebAppInstanceStatusCollection. - /// Collection of resources. - /// is null. - internal WebAppInstanceStatusCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of WebAppInstanceStatusCollection. - /// Collection of resources. - /// Link to next page of resources. - internal WebAppInstanceStatusCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.Serialization.cs deleted file mode 100644 index 66bddc2cd981..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class WebAppMajorVersion - { - internal static WebAppMajorVersion DeserializeWebAppMajorVersion(JsonElement element) - { - Optional displayText = default; - Optional value = default; - Optional> minorVersions = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("displayText")) - { - displayText = property.Value.GetString(); - continue; - } - if (property.NameEquals("value")) - { - value = property.Value.GetString(); - continue; - } - if (property.NameEquals("minorVersions")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(WebAppMinorVersion.DeserializeWebAppMinorVersion(item)); - } - minorVersions = array; - continue; - } - } - return new WebAppMajorVersion(displayText.Value, value.Value, Optional.ToList(minorVersions)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs deleted file mode 100644 index e0d0fdbef4a9..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Web App stack major version. - public partial class WebAppMajorVersion - { - /// Initializes a new instance of WebAppMajorVersion. - internal WebAppMajorVersion() - { - MinorVersions = new ChangeTrackingList(); - } - - /// Initializes a new instance of WebAppMajorVersion. - /// Web App stack major version (display only). - /// Web App stack major version name. - /// Minor versions associated with the major version. - internal WebAppMajorVersion(string displayText, string value, IReadOnlyList minorVersions) - { - DisplayText = displayText; - Value = value; - MinorVersions = minorVersions; - } - - /// Web App stack major version (display only). - public string DisplayText { get; } - /// Web App stack major version name. - public string Value { get; } - /// Minor versions associated with the major version. - public IReadOnlyList MinorVersions { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.Serialization.cs deleted file mode 100644 index 3cafbee51d13..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class WebAppMinorVersion - { - internal static WebAppMinorVersion DeserializeWebAppMinorVersion(JsonElement element) - { - Optional displayText = default; - Optional value = default; - Optional stackSettings = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("displayText")) - { - displayText = property.Value.GetString(); - continue; - } - if (property.NameEquals("value")) - { - value = property.Value.GetString(); - continue; - } - if (property.NameEquals("stackSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - stackSettings = WebAppRuntimes.DeserializeWebAppRuntimes(property.Value); - continue; - } - } - return new WebAppMinorVersion(displayText.Value, value.Value, stackSettings.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs deleted file mode 100644 index 24e0678d7351..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Web App stack minor version. - public partial class WebAppMinorVersion - { - /// Initializes a new instance of WebAppMinorVersion. - internal WebAppMinorVersion() - { - } - - /// Initializes a new instance of WebAppMinorVersion. - /// Web App stack minor version (display only). - /// Web App stack major version name. - /// Settings associated with the minor version. - internal WebAppMinorVersion(string displayText, string value, WebAppRuntimes stackSettings) - { - DisplayText = displayText; - Value = value; - StackSettings = stackSettings; - } - - /// Web App stack minor version (display only). - public string DisplayText { get; } - /// Web App stack major version name. - public string Value { get; } - /// Settings associated with the minor version. - public WebAppRuntimes StackSettings { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.Serialization.cs deleted file mode 100644 index 9baa7b2b1318..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.Serialization.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class WebAppRuntimeSettings - { - internal static WebAppRuntimeSettings DeserializeWebAppRuntimeSettings(JsonElement element) - { - Optional runtimeVersion = default; - Optional remoteDebuggingSupported = default; - Optional appInsightsSettings = default; - Optional gitHubActionSettings = default; - Optional isPreview = default; - Optional isDeprecated = default; - Optional isHidden = default; - Optional endOfLifeDate = default; - Optional isAutoUpdate = default; - Optional isEarlyAccess = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("runtimeVersion")) - { - runtimeVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("remoteDebuggingSupported")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - remoteDebuggingSupported = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("appInsightsSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - appInsightsSettings = AppInsightsWebAppStackSettings.DeserializeAppInsightsWebAppStackSettings(property.Value); - continue; - } - if (property.NameEquals("gitHubActionSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - gitHubActionSettings = GitHubActionWebAppStackSettings.DeserializeGitHubActionWebAppStackSettings(property.Value); - continue; - } - if (property.NameEquals("isPreview")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isPreview = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isDeprecated")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isDeprecated = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isHidden")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isHidden = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("endOfLifeDate")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - endOfLifeDate = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("isAutoUpdate")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isAutoUpdate = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isEarlyAccess")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isEarlyAccess = property.Value.GetBoolean(); - continue; - } - } - return new WebAppRuntimeSettings(runtimeVersion.Value, Optional.ToNullable(remoteDebuggingSupported), appInsightsSettings.Value, gitHubActionSettings.Value, Optional.ToNullable(isPreview), Optional.ToNullable(isDeprecated), Optional.ToNullable(isHidden), Optional.ToNullable(endOfLifeDate), Optional.ToNullable(isAutoUpdate), Optional.ToNullable(isEarlyAccess)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs deleted file mode 100644 index 55932dbe9e46..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Web App runtime settings. - public partial class WebAppRuntimeSettings - { - /// Initializes a new instance of WebAppRuntimeSettings. - internal WebAppRuntimeSettings() - { - } - - /// Initializes a new instance of WebAppRuntimeSettings. - /// Web App stack minor version (runtime only). - /// <code>true</code> if remote debugging is supported for the stack; otherwise, <code>false</code>. - /// Application Insights settings associated with the minor version. - /// GitHub Actions settings associated with the minor version. - /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. - /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. - /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. - /// End-of-life date for the minor version. - /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. - /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. - internal WebAppRuntimeSettings(string runtimeVersion, bool? remoteDebuggingSupported, AppInsightsWebAppStackSettings appInsightsSettings, GitHubActionWebAppStackSettings gitHubActionSettings, bool? isPreview, bool? isDeprecated, bool? isHidden, DateTimeOffset? endOfLifeDate, bool? isAutoUpdate, bool? isEarlyAccess) - { - RuntimeVersion = runtimeVersion; - RemoteDebuggingSupported = remoteDebuggingSupported; - AppInsightsSettings = appInsightsSettings; - GitHubActionSettings = gitHubActionSettings; - IsPreview = isPreview; - IsDeprecated = isDeprecated; - IsHidden = isHidden; - EndOfLifeDate = endOfLifeDate; - IsAutoUpdate = isAutoUpdate; - IsEarlyAccess = isEarlyAccess; - } - - /// Web App stack minor version (runtime only). - public string RuntimeVersion { get; } - /// <code>true</code> if remote debugging is supported for the stack; otherwise, <code>false</code>. - public bool? RemoteDebuggingSupported { get; } - /// Application Insights settings associated with the minor version. - public AppInsightsWebAppStackSettings AppInsightsSettings { get; } - /// GitHub Actions settings associated with the minor version. - public GitHubActionWebAppStackSettings GitHubActionSettings { get; } - /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. - public bool? IsPreview { get; } - /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. - public bool? IsDeprecated { get; } - /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. - public bool? IsHidden { get; } - /// End-of-life date for the minor version. - public DateTimeOffset? EndOfLifeDate { get; } - /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. - public bool? IsAutoUpdate { get; } - /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. - public bool? IsEarlyAccess { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.Serialization.cs deleted file mode 100644 index b938ebb848e7..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.Serialization.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class WebAppRuntimes - { - internal static WebAppRuntimes DeserializeWebAppRuntimes(JsonElement element) - { - Optional linuxRuntimeSettings = default; - Optional windowsRuntimeSettings = default; - Optional linuxContainerSettings = default; - Optional windowsContainerSettings = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("linuxRuntimeSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - linuxRuntimeSettings = WebAppRuntimeSettings.DeserializeWebAppRuntimeSettings(property.Value); - continue; - } - if (property.NameEquals("windowsRuntimeSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - windowsRuntimeSettings = WebAppRuntimeSettings.DeserializeWebAppRuntimeSettings(property.Value); - continue; - } - if (property.NameEquals("linuxContainerSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - linuxContainerSettings = LinuxJavaContainerSettings.DeserializeLinuxJavaContainerSettings(property.Value); - continue; - } - if (property.NameEquals("windowsContainerSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - windowsContainerSettings = WindowsJavaContainerSettings.DeserializeWindowsJavaContainerSettings(property.Value); - continue; - } - } - return new WebAppRuntimes(linuxRuntimeSettings.Value, windowsRuntimeSettings.Value, linuxContainerSettings.Value, windowsContainerSettings.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs deleted file mode 100644 index 63754660a688..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Web App stack runtimes. - public partial class WebAppRuntimes - { - /// Initializes a new instance of WebAppRuntimes. - internal WebAppRuntimes() - { - } - - /// Initializes a new instance of WebAppRuntimes. - /// Linux-specific settings associated with the minor version. - /// Windows-specific settings associated with the minor version. - /// Linux-specific settings associated with the Java container minor version. - /// Windows-specific settings associated with the Java container minor version. - internal WebAppRuntimes(WebAppRuntimeSettings linuxRuntimeSettings, WebAppRuntimeSettings windowsRuntimeSettings, LinuxJavaContainerSettings linuxContainerSettings, WindowsJavaContainerSettings windowsContainerSettings) - { - LinuxRuntimeSettings = linuxRuntimeSettings; - WindowsRuntimeSettings = windowsRuntimeSettings; - LinuxContainerSettings = linuxContainerSettings; - WindowsContainerSettings = windowsContainerSettings; - } - - /// Linux-specific settings associated with the minor version. - public WebAppRuntimeSettings LinuxRuntimeSettings { get; } - /// Windows-specific settings associated with the minor version. - public WebAppRuntimeSettings WindowsRuntimeSettings { get; } - /// Linux-specific settings associated with the Java container minor version. - public LinuxJavaContainerSettings LinuxContainerSettings { get; } - /// Windows-specific settings associated with the Java container minor version. - public WindowsJavaContainerSettings WindowsContainerSettings { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.Serialization.cs deleted file mode 100644 index fbe195f9d49b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.Serialization.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class WebAppStack : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static WebAppStack DeserializeWebAppStack(JsonElement element) - { - Optional location = default; - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional displayText = default; - Optional value = default; - Optional> majorVersions = default; - Optional preferredOs = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("displayText")) - { - displayText = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("value")) - { - value = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("majorVersions")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(WebAppMajorVersion.DeserializeWebAppMajorVersion(item)); - } - majorVersions = array; - continue; - } - if (property0.NameEquals("preferredOs")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - preferredOs = property0.Value.GetString().ToStackPreferredOs(); - continue; - } - } - continue; - } - } - return new WebAppStack(id.Value, name.Value, kind.Value, type.Value, location.Value, displayText.Value, value.Value, Optional.ToList(majorVersions), Optional.ToNullable(preferredOs)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs deleted file mode 100644 index 09d5925e0ae1..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Web App stack. - public partial class WebAppStack : ProxyOnlyResource - { - /// Initializes a new instance of WebAppStack. - public WebAppStack() - { - MajorVersions = new ChangeTrackingList(); - } - - /// Initializes a new instance of WebAppStack. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Web App stack location. - /// Web App stack (display only). - /// Web App stack name. - /// List of major versions available. - /// Web App stack preferred OS. - internal WebAppStack(string id, string name, string kind, string type, string location, string displayText, string value, IReadOnlyList majorVersions, StackPreferredOs? preferredOs) : base(id, name, kind, type) - { - Location = location; - DisplayText = displayText; - Value = value; - MajorVersions = majorVersions; - PreferredOs = preferredOs; - } - - /// Web App stack location. - public string Location { get; } - /// Web App stack (display only). - public string DisplayText { get; } - /// Web App stack name. - public string Value { get; } - /// List of major versions available. - public IReadOnlyList MajorVersions { get; } - /// Web App stack preferred OS. - public StackPreferredOs? PreferredOs { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.Serialization.cs deleted file mode 100644 index 0a1394e999d6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class WebAppStackCollection - { - internal static WebAppStackCollection DeserializeWebAppStackCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(WebAppStack.DeserializeWebAppStack(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new WebAppStackCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.cs deleted file mode 100644 index afb062d40534..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStackCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Web app Stacks. - internal partial class WebAppStackCollection - { - /// Initializes a new instance of WebAppStackCollection. - /// Collection of resources. - /// is null. - internal WebAppStackCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of WebAppStackCollection. - /// Collection of resources. - /// Link to next page of resources. - internal WebAppStackCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.Serialization.cs deleted file mode 100644 index f5032cea715b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.Serialization.cs +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class WebJob : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(RunCommand)) - { - writer.WritePropertyName("run_command"); - writer.WriteStringValue(RunCommand); - } - if (Optional.IsDefined(Url)) - { - writer.WritePropertyName("url"); - writer.WriteStringValue(Url); - } - if (Optional.IsDefined(ExtraInfoUrl)) - { - writer.WritePropertyName("extra_info_url"); - writer.WriteStringValue(ExtraInfoUrl); - } - if (Optional.IsDefined(WebJobType)) - { - writer.WritePropertyName("web_job_type"); - writer.WriteStringValue(WebJobType.Value.ToSerialString()); - } - if (Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"); - writer.WriteStringValue(Error); - } - if (Optional.IsDefined(UsingSdk)) - { - writer.WritePropertyName("using_sdk"); - writer.WriteBooleanValue(UsingSdk.Value); - } - if (Optional.IsCollectionDefined(Settings)) - { - writer.WritePropertyName("settings"); - writer.WriteStartObject(); - foreach (var item in Settings) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static WebJob DeserializeWebJob(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional runCommand = default; - Optional url = default; - Optional extraInfoUrl = default; - Optional webJobType = default; - Optional error = default; - Optional usingSdk = default; - Optional> settings = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("run_command")) - { - runCommand = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("url")) - { - url = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("extra_info_url")) - { - extraInfoUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("web_job_type")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - webJobType = property0.Value.GetString().ToWebJobType(); - continue; - } - if (property0.NameEquals("error")) - { - error = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("using_sdk")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - usingSdk = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("settings")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetObject()); - } - settings = dictionary; - continue; - } - } - continue; - } - } - return new WebJob(id.Value, name.Value, kind.Value, type.Value, runCommand.Value, url.Value, extraInfoUrl.Value, Optional.ToNullable(webJobType), error.Value, Optional.ToNullable(usingSdk), Optional.ToDictionary(settings)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.cs index 0b90766b1def..588aa9240332 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJob.cs @@ -1,37 +1,53 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Web Job Information. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Web Job Information. + /// + [Rest.Serialization.JsonTransformation] public partial class WebJob : ProxyOnlyResource { - /// Initializes a new instance of WebJob. + /// + /// Initializes a new instance of the WebJob class. + /// public WebJob() { - Settings = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of WebJob. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Run command. - /// Job URL. - /// Extra Info URL. - /// Job type. - /// Error information. - /// Using SDK?. - /// Job settings. - internal WebJob(string id, string name, string kind, string type, string runCommand, string url, string extraInfoUrl, WebJobType? webJobType, string error, bool? usingSdk, IDictionary settings) : base(id, name, kind, type) + /// + /// Initializes a new instance of the WebJob class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Run command. + /// Job URL. + /// Extra Info URL. + /// Job type. Possible values include: + /// 'Continuous', 'Triggered' + /// Error information. + /// Using SDK? + /// Job settings. + public WebJob(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string runCommand = default(string), string url = default(string), string extraInfoUrl = default(string), WebJobType? webJobType = default(WebJobType?), string error = default(string), bool? usingSdk = default(bool?), IDictionary settings = default(IDictionary)) + : base(id, name, kind, type) { RunCommand = runCommand; Url = url; @@ -40,21 +56,56 @@ internal WebJob(string id, string name, string kind, string type, string runComm Error = error; UsingSdk = usingSdk; Settings = settings; + CustomInit(); } - /// Run command. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets run command. + /// + [JsonProperty(PropertyName = "properties.run_command")] public string RunCommand { get; set; } - /// Job URL. + + /// + /// Gets or sets job URL. + /// + [JsonProperty(PropertyName = "properties.url")] public string Url { get; set; } - /// Extra Info URL. + + /// + /// Gets or sets extra Info URL. + /// + [JsonProperty(PropertyName = "properties.extra_info_url")] public string ExtraInfoUrl { get; set; } - /// Job type. + + /// + /// Gets or sets job type. Possible values include: 'Continuous', + /// 'Triggered' + /// + [JsonProperty(PropertyName = "properties.web_job_type")] public WebJobType? WebJobType { get; set; } - /// Error information. + + /// + /// Gets or sets error information. + /// + [JsonProperty(PropertyName = "properties.error")] public string Error { get; set; } - /// Using SDK?. + + /// + /// Gets or sets using SDK? + /// + [JsonProperty(PropertyName = "properties.using_sdk")] public bool? UsingSdk { get; set; } - /// Job settings. - public IDictionary Settings { get; } + + /// + /// Gets or sets job settings. + /// + [JsonProperty(PropertyName = "properties.settings")] + public IDictionary Settings { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.Serialization.cs deleted file mode 100644 index 766f0f6d6332..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class WebJobCollection - { - internal static WebJobCollection DeserializeWebJobCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(WebJob.DeserializeWebJob(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new WebJobCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.cs deleted file mode 100644 index 4653eb18e865..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of Kudu web job information elements. - internal partial class WebJobCollection - { - /// Initializes a new instance of WebJobCollection. - /// Collection of resources. - /// is null. - internal WebJobCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of WebJobCollection. - /// Collection of resources. - /// Link to next page of resources. - internal WebJobCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.Serialization.cs deleted file mode 100644 index 21cedd3a17df..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class WebJobTypeExtensions - { - public static string ToSerialString(this WebJobType value) => value switch - { - WebJobType.Continuous => "Continuous", - WebJobType.Triggered => "Triggered", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown WebJobType value.") - }; - - public static WebJobType ToWebJobType(this string value) - { - if (string.Equals(value, "Continuous", StringComparison.InvariantCultureIgnoreCase)) return WebJobType.Continuous; - if (string.Equals(value, "Triggered", StringComparison.InvariantCultureIgnoreCase)) return WebJobType.Triggered; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown WebJobType value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.cs index 018b1dd03102..e8520fd920fe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebJobType.cs @@ -1,18 +1,60 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Job type. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for WebJobType. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum WebJobType { - /// Continuous. + [EnumMember(Value = "Continuous")] Continuous, - /// Triggered. + [EnumMember(Value = "Triggered")] Triggered } + internal static class WebJobTypeEnumExtension + { + internal static string ToSerializedValue(this WebJobType? value) + { + return value == null ? null : ((WebJobType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this WebJobType value) + { + switch( value ) + { + case WebJobType.Continuous: + return "Continuous"; + case WebJobType.Triggered: + return "Triggered"; + } + return null; + } + + internal static WebJobType? ParseWebJobType(this string value) + { + switch( value ) + { + case "Continuous": + return WebJobType.Continuous; + case "Triggered": + return WebJobType.Triggered; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.Serialization.cs deleted file mode 100644 index 8215032581fe..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.Serialization.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class WebSiteInstanceStatus : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(State)) - { - writer.WritePropertyName("state"); - writer.WriteStringValue(State.Value.ToSerialString()); - } - if (Optional.IsDefined(StatusUrl)) - { - writer.WritePropertyName("statusUrl"); - writer.WriteStringValue(StatusUrl); - } - if (Optional.IsDefined(DetectorUrl)) - { - writer.WritePropertyName("detectorUrl"); - writer.WriteStringValue(DetectorUrl); - } - if (Optional.IsDefined(ConsoleUrl)) - { - writer.WritePropertyName("consoleUrl"); - writer.WriteStringValue(ConsoleUrl); - } - if (Optional.IsDefined(HealthCheckUrl)) - { - writer.WritePropertyName("healthCheckUrl"); - writer.WriteStringValue(HealthCheckUrl); - } - if (Optional.IsCollectionDefined(Containers)) - { - writer.WritePropertyName("containers"); - writer.WriteStartObject(); - foreach (var item in Containers) - { - writer.WritePropertyName(item.Key); - writer.WriteObjectValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static WebSiteInstanceStatus DeserializeWebSiteInstanceStatus(JsonElement element) - { - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional state = default; - Optional statusUrl = default; - Optional detectorUrl = default; - Optional consoleUrl = default; - Optional healthCheckUrl = default; - Optional> containers = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("state")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - state = property0.Value.GetString().ToSiteRuntimeState(); - continue; - } - if (property0.NameEquals("statusUrl")) - { - statusUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("detectorUrl")) - { - detectorUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("consoleUrl")) - { - consoleUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("healthCheckUrl")) - { - healthCheckUrl = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("containers")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, ContainerInfo.DeserializeContainerInfo(property1.Value)); - } - containers = dictionary; - continue; - } - } - continue; - } - } - return new WebSiteInstanceStatus(id.Value, name.Value, kind.Value, type.Value, Optional.ToNullable(state), statusUrl.Value, detectorUrl.Value, consoleUrl.Value, healthCheckUrl.Value, Optional.ToDictionary(containers)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.cs index 6b0a7b965842..c9e91df2ae59 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebSiteInstanceStatus.cs @@ -1,36 +1,51 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// The WebSiteInstanceStatus. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + [Rest.Serialization.JsonTransformation] public partial class WebSiteInstanceStatus : ProxyOnlyResource { - /// Initializes a new instance of WebSiteInstanceStatus. + /// + /// Initializes a new instance of the WebSiteInstanceStatus class. + /// public WebSiteInstanceStatus() { - Containers = new ChangeTrackingDictionary(); + CustomInit(); } - /// Initializes a new instance of WebSiteInstanceStatus. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// . - /// Link to the GetStatusApi in Kudu. - /// Link to the Diagnose and Solve Portal. - /// Link to the console to web app instance. - /// Link to the console to web app instance. - /// Dictionary of <ContainerInfo>. - internal WebSiteInstanceStatus(string id, string name, string kind, string type, SiteRuntimeState? state, string statusUrl, string detectorUrl, string consoleUrl, string healthCheckUrl, IDictionary containers) : base(id, name, kind, type) + /// + /// Initializes a new instance of the WebSiteInstanceStatus class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Possible values include: 'READY', 'STOPPED', + /// 'UNKNOWN' + /// Link to the GetStatusApi in Kudu + /// Link to the Diagnose and Solve + /// Portal + /// Link to the console to web app + /// instance + /// Link to the console to web app + /// instance + public WebSiteInstanceStatus(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), SiteRuntimeState? state = default(SiteRuntimeState?), string statusUrl = default(string), string detectorUrl = default(string), string consoleUrl = default(string), string healthCheckUrl = default(string), IDictionary containers = default(IDictionary)) + : base(id, name, kind, type) { State = state; StatusUrl = statusUrl; @@ -38,18 +53,48 @@ internal WebSiteInstanceStatus(string id, string name, string kind, string type, ConsoleUrl = consoleUrl; HealthCheckUrl = healthCheckUrl; Containers = containers; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'READY', 'STOPPED', 'UNKNOWN' + /// + [JsonProperty(PropertyName = "properties.state")] public SiteRuntimeState? State { get; set; } - /// Link to the GetStatusApi in Kudu. + + /// + /// Gets or sets link to the GetStatusApi in Kudu + /// + [JsonProperty(PropertyName = "properties.statusUrl")] public string StatusUrl { get; set; } - /// Link to the Diagnose and Solve Portal. + + /// + /// Gets or sets link to the Diagnose and Solve Portal + /// + [JsonProperty(PropertyName = "properties.detectorUrl")] public string DetectorUrl { get; set; } - /// Link to the console to web app instance. + + /// + /// Gets or sets link to the console to web app instance + /// + [JsonProperty(PropertyName = "properties.consoleUrl")] public string ConsoleUrl { get; set; } - /// Link to the console to web app instance. + + /// + /// Gets or sets link to the console to web app instance + /// + [JsonProperty(PropertyName = "properties.healthCheckUrl")] public string HealthCheckUrl { get; set; } - /// Dictionary of <ContainerInfo>. - public IDictionary Containers { get; } + + /// + /// + [JsonProperty(PropertyName = "properties.containers")] + public IDictionary Containers { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.Serialization.cs deleted file mode 100644 index 2a97024f1110..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.Serialization.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class WindowsJavaContainerSettings - { - internal static WindowsJavaContainerSettings DeserializeWindowsJavaContainerSettings(JsonElement element) - { - Optional javaContainer = default; - Optional javaContainerVersion = default; - Optional isPreview = default; - Optional isDeprecated = default; - Optional isHidden = default; - Optional endOfLifeDate = default; - Optional isAutoUpdate = default; - Optional isEarlyAccess = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("javaContainer")) - { - javaContainer = property.Value.GetString(); - continue; - } - if (property.NameEquals("javaContainerVersion")) - { - javaContainerVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("isPreview")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isPreview = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isDeprecated")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isDeprecated = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isHidden")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isHidden = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("endOfLifeDate")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - endOfLifeDate = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("isAutoUpdate")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isAutoUpdate = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("isEarlyAccess")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isEarlyAccess = property.Value.GetBoolean(); - continue; - } - } - return new WindowsJavaContainerSettings(javaContainer.Value, javaContainerVersion.Value, Optional.ToNullable(isPreview), Optional.ToNullable(isDeprecated), Optional.ToNullable(isHidden), Optional.ToNullable(endOfLifeDate), Optional.ToNullable(isAutoUpdate), Optional.ToNullable(isEarlyAccess)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs deleted file mode 100644 index f3f61c18520d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Windows Java Container settings. - public partial class WindowsJavaContainerSettings - { - /// Initializes a new instance of WindowsJavaContainerSettings. - internal WindowsJavaContainerSettings() - { - } - - /// Initializes a new instance of WindowsJavaContainerSettings. - /// Java container (runtime only). - /// Java container version (runtime only). - /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. - /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. - /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. - /// End-of-life date for the minor version. - /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. - /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. - internal WindowsJavaContainerSettings(string javaContainer, string javaContainerVersion, bool? isPreview, bool? isDeprecated, bool? isHidden, DateTimeOffset? endOfLifeDate, bool? isAutoUpdate, bool? isEarlyAccess) - { - JavaContainer = javaContainer; - JavaContainerVersion = javaContainerVersion; - IsPreview = isPreview; - IsDeprecated = isDeprecated; - IsHidden = isHidden; - EndOfLifeDate = endOfLifeDate; - IsAutoUpdate = isAutoUpdate; - IsEarlyAccess = isEarlyAccess; - } - - /// Java container (runtime only). - public string JavaContainer { get; } - /// Java container version (runtime only). - public string JavaContainerVersion { get; } - /// <code>true</code> if the stack is in preview; otherwise, <code>false</code>. - public bool? IsPreview { get; } - /// <code>true</code> if the stack is deprecated; otherwise, <code>false</code>. - public bool? IsDeprecated { get; } - /// <code>true</code> if the stack should be hidden; otherwise, <code>false</code>. - public bool? IsHidden { get; } - /// End-of-life date for the minor version. - public DateTimeOffset? EndOfLifeDate { get; } - /// <code>true</code> if the stack version is auto-updated; otherwise, <code>false</code>. - public bool? IsAutoUpdate { get; } - /// <code>true</code> if the minor version is early-access; otherwise, <code>false</code>. - public bool? IsEarlyAccess { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.Serialization.cs deleted file mode 100644 index 78b359c49039..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal partial class WorkerPoolCollection - { - internal static WorkerPoolCollection DeserializeWorkerPoolCollection(JsonElement element) - { - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(WorkerPoolResource.DeserializeWorkerPoolResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new WorkerPoolCollection(value, nextLink.Value); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.cs deleted file mode 100644 index 8bbef56fbdf5..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - /// Collection of worker pools. - internal partial class WorkerPoolCollection - { - /// Initializes a new instance of WorkerPoolCollection. - /// Collection of resources. - /// is null. - internal WorkerPoolCollection(IEnumerable value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value.ToList(); - } - - /// Initializes a new instance of WorkerPoolCollection. - /// Collection of resources. - /// Link to next page of resources. - internal WorkerPoolCollection(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of resources. - public IReadOnlyList Value { get; } - /// Link to next page of resources. - public string NextLink { get; } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.Serialization.cs deleted file mode 100644 index d8307eb5bcc6..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.Serialization.cs +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - public partial class WorkerPoolResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"); - writer.WriteObjectValue(Sku); - } - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(WorkerSizeId)) - { - writer.WritePropertyName("workerSizeId"); - writer.WriteNumberValue(WorkerSizeId.Value); - } - if (Optional.IsDefined(ComputeMode)) - { - writer.WritePropertyName("computeMode"); - writer.WriteStringValue(ComputeMode.Value.ToSerialString()); - } - if (Optional.IsDefined(WorkerSize)) - { - writer.WritePropertyName("workerSize"); - writer.WriteStringValue(WorkerSize); - } - if (Optional.IsDefined(WorkerCount)) - { - writer.WritePropertyName("workerCount"); - writer.WriteNumberValue(WorkerCount.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static WorkerPoolResource DeserializeWorkerPoolResource(JsonElement element) - { - Optional sku = default; - Optional id = default; - Optional name = default; - Optional kind = default; - Optional type = default; - Optional workerSizeId = default; - Optional computeMode = default; - Optional workerSize = default; - Optional workerCount = default; - Optional> instanceNames = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sku")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - sku = SkuDescription.DeserializeSkuDescription(property.Value); - continue; - } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("kind")) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("workerSizeId")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - workerSizeId = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("computeMode")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - computeMode = property0.Value.GetString().ToComputeModeOptions(); - continue; - } - if (property0.NameEquals("workerSize")) - { - workerSize = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("workerCount")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - workerCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("instanceNames")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - instanceNames = array; - continue; - } - } - continue; - } - } - return new WorkerPoolResource(id.Value, name.Value, kind.Value, type.Value, sku.Value, Optional.ToNullable(workerSizeId), Optional.ToNullable(computeMode), workerSize.Value, Optional.ToNullable(workerCount), Optional.ToList(instanceNames)); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.cs index 5d9de4d88cfb..1fc210ba63f6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPoolResource.cs @@ -1,56 +1,105 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; +// 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.WebSites.Models { - /// Worker pool of an App Service Environment ARM resource. + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Worker pool of an App Service Environment ARM resource. + /// + [Rest.Serialization.JsonTransformation] public partial class WorkerPoolResource : ProxyOnlyResource { - /// Initializes a new instance of WorkerPoolResource. + /// + /// Initializes a new instance of the WorkerPoolResource class. + /// public WorkerPoolResource() { - InstanceNames = new ChangeTrackingList(); + CustomInit(); } - /// Initializes a new instance of WorkerPoolResource. - /// Resource Id. - /// Resource Name. - /// Kind of resource. - /// Resource type. - /// Description of a SKU for a scalable resource. - /// Worker size ID for referencing this worker pool. - /// Shared or dedicated app hosting. - /// VM size of the worker pool instances. - /// Number of instances in the worker pool. - /// Names of all instances in the worker pool (read only). - internal WorkerPoolResource(string id, string name, string kind, string type, SkuDescription sku, int? workerSizeId, ComputeModeOptions? computeMode, string workerSize, int? workerCount, IReadOnlyList instanceNames) : base(id, name, kind, type) + /// + /// Initializes a new instance of the WorkerPoolResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Worker size ID for referencing this + /// worker pool. + /// Shared or dedicated app hosting. Possible + /// values include: 'Shared', 'Dedicated', 'Dynamic' + /// VM size of the worker pool + /// instances. + /// Number of instances in the worker + /// pool. + /// Names of all instances in the worker + /// pool (read only). + public WorkerPoolResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? workerSizeId = default(int?), ComputeModeOptions? computeMode = default(ComputeModeOptions?), string workerSize = default(string), int? workerCount = default(int?), IList instanceNames = default(IList), SkuDescription sku = default(SkuDescription)) + : base(id, name, kind, type) { - Sku = sku; WorkerSizeId = workerSizeId; ComputeMode = computeMode; WorkerSize = workerSize; WorkerCount = workerCount; InstanceNames = instanceNames; + Sku = sku; + CustomInit(); } - /// Description of a SKU for a scalable resource. - public SkuDescription Sku { get; set; } - /// Worker size ID for referencing this worker pool. + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets worker size ID for referencing this worker pool. + /// + [JsonProperty(PropertyName = "properties.workerSizeId")] public int? WorkerSizeId { get; set; } - /// Shared or dedicated app hosting. + + /// + /// Gets or sets shared or dedicated app hosting. Possible values + /// include: 'Shared', 'Dedicated', 'Dynamic' + /// + [JsonProperty(PropertyName = "properties.computeMode")] public ComputeModeOptions? ComputeMode { get; set; } - /// VM size of the worker pool instances. + + /// + /// Gets or sets VM size of the worker pool instances. + /// + [JsonProperty(PropertyName = "properties.workerSize")] public string WorkerSize { get; set; } - /// Number of instances in the worker pool. + + /// + /// Gets or sets number of instances in the worker pool. + /// + [JsonProperty(PropertyName = "properties.workerCount")] public int? WorkerCount { get; set; } - /// Names of all instances in the worker pool (read only). - public IReadOnlyList InstanceNames { get; } + + /// + /// Gets names of all instances in the worker pool (read only). + /// + [JsonProperty(PropertyName = "properties.instanceNames")] + public IList InstanceNames { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public SkuDescription Sku { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.Serialization.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.Serialization.cs deleted file mode 100644 index 34c55f9e2868..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.Serialization.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Microsoft.Azure.Management.WebSites.Models -{ - internal static partial class WorkerSizeOptionsExtensions - { - public static string ToSerialString(this WorkerSizeOptions value) => value switch - { - WorkerSizeOptions.Small => "Small", - WorkerSizeOptions.Medium => "Medium", - WorkerSizeOptions.Large => "Large", - WorkerSizeOptions.D1 => "D1", - WorkerSizeOptions.D2 => "D2", - WorkerSizeOptions.D3 => "D3", - WorkerSizeOptions.SmallV3 => "SmallV3", - WorkerSizeOptions.MediumV3 => "MediumV3", - WorkerSizeOptions.LargeV3 => "LargeV3", - WorkerSizeOptions.NestedSmall => "NestedSmall", - WorkerSizeOptions.NestedSmallLinux => "NestedSmallLinux", - WorkerSizeOptions.Default => "Default", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown WorkerSizeOptions value.") - }; - - public static WorkerSizeOptions ToWorkerSizeOptions(this string value) - { - if (string.Equals(value, "Small", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.Small; - if (string.Equals(value, "Medium", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.Medium; - if (string.Equals(value, "Large", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.Large; - if (string.Equals(value, "D1", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.D1; - if (string.Equals(value, "D2", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.D2; - if (string.Equals(value, "D3", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.D3; - if (string.Equals(value, "SmallV3", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.SmallV3; - if (string.Equals(value, "MediumV3", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.MediumV3; - if (string.Equals(value, "LargeV3", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.LargeV3; - if (string.Equals(value, "NestedSmall", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.NestedSmall; - if (string.Equals(value, "NestedSmallLinux", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.NestedSmallLinux; - if (string.Equals(value, "Default", StringComparison.InvariantCultureIgnoreCase)) return WorkerSizeOptions.Default; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown WorkerSizeOptions value."); - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs index f2741121999d..32d869df6f66 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs @@ -1,38 +1,96 @@ +// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable +// 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.WebSites.Models { - /// Size of the machines. + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for WorkerSizeOptions. + /// + [JsonConverter(typeof(StringEnumConverter))] public enum WorkerSizeOptions { - /// Small. + [EnumMember(Value = "Small")] Small, - /// Medium. + [EnumMember(Value = "Medium")] Medium, - /// Large. + [EnumMember(Value = "Large")] Large, - /// D1. + [EnumMember(Value = "D1")] D1, - /// D2. + [EnumMember(Value = "D2")] D2, - /// D3. + [EnumMember(Value = "D3")] D3, - /// SmallV3. - SmallV3, - /// MediumV3. - MediumV3, - /// LargeV3. - LargeV3, - /// NestedSmall. + [EnumMember(Value = "NestedSmall")] NestedSmall, - /// NestedSmallLinux. - NestedSmallLinux, - /// Default. + [EnumMember(Value = "Default")] Default } + internal static class WorkerSizeOptionsEnumExtension + { + internal static string ToSerializedValue(this WorkerSizeOptions? value) + { + return value == null ? null : ((WorkerSizeOptions)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this WorkerSizeOptions value) + { + switch( value ) + { + case WorkerSizeOptions.Small: + return "Small"; + case WorkerSizeOptions.Medium: + return "Medium"; + case WorkerSizeOptions.Large: + return "Large"; + case WorkerSizeOptions.D1: + return "D1"; + case WorkerSizeOptions.D2: + return "D2"; + case WorkerSizeOptions.D3: + return "D3"; + case WorkerSizeOptions.NestedSmall: + return "NestedSmall"; + case WorkerSizeOptions.Default: + return "Default"; + } + return null; + } + + internal static WorkerSizeOptions? ParseWorkerSizeOptions(this string value) + { + switch( value ) + { + case "Small": + return WorkerSizeOptions.Small; + case "Medium": + return WorkerSizeOptions.Medium; + case "Large": + return WorkerSizeOptions.Large; + case "D1": + return WorkerSizeOptions.D1; + case "D2": + return WorkerSizeOptions.D2; + case "D3": + return WorkerSizeOptions.D3; + case "NestedSmall": + return WorkerSizeOptions.NestedSmall; + case "Default": + return WorkerSizeOptions.Default; + } + return null; + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderRestClient.cs deleted file mode 100644 index 18710db1fc38..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderRestClient.cs +++ /dev/null @@ -1,1002 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class ProviderRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of ProviderRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public ProviderRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateGetAvailableStacksRequest(Enum4? osTypeSelected) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.Web/availableStacks", false); - if (osTypeSelected != null) - { - uri.AppendQuery("osTypeSelected", osTypeSelected.Value.ToString(), true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available application frameworks and their versions. - /// The Enum4 to use. - /// The cancellation token to use. - public async Task> GetAvailableStacksAsync(Enum4? osTypeSelected = null, CancellationToken cancellationToken = default) - { - using var message = CreateGetAvailableStacksRequest(osTypeSelected); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApplicationStackCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available application frameworks and their versions. - /// The Enum4 to use. - /// The cancellation token to use. - public Response GetAvailableStacks(Enum4? osTypeSelected = null, CancellationToken cancellationToken = default) - { - using var message = CreateGetAvailableStacksRequest(osTypeSelected); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApplicationStackCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetFunctionAppStacksRequest(Enum5? stackOsType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.Web/functionAppStacks", false); - if (stackOsType != null) - { - uri.AppendQuery("stackOsType", stackOsType.Value.ToString(), true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available Function app frameworks and their versions. - /// Stack OS Type. - /// The cancellation token to use. - public async Task> GetFunctionAppStacksAsync(Enum5? stackOsType = null, CancellationToken cancellationToken = default) - { - using var message = CreateGetFunctionAppStacksRequest(stackOsType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionAppStackCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available Function app frameworks and their versions. - /// Stack OS Type. - /// The cancellation token to use. - public Response GetFunctionAppStacks(Enum5? stackOsType = null, CancellationToken cancellationToken = default) - { - using var message = CreateGetFunctionAppStacksRequest(stackOsType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionAppStackCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetFunctionAppStacksForLocationRequest(string location, Enum6? stackOsType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.Web/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/functionAppStacks", false); - if (stackOsType != null) - { - uri.AppendQuery("stackOsType", stackOsType.Value.ToString(), true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available Function app frameworks and their versions for location. - /// Function App stack location. - /// Stack OS Type. - /// The cancellation token to use. - /// is null. - public async Task> GetFunctionAppStacksForLocationAsync(string location, Enum6? stackOsType = null, CancellationToken cancellationToken = default) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - using var message = CreateGetFunctionAppStacksForLocationRequest(location, stackOsType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionAppStackCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available Function app frameworks and their versions for location. - /// Function App stack location. - /// Stack OS Type. - /// The cancellation token to use. - /// is null. - public Response GetFunctionAppStacksForLocation(string location, Enum6? stackOsType = null, CancellationToken cancellationToken = default) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - using var message = CreateGetFunctionAppStacksForLocationRequest(location, stackOsType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionAppStackCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetWebAppStacksForLocationRequest(string location, Enum7? stackOsType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.Web/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/webAppStacks", false); - if (stackOsType != null) - { - uri.AppendQuery("stackOsType", stackOsType.Value.ToString(), true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available Web app frameworks and their versions for location. - /// Web App stack location. - /// Stack OS Type. - /// The cancellation token to use. - /// is null. - public async Task> GetWebAppStacksForLocationAsync(string location, Enum7? stackOsType = null, CancellationToken cancellationToken = default) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - using var message = CreateGetWebAppStacksForLocationRequest(location, stackOsType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppStackCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available Web app frameworks and their versions for location. - /// Web App stack location. - /// Stack OS Type. - /// The cancellation token to use. - /// is null. - public Response GetWebAppStacksForLocation(string location, Enum7? stackOsType = null, CancellationToken cancellationToken = default) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - using var message = CreateGetWebAppStacksForLocationRequest(location, stackOsType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppStackCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOperationsRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.Web/operations", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - /// The cancellation token to use. - public async Task> ListOperationsAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListOperationsRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmOperationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - /// The cancellation token to use. - public Response ListOperations(CancellationToken cancellationToken = default) - { - using var message = CreateListOperationsRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmOperationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetWebAppStacksRequest(Enum8? stackOsType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.Web/webAppStacks", false); - if (stackOsType != null) - { - uri.AppendQuery("stackOsType", stackOsType.Value.ToString(), true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available Web app frameworks and their versions. - /// Stack OS Type. - /// The cancellation token to use. - public async Task> GetWebAppStacksAsync(Enum8? stackOsType = null, CancellationToken cancellationToken = default) - { - using var message = CreateGetWebAppStacksRequest(stackOsType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppStackCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available Web app frameworks and their versions. - /// Stack OS Type. - /// The cancellation token to use. - public Response GetWebAppStacks(Enum8? stackOsType = null, CancellationToken cancellationToken = default) - { - using var message = CreateGetWebAppStacksRequest(stackOsType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppStackCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAvailableStacksOnPremRequest(Enum9? osTypeSelected) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/availableStacks", false); - if (osTypeSelected != null) - { - uri.AppendQuery("osTypeSelected", osTypeSelected.Value.ToString(), true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available application frameworks and their versions. - /// The Enum9 to use. - /// The cancellation token to use. - public async Task> GetAvailableStacksOnPremAsync(Enum9? osTypeSelected = null, CancellationToken cancellationToken = default) - { - using var message = CreateGetAvailableStacksOnPremRequest(osTypeSelected); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApplicationStackCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available application frameworks and their versions. - /// The Enum9 to use. - /// The cancellation token to use. - public Response GetAvailableStacksOnPrem(Enum9? osTypeSelected = null, CancellationToken cancellationToken = default) - { - using var message = CreateGetAvailableStacksOnPremRequest(osTypeSelected); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApplicationStackCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAvailableStacksNextPageRequest(string nextLink, Enum4? osTypeSelected) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available application frameworks and their versions. - /// The URL to the next page of results. - /// The Enum4 to use. - /// The cancellation token to use. - /// is null. - public async Task> GetAvailableStacksNextPageAsync(string nextLink, Enum4? osTypeSelected = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateGetAvailableStacksNextPageRequest(nextLink, osTypeSelected); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApplicationStackCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available application frameworks and their versions. - /// The URL to the next page of results. - /// The Enum4 to use. - /// The cancellation token to use. - /// is null. - public Response GetAvailableStacksNextPage(string nextLink, Enum4? osTypeSelected = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateGetAvailableStacksNextPageRequest(nextLink, osTypeSelected); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApplicationStackCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetFunctionAppStacksNextPageRequest(string nextLink, Enum5? stackOsType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available Function app frameworks and their versions. - /// The URL to the next page of results. - /// Stack OS Type. - /// The cancellation token to use. - /// is null. - public async Task> GetFunctionAppStacksNextPageAsync(string nextLink, Enum5? stackOsType = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateGetFunctionAppStacksNextPageRequest(nextLink, stackOsType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionAppStackCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available Function app frameworks and their versions. - /// The URL to the next page of results. - /// Stack OS Type. - /// The cancellation token to use. - /// is null. - public Response GetFunctionAppStacksNextPage(string nextLink, Enum5? stackOsType = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateGetFunctionAppStacksNextPageRequest(nextLink, stackOsType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionAppStackCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetFunctionAppStacksForLocationNextPageRequest(string nextLink, string location, Enum6? stackOsType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available Function app frameworks and their versions for location. - /// The URL to the next page of results. - /// Function App stack location. - /// Stack OS Type. - /// The cancellation token to use. - /// or is null. - public async Task> GetFunctionAppStacksForLocationNextPageAsync(string nextLink, string location, Enum6? stackOsType = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - using var message = CreateGetFunctionAppStacksForLocationNextPageRequest(nextLink, location, stackOsType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionAppStackCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available Function app frameworks and their versions for location. - /// The URL to the next page of results. - /// Function App stack location. - /// Stack OS Type. - /// The cancellation token to use. - /// or is null. - public Response GetFunctionAppStacksForLocationNextPage(string nextLink, string location, Enum6? stackOsType = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - using var message = CreateGetFunctionAppStacksForLocationNextPageRequest(nextLink, location, stackOsType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionAppStackCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionAppStackCollection.DeserializeFunctionAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetWebAppStacksForLocationNextPageRequest(string nextLink, string location, Enum7? stackOsType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available Web app frameworks and their versions for location. - /// The URL to the next page of results. - /// Web App stack location. - /// Stack OS Type. - /// The cancellation token to use. - /// or is null. - public async Task> GetWebAppStacksForLocationNextPageAsync(string nextLink, string location, Enum7? stackOsType = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - using var message = CreateGetWebAppStacksForLocationNextPageRequest(nextLink, location, stackOsType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppStackCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available Web app frameworks and their versions for location. - /// The URL to the next page of results. - /// Web App stack location. - /// Stack OS Type. - /// The cancellation token to use. - /// or is null. - public Response GetWebAppStacksForLocationNextPage(string nextLink, string location, Enum7? stackOsType = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - using var message = CreateGetWebAppStacksForLocationNextPageRequest(nextLink, location, stackOsType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppStackCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOperationsNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListOperationsNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListOperationsNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmOperationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListOperationsNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListOperationsNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmOperationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmOperationCollection.DeserializeCsmOperationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetWebAppStacksNextPageRequest(string nextLink, Enum8? stackOsType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available Web app frameworks and their versions. - /// The URL to the next page of results. - /// Stack OS Type. - /// The cancellation token to use. - /// is null. - public async Task> GetWebAppStacksNextPageAsync(string nextLink, Enum8? stackOsType = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateGetWebAppStacksNextPageRequest(nextLink, stackOsType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppStackCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available Web app frameworks and their versions. - /// The URL to the next page of results. - /// Stack OS Type. - /// The cancellation token to use. - /// is null. - public Response GetWebAppStacksNextPage(string nextLink, Enum8? stackOsType = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateGetWebAppStacksNextPageRequest(nextLink, stackOsType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppStackCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppStackCollection.DeserializeWebAppStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAvailableStacksOnPremNextPageRequest(string nextLink, Enum9? osTypeSelected) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get available application frameworks and their versions. - /// The URL to the next page of results. - /// The Enum9 to use. - /// The cancellation token to use. - /// is null. - public async Task> GetAvailableStacksOnPremNextPageAsync(string nextLink, Enum9? osTypeSelected = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateGetAvailableStacksOnPremNextPageRequest(nextLink, osTypeSelected); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApplicationStackCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get available application frameworks and their versions. - /// The URL to the next page of results. - /// The Enum9 to use. - /// The cancellation token to use. - /// is null. - public Response GetAvailableStacksOnPremNextPage(string nextLink, Enum9? osTypeSelected = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateGetAvailableStacksOnPremNextPageRequest(nextLink, osTypeSelected); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApplicationStackCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApplicationStackCollection.DeserializeApplicationStackCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/RecommendationsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/RecommendationsRestClient.cs deleted file mode 100644 index 1bdf386dd54d..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/RecommendationsRestClient.cs +++ /dev/null @@ -1,1763 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class RecommendationsRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of RecommendationsRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public RecommendationsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListRequest(bool? featured, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/recommendations", false); - if (featured != null) - { - uri.AppendQuery("featured", featured.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all recommendations for a subscription. - /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. - /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. - /// The cancellation token to use. - public async Task> ListAsync(bool? featured = null, string filter = null, CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(featured, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all recommendations for a subscription. - /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. - /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. - /// The cancellation token to use. - public Response List(bool? featured = null, string filter = null, CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(featured, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResetAllFiltersRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/recommendations/reset", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Reset all recommendation opt-out settings for a subscription. - /// The cancellation token to use. - public async Task ResetAllFiltersAsync(CancellationToken cancellationToken = default) - { - using var message = CreateResetAllFiltersRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Reset all recommendation opt-out settings for a subscription. - /// The cancellation token to use. - public Response ResetAllFilters(CancellationToken cancellationToken = default) - { - using var message = CreateResetAllFiltersRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDisableRecommendationForSubscriptionRequest(string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/recommendations/", false); - uri.AppendPath(name, true); - uri.AppendPath("/disable", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Disables the specified rule so it will not apply to a subscription in the future. - /// Rule name. - /// The cancellation token to use. - /// is null. - public async Task DisableRecommendationForSubscriptionAsync(string name, CancellationToken cancellationToken = default) - { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDisableRecommendationForSubscriptionRequest(name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Disables the specified rule so it will not apply to a subscription in the future. - /// Rule name. - /// The cancellation token to use. - /// is null. - public Response DisableRecommendationForSubscription(string name, CancellationToken cancellationToken = default) - { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDisableRecommendationForSubscriptionRequest(name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHistoryForHostingEnvironmentRequest(string resourceGroupName, string hostingEnvironmentName, bool? expiredOnly, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(hostingEnvironmentName, true); - uri.AppendPath("/recommendationHistory", false); - if (expiredOnly != null) - { - uri.AppendQuery("expiredOnly", expiredOnly.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get past recommendations for an app, optionally specified by the time range. - /// Name of the resource group to which the resource belongs. - /// Name of the hosting environment. - /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. - /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. - /// The cancellation token to use. - /// or is null. - public async Task> ListHistoryForHostingEnvironmentAsync(string resourceGroupName, string hostingEnvironmentName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateListHistoryForHostingEnvironmentRequest(resourceGroupName, hostingEnvironmentName, expiredOnly, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get past recommendations for an app, optionally specified by the time range. - /// Name of the resource group to which the resource belongs. - /// Name of the hosting environment. - /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. - /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. - /// The cancellation token to use. - /// or is null. - public Response ListHistoryForHostingEnvironment(string resourceGroupName, string hostingEnvironmentName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateListHistoryForHostingEnvironmentRequest(resourceGroupName, hostingEnvironmentName, expiredOnly, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRecommendedRulesForHostingEnvironmentRequest(string resourceGroupName, string hostingEnvironmentName, bool? featured, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(hostingEnvironmentName, true); - uri.AppendPath("/recommendations", false); - if (featured != null) - { - uri.AppendQuery("featured", featured.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all recommendations for a hosting environment. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. - /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. - /// The cancellation token to use. - /// or is null. - public async Task> ListRecommendedRulesForHostingEnvironmentAsync(string resourceGroupName, string hostingEnvironmentName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateListRecommendedRulesForHostingEnvironmentRequest(resourceGroupName, hostingEnvironmentName, featured, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all recommendations for a hosting environment. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. - /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. - /// The cancellation token to use. - /// or is null. - public Response ListRecommendedRulesForHostingEnvironment(string resourceGroupName, string hostingEnvironmentName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateListRecommendedRulesForHostingEnvironmentRequest(resourceGroupName, hostingEnvironmentName, featured, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDisableAllForHostingEnvironmentRequest(string resourceGroupName, string environmentName, string hostingEnvironmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(hostingEnvironmentName, true); - uri.AppendPath("/recommendations/disable", false); - uri.AppendQuery("environmentName", environmentName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Disable all recommendations for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task DisableAllForHostingEnvironmentAsync(string resourceGroupName, string environmentName, string hostingEnvironmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateDisableAllForHostingEnvironmentRequest(resourceGroupName, environmentName, hostingEnvironmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Disable all recommendations for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response DisableAllForHostingEnvironment(string resourceGroupName, string environmentName, string hostingEnvironmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateDisableAllForHostingEnvironmentRequest(resourceGroupName, environmentName, hostingEnvironmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResetAllFiltersForHostingEnvironmentRequest(string resourceGroupName, string environmentName, string hostingEnvironmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(hostingEnvironmentName, true); - uri.AppendPath("/recommendations/reset", false); - uri.AppendQuery("environmentName", environmentName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Reset all recommendation opt-out settings for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task ResetAllFiltersForHostingEnvironmentAsync(string resourceGroupName, string environmentName, string hostingEnvironmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateResetAllFiltersForHostingEnvironmentRequest(resourceGroupName, environmentName, hostingEnvironmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Reset all recommendation opt-out settings for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response ResetAllFiltersForHostingEnvironment(string resourceGroupName, string environmentName, string hostingEnvironmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateResetAllFiltersForHostingEnvironmentRequest(resourceGroupName, environmentName, hostingEnvironmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRuleDetailsByHostingEnvironmentRequest(string resourceGroupName, string hostingEnvironmentName, string name, bool? updateSeen, string recommendationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(hostingEnvironmentName, true); - uri.AppendPath("/recommendations/", false); - uri.AppendPath(name, true); - if (updateSeen != null) - { - uri.AppendQuery("updateSeen", updateSeen.Value, true); - } - if (recommendationId != null) - { - uri.AppendQuery("recommendationId", recommendationId, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a recommendation rule for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the hosting environment. - /// Name of the recommendation. - /// Specify <code>true</code> to update the last-seen timestamp of the recommendation object. - /// The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetRuleDetailsByHostingEnvironmentAsync(string resourceGroupName, string hostingEnvironmentName, string name, bool? updateSeen = null, string recommendationId = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRuleDetailsByHostingEnvironmentRequest(resourceGroupName, hostingEnvironmentName, name, updateSeen, recommendationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RecommendationRule value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RecommendationRule.DeserializeRecommendationRule(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a recommendation rule for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the hosting environment. - /// Name of the recommendation. - /// Specify <code>true</code> to update the last-seen timestamp of the recommendation object. - /// The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. - /// The cancellation token to use. - /// , , or is null. - public Response GetRuleDetailsByHostingEnvironment(string resourceGroupName, string hostingEnvironmentName, string name, bool? updateSeen = null, string recommendationId = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRuleDetailsByHostingEnvironmentRequest(resourceGroupName, hostingEnvironmentName, name, updateSeen, recommendationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RecommendationRule value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RecommendationRule.DeserializeRecommendationRule(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDisableRecommendationForHostingEnvironmentRequest(string resourceGroupName, string environmentName, string name, string hostingEnvironmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/hostingEnvironments/", false); - uri.AppendPath(hostingEnvironmentName, true); - uri.AppendPath("/recommendations/", false); - uri.AppendPath(name, true); - uri.AppendPath("/disable", false); - uri.AppendQuery("environmentName", environmentName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Disables the specific rule for a web site permanently. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Rule name. - /// The String to use. - /// The cancellation token to use. - /// , , , or is null. - public async Task DisableRecommendationForHostingEnvironmentAsync(string resourceGroupName, string environmentName, string name, string hostingEnvironmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateDisableRecommendationForHostingEnvironmentRequest(resourceGroupName, environmentName, name, hostingEnvironmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Disables the specific rule for a web site permanently. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Rule name. - /// The String to use. - /// The cancellation token to use. - /// , , , or is null. - public Response DisableRecommendationForHostingEnvironment(string resourceGroupName, string environmentName, string name, string hostingEnvironmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateDisableRecommendationForHostingEnvironmentRequest(resourceGroupName, environmentName, name, hostingEnvironmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHistoryForWebAppRequest(string resourceGroupName, string siteName, bool? expiredOnly, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/recommendationHistory", false); - if (expiredOnly != null) - { - uri.AppendQuery("expiredOnly", expiredOnly.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get past recommendations for an app, optionally specified by the time range. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. - /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. - /// The cancellation token to use. - /// or is null. - public async Task> ListHistoryForWebAppAsync(string resourceGroupName, string siteName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListHistoryForWebAppRequest(resourceGroupName, siteName, expiredOnly, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get past recommendations for an app, optionally specified by the time range. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. - /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. - /// The cancellation token to use. - /// or is null. - public Response ListHistoryForWebApp(string resourceGroupName, string siteName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListHistoryForWebAppRequest(resourceGroupName, siteName, expiredOnly, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRecommendedRulesForWebAppRequest(string resourceGroupName, string siteName, bool? featured, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/recommendations", false); - if (featured != null) - { - uri.AppendQuery("featured", featured.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all recommendations for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. - /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. - /// The cancellation token to use. - /// or is null. - public async Task> ListRecommendedRulesForWebAppAsync(string resourceGroupName, string siteName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListRecommendedRulesForWebAppRequest(resourceGroupName, siteName, featured, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all recommendations for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. - /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. - /// The cancellation token to use. - /// or is null. - public Response ListRecommendedRulesForWebApp(string resourceGroupName, string siteName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListRecommendedRulesForWebAppRequest(resourceGroupName, siteName, featured, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDisableAllForWebAppRequest(string resourceGroupName, string siteName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/recommendations/disable", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Disable all recommendations for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task DisableAllForWebAppAsync(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateDisableAllForWebAppRequest(resourceGroupName, siteName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Disable all recommendations for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response DisableAllForWebApp(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateDisableAllForWebAppRequest(resourceGroupName, siteName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResetAllFiltersForWebAppRequest(string resourceGroupName, string siteName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/recommendations/reset", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Reset all recommendation opt-out settings for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task ResetAllFiltersForWebAppAsync(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateResetAllFiltersForWebAppRequest(resourceGroupName, siteName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Reset all recommendation opt-out settings for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ResetAllFiltersForWebApp(string resourceGroupName, string siteName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateResetAllFiltersForWebAppRequest(resourceGroupName, siteName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRuleDetailsByWebAppRequest(string resourceGroupName, string siteName, string name, bool? updateSeen, string recommendationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/recommendations/", false); - uri.AppendPath(name, true); - if (updateSeen != null) - { - uri.AppendQuery("updateSeen", updateSeen.Value, true); - } - if (recommendationId != null) - { - uri.AppendQuery("recommendationId", recommendationId, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a recommendation rule for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the recommendation. - /// Specify <code>true</code> to update the last-seen timestamp of the recommendation object. - /// The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetRuleDetailsByWebAppAsync(string resourceGroupName, string siteName, string name, bool? updateSeen = null, string recommendationId = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRuleDetailsByWebAppRequest(resourceGroupName, siteName, name, updateSeen, recommendationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RecommendationRule value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RecommendationRule.DeserializeRecommendationRule(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a recommendation rule for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the recommendation. - /// Specify <code>true</code> to update the last-seen timestamp of the recommendation object. - /// The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. - /// The cancellation token to use. - /// , , or is null. - public Response GetRuleDetailsByWebApp(string resourceGroupName, string siteName, string name, bool? updateSeen = null, string recommendationId = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRuleDetailsByWebAppRequest(resourceGroupName, siteName, name, updateSeen, recommendationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RecommendationRule value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RecommendationRule.DeserializeRecommendationRule(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDisableRecommendationForSiteRequest(string resourceGroupName, string siteName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(siteName, true); - uri.AppendPath("/recommendations/", false); - uri.AppendPath(name, true); - uri.AppendPath("/disable", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Disables the specific rule for a web site permanently. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Rule name. - /// The cancellation token to use. - /// , , or is null. - public async Task DisableRecommendationForSiteAsync(string resourceGroupName, string siteName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDisableRecommendationForSiteRequest(resourceGroupName, siteName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Disables the specific rule for a web site permanently. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Rule name. - /// The cancellation token to use. - /// , , or is null. - public Response DisableRecommendationForSite(string resourceGroupName, string siteName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDisableRecommendationForSiteRequest(resourceGroupName, siteName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, bool? featured, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all recommendations for a subscription. - /// The URL to the next page of results. - /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. - /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink, featured, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all recommendations for a subscription. - /// The URL to the next page of results. - /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. - /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink, featured, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHistoryForHostingEnvironmentNextPageRequest(string nextLink, string resourceGroupName, string hostingEnvironmentName, bool? expiredOnly, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get past recommendations for an app, optionally specified by the time range. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the hosting environment. - /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. - /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListHistoryForHostingEnvironmentNextPageAsync(string nextLink, string resourceGroupName, string hostingEnvironmentName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateListHistoryForHostingEnvironmentNextPageRequest(nextLink, resourceGroupName, hostingEnvironmentName, expiredOnly, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get past recommendations for an app, optionally specified by the time range. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the hosting environment. - /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. - /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. - /// The cancellation token to use. - /// , , or is null. - public Response ListHistoryForHostingEnvironmentNextPage(string nextLink, string resourceGroupName, string hostingEnvironmentName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateListHistoryForHostingEnvironmentNextPageRequest(nextLink, resourceGroupName, hostingEnvironmentName, expiredOnly, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRecommendedRulesForHostingEnvironmentNextPageRequest(string nextLink, string resourceGroupName, string hostingEnvironmentName, bool? featured, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all recommendations for a hosting environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. - /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListRecommendedRulesForHostingEnvironmentNextPageAsync(string nextLink, string resourceGroupName, string hostingEnvironmentName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateListRecommendedRulesForHostingEnvironmentNextPageRequest(nextLink, resourceGroupName, hostingEnvironmentName, featured, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all recommendations for a hosting environment. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. - /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. - /// The cancellation token to use. - /// , , or is null. - public Response ListRecommendedRulesForHostingEnvironmentNextPage(string nextLink, string resourceGroupName, string hostingEnvironmentName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (hostingEnvironmentName == null) - { - throw new ArgumentNullException(nameof(hostingEnvironmentName)); - } - - using var message = CreateListRecommendedRulesForHostingEnvironmentNextPageRequest(nextLink, resourceGroupName, hostingEnvironmentName, featured, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHistoryForWebAppNextPageRequest(string nextLink, string resourceGroupName, string siteName, bool? expiredOnly, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get past recommendations for an app, optionally specified by the time range. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. - /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListHistoryForWebAppNextPageAsync(string nextLink, string resourceGroupName, string siteName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListHistoryForWebAppNextPageRequest(nextLink, resourceGroupName, siteName, expiredOnly, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get past recommendations for an app, optionally specified by the time range. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify <code>false</code> to return all recommendations. The default is <code>true</code>, which returns only expired recommendations. - /// Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. - /// The cancellation token to use. - /// , , or is null. - public Response ListHistoryForWebAppNextPage(string nextLink, string resourceGroupName, string siteName, bool? expiredOnly = null, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListHistoryForWebAppNextPageRequest(nextLink, resourceGroupName, siteName, expiredOnly, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRecommendedRulesForWebAppNextPageRequest(string nextLink, string resourceGroupName, string siteName, bool? featured, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all recommendations for an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. - /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListRecommendedRulesForWebAppNextPageAsync(string nextLink, string resourceGroupName, string siteName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListRecommendedRulesForWebAppNextPageRequest(nextLink, resourceGroupName, siteName, featured, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all recommendations for an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. - /// Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. - /// The cancellation token to use. - /// , , or is null. - public Response ListRecommendedRulesForWebAppNextPage(string nextLink, string resourceGroupName, string siteName, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (siteName == null) - { - throw new ArgumentNullException(nameof(siteName)); - } - - using var message = CreateListRecommendedRulesForWebAppNextPageRequest(nextLink, resourceGroupName, siteName, featured, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RecommendationCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RecommendationCollection.DeserializeRecommendationCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ResourceHealthMetadataRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ResourceHealthMetadataRestClient.cs deleted file mode 100644 index c5447abb65c8..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ResourceHealthMetadataRestClient.cs +++ /dev/null @@ -1,869 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class ResourceHealthMetadataRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of ResourceHealthMetadataRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public ResourceHealthMetadataRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/resourceHealthMetadata", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all ResourceHealthMetadata for all sites in the subscription. - /// The cancellation token to use. - public async Task> ListAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all ResourceHealthMetadata for all sites in the subscription. - /// The cancellation token to use. - public Response List(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/resourceHealthMetadata", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all ResourceHealthMetadata for all sites in the resource group in the subscription. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all ResourceHealthMetadata for all sites in the resource group in the subscription. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBySiteRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/resourceHealthMetadata", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public async Task> ListBySiteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListBySiteRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public Response ListBySite(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListBySiteRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetBySiteRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/resourceHealthMetadata/default", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the category of ResourceHealthMetadata to use for the given site. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public async Task> GetBySiteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetBySiteRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadata value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceHealthMetadata.DeserializeResourceHealthMetadata(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the category of ResourceHealthMetadata to use for the given site. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public Response GetBySite(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetBySiteRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadata value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceHealthMetadata.DeserializeResourceHealthMetadata(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBySiteSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/resourceHealthMetadata", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListBySiteSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListBySiteSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListBySiteSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListBySiteSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetBySiteSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/resourceHealthMetadata/default", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the category of ResourceHealthMetadata to use for the given site. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetBySiteSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetBySiteSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadata value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceHealthMetadata.DeserializeResourceHealthMetadata(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the category of ResourceHealthMetadata to use for the given site. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetBySiteSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetBySiteSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadata value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceHealthMetadata.DeserializeResourceHealthMetadata(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all ResourceHealthMetadata for all sites in the subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all ResourceHealthMetadata for all sites in the subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all ResourceHealthMetadata for all sites in the resource group in the subscription. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all ResourceHealthMetadata for all sites in the resource group in the subscription. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBySiteNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListBySiteNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListBySiteNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// , , or is null. - public Response ListBySiteNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListBySiteNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBySiteSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListBySiteSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListBySiteSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListBySiteSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListBySiteSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceHealthMetadataCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceHealthMetadataCollection.DeserializeResourceHealthMetadataCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesRestClient.cs deleted file mode 100644 index d4c7000b3222..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesRestClient.cs +++ /dev/null @@ -1,5359 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class StaticSitesRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of StaticSitesRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public StaticSitesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreatePreviewWorkflowRequest(string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/previewStaticSiteWorkflowFile", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(staticSitesWorkflowPreviewRequest); - request.Content = content; - return message; - } - - /// Description for Generates a preview workflow file for the static site. - /// Location where you plan to create the static site. - /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. See example. - /// The cancellation token to use. - /// or is null. - public async Task> PreviewWorkflowAsync(string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, CancellationToken cancellationToken = default) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - if (staticSitesWorkflowPreviewRequest == null) - { - throw new ArgumentNullException(nameof(staticSitesWorkflowPreviewRequest)); - } - - using var message = CreatePreviewWorkflowRequest(location, staticSitesWorkflowPreviewRequest); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSitesWorkflowPreview value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSitesWorkflowPreview.DeserializeStaticSitesWorkflowPreview(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Generates a preview workflow file for the static site. - /// Location where you plan to create the static site. - /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. See example. - /// The cancellation token to use. - /// or is null. - public Response PreviewWorkflow(string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, CancellationToken cancellationToken = default) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - if (staticSitesWorkflowPreviewRequest == null) - { - throw new ArgumentNullException(nameof(staticSitesWorkflowPreviewRequest)); - } - - using var message = CreatePreviewWorkflowRequest(location, staticSitesWorkflowPreviewRequest); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSitesWorkflowPreview value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSitesWorkflowPreview.DeserializeStaticSitesWorkflowPreview(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all Static Sites for a subscription. - /// The cancellation token to use. - public async Task> ListAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all Static Sites for a subscription. - /// The cancellation token to use. - public Response List(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetStaticSitesByResourceGroupRequest(string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all static sites in the specified resource group. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public async Task> GetStaticSitesByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateGetStaticSitesByResourceGroupRequest(resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all static sites in the specified resource group. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// is null. - public Response GetStaticSitesByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateGetStaticSitesByResourceGroupRequest(resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetStaticSiteRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the details of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public async Task> GetStaticSiteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetStaticSiteRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteARMResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteARMResource.DeserializeStaticSiteARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the details of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public Response GetStaticSite(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetStaticSiteRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteARMResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteARMResource.DeserializeStaticSiteARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateStaticSiteRequest(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(staticSiteEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new static site in an existing resource group, or updates an existing static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site to create or update. - /// A JSON representation of the staticsite properties. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task CreateOrUpdateStaticSiteAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (staticSiteEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteEnvelope)); - } - - using var message = CreateCreateOrUpdateStaticSiteRequest(resourceGroupName, name, staticSiteEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new static site in an existing resource group, or updates an existing static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site to create or update. - /// A JSON representation of the staticsite properties. See example. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdateStaticSite(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (staticSiteEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteEnvelope)); - } - - using var message = CreateCreateOrUpdateStaticSiteRequest(resourceGroupName, name, staticSiteEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteStaticSiteRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site to delete. - /// The cancellation token to use. - /// or is null. - public async Task DeleteStaticSiteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteStaticSiteRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site to delete. - /// The cancellation token to use. - /// or is null. - public Response DeleteStaticSite(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteStaticSiteRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateStaticSiteRequest(string resourceGroupName, string name, StaticSitePatchResource staticSiteEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(staticSiteEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new static site in an existing resource group, or updates an existing static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site to create or update. - /// A JSON representation of the staticsite properties. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateStaticSiteAsync(string resourceGroupName, string name, StaticSitePatchResource staticSiteEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (staticSiteEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteEnvelope)); - } - - using var message = CreateUpdateStaticSiteRequest(resourceGroupName, name, staticSiteEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - { - StaticSiteARMResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteARMResource.DeserializeStaticSiteARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new static site in an existing resource group, or updates an existing static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site to create or update. - /// A JSON representation of the staticsite properties. See example. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateStaticSite(string resourceGroupName, string name, StaticSitePatchResource staticSiteEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (staticSiteEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteEnvelope)); - } - - using var message = CreateUpdateStaticSiteRequest(resourceGroupName, name, staticSiteEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - { - StaticSiteARMResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteARMResource.DeserializeStaticSiteARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteUsersRequest(string resourceGroupName, string name, string authprovider) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/authproviders/", false); - uri.AppendPath(authprovider, true); - uri.AppendPath("/listUsers", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the list of users of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The auth provider for the users. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListStaticSiteUsersAsync(string resourceGroupName, string name, string authprovider, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (authprovider == null) - { - throw new ArgumentNullException(nameof(authprovider)); - } - - using var message = CreateListStaticSiteUsersRequest(resourceGroupName, name, authprovider); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteUserCollection.DeserializeStaticSiteUserCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the list of users of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The auth provider for the users. - /// The cancellation token to use. - /// , , or is null. - public Response ListStaticSiteUsers(string resourceGroupName, string name, string authprovider, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (authprovider == null) - { - throw new ArgumentNullException(nameof(authprovider)); - } - - using var message = CreateListStaticSiteUsersRequest(resourceGroupName, name, authprovider); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteUserCollection.DeserializeStaticSiteUserCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteStaticSiteUserRequest(string resourceGroupName, string name, string authprovider, string userid) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/authproviders/", false); - uri.AppendPath(authprovider, true); - uri.AppendPath("/users/", false); - uri.AppendPath(userid, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes the user entry from the static site. - /// Name of the resource group to which the resource belongs. - /// Name of the staticsite. - /// The auth provider for this user. - /// The user id of the user. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteStaticSiteUserAsync(string resourceGroupName, string name, string authprovider, string userid, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (authprovider == null) - { - throw new ArgumentNullException(nameof(authprovider)); - } - if (userid == null) - { - throw new ArgumentNullException(nameof(userid)); - } - - using var message = CreateDeleteStaticSiteUserRequest(resourceGroupName, name, authprovider, userid); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes the user entry from the static site. - /// Name of the resource group to which the resource belongs. - /// Name of the staticsite. - /// The auth provider for this user. - /// The user id of the user. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteStaticSiteUser(string resourceGroupName, string name, string authprovider, string userid, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (authprovider == null) - { - throw new ArgumentNullException(nameof(authprovider)); - } - if (userid == null) - { - throw new ArgumentNullException(nameof(userid)); - } - - using var message = CreateDeleteStaticSiteUserRequest(resourceGroupName, name, authprovider, userid); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateStaticSiteUserRequest(string resourceGroupName, string name, string authprovider, string userid, StaticSiteUserARMResource staticSiteUserEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/authproviders/", false); - uri.AppendPath(authprovider, true); - uri.AppendPath("/users/", false); - uri.AppendPath(userid, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(staticSiteUserEnvelope); - request.Content = content; - return message; - } - - /// Description for Updates a user entry with the listed roles. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The auth provider for this user. - /// The user id of the user. - /// A JSON representation of the StaticSiteUser properties. See example. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> UpdateStaticSiteUserAsync(string resourceGroupName, string name, string authprovider, string userid, StaticSiteUserARMResource staticSiteUserEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (authprovider == null) - { - throw new ArgumentNullException(nameof(authprovider)); - } - if (userid == null) - { - throw new ArgumentNullException(nameof(userid)); - } - if (staticSiteUserEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteUserEnvelope)); - } - - using var message = CreateUpdateStaticSiteUserRequest(resourceGroupName, name, authprovider, userid, staticSiteUserEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserARMResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteUserARMResource.DeserializeStaticSiteUserARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates a user entry with the listed roles. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The auth provider for this user. - /// The user id of the user. - /// A JSON representation of the StaticSiteUser properties. See example. - /// The cancellation token to use. - /// , , , , or is null. - public Response UpdateStaticSiteUser(string resourceGroupName, string name, string authprovider, string userid, StaticSiteUserARMResource staticSiteUserEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (authprovider == null) - { - throw new ArgumentNullException(nameof(authprovider)); - } - if (userid == null) - { - throw new ArgumentNullException(nameof(userid)); - } - if (staticSiteUserEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteUserEnvelope)); - } - - using var message = CreateUpdateStaticSiteUserRequest(resourceGroupName, name, authprovider, userid, staticSiteUserEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserARMResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteUserARMResource.DeserializeStaticSiteUserARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetStaticSiteBuildsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all static site builds for a particular static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public async Task> GetStaticSiteBuildsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetStaticSiteBuildsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteBuildCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteBuildCollection.DeserializeStaticSiteBuildCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all static site builds for a particular static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public Response GetStaticSiteBuilds(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetStaticSiteBuildsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteBuildCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteBuildCollection.DeserializeStaticSiteBuildCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds/", false); - uri.AppendPath(environmentName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the details of a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateGetStaticSiteBuildRequest(resourceGroupName, name, environmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteBuildARMResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteBuildARMResource.DeserializeStaticSiteBuildARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the details of a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , or is null. - public Response GetStaticSiteBuild(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateGetStaticSiteBuildRequest(resourceGroupName, name, environmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteBuildARMResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteBuildARMResource.DeserializeStaticSiteBuildARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds/", false); - uri.AppendPath(environmentName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateDeleteStaticSiteBuildRequest(resourceGroupName, name, environmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteStaticSiteBuild(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateDeleteStaticSiteBuildRequest(resourceGroupName, name, environmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateStaticSiteBuildAppSettingsRequest(string resourceGroupName, string name, string environmentName, StringDictionary appSettings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds/", false); - uri.AppendPath(environmentName, true); - uri.AppendPath("/config/appsettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(appSettings); - request.Content = content; - return message; - } - - /// Description for Creates or updates the app settings of a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The dictionary containing the static site app settings to update. - /// The cancellation token to use. - /// , , , or is null. - public async Task> CreateOrUpdateStaticSiteBuildAppSettingsAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (appSettings == null) - { - throw new ArgumentNullException(nameof(appSettings)); - } - - using var message = CreateCreateOrUpdateStaticSiteBuildAppSettingsRequest(resourceGroupName, name, environmentName, appSettings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates or updates the app settings of a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The dictionary containing the static site app settings to update. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateStaticSiteBuildAppSettings(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (appSettings == null) - { - throw new ArgumentNullException(nameof(appSettings)); - } - - using var message = CreateCreateOrUpdateStaticSiteBuildAppSettingsRequest(resourceGroupName, name, environmentName, appSettings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateStaticSiteBuildFunctionAppSettingsRequest(string resourceGroupName, string name, string environmentName, StringDictionary appSettings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds/", false); - uri.AppendPath(environmentName, true); - uri.AppendPath("/config/functionappsettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(appSettings); - request.Content = content; - return message; - } - - /// Description for Creates or updates the function app settings of a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The dictionary containing the static site function app settings to update. - /// The cancellation token to use. - /// , , , or is null. - public async Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (appSettings == null) - { - throw new ArgumentNullException(nameof(appSettings)); - } - - using var message = CreateCreateOrUpdateStaticSiteBuildFunctionAppSettingsRequest(resourceGroupName, name, environmentName, appSettings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates or updates the function app settings of a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The dictionary containing the static site function app settings to update. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateStaticSiteBuildFunctionAppSettings(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (appSettings == null) - { - throw new ArgumentNullException(nameof(appSettings)); - } - - using var message = CreateCreateOrUpdateStaticSiteBuildFunctionAppSettingsRequest(resourceGroupName, name, environmentName, appSettings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteBuildFunctionsRequest(string resourceGroupName, string name, string environmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds/", false); - uri.AppendPath(environmentName, true); - uri.AppendPath("/functions", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the functions of a particular static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListStaticSiteBuildFunctionsAsync(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateListStaticSiteBuildFunctionsRequest(resourceGroupName, name, environmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteFunctionOverviewCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the functions of a particular static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , or is null. - public Response ListStaticSiteBuildFunctions(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateListStaticSiteBuildFunctionsRequest(resourceGroupName, name, environmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteFunctionOverviewCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteBuildAppSettingsRequest(string resourceGroupName, string name, string environmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds/", false); - uri.AppendPath(environmentName, true); - uri.AppendPath("/listAppSettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the application settings of a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListStaticSiteBuildAppSettingsAsync(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateListStaticSiteBuildAppSettingsRequest(resourceGroupName, name, environmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the application settings of a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , or is null. - public Response ListStaticSiteBuildAppSettings(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateListStaticSiteBuildAppSettingsRequest(resourceGroupName, name, environmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteBuildFunctionAppSettingsRequest(string resourceGroupName, string name, string environmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds/", false); - uri.AppendPath(environmentName, true); - uri.AppendPath("/listFunctionAppSettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the application settings of a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListStaticSiteBuildFunctionAppSettingsAsync(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateListStaticSiteBuildFunctionAppSettingsRequest(resourceGroupName, name, environmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the application settings of a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , or is null. - public Response ListStaticSiteBuildFunctionAppSettings(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateListStaticSiteBuildFunctionAppSettingsRequest(resourceGroupName, name, environmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetUserProvidedFunctionAppsForStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds/", false); - uri.AppendPath(environmentName, true); - uri.AppendPath("/userProvidedFunctionApps", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the details of the user provided function apps registered with a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetUserProvidedFunctionAppsForStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateGetUserProvidedFunctionAppsForStaticSiteBuildRequest(resourceGroupName, name, environmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserProvidedFunctionAppsCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the details of the user provided function apps registered with a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , or is null. - public Response GetUserProvidedFunctionAppsForStaticSiteBuild(string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateGetUserProvidedFunctionAppsForStaticSiteBuildRequest(resourceGroupName, name, environmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserProvidedFunctionAppsCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetUserProvidedFunctionAppForStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName, string functionAppName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds/", false); - uri.AppendPath(environmentName, true); - uri.AppendPath("/userProvidedFunctionApps/", false); - uri.AppendPath(functionAppName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the details of the user provided function app registered with a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// Name of the function app registered with the static site build. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetUserProvidedFunctionAppForStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (functionAppName == null) - { - throw new ArgumentNullException(nameof(functionAppName)); - } - - using var message = CreateGetUserProvidedFunctionAppForStaticSiteBuildRequest(resourceGroupName, name, environmentName, functionAppName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserProvidedFunctionAppARMResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteUserProvidedFunctionAppARMResource.DeserializeStaticSiteUserProvidedFunctionAppARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the details of the user provided function app registered with a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// Name of the function app registered with the static site build. - /// The cancellation token to use. - /// , , , or is null. - public Response GetUserProvidedFunctionAppForStaticSiteBuild(string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (functionAppName == null) - { - throw new ArgumentNullException(nameof(functionAppName)); - } - - using var message = CreateGetUserProvidedFunctionAppForStaticSiteBuildRequest(resourceGroupName, name, environmentName, functionAppName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserProvidedFunctionAppARMResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteUserProvidedFunctionAppARMResource.DeserializeStaticSiteUserProvidedFunctionAppARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRegisterUserProvidedFunctionAppWithStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds/", false); - uri.AppendPath(environmentName, true); - uri.AppendPath("/userProvidedFunctionApps/", false); - uri.AppendPath(functionAppName, true); - if (isForced != null) - { - uri.AppendQuery("isForced", isForced.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(staticSiteUserProvidedFunctionEnvelope); - request.Content = content; - return message; - } - - /// Description for Register a user provided function app with a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// Name of the function app to register with the static site build. - /// A JSON representation of the user provided function app properties. See example. - /// Specify <code>true</code> to force the update of the auth configuration on the function app even if an AzureStaticWebApps provider is already configured on the function app. The default is <code>false</code>. - /// The cancellation token to use. - /// , , , , or is null. - public async Task RegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (functionAppName == null) - { - throw new ArgumentNullException(nameof(functionAppName)); - } - if (staticSiteUserProvidedFunctionEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteUserProvidedFunctionEnvelope)); - } - - using var message = CreateRegisterUserProvidedFunctionAppWithStaticSiteBuildRequest(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Register a user provided function app with a static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// Name of the function app to register with the static site build. - /// A JSON representation of the user provided function app properties. See example. - /// Specify <code>true</code> to force the update of the auth configuration on the function app even if an AzureStaticWebApps provider is already configured on the function app. The default is <code>false</code>. - /// The cancellation token to use. - /// , , , , or is null. - public Response RegisterUserProvidedFunctionAppWithStaticSiteBuild(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (functionAppName == null) - { - throw new ArgumentNullException(nameof(functionAppName)); - } - if (staticSiteUserProvidedFunctionEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteUserProvidedFunctionEnvelope)); - } - - using var message = CreateRegisterUserProvidedFunctionAppWithStaticSiteBuildRequest(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDetachUserProvidedFunctionAppFromStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName, string functionAppName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds/", false); - uri.AppendPath(environmentName, true); - uri.AppendPath("/userProvidedFunctionApps/", false); - uri.AppendPath(functionAppName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Detach the user provided function app from the static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// Name of the function app registered with the static site build. - /// The cancellation token to use. - /// , , , or is null. - public async Task DetachUserProvidedFunctionAppFromStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (functionAppName == null) - { - throw new ArgumentNullException(nameof(functionAppName)); - } - - using var message = CreateDetachUserProvidedFunctionAppFromStaticSiteBuildRequest(resourceGroupName, name, environmentName, functionAppName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Detach the user provided function app from the static site build. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// Name of the function app registered with the static site build. - /// The cancellation token to use. - /// , , , or is null. - public Response DetachUserProvidedFunctionAppFromStaticSiteBuild(string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (functionAppName == null) - { - throw new ArgumentNullException(nameof(functionAppName)); - } - - using var message = CreateDetachUserProvidedFunctionAppFromStaticSiteBuildRequest(resourceGroupName, name, environmentName, functionAppName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateZipDeploymentForStaticSiteBuildRequest(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/builds/", false); - uri.AppendPath(environmentName, true); - uri.AppendPath("/zipdeploy", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(staticSiteZipDeploymentEnvelope); - request.Content = content; - return message; - } - - /// Description for Deploys zipped content to a specific environment of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the environment. - /// A JSON representation of the StaticSiteZipDeployment properties. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task CreateZipDeploymentForStaticSiteBuildAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (staticSiteZipDeploymentEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteZipDeploymentEnvelope)); - } - - using var message = CreateCreateZipDeploymentForStaticSiteBuildRequest(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deploys zipped content to a specific environment of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the environment. - /// A JSON representation of the StaticSiteZipDeployment properties. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateZipDeploymentForStaticSiteBuild(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - if (staticSiteZipDeploymentEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteZipDeploymentEnvelope)); - } - - using var message = CreateCreateZipDeploymentForStaticSiteBuildRequest(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateStaticSiteAppSettingsRequest(string resourceGroupName, string name, StringDictionary appSettings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/appsettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(appSettings); - request.Content = content; - return message; - } - - /// Description for Creates or updates the app settings of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The dictionary containing the static site app settings to update. - /// The cancellation token to use. - /// , , or is null. - public async Task> CreateOrUpdateStaticSiteAppSettingsAsync(string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appSettings == null) - { - throw new ArgumentNullException(nameof(appSettings)); - } - - using var message = CreateCreateOrUpdateStaticSiteAppSettingsRequest(resourceGroupName, name, appSettings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates or updates the app settings of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The dictionary containing the static site app settings to update. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdateStaticSiteAppSettings(string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appSettings == null) - { - throw new ArgumentNullException(nameof(appSettings)); - } - - using var message = CreateCreateOrUpdateStaticSiteAppSettingsRequest(resourceGroupName, name, appSettings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateStaticSiteFunctionAppSettingsRequest(string resourceGroupName, string name, StringDictionary appSettings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/functionappsettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(appSettings); - request.Content = content; - return message; - } - - /// Description for Creates or updates the function app settings of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The dictionary containing the static site function app settings to update. - /// The cancellation token to use. - /// , , or is null. - public async Task> CreateOrUpdateStaticSiteFunctionAppSettingsAsync(string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appSettings == null) - { - throw new ArgumentNullException(nameof(appSettings)); - } - - using var message = CreateCreateOrUpdateStaticSiteFunctionAppSettingsRequest(resourceGroupName, name, appSettings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates or updates the function app settings of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The dictionary containing the static site function app settings to update. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdateStaticSiteFunctionAppSettings(string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appSettings == null) - { - throw new ArgumentNullException(nameof(appSettings)); - } - - using var message = CreateCreateOrUpdateStaticSiteFunctionAppSettingsRequest(resourceGroupName, name, appSettings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateUserRolesInvitationLinkRequest(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/createUserInvitation", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(staticSiteUserRolesInvitationEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates an invitation link for a user with the role. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The StaticSiteUserInvitationRequestResource to use. - /// The cancellation token to use. - /// , , or is null. - public async Task> CreateUserRolesInvitationLinkAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (staticSiteUserRolesInvitationEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteUserRolesInvitationEnvelope)); - } - - using var message = CreateCreateUserRolesInvitationLinkRequest(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserInvitationResponseResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteUserInvitationResponseResource.DeserializeStaticSiteUserInvitationResponseResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates an invitation link for a user with the role. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The StaticSiteUserInvitationRequestResource to use. - /// The cancellation token to use. - /// , , or is null. - public Response CreateUserRolesInvitationLink(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (staticSiteUserRolesInvitationEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteUserRolesInvitationEnvelope)); - } - - using var message = CreateCreateUserRolesInvitationLinkRequest(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserInvitationResponseResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteUserInvitationResponseResource.DeserializeStaticSiteUserInvitationResponseResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteCustomDomainsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/customDomains", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all static site custom domains for a particular static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site resource to search in. - /// The cancellation token to use. - /// or is null. - public async Task> ListStaticSiteCustomDomainsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteCustomDomainsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCustomDomainOverviewCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteCustomDomainOverviewCollection.DeserializeStaticSiteCustomDomainOverviewCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all static site custom domains for a particular static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site resource to search in. - /// The cancellation token to use. - /// or is null. - public Response ListStaticSiteCustomDomains(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteCustomDomainsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCustomDomainOverviewCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteCustomDomainOverviewCollection.DeserializeStaticSiteCustomDomainOverviewCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetStaticSiteCustomDomainRequest(string resourceGroupName, string name, string domainName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/customDomains/", false); - uri.AppendPath(domainName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets an existing custom domain for a particular static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site resource to search in. - /// The custom domain name. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetStaticSiteCustomDomainAsync(string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateGetStaticSiteCustomDomainRequest(resourceGroupName, name, domainName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCustomDomainOverviewARMResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteCustomDomainOverviewARMResource.DeserializeStaticSiteCustomDomainOverviewARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets an existing custom domain for a particular static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site resource to search in. - /// The custom domain name. - /// The cancellation token to use. - /// , , or is null. - public Response GetStaticSiteCustomDomain(string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateGetStaticSiteCustomDomainRequest(resourceGroupName, name, domainName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCustomDomainOverviewARMResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteCustomDomainOverviewARMResource.DeserializeStaticSiteCustomDomainOverviewARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateStaticSiteCustomDomainRequest(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/customDomains/", false); - uri.AppendPath(domainName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(staticSiteCustomDomainRequestPropertiesEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new static site custom domain in an existing resource group and static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The custom domain to create. - /// A JSON representation of the static site custom domain request properties. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task CreateOrUpdateStaticSiteCustomDomainAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (staticSiteCustomDomainRequestPropertiesEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteCustomDomainRequestPropertiesEnvelope)); - } - - using var message = CreateCreateOrUpdateStaticSiteCustomDomainRequest(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new static site custom domain in an existing resource group and static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The custom domain to create. - /// A JSON representation of the static site custom domain request properties. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateStaticSiteCustomDomain(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (staticSiteCustomDomainRequestPropertiesEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteCustomDomainRequestPropertiesEnvelope)); - } - - using var message = CreateCreateOrUpdateStaticSiteCustomDomainRequest(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteStaticSiteCustomDomainRequest(string resourceGroupName, string name, string domainName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/customDomains/", false); - uri.AppendPath(domainName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a custom domain. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The custom domain to delete. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteStaticSiteCustomDomainAsync(string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateDeleteStaticSiteCustomDomainRequest(resourceGroupName, name, domainName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a custom domain. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The custom domain to delete. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteStaticSiteCustomDomain(string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - - using var message = CreateDeleteStaticSiteCustomDomainRequest(resourceGroupName, name, domainName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateValidateCustomDomainCanBeAddedToStaticSiteRequest(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/customDomains/", false); - uri.AppendPath(domainName, true); - uri.AppendPath("/validate", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(staticSiteCustomDomainRequestPropertiesEnvelope); - request.Content = content; - return message; - } - - /// Description for Validates a particular custom domain can be added to a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The custom domain to validate. - /// A JSON representation of the static site custom domain request properties. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task ValidateCustomDomainCanBeAddedToStaticSiteAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (staticSiteCustomDomainRequestPropertiesEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteCustomDomainRequestPropertiesEnvelope)); - } - - using var message = CreateValidateCustomDomainCanBeAddedToStaticSiteRequest(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Validates a particular custom domain can be added to a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The custom domain to validate. - /// A JSON representation of the static site custom domain request properties. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response ValidateCustomDomainCanBeAddedToStaticSite(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainName == null) - { - throw new ArgumentNullException(nameof(domainName)); - } - if (staticSiteCustomDomainRequestPropertiesEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteCustomDomainRequestPropertiesEnvelope)); - } - - using var message = CreateValidateCustomDomainCanBeAddedToStaticSiteRequest(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDetachStaticSiteRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/detach", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Detaches a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site to detach. - /// The cancellation token to use. - /// or is null. - public async Task DetachStaticSiteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDetachStaticSiteRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Detaches a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site to detach. - /// The cancellation token to use. - /// or is null. - public Response DetachStaticSite(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDetachStaticSiteRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteFunctionsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/functions", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the functions of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public async Task> ListStaticSiteFunctionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteFunctionsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteFunctionOverviewCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the functions of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public Response ListStaticSiteFunctions(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteFunctionsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteFunctionOverviewCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteAppSettingsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/listAppSettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the application settings of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public async Task> ListStaticSiteAppSettingsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteAppSettingsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the application settings of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public Response ListStaticSiteAppSettings(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteAppSettingsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteConfiguredRolesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/listConfiguredRoles", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Lists the roles configured for the static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public async Task> ListStaticSiteConfiguredRolesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteConfiguredRolesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringList.DeserializeStringList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Lists the roles configured for the static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public Response ListStaticSiteConfiguredRoles(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteConfiguredRolesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringList.DeserializeStringList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteFunctionAppSettingsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/listFunctionAppSettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the application settings of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public async Task> ListStaticSiteFunctionAppSettingsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteFunctionAppSettingsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the application settings of a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public Response ListStaticSiteFunctionAppSettings(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteFunctionAppSettingsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteSecretsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/listSecrets", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Lists the secrets for an existing static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public async Task> ListStaticSiteSecretsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteSecretsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Lists the secrets for an existing static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public Response ListStaticSiteSecrets(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteSecretsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateEndpointConnectionListRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the list of private endpoint connections associated with a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public async Task> GetPrivateEndpointConnectionListAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateEndpointConnectionListRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the list of private endpoint connections associated with a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public Response GetPrivateEndpointConnectionList(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateEndpointConnectionListRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the private endpoint connection. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetPrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - - using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RemotePrivateEndpointConnectionARMResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the private endpoint connection. - /// The cancellation token to use. - /// , , or is null. - public Response GetPrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - - using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RemotePrivateEndpointConnectionARMResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateApproveOrRejectPrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(privateEndpointWrapper); - request.Content = content; - return message; - } - - /// Description for Approves or rejects a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the private endpoint connection. - /// Request body. - /// The cancellation token to use. - /// , , , or is null. - public async Task ApproveOrRejectPrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - if (privateEndpointWrapper == null) - { - throw new ArgumentNullException(nameof(privateEndpointWrapper)); - } - - using var message = CreateApproveOrRejectPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Approves or rejects a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the private endpoint connection. - /// Request body. - /// The cancellation token to use. - /// , , , or is null. - public Response ApproveOrRejectPrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - if (privateEndpointWrapper == null) - { - throw new ArgumentNullException(nameof(privateEndpointWrapper)); - } - - using var message = CreateApproveOrRejectPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeletePrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the private endpoint connection. - /// The cancellation token to use. - /// , , or is null. - public async Task DeletePrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - - using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the private endpoint connection. - /// The cancellation token to use. - /// , , or is null. - public Response DeletePrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - - using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateLinkResourcesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the private link resources. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The cancellation token to use. - /// or is null. - public async Task> GetPrivateLinkResourcesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateLinkResourcesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateLinkResourcesWrapper value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the private link resources. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The cancellation token to use. - /// or is null. - public Response GetPrivateLinkResources(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateLinkResourcesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateLinkResourcesWrapper value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResetStaticSiteApiKeyRequest(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/resetapikey", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(resetPropertiesEnvelope); - request.Content = content; - return message; - } - - /// Description for Resets the api key for an existing static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The StaticSiteResetPropertiesARMResource to use. - /// The cancellation token to use. - /// , , or is null. - public async Task ResetStaticSiteApiKeyAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (resetPropertiesEnvelope == null) - { - throw new ArgumentNullException(nameof(resetPropertiesEnvelope)); - } - - using var message = CreateResetStaticSiteApiKeyRequest(resourceGroupName, name, resetPropertiesEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Resets the api key for an existing static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The StaticSiteResetPropertiesARMResource to use. - /// The cancellation token to use. - /// , , or is null. - public Response ResetStaticSiteApiKey(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (resetPropertiesEnvelope == null) - { - throw new ArgumentNullException(nameof(resetPropertiesEnvelope)); - } - - using var message = CreateResetStaticSiteApiKeyRequest(resourceGroupName, name, resetPropertiesEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetUserProvidedFunctionAppsForStaticSiteRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/userProvidedFunctionApps", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the details of the user provided function apps registered with a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public async Task> GetUserProvidedFunctionAppsForStaticSiteAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetUserProvidedFunctionAppsForStaticSiteRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserProvidedFunctionAppsCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the details of the user provided function apps registered with a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// or is null. - public Response GetUserProvidedFunctionAppsForStaticSite(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetUserProvidedFunctionAppsForStaticSiteRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserProvidedFunctionAppsCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetUserProvidedFunctionAppForStaticSiteRequest(string resourceGroupName, string name, string functionAppName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/userProvidedFunctionApps/", false); - uri.AppendPath(functionAppName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the details of the user provided function app registered with a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the function app registered with the static site. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetUserProvidedFunctionAppForStaticSiteAsync(string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionAppName == null) - { - throw new ArgumentNullException(nameof(functionAppName)); - } - - using var message = CreateGetUserProvidedFunctionAppForStaticSiteRequest(resourceGroupName, name, functionAppName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserProvidedFunctionAppARMResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteUserProvidedFunctionAppARMResource.DeserializeStaticSiteUserProvidedFunctionAppARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the details of the user provided function app registered with a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the function app registered with the static site. - /// The cancellation token to use. - /// , , or is null. - public Response GetUserProvidedFunctionAppForStaticSite(string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionAppName == null) - { - throw new ArgumentNullException(nameof(functionAppName)); - } - - using var message = CreateGetUserProvidedFunctionAppForStaticSiteRequest(resourceGroupName, name, functionAppName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserProvidedFunctionAppARMResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteUserProvidedFunctionAppARMResource.DeserializeStaticSiteUserProvidedFunctionAppARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRegisterUserProvidedFunctionAppWithStaticSiteRequest(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/userProvidedFunctionApps/", false); - uri.AppendPath(functionAppName, true); - if (isForced != null) - { - uri.AppendQuery("isForced", isForced.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(staticSiteUserProvidedFunctionEnvelope); - request.Content = content; - return message; - } - - /// Description for Register a user provided function app with a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the function app to register with the static site. - /// A JSON representation of the user provided function app properties. See example. - /// Specify <code>true</code> to force the update of the auth configuration on the function app even if an AzureStaticWebApps provider is already configured on the function app. The default is <code>false</code>. - /// The cancellation token to use. - /// , , , or is null. - public async Task RegisterUserProvidedFunctionAppWithStaticSiteAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionAppName == null) - { - throw new ArgumentNullException(nameof(functionAppName)); - } - if (staticSiteUserProvidedFunctionEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteUserProvidedFunctionEnvelope)); - } - - using var message = CreateRegisterUserProvidedFunctionAppWithStaticSiteRequest(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Register a user provided function app with a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the function app to register with the static site. - /// A JSON representation of the user provided function app properties. See example. - /// Specify <code>true</code> to force the update of the auth configuration on the function app even if an AzureStaticWebApps provider is already configured on the function app. The default is <code>false</code>. - /// The cancellation token to use. - /// , , , or is null. - public Response RegisterUserProvidedFunctionAppWithStaticSite(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionAppName == null) - { - throw new ArgumentNullException(nameof(functionAppName)); - } - if (staticSiteUserProvidedFunctionEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteUserProvidedFunctionEnvelope)); - } - - using var message = CreateRegisterUserProvidedFunctionAppWithStaticSiteRequest(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDetachUserProvidedFunctionAppFromStaticSiteRequest(string resourceGroupName, string name, string functionAppName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/userProvidedFunctionApps/", false); - uri.AppendPath(functionAppName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Detach the user provided function app from the static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the function app registered with the static site. - /// The cancellation token to use. - /// , , or is null. - public async Task DetachUserProvidedFunctionAppFromStaticSiteAsync(string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionAppName == null) - { - throw new ArgumentNullException(nameof(functionAppName)); - } - - using var message = CreateDetachUserProvidedFunctionAppFromStaticSiteRequest(resourceGroupName, name, functionAppName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Detach the user provided function app from the static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// Name of the function app registered with the static site. - /// The cancellation token to use. - /// , , or is null. - public Response DetachUserProvidedFunctionAppFromStaticSite(string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionAppName == null) - { - throw new ArgumentNullException(nameof(functionAppName)); - } - - using var message = CreateDetachUserProvidedFunctionAppFromStaticSiteRequest(resourceGroupName, name, functionAppName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateZipDeploymentForStaticSiteRequest(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/staticSites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/zipdeploy", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(staticSiteZipDeploymentEnvelope); - request.Content = content; - return message; - } - - /// Description for Deploys zipped content to a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// A JSON representation of the StaticSiteZipDeployment properties. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task CreateZipDeploymentForStaticSiteAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (staticSiteZipDeploymentEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteZipDeploymentEnvelope)); - } - - using var message = CreateCreateZipDeploymentForStaticSiteRequest(resourceGroupName, name, staticSiteZipDeploymentEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deploys zipped content to a static site. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// A JSON representation of the StaticSiteZipDeployment properties. See example. - /// The cancellation token to use. - /// , , or is null. - public Response CreateZipDeploymentForStaticSite(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (staticSiteZipDeploymentEnvelope == null) - { - throw new ArgumentNullException(nameof(staticSiteZipDeploymentEnvelope)); - } - - using var message = CreateCreateZipDeploymentForStaticSiteRequest(resourceGroupName, name, staticSiteZipDeploymentEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all Static Sites for a subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all Static Sites for a subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetStaticSitesByResourceGroupNextPageRequest(string nextLink, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all static sites in the specified resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public async Task> GetStaticSitesByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateGetStaticSitesByResourceGroupNextPageRequest(nextLink, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all static sites in the specified resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// The cancellation token to use. - /// or is null. - public Response GetStaticSitesByResourceGroupNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateGetStaticSitesByResourceGroupNextPageRequest(nextLink, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteCollection.DeserializeStaticSiteCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteUsersNextPageRequest(string nextLink, string resourceGroupName, string name, string authprovider) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the list of users of a static site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The auth provider for the users. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListStaticSiteUsersNextPageAsync(string nextLink, string resourceGroupName, string name, string authprovider, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (authprovider == null) - { - throw new ArgumentNullException(nameof(authprovider)); - } - - using var message = CreateListStaticSiteUsersNextPageRequest(nextLink, resourceGroupName, name, authprovider); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteUserCollection.DeserializeStaticSiteUserCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the list of users of a static site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The auth provider for the users. - /// The cancellation token to use. - /// , , , or is null. - public Response ListStaticSiteUsersNextPage(string nextLink, string resourceGroupName, string name, string authprovider, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (authprovider == null) - { - throw new ArgumentNullException(nameof(authprovider)); - } - - using var message = CreateListStaticSiteUsersNextPageRequest(nextLink, resourceGroupName, name, authprovider); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteUserCollection.DeserializeStaticSiteUserCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetStaticSiteBuildsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all static site builds for a particular static site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetStaticSiteBuildsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetStaticSiteBuildsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteBuildCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteBuildCollection.DeserializeStaticSiteBuildCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all static site builds for a particular static site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// , , or is null. - public Response GetStaticSiteBuildsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetStaticSiteBuildsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteBuildCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteBuildCollection.DeserializeStaticSiteBuildCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteBuildFunctionsNextPageRequest(string nextLink, string resourceGroupName, string name, string environmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the functions of a particular static site build. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListStaticSiteBuildFunctionsNextPageAsync(string nextLink, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateListStaticSiteBuildFunctionsNextPageRequest(nextLink, resourceGroupName, name, environmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteFunctionOverviewCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the functions of a particular static site build. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , , or is null. - public Response ListStaticSiteBuildFunctionsNextPage(string nextLink, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateListStaticSiteBuildFunctionsNextPageRequest(nextLink, resourceGroupName, name, environmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteFunctionOverviewCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetUserProvidedFunctionAppsForStaticSiteBuildNextPageRequest(string nextLink, string resourceGroupName, string name, string environmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the details of the user provided function apps registered with a static site build. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetUserProvidedFunctionAppsForStaticSiteBuildNextPageAsync(string nextLink, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateGetUserProvidedFunctionAppsForStaticSiteBuildNextPageRequest(nextLink, resourceGroupName, name, environmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserProvidedFunctionAppsCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the details of the user provided function apps registered with a static site build. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The stage site identifier. - /// The cancellation token to use. - /// , , , or is null. - public Response GetUserProvidedFunctionAppsForStaticSiteBuildNextPage(string nextLink, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (environmentName == null) - { - throw new ArgumentNullException(nameof(environmentName)); - } - - using var message = CreateGetUserProvidedFunctionAppsForStaticSiteBuildNextPageRequest(nextLink, resourceGroupName, name, environmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserProvidedFunctionAppsCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteCustomDomainsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all static site custom domains for a particular static site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site resource to search in. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListStaticSiteCustomDomainsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteCustomDomainsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCustomDomainOverviewCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteCustomDomainOverviewCollection.DeserializeStaticSiteCustomDomainOverviewCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all static site custom domains for a particular static site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site resource to search in. - /// The cancellation token to use. - /// , , or is null. - public Response ListStaticSiteCustomDomainsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteCustomDomainsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteCustomDomainOverviewCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteCustomDomainOverviewCollection.DeserializeStaticSiteCustomDomainOverviewCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListStaticSiteFunctionsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the functions of a static site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListStaticSiteFunctionsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteFunctionsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteFunctionOverviewCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the functions of a static site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// , , or is null. - public Response ListStaticSiteFunctionsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListStaticSiteFunctionsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteFunctionOverviewCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteFunctionOverviewCollection.DeserializeStaticSiteFunctionOverviewCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateEndpointConnectionListNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the list of private endpoint connections associated with a static site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetPrivateEndpointConnectionListNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateEndpointConnectionListNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the list of private endpoint connections associated with a static site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// , , or is null. - public Response GetPrivateEndpointConnectionListNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateEndpointConnectionListNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetUserProvidedFunctionAppsForStaticSiteNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the details of the user provided function apps registered with a static site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetUserProvidedFunctionAppsForStaticSiteNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetUserProvidedFunctionAppsForStaticSiteNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserProvidedFunctionAppsCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the details of the user provided function apps registered with a static site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the static site. - /// The cancellation token to use. - /// , , or is null. - public Response GetUserProvidedFunctionAppsForStaticSiteNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetUserProvidedFunctionAppsForStaticSiteNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StaticSiteUserProvidedFunctionAppsCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StaticSiteUserProvidedFunctionAppsCollection.DeserializeStaticSiteUserProvidedFunctionAppsCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/TopLevelDomainsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/TopLevelDomainsRestClient.cs deleted file mode 100644 index d301ad14ee43..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/TopLevelDomainsRestClient.cs +++ /dev/null @@ -1,420 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class TopLevelDomainsRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of TopLevelDomainsRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public TopLevelDomainsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/topLevelDomains", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all top-level domains supported for registration. - /// The cancellation token to use. - public async Task> ListAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TopLevelDomainCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TopLevelDomainCollection.DeserializeTopLevelDomainCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all top-level domains supported for registration. - /// The cancellation token to use. - public Response List(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TopLevelDomainCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TopLevelDomainCollection.DeserializeTopLevelDomainCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/topLevelDomains/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get details of a top-level domain. - /// Name of the top-level domain. - /// The cancellation token to use. - /// is null. - public async Task> GetAsync(string name, CancellationToken cancellationToken = default) - { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRequest(name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TopLevelDomain value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TopLevelDomain.DeserializeTopLevelDomain(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get details of a top-level domain. - /// Name of the top-level domain. - /// The cancellation token to use. - /// is null. - public Response Get(string name, CancellationToken cancellationToken = default) - { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRequest(name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TopLevelDomain value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TopLevelDomain.DeserializeTopLevelDomain(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListAgreementsRequest(string name, TopLevelDomainAgreementOption agreementOption) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DomainRegistration/topLevelDomains/", false); - uri.AppendPath(name, true); - uri.AppendPath("/listAgreements", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(agreementOption); - request.Content = content; - return message; - } - - /// Description for Gets all legal agreements that user needs to accept before purchasing a domain. - /// Name of the top-level domain. - /// Domain agreement options. - /// The cancellation token to use. - /// or is null. - public async Task> ListAgreementsAsync(string name, TopLevelDomainAgreementOption agreementOption, CancellationToken cancellationToken = default) - { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (agreementOption == null) - { - throw new ArgumentNullException(nameof(agreementOption)); - } - - using var message = CreateListAgreementsRequest(name, agreementOption); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TldLegalAgreementCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TldLegalAgreementCollection.DeserializeTldLegalAgreementCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all legal agreements that user needs to accept before purchasing a domain. - /// Name of the top-level domain. - /// Domain agreement options. - /// The cancellation token to use. - /// or is null. - public Response ListAgreements(string name, TopLevelDomainAgreementOption agreementOption, CancellationToken cancellationToken = default) - { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (agreementOption == null) - { - throw new ArgumentNullException(nameof(agreementOption)); - } - - using var message = CreateListAgreementsRequest(name, agreementOption); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TldLegalAgreementCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TldLegalAgreementCollection.DeserializeTldLegalAgreementCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all top-level domains supported for registration. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TopLevelDomainCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TopLevelDomainCollection.DeserializeTopLevelDomainCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all top-level domains supported for registration. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TopLevelDomainCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TopLevelDomainCollection.DeserializeTopLevelDomainCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListAgreementsNextPageRequest(string nextLink, string name, TopLevelDomainAgreementOption agreementOption) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all legal agreements that user needs to accept before purchasing a domain. - /// The URL to the next page of results. - /// Name of the top-level domain. - /// Domain agreement options. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListAgreementsNextPageAsync(string nextLink, string name, TopLevelDomainAgreementOption agreementOption, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (agreementOption == null) - { - throw new ArgumentNullException(nameof(agreementOption)); - } - - using var message = CreateListAgreementsNextPageRequest(nextLink, name, agreementOption); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TldLegalAgreementCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TldLegalAgreementCollection.DeserializeTldLegalAgreementCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all legal agreements that user needs to accept before purchasing a domain. - /// The URL to the next page of results. - /// Name of the top-level domain. - /// Domain agreement options. - /// The cancellation token to use. - /// , , or is null. - public Response ListAgreementsNextPage(string nextLink, string name, TopLevelDomainAgreementOption agreementOption, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (agreementOption == null) - { - throw new ArgumentNullException(nameof(agreementOption)); - } - - using var message = CreateListAgreementsNextPageRequest(nextLink, name, agreementOption); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TldLegalAgreementCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TldLegalAgreementCollection.DeserializeTldLegalAgreementCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsRestClient.cs deleted file mode 100644 index b15a8aec7e77..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsRestClient.cs +++ /dev/null @@ -1,44343 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class WebAppsRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of WebAppsRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public WebAppsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateListRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/sites", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all apps for a subscription. - /// The cancellation token to use. - public async Task> ListAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all apps for a subscription. - /// The cancellation token to use. - public Response List(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName, bool? includeSlots) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites", false); - if (includeSlots != null) - { - uri.AppendQuery("includeSlots", includeSlots.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all web, mobile, and API apps in the specified resource group. - /// Name of the resource group to which the resource belongs. - /// Specify <strong>true</strong> to include deployment slots in results. The default is false, which only gives you the production slot of all apps. - /// The cancellation token to use. - /// is null. - public async Task> ListByResourceGroupAsync(string resourceGroupName, bool? includeSlots = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName, includeSlots); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all web, mobile, and API apps in the specified resource group. - /// Name of the resource group to which the resource belongs. - /// Specify <strong>true</strong> to include deployment slots in results. The default is false, which only gives you the production slot of all apps. - /// The cancellation token to use. - /// is null. - public Response ListByResourceGroup(string resourceGroupName, bool? includeSlots = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupRequest(resourceGroupName, includeSlots); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the details of a web, mobile, or API app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Site value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Site.DeserializeSite(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((Site)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the details of a web, mobile, or API app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response Get(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Site value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Site.DeserializeSite(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((Site)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string name, Site siteEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - /// Name of the resource group to which the resource belongs. - /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. - /// A JSON representation of the app properties. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task CreateOrUpdateAsync(string resourceGroupName, string name, Site siteEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteEnvelope == null) - { - throw new ArgumentNullException(nameof(siteEnvelope)); - } - - using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, siteEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - /// Name of the resource group to which the resource belongs. - /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. - /// A JSON representation of the app properties. See example. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdate(string resourceGroupName, string name, Site siteEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteEnvelope == null) - { - throw new ArgumentNullException(nameof(siteEnvelope)); - } - - using var message = CreateCreateOrUpdateRequest(resourceGroupName, name, siteEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string resourceGroupName, string name, bool? deleteMetrics, bool? deleteEmptyServerFarm) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - if (deleteMetrics != null) - { - uri.AppendQuery("deleteMetrics", deleteMetrics.Value, true); - } - if (deleteEmptyServerFarm != null) - { - uri.AppendQuery("deleteEmptyServerFarm", deleteEmptyServerFarm.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a web, mobile, or API app, or one of the deployment slots. - /// Name of the resource group to which the resource belongs. - /// Name of the app to delete. - /// If true, web app metrics are also deleted. - /// Specify false if you want to keep empty App Service plan. By default, empty App Service plan is deleted. - /// The cancellation token to use. - /// or is null. - public async Task DeleteAsync(string resourceGroupName, string name, bool? deleteMetrics = null, bool? deleteEmptyServerFarm = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteRequest(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a web, mobile, or API app, or one of the deployment slots. - /// Name of the resource group to which the resource belongs. - /// Name of the app to delete. - /// If true, web app metrics are also deleted. - /// Specify false if you want to keep empty App Service plan. By default, empty App Service plan is deleted. - /// The cancellation token to use. - /// or is null. - public Response Delete(string resourceGroupName, string name, bool? deleteMetrics = null, bool? deleteEmptyServerFarm = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteRequest(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string resourceGroupName, string name, SitePatchResource siteEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - /// Name of the resource group to which the resource belongs. - /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. - /// A JSON representation of the app properties. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateAsync(string resourceGroupName, string name, SitePatchResource siteEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteEnvelope == null) - { - throw new ArgumentNullException(nameof(siteEnvelope)); - } - - using var message = CreateUpdateRequest(resourceGroupName, name, siteEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - { - Site value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Site.DeserializeSite(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - /// Name of the resource group to which the resource belongs. - /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. - /// A JSON representation of the app properties. See example. - /// The cancellation token to use. - /// , , or is null. - public Response Update(string resourceGroupName, string name, SitePatchResource siteEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteEnvelope == null) - { - throw new ArgumentNullException(nameof(siteEnvelope)); - } - - using var message = CreateUpdateRequest(resourceGroupName, name, siteEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - { - Site value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Site.DeserializeSite(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateAnalyzeCustomHostnameRequest(string resourceGroupName, string name, string hostName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/analyzeCustomHostname", false); - if (hostName != null) - { - uri.AppendQuery("hostName", hostName, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Analyze a custom hostname. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Custom hostname. - /// The cancellation token to use. - /// or is null. - public async Task> AnalyzeCustomHostnameAsync(string resourceGroupName, string name, string hostName = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateAnalyzeCustomHostnameRequest(resourceGroupName, name, hostName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CustomHostnameAnalysisResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomHostnameAnalysisResult.DeserializeCustomHostnameAnalysisResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Analyze a custom hostname. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Custom hostname. - /// The cancellation token to use. - /// or is null. - public Response AnalyzeCustomHostname(string resourceGroupName, string name, string hostName = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateAnalyzeCustomHostnameRequest(resourceGroupName, name, hostName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CustomHostnameAnalysisResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomHostnameAnalysisResult.DeserializeCustomHostnameAnalysisResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateApplySlotConfigToProductionRequest(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/applySlotConfig", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(slotSwapEntity); - request.Content = content; - return message; - } - - /// Description for Applies the configuration settings from the target slot onto the current slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task ApplySlotConfigToProductionAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateApplySlotConfigToProductionRequest(resourceGroupName, name, slotSwapEntity); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Applies the configuration settings from the target slot onto the current slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , or is null. - public Response ApplySlotConfigToProduction(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateApplySlotConfigToProductionRequest(resourceGroupName, name, slotSwapEntity); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateBackupRequest(string resourceGroupName, string name, BackupRequest request) - { - var message = _pipeline.CreateMessage(); - var request0 = message.Request; - request0.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/backup", false); - uri.AppendQuery("api-version", apiVersion, true); - request0.Uri = uri; - request0.Headers.Add("Accept", "application/json"); - request0.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(request); - request0.Content = content; - return message; - } - - /// Description for Creates a backup of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Backup configuration. You can use the JSON response from the POST action as input here. - /// The cancellation token to use. - /// , , or is null. - public async Task> BackupAsync(string resourceGroupName, string name, BackupRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateBackupRequest(resourceGroupName, name, request); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItem value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItem.DeserializeBackupItem(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a backup of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Backup configuration. You can use the JSON response from the POST action as input here. - /// The cancellation token to use. - /// , , or is null. - public Response Backup(string resourceGroupName, string name, BackupRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateBackupRequest(resourceGroupName, name, request); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItem value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItem.DeserializeBackupItem(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBackupsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/backups", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets existing backups of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListBackupsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListBackupsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets existing backups of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListBackups(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListBackupsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetBackupStatusRequest(string resourceGroupName, string name, string backupId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/backups/", false); - uri.AppendPath(backupId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a backup of an app by its ID. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of the backup. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetBackupStatusAsync(string resourceGroupName, string name, string backupId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - - using var message = CreateGetBackupStatusRequest(resourceGroupName, name, backupId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItem value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItem.DeserializeBackupItem(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a backup of an app by its ID. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of the backup. - /// The cancellation token to use. - /// , , or is null. - public Response GetBackupStatus(string resourceGroupName, string name, string backupId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - - using var message = CreateGetBackupStatusRequest(resourceGroupName, name, backupId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItem value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItem.DeserializeBackupItem(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteBackupRequest(string resourceGroupName, string name, string backupId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/backups/", false); - uri.AppendPath(backupId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a backup of an app by its ID. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of the backup. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteBackupAsync(string resourceGroupName, string name, string backupId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - - using var message = CreateDeleteBackupRequest(resourceGroupName, name, backupId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a backup of an app by its ID. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of the backup. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteBackup(string resourceGroupName, string name, string backupId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - - using var message = CreateDeleteBackupRequest(resourceGroupName, name, backupId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBackupStatusSecretsRequest(string resourceGroupName, string name, string backupId, BackupRequest request) - { - var message = _pipeline.CreateMessage(); - var request0 = message.Request; - request0.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/backups/", false); - uri.AppendPath(backupId, true); - uri.AppendPath("/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request0.Uri = uri; - request0.Headers.Add("Accept", "application/json"); - request0.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(request); - request0.Content = content; - return message; - } - - /// Description for Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// ID of backup. - /// Information on backup request. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListBackupStatusSecretsAsync(string resourceGroupName, string name, string backupId, BackupRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateListBackupStatusSecretsRequest(resourceGroupName, name, backupId, request); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItem value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItem.DeserializeBackupItem(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// ID of backup. - /// Information on backup request. - /// The cancellation token to use. - /// , , , or is null. - public Response ListBackupStatusSecrets(string resourceGroupName, string name, string backupId, BackupRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateListBackupStatusSecretsRequest(resourceGroupName, name, backupId, request); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItem value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItem.DeserializeBackupItem(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRestoreRequest(string resourceGroupName, string name, string backupId, RestoreRequest request) - { - var message = _pipeline.CreateMessage(); - var request0 = message.Request; - request0.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/backups/", false); - uri.AppendPath(backupId, true); - uri.AppendPath("/restore", false); - uri.AppendQuery("api-version", apiVersion, true); - request0.Uri = uri; - request0.Headers.Add("Accept", "application/json"); - request0.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(request); - request0.Content = content; - return message; - } - - /// Description for Restores a specific backup to another app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of the backup. - /// Information on restore request . - /// The cancellation token to use. - /// , , , or is null. - public async Task RestoreAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateRestoreRequest(resourceGroupName, name, backupId, request); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Restores a specific backup to another app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of the backup. - /// Information on restore request . - /// The cancellation token to use. - /// , , , or is null. - public Response Restore(string resourceGroupName, string name, string backupId, RestoreRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateRestoreRequest(resourceGroupName, name, backupId, request); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetBasicPublishingCredentialsPoliciesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/basicPublishingCredentialsPolicies", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetBasicPublishingCredentialsPoliciesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetBasicPublishingCredentialsPoliciesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmPublishingCredentialsPoliciesCollection.DeserializeCsmPublishingCredentialsPoliciesCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GetBasicPublishingCredentialsPolicies(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetBasicPublishingCredentialsPoliciesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmPublishingCredentialsPoliciesCollection.DeserializeCsmPublishingCredentialsPoliciesCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetFtpAllowedRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/basicPublishingCredentialsPolicies/ftp", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns whether FTP is allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetFtpAllowedAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetFtpAllowedRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns whether FTP is allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GetFtpAllowed(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetFtpAllowedRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateFtpAllowedRequest(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/basicPublishingCredentialsPolicies/ftp", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(csmPublishingAccessPoliciesEntity); - request.Content = content; - return message; - } - - /// Description for Updates whether FTP is allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The CsmPublishingCredentialsPoliciesEntity to use. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateFtpAllowedAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (csmPublishingAccessPoliciesEntity == null) - { - throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); - } - - using var message = CreateUpdateFtpAllowedRequest(resourceGroupName, name, csmPublishingAccessPoliciesEntity); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates whether FTP is allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The CsmPublishingCredentialsPoliciesEntity to use. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateFtpAllowed(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (csmPublishingAccessPoliciesEntity == null) - { - throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); - } - - using var message = CreateUpdateFtpAllowedRequest(resourceGroupName, name, csmPublishingAccessPoliciesEntity); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetScmAllowedRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/basicPublishingCredentialsPolicies/scm", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns whether Scm basic auth is allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetScmAllowedAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetScmAllowedRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns whether Scm basic auth is allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GetScmAllowed(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetScmAllowedRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateScmAllowedRequest(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/basicPublishingCredentialsPolicies/scm", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(csmPublishingAccessPoliciesEntity); - request.Content = content; - return message; - } - - /// Description for Updates whether user publishing credentials are allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The CsmPublishingCredentialsPoliciesEntity to use. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateScmAllowedAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (csmPublishingAccessPoliciesEntity == null) - { - throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); - } - - using var message = CreateUpdateScmAllowedRequest(resourceGroupName, name, csmPublishingAccessPoliciesEntity); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates whether user publishing credentials are allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The CsmPublishingCredentialsPoliciesEntity to use. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateScmAllowed(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (csmPublishingAccessPoliciesEntity == null) - { - throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); - } - - using var message = CreateUpdateScmAllowedRequest(resourceGroupName, name, csmPublishingAccessPoliciesEntity); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConfigurationsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the configurations of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListConfigurationsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListConfigurationsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResourceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the configurations of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListConfigurations(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListConfigurationsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResourceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateApplicationSettingsRequest(string resourceGroupName, string name, StringDictionary appSettings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/appsettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(appSettings); - request.Content = content; - return message; - } - - /// Description for Replaces the application settings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Application settings of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateApplicationSettingsAsync(string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appSettings == null) - { - throw new ArgumentNullException(nameof(appSettings)); - } - - using var message = CreateUpdateApplicationSettingsRequest(resourceGroupName, name, appSettings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Replaces the application settings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Application settings of the app. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateApplicationSettings(string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appSettings == null) - { - throw new ArgumentNullException(nameof(appSettings)); - } - - using var message = CreateUpdateApplicationSettingsRequest(resourceGroupName, name, appSettings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListApplicationSettingsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/appsettings/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the application settings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListApplicationSettingsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListApplicationSettingsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the application settings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListApplicationSettings(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListApplicationSettingsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateAuthSettingsRequest(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/authsettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteAuthSettings); - request.Content = content; - return message; - } - - /// Description for Updates the Authentication / Authorization settings associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Auth settings associated with web app. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateAuthSettingsAsync(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteAuthSettings == null) - { - throw new ArgumentNullException(nameof(siteAuthSettings)); - } - - using var message = CreateUpdateAuthSettingsRequest(resourceGroupName, name, siteAuthSettings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettings value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the Authentication / Authorization settings associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Auth settings associated with web app. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateAuthSettings(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteAuthSettings == null) - { - throw new ArgumentNullException(nameof(siteAuthSettings)); - } - - using var message = CreateUpdateAuthSettingsRequest(resourceGroupName, name, siteAuthSettings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettings value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAuthSettingsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/authsettings/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the Authentication/Authorization settings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetAuthSettingsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetAuthSettingsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettings value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the Authentication/Authorization settings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GetAuthSettings(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetAuthSettingsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettings value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateAuthSettingsV2Request(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/authsettingsV2", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteAuthSettingsV2); - request.Content = content; - return message; - } - - /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Auth settings associated with web app. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateAuthSettingsV2Async(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteAuthSettingsV2 == null) - { - throw new ArgumentNullException(nameof(siteAuthSettingsV2)); - } - - using var message = CreateUpdateAuthSettingsV2Request(resourceGroupName, name, siteAuthSettingsV2); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettingsV2 value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Auth settings associated with web app. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateAuthSettingsV2(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteAuthSettingsV2 == null) - { - throw new ArgumentNullException(nameof(siteAuthSettingsV2)); - } - - using var message = CreateUpdateAuthSettingsV2Request(resourceGroupName, name, siteAuthSettingsV2); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettingsV2 value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAuthSettingsV2Request(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/authsettingsV2/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetAuthSettingsV2Async(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetAuthSettingsV2Request(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettingsV2 value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GetAuthSettingsV2(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetAuthSettingsV2Request(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettingsV2 value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateAzureStorageAccountsRequest(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/azurestorageaccounts", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(azureStorageAccounts); - request.Content = content; - return message; - } - - /// Description for Updates the Azure storage account configurations of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Azure storage accounts of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateAzureStorageAccountsAsync(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (azureStorageAccounts == null) - { - throw new ArgumentNullException(nameof(azureStorageAccounts)); - } - - using var message = CreateUpdateAzureStorageAccountsRequest(resourceGroupName, name, azureStorageAccounts); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AzureStoragePropertyDictionaryResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the Azure storage account configurations of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Azure storage accounts of the app. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateAzureStorageAccounts(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (azureStorageAccounts == null) - { - throw new ArgumentNullException(nameof(azureStorageAccounts)); - } - - using var message = CreateUpdateAzureStorageAccountsRequest(resourceGroupName, name, azureStorageAccounts); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AzureStoragePropertyDictionaryResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListAzureStorageAccountsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/azurestorageaccounts/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the Azure storage account configurations of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListAzureStorageAccountsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListAzureStorageAccountsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AzureStoragePropertyDictionaryResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the Azure storage account configurations of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListAzureStorageAccounts(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListAzureStorageAccountsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AzureStoragePropertyDictionaryResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateBackupConfigurationRequest(string resourceGroupName, string name, BackupRequest request) - { - var message = _pipeline.CreateMessage(); - var request0 = message.Request; - request0.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/backup", false); - uri.AppendQuery("api-version", apiVersion, true); - request0.Uri = uri; - request0.Headers.Add("Accept", "application/json"); - request0.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(request); - request0.Content = content; - return message; - } - - /// Description for Updates the backup configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Edited backup configuration. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateBackupConfigurationAsync(string resourceGroupName, string name, BackupRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateUpdateBackupConfigurationRequest(resourceGroupName, name, request); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupRequest value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupRequest.DeserializeBackupRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the backup configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Edited backup configuration. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateBackupConfiguration(string resourceGroupName, string name, BackupRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateUpdateBackupConfigurationRequest(resourceGroupName, name, request); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupRequest value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupRequest.DeserializeBackupRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteBackupConfigurationRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/backup", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes the backup configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task DeleteBackupConfigurationAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteBackupConfigurationRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes the backup configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response DeleteBackupConfiguration(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteBackupConfigurationRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetBackupConfigurationRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/backup/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the backup configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetBackupConfigurationAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetBackupConfigurationRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupRequest value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupRequest.DeserializeBackupRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the backup configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GetBackupConfiguration(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetBackupConfigurationRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupRequest value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupRequest.DeserializeBackupRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAppSettingsKeyVaultReferencesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/configreferences/appsettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the config reference app settings and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetAppSettingsKeyVaultReferencesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetAppSettingsKeyVaultReferencesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the config reference app settings and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GetAppSettingsKeyVaultReferences(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetAppSettingsKeyVaultReferencesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAppSettingKeyVaultReferenceRequest(string resourceGroupName, string name, string appSettingKey) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/configreferences/appsettings/", false); - uri.AppendPath(appSettingKey, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the config reference and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// App Setting key name. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetAppSettingKeyVaultReferenceAsync(string resourceGroupName, string name, string appSettingKey, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appSettingKey == null) - { - throw new ArgumentNullException(nameof(appSettingKey)); - } - - using var message = CreateGetAppSettingKeyVaultReferenceRequest(resourceGroupName, name, appSettingKey); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApiKVReference value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApiKVReference.DeserializeApiKVReference(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the config reference and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// App Setting key name. - /// The cancellation token to use. - /// , , or is null. - public Response GetAppSettingKeyVaultReference(string resourceGroupName, string name, string appSettingKey, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appSettingKey == null) - { - throw new ArgumentNullException(nameof(appSettingKey)); - } - - using var message = CreateGetAppSettingKeyVaultReferenceRequest(resourceGroupName, name, appSettingKey); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApiKVReference value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApiKVReference.DeserializeApiKVReference(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteConnectionStringKeyVaultReferencesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/configreferences/connectionstrings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the config reference app settings and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetSiteConnectionStringKeyVaultReferencesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetSiteConnectionStringKeyVaultReferencesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the config reference app settings and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GetSiteConnectionStringKeyVaultReferences(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetSiteConnectionStringKeyVaultReferencesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteConnectionStringKeyVaultReferenceRequest(string resourceGroupName, string name, string connectionStringKey) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/configreferences/connectionstrings/", false); - uri.AppendPath(connectionStringKey, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the config reference and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetSiteConnectionStringKeyVaultReferenceAsync(string resourceGroupName, string name, string connectionStringKey, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (connectionStringKey == null) - { - throw new ArgumentNullException(nameof(connectionStringKey)); - } - - using var message = CreateGetSiteConnectionStringKeyVaultReferenceRequest(resourceGroupName, name, connectionStringKey); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApiKVReference value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApiKVReference.DeserializeApiKVReference(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the config reference and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response GetSiteConnectionStringKeyVaultReference(string resourceGroupName, string name, string connectionStringKey, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (connectionStringKey == null) - { - throw new ArgumentNullException(nameof(connectionStringKey)); - } - - using var message = CreateGetSiteConnectionStringKeyVaultReferenceRequest(resourceGroupName, name, connectionStringKey); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApiKVReference value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApiKVReference.DeserializeApiKVReference(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateConnectionStringsRequest(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/connectionstrings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionStrings); - request.Content = content; - return message; - } - - /// Description for Replaces the connection strings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Connection strings of the app or deployment slot. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateConnectionStringsAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (connectionStrings == null) - { - throw new ArgumentNullException(nameof(connectionStrings)); - } - - using var message = CreateUpdateConnectionStringsRequest(resourceGroupName, name, connectionStrings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ConnectionStringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Replaces the connection strings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Connection strings of the app or deployment slot. See example. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateConnectionStrings(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (connectionStrings == null) - { - throw new ArgumentNullException(nameof(connectionStrings)); - } - - using var message = CreateUpdateConnectionStringsRequest(resourceGroupName, name, connectionStrings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ConnectionStringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConnectionStringsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/connectionstrings/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the connection strings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListConnectionStringsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListConnectionStringsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ConnectionStringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the connection strings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListConnectionStrings(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListConnectionStringsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ConnectionStringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetDiagnosticLogsConfigurationRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/logs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the logging configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetDiagnosticLogsConfigurationAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetDiagnosticLogsConfigurationRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteLogsConfig value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the logging configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GetDiagnosticLogsConfiguration(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetDiagnosticLogsConfigurationRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteLogsConfig value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateDiagnosticLogsConfigRequest(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/logs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteLogsConfig); - request.Content = content; - return message; - } - - /// Description for Updates the logging configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// A SiteLogsConfig JSON object that contains the logging configuration to change in the "properties" property. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateDiagnosticLogsConfigAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteLogsConfig == null) - { - throw new ArgumentNullException(nameof(siteLogsConfig)); - } - - using var message = CreateUpdateDiagnosticLogsConfigRequest(resourceGroupName, name, siteLogsConfig); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteLogsConfig value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the logging configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// A SiteLogsConfig JSON object that contains the logging configuration to change in the "properties" property. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateDiagnosticLogsConfig(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteLogsConfig == null) - { - throw new ArgumentNullException(nameof(siteLogsConfig)); - } - - using var message = CreateUpdateDiagnosticLogsConfigRequest(resourceGroupName, name, siteLogsConfig); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteLogsConfig value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateMetadataRequest(string resourceGroupName, string name, StringDictionary metadata) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/metadata", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(metadata); - request.Content = content; - return message; - } - - /// Description for Replaces the metadata of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Edited metadata of the app or deployment slot. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateMetadataAsync(string resourceGroupName, string name, StringDictionary metadata, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (metadata == null) - { - throw new ArgumentNullException(nameof(metadata)); - } - - using var message = CreateUpdateMetadataRequest(resourceGroupName, name, metadata); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Replaces the metadata of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Edited metadata of the app or deployment slot. See example. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateMetadata(string resourceGroupName, string name, StringDictionary metadata, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (metadata == null) - { - throw new ArgumentNullException(nameof(metadata)); - } - - using var message = CreateUpdateMetadataRequest(resourceGroupName, name, metadata); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMetadataRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/metadata/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the metadata of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListMetadataAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMetadataRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the metadata of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListMetadata(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListMetadataRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPublishingCredentialsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/publishingcredentials/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the Git/FTP publishing credentials of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task ListPublishingCredentialsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListPublishingCredentialsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the Git/FTP publishing credentials of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListPublishingCredentials(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListPublishingCredentialsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateSitePushSettingsRequest(string resourceGroupName, string name, PushSettings pushSettings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/pushsettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(pushSettings); - request.Content = content; - return message; - } - - /// Description for Updates the Push settings associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Push settings associated with web app. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateSitePushSettingsAsync(string resourceGroupName, string name, PushSettings pushSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (pushSettings == null) - { - throw new ArgumentNullException(nameof(pushSettings)); - } - - using var message = CreateUpdateSitePushSettingsRequest(resourceGroupName, name, pushSettings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PushSettings value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PushSettings.DeserializePushSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the Push settings associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Push settings associated with web app. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateSitePushSettings(string resourceGroupName, string name, PushSettings pushSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (pushSettings == null) - { - throw new ArgumentNullException(nameof(pushSettings)); - } - - using var message = CreateUpdateSitePushSettingsRequest(resourceGroupName, name, pushSettings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PushSettings value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PushSettings.DeserializePushSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSitePushSettingsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/pushsettings/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the Push settings associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public async Task> ListSitePushSettingsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSitePushSettingsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PushSettings value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PushSettings.DeserializePushSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the Push settings associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public Response ListSitePushSettings(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSitePushSettingsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PushSettings value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PushSettings.DeserializePushSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSlotConfigurationNamesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/slotConfigNames", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the names of app settings and connection strings that stick to the slot (not swapped). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListSlotConfigurationNamesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSlotConfigurationNamesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SlotConfigNamesResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SlotConfigNamesResource.DeserializeSlotConfigNamesResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the names of app settings and connection strings that stick to the slot (not swapped). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListSlotConfigurationNames(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSlotConfigurationNamesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SlotConfigNamesResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SlotConfigNamesResource.DeserializeSlotConfigNamesResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateSlotConfigurationNamesRequest(string resourceGroupName, string name, SlotConfigNamesResource slotConfigNames) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/slotConfigNames", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(slotConfigNames); - request.Content = content; - return message; - } - - /// Description for Updates the names of application settings and connection string that remain with the slot during swap operation. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Names of application settings and connection strings. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateSlotConfigurationNamesAsync(string resourceGroupName, string name, SlotConfigNamesResource slotConfigNames, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slotConfigNames == null) - { - throw new ArgumentNullException(nameof(slotConfigNames)); - } - - using var message = CreateUpdateSlotConfigurationNamesRequest(resourceGroupName, name, slotConfigNames); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SlotConfigNamesResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SlotConfigNamesResource.DeserializeSlotConfigNamesResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the names of application settings and connection string that remain with the slot during swap operation. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Names of application settings and connection strings. See example. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateSlotConfigurationNames(string resourceGroupName, string name, SlotConfigNamesResource slotConfigNames, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slotConfigNames == null) - { - throw new ArgumentNullException(nameof(slotConfigNames)); - } - - using var message = CreateUpdateSlotConfigurationNamesRequest(resourceGroupName, name, slotConfigNames); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SlotConfigNamesResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SlotConfigNamesResource.DeserializeSlotConfigNamesResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetConfigurationRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetConfigurationAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetConfigurationRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GetConfiguration(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetConfigurationRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateConfigurationRequest(string resourceGroupName, string name, SiteConfigResource siteConfig) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteConfig); - request.Content = content; - return message; - } - - /// Description for Updates the configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON representation of a SiteConfig object. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task> CreateOrUpdateConfigurationAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteConfig == null) - { - throw new ArgumentNullException(nameof(siteConfig)); - } - - using var message = CreateCreateOrUpdateConfigurationRequest(resourceGroupName, name, siteConfig); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON representation of a SiteConfig object. See example. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdateConfiguration(string resourceGroupName, string name, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteConfig == null) - { - throw new ArgumentNullException(nameof(siteConfig)); - } - - using var message = CreateCreateOrUpdateConfigurationRequest(resourceGroupName, name, siteConfig); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateConfigurationRequest(string resourceGroupName, string name, SiteConfigResource siteConfig) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteConfig); - request.Content = content; - return message; - } - - /// Description for Updates the configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON representation of a SiteConfig object. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateConfigurationAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteConfig == null) - { - throw new ArgumentNullException(nameof(siteConfig)); - } - - using var message = CreateUpdateConfigurationRequest(resourceGroupName, name, siteConfig); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON representation of a SiteConfig object. See example. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateConfiguration(string resourceGroupName, string name, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteConfig == null) - { - throw new ArgumentNullException(nameof(siteConfig)); - } - - using var message = CreateUpdateConfigurationRequest(resourceGroupName, name, siteConfig); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConfigurationSnapshotInfoRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/web/snapshots", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListConfigurationSnapshotInfoAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListConfigurationSnapshotInfoRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigurationSnapshotInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListConfigurationSnapshotInfo(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListConfigurationSnapshotInfoRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigurationSnapshotInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetConfigurationSnapshotRequest(string resourceGroupName, string name, string snapshotId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/web/snapshots/", false); - uri.AppendPath(snapshotId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a snapshot of the configuration of an app at a previous point in time. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The ID of the snapshot to read. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetConfigurationSnapshotAsync(string resourceGroupName, string name, string snapshotId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (snapshotId == null) - { - throw new ArgumentNullException(nameof(snapshotId)); - } - - using var message = CreateGetConfigurationSnapshotRequest(resourceGroupName, name, snapshotId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a snapshot of the configuration of an app at a previous point in time. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The ID of the snapshot to read. - /// The cancellation token to use. - /// , , or is null. - public Response GetConfigurationSnapshot(string resourceGroupName, string name, string snapshotId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (snapshotId == null) - { - throw new ArgumentNullException(nameof(snapshotId)); - } - - using var message = CreateGetConfigurationSnapshotRequest(resourceGroupName, name, snapshotId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRecoverSiteConfigurationSnapshotRequest(string resourceGroupName, string name, string snapshotId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/config/web/snapshots/", false); - uri.AppendPath(snapshotId, true); - uri.AppendPath("/recover", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Reverts the configuration of an app to a previous snapshot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The ID of the snapshot to read. - /// The cancellation token to use. - /// , , or is null. - public async Task RecoverSiteConfigurationSnapshotAsync(string resourceGroupName, string name, string snapshotId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (snapshotId == null) - { - throw new ArgumentNullException(nameof(snapshotId)); - } - - using var message = CreateRecoverSiteConfigurationSnapshotRequest(resourceGroupName, name, snapshotId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Reverts the configuration of an app to a previous snapshot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The ID of the snapshot to read. - /// The cancellation token to use. - /// , , or is null. - public Response RecoverSiteConfigurationSnapshot(string resourceGroupName, string name, string snapshotId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (snapshotId == null) - { - throw new ArgumentNullException(nameof(snapshotId)); - } - - using var message = CreateRecoverSiteConfigurationSnapshotRequest(resourceGroupName, name, snapshotId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetWebSiteContainerLogsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/containerlogs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/octet-stream"); - return message; - } - - /// Description for Gets the last lines of docker logs for the given site. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public async Task> GetWebSiteContainerLogsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetWebSiteContainerLogsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 204: - return Response.FromValue((Stream)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the last lines of docker logs for the given site. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public Response GetWebSiteContainerLogs(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetWebSiteContainerLogsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 204: - return Response.FromValue((Stream)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetContainerLogsZipRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/containerlogs/zip/download", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/zip"); - return message; - } - - /// Description for Gets the ZIP archived docker log files for the given site. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public async Task> GetContainerLogsZipAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetContainerLogsZipRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 204: - return Response.FromValue((Stream)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the ZIP archived docker log files for the given site. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public Response GetContainerLogsZip(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetContainerLogsZipRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 204: - return Response.FromValue((Stream)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListContinuousWebJobsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/continuouswebjobs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List continuous web jobs for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public async Task> ListContinuousWebJobsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListContinuousWebJobsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContinuousWebJobCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List continuous web jobs for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public Response ListContinuousWebJobs(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListContinuousWebJobsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContinuousWebJobCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetContinuousWebJobRequest(string resourceGroupName, string name, string webJobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/continuouswebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a continuous web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetContinuousWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateGetContinuousWebJobRequest(resourceGroupName, name, webJobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContinuousWebJob value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContinuousWebJob.DeserializeContinuousWebJob(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContinuousWebJob)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a continuous web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public Response GetContinuousWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateGetContinuousWebJobRequest(resourceGroupName, name, webJobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContinuousWebJob value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContinuousWebJob.DeserializeContinuousWebJob(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContinuousWebJob)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteContinuousWebJobRequest(string resourceGroupName, string name, string webJobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/continuouswebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a continuous web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteContinuousWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateDeleteContinuousWebJobRequest(resourceGroupName, name, webJobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a continuous web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteContinuousWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateDeleteContinuousWebJobRequest(resourceGroupName, name, webJobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStartContinuousWebJobRequest(string resourceGroupName, string name, string webJobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/continuouswebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendPath("/start", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Start a continuous web job for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public async Task StartContinuousWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateStartContinuousWebJobRequest(resourceGroupName, name, webJobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Start a continuous web job for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public Response StartContinuousWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateStartContinuousWebJobRequest(resourceGroupName, name, webJobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStopContinuousWebJobRequest(string resourceGroupName, string name, string webJobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/continuouswebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendPath("/stop", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Stop a continuous web job for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public async Task StopContinuousWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateStopContinuousWebJobRequest(resourceGroupName, name, webJobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Stop a continuous web job for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public Response StopContinuousWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateStopContinuousWebJobRequest(resourceGroupName, name, webJobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListDeploymentsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/deployments", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List deployments for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListDeploymentsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListDeploymentsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeploymentCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List deployments for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListDeployments(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListDeploymentsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeploymentCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetDeploymentRequest(string resourceGroupName, string name, string id) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/deployments/", false); - uri.AppendPath(id, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a deployment by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Deployment ID. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetDeploymentAsync(string resourceGroupName, string name, string id, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - - using var message = CreateGetDeploymentRequest(resourceGroupName, name, id); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Deployment value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Deployment.DeserializeDeployment(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a deployment by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Deployment ID. - /// The cancellation token to use. - /// , , or is null. - public Response GetDeployment(string resourceGroupName, string name, string id, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - - using var message = CreateGetDeploymentRequest(resourceGroupName, name, id); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Deployment value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Deployment.DeserializeDeployment(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateDeploymentRequest(string resourceGroupName, string name, string id, Deployment deployment) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/deployments/", false); - uri.AppendPath(id, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(deployment); - request.Content = content; - return message; - } - - /// Description for Create a deployment for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of an existing deployment. - /// Deployment details. - /// The cancellation token to use. - /// , , , or is null. - public async Task> CreateDeploymentAsync(string resourceGroupName, string name, string id, Deployment deployment, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (deployment == null) - { - throw new ArgumentNullException(nameof(deployment)); - } - - using var message = CreateCreateDeploymentRequest(resourceGroupName, name, id, deployment); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Deployment value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Deployment.DeserializeDeployment(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create a deployment for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of an existing deployment. - /// Deployment details. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateDeployment(string resourceGroupName, string name, string id, Deployment deployment, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (deployment == null) - { - throw new ArgumentNullException(nameof(deployment)); - } - - using var message = CreateCreateDeploymentRequest(resourceGroupName, name, id, deployment); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Deployment value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Deployment.DeserializeDeployment(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteDeploymentRequest(string resourceGroupName, string name, string id) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/deployments/", false); - uri.AppendPath(id, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a deployment by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Deployment ID. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteDeploymentAsync(string resourceGroupName, string name, string id, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - - using var message = CreateDeleteDeploymentRequest(resourceGroupName, name, id); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a deployment by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Deployment ID. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteDeployment(string resourceGroupName, string name, string id, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - - using var message = CreateDeleteDeploymentRequest(resourceGroupName, name, id); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListDeploymentLogRequest(string resourceGroupName, string name, string id) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/deployments/", false); - uri.AppendPath(id, true); - uri.AppendPath("/log", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List deployment log for specific deployment for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The ID of a specific deployment. This is the value of the name property in the JSON response from "GET /api/sites/{siteName}/deployments". - /// The cancellation token to use. - /// , , or is null. - public async Task> ListDeploymentLogAsync(string resourceGroupName, string name, string id, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - - using var message = CreateListDeploymentLogRequest(resourceGroupName, name, id); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Deployment value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Deployment.DeserializeDeployment(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List deployment log for specific deployment for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The ID of a specific deployment. This is the value of the name property in the JSON response from "GET /api/sites/{siteName}/deployments". - /// The cancellation token to use. - /// , , or is null. - public Response ListDeploymentLog(string resourceGroupName, string name, string id, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - - using var message = CreateListDeploymentLogRequest(resourceGroupName, name, id); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Deployment value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Deployment.DeserializeDeployment(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDiscoverBackupRequest(string resourceGroupName, string name, RestoreRequest request) - { - var message = _pipeline.CreateMessage(); - var request0 = message.Request; - request0.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/discoverbackup", false); - uri.AppendQuery("api-version", apiVersion, true); - request0.Uri = uri; - request0.Headers.Add("Accept", "application/json"); - request0.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(request); - request0.Content = content; - return message; - } - - /// Description for Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - /// The cancellation token to use. - /// , , or is null. - public async Task> DiscoverBackupAsync(string resourceGroupName, string name, RestoreRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateDiscoverBackupRequest(resourceGroupName, name, request); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RestoreRequest value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RestoreRequest.DeserializeRestoreRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - /// The cancellation token to use. - /// , , or is null. - public Response DiscoverBackup(string resourceGroupName, string name, RestoreRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateDiscoverBackupRequest(resourceGroupName, name, request); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RestoreRequest value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RestoreRequest.DeserializeRestoreRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListDomainOwnershipIdentifiersRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/domainOwnershipIdentifiers", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Lists ownership identifiers for domain associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListDomainOwnershipIdentifiersAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListDomainOwnershipIdentifiersRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IdentifierCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Lists ownership identifiers for domain associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListDomainOwnershipIdentifiers(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListDomainOwnershipIdentifiersRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IdentifierCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetDomainOwnershipIdentifierRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/domainOwnershipIdentifiers/", false); - uri.AppendPath(domainOwnershipIdentifierName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get domain ownership identifier for web app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetDomainOwnershipIdentifierAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - - using var message = CreateGetDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Identifier value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Identifier.DeserializeIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get domain ownership identifier for web app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// The cancellation token to use. - /// , , or is null. - public Response GetDomainOwnershipIdentifier(string resourceGroupName, string name, string domainOwnershipIdentifierName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - - using var message = CreateGetDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Identifier value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Identifier.DeserializeIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateDomainOwnershipIdentifierRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/domainOwnershipIdentifiers/", false); - uri.AppendPath(domainOwnershipIdentifierName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(domainOwnershipIdentifier); - request.Content = content; - return message; - } - - /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// A JSON representation of the domain ownership properties. - /// The cancellation token to use. - /// , , , or is null. - public async Task> CreateOrUpdateDomainOwnershipIdentifierAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - if (domainOwnershipIdentifier == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); - } - - using var message = CreateCreateOrUpdateDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Identifier value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Identifier.DeserializeIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// A JSON representation of the domain ownership properties. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateDomainOwnershipIdentifier(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - if (domainOwnershipIdentifier == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); - } - - using var message = CreateCreateOrUpdateDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Identifier value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Identifier.DeserializeIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteDomainOwnershipIdentifierRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/domainOwnershipIdentifiers/", false); - uri.AppendPath(domainOwnershipIdentifierName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a domain ownership identifier for a web app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteDomainOwnershipIdentifierAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - - using var message = CreateDeleteDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a domain ownership identifier for a web app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteDomainOwnershipIdentifier(string resourceGroupName, string name, string domainOwnershipIdentifierName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - - using var message = CreateDeleteDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateDomainOwnershipIdentifierRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/domainOwnershipIdentifiers/", false); - uri.AppendPath(domainOwnershipIdentifierName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(domainOwnershipIdentifier); - request.Content = content; - return message; - } - - /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// A JSON representation of the domain ownership properties. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateDomainOwnershipIdentifierAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - if (domainOwnershipIdentifier == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); - } - - using var message = CreateUpdateDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Identifier value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Identifier.DeserializeIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// A JSON representation of the domain ownership properties. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateDomainOwnershipIdentifier(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - if (domainOwnershipIdentifier == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); - } - - using var message = CreateUpdateDomainOwnershipIdentifierRequest(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Identifier value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Identifier.DeserializeIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetMSDeployStatusRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/extensions/MSDeploy", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the status of the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public async Task> GetMSDeployStatusAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetMSDeployStatusRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MSDeployStatus value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the status of the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public Response GetMSDeployStatus(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetMSDeployStatusRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MSDeployStatus value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateMSDeployOperationRequest(string resourceGroupName, string name, MSDeploy mSDeploy) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/extensions/MSDeploy", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(mSDeploy); - request.Content = content; - return message; - } - - /// Description for Invoke the MSDeploy web app extension. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Details of MSDeploy operation. - /// The cancellation token to use. - /// , , or is null. - public async Task CreateMSDeployOperationAsync(string resourceGroupName, string name, MSDeploy mSDeploy, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (mSDeploy == null) - { - throw new ArgumentNullException(nameof(mSDeploy)); - } - - using var message = CreateCreateMSDeployOperationRequest(resourceGroupName, name, mSDeploy); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 201: - case 409: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Invoke the MSDeploy web app extension. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Details of MSDeploy operation. - /// The cancellation token to use. - /// , , or is null. - public Response CreateMSDeployOperation(string resourceGroupName, string name, MSDeploy mSDeploy, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (mSDeploy == null) - { - throw new ArgumentNullException(nameof(mSDeploy)); - } - - using var message = CreateCreateMSDeployOperationRequest(resourceGroupName, name, mSDeploy); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 201: - case 409: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetMSDeployLogRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/extensions/MSDeploy/log", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public async Task> GetMSDeployLogAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetMSDeployLogRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MSDeployLog value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MSDeployLog)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public Response GetMSDeployLog(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetMSDeployLogRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MSDeployLog value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MSDeployLog)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListFunctionsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/functions", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the functions for a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public async Task> ListFunctionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListFunctionsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionEnvelopeCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the functions for a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public Response ListFunctions(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListFunctionsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionEnvelopeCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetFunctionsAdminTokenRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/functions/admin/token", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Fetch a short lived token that can be exchanged for a master key. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public async Task> GetFunctionsAdminTokenAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetFunctionsAdminTokenRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - string value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = document.RootElement.GetString(); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Fetch a short lived token that can be exchanged for a master key. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public Response GetFunctionsAdminToken(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetFunctionsAdminTokenRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - string value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = document.RootElement.GetString(); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetFunctionRequest(string resourceGroupName, string name, string functionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get function information by its ID for web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetFunctionAsync(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - - using var message = CreateGetFunctionRequest(resourceGroupName, name, functionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionEnvelope value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionEnvelope.DeserializeFunctionEnvelope(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((FunctionEnvelope)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get function information by its ID for web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// The cancellation token to use. - /// , , or is null. - public Response GetFunction(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - - using var message = CreateGetFunctionRequest(resourceGroupName, name, functionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionEnvelope value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionEnvelope.DeserializeFunctionEnvelope(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((FunctionEnvelope)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateFunctionRequest(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(functionEnvelope); - request.Content = content; - return message; - } - - /// Description for Create function for web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// Function details. - /// The cancellation token to use. - /// , , , or is null. - public async Task CreateFunctionAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (functionEnvelope == null) - { - throw new ArgumentNullException(nameof(functionEnvelope)); - } - - using var message = CreateCreateFunctionRequest(resourceGroupName, name, functionName, functionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 201: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create function for web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// Function details. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateFunction(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (functionEnvelope == null) - { - throw new ArgumentNullException(nameof(functionEnvelope)); - } - - using var message = CreateCreateFunctionRequest(resourceGroupName, name, functionName, functionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 201: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteFunctionRequest(string resourceGroupName, string name, string functionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a function for web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteFunctionAsync(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - - using var message = CreateDeleteFunctionRequest(resourceGroupName, name, functionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a function for web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteFunction(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - - using var message = CreateDeleteFunctionRequest(resourceGroupName, name, functionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateFunctionSecretRequest(string resourceGroupName, string name, string functionName, string keyName, KeyInfo key) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendPath("/keys/", false); - uri.AppendPath(keyName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(key); - request.Content = content; - return message; - } - - /// Description for Add or update a function secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The name of the function. - /// The name of the key. - /// The key to create or update. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> CreateOrUpdateFunctionSecretAsync(string resourceGroupName, string name, string functionName, string keyName, KeyInfo key, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - using var message = CreateCreateOrUpdateFunctionSecretRequest(resourceGroupName, name, functionName, keyName, key); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - KeyInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = KeyInfo.DeserializeKeyInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Add or update a function secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The name of the function. - /// The name of the key. - /// The key to create or update. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateOrUpdateFunctionSecret(string resourceGroupName, string name, string functionName, string keyName, KeyInfo key, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - using var message = CreateCreateOrUpdateFunctionSecretRequest(resourceGroupName, name, functionName, keyName, key); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - KeyInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = KeyInfo.DeserializeKeyInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteFunctionSecretRequest(string resourceGroupName, string name, string functionName, string keyName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendPath("/keys/", false); - uri.AppendPath(keyName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a function secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The name of the function. - /// The name of the key. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteFunctionSecretAsync(string resourceGroupName, string name, string functionName, string keyName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - - using var message = CreateDeleteFunctionSecretRequest(resourceGroupName, name, functionName, keyName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a function secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The name of the function. - /// The name of the key. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteFunctionSecret(string resourceGroupName, string name, string functionName, string keyName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - - using var message = CreateDeleteFunctionSecretRequest(resourceGroupName, name, functionName, keyName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListFunctionKeysRequest(string resourceGroupName, string name, string functionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendPath("/listkeys", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get function keys for a function in a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListFunctionKeysAsync(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - - using var message = CreateListFunctionKeysRequest(resourceGroupName, name, functionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get function keys for a function in a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// The cancellation token to use. - /// , , or is null. - public Response ListFunctionKeys(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - - using var message = CreateListFunctionKeysRequest(resourceGroupName, name, functionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListFunctionSecretsRequest(string resourceGroupName, string name, string functionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendPath("/listsecrets", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get function secrets for a function in a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListFunctionSecretsAsync(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - - using var message = CreateListFunctionSecretsRequest(resourceGroupName, name, functionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionSecrets value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get function secrets for a function in a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// The cancellation token to use. - /// , , or is null. - public Response ListFunctionSecrets(string resourceGroupName, string name, string functionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - - using var message = CreateListFunctionSecretsRequest(resourceGroupName, name, functionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionSecrets value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHostKeysRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/host/default/listkeys", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get host secrets for a function app. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public async Task> ListHostKeysAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHostKeysRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HostKeys value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HostKeys.DeserializeHostKeys(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get host secrets for a function app. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public Response ListHostKeys(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHostKeysRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HostKeys value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HostKeys.DeserializeHostKeys(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSyncStatusRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/host/default/listsyncstatus", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for This is to allow calling via powershell and ARM template. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task ListSyncStatusAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSyncStatusRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for This is to allow calling via powershell and ARM template. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListSyncStatus(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSyncStatusRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateSyncFunctionsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/host/default/sync", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Syncs function trigger metadata to the management database. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task SyncFunctionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateSyncFunctionsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Syncs function trigger metadata to the management database. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response SyncFunctions(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateSyncFunctionsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateHostSecretRequest(string resourceGroupName, string name, string keyType, string keyName, KeyInfo key) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/host/default/", false); - uri.AppendPath(keyType, true); - uri.AppendPath("/", false); - uri.AppendPath(keyName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(key); - request.Content = content; - return message; - } - - /// Description for Add or update a host level secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The type of host key. - /// The name of the key. - /// The key to create or update. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> CreateOrUpdateHostSecretAsync(string resourceGroupName, string name, string keyType, string keyName, KeyInfo key, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (keyType == null) - { - throw new ArgumentNullException(nameof(keyType)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - using var message = CreateCreateOrUpdateHostSecretRequest(resourceGroupName, name, keyType, keyName, key); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - KeyInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = KeyInfo.DeserializeKeyInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Add or update a host level secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The type of host key. - /// The name of the key. - /// The key to create or update. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateOrUpdateHostSecret(string resourceGroupName, string name, string keyType, string keyName, KeyInfo key, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (keyType == null) - { - throw new ArgumentNullException(nameof(keyType)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - using var message = CreateCreateOrUpdateHostSecretRequest(resourceGroupName, name, keyType, keyName, key); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - KeyInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = KeyInfo.DeserializeKeyInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteHostSecretRequest(string resourceGroupName, string name, string keyType, string keyName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/host/default/", false); - uri.AppendPath(keyType, true); - uri.AppendPath("/", false); - uri.AppendPath(keyName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a host level secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The type of host key. - /// The name of the key. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteHostSecretAsync(string resourceGroupName, string name, string keyType, string keyName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (keyType == null) - { - throw new ArgumentNullException(nameof(keyType)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - - using var message = CreateDeleteHostSecretRequest(resourceGroupName, name, keyType, keyName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a host level secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The type of host key. - /// The name of the key. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteHostSecret(string resourceGroupName, string name, string keyType, string keyName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (keyType == null) - { - throw new ArgumentNullException(nameof(keyType)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - - using var message = CreateDeleteHostSecretRequest(resourceGroupName, name, keyType, keyName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHostNameBindingsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hostNameBindings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get hostname bindings for an app or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListHostNameBindingsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHostNameBindingsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HostNameBindingCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get hostname bindings for an app or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListHostNameBindings(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHostNameBindingsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HostNameBindingCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetHostNameBindingRequest(string resourceGroupName, string name, string hostName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hostNameBindings/", false); - uri.AppendPath(hostName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the named hostname binding for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Hostname in the hostname binding. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetHostNameBindingAsync(string resourceGroupName, string name, string hostName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostName == null) - { - throw new ArgumentNullException(nameof(hostName)); - } - - using var message = CreateGetHostNameBindingRequest(resourceGroupName, name, hostName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HostNameBinding value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the named hostname binding for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Hostname in the hostname binding. - /// The cancellation token to use. - /// , , or is null. - public Response GetHostNameBinding(string resourceGroupName, string name, string hostName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostName == null) - { - throw new ArgumentNullException(nameof(hostName)); - } - - using var message = CreateGetHostNameBindingRequest(resourceGroupName, name, hostName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HostNameBinding value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateHostNameBindingRequest(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hostNameBindings/", false); - uri.AppendPath(hostName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(hostNameBinding); - request.Content = content; - return message; - } - - /// Description for Creates a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Hostname in the hostname binding. - /// Binding details. This is the JSON representation of a HostNameBinding object. - /// The cancellation token to use. - /// , , , or is null. - public async Task> CreateOrUpdateHostNameBindingAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostName == null) - { - throw new ArgumentNullException(nameof(hostName)); - } - if (hostNameBinding == null) - { - throw new ArgumentNullException(nameof(hostNameBinding)); - } - - using var message = CreateCreateOrUpdateHostNameBindingRequest(resourceGroupName, name, hostName, hostNameBinding); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HostNameBinding value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Hostname in the hostname binding. - /// Binding details. This is the JSON representation of a HostNameBinding object. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateHostNameBinding(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostName == null) - { - throw new ArgumentNullException(nameof(hostName)); - } - if (hostNameBinding == null) - { - throw new ArgumentNullException(nameof(hostNameBinding)); - } - - using var message = CreateCreateOrUpdateHostNameBindingRequest(resourceGroupName, name, hostName, hostNameBinding); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HostNameBinding value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteHostNameBindingRequest(string resourceGroupName, string name, string hostName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hostNameBindings/", false); - uri.AppendPath(hostName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Hostname in the hostname binding. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteHostNameBindingAsync(string resourceGroupName, string name, string hostName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostName == null) - { - throw new ArgumentNullException(nameof(hostName)); - } - - using var message = CreateDeleteHostNameBindingRequest(resourceGroupName, name, hostName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Hostname in the hostname binding. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteHostNameBinding(string resourceGroupName, string name, string hostName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostName == null) - { - throw new ArgumentNullException(nameof(hostName)); - } - - using var message = CreateDeleteHostNameBindingRequest(resourceGroupName, name, hostName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridConnectionNamespaces/", false); - uri.AppendPath(namespaceName, true); - uri.AppendPath("/relays/", false); - uri.AppendPath(relayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateGetHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The cancellation token to use. - /// , , , or is null. - public Response GetHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateGetHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridConnectionNamespaces/", false); - uri.AppendPath(namespaceName, true); - uri.AppendPath("/relays/", false); - uri.AppendPath(relayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new Hybrid Connection using a Service Bus relay. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The details of the hybrid connection. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> CreateOrUpdateHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new Hybrid Connection using a Service Bus relay. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The details of the hybrid connection. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateOrUpdateHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridConnectionNamespaces/", false); - uri.AppendPath(namespaceName, true); - uri.AppendPath("/relays/", false); - uri.AppendPath(relayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Removes a Hybrid Connection from this site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateDeleteHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Removes a Hybrid Connection from this site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - - using var message = CreateDeleteHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateHybridConnectionRequest(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridConnectionNamespaces/", false); - uri.AppendPath(namespaceName, true); - uri.AppendPath("/relays/", false); - uri.AppendPath(relayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new Hybrid Connection using a Service Bus relay. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The details of the hybrid connection. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> UpdateHybridConnectionAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new Hybrid Connection using a Service Bus relay. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The details of the hybrid connection. - /// The cancellation token to use. - /// , , , , or is null. - public Response UpdateHybridConnection(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateHybridConnectionRequest(resourceGroupName, name, namespaceName, relayName, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHybridConnectionsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridConnectionRelays", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The cancellation token to use. - /// or is null. - public async Task> ListHybridConnectionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHybridConnectionsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The cancellation token to use. - /// or is null. - public Response ListHybridConnections(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHybridConnectionsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRelayServiceConnectionsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridconnection", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets hybrid connections configured for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListRelayServiceConnectionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListRelayServiceConnectionsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets hybrid connections configured for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListRelayServiceConnections(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListRelayServiceConnectionsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRelayServiceConnectionRequest(string resourceGroupName, string name, string entityName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridconnection/", false); - uri.AppendPath(entityName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a hybrid connection configuration by its name. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetRelayServiceConnectionAsync(string resourceGroupName, string name, string entityName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - - using var message = CreateGetRelayServiceConnectionRequest(resourceGroupName, name, entityName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a hybrid connection configuration by its name. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection. - /// The cancellation token to use. - /// , , or is null. - public Response GetRelayServiceConnection(string resourceGroupName, string name, string entityName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - - using var message = CreateGetRelayServiceConnectionRequest(resourceGroupName, name, entityName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRelayServiceConnectionRequest(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridconnection/", false); - uri.AppendPath(entityName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection configuration. - /// Details of the hybrid connection configuration. - /// The cancellation token to use. - /// , , , or is null. - public async Task> CreateOrUpdateRelayServiceConnectionAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateRelayServiceConnectionRequest(resourceGroupName, name, entityName, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection configuration. - /// Details of the hybrid connection configuration. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateRelayServiceConnection(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateRelayServiceConnectionRequest(resourceGroupName, name, entityName, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRelayServiceConnectionRequest(string resourceGroupName, string name, string entityName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridconnection/", false); - uri.AppendPath(entityName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a relay service connection by its name. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection configuration. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteRelayServiceConnectionAsync(string resourceGroupName, string name, string entityName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - - using var message = CreateDeleteRelayServiceConnectionRequest(resourceGroupName, name, entityName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a relay service connection by its name. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection configuration. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteRelayServiceConnection(string resourceGroupName, string name, string entityName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - - using var message = CreateDeleteRelayServiceConnectionRequest(resourceGroupName, name, entityName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRelayServiceConnectionRequest(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridconnection/", false); - uri.AppendPath(entityName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection configuration. - /// Details of the hybrid connection configuration. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateRelayServiceConnectionAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateRelayServiceConnectionRequest(resourceGroupName, name, entityName, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection configuration. - /// Details of the hybrid connection configuration. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateRelayServiceConnection(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateRelayServiceConnectionRequest(resourceGroupName, name, entityName, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceIdentifiersRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/instances", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all scale-out instances of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListInstanceIdentifiersAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListInstanceIdentifiersRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppInstanceStatusCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all scale-out instances of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListInstanceIdentifiers(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListInstanceIdentifiersRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppInstanceStatusCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceInfoRequest(string resourceGroupName, string name, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all scale-out instances of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetInstanceInfoAsync(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceInfoRequest(resourceGroupName, name, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebSiteInstanceStatus value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebSiteInstanceStatus.DeserializeWebSiteInstanceStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all scale-out instances of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response GetInstanceInfo(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceInfoRequest(resourceGroupName, name, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebSiteInstanceStatus value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebSiteInstanceStatus.DeserializeWebSiteInstanceStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceMsDeployStatusRequest(string resourceGroupName, string name, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/extensions/MSDeploy", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the status of the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// ID of web app instance. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetInstanceMsDeployStatusAsync(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceMsDeployStatusRequest(resourceGroupName, name, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MSDeployStatus value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the status of the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// ID of web app instance. - /// The cancellation token to use. - /// , , or is null. - public Response GetInstanceMsDeployStatus(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceMsDeployStatusRequest(resourceGroupName, name, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MSDeployStatus value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateInstanceMSDeployOperationRequest(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/extensions/MSDeploy", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(mSDeploy); - request.Content = content; - return message; - } - - /// Description for Invoke the MSDeploy web app extension. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// ID of web app instance. - /// Details of MSDeploy operation. - /// The cancellation token to use. - /// , , , or is null. - public async Task CreateInstanceMSDeployOperationAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - if (mSDeploy == null) - { - throw new ArgumentNullException(nameof(mSDeploy)); - } - - using var message = CreateCreateInstanceMSDeployOperationRequest(resourceGroupName, name, instanceId, mSDeploy); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 201: - case 409: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Invoke the MSDeploy web app extension. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// ID of web app instance. - /// Details of MSDeploy operation. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateInstanceMSDeployOperation(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - if (mSDeploy == null) - { - throw new ArgumentNullException(nameof(mSDeploy)); - } - - using var message = CreateCreateInstanceMSDeployOperationRequest(resourceGroupName, name, instanceId, mSDeploy); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 201: - case 409: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceMSDeployLogRequest(string resourceGroupName, string name, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/extensions/MSDeploy/log", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// ID of web app instance. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetInstanceMSDeployLogAsync(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceMSDeployLogRequest(resourceGroupName, name, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MSDeployLog value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MSDeployLog)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// ID of web app instance. - /// The cancellation token to use. - /// , , or is null. - public Response GetInstanceMSDeployLog(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceMSDeployLogRequest(resourceGroupName, name, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MSDeployLog value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MSDeployLog)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceProcessesRequest(string resourceGroupName, string name, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , or is null. - public async Task> ListInstanceProcessesAsync(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessesRequest(resourceGroupName, name, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , or is null. - public Response ListInstanceProcesses(string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessesRequest(resourceGroupName, name, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceProcessRequest(string resourceGroupName, string name, string processId, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetInstanceProcessAsync(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceProcessRequest(resourceGroupName, name, processId, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessInfo.DeserializeProcessInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfo)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public Response GetInstanceProcess(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceProcessRequest(resourceGroupName, name, processId, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessInfo.DeserializeProcessInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfo)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteInstanceProcessRequest(string resourceGroupName, string name, string processId, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteInstanceProcessAsync(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateDeleteInstanceProcessRequest(resourceGroupName, name, processId, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteInstanceProcess(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateDeleteInstanceProcessRequest(resourceGroupName, name, processId, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceProcessDumpRequest(string resourceGroupName, string name, string processId, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/dump", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetInstanceProcessDumpAsync(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceProcessDumpRequest(resourceGroupName, name, processId, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((Stream)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public Response GetInstanceProcessDump(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceProcessDumpRequest(resourceGroupName, name, processId, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((Stream)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceProcessModulesRequest(string resourceGroupName, string name, string processId, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/modules", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListInstanceProcessModulesAsync(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessModulesRequest(resourceGroupName, name, processId, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public Response ListInstanceProcessModules(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessModulesRequest(resourceGroupName, name, processId, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceProcessModuleRequest(string resourceGroupName, string name, string processId, string baseAddress, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/modules/", false); - uri.AppendPath(baseAddress, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Module base address. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public async Task> GetInstanceProcessModuleAsync(string resourceGroupName, string name, string processId, string baseAddress, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (baseAddress == null) - { - throw new ArgumentNullException(nameof(baseAddress)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceProcessModuleRequest(resourceGroupName, name, processId, baseAddress, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfo)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Module base address. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public Response GetInstanceProcessModule(string resourceGroupName, string name, string processId, string baseAddress, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (baseAddress == null) - { - throw new ArgumentNullException(nameof(baseAddress)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceProcessModuleRequest(resourceGroupName, name, processId, baseAddress, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfo)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceProcessThreadsRequest(string resourceGroupName, string name, string processId, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/threads", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListInstanceProcessThreadsAsync(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessThreadsRequest(resourceGroupName, name, processId, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public Response ListInstanceProcessThreads(string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessThreadsRequest(resourceGroupName, name, processId, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateIsCloneableRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/iscloneable", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Shows whether an app can be cloned to another resource group or subscription. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> IsCloneableAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateIsCloneableRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteCloneability value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteCloneability.DeserializeSiteCloneability(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Shows whether an app can be cloned to another resource group or subscription. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response IsCloneable(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateIsCloneableRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteCloneability value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteCloneability.DeserializeSiteCloneability(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteBackupsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/listbackups", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets existing backups of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListSiteBackupsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSiteBackupsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets existing backups of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListSiteBackups(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSiteBackupsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSyncFunctionTriggersRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/listsyncfunctiontriggerstatus", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for This is to allow calling via powershell and ARM template. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListSyncFunctionTriggersAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSyncFunctionTriggersRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionSecrets value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for This is to allow calling via powershell and ARM template. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListSyncFunctionTriggers(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSyncFunctionTriggersRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionSecrets value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateMigrateStorageRequest(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/migrate", false); - uri.AppendQuery("subscriptionName", subscriptionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(migrationOptions); - request.Content = content; - return message; - } - - /// Description for Restores a web app. - /// Azure subscription. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Migration migrationOptions. - /// The cancellation token to use. - /// , , , or is null. - public async Task MigrateStorageAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, CancellationToken cancellationToken = default) - { - if (subscriptionName == null) - { - throw new ArgumentNullException(nameof(subscriptionName)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (migrationOptions == null) - { - throw new ArgumentNullException(nameof(migrationOptions)); - } - - using var message = CreateMigrateStorageRequest(subscriptionName, resourceGroupName, name, migrationOptions); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Restores a web app. - /// Azure subscription. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Migration migrationOptions. - /// The cancellation token to use. - /// , , , or is null. - public Response MigrateStorage(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, CancellationToken cancellationToken = default) - { - if (subscriptionName == null) - { - throw new ArgumentNullException(nameof(subscriptionName)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (migrationOptions == null) - { - throw new ArgumentNullException(nameof(migrationOptions)); - } - - using var message = CreateMigrateStorageRequest(subscriptionName, resourceGroupName, name, migrationOptions); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateMigrateMySqlRequest(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/migratemysql", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(migrationRequestEnvelope); - request.Content = content; - return message; - } - - /// Description for Migrates a local (in-app) MySql database to a remote MySql database. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// MySql migration options. - /// The cancellation token to use. - /// , , or is null. - public async Task MigrateMySqlAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (migrationRequestEnvelope == null) - { - throw new ArgumentNullException(nameof(migrationRequestEnvelope)); - } - - using var message = CreateMigrateMySqlRequest(resourceGroupName, name, migrationRequestEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Migrates a local (in-app) MySql database to a remote MySql database. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// MySql migration options. - /// The cancellation token to use. - /// , , or is null. - public Response MigrateMySql(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (migrationRequestEnvelope == null) - { - throw new ArgumentNullException(nameof(migrationRequestEnvelope)); - } - - using var message = CreateMigrateMySqlRequest(resourceGroupName, name, migrationRequestEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetMigrateMySqlStatusRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/migratemysql/status", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public async Task> GetMigrateMySqlStatusAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetMigrateMySqlStatusRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MigrateMySqlStatus value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MigrateMySqlStatus.DeserializeMigrateMySqlStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public Response GetMigrateMySqlStatus(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetMigrateMySqlStatusRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MigrateMySqlStatus value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MigrateMySqlStatus.DeserializeMigrateMySqlStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSwiftVirtualNetworkConnectionRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/networkConfig/virtualNetwork", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a Swift Virtual Network connection. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetSwiftVirtualNetworkConnectionAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetSwiftVirtualNetworkConnectionRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SwiftVirtualNetwork value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SwiftVirtualNetwork.DeserializeSwiftVirtualNetwork(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a Swift Virtual Network connection. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GetSwiftVirtualNetworkConnection(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetSwiftVirtualNetworkConnectionRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SwiftVirtualNetwork value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SwiftVirtualNetwork.DeserializeSwiftVirtualNetwork(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckRequest(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/networkConfig/virtualNetwork", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// - /// Description for Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Properties of the Virtual Network connection. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task> CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckRequest(resourceGroupName, name, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SwiftVirtualNetwork value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SwiftVirtualNetwork.DeserializeSwiftVirtualNetwork(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// - /// Description for Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Properties of the Virtual Network connection. See example. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckRequest(resourceGroupName, name, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SwiftVirtualNetwork value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SwiftVirtualNetwork.DeserializeSwiftVirtualNetwork(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteSwiftVirtualNetworkRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/networkConfig/virtualNetwork", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task DeleteSwiftVirtualNetworkAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteSwiftVirtualNetworkRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response DeleteSwiftVirtualNetwork(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteSwiftVirtualNetworkRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNetworkFeaturesRequest(string resourceGroupName, string name, string view) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/networkFeatures/", false); - uri.AppendPath(view, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all network features used by the app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The type of view. Only "summary" is supported at this time. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListNetworkFeaturesAsync(string resourceGroupName, string name, string view, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (view == null) - { - throw new ArgumentNullException(nameof(view)); - } - - using var message = CreateListNetworkFeaturesRequest(resourceGroupName, name, view); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkFeatures value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NetworkFeatures.DeserializeNetworkFeatures(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NetworkFeatures)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all network features used by the app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The type of view. Only "summary" is supported at this time. - /// The cancellation token to use. - /// , , or is null. - public Response ListNetworkFeatures(string resourceGroupName, string name, string view, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (view == null) - { - throw new ArgumentNullException(nameof(view)); - } - - using var message = CreateListNetworkFeaturesRequest(resourceGroupName, name, view); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkFeatures value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NetworkFeatures.DeserializeNetworkFeatures(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NetworkFeatures)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetNetworkTraceOperationRequest(string resourceGroupName, string name, string operationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/networkTrace/operationresults/", false); - uri.AppendPath(operationId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetNetworkTraceOperationAsync(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - - using var message = CreateGetNetworkTraceOperationRequest(resourceGroupName, name, operationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - case 202: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// The cancellation token to use. - /// , , or is null. - public Response GetNetworkTraceOperation(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - - using var message = CreateGetNetworkTraceOperationRequest(resourceGroupName, name, operationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - case 202: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStartWebSiteNetworkTraceRequest(string resourceGroupName, string name, int? durationInSeconds, int? maxFrameLength, string sasUrl) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/networkTrace/start", false); - if (durationInSeconds != null) - { - uri.AppendQuery("durationInSeconds", durationInSeconds.Value, true); - } - if (maxFrameLength != null) - { - uri.AppendQuery("maxFrameLength", maxFrameLength.Value, true); - } - if (sasUrl != null) - { - uri.AppendQuery("sasUrl", sasUrl, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Start capturing network packets for the site (To be deprecated). - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The duration to keep capturing in seconds. - /// The maximum frame length in bytes (Optional). - /// The Blob URL to store capture file. - /// The cancellation token to use. - /// or is null. - public async Task> StartWebSiteNetworkTraceAsync(string resourceGroupName, string name, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStartWebSiteNetworkTraceRequest(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - string value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = document.RootElement.GetString(); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Start capturing network packets for the site (To be deprecated). - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The duration to keep capturing in seconds. - /// The maximum frame length in bytes (Optional). - /// The Blob URL to store capture file. - /// The cancellation token to use. - /// or is null. - public Response StartWebSiteNetworkTrace(string resourceGroupName, string name, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStartWebSiteNetworkTraceRequest(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - string value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = document.RootElement.GetString(); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStartWebSiteNetworkTraceOperationRequest(string resourceGroupName, string name, int? durationInSeconds, int? maxFrameLength, string sasUrl) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/networkTrace/startOperation", false); - if (durationInSeconds != null) - { - uri.AppendQuery("durationInSeconds", durationInSeconds.Value, true); - } - if (maxFrameLength != null) - { - uri.AppendQuery("maxFrameLength", maxFrameLength.Value, true); - } - if (sasUrl != null) - { - uri.AppendQuery("sasUrl", sasUrl, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Start capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The duration to keep capturing in seconds. - /// The maximum frame length in bytes (Optional). - /// The Blob URL to store capture file. - /// The cancellation token to use. - /// or is null. - public async Task StartWebSiteNetworkTraceOperationAsync(string resourceGroupName, string name, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStartWebSiteNetworkTraceOperationRequest(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Start capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The duration to keep capturing in seconds. - /// The maximum frame length in bytes (Optional). - /// The Blob URL to store capture file. - /// The cancellation token to use. - /// or is null. - public Response StartWebSiteNetworkTraceOperation(string resourceGroupName, string name, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStartWebSiteNetworkTraceOperationRequest(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStopWebSiteNetworkTraceRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/networkTrace/stop", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Stop ongoing capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The cancellation token to use. - /// or is null. - public async Task StopWebSiteNetworkTraceAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStopWebSiteNetworkTraceRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Stop ongoing capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The cancellation token to use. - /// or is null. - public Response StopWebSiteNetworkTrace(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStopWebSiteNetworkTraceRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetNetworkTracesRequest(string resourceGroupName, string name, string operationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/networkTrace/", false); - uri.AppendPath(operationId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// The cancellation token to use. - /// , , or is null. - public async Task>> GetNetworkTracesAsync(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - - using var message = CreateGetNetworkTracesRequest(resourceGroupName, name, operationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// The cancellation token to use. - /// , , or is null. - public Response> GetNetworkTraces(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - - using var message = CreateGetNetworkTracesRequest(resourceGroupName, name, operationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetNetworkTraceOperationV2Request(string resourceGroupName, string name, string operationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/networkTraces/current/operationresults/", false); - uri.AppendPath(operationId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetNetworkTraceOperationV2Async(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - - using var message = CreateGetNetworkTraceOperationV2Request(resourceGroupName, name, operationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - case 202: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// The cancellation token to use. - /// , , or is null. - public Response GetNetworkTraceOperationV2(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - - using var message = CreateGetNetworkTraceOperationV2Request(resourceGroupName, name, operationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - case 202: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetNetworkTracesV2Request(string resourceGroupName, string name, string operationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/networkTraces/", false); - uri.AppendPath(operationId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// The cancellation token to use. - /// , , or is null. - public async Task>> GetNetworkTracesV2Async(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - - using var message = CreateGetNetworkTracesV2Request(resourceGroupName, name, operationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// The cancellation token to use. - /// , , or is null. - public Response> GetNetworkTracesV2(string resourceGroupName, string name, string operationId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - - using var message = CreateGetNetworkTracesV2Request(resourceGroupName, name, operationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGenerateNewSitePublishingPasswordRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/newpassword", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Generates a new publishing password for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task GenerateNewSitePublishingPasswordAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGenerateNewSitePublishingPasswordRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Generates a new publishing password for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GenerateNewSitePublishingPassword(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGenerateNewSitePublishingPasswordRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPerfMonCountersRequest(string resourceGroupName, string name, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/perfcounters", false); - uri.AppendQuery("api-version", apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets perfmon counters for web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// or is null. - public async Task> ListPerfMonCountersAsync(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListPerfMonCountersRequest(resourceGroupName, name, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PerfMonCounterCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets perfmon counters for web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// or is null. - public Response ListPerfMonCounters(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListPerfMonCountersRequest(resourceGroupName, name, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PerfMonCounterCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSitePhpErrorLogFlagRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/phplogging", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets web app's event logs. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public async Task> GetSitePhpErrorLogFlagAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetSitePhpErrorLogFlagRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SitePhpErrorLogFlag value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SitePhpErrorLogFlag.DeserializeSitePhpErrorLogFlag(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets web app's event logs. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public Response GetSitePhpErrorLogFlag(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetSitePhpErrorLogFlagRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SitePhpErrorLogFlag value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SitePhpErrorLogFlag.DeserializeSitePhpErrorLogFlag(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPremierAddOnsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/premieraddons", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the premier add-ons of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListPremierAddOnsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListPremierAddOnsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the premier add-ons of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListPremierAddOns(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListPremierAddOnsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPremierAddOnRequest(string resourceGroupName, string name, string premierAddOnName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/premieraddons/", false); - uri.AppendPath(premierAddOnName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a named add-on of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetPremierAddOnAsync(string resourceGroupName, string name, string premierAddOnName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - - using var message = CreateGetPremierAddOnRequest(resourceGroupName, name, premierAddOnName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a named add-on of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// The cancellation token to use. - /// , , or is null. - public Response GetPremierAddOn(string resourceGroupName, string name, string premierAddOnName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - - using var message = CreateGetPremierAddOnRequest(resourceGroupName, name, premierAddOnName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateAddPremierAddOnRequest(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/premieraddons/", false); - uri.AppendPath(premierAddOnName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(premierAddOn); - request.Content = content; - return message; - } - - /// Description for Updates a named add-on of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// A JSON representation of the edited premier add-on. - /// The cancellation token to use. - /// , , , or is null. - public async Task> AddPremierAddOnAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - if (premierAddOn == null) - { - throw new ArgumentNullException(nameof(premierAddOn)); - } - - using var message = CreateAddPremierAddOnRequest(resourceGroupName, name, premierAddOnName, premierAddOn); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates a named add-on of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// A JSON representation of the edited premier add-on. - /// The cancellation token to use. - /// , , , or is null. - public Response AddPremierAddOn(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - if (premierAddOn == null) - { - throw new ArgumentNullException(nameof(premierAddOn)); - } - - using var message = CreateAddPremierAddOnRequest(resourceGroupName, name, premierAddOnName, premierAddOn); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeletePremierAddOnRequest(string resourceGroupName, string name, string premierAddOnName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/premieraddons/", false); - uri.AppendPath(premierAddOnName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a premier add-on from an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// The cancellation token to use. - /// , , or is null. - public async Task DeletePremierAddOnAsync(string resourceGroupName, string name, string premierAddOnName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - - using var message = CreateDeletePremierAddOnRequest(resourceGroupName, name, premierAddOnName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a premier add-on from an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// The cancellation token to use. - /// , , or is null. - public Response DeletePremierAddOn(string resourceGroupName, string name, string premierAddOnName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - - using var message = CreateDeletePremierAddOnRequest(resourceGroupName, name, premierAddOnName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdatePremierAddOnRequest(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/premieraddons/", false); - uri.AppendPath(premierAddOnName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(premierAddOn); - request.Content = content; - return message; - } - - /// Description for Updates a named add-on of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// A JSON representation of the edited premier add-on. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdatePremierAddOnAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - if (premierAddOn == null) - { - throw new ArgumentNullException(nameof(premierAddOn)); - } - - using var message = CreateUpdatePremierAddOnRequest(resourceGroupName, name, premierAddOnName, premierAddOn); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates a named add-on of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// A JSON representation of the edited premier add-on. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdatePremierAddOn(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - if (premierAddOn == null) - { - throw new ArgumentNullException(nameof(premierAddOn)); - } - - using var message = CreateUpdatePremierAddOnRequest(resourceGroupName, name, premierAddOnName, premierAddOn); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateAccessRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateAccess/virtualNetworks", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets data around private site access enablement and authorized Virtual Networks that can access the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The cancellation token to use. - /// or is null. - public async Task> GetPrivateAccessAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateAccessRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateAccess value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateAccess.DeserializePrivateAccess(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets data around private site access enablement and authorized Virtual Networks that can access the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The cancellation token to use. - /// or is null. - public Response GetPrivateAccess(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateAccessRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateAccess value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateAccess.DeserializePrivateAccess(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreatePutPrivateAccessVnetRequest(string resourceGroupName, string name, PrivateAccess access) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateAccess/virtualNetworks", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(access); - request.Content = content; - return message; - } - - /// Description for Sets data around private site access enablement and authorized Virtual Networks that can access the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The information for the private access. - /// The cancellation token to use. - /// , , or is null. - public async Task> PutPrivateAccessVnetAsync(string resourceGroupName, string name, PrivateAccess access, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (access == null) - { - throw new ArgumentNullException(nameof(access)); - } - - using var message = CreatePutPrivateAccessVnetRequest(resourceGroupName, name, access); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateAccess value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateAccess.DeserializePrivateAccess(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Sets data around private site access enablement and authorized Virtual Networks that can access the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The information for the private access. - /// The cancellation token to use. - /// , , or is null. - public Response PutPrivateAccessVnet(string resourceGroupName, string name, PrivateAccess access, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (access == null) - { - throw new ArgumentNullException(nameof(access)); - } - - using var message = CreatePutPrivateAccessVnetRequest(resourceGroupName, name, access); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateAccess value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateAccess.DeserializePrivateAccess(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateEndpointConnectionListRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the list of private endpoint connections associated with a site. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The cancellation token to use. - /// or is null. - public async Task> GetPrivateEndpointConnectionListAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateEndpointConnectionListRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the list of private endpoint connections associated with a site. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The cancellation token to use. - /// or is null. - public Response GetPrivateEndpointConnectionList(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateEndpointConnectionListRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// Name of the private endpoint connection. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetPrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - - using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RemotePrivateEndpointConnectionARMResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// Name of the private endpoint connection. - /// The cancellation token to use. - /// , , or is null. - public Response GetPrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - - using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RemotePrivateEndpointConnectionARMResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateApproveOrRejectPrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(privateEndpointWrapper); - request.Content = content; - return message; - } - - /// Description for Approves or rejects a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The String to use. - /// The PrivateLinkConnectionApprovalRequestResource to use. - /// The cancellation token to use. - /// , , , or is null. - public async Task ApproveOrRejectPrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - if (privateEndpointWrapper == null) - { - throw new ArgumentNullException(nameof(privateEndpointWrapper)); - } - - using var message = CreateApproveOrRejectPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Approves or rejects a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The String to use. - /// The PrivateLinkConnectionApprovalRequestResource to use. - /// The cancellation token to use. - /// , , , or is null. - public Response ApproveOrRejectPrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - if (privateEndpointWrapper == null) - { - throw new ArgumentNullException(nameof(privateEndpointWrapper)); - } - - using var message = CreateApproveOrRejectPrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeletePrivateEndpointConnectionRequest(string resourceGroupName, string name, string privateEndpointConnectionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task DeletePrivateEndpointConnectionAsync(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - - using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response DeletePrivateEndpointConnection(string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - - using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, name, privateEndpointConnectionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateLinkResourcesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the private link resources. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The cancellation token to use. - /// or is null. - public async Task> GetPrivateLinkResourcesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateLinkResourcesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateLinkResourcesWrapper value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the private link resources. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The cancellation token to use. - /// or is null. - public Response GetPrivateLinkResources(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateLinkResourcesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateLinkResourcesWrapper value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProcessesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/processes", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public async Task> ListProcessesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListProcessesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public Response ListProcesses(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListProcessesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetProcessRequest(string resourceGroupName, string name, string processId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetProcessAsync(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateGetProcessRequest(resourceGroupName, name, processId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessInfo.DeserializeProcessInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfo)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , or is null. - public Response GetProcess(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateGetProcessRequest(resourceGroupName, name, processId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessInfo.DeserializeProcessInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfo)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteProcessRequest(string resourceGroupName, string name, string processId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteProcessAsync(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateDeleteProcessRequest(resourceGroupName, name, processId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteProcess(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateDeleteProcessRequest(resourceGroupName, name, processId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetProcessDumpRequest(string resourceGroupName, string name, string processId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/dump", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetProcessDumpAsync(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateGetProcessDumpRequest(resourceGroupName, name, processId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((Stream)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , or is null. - public Response GetProcessDump(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateGetProcessDumpRequest(resourceGroupName, name, processId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((Stream)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProcessModulesRequest(string resourceGroupName, string name, string processId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/modules", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListProcessModulesAsync(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateListProcessModulesRequest(resourceGroupName, name, processId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , or is null. - public Response ListProcessModules(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateListProcessModulesRequest(resourceGroupName, name, processId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetProcessModuleRequest(string resourceGroupName, string name, string processId, string baseAddress) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/modules/", false); - uri.AppendPath(baseAddress, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Module base address. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetProcessModuleAsync(string resourceGroupName, string name, string processId, string baseAddress, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (baseAddress == null) - { - throw new ArgumentNullException(nameof(baseAddress)); - } - - using var message = CreateGetProcessModuleRequest(resourceGroupName, name, processId, baseAddress); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfo)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Module base address. - /// The cancellation token to use. - /// , , , or is null. - public Response GetProcessModule(string resourceGroupName, string name, string processId, string baseAddress, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (baseAddress == null) - { - throw new ArgumentNullException(nameof(baseAddress)); - } - - using var message = CreateGetProcessModuleRequest(resourceGroupName, name, processId, baseAddress); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfo)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProcessThreadsRequest(string resourceGroupName, string name, string processId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/threads", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListProcessThreadsAsync(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateListProcessThreadsRequest(resourceGroupName, name, processId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , or is null. - public Response ListProcessThreads(string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateListProcessThreadsRequest(resourceGroupName, name, processId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPublicCertificatesRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/publicCertificates", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get public certificates for an app or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListPublicCertificatesAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListPublicCertificatesRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PublicCertificateCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get public certificates for an app or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListPublicCertificates(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListPublicCertificatesRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PublicCertificateCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPublicCertificateRequest(string resourceGroupName, string name, string publicCertificateName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/publicCertificates/", false); - uri.AppendPath(publicCertificateName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the named public certificate for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Public certificate name. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetPublicCertificateAsync(string resourceGroupName, string name, string publicCertificateName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (publicCertificateName == null) - { - throw new ArgumentNullException(nameof(publicCertificateName)); - } - - using var message = CreateGetPublicCertificateRequest(resourceGroupName, name, publicCertificateName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PublicCertificate value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PublicCertificate.DeserializePublicCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the named public certificate for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Public certificate name. - /// The cancellation token to use. - /// , , or is null. - public Response GetPublicCertificate(string resourceGroupName, string name, string publicCertificateName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (publicCertificateName == null) - { - throw new ArgumentNullException(nameof(publicCertificateName)); - } - - using var message = CreateGetPublicCertificateRequest(resourceGroupName, name, publicCertificateName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PublicCertificate value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PublicCertificate.DeserializePublicCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdatePublicCertificateRequest(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/publicCertificates/", false); - uri.AppendPath(publicCertificateName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(publicCertificate); - request.Content = content; - return message; - } - - /// Description for Creates a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Public certificate name. - /// Public certificate details. This is the JSON representation of a PublicCertificate object. - /// The cancellation token to use. - /// , , , or is null. - public async Task> CreateOrUpdatePublicCertificateAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (publicCertificateName == null) - { - throw new ArgumentNullException(nameof(publicCertificateName)); - } - if (publicCertificate == null) - { - throw new ArgumentNullException(nameof(publicCertificate)); - } - - using var message = CreateCreateOrUpdatePublicCertificateRequest(resourceGroupName, name, publicCertificateName, publicCertificate); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PublicCertificate value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PublicCertificate.DeserializePublicCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Public certificate name. - /// Public certificate details. This is the JSON representation of a PublicCertificate object. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdatePublicCertificate(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (publicCertificateName == null) - { - throw new ArgumentNullException(nameof(publicCertificateName)); - } - if (publicCertificate == null) - { - throw new ArgumentNullException(nameof(publicCertificate)); - } - - using var message = CreateCreateOrUpdatePublicCertificateRequest(resourceGroupName, name, publicCertificateName, publicCertificate); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PublicCertificate value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PublicCertificate.DeserializePublicCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeletePublicCertificateRequest(string resourceGroupName, string name, string publicCertificateName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/publicCertificates/", false); - uri.AppendPath(publicCertificateName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Public certificate name. - /// The cancellation token to use. - /// , , or is null. - public async Task DeletePublicCertificateAsync(string resourceGroupName, string name, string publicCertificateName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (publicCertificateName == null) - { - throw new ArgumentNullException(nameof(publicCertificateName)); - } - - using var message = CreateDeletePublicCertificateRequest(resourceGroupName, name, publicCertificateName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Public certificate name. - /// The cancellation token to use. - /// , , or is null. - public Response DeletePublicCertificate(string resourceGroupName, string name, string publicCertificateName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (publicCertificateName == null) - { - throw new ArgumentNullException(nameof(publicCertificateName)); - } - - using var message = CreateDeletePublicCertificateRequest(resourceGroupName, name, publicCertificateName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPublishingProfileXmlWithSecretsRequest(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/publishxml", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/xml"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(publishingProfileOptions); - request.Content = content; - return message; - } - - /// Description for Gets the publishing profile for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specifies publishingProfileOptions for publishing profile. For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListPublishingProfileXmlWithSecretsAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (publishingProfileOptions == null) - { - throw new ArgumentNullException(nameof(publishingProfileOptions)); - } - - using var message = CreateListPublishingProfileXmlWithSecretsRequest(resourceGroupName, name, publishingProfileOptions); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the publishing profile for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specifies publishingProfileOptions for publishing profile. For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. - /// The cancellation token to use. - /// , , or is null. - public Response ListPublishingProfileXmlWithSecrets(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (publishingProfileOptions == null) - { - throw new ArgumentNullException(nameof(publishingProfileOptions)); - } - - using var message = CreateListPublishingProfileXmlWithSecretsRequest(resourceGroupName, name, publishingProfileOptions); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResetProductionSlotConfigRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/resetSlotConfig", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task ResetProductionSlotConfigAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateResetProductionSlotConfigRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ResetProductionSlotConfig(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateResetProductionSlotConfigRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRestartRequest(string resourceGroupName, string name, bool? softRestart, bool? synchronous) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/restart", false); - if (softRestart != null) - { - uri.AppendQuery("softRestart", softRestart.Value, true); - } - if (synchronous != null) - { - uri.AppendQuery("synchronous", synchronous.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Restarts an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify true to apply the configuration settings and restarts the app only if necessary. By default, the API always restarts and reprovisions the app. - /// Specify true to block until the app is restarted. By default, it is set to false, and the API responds immediately (asynchronous). - /// The cancellation token to use. - /// or is null. - public async Task RestartAsync(string resourceGroupName, string name, bool? softRestart = null, bool? synchronous = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateRestartRequest(resourceGroupName, name, softRestart, synchronous); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Restarts an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Specify true to apply the configuration settings and restarts the app only if necessary. By default, the API always restarts and reprovisions the app. - /// Specify true to block until the app is restarted. By default, it is set to false, and the API responds immediately (asynchronous). - /// The cancellation token to use. - /// or is null. - public Response Restart(string resourceGroupName, string name, bool? softRestart = null, bool? synchronous = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateRestartRequest(resourceGroupName, name, softRestart, synchronous); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRestoreFromBackupBlobRequest(string resourceGroupName, string name, RestoreRequest request) - { - var message = _pipeline.CreateMessage(); - var request0 = message.Request; - request0.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/restoreFromBackupBlob", false); - uri.AppendQuery("api-version", apiVersion, true); - request0.Uri = uri; - request0.Headers.Add("Accept", "application/json"); - request0.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(request); - request0.Content = content; - return message; - } - - /// Description for Restores an app from a backup blob in Azure Storage. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Information on restore request . - /// The cancellation token to use. - /// , , or is null. - public async Task RestoreFromBackupBlobAsync(string resourceGroupName, string name, RestoreRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateRestoreFromBackupBlobRequest(resourceGroupName, name, request); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Restores an app from a backup blob in Azure Storage. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Information on restore request . - /// The cancellation token to use. - /// , , or is null. - public Response RestoreFromBackupBlob(string resourceGroupName, string name, RestoreRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateRestoreFromBackupBlobRequest(resourceGroupName, name, request); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRestoreFromDeletedAppRequest(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/restoreFromDeletedApp", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(restoreRequest); - request.Content = content; - return message; - } - - /// Description for Restores a deleted web app to this web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Deleted web app restore information. - /// The cancellation token to use. - /// , , or is null. - public async Task RestoreFromDeletedAppAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (restoreRequest == null) - { - throw new ArgumentNullException(nameof(restoreRequest)); - } - - using var message = CreateRestoreFromDeletedAppRequest(resourceGroupName, name, restoreRequest); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Restores a deleted web app to this web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Deleted web app restore information. - /// The cancellation token to use. - /// , , or is null. - public Response RestoreFromDeletedApp(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (restoreRequest == null) - { - throw new ArgumentNullException(nameof(restoreRequest)); - } - - using var message = CreateRestoreFromDeletedAppRequest(resourceGroupName, name, restoreRequest); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRestoreSnapshotRequest(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/restoreSnapshot", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(restoreRequest); - request.Content = content; - return message; - } - - /// Description for Restores a web app from a snapshot. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. - /// The cancellation token to use. - /// , , or is null. - public async Task RestoreSnapshotAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (restoreRequest == null) - { - throw new ArgumentNullException(nameof(restoreRequest)); - } - - using var message = CreateRestoreSnapshotRequest(resourceGroupName, name, restoreRequest); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Restores a web app from a snapshot. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. - /// The cancellation token to use. - /// , , or is null. - public Response RestoreSnapshot(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (restoreRequest == null) - { - throw new ArgumentNullException(nameof(restoreRequest)); - } - - using var message = CreateRestoreSnapshotRequest(resourceGroupName, name, restoreRequest); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteExtensionsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/siteextensions", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get list of siteextensions for a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public async Task> ListSiteExtensionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSiteExtensionsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteExtensionInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get list of siteextensions for a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public Response ListSiteExtensions(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSiteExtensionsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteExtensionInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteExtensionRequest(string resourceGroupName, string name, string siteExtensionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/siteextensions/", false); - uri.AppendPath(siteExtensionId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get site extension information by its ID for a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Site extension name. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetSiteExtensionAsync(string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteExtensionId == null) - { - throw new ArgumentNullException(nameof(siteExtensionId)); - } - - using var message = CreateGetSiteExtensionRequest(resourceGroupName, name, siteExtensionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteExtensionInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteExtensionInfo.DeserializeSiteExtensionInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SiteExtensionInfo)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get site extension information by its ID for a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Site extension name. - /// The cancellation token to use. - /// , , or is null. - public Response GetSiteExtension(string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteExtensionId == null) - { - throw new ArgumentNullException(nameof(siteExtensionId)); - } - - using var message = CreateGetSiteExtensionRequest(resourceGroupName, name, siteExtensionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteExtensionInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteExtensionInfo.DeserializeSiteExtensionInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SiteExtensionInfo)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateInstallSiteExtensionRequest(string resourceGroupName, string name, string siteExtensionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/siteextensions/", false); - uri.AppendPath(siteExtensionId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Install site extension on a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Site extension name. - /// The cancellation token to use. - /// , , or is null. - public async Task InstallSiteExtensionAsync(string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteExtensionId == null) - { - throw new ArgumentNullException(nameof(siteExtensionId)); - } - - using var message = CreateInstallSiteExtensionRequest(resourceGroupName, name, siteExtensionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - case 429: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Install site extension on a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Site extension name. - /// The cancellation token to use. - /// , , or is null. - public Response InstallSiteExtension(string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteExtensionId == null) - { - throw new ArgumentNullException(nameof(siteExtensionId)); - } - - using var message = CreateInstallSiteExtensionRequest(resourceGroupName, name, siteExtensionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - case 429: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteSiteExtensionRequest(string resourceGroupName, string name, string siteExtensionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/siteextensions/", false); - uri.AppendPath(siteExtensionId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Remove a site extension from a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Site extension name. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteSiteExtensionAsync(string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteExtensionId == null) - { - throw new ArgumentNullException(nameof(siteExtensionId)); - } - - using var message = CreateDeleteSiteExtensionRequest(resourceGroupName, name, siteExtensionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Remove a site extension from a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Site extension name. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteSiteExtension(string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteExtensionId == null) - { - throw new ArgumentNullException(nameof(siteExtensionId)); - } - - using var message = CreateDeleteSiteExtensionRequest(resourceGroupName, name, siteExtensionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSlotsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets an app's deployment slots. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> ListSlotsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSlotsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets an app's deployment slots. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response ListSlots(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSlotsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the details of a web, mobile, or API app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. By default, this API returns the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Site value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Site.DeserializeSite(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((Site)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the details of a web, mobile, or API app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. By default, this API returns the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Site value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Site.DeserializeSite(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((Site)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateSlotRequest(string resourceGroupName, string name, string slot, Site siteEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - /// Name of the resource group to which the resource belongs. - /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. - /// Name of the deployment slot to create or update. By default, this API attempts to create or modify the production slot. - /// A JSON representation of the app properties. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task CreateOrUpdateSlotAsync(string resourceGroupName, string name, string slot, Site siteEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteEnvelope == null) - { - throw new ArgumentNullException(nameof(siteEnvelope)); - } - - using var message = CreateCreateOrUpdateSlotRequest(resourceGroupName, name, slot, siteEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - /// Name of the resource group to which the resource belongs. - /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. - /// Name of the deployment slot to create or update. By default, this API attempts to create or modify the production slot. - /// A JSON representation of the app properties. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateSlot(string resourceGroupName, string name, string slot, Site siteEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteEnvelope == null) - { - throw new ArgumentNullException(nameof(siteEnvelope)); - } - - using var message = CreateCreateOrUpdateSlotRequest(resourceGroupName, name, slot, siteEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteSlotRequest(string resourceGroupName, string name, string slot, bool? deleteMetrics, bool? deleteEmptyServerFarm) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - if (deleteMetrics != null) - { - uri.AppendQuery("deleteMetrics", deleteMetrics.Value, true); - } - if (deleteEmptyServerFarm != null) - { - uri.AppendQuery("deleteEmptyServerFarm", deleteEmptyServerFarm.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a web, mobile, or API app, or one of the deployment slots. - /// Name of the resource group to which the resource belongs. - /// Name of the app to delete. - /// Name of the deployment slot to delete. By default, the API deletes the production slot. - /// If true, web app metrics are also deleted. - /// Specify false if you want to keep empty App Service plan. By default, empty App Service plan is deleted. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteSlotAsync(string resourceGroupName, string name, string slot, bool? deleteMetrics = null, bool? deleteEmptyServerFarm = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteSlotRequest(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a web, mobile, or API app, or one of the deployment slots. - /// Name of the resource group to which the resource belongs. - /// Name of the app to delete. - /// Name of the deployment slot to delete. By default, the API deletes the production slot. - /// If true, web app metrics are also deleted. - /// Specify false if you want to keep empty App Service plan. By default, empty App Service plan is deleted. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteSlot(string resourceGroupName, string name, string slot, bool? deleteMetrics = null, bool? deleteEmptyServerFarm = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteSlotRequest(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateSlotRequest(string resourceGroupName, string name, string slot, SitePatchResource siteEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - /// Name of the resource group to which the resource belongs. - /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. - /// Name of the deployment slot to create or update. By default, this API attempts to create or modify the production slot. - /// A JSON representation of the app properties. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateSlotAsync(string resourceGroupName, string name, string slot, SitePatchResource siteEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteEnvelope == null) - { - throw new ArgumentNullException(nameof(siteEnvelope)); - } - - using var message = CreateUpdateSlotRequest(resourceGroupName, name, slot, siteEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - { - Site value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Site.DeserializeSite(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - /// Name of the resource group to which the resource belongs. - /// Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. - /// Name of the deployment slot to create or update. By default, this API attempts to create or modify the production slot. - /// A JSON representation of the app properties. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateSlot(string resourceGroupName, string name, string slot, SitePatchResource siteEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteEnvelope == null) - { - throw new ArgumentNullException(nameof(siteEnvelope)); - } - - using var message = CreateUpdateSlotRequest(resourceGroupName, name, slot, siteEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - { - Site value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Site.DeserializeSite(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateAnalyzeCustomHostnameSlotRequest(string resourceGroupName, string name, string slot, string hostName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/analyzeCustomHostname", false); - if (hostName != null) - { - uri.AppendQuery("hostName", hostName, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Analyze a custom hostname. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Custom hostname. - /// The cancellation token to use. - /// , , or is null. - public async Task> AnalyzeCustomHostnameSlotAsync(string resourceGroupName, string name, string slot, string hostName = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateAnalyzeCustomHostnameSlotRequest(resourceGroupName, name, slot, hostName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CustomHostnameAnalysisResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomHostnameAnalysisResult.DeserializeCustomHostnameAnalysisResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Analyze a custom hostname. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Custom hostname. - /// The cancellation token to use. - /// , , or is null. - public Response AnalyzeCustomHostnameSlot(string resourceGroupName, string name, string slot, string hostName = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateAnalyzeCustomHostnameSlotRequest(resourceGroupName, name, slot, hostName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CustomHostnameAnalysisResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomHostnameAnalysisResult.DeserializeCustomHostnameAnalysisResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateApplySlotConfigurationSlotRequest(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/applySlotConfig", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(slotSwapEntity); - request.Content = content; - return message; - } - - /// Description for Applies the configuration settings from the target slot onto the current slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task ApplySlotConfigurationSlotAsync(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateApplySlotConfigurationSlotRequest(resourceGroupName, name, slot, slotSwapEntity); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Applies the configuration settings from the target slot onto the current slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response ApplySlotConfigurationSlot(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateApplySlotConfigurationSlotRequest(resourceGroupName, name, slot, slotSwapEntity); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateBackupSlotRequest(string resourceGroupName, string name, string slot, BackupRequest request) - { - var message = _pipeline.CreateMessage(); - var request0 = message.Request; - request0.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/backup", false); - uri.AppendQuery("api-version", apiVersion, true); - request0.Uri = uri; - request0.Headers.Add("Accept", "application/json"); - request0.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(request); - request0.Content = content; - return message; - } - - /// Description for Creates a backup of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will create a backup for the production slot. - /// Backup configuration. You can use the JSON response from the POST action as input here. - /// The cancellation token to use. - /// , , , or is null. - public async Task> BackupSlotAsync(string resourceGroupName, string name, string slot, BackupRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateBackupSlotRequest(resourceGroupName, name, slot, request); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItem value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItem.DeserializeBackupItem(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a backup of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will create a backup for the production slot. - /// Backup configuration. You can use the JSON response from the POST action as input here. - /// The cancellation token to use. - /// , , , or is null. - public Response BackupSlot(string resourceGroupName, string name, string slot, BackupRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateBackupSlotRequest(resourceGroupName, name, slot, request); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItem value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItem.DeserializeBackupItem(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBackupsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/backups", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets existing backups of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListBackupsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListBackupsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets existing backups of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListBackupsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListBackupsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetBackupStatusSlotRequest(string resourceGroupName, string name, string backupId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/backups/", false); - uri.AppendPath(backupId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a backup of an app by its ID. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of the backup. - /// Name of the deployment slot. If a slot is not specified, the API will get a backup of the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetBackupStatusSlotAsync(string resourceGroupName, string name, string backupId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetBackupStatusSlotRequest(resourceGroupName, name, backupId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItem value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItem.DeserializeBackupItem(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a backup of an app by its ID. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of the backup. - /// Name of the deployment slot. If a slot is not specified, the API will get a backup of the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetBackupStatusSlot(string resourceGroupName, string name, string backupId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetBackupStatusSlotRequest(resourceGroupName, name, backupId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItem value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItem.DeserializeBackupItem(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteBackupSlotRequest(string resourceGroupName, string name, string backupId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/backups/", false); - uri.AppendPath(backupId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a backup of an app by its ID. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of the backup. - /// Name of the deployment slot. If a slot is not specified, the API will delete a backup of the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteBackupSlotAsync(string resourceGroupName, string name, string backupId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteBackupSlotRequest(resourceGroupName, name, backupId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a backup of an app by its ID. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of the backup. - /// Name of the deployment slot. If a slot is not specified, the API will delete a backup of the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteBackupSlot(string resourceGroupName, string name, string backupId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteBackupSlotRequest(resourceGroupName, name, backupId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBackupStatusSecretsSlotRequest(string resourceGroupName, string name, string backupId, string slot, BackupRequest request) - { - var message = _pipeline.CreateMessage(); - var request0 = message.Request; - request0.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/backups/", false); - uri.AppendPath(backupId, true); - uri.AppendPath("/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request0.Uri = uri; - request0.Headers.Add("Accept", "application/json"); - request0.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(request); - request0.Content = content; - return message; - } - - /// Description for Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// ID of backup. - /// Name of web app slot. If not specified then will default to production slot. - /// Information on backup request. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListBackupStatusSecretsSlotAsync(string resourceGroupName, string name, string backupId, string slot, BackupRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateListBackupStatusSecretsSlotRequest(resourceGroupName, name, backupId, slot, request); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItem value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItem.DeserializeBackupItem(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// ID of backup. - /// Name of web app slot. If not specified then will default to production slot. - /// Information on backup request. - /// The cancellation token to use. - /// , , , , or is null. - public Response ListBackupStatusSecretsSlot(string resourceGroupName, string name, string backupId, string slot, BackupRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateListBackupStatusSecretsSlotRequest(resourceGroupName, name, backupId, slot, request); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItem value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItem.DeserializeBackupItem(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRestoreSlotRequest(string resourceGroupName, string name, string backupId, string slot, RestoreRequest request) - { - var message = _pipeline.CreateMessage(); - var request0 = message.Request; - request0.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/backups/", false); - uri.AppendPath(backupId, true); - uri.AppendPath("/restore", false); - uri.AppendQuery("api-version", apiVersion, true); - request0.Uri = uri; - request0.Headers.Add("Accept", "application/json"); - request0.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(request); - request0.Content = content; - return message; - } - - /// Description for Restores a specific backup to another app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of the backup. - /// Name of the deployment slot. If a slot is not specified, the API will restore a backup of the production slot. - /// Information on restore request . - /// The cancellation token to use. - /// , , , , or is null. - public async Task RestoreSlotAsync(string resourceGroupName, string name, string backupId, string slot, RestoreRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateRestoreSlotRequest(resourceGroupName, name, backupId, slot, request); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Restores a specific backup to another app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of the backup. - /// Name of the deployment slot. If a slot is not specified, the API will restore a backup of the production slot. - /// Information on restore request . - /// The cancellation token to use. - /// , , , , or is null. - public Response RestoreSlot(string resourceGroupName, string name, string backupId, string slot, RestoreRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (backupId == null) - { - throw new ArgumentNullException(nameof(backupId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateRestoreSlotRequest(resourceGroupName, name, backupId, slot, request); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetBasicPublishingCredentialsPoliciesSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/basicPublishingCredentialsPolicies", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetBasicPublishingCredentialsPoliciesSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetBasicPublishingCredentialsPoliciesSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmPublishingCredentialsPoliciesCollection.DeserializeCsmPublishingCredentialsPoliciesCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response GetBasicPublishingCredentialsPoliciesSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetBasicPublishingCredentialsPoliciesSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmPublishingCredentialsPoliciesCollection.DeserializeCsmPublishingCredentialsPoliciesCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetFtpAllowedSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/basicPublishingCredentialsPolicies/ftp", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns whether FTP is allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetFtpAllowedSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetFtpAllowedSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns whether FTP is allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response GetFtpAllowedSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetFtpAllowedSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateFtpAllowedSlotRequest(string resourceGroupName, string name, string slot, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/basicPublishingCredentialsPolicies/ftp", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(csmPublishingAccessPoliciesEntity); - request.Content = content; - return message; - } - - /// Description for Updates whether FTP is allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The CsmPublishingCredentialsPoliciesEntity to use. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateFtpAllowedSlotAsync(string resourceGroupName, string name, string slot, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (csmPublishingAccessPoliciesEntity == null) - { - throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); - } - - using var message = CreateUpdateFtpAllowedSlotRequest(resourceGroupName, name, slot, csmPublishingAccessPoliciesEntity); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates whether FTP is allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The CsmPublishingCredentialsPoliciesEntity to use. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateFtpAllowedSlot(string resourceGroupName, string name, string slot, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (csmPublishingAccessPoliciesEntity == null) - { - throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); - } - - using var message = CreateUpdateFtpAllowedSlotRequest(resourceGroupName, name, slot, csmPublishingAccessPoliciesEntity); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetScmAllowedSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/basicPublishingCredentialsPolicies/scm", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns whether Scm basic auth is allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetScmAllowedSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetScmAllowedSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns whether Scm basic auth is allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response GetScmAllowedSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetScmAllowedSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateScmAllowedSlotRequest(string resourceGroupName, string name, string slot, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/basicPublishingCredentialsPolicies/scm", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(csmPublishingAccessPoliciesEntity); - request.Content = content; - return message; - } - - /// Description for Updates whether user publishing credentials are allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The CsmPublishingCredentialsPoliciesEntity to use. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateScmAllowedSlotAsync(string resourceGroupName, string name, string slot, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (csmPublishingAccessPoliciesEntity == null) - { - throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); - } - - using var message = CreateUpdateScmAllowedSlotRequest(resourceGroupName, name, slot, csmPublishingAccessPoliciesEntity); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates whether user publishing credentials are allowed on the site or not. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The CsmPublishingCredentialsPoliciesEntity to use. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateScmAllowedSlot(string resourceGroupName, string name, string slot, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (csmPublishingAccessPoliciesEntity == null) - { - throw new ArgumentNullException(nameof(csmPublishingAccessPoliciesEntity)); - } - - using var message = CreateUpdateScmAllowedSlotRequest(resourceGroupName, name, slot, csmPublishingAccessPoliciesEntity); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmPublishingCredentialsPoliciesEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmPublishingCredentialsPoliciesEntity.DeserializeCsmPublishingCredentialsPoliciesEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConfigurationsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the configurations of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListConfigurationsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListConfigurationsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResourceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the configurations of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListConfigurationsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListConfigurationsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResourceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateApplicationSettingsSlotRequest(string resourceGroupName, string name, string slot, StringDictionary appSettings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/appsettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(appSettings); - request.Content = content; - return message; - } - - /// Description for Replaces the application settings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the application settings for the production slot. - /// Application settings of the app. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateApplicationSettingsSlotAsync(string resourceGroupName, string name, string slot, StringDictionary appSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (appSettings == null) - { - throw new ArgumentNullException(nameof(appSettings)); - } - - using var message = CreateUpdateApplicationSettingsSlotRequest(resourceGroupName, name, slot, appSettings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Replaces the application settings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the application settings for the production slot. - /// Application settings of the app. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateApplicationSettingsSlot(string resourceGroupName, string name, string slot, StringDictionary appSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (appSettings == null) - { - throw new ArgumentNullException(nameof(appSettings)); - } - - using var message = CreateUpdateApplicationSettingsSlotRequest(resourceGroupName, name, slot, appSettings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListApplicationSettingsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/appsettings/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the application settings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the application settings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListApplicationSettingsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListApplicationSettingsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the application settings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the application settings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListApplicationSettingsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListApplicationSettingsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateAuthSettingsSlotRequest(string resourceGroupName, string name, string slot, SiteAuthSettings siteAuthSettings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/authsettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteAuthSettings); - request.Content = content; - return message; - } - - /// Description for Updates the Authentication / Authorization settings associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Auth settings associated with web app. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateAuthSettingsSlotAsync(string resourceGroupName, string name, string slot, SiteAuthSettings siteAuthSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteAuthSettings == null) - { - throw new ArgumentNullException(nameof(siteAuthSettings)); - } - - using var message = CreateUpdateAuthSettingsSlotRequest(resourceGroupName, name, slot, siteAuthSettings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettings value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the Authentication / Authorization settings associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Auth settings associated with web app. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateAuthSettingsSlot(string resourceGroupName, string name, string slot, SiteAuthSettings siteAuthSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteAuthSettings == null) - { - throw new ArgumentNullException(nameof(siteAuthSettings)); - } - - using var message = CreateUpdateAuthSettingsSlotRequest(resourceGroupName, name, slot, siteAuthSettings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettings value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAuthSettingsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/authsettings/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the Authentication/Authorization settings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the settings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetAuthSettingsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetAuthSettingsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettings value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the Authentication/Authorization settings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the settings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetAuthSettingsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetAuthSettingsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettings value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteAuthSettings.DeserializeSiteAuthSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateAuthSettingsV2SlotRequest(string resourceGroupName, string name, string slot, SiteAuthSettingsV2 siteAuthSettingsV2) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/authsettingsV2", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteAuthSettingsV2); - request.Content = content; - return message; - } - - /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Auth settings associated with web app. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateAuthSettingsV2SlotAsync(string resourceGroupName, string name, string slot, SiteAuthSettingsV2 siteAuthSettingsV2, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteAuthSettingsV2 == null) - { - throw new ArgumentNullException(nameof(siteAuthSettingsV2)); - } - - using var message = CreateUpdateAuthSettingsV2SlotRequest(resourceGroupName, name, slot, siteAuthSettingsV2); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettingsV2 value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Auth settings associated with web app. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateAuthSettingsV2Slot(string resourceGroupName, string name, string slot, SiteAuthSettingsV2 siteAuthSettingsV2, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteAuthSettingsV2 == null) - { - throw new ArgumentNullException(nameof(siteAuthSettingsV2)); - } - - using var message = CreateUpdateAuthSettingsV2SlotRequest(resourceGroupName, name, slot, siteAuthSettingsV2); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettingsV2 value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAuthSettingsV2SlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/authsettingsV2/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the settings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetAuthSettingsV2SlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetAuthSettingsV2SlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettingsV2 value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the settings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetAuthSettingsV2Slot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetAuthSettingsV2SlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteAuthSettingsV2 value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteAuthSettingsV2.DeserializeSiteAuthSettingsV2(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateAzureStorageAccountsSlotRequest(string resourceGroupName, string name, string slot, AzureStoragePropertyDictionaryResource azureStorageAccounts) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/azurestorageaccounts", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(azureStorageAccounts); - request.Content = content; - return message; - } - - /// Description for Updates the Azure storage account configurations of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the Azure storage account configurations for the production slot. - /// Azure storage accounts of the app. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateAzureStorageAccountsSlotAsync(string resourceGroupName, string name, string slot, AzureStoragePropertyDictionaryResource azureStorageAccounts, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (azureStorageAccounts == null) - { - throw new ArgumentNullException(nameof(azureStorageAccounts)); - } - - using var message = CreateUpdateAzureStorageAccountsSlotRequest(resourceGroupName, name, slot, azureStorageAccounts); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AzureStoragePropertyDictionaryResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the Azure storage account configurations of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the Azure storage account configurations for the production slot. - /// Azure storage accounts of the app. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateAzureStorageAccountsSlot(string resourceGroupName, string name, string slot, AzureStoragePropertyDictionaryResource azureStorageAccounts, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (azureStorageAccounts == null) - { - throw new ArgumentNullException(nameof(azureStorageAccounts)); - } - - using var message = CreateUpdateAzureStorageAccountsSlotRequest(resourceGroupName, name, slot, azureStorageAccounts); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AzureStoragePropertyDictionaryResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListAzureStorageAccountsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/azurestorageaccounts/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the Azure storage account configurations of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the Azure storage account configurations for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListAzureStorageAccountsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListAzureStorageAccountsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AzureStoragePropertyDictionaryResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the Azure storage account configurations of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the Azure storage account configurations for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListAzureStorageAccountsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListAzureStorageAccountsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AzureStoragePropertyDictionaryResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AzureStoragePropertyDictionaryResource.DeserializeAzureStoragePropertyDictionaryResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateBackupConfigurationSlotRequest(string resourceGroupName, string name, string slot, BackupRequest request) - { - var message = _pipeline.CreateMessage(); - var request0 = message.Request; - request0.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/backup", false); - uri.AppendQuery("api-version", apiVersion, true); - request0.Uri = uri; - request0.Headers.Add("Accept", "application/json"); - request0.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(request); - request0.Content = content; - return message; - } - - /// Description for Updates the backup configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the backup configuration for the production slot. - /// Edited backup configuration. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateBackupConfigurationSlotAsync(string resourceGroupName, string name, string slot, BackupRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateUpdateBackupConfigurationSlotRequest(resourceGroupName, name, slot, request); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupRequest value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupRequest.DeserializeBackupRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the backup configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the backup configuration for the production slot. - /// Edited backup configuration. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateBackupConfigurationSlot(string resourceGroupName, string name, string slot, BackupRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateUpdateBackupConfigurationSlotRequest(resourceGroupName, name, slot, request); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupRequest value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupRequest.DeserializeBackupRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteBackupConfigurationSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/backup", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes the backup configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteBackupConfigurationSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteBackupConfigurationSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes the backup configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the backup configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteBackupConfigurationSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteBackupConfigurationSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetBackupConfigurationSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/backup/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the backup configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the backup configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetBackupConfigurationSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetBackupConfigurationSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupRequest value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupRequest.DeserializeBackupRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the backup configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the backup configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetBackupConfigurationSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetBackupConfigurationSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupRequest value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupRequest.DeserializeBackupRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAppSettingsKeyVaultReferencesSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/configreferences/appsettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the config reference app settings and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetAppSettingsKeyVaultReferencesSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetAppSettingsKeyVaultReferencesSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the config reference app settings and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response GetAppSettingsKeyVaultReferencesSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetAppSettingsKeyVaultReferencesSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAppSettingKeyVaultReferenceSlotRequest(string resourceGroupName, string name, string appSettingKey, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/configreferences/appsettings/", false); - uri.AppendPath(appSettingKey, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the config reference and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// App Setting key name. - /// The String to use. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetAppSettingKeyVaultReferenceSlotAsync(string resourceGroupName, string name, string appSettingKey, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appSettingKey == null) - { - throw new ArgumentNullException(nameof(appSettingKey)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetAppSettingKeyVaultReferenceSlotRequest(resourceGroupName, name, appSettingKey, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApiKVReference value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApiKVReference.DeserializeApiKVReference(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the config reference and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// App Setting key name. - /// The String to use. - /// The cancellation token to use. - /// , , , or is null. - public Response GetAppSettingKeyVaultReferenceSlot(string resourceGroupName, string name, string appSettingKey, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (appSettingKey == null) - { - throw new ArgumentNullException(nameof(appSettingKey)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetAppSettingKeyVaultReferenceSlotRequest(resourceGroupName, name, appSettingKey, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApiKVReference value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApiKVReference.DeserializeApiKVReference(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteConnectionStringKeyVaultReferencesSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/configreferences/connectionstrings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the config reference app settings and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetSiteConnectionStringKeyVaultReferencesSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteConnectionStringKeyVaultReferencesSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the config reference app settings and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response GetSiteConnectionStringKeyVaultReferencesSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteConnectionStringKeyVaultReferencesSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteConnectionStringKeyVaultReferenceSlotRequest(string resourceGroupName, string name, string connectionStringKey, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/configreferences/connectionstrings/", false); - uri.AppendPath(connectionStringKey, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the config reference and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The String to use. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetSiteConnectionStringKeyVaultReferenceSlotAsync(string resourceGroupName, string name, string connectionStringKey, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (connectionStringKey == null) - { - throw new ArgumentNullException(nameof(connectionStringKey)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteConnectionStringKeyVaultReferenceSlotRequest(resourceGroupName, name, connectionStringKey, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApiKVReference value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApiKVReference.DeserializeApiKVReference(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the config reference and status of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The String to use. - /// The cancellation token to use. - /// , , , or is null. - public Response GetSiteConnectionStringKeyVaultReferenceSlot(string resourceGroupName, string name, string connectionStringKey, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (connectionStringKey == null) - { - throw new ArgumentNullException(nameof(connectionStringKey)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteConnectionStringKeyVaultReferenceSlotRequest(resourceGroupName, name, connectionStringKey, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApiKVReference value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApiKVReference.DeserializeApiKVReference(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateConnectionStringsSlotRequest(string resourceGroupName, string name, string slot, ConnectionStringDictionary connectionStrings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/connectionstrings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionStrings); - request.Content = content; - return message; - } - - /// Description for Replaces the connection strings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the connection settings for the production slot. - /// Connection strings of the app or deployment slot. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateConnectionStringsSlotAsync(string resourceGroupName, string name, string slot, ConnectionStringDictionary connectionStrings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionStrings == null) - { - throw new ArgumentNullException(nameof(connectionStrings)); - } - - using var message = CreateUpdateConnectionStringsSlotRequest(resourceGroupName, name, slot, connectionStrings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ConnectionStringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Replaces the connection strings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the connection settings for the production slot. - /// Connection strings of the app or deployment slot. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateConnectionStringsSlot(string resourceGroupName, string name, string slot, ConnectionStringDictionary connectionStrings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionStrings == null) - { - throw new ArgumentNullException(nameof(connectionStrings)); - } - - using var message = CreateUpdateConnectionStringsSlotRequest(resourceGroupName, name, slot, connectionStrings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ConnectionStringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConnectionStringsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/connectionstrings/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the connection strings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the connection settings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListConnectionStringsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListConnectionStringsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ConnectionStringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the connection strings of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the connection settings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListConnectionStringsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListConnectionStringsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ConnectionStringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ConnectionStringDictionary.DeserializeConnectionStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetDiagnosticLogsConfigurationSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/logs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the logging configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the logging configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetDiagnosticLogsConfigurationSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetDiagnosticLogsConfigurationSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteLogsConfig value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the logging configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the logging configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetDiagnosticLogsConfigurationSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetDiagnosticLogsConfigurationSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteLogsConfig value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateDiagnosticLogsConfigSlotRequest(string resourceGroupName, string name, string slot, SiteLogsConfig siteLogsConfig) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/logs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteLogsConfig); - request.Content = content; - return message; - } - - /// Description for Updates the logging configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the logging configuration for the production slot. - /// A SiteLogsConfig JSON object that contains the logging configuration to change in the "properties" property. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateDiagnosticLogsConfigSlotAsync(string resourceGroupName, string name, string slot, SiteLogsConfig siteLogsConfig, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteLogsConfig == null) - { - throw new ArgumentNullException(nameof(siteLogsConfig)); - } - - using var message = CreateUpdateDiagnosticLogsConfigSlotRequest(resourceGroupName, name, slot, siteLogsConfig); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteLogsConfig value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the logging configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the logging configuration for the production slot. - /// A SiteLogsConfig JSON object that contains the logging configuration to change in the "properties" property. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateDiagnosticLogsConfigSlot(string resourceGroupName, string name, string slot, SiteLogsConfig siteLogsConfig, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteLogsConfig == null) - { - throw new ArgumentNullException(nameof(siteLogsConfig)); - } - - using var message = CreateUpdateDiagnosticLogsConfigSlotRequest(resourceGroupName, name, slot, siteLogsConfig); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteLogsConfig value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteLogsConfig.DeserializeSiteLogsConfig(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateMetadataSlotRequest(string resourceGroupName, string name, string slot, StringDictionary metadata) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/metadata", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(metadata); - request.Content = content; - return message; - } - - /// Description for Replaces the metadata of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the metadata for the production slot. - /// Edited metadata of the app or deployment slot. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateMetadataSlotAsync(string resourceGroupName, string name, string slot, StringDictionary metadata, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (metadata == null) - { - throw new ArgumentNullException(nameof(metadata)); - } - - using var message = CreateUpdateMetadataSlotRequest(resourceGroupName, name, slot, metadata); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Replaces the metadata of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the metadata for the production slot. - /// Edited metadata of the app or deployment slot. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateMetadataSlot(string resourceGroupName, string name, string slot, StringDictionary metadata, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (metadata == null) - { - throw new ArgumentNullException(nameof(metadata)); - } - - using var message = CreateUpdateMetadataSlotRequest(resourceGroupName, name, slot, metadata); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListMetadataSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/metadata/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the metadata of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the metadata for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListMetadataSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListMetadataSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the metadata of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the metadata for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListMetadataSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListMetadataSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPublishingCredentialsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/publishingcredentials/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the Git/FTP publishing credentials of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task ListPublishingCredentialsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListPublishingCredentialsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the Git/FTP publishing credentials of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListPublishingCredentialsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListPublishingCredentialsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateSitePushSettingsSlotRequest(string resourceGroupName, string name, string slot, PushSettings pushSettings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/pushsettings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(pushSettings); - request.Content = content; - return message; - } - - /// Description for Updates the Push settings associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Push settings associated with web app. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateSitePushSettingsSlotAsync(string resourceGroupName, string name, string slot, PushSettings pushSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (pushSettings == null) - { - throw new ArgumentNullException(nameof(pushSettings)); - } - - using var message = CreateUpdateSitePushSettingsSlotRequest(resourceGroupName, name, slot, pushSettings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PushSettings value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PushSettings.DeserializePushSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the Push settings associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Push settings associated with web app. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateSitePushSettingsSlot(string resourceGroupName, string name, string slot, PushSettings pushSettings, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (pushSettings == null) - { - throw new ArgumentNullException(nameof(pushSettings)); - } - - using var message = CreateUpdateSitePushSettingsSlotRequest(resourceGroupName, name, slot, pushSettings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PushSettings value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PushSettings.DeserializePushSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSitePushSettingsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/pushsettings/list", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the Push settings associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSitePushSettingsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSitePushSettingsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PushSettings value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PushSettings.DeserializePushSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the Push settings associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListSitePushSettingsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSitePushSettingsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PushSettings value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PushSettings.DeserializePushSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetConfigurationSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetConfigurationSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetConfigurationSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetConfigurationSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetConfigurationSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateConfigurationSlotRequest(string resourceGroupName, string name, string slot, SiteConfigResource siteConfig) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteConfig); - request.Content = content; - return message; - } - - /// Description for Updates the configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update configuration for the production slot. - /// JSON representation of a SiteConfig object. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task> CreateOrUpdateConfigurationSlotAsync(string resourceGroupName, string name, string slot, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteConfig == null) - { - throw new ArgumentNullException(nameof(siteConfig)); - } - - using var message = CreateCreateOrUpdateConfigurationSlotRequest(resourceGroupName, name, slot, siteConfig); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update configuration for the production slot. - /// JSON representation of a SiteConfig object. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateConfigurationSlot(string resourceGroupName, string name, string slot, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteConfig == null) - { - throw new ArgumentNullException(nameof(siteConfig)); - } - - using var message = CreateCreateOrUpdateConfigurationSlotRequest(resourceGroupName, name, slot, siteConfig); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateConfigurationSlotRequest(string resourceGroupName, string name, string slot, SiteConfigResource siteConfig) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteConfig); - request.Content = content; - return message; - } - - /// Description for Updates the configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update configuration for the production slot. - /// JSON representation of a SiteConfig object. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateConfigurationSlotAsync(string resourceGroupName, string name, string slot, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteConfig == null) - { - throw new ArgumentNullException(nameof(siteConfig)); - } - - using var message = CreateUpdateConfigurationSlotRequest(resourceGroupName, name, slot, siteConfig); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update configuration for the production slot. - /// JSON representation of a SiteConfig object. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateConfigurationSlot(string resourceGroupName, string name, string slot, SiteConfigResource siteConfig, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteConfig == null) - { - throw new ArgumentNullException(nameof(siteConfig)); - } - - using var message = CreateUpdateConfigurationSlotRequest(resourceGroupName, name, slot, siteConfig); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConfigurationSnapshotInfoSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/web/snapshots", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListConfigurationSnapshotInfoSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListConfigurationSnapshotInfoSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigurationSnapshotInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListConfigurationSnapshotInfoSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListConfigurationSnapshotInfoSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigurationSnapshotInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetConfigurationSnapshotSlotRequest(string resourceGroupName, string name, string snapshotId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/web/snapshots/", false); - uri.AppendPath(snapshotId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a snapshot of the configuration of an app at a previous point in time. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The ID of the snapshot to read. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetConfigurationSnapshotSlotAsync(string resourceGroupName, string name, string snapshotId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (snapshotId == null) - { - throw new ArgumentNullException(nameof(snapshotId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetConfigurationSnapshotSlotRequest(resourceGroupName, name, snapshotId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a snapshot of the configuration of an app at a previous point in time. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The ID of the snapshot to read. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetConfigurationSnapshotSlot(string resourceGroupName, string name, string snapshotId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (snapshotId == null) - { - throw new ArgumentNullException(nameof(snapshotId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetConfigurationSnapshotSlotRequest(resourceGroupName, name, snapshotId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigResource.DeserializeSiteConfigResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRecoverSiteConfigurationSnapshotSlotRequest(string resourceGroupName, string name, string snapshotId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/config/web/snapshots/", false); - uri.AppendPath(snapshotId, true); - uri.AppendPath("/recover", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Reverts the configuration of an app to a previous snapshot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The ID of the snapshot to read. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task RecoverSiteConfigurationSnapshotSlotAsync(string resourceGroupName, string name, string snapshotId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (snapshotId == null) - { - throw new ArgumentNullException(nameof(snapshotId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateRecoverSiteConfigurationSnapshotSlotRequest(resourceGroupName, name, snapshotId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Reverts the configuration of an app to a previous snapshot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The ID of the snapshot to read. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response RecoverSiteConfigurationSnapshotSlot(string resourceGroupName, string name, string snapshotId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (snapshotId == null) - { - throw new ArgumentNullException(nameof(snapshotId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateRecoverSiteConfigurationSnapshotSlotRequest(resourceGroupName, name, snapshotId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetWebSiteContainerLogsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/containerlogs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/octet-stream"); - return message; - } - - /// Description for Gets the last lines of docker logs for the given site. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetWebSiteContainerLogsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetWebSiteContainerLogsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 204: - return Response.FromValue((Stream)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the last lines of docker logs for the given site. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetWebSiteContainerLogsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetWebSiteContainerLogsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 204: - return Response.FromValue((Stream)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetContainerLogsZipSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/containerlogs/zip/download", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/zip"); - return message; - } - - /// Description for Gets the ZIP archived docker log files for the given site. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetContainerLogsZipSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetContainerLogsZipSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 204: - return Response.FromValue((Stream)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the ZIP archived docker log files for the given site. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetContainerLogsZipSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetContainerLogsZipSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 204: - return Response.FromValue((Stream)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListContinuousWebJobsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/continuouswebjobs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List continuous web jobs for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListContinuousWebJobsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListContinuousWebJobsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContinuousWebJobCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List continuous web jobs for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListContinuousWebJobsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListContinuousWebJobsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContinuousWebJobCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetContinuousWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/continuouswebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a continuous web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetContinuousWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContinuousWebJob value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContinuousWebJob.DeserializeContinuousWebJob(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContinuousWebJob)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a continuous web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetContinuousWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContinuousWebJob value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContinuousWebJob.DeserializeContinuousWebJob(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContinuousWebJob)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteContinuousWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/continuouswebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a continuous web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteContinuousWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a continuous web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteContinuousWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStartContinuousWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/continuouswebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendPath("/start", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Start a continuous web job for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task StartContinuousWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStartContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Start a continuous web job for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response StartContinuousWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStartContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStopContinuousWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/continuouswebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendPath("/stop", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Stop a continuous web job for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task StopContinuousWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStopContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Stop a continuous web job for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response StopContinuousWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStopContinuousWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListDeploymentsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/deployments", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List deployments for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListDeploymentsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListDeploymentsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeploymentCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List deployments for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListDeploymentsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListDeploymentsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeploymentCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetDeploymentSlotRequest(string resourceGroupName, string name, string id, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/deployments/", false); - uri.AppendPath(id, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a deployment by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Deployment ID. - /// Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetDeploymentSlotAsync(string resourceGroupName, string name, string id, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetDeploymentSlotRequest(resourceGroupName, name, id, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Deployment value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Deployment.DeserializeDeployment(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a deployment by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Deployment ID. - /// Name of the deployment slot. If a slot is not specified, the API gets a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetDeploymentSlot(string resourceGroupName, string name, string id, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetDeploymentSlotRequest(resourceGroupName, name, id, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Deployment value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Deployment.DeserializeDeployment(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateDeploymentSlotRequest(string resourceGroupName, string name, string id, string slot, Deployment deployment) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/deployments/", false); - uri.AppendPath(id, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(deployment); - request.Content = content; - return message; - } - - /// Description for Create a deployment for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of an existing deployment. - /// Name of the deployment slot. If a slot is not specified, the API creates a deployment for the production slot. - /// Deployment details. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> CreateDeploymentSlotAsync(string resourceGroupName, string name, string id, string slot, Deployment deployment, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (deployment == null) - { - throw new ArgumentNullException(nameof(deployment)); - } - - using var message = CreateCreateDeploymentSlotRequest(resourceGroupName, name, id, slot, deployment); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Deployment value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Deployment.DeserializeDeployment(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create a deployment for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// ID of an existing deployment. - /// Name of the deployment slot. If a slot is not specified, the API creates a deployment for the production slot. - /// Deployment details. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateDeploymentSlot(string resourceGroupName, string name, string id, string slot, Deployment deployment, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (deployment == null) - { - throw new ArgumentNullException(nameof(deployment)); - } - - using var message = CreateCreateDeploymentSlotRequest(resourceGroupName, name, id, slot, deployment); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Deployment value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Deployment.DeserializeDeployment(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteDeploymentSlotRequest(string resourceGroupName, string name, string id, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/deployments/", false); - uri.AppendPath(id, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a deployment by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Deployment ID. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteDeploymentSlotAsync(string resourceGroupName, string name, string id, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteDeploymentSlotRequest(resourceGroupName, name, id, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a deployment by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Deployment ID. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteDeploymentSlot(string resourceGroupName, string name, string id, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteDeploymentSlotRequest(resourceGroupName, name, id, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListDeploymentLogSlotRequest(string resourceGroupName, string name, string id, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/deployments/", false); - uri.AppendPath(id, true); - uri.AppendPath("/log", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List deployment log for specific deployment for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The ID of a specific deployment. This is the value of the name property in the JSON response from "GET /api/sites/{siteName}/deployments". - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListDeploymentLogSlotAsync(string resourceGroupName, string name, string id, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListDeploymentLogSlotRequest(resourceGroupName, name, id, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Deployment value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Deployment.DeserializeDeployment(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List deployment log for specific deployment for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The ID of a specific deployment. This is the value of the name property in the JSON response from "GET /api/sites/{siteName}/deployments". - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListDeploymentLogSlot(string resourceGroupName, string name, string id, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListDeploymentLogSlotRequest(resourceGroupName, name, id, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Deployment value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Deployment.DeserializeDeployment(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDiscoverBackupSlotRequest(string resourceGroupName, string name, string slot, RestoreRequest request) - { - var message = _pipeline.CreateMessage(); - var request0 = message.Request; - request0.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/discoverbackup", false); - uri.AppendQuery("api-version", apiVersion, true); - request0.Uri = uri; - request0.Headers.Add("Accept", "application/json"); - request0.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(request); - request0.Content = content; - return message; - } - - /// Description for Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will perform discovery for the production slot. - /// A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - /// The cancellation token to use. - /// , , , or is null. - public async Task> DiscoverBackupSlotAsync(string resourceGroupName, string name, string slot, RestoreRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateDiscoverBackupSlotRequest(resourceGroupName, name, slot, request); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RestoreRequest value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RestoreRequest.DeserializeRestoreRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will perform discovery for the production slot. - /// A RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. - /// The cancellation token to use. - /// , , , or is null. - public Response DiscoverBackupSlot(string resourceGroupName, string name, string slot, RestoreRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateDiscoverBackupSlotRequest(resourceGroupName, name, slot, request); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RestoreRequest value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RestoreRequest.DeserializeRestoreRequest(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListDomainOwnershipIdentifiersSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/domainOwnershipIdentifiers", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Lists ownership identifiers for domain associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListDomainOwnershipIdentifiersSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListDomainOwnershipIdentifiersSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IdentifierCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Lists ownership identifiers for domain associated with web app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListDomainOwnershipIdentifiersSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListDomainOwnershipIdentifiersSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IdentifierCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetDomainOwnershipIdentifierSlotRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/domainOwnershipIdentifiers/", false); - uri.AppendPath(domainOwnershipIdentifierName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get domain ownership identifier for web app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetDomainOwnershipIdentifierSlotAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Identifier value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Identifier.DeserializeIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get domain ownership identifier for web app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetDomainOwnershipIdentifierSlot(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Identifier value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Identifier.DeserializeIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateDomainOwnershipIdentifierSlotRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Identifier domainOwnershipIdentifier) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/domainOwnershipIdentifiers/", false); - uri.AppendPath(domainOwnershipIdentifierName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(domainOwnershipIdentifier); - request.Content = content; - return message; - } - - /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// A JSON representation of the domain ownership properties. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> CreateOrUpdateDomainOwnershipIdentifierSlotAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (domainOwnershipIdentifier == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); - } - - using var message = CreateCreateOrUpdateDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Identifier value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Identifier.DeserializeIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// A JSON representation of the domain ownership properties. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateOrUpdateDomainOwnershipIdentifierSlot(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (domainOwnershipIdentifier == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); - } - - using var message = CreateCreateOrUpdateDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Identifier value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Identifier.DeserializeIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteDomainOwnershipIdentifierSlotRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/domainOwnershipIdentifiers/", false); - uri.AppendPath(domainOwnershipIdentifierName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a domain ownership identifier for a web app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteDomainOwnershipIdentifierSlotAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a domain ownership identifier for a web app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteDomainOwnershipIdentifierSlot(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateDomainOwnershipIdentifierSlotRequest(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Identifier domainOwnershipIdentifier) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/domainOwnershipIdentifiers/", false); - uri.AppendPath(domainOwnershipIdentifierName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(domainOwnershipIdentifier); - request.Content = content; - return message; - } - - /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// A JSON representation of the domain ownership properties. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> UpdateDomainOwnershipIdentifierSlotAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (domainOwnershipIdentifier == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); - } - - using var message = CreateUpdateDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Identifier value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Identifier.DeserializeIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of domain ownership identifier. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// A JSON representation of the domain ownership properties. - /// The cancellation token to use. - /// , , , , or is null. - public Response UpdateDomainOwnershipIdentifierSlot(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Identifier domainOwnershipIdentifier, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (domainOwnershipIdentifierName == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (domainOwnershipIdentifier == null) - { - throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); - } - - using var message = CreateUpdateDomainOwnershipIdentifierSlotRequest(resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Identifier value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Identifier.DeserializeIdentifier(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetMSDeployStatusSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/extensions/MSDeploy", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the status of the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetMSDeployStatusSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetMSDeployStatusSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MSDeployStatus value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the status of the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetMSDeployStatusSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetMSDeployStatusSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MSDeployStatus value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateMSDeployOperationSlotRequest(string resourceGroupName, string name, string slot, MSDeploy mSDeploy) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/extensions/MSDeploy", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(mSDeploy); - request.Content = content; - return message; - } - - /// Description for Invoke the MSDeploy web app extension. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Details of MSDeploy operation. - /// The cancellation token to use. - /// , , , or is null. - public async Task CreateMSDeployOperationSlotAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (mSDeploy == null) - { - throw new ArgumentNullException(nameof(mSDeploy)); - } - - using var message = CreateCreateMSDeployOperationSlotRequest(resourceGroupName, name, slot, mSDeploy); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 201: - case 409: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Invoke the MSDeploy web app extension. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Details of MSDeploy operation. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateMSDeployOperationSlot(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (mSDeploy == null) - { - throw new ArgumentNullException(nameof(mSDeploy)); - } - - using var message = CreateCreateMSDeployOperationSlotRequest(resourceGroupName, name, slot, mSDeploy); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 201: - case 409: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetMSDeployLogSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/extensions/MSDeploy/log", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetMSDeployLogSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetMSDeployLogSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MSDeployLog value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MSDeployLog)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetMSDeployLogSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetMSDeployLogSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MSDeployLog value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MSDeployLog)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceFunctionsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/functions", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the functions for a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListInstanceFunctionsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListInstanceFunctionsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionEnvelopeCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the functions for a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListInstanceFunctionsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListInstanceFunctionsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionEnvelopeCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetFunctionsAdminTokenSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/functions/admin/token", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Fetch a short lived token that can be exchanged for a master key. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetFunctionsAdminTokenSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetFunctionsAdminTokenSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - string value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = document.RootElement.GetString(); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Fetch a short lived token that can be exchanged for a master key. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetFunctionsAdminTokenSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetFunctionsAdminTokenSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - string value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = document.RootElement.GetString(); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceFunctionSlotRequest(string resourceGroupName, string name, string functionName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get function information by its ID for web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetInstanceFunctionSlotAsync(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetInstanceFunctionSlotRequest(resourceGroupName, name, functionName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionEnvelope value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionEnvelope.DeserializeFunctionEnvelope(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((FunctionEnvelope)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get function information by its ID for web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetInstanceFunctionSlot(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetInstanceFunctionSlotRequest(resourceGroupName, name, functionName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionEnvelope value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionEnvelope.DeserializeFunctionEnvelope(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((FunctionEnvelope)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateInstanceFunctionSlotRequest(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(functionEnvelope); - request.Content = content; - return message; - } - - /// Description for Create function for web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// Name of the deployment slot. - /// Function details. - /// The cancellation token to use. - /// , , , , or is null. - public async Task CreateInstanceFunctionSlotAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (functionEnvelope == null) - { - throw new ArgumentNullException(nameof(functionEnvelope)); - } - - using var message = CreateCreateInstanceFunctionSlotRequest(resourceGroupName, name, functionName, slot, functionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 201: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Create function for web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// Name of the deployment slot. - /// Function details. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateInstanceFunctionSlot(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (functionEnvelope == null) - { - throw new ArgumentNullException(nameof(functionEnvelope)); - } - - using var message = CreateCreateInstanceFunctionSlotRequest(resourceGroupName, name, functionName, slot, functionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 201: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteInstanceFunctionSlotRequest(string resourceGroupName, string name, string functionName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a function for web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteInstanceFunctionSlotAsync(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteInstanceFunctionSlotRequest(resourceGroupName, name, functionName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a function for web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteInstanceFunctionSlot(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteInstanceFunctionSlotRequest(resourceGroupName, name, functionName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateFunctionSecretSlotRequest(string resourceGroupName, string name, string functionName, string keyName, string slot, KeyInfo key) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendPath("/keys/", false); - uri.AppendPath(keyName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(key); - request.Content = content; - return message; - } - - /// Description for Add or update a function secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The name of the function. - /// The name of the key. - /// Name of the deployment slot. - /// The key to create or update. - /// The cancellation token to use. - /// , , , , , or is null. - public async Task> CreateOrUpdateFunctionSecretSlotAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, KeyInfo key, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - using var message = CreateCreateOrUpdateFunctionSecretSlotRequest(resourceGroupName, name, functionName, keyName, slot, key); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - KeyInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = KeyInfo.DeserializeKeyInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Add or update a function secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The name of the function. - /// The name of the key. - /// Name of the deployment slot. - /// The key to create or update. - /// The cancellation token to use. - /// , , , , , or is null. - public Response CreateOrUpdateFunctionSecretSlot(string resourceGroupName, string name, string functionName, string keyName, string slot, KeyInfo key, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - using var message = CreateCreateOrUpdateFunctionSecretSlotRequest(resourceGroupName, name, functionName, keyName, slot, key); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - KeyInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = KeyInfo.DeserializeKeyInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteFunctionSecretSlotRequest(string resourceGroupName, string name, string functionName, string keyName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendPath("/keys/", false); - uri.AppendPath(keyName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a function secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The name of the function. - /// The name of the key. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , , or is null. - public async Task DeleteFunctionSecretSlotAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteFunctionSecretSlotRequest(resourceGroupName, name, functionName, keyName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a function secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The name of the function. - /// The name of the key. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , , or is null. - public Response DeleteFunctionSecretSlot(string resourceGroupName, string name, string functionName, string keyName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteFunctionSecretSlotRequest(resourceGroupName, name, functionName, keyName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListFunctionKeysSlotRequest(string resourceGroupName, string name, string functionName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendPath("/listkeys", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get function keys for a function in a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListFunctionKeysSlotAsync(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListFunctionKeysSlotRequest(resourceGroupName, name, functionName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get function keys for a function in a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListFunctionKeysSlot(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListFunctionKeysSlotRequest(resourceGroupName, name, functionName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - StringDictionary value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = StringDictionary.DeserializeStringDictionary(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListFunctionSecretsSlotRequest(string resourceGroupName, string name, string functionName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/functions/", false); - uri.AppendPath(functionName, true); - uri.AppendPath("/listsecrets", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get function secrets for a function in a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListFunctionSecretsSlotAsync(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListFunctionSecretsSlotRequest(resourceGroupName, name, functionName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionSecrets value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get function secrets for a function in a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Function name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListFunctionSecretsSlot(string resourceGroupName, string name, string functionName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (functionName == null) - { - throw new ArgumentNullException(nameof(functionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListFunctionSecretsSlotRequest(resourceGroupName, name, functionName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionSecrets value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHostKeysSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/host/default/listkeys", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get host secrets for a function app. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListHostKeysSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListHostKeysSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HostKeys value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HostKeys.DeserializeHostKeys(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get host secrets for a function app. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListHostKeysSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListHostKeysSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HostKeys value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HostKeys.DeserializeHostKeys(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSyncStatusSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/host/default/listsyncstatus", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for This is to allow calling via powershell and ARM template. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public async Task ListSyncStatusSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSyncStatusSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for This is to allow calling via powershell and ARM template. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListSyncStatusSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSyncStatusSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateSyncFunctionsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/host/default/sync", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Syncs function trigger metadata to the management database. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public async Task SyncFunctionsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateSyncFunctionsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Syncs function trigger metadata to the management database. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public Response SyncFunctionsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateSyncFunctionsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateHostSecretSlotRequest(string resourceGroupName, string name, string keyType, string keyName, string slot, KeyInfo key) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/host/default/", false); - uri.AppendPath(keyType, true); - uri.AppendPath("/", false); - uri.AppendPath(keyName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(key); - request.Content = content; - return message; - } - - /// Description for Add or update a host level secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The type of host key. - /// The name of the key. - /// Name of the deployment slot. - /// The key to create or update. - /// The cancellation token to use. - /// , , , , , or is null. - public async Task> CreateOrUpdateHostSecretSlotAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, KeyInfo key, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (keyType == null) - { - throw new ArgumentNullException(nameof(keyType)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - using var message = CreateCreateOrUpdateHostSecretSlotRequest(resourceGroupName, name, keyType, keyName, slot, key); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - KeyInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = KeyInfo.DeserializeKeyInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Add or update a host level secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The type of host key. - /// The name of the key. - /// Name of the deployment slot. - /// The key to create or update. - /// The cancellation token to use. - /// , , , , , or is null. - public Response CreateOrUpdateHostSecretSlot(string resourceGroupName, string name, string keyType, string keyName, string slot, KeyInfo key, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (keyType == null) - { - throw new ArgumentNullException(nameof(keyType)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - using var message = CreateCreateOrUpdateHostSecretSlotRequest(resourceGroupName, name, keyType, keyName, slot, key); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - KeyInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = KeyInfo.DeserializeKeyInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteHostSecretSlotRequest(string resourceGroupName, string name, string keyType, string keyName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/host/default/", false); - uri.AppendPath(keyType, true); - uri.AppendPath("/", false); - uri.AppendPath(keyName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a host level secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The type of host key. - /// The name of the key. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , , or is null. - public async Task DeleteHostSecretSlotAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (keyType == null) - { - throw new ArgumentNullException(nameof(keyType)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteHostSecretSlotRequest(resourceGroupName, name, keyType, keyName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a host level secret. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The type of host key. - /// The name of the key. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , , or is null. - public Response DeleteHostSecretSlot(string resourceGroupName, string name, string keyType, string keyName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (keyType == null) - { - throw new ArgumentNullException(nameof(keyType)); - } - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteHostSecretSlotRequest(resourceGroupName, name, keyType, keyName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHostNameBindingsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hostNameBindings", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get hostname bindings for an app or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListHostNameBindingsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListHostNameBindingsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HostNameBindingCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get hostname bindings for an app or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListHostNameBindingsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListHostNameBindingsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HostNameBindingCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetHostNameBindingSlotRequest(string resourceGroupName, string name, string slot, string hostName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hostNameBindings/", false); - uri.AppendPath(hostName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the named hostname binding for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API the named binding for the production slot. - /// Hostname in the hostname binding. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetHostNameBindingSlotAsync(string resourceGroupName, string name, string slot, string hostName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (hostName == null) - { - throw new ArgumentNullException(nameof(hostName)); - } - - using var message = CreateGetHostNameBindingSlotRequest(resourceGroupName, name, slot, hostName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HostNameBinding value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the named hostname binding for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API the named binding for the production slot. - /// Hostname in the hostname binding. - /// The cancellation token to use. - /// , , , or is null. - public Response GetHostNameBindingSlot(string resourceGroupName, string name, string slot, string hostName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (hostName == null) - { - throw new ArgumentNullException(nameof(hostName)); - } - - using var message = CreateGetHostNameBindingSlotRequest(resourceGroupName, name, slot, hostName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HostNameBinding value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateHostNameBindingSlotRequest(string resourceGroupName, string name, string hostName, string slot, HostNameBinding hostNameBinding) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hostNameBindings/", false); - uri.AppendPath(hostName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(hostNameBinding); - request.Content = content; - return message; - } - - /// Description for Creates a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Hostname in the hostname binding. - /// Name of the deployment slot. If a slot is not specified, the API will create a binding for the production slot. - /// Binding details. This is the JSON representation of a HostNameBinding object. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> CreateOrUpdateHostNameBindingSlotAsync(string resourceGroupName, string name, string hostName, string slot, HostNameBinding hostNameBinding, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostName == null) - { - throw new ArgumentNullException(nameof(hostName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (hostNameBinding == null) - { - throw new ArgumentNullException(nameof(hostNameBinding)); - } - - using var message = CreateCreateOrUpdateHostNameBindingSlotRequest(resourceGroupName, name, hostName, slot, hostNameBinding); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HostNameBinding value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Hostname in the hostname binding. - /// Name of the deployment slot. If a slot is not specified, the API will create a binding for the production slot. - /// Binding details. This is the JSON representation of a HostNameBinding object. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateOrUpdateHostNameBindingSlot(string resourceGroupName, string name, string hostName, string slot, HostNameBinding hostNameBinding, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (hostName == null) - { - throw new ArgumentNullException(nameof(hostName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (hostNameBinding == null) - { - throw new ArgumentNullException(nameof(hostNameBinding)); - } - - using var message = CreateCreateOrUpdateHostNameBindingSlotRequest(resourceGroupName, name, hostName, slot, hostNameBinding); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HostNameBinding value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HostNameBinding.DeserializeHostNameBinding(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteHostNameBindingSlotRequest(string resourceGroupName, string name, string slot, string hostName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hostNameBindings/", false); - uri.AppendPath(hostName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// Hostname in the hostname binding. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteHostNameBindingSlotAsync(string resourceGroupName, string name, string slot, string hostName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (hostName == null) - { - throw new ArgumentNullException(nameof(hostName)); - } - - using var message = CreateDeleteHostNameBindingSlotRequest(resourceGroupName, name, slot, hostName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// Hostname in the hostname binding. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteHostNameBindingSlot(string resourceGroupName, string name, string slot, string hostName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (hostName == null) - { - throw new ArgumentNullException(nameof(hostName)); - } - - using var message = CreateDeleteHostNameBindingSlotRequest(resourceGroupName, name, slot, hostName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetHybridConnectionSlotRequest(string resourceGroupName, string name, string namespaceName, string relayName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hybridConnectionNamespaces/", false); - uri.AppendPath(namespaceName, true); - uri.AppendPath("/relays/", false); - uri.AppendPath(relayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The name of the slot for the web app. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> GetHybridConnectionSlotAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The name of the slot for the web app. - /// The cancellation token to use. - /// , , , , or is null. - public Response GetHybridConnectionSlot(string resourceGroupName, string name, string namespaceName, string relayName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateHybridConnectionSlotRequest(string resourceGroupName, string name, string namespaceName, string relayName, string slot, HybridConnection connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hybridConnectionNamespaces/", false); - uri.AppendPath(namespaceName, true); - uri.AppendPath("/relays/", false); - uri.AppendPath(relayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new Hybrid Connection using a Service Bus relay. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The name of the slot for the web app. - /// The details of the hybrid connection. - /// The cancellation token to use. - /// , , , , , or is null. - public async Task> CreateOrUpdateHybridConnectionSlotAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new Hybrid Connection using a Service Bus relay. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The name of the slot for the web app. - /// The details of the hybrid connection. - /// The cancellation token to use. - /// , , , , , or is null. - public Response CreateOrUpdateHybridConnectionSlot(string resourceGroupName, string name, string namespaceName, string relayName, string slot, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteHybridConnectionSlotRequest(string resourceGroupName, string name, string namespaceName, string relayName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hybridConnectionNamespaces/", false); - uri.AppendPath(namespaceName, true); - uri.AppendPath("/relays/", false); - uri.AppendPath(relayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Removes a Hybrid Connection from this site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The name of the slot for the web app. - /// The cancellation token to use. - /// , , , , or is null. - public async Task DeleteHybridConnectionSlotAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Removes a Hybrid Connection from this site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The name of the slot for the web app. - /// The cancellation token to use. - /// , , , , or is null. - public Response DeleteHybridConnectionSlot(string resourceGroupName, string name, string namespaceName, string relayName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateHybridConnectionSlotRequest(string resourceGroupName, string name, string namespaceName, string relayName, string slot, HybridConnection connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hybridConnectionNamespaces/", false); - uri.AppendPath(namespaceName, true); - uri.AppendPath("/relays/", false); - uri.AppendPath(relayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new Hybrid Connection using a Service Bus relay. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The name of the slot for the web app. - /// The details of the hybrid connection. - /// The cancellation token to use. - /// , , , , , or is null. - public async Task> UpdateHybridConnectionSlotAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new Hybrid Connection using a Service Bus relay. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The namespace for this hybrid connection. - /// The relay name for this hybrid connection. - /// The name of the slot for the web app. - /// The details of the hybrid connection. - /// The cancellation token to use. - /// , , , , , or is null. - public Response UpdateHybridConnectionSlot(string resourceGroupName, string name, string namespaceName, string relayName, string slot, HybridConnection connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (namespaceName == null) - { - throw new ArgumentNullException(nameof(namespaceName)); - } - if (relayName == null) - { - throw new ArgumentNullException(nameof(relayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateHybridConnectionSlotRequest(resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHybridConnectionsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hybridConnectionRelays", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for the web app. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListHybridConnectionsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListHybridConnectionsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for the web app. - /// The cancellation token to use. - /// , , or is null. - public Response ListHybridConnectionsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListHybridConnectionsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnection.DeserializeHybridConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRelayServiceConnectionsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hybridconnection", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets hybrid connections configured for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListRelayServiceConnectionsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListRelayServiceConnectionsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets hybrid connections configured for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListRelayServiceConnectionsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListRelayServiceConnectionsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRelayServiceConnectionSlotRequest(string resourceGroupName, string name, string entityName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hybridconnection/", false); - uri.AppendPath(entityName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a hybrid connection configuration by its name. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection. - /// Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetRelayServiceConnectionSlotAsync(string resourceGroupName, string name, string entityName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a hybrid connection configuration by its name. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection. - /// Name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetRelayServiceConnectionSlot(string resourceGroupName, string name, string entityName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRelayServiceConnectionSlotRequest(string resourceGroupName, string name, string entityName, string slot, RelayServiceConnectionEntity connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hybridconnection/", false); - uri.AppendPath(entityName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection configuration. - /// Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid connection for the production slot. - /// Details of the hybrid connection configuration. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> CreateOrUpdateRelayServiceConnectionSlotAsync(string resourceGroupName, string name, string entityName, string slot, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection configuration. - /// Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid connection for the production slot. - /// Details of the hybrid connection configuration. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateOrUpdateRelayServiceConnectionSlot(string resourceGroupName, string name, string entityName, string slot, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRelayServiceConnectionSlotRequest(string resourceGroupName, string name, string entityName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hybridconnection/", false); - uri.AppendPath(entityName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a relay service connection by its name. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection configuration. - /// Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteRelayServiceConnectionSlotAsync(string resourceGroupName, string name, string entityName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a relay service connection by its name. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection configuration. - /// Name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteRelayServiceConnectionSlot(string resourceGroupName, string name, string entityName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRelayServiceConnectionSlotRequest(string resourceGroupName, string name, string entityName, string slot, RelayServiceConnectionEntity connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hybridconnection/", false); - uri.AppendPath(entityName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection configuration. - /// Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid connection for the production slot. - /// Details of the hybrid connection configuration. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> UpdateRelayServiceConnectionSlotAsync(string resourceGroupName, string name, string entityName, string slot, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the hybrid connection configuration. - /// Name of the deployment slot. If a slot is not specified, the API will create or update a hybrid connection for the production slot. - /// Details of the hybrid connection configuration. - /// The cancellation token to use. - /// , , , , or is null. - public Response UpdateRelayServiceConnectionSlot(string resourceGroupName, string name, string entityName, string slot, RelayServiceConnectionEntity connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (entityName == null) - { - throw new ArgumentNullException(nameof(entityName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateRelayServiceConnectionSlotRequest(resourceGroupName, name, entityName, slot, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RelayServiceConnectionEntity value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RelayServiceConnectionEntity.DeserializeRelayServiceConnectionEntity(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceIdentifiersSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/instances", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all scale-out instances of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListInstanceIdentifiersSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListInstanceIdentifiersSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppInstanceStatusCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all scale-out instances of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - /// The cancellation token to use. - /// , , or is null. - public Response ListInstanceIdentifiersSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListInstanceIdentifiersSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppInstanceStatusCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceInfoSlotRequest(string resourceGroupName, string name, string instanceId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all scale-out instances of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetInstanceInfoSlotAsync(string resourceGroupName, string name, string instanceId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetInstanceInfoSlotRequest(resourceGroupName, name, instanceId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebSiteInstanceStatus value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebSiteInstanceStatus.DeserializeWebSiteInstanceStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all scale-out instances of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - /// The cancellation token to use. - /// , , , or is null. - public Response GetInstanceInfoSlot(string resourceGroupName, string name, string instanceId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetInstanceInfoSlotRequest(resourceGroupName, name, instanceId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebSiteInstanceStatus value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebSiteInstanceStatus.DeserializeWebSiteInstanceStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceMsDeployStatusSlotRequest(string resourceGroupName, string name, string slot, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/extensions/MSDeploy", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the status of the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// ID of web app instance. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetInstanceMsDeployStatusSlotAsync(string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceMsDeployStatusSlotRequest(resourceGroupName, name, slot, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MSDeployStatus value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the status of the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// ID of web app instance. - /// The cancellation token to use. - /// , , , or is null. - public Response GetInstanceMsDeployStatusSlot(string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceMsDeployStatusSlotRequest(resourceGroupName, name, slot, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MSDeployStatus value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MSDeployStatus.DeserializeMSDeployStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateInstanceMSDeployOperationSlotRequest(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/extensions/MSDeploy", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(mSDeploy); - request.Content = content; - return message; - } - - /// Description for Invoke the MSDeploy web app extension. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// ID of web app instance. - /// Details of MSDeploy operation. - /// The cancellation token to use. - /// , , , , or is null. - public async Task CreateInstanceMSDeployOperationSlotAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - if (mSDeploy == null) - { - throw new ArgumentNullException(nameof(mSDeploy)); - } - - using var message = CreateCreateInstanceMSDeployOperationSlotRequest(resourceGroupName, name, slot, instanceId, mSDeploy); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 201: - case 409: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Invoke the MSDeploy web app extension. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// ID of web app instance. - /// Details of MSDeploy operation. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateInstanceMSDeployOperationSlot(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - if (mSDeploy == null) - { - throw new ArgumentNullException(nameof(mSDeploy)); - } - - using var message = CreateCreateInstanceMSDeployOperationSlotRequest(resourceGroupName, name, slot, instanceId, mSDeploy); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 201: - case 409: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceMSDeployLogSlotRequest(string resourceGroupName, string name, string slot, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/extensions/MSDeploy/log", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// ID of web app instance. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetInstanceMSDeployLogSlotAsync(string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceMSDeployLogSlotRequest(resourceGroupName, name, slot, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MSDeployLog value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MSDeployLog)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// ID of web app instance. - /// The cancellation token to use. - /// , , , or is null. - public Response GetInstanceMSDeployLogSlot(string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceMSDeployLogSlotRequest(resourceGroupName, name, slot, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MSDeployLog value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MSDeployLog.DeserializeMSDeployLog(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((MSDeployLog)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceProcessesSlotRequest(string resourceGroupName, string name, string slot, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListInstanceProcessesSlotAsync(string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessesSlotRequest(resourceGroupName, name, slot, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public Response ListInstanceProcessesSlot(string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessesSlotRequest(resourceGroupName, name, slot, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceProcessSlotRequest(string resourceGroupName, string name, string processId, string slot, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public async Task> GetInstanceProcessSlotAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceProcessSlotRequest(resourceGroupName, name, processId, slot, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessInfo.DeserializeProcessInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfo)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public Response GetInstanceProcessSlot(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceProcessSlotRequest(resourceGroupName, name, processId, slot, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessInfo.DeserializeProcessInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfo)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteInstanceProcessSlotRequest(string resourceGroupName, string name, string processId, string slot, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public async Task DeleteInstanceProcessSlotAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateDeleteInstanceProcessSlotRequest(resourceGroupName, name, processId, slot, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public Response DeleteInstanceProcessSlot(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateDeleteInstanceProcessSlotRequest(resourceGroupName, name, processId, slot, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceProcessDumpSlotRequest(string resourceGroupName, string name, string processId, string slot, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/dump", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public async Task> GetInstanceProcessDumpSlotAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceProcessDumpSlotRequest(resourceGroupName, name, processId, slot, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((Stream)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public Response GetInstanceProcessDumpSlot(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceProcessDumpSlotRequest(resourceGroupName, name, processId, slot, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((Stream)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceProcessModulesSlotRequest(string resourceGroupName, string name, string processId, string slot, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/modules", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListInstanceProcessModulesSlotAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessModulesSlotRequest(resourceGroupName, name, processId, slot, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public Response ListInstanceProcessModulesSlot(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessModulesSlotRequest(resourceGroupName, name, processId, slot, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInstanceProcessModuleSlotRequest(string resourceGroupName, string name, string processId, string baseAddress, string slot, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/modules/", false); - uri.AppendPath(baseAddress, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Module base address. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , , or is null. - public async Task> GetInstanceProcessModuleSlotAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (baseAddress == null) - { - throw new ArgumentNullException(nameof(baseAddress)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceProcessModuleSlotRequest(resourceGroupName, name, processId, baseAddress, slot, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfo)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Module base address. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , , or is null. - public Response GetInstanceProcessModuleSlot(string resourceGroupName, string name, string processId, string baseAddress, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (baseAddress == null) - { - throw new ArgumentNullException(nameof(baseAddress)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateGetInstanceProcessModuleSlotRequest(resourceGroupName, name, processId, baseAddress, slot, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfo)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceProcessThreadsSlotRequest(string resourceGroupName, string name, string processId, string slot, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/instances/", false); - uri.AppendPath(instanceId, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/threads", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListInstanceProcessThreadsSlotAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessThreadsSlotRequest(resourceGroupName, name, processId, slot, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public Response ListInstanceProcessThreadsSlot(string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessThreadsSlotRequest(resourceGroupName, name, processId, slot, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateIsCloneableSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/iscloneable", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Shows whether an app can be cloned to another resource group or subscription. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. By default, this API returns information on the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> IsCloneableSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateIsCloneableSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteCloneability value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteCloneability.DeserializeSiteCloneability(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Shows whether an app can be cloned to another resource group or subscription. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. By default, this API returns information on the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response IsCloneableSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateIsCloneableSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteCloneability value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteCloneability.DeserializeSiteCloneability(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteBackupsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/listbackups", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets existing backups of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSiteBackupsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteBackupsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets existing backups of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListSiteBackupsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteBackupsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSyncFunctionTriggersSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/listsyncfunctiontriggerstatus", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for This is to allow calling via powershell and ARM template. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSyncFunctionTriggersSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSyncFunctionTriggersSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionSecrets value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for This is to allow calling via powershell and ARM template. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListSyncFunctionTriggersSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSyncFunctionTriggersSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionSecrets value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionSecrets.DeserializeFunctionSecrets(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetMigrateMySqlStatusSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/migratemysql/status", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetMigrateMySqlStatusSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetMigrateMySqlStatusSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MigrateMySqlStatus value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MigrateMySqlStatus.DeserializeMigrateMySqlStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetMigrateMySqlStatusSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetMigrateMySqlStatusSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MigrateMySqlStatus value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MigrateMySqlStatus.DeserializeMigrateMySqlStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSwiftVirtualNetworkConnectionSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/networkConfig/virtualNetwork", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a Swift Virtual Network connection. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get a gateway for the production slot's Virtual Network. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetSwiftVirtualNetworkConnectionSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSwiftVirtualNetworkConnectionSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SwiftVirtualNetwork value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SwiftVirtualNetwork.DeserializeSwiftVirtualNetwork(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a Swift Virtual Network connection. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get a gateway for the production slot's Virtual Network. - /// The cancellation token to use. - /// , , or is null. - public Response GetSwiftVirtualNetworkConnectionSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSwiftVirtualNetworkConnectionSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SwiftVirtualNetwork value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SwiftVirtualNetwork.DeserializeSwiftVirtualNetwork(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteSwiftVirtualNetworkSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/networkConfig/virtualNetwork", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the connection for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteSwiftVirtualNetworkSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteSwiftVirtualNetworkSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the connection for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteSwiftVirtualNetworkSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteSwiftVirtualNetworkSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNetworkFeaturesSlotRequest(string resourceGroupName, string name, string view, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/networkFeatures/", false); - uri.AppendPath(view, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all network features used by the app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The type of view. Only "summary" is supported at this time. - /// Name of the deployment slot. If a slot is not specified, the API will get network features for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListNetworkFeaturesSlotAsync(string resourceGroupName, string name, string view, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (view == null) - { - throw new ArgumentNullException(nameof(view)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListNetworkFeaturesSlotRequest(resourceGroupName, name, view, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkFeatures value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NetworkFeatures.DeserializeNetworkFeatures(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NetworkFeatures)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all network features used by the app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The type of view. Only "summary" is supported at this time. - /// Name of the deployment slot. If a slot is not specified, the API will get network features for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListNetworkFeaturesSlot(string resourceGroupName, string name, string view, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (view == null) - { - throw new ArgumentNullException(nameof(view)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListNetworkFeaturesSlotRequest(resourceGroupName, name, view, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkFeatures value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NetworkFeatures.DeserializeNetworkFeatures(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NetworkFeatures)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetNetworkTraceOperationSlotRequest(string resourceGroupName, string name, string operationId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/networkTrace/operationresults/", false); - uri.AppendPath(operationId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetNetworkTraceOperationSlotAsync(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetNetworkTraceOperationSlotRequest(resourceGroupName, name, operationId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - case 202: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetNetworkTraceOperationSlot(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetNetworkTraceOperationSlotRequest(resourceGroupName, name, operationId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - case 202: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStartWebSiteNetworkTraceSlotRequest(string resourceGroupName, string name, string slot, int? durationInSeconds, int? maxFrameLength, string sasUrl) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/networkTrace/start", false); - if (durationInSeconds != null) - { - uri.AppendQuery("durationInSeconds", durationInSeconds.Value, true); - } - if (maxFrameLength != null) - { - uri.AppendQuery("maxFrameLength", maxFrameLength.Value, true); - } - if (sasUrl != null) - { - uri.AppendQuery("sasUrl", sasUrl, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Start capturing network packets for the site (To be deprecated). - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for this web app. - /// The duration to keep capturing in seconds. - /// The maximum frame length in bytes (Optional). - /// The Blob URL to store capture file. - /// The cancellation token to use. - /// , , or is null. - public async Task> StartWebSiteNetworkTraceSlotAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStartWebSiteNetworkTraceSlotRequest(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - string value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = document.RootElement.GetString(); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Start capturing network packets for the site (To be deprecated). - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for this web app. - /// The duration to keep capturing in seconds. - /// The maximum frame length in bytes (Optional). - /// The Blob URL to store capture file. - /// The cancellation token to use. - /// , , or is null. - public Response StartWebSiteNetworkTraceSlot(string resourceGroupName, string name, string slot, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStartWebSiteNetworkTraceSlotRequest(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - string value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = document.RootElement.GetString(); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStartWebSiteNetworkTraceOperationSlotRequest(string resourceGroupName, string name, string slot, int? durationInSeconds, int? maxFrameLength, string sasUrl) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/networkTrace/startOperation", false); - if (durationInSeconds != null) - { - uri.AppendQuery("durationInSeconds", durationInSeconds.Value, true); - } - if (maxFrameLength != null) - { - uri.AppendQuery("maxFrameLength", maxFrameLength.Value, true); - } - if (sasUrl != null) - { - uri.AppendQuery("sasUrl", sasUrl, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Start capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for this web app. - /// The duration to keep capturing in seconds. - /// The maximum frame length in bytes (Optional). - /// The Blob URL to store capture file. - /// The cancellation token to use. - /// , , or is null. - public async Task StartWebSiteNetworkTraceOperationSlotAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStartWebSiteNetworkTraceOperationSlotRequest(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Start capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for this web app. - /// The duration to keep capturing in seconds. - /// The maximum frame length in bytes (Optional). - /// The Blob URL to store capture file. - /// The cancellation token to use. - /// , , or is null. - public Response StartWebSiteNetworkTraceOperationSlot(string resourceGroupName, string name, string slot, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStartWebSiteNetworkTraceOperationSlotRequest(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStopWebSiteNetworkTraceSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/networkTrace/stop", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Stop ongoing capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for this web app. - /// The cancellation token to use. - /// , , or is null. - public async Task StopWebSiteNetworkTraceSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStopWebSiteNetworkTraceSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Stop ongoing capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for this web app. - /// The cancellation token to use. - /// , , or is null. - public Response StopWebSiteNetworkTraceSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStopWebSiteNetworkTraceSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetNetworkTracesSlotRequest(string resourceGroupName, string name, string operationId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/networkTrace/", false); - uri.AppendPath(operationId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task>> GetNetworkTracesSlotAsync(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetNetworkTracesSlotRequest(resourceGroupName, name, operationId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response> GetNetworkTracesSlot(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetNetworkTracesSlotRequest(resourceGroupName, name, operationId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetNetworkTraceOperationSlotV2Request(string resourceGroupName, string name, string operationId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/networkTraces/current/operationresults/", false); - uri.AppendPath(operationId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetNetworkTraceOperationSlotV2Async(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetNetworkTraceOperationSlotV2Request(resourceGroupName, name, operationId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - case 202: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetNetworkTraceOperationSlotV2(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetNetworkTraceOperationSlotV2Request(resourceGroupName, name, operationId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - case 202: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetNetworkTracesSlotV2Request(string resourceGroupName, string name, string operationId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/networkTraces/", false); - uri.AppendPath(operationId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task>> GetNetworkTracesSlotV2Async(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetNetworkTracesSlotV2Request(resourceGroupName, name, operationId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// GUID of the operation. - /// Name of the deployment slot. If a slot is not specified, the API will get an operation for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response> GetNetworkTracesSlotV2(string resourceGroupName, string name, string operationId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (operationId == null) - { - throw new ArgumentNullException(nameof(operationId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetNetworkTracesSlotV2Request(resourceGroupName, name, operationId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(NetworkTrace.DeserializeNetworkTrace(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGenerateNewSitePublishingPasswordSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/newpassword", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Generates a new publishing password for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API generate a new publishing password for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task GenerateNewSitePublishingPasswordSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGenerateNewSitePublishingPasswordSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Generates a new publishing password for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API generate a new publishing password for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GenerateNewSitePublishingPasswordSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGenerateNewSitePublishingPasswordSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPerfMonCountersSlotRequest(string resourceGroupName, string name, string slot, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/perfcounters", false); - uri.AppendQuery("api-version", apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets perfmon counters for web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListPerfMonCountersSlotAsync(string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListPerfMonCountersSlotRequest(resourceGroupName, name, slot, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PerfMonCounterCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets perfmon counters for web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , or is null. - public Response ListPerfMonCountersSlot(string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListPerfMonCountersSlotRequest(resourceGroupName, name, slot, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PerfMonCounterCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSitePhpErrorLogFlagSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/phplogging", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets web app's event logs. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetSitePhpErrorLogFlagSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSitePhpErrorLogFlagSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SitePhpErrorLogFlag value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SitePhpErrorLogFlag.DeserializeSitePhpErrorLogFlag(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets web app's event logs. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetSitePhpErrorLogFlagSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSitePhpErrorLogFlagSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SitePhpErrorLogFlag value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SitePhpErrorLogFlag.DeserializeSitePhpErrorLogFlag(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPremierAddOnsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/premieraddons", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the premier add-ons of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListPremierAddOnsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListPremierAddOnsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the premier add-ons of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListPremierAddOnsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListPremierAddOnsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPremierAddOnSlotRequest(string resourceGroupName, string name, string premierAddOnName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/premieraddons/", false); - uri.AppendPath(premierAddOnName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a named add-on of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetPremierAddOnSlotAsync(string resourceGroupName, string name, string premierAddOnName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetPremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a named add-on of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// Name of the deployment slot. If a slot is not specified, the API will get the named add-on for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetPremierAddOnSlot(string resourceGroupName, string name, string premierAddOnName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetPremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateAddPremierAddOnSlotRequest(string resourceGroupName, string name, string premierAddOnName, string slot, PremierAddOn premierAddOn) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/premieraddons/", false); - uri.AppendPath(premierAddOnName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(premierAddOn); - request.Content = content; - return message; - } - - /// Description for Updates a named add-on of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the production slot. - /// A JSON representation of the edited premier add-on. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> AddPremierAddOnSlotAsync(string resourceGroupName, string name, string premierAddOnName, string slot, PremierAddOn premierAddOn, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (premierAddOn == null) - { - throw new ArgumentNullException(nameof(premierAddOn)); - } - - using var message = CreateAddPremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot, premierAddOn); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates a named add-on of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the production slot. - /// A JSON representation of the edited premier add-on. - /// The cancellation token to use. - /// , , , , or is null. - public Response AddPremierAddOnSlot(string resourceGroupName, string name, string premierAddOnName, string slot, PremierAddOn premierAddOn, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (premierAddOn == null) - { - throw new ArgumentNullException(nameof(premierAddOn)); - } - - using var message = CreateAddPremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot, premierAddOn); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeletePremierAddOnSlotRequest(string resourceGroupName, string name, string premierAddOnName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/premieraddons/", false); - uri.AppendPath(premierAddOnName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a premier add-on from an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeletePremierAddOnSlotAsync(string resourceGroupName, string name, string premierAddOnName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeletePremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a premier add-on from an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// Name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response DeletePremierAddOnSlot(string resourceGroupName, string name, string premierAddOnName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeletePremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdatePremierAddOnSlotRequest(string resourceGroupName, string name, string premierAddOnName, string slot, PremierAddOnPatchResource premierAddOn) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/premieraddons/", false); - uri.AppendPath(premierAddOnName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(premierAddOn); - request.Content = content; - return message; - } - - /// Description for Updates a named add-on of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the production slot. - /// A JSON representation of the edited premier add-on. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> UpdatePremierAddOnSlotAsync(string resourceGroupName, string name, string premierAddOnName, string slot, PremierAddOnPatchResource premierAddOn, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (premierAddOn == null) - { - throw new ArgumentNullException(nameof(premierAddOn)); - } - - using var message = CreateUpdatePremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot, premierAddOn); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates a named add-on of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Add-on name. - /// Name of the deployment slot. If a slot is not specified, the API will update the named add-on for the production slot. - /// A JSON representation of the edited premier add-on. - /// The cancellation token to use. - /// , , , , or is null. - public Response UpdatePremierAddOnSlot(string resourceGroupName, string name, string premierAddOnName, string slot, PremierAddOnPatchResource premierAddOn, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (premierAddOnName == null) - { - throw new ArgumentNullException(nameof(premierAddOnName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (premierAddOn == null) - { - throw new ArgumentNullException(nameof(premierAddOn)); - } - - using var message = CreateUpdatePremierAddOnSlotRequest(resourceGroupName, name, premierAddOnName, slot, premierAddOn); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PremierAddOn value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PremierAddOn.DeserializePremierAddOn(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateAccessSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/privateAccess/virtualNetworks", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets data around private site access enablement and authorized Virtual Networks that can access the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for the web app. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetPrivateAccessSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetPrivateAccessSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateAccess value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateAccess.DeserializePrivateAccess(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets data around private site access enablement and authorized Virtual Networks that can access the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for the web app. - /// The cancellation token to use. - /// , , or is null. - public Response GetPrivateAccessSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetPrivateAccessSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateAccess value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateAccess.DeserializePrivateAccess(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreatePutPrivateAccessVnetSlotRequest(string resourceGroupName, string name, string slot, PrivateAccess access) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/privateAccess/virtualNetworks", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(access); - request.Content = content; - return message; - } - - /// Description for Sets data around private site access enablement and authorized Virtual Networks that can access the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for the web app. - /// The information for the private access. - /// The cancellation token to use. - /// , , , or is null. - public async Task> PutPrivateAccessVnetSlotAsync(string resourceGroupName, string name, string slot, PrivateAccess access, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (access == null) - { - throw new ArgumentNullException(nameof(access)); - } - - using var message = CreatePutPrivateAccessVnetSlotRequest(resourceGroupName, name, slot, access); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateAccess value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateAccess.DeserializePrivateAccess(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Sets data around private site access enablement and authorized Virtual Networks that can access the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for the web app. - /// The information for the private access. - /// The cancellation token to use. - /// , , , or is null. - public Response PutPrivateAccessVnetSlot(string resourceGroupName, string name, string slot, PrivateAccess access, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (access == null) - { - throw new ArgumentNullException(nameof(access)); - } - - using var message = CreatePutPrivateAccessVnetSlotRequest(resourceGroupName, name, slot, access); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateAccess value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateAccess.DeserializePrivateAccess(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateEndpointConnectionListSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/privateEndpointConnections", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the list of private endpoint connections associated with a site. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// Name of the site deployment slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetPrivateEndpointConnectionListSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetPrivateEndpointConnectionListSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the list of private endpoint connections associated with a site. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// Name of the site deployment slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetPrivateEndpointConnectionListSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetPrivateEndpointConnectionListSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateEndpointConnectionSlotRequest(string resourceGroupName, string name, string privateEndpointConnectionName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// Name of the private endpoint connection. - /// Name of the site deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetPrivateEndpointConnectionSlotAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetPrivateEndpointConnectionSlotRequest(resourceGroupName, name, privateEndpointConnectionName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RemotePrivateEndpointConnectionARMResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// Name of the private endpoint connection. - /// Name of the site deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetPrivateEndpointConnectionSlot(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetPrivateEndpointConnectionSlotRequest(resourceGroupName, name, privateEndpointConnectionName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RemotePrivateEndpointConnectionARMResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RemotePrivateEndpointConnectionARMResource.DeserializeRemotePrivateEndpointConnectionARMResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateApproveOrRejectPrivateEndpointConnectionSlotRequest(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(privateEndpointWrapper); - request.Content = content; - return message; - } - - /// Description for Approves or rejects a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The String to use. - /// The String to use. - /// The PrivateLinkConnectionApprovalRequestResource to use. - /// The cancellation token to use. - /// , , , , or is null. - public async Task ApproveOrRejectPrivateEndpointConnectionSlotAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (privateEndpointWrapper == null) - { - throw new ArgumentNullException(nameof(privateEndpointWrapper)); - } - - using var message = CreateApproveOrRejectPrivateEndpointConnectionSlotRequest(resourceGroupName, name, privateEndpointConnectionName, slot, privateEndpointWrapper); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Approves or rejects a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The String to use. - /// The String to use. - /// The PrivateLinkConnectionApprovalRequestResource to use. - /// The cancellation token to use. - /// , , , , or is null. - public Response ApproveOrRejectPrivateEndpointConnectionSlot(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (privateEndpointWrapper == null) - { - throw new ArgumentNullException(nameof(privateEndpointWrapper)); - } - - using var message = CreateApproveOrRejectPrivateEndpointConnectionSlotRequest(resourceGroupName, name, privateEndpointConnectionName, slot, privateEndpointWrapper); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeletePrivateEndpointConnectionSlotRequest(string resourceGroupName, string name, string privateEndpointConnectionName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The String to use. - /// The String to use. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeletePrivateEndpointConnectionSlotAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeletePrivateEndpointConnectionSlotRequest(resourceGroupName, name, privateEndpointConnectionName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a private endpoint connection. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The String to use. - /// The String to use. - /// The cancellation token to use. - /// , , , or is null. - public Response DeletePrivateEndpointConnectionSlot(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (privateEndpointConnectionName == null) - { - throw new ArgumentNullException(nameof(privateEndpointConnectionName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeletePrivateEndpointConnectionSlotRequest(resourceGroupName, name, privateEndpointConnectionName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateLinkResourcesSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the private link resources. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetPrivateLinkResourcesSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetPrivateLinkResourcesSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateLinkResourcesWrapper value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the private link resources. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response GetPrivateLinkResourcesSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetPrivateLinkResourcesSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateLinkResourcesWrapper value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateLinkResourcesWrapper.DeserializePrivateLinkResourcesWrapper(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProcessesSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/processes", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListProcessesSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListProcessesSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListProcessesSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListProcessesSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetProcessSlotRequest(string resourceGroupName, string name, string processId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetProcessSlotAsync(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetProcessSlotRequest(resourceGroupName, name, processId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessInfo.DeserializeProcessInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfo)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetProcessSlot(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetProcessSlotRequest(resourceGroupName, name, processId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessInfo.DeserializeProcessInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfo)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteProcessSlotRequest(string resourceGroupName, string name, string processId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteProcessSlotAsync(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteProcessSlotRequest(resourceGroupName, name, processId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteProcessSlot(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteProcessSlotRequest(resourceGroupName, name, processId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetProcessDumpSlotRequest(string resourceGroupName, string name, string processId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/dump", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetProcessDumpSlotAsync(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetProcessDumpSlotRequest(resourceGroupName, name, processId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((Stream)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetProcessDumpSlot(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetProcessDumpSlotRequest(resourceGroupName, name, processId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((Stream)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProcessModulesSlotRequest(string resourceGroupName, string name, string processId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/modules", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListProcessModulesSlotAsync(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListProcessModulesSlotRequest(resourceGroupName, name, processId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListProcessModulesSlot(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListProcessModulesSlotRequest(resourceGroupName, name, processId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetProcessModuleSlotRequest(string resourceGroupName, string name, string processId, string baseAddress, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/modules/", false); - uri.AppendPath(baseAddress, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Module base address. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> GetProcessModuleSlotAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (baseAddress == null) - { - throw new ArgumentNullException(nameof(baseAddress)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetProcessModuleSlotRequest(resourceGroupName, name, processId, baseAddress, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfo)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get process information by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Module base address. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , , or is null. - public Response GetProcessModuleSlot(string resourceGroupName, string name, string processId, string baseAddress, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (baseAddress == null) - { - throw new ArgumentNullException(nameof(baseAddress)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetProcessModuleSlotRequest(resourceGroupName, name, processId, baseAddress, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessModuleInfo.DeserializeProcessModuleInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfo)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProcessThreadsSlotRequest(string resourceGroupName, string name, string processId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/processes/", false); - uri.AppendPath(processId, true); - uri.AppendPath("/threads", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListProcessThreadsSlotAsync(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListProcessThreadsSlotRequest(resourceGroupName, name, processId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListProcessThreadsSlot(string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListProcessThreadsSlotRequest(resourceGroupName, name, processId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPublicCertificatesSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/publicCertificates", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get public certificates for an app or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListPublicCertificatesSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListPublicCertificatesSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PublicCertificateCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get public certificates for an app or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListPublicCertificatesSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListPublicCertificatesSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PublicCertificateCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPublicCertificateSlotRequest(string resourceGroupName, string name, string slot, string publicCertificateName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/publicCertificates/", false); - uri.AppendPath(publicCertificateName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the named public certificate for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API the named binding for the production slot. - /// Public certificate name. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetPublicCertificateSlotAsync(string resourceGroupName, string name, string slot, string publicCertificateName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (publicCertificateName == null) - { - throw new ArgumentNullException(nameof(publicCertificateName)); - } - - using var message = CreateGetPublicCertificateSlotRequest(resourceGroupName, name, slot, publicCertificateName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PublicCertificate value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PublicCertificate.DeserializePublicCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the named public certificate for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API the named binding for the production slot. - /// Public certificate name. - /// The cancellation token to use. - /// , , , or is null. - public Response GetPublicCertificateSlot(string resourceGroupName, string name, string slot, string publicCertificateName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (publicCertificateName == null) - { - throw new ArgumentNullException(nameof(publicCertificateName)); - } - - using var message = CreateGetPublicCertificateSlotRequest(resourceGroupName, name, slot, publicCertificateName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PublicCertificate value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PublicCertificate.DeserializePublicCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdatePublicCertificateSlotRequest(string resourceGroupName, string name, string publicCertificateName, string slot, PublicCertificate publicCertificate) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/publicCertificates/", false); - uri.AppendPath(publicCertificateName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(publicCertificate); - request.Content = content; - return message; - } - - /// Description for Creates a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Public certificate name. - /// Name of the deployment slot. If a slot is not specified, the API will create a binding for the production slot. - /// Public certificate details. This is the JSON representation of a PublicCertificate object. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> CreateOrUpdatePublicCertificateSlotAsync(string resourceGroupName, string name, string publicCertificateName, string slot, PublicCertificate publicCertificate, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (publicCertificateName == null) - { - throw new ArgumentNullException(nameof(publicCertificateName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (publicCertificate == null) - { - throw new ArgumentNullException(nameof(publicCertificate)); - } - - using var message = CreateCreateOrUpdatePublicCertificateSlotRequest(resourceGroupName, name, publicCertificateName, slot, publicCertificate); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PublicCertificate value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PublicCertificate.DeserializePublicCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Creates a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Public certificate name. - /// Name of the deployment slot. If a slot is not specified, the API will create a binding for the production slot. - /// Public certificate details. This is the JSON representation of a PublicCertificate object. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateOrUpdatePublicCertificateSlot(string resourceGroupName, string name, string publicCertificateName, string slot, PublicCertificate publicCertificate, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (publicCertificateName == null) - { - throw new ArgumentNullException(nameof(publicCertificateName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (publicCertificate == null) - { - throw new ArgumentNullException(nameof(publicCertificate)); - } - - using var message = CreateCreateOrUpdatePublicCertificateSlotRequest(resourceGroupName, name, publicCertificateName, slot, publicCertificate); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PublicCertificate value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PublicCertificate.DeserializePublicCertificate(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeletePublicCertificateSlotRequest(string resourceGroupName, string name, string slot, string publicCertificateName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/publicCertificates/", false); - uri.AppendPath(publicCertificateName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// Public certificate name. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeletePublicCertificateSlotAsync(string resourceGroupName, string name, string slot, string publicCertificateName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (publicCertificateName == null) - { - throw new ArgumentNullException(nameof(publicCertificateName)); - } - - using var message = CreateDeletePublicCertificateSlotRequest(resourceGroupName, name, slot, publicCertificateName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a hostname binding for an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// Public certificate name. - /// The cancellation token to use. - /// , , , or is null. - public Response DeletePublicCertificateSlot(string resourceGroupName, string name, string slot, string publicCertificateName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (publicCertificateName == null) - { - throw new ArgumentNullException(nameof(publicCertificateName)); - } - - using var message = CreateDeletePublicCertificateSlotRequest(resourceGroupName, name, slot, publicCertificateName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPublishingProfileXmlWithSecretsSlotRequest(string resourceGroupName, string name, string slot, CsmPublishingProfileOptions publishingProfileOptions) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/publishxml", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/xml"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(publishingProfileOptions); - request.Content = content; - return message; - } - - /// Description for Gets the publishing profile for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for the production slot. - /// Specifies publishingProfileOptions for publishing profile. For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListPublishingProfileXmlWithSecretsSlotAsync(string resourceGroupName, string name, string slot, CsmPublishingProfileOptions publishingProfileOptions, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (publishingProfileOptions == null) - { - throw new ArgumentNullException(nameof(publishingProfileOptions)); - } - - using var message = CreateListPublishingProfileXmlWithSecretsSlotRequest(resourceGroupName, name, slot, publishingProfileOptions); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the publishing profile for an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for the production slot. - /// Specifies publishingProfileOptions for publishing profile. For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. - /// The cancellation token to use. - /// , , , or is null. - public Response ListPublishingProfileXmlWithSecretsSlot(string resourceGroupName, string name, string slot, CsmPublishingProfileOptions publishingProfileOptions, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (publishingProfileOptions == null) - { - throw new ArgumentNullException(nameof(publishingProfileOptions)); - } - - using var message = CreateListPublishingProfileXmlWithSecretsSlotRequest(resourceGroupName, name, slot, publishingProfileOptions); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - var value = message.ExtractResponseContent(); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateResetSlotConfigurationSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/resetSlotConfig", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API resets configuration settings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task ResetSlotConfigurationSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateResetSlotConfigurationSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API resets configuration settings for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ResetSlotConfigurationSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateResetSlotConfigurationSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRestartSlotRequest(string resourceGroupName, string name, string slot, bool? softRestart, bool? synchronous) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/restart", false); - if (softRestart != null) - { - uri.AppendQuery("softRestart", softRestart.Value, true); - } - if (synchronous != null) - { - uri.AppendQuery("synchronous", synchronous.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Restarts an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - /// Specify true to apply the configuration settings and restarts the app only if necessary. By default, the API always restarts and reprovisions the app. - /// Specify true to block until the app is restarted. By default, it is set to false, and the API responds immediately (asynchronous). - /// The cancellation token to use. - /// , , or is null. - public async Task RestartSlotAsync(string resourceGroupName, string name, string slot, bool? softRestart = null, bool? synchronous = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateRestartSlotRequest(resourceGroupName, name, slot, softRestart, synchronous); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Restarts an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will restart the production slot. - /// Specify true to apply the configuration settings and restarts the app only if necessary. By default, the API always restarts and reprovisions the app. - /// Specify true to block until the app is restarted. By default, it is set to false, and the API responds immediately (asynchronous). - /// The cancellation token to use. - /// , , or is null. - public Response RestartSlot(string resourceGroupName, string name, string slot, bool? softRestart = null, bool? synchronous = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateRestartSlotRequest(resourceGroupName, name, slot, softRestart, synchronous); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRestoreFromBackupBlobSlotRequest(string resourceGroupName, string name, string slot, RestoreRequest request) - { - var message = _pipeline.CreateMessage(); - var request0 = message.Request; - request0.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/restoreFromBackupBlob", false); - uri.AppendQuery("api-version", apiVersion, true); - request0.Uri = uri; - request0.Headers.Add("Accept", "application/json"); - request0.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(request); - request0.Content = content; - return message; - } - - /// Description for Restores an app from a backup blob in Azure Storage. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will restore a backup of the production slot. - /// Information on restore request . - /// The cancellation token to use. - /// , , , or is null. - public async Task RestoreFromBackupBlobSlotAsync(string resourceGroupName, string name, string slot, RestoreRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateRestoreFromBackupBlobSlotRequest(resourceGroupName, name, slot, request); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Restores an app from a backup blob in Azure Storage. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will restore a backup of the production slot. - /// Information on restore request . - /// The cancellation token to use. - /// , , , or is null. - public Response RestoreFromBackupBlobSlot(string resourceGroupName, string name, string slot, RestoreRequest request, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - using var message = CreateRestoreFromBackupBlobSlotRequest(resourceGroupName, name, slot, request); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRestoreFromDeletedAppSlotRequest(string resourceGroupName, string name, string slot, DeletedAppRestoreRequest restoreRequest) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/restoreFromDeletedApp", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(restoreRequest); - request.Content = content; - return message; - } - - /// Description for Restores a deleted web app to this web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Deleted web app restore information. - /// The cancellation token to use. - /// , , , or is null. - public async Task RestoreFromDeletedAppSlotAsync(string resourceGroupName, string name, string slot, DeletedAppRestoreRequest restoreRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (restoreRequest == null) - { - throw new ArgumentNullException(nameof(restoreRequest)); - } - - using var message = CreateRestoreFromDeletedAppSlotRequest(resourceGroupName, name, slot, restoreRequest); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Restores a deleted web app to this web app. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Deleted web app restore information. - /// The cancellation token to use. - /// , , , or is null. - public Response RestoreFromDeletedAppSlot(string resourceGroupName, string name, string slot, DeletedAppRestoreRequest restoreRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (restoreRequest == null) - { - throw new ArgumentNullException(nameof(restoreRequest)); - } - - using var message = CreateRestoreFromDeletedAppSlotRequest(resourceGroupName, name, slot, restoreRequest); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRestoreSnapshotSlotRequest(string resourceGroupName, string name, string slot, SnapshotRestoreRequest restoreRequest) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/restoreSnapshot", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(restoreRequest); - request.Content = content; - return message; - } - - /// Description for Restores a web app from a snapshot. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. - /// The cancellation token to use. - /// , , , or is null. - public async Task RestoreSnapshotSlotAsync(string resourceGroupName, string name, string slot, SnapshotRestoreRequest restoreRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (restoreRequest == null) - { - throw new ArgumentNullException(nameof(restoreRequest)); - } - - using var message = CreateRestoreSnapshotSlotRequest(resourceGroupName, name, slot, restoreRequest); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Restores a web app from a snapshot. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. - /// The cancellation token to use. - /// , , , or is null. - public Response RestoreSnapshotSlot(string resourceGroupName, string name, string slot, SnapshotRestoreRequest restoreRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (restoreRequest == null) - { - throw new ArgumentNullException(nameof(restoreRequest)); - } - - using var message = CreateRestoreSnapshotSlotRequest(resourceGroupName, name, slot, restoreRequest); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteExtensionsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/siteextensions", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get list of siteextensions for a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSiteExtensionsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteExtensionsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteExtensionInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get list of siteextensions for a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListSiteExtensionsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteExtensionsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteExtensionInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteExtensionSlotRequest(string resourceGroupName, string name, string siteExtensionId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/siteextensions/", false); - uri.AppendPath(siteExtensionId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get site extension information by its ID for a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Site extension name. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetSiteExtensionSlotAsync(string resourceGroupName, string name, string siteExtensionId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteExtensionId == null) - { - throw new ArgumentNullException(nameof(siteExtensionId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteExtensionSlotRequest(resourceGroupName, name, siteExtensionId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteExtensionInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteExtensionInfo.DeserializeSiteExtensionInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SiteExtensionInfo)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get site extension information by its ID for a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Site extension name. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetSiteExtensionSlot(string resourceGroupName, string name, string siteExtensionId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteExtensionId == null) - { - throw new ArgumentNullException(nameof(siteExtensionId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteExtensionSlotRequest(resourceGroupName, name, siteExtensionId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteExtensionInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteExtensionInfo.DeserializeSiteExtensionInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SiteExtensionInfo)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateInstallSiteExtensionSlotRequest(string resourceGroupName, string name, string siteExtensionId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/siteextensions/", false); - uri.AppendPath(siteExtensionId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Install site extension on a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Site extension name. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task InstallSiteExtensionSlotAsync(string resourceGroupName, string name, string siteExtensionId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteExtensionId == null) - { - throw new ArgumentNullException(nameof(siteExtensionId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateInstallSiteExtensionSlotRequest(resourceGroupName, name, siteExtensionId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - case 429: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Install site extension on a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Site extension name. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response InstallSiteExtensionSlot(string resourceGroupName, string name, string siteExtensionId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteExtensionId == null) - { - throw new ArgumentNullException(nameof(siteExtensionId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateInstallSiteExtensionSlotRequest(resourceGroupName, name, siteExtensionId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - case 429: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteSiteExtensionSlotRequest(string resourceGroupName, string name, string siteExtensionId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/siteextensions/", false); - uri.AppendPath(siteExtensionId, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Remove a site extension from a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Site extension name. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteSiteExtensionSlotAsync(string resourceGroupName, string name, string siteExtensionId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteExtensionId == null) - { - throw new ArgumentNullException(nameof(siteExtensionId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteSiteExtensionSlotRequest(resourceGroupName, name, siteExtensionId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Remove a site extension from a web site, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Site extension name. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteSiteExtensionSlot(string resourceGroupName, string name, string siteExtensionId, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteExtensionId == null) - { - throw new ArgumentNullException(nameof(siteExtensionId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteSiteExtensionSlotRequest(resourceGroupName, name, siteExtensionId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSlotDifferencesSlotRequest(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/slotsdiffs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(slotSwapEntity); - request.Content = content; - return message; - } - - /// Description for Get the difference in configuration settings between two web app slots. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListSlotDifferencesSlotAsync(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateListSlotDifferencesSlotRequest(resourceGroupName, name, slot, slotSwapEntity); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SlotDifferenceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the difference in configuration settings between two web app slots. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response ListSlotDifferencesSlot(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateListSlotDifferencesSlotRequest(resourceGroupName, name, slot, slotSwapEntity); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SlotDifferenceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateSwapSlotRequest(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/slotsswap", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(slotSwapEntity); - request.Content = content; - return message; - } - - /// Description for Swaps two deployment slots of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task SwapSlotAsync(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateSwapSlotRequest(resourceGroupName, name, slot, slotSwapEntity); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Swaps two deployment slots of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response SwapSlot(string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateSwapSlotRequest(resourceGroupName, name, slot, slotSwapEntity); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSnapshotsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/snapshots", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns all Snapshots to the user. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// Website Slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSnapshotsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSnapshotsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns all Snapshots to the user. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// Website Slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListSnapshotsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSnapshotsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSnapshotsFromDRSecondarySlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/snapshotsdr", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns all Snapshots to the user from DRSecondary endpoint. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// Website Slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSnapshotsFromDRSecondarySlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSnapshotsFromDRSecondarySlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns all Snapshots to the user from DRSecondary endpoint. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// Website Slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListSnapshotsFromDRSecondarySlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSnapshotsFromDRSecondarySlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSourceControlSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/sourcecontrols/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the source control configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetSourceControlSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSourceControlSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - { - SiteSourceControl value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get the source control configuration for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response GetSourceControlSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSourceControlSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - { - SiteSourceControl value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateSourceControlSlotRequest(string resourceGroupName, string name, string slot, SiteSourceControl siteSourceControl) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/sourcecontrols/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteSourceControl); - request.Content = content; - return message; - } - - /// Description for Updates the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the source control configuration for the production slot. - /// JSON representation of a SiteSourceControl object. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task CreateOrUpdateSourceControlSlotAsync(string resourceGroupName, string name, string slot, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteSourceControl == null) - { - throw new ArgumentNullException(nameof(siteSourceControl)); - } - - using var message = CreateCreateOrUpdateSourceControlSlotRequest(resourceGroupName, name, slot, siteSourceControl); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the source control configuration for the production slot. - /// JSON representation of a SiteSourceControl object. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateSourceControlSlot(string resourceGroupName, string name, string slot, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteSourceControl == null) - { - throw new ArgumentNullException(nameof(siteSourceControl)); - } - - using var message = CreateCreateOrUpdateSourceControlSlotRequest(resourceGroupName, name, slot, siteSourceControl); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteSourceControlSlotRequest(string resourceGroupName, string name, string slot, string additionalFlags) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/sourcecontrols/web", false); - if (additionalFlags != null) - { - uri.AppendQuery("additionalFlags", additionalFlags, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the source control configuration for the production slot. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteSourceControlSlotAsync(string resourceGroupName, string name, string slot, string additionalFlags = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteSourceControlSlotRequest(resourceGroupName, name, slot, additionalFlags); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the source control configuration for the production slot. - /// The String to use. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteSourceControlSlot(string resourceGroupName, string name, string slot, string additionalFlags = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteSourceControlSlotRequest(resourceGroupName, name, slot, additionalFlags); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateSourceControlSlotRequest(string resourceGroupName, string name, string slot, SiteSourceControl siteSourceControl) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/sourcecontrols/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteSourceControl); - request.Content = content; - return message; - } - - /// Description for Updates the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the source control configuration for the production slot. - /// JSON representation of a SiteSourceControl object. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateSourceControlSlotAsync(string resourceGroupName, string name, string slot, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteSourceControl == null) - { - throw new ArgumentNullException(nameof(siteSourceControl)); - } - - using var message = CreateUpdateSourceControlSlotRequest(resourceGroupName, name, slot, siteSourceControl); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - { - SiteSourceControl value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will update the source control configuration for the production slot. - /// JSON representation of a SiteSourceControl object. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateSourceControlSlot(string resourceGroupName, string name, string slot, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (siteSourceControl == null) - { - throw new ArgumentNullException(nameof(siteSourceControl)); - } - - using var message = CreateUpdateSourceControlSlotRequest(resourceGroupName, name, slot, siteSourceControl); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - { - SiteSourceControl value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStartSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/start", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Starts an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will start the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task StartSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStartSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Starts an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will start the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response StartSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStartSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStartNetworkTraceSlotRequest(string resourceGroupName, string name, string slot, int? durationInSeconds, int? maxFrameLength, string sasUrl) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/startNetworkTrace", false); - if (durationInSeconds != null) - { - uri.AppendQuery("durationInSeconds", durationInSeconds.Value, true); - } - if (maxFrameLength != null) - { - uri.AppendQuery("maxFrameLength", maxFrameLength.Value, true); - } - if (sasUrl != null) - { - uri.AppendQuery("sasUrl", sasUrl, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Start capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for this web app. - /// The duration to keep capturing in seconds. - /// The maximum frame length in bytes (Optional). - /// The Blob URL to store capture file. - /// The cancellation token to use. - /// , , or is null. - public async Task StartNetworkTraceSlotAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStartNetworkTraceSlotRequest(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Start capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for this web app. - /// The duration to keep capturing in seconds. - /// The maximum frame length in bytes (Optional). - /// The Blob URL to store capture file. - /// The cancellation token to use. - /// , , or is null. - public Response StartNetworkTraceSlot(string resourceGroupName, string name, string slot, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStartNetworkTraceSlotRequest(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStopSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/stop", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Stops an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will stop the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task StopSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStopSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Stops an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will stop the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response StopSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStopSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStopNetworkTraceSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/stopNetworkTrace", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Stop ongoing capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for this web app. - /// The cancellation token to use. - /// , , or is null. - public async Task StopNetworkTraceSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStopNetworkTraceSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Stop ongoing capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for this web app. - /// The cancellation token to use. - /// , , or is null. - public Response StopNetworkTraceSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateStopNetworkTraceSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateSyncRepositorySlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/sync", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Sync web app repository. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task SyncRepositorySlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateSyncRepositorySlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Sync web app repository. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// The cancellation token to use. - /// , , or is null. - public Response SyncRepositorySlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateSyncRepositorySlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateSyncFunctionTriggersSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/syncfunctiontriggers", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Syncs function trigger metadata to the management database. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public async Task SyncFunctionTriggersSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateSyncFunctionTriggersSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Syncs function trigger metadata to the management database. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , or is null. - public Response SyncFunctionTriggersSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateSyncFunctionTriggersSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListTriggeredWebJobsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/triggeredwebjobs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List triggered web jobs for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListTriggeredWebJobsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListTriggeredWebJobsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TriggeredWebJobCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List triggered web jobs for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListTriggeredWebJobsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListTriggeredWebJobsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TriggeredWebJobCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetTriggeredWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/triggeredwebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a triggered web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetTriggeredWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetTriggeredWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TriggeredWebJob value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TriggeredWebJob.DeserializeTriggeredWebJob(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredWebJob)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a triggered web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetTriggeredWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetTriggeredWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TriggeredWebJob value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TriggeredWebJob.DeserializeTriggeredWebJob(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredWebJob)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteTriggeredWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/triggeredwebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a triggered web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API deletes web job for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteTriggeredWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteTriggeredWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a triggered web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API deletes web job for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteTriggeredWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteTriggeredWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListTriggeredWebJobHistorySlotRequest(string resourceGroupName, string name, string webJobName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/triggeredwebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendPath("/history", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List a triggered web job's history for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListTriggeredWebJobHistorySlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListTriggeredWebJobHistorySlotRequest(resourceGroupName, name, webJobName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TriggeredJobHistoryCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List a triggered web job's history for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListTriggeredWebJobHistorySlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListTriggeredWebJobHistorySlotRequest(resourceGroupName, name, webJobName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TriggeredJobHistoryCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetTriggeredWebJobHistorySlotRequest(string resourceGroupName, string name, string webJobName, string id, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/triggeredwebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendPath("/history/", false); - uri.AppendPath(id, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a triggered web job's history by its ID for an app, , or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// History ID. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> GetTriggeredWebJobHistorySlotAsync(string resourceGroupName, string name, string webJobName, string id, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetTriggeredWebJobHistorySlotRequest(resourceGroupName, name, webJobName, id, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TriggeredJobHistory value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TriggeredJobHistory.DeserializeTriggeredJobHistory(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredJobHistory)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a triggered web job's history by its ID for an app, , or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// History ID. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , , or is null. - public Response GetTriggeredWebJobHistorySlot(string resourceGroupName, string name, string webJobName, string id, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetTriggeredWebJobHistorySlotRequest(resourceGroupName, name, webJobName, id, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TriggeredJobHistory value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TriggeredJobHistory.DeserializeTriggeredJobHistory(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredJobHistory)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRunTriggeredWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/triggeredwebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendPath("/run", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Run a triggered web job for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task RunTriggeredWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateRunTriggeredWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Run a triggered web job for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response RunTriggeredWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateRunTriggeredWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListUsagesSlotRequest(string resourceGroupName, string name, string slot, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/usages", false); - uri.AppendQuery("api-version", apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the quota usage information of an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get quota information of the production slot. - /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListUsagesSlotAsync(string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListUsagesSlotRequest(resourceGroupName, name, slot, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the quota usage information of an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get quota information of the production slot. - /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , or is null. - public Response ListUsagesSlot(string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListUsagesSlotRequest(resourceGroupName, name, slot, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListVnetConnectionsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/virtualNetworkConnections", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the virtual networks the app (or deployment slot) is connected to. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get virtual network connections for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task>> ListVnetConnectionsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListVnetConnectionsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(VnetInfo.DeserializeVnetInfo(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the virtual networks the app (or deployment slot) is connected to. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get virtual network connections for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response> ListVnetConnectionsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListVnetConnectionsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(VnetInfo.DeserializeVnetInfo(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetVnetConnectionSlotRequest(string resourceGroupName, string name, string vnetName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a virtual network the app (or deployment slot) is connected to by name. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the virtual network. - /// Name of the deployment slot. If a slot is not specified, the API will get the named virtual network for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetVnetConnectionSlotAsync(string resourceGroupName, string name, string vnetName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a virtual network the app (or deployment slot) is connected to by name. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the virtual network. - /// Name of the deployment slot. If a slot is not specified, the API will get the named virtual network for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetVnetConnectionSlot(string resourceGroupName, string name, string vnetName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateVnetConnectionSlotRequest(string resourceGroupName, string name, string vnetName, string slot, VnetInfo connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of an existing Virtual Network. - /// Name of the deployment slot. If a slot is not specified, the API will add or update connections for the production slot. - /// Properties of the Virtual Network connection. See example. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> CreateOrUpdateVnetConnectionSlotAsync(string resourceGroupName, string name, string vnetName, string slot, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of an existing Virtual Network. - /// Name of the deployment slot. If a slot is not specified, the API will add or update connections for the production slot. - /// Properties of the Virtual Network connection. See example. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateOrUpdateVnetConnectionSlot(string resourceGroupName, string name, string vnetName, string slot, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteVnetConnectionSlotRequest(string resourceGroupName, string name, string vnetName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a connection from an app (or deployment slot to a named virtual network. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the virtual network. - /// Name of the deployment slot. If a slot is not specified, the API will delete the connection for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task DeleteVnetConnectionSlotAsync(string resourceGroupName, string name, string vnetName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a connection from an app (or deployment slot to a named virtual network. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the virtual network. - /// Name of the deployment slot. If a slot is not specified, the API will delete the connection for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response DeleteVnetConnectionSlot(string resourceGroupName, string name, string vnetName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateDeleteVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateVnetConnectionSlotRequest(string resourceGroupName, string name, string vnetName, string slot, VnetInfo connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of an existing Virtual Network. - /// Name of the deployment slot. If a slot is not specified, the API will add or update connections for the production slot. - /// Properties of the Virtual Network connection. See example. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> UpdateVnetConnectionSlotAsync(string resourceGroupName, string name, string vnetName, string slot, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of an existing Virtual Network. - /// Name of the deployment slot. If a slot is not specified, the API will add or update connections for the production slot. - /// Properties of the Virtual Network connection. See example. - /// The cancellation token to use. - /// , , , , or is null. - public Response UpdateVnetConnectionSlot(string resourceGroupName, string name, string vnetName, string slot, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateVnetConnectionSlotRequest(resourceGroupName, name, vnetName, slot, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetVnetConnectionGatewaySlotRequest(string resourceGroupName, string name, string vnetName, string gatewayName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets an app's Virtual Network gateway. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the Virtual Network. - /// Name of the gateway. Currently, the only supported string is "primary". - /// Name of the deployment slot. If a slot is not specified, the API will get a gateway for the production slot's Virtual Network. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> GetVnetConnectionGatewaySlotAsync(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetVnetConnectionGatewaySlotRequest(resourceGroupName, name, vnetName, gatewayName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((VnetGateway)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets an app's Virtual Network gateway. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the Virtual Network. - /// Name of the gateway. Currently, the only supported string is "primary". - /// Name of the deployment slot. If a slot is not specified, the API will get a gateway for the production slot's Virtual Network. - /// The cancellation token to use. - /// , , , , or is null. - public Response GetVnetConnectionGatewaySlot(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetVnetConnectionGatewaySlotRequest(resourceGroupName, name, vnetName, gatewayName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((VnetGateway)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateVnetConnectionGatewaySlotRequest(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, VnetGateway connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the Virtual Network. - /// Name of the gateway. Currently, the only supported string is "primary". - /// Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the production slot's Virtual Network. - /// The properties to update this gateway with. - /// The cancellation token to use. - /// , , , , , or is null. - public async Task> CreateOrUpdateVnetConnectionGatewaySlotAsync(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateVnetConnectionGatewaySlotRequest(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the Virtual Network. - /// Name of the gateway. Currently, the only supported string is "primary". - /// Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the production slot's Virtual Network. - /// The properties to update this gateway with. - /// The cancellation token to use. - /// , , , , , or is null. - public Response CreateOrUpdateVnetConnectionGatewaySlot(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateVnetConnectionGatewaySlotRequest(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateVnetConnectionGatewaySlotRequest(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, VnetGateway connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the Virtual Network. - /// Name of the gateway. Currently, the only supported string is "primary". - /// Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the production slot's Virtual Network. - /// The properties to update this gateway with. - /// The cancellation token to use. - /// , , , , , or is null. - public async Task> UpdateVnetConnectionGatewaySlotAsync(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateVnetConnectionGatewaySlotRequest(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the Virtual Network. - /// Name of the gateway. Currently, the only supported string is "primary". - /// Name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the production slot's Virtual Network. - /// The properties to update this gateway with. - /// The cancellation token to use. - /// , , , , , or is null. - public Response UpdateVnetConnectionGatewaySlot(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateVnetConnectionGatewaySlotRequest(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebJobsSlotRequest(string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/webjobs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List webjobs for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListWebJobsSlotAsync(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListWebJobsSlotRequest(resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebJobCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List webjobs for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , or is null. - public Response ListWebJobsSlot(string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListWebJobsSlotRequest(resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebJobCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetWebJobSlotRequest(string resourceGroupName, string name, string webJobName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/webjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get webjob information for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the web job. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetWebJobSlotAsync(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebJob value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebJob.DeserializeWebJob(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get webjob information for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the web job. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetWebJobSlot(string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetWebJobSlotRequest(resourceGroupName, name, webJobName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebJob value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebJob.DeserializeWebJob(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSlotDifferencesFromProductionRequest(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slotsdiffs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(slotSwapEntity); - request.Content = content; - return message; - } - - /// Description for Get the difference in configuration settings between two web app slots. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSlotDifferencesFromProductionAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateListSlotDifferencesFromProductionRequest(resourceGroupName, name, slotSwapEntity); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SlotDifferenceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the difference in configuration settings between two web app slots. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , or is null. - public Response ListSlotDifferencesFromProduction(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateListSlotDifferencesFromProductionRequest(resourceGroupName, name, slotSwapEntity); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SlotDifferenceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateSwapSlotWithProductionRequest(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slotsswap", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(slotSwapEntity); - request.Content = content; - return message; - } - - /// Description for Swaps two deployment slots of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task SwapSlotWithProductionAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateSwapSlotWithProductionRequest(resourceGroupName, name, slotSwapEntity); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Swaps two deployment slots of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , or is null. - public Response SwapSlotWithProduction(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateSwapSlotWithProductionRequest(resourceGroupName, name, slotSwapEntity); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSnapshotsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/snapshots", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns all Snapshots to the user. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// The cancellation token to use. - /// or is null. - public async Task> ListSnapshotsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSnapshotsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns all Snapshots to the user. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// The cancellation token to use. - /// or is null. - public Response ListSnapshots(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSnapshotsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSnapshotsFromDRSecondaryRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/snapshotsdr", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns all Snapshots to the user from DRSecondary endpoint. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// The cancellation token to use. - /// or is null. - public async Task> ListSnapshotsFromDRSecondaryAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSnapshotsFromDRSecondaryRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns all Snapshots to the user from DRSecondary endpoint. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// The cancellation token to use. - /// or is null. - public Response ListSnapshotsFromDRSecondary(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSnapshotsFromDRSecondaryRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSourceControlRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/sourcecontrols/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task> GetSourceControlAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetSourceControlRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - { - SiteSourceControl value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response GetSourceControl(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetSourceControlRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - { - SiteSourceControl value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateSourceControlRequest(string resourceGroupName, string name, SiteSourceControl siteSourceControl) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/sourcecontrols/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteSourceControl); - request.Content = content; - return message; - } - - /// Description for Updates the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON representation of a SiteSourceControl object. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task CreateOrUpdateSourceControlAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteSourceControl == null) - { - throw new ArgumentNullException(nameof(siteSourceControl)); - } - - using var message = CreateCreateOrUpdateSourceControlRequest(resourceGroupName, name, siteSourceControl); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON representation of a SiteSourceControl object. See example. - /// The cancellation token to use. - /// , , or is null. - public Response CreateOrUpdateSourceControl(string resourceGroupName, string name, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteSourceControl == null) - { - throw new ArgumentNullException(nameof(siteSourceControl)); - } - - using var message = CreateCreateOrUpdateSourceControlRequest(resourceGroupName, name, siteSourceControl); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteSourceControlRequest(string resourceGroupName, string name, string additionalFlags) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/sourcecontrols/web", false); - if (additionalFlags != null) - { - uri.AppendQuery("additionalFlags", additionalFlags, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// or is null. - public async Task DeleteSourceControlAsync(string resourceGroupName, string name, string additionalFlags = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteSourceControlRequest(resourceGroupName, name, additionalFlags); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// or is null. - public Response DeleteSourceControl(string resourceGroupName, string name, string additionalFlags = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateDeleteSourceControlRequest(resourceGroupName, name, additionalFlags); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateSourceControlRequest(string resourceGroupName, string name, SiteSourceControl siteSourceControl) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/sourcecontrols/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(siteSourceControl); - request.Content = content; - return message; - } - - /// Description for Updates the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON representation of a SiteSourceControl object. See example. - /// The cancellation token to use. - /// , , or is null. - public async Task> UpdateSourceControlAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteSourceControl == null) - { - throw new ArgumentNullException(nameof(siteSourceControl)); - } - - using var message = CreateUpdateSourceControlRequest(resourceGroupName, name, siteSourceControl); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - { - SiteSourceControl value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates the source control configuration of an app. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON representation of a SiteSourceControl object. See example. - /// The cancellation token to use. - /// , , or is null. - public Response UpdateSourceControl(string resourceGroupName, string name, SiteSourceControl siteSourceControl, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (siteSourceControl == null) - { - throw new ArgumentNullException(nameof(siteSourceControl)); - } - - using var message = CreateUpdateSourceControlRequest(resourceGroupName, name, siteSourceControl); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - case 202: - { - SiteSourceControl value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteSourceControl.DeserializeSiteSourceControl(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStartRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/start", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Starts an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task StartAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStartRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Starts an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response Start(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStartRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStartNetworkTraceRequest(string resourceGroupName, string name, int? durationInSeconds, int? maxFrameLength, string sasUrl) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/startNetworkTrace", false); - if (durationInSeconds != null) - { - uri.AppendQuery("durationInSeconds", durationInSeconds.Value, true); - } - if (maxFrameLength != null) - { - uri.AppendQuery("maxFrameLength", maxFrameLength.Value, true); - } - if (sasUrl != null) - { - uri.AppendQuery("sasUrl", sasUrl, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Start capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The duration to keep capturing in seconds. - /// The maximum frame length in bytes (Optional). - /// The Blob URL to store capture file. - /// The cancellation token to use. - /// or is null. - public async Task StartNetworkTraceAsync(string resourceGroupName, string name, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStartNetworkTraceRequest(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Start capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The duration to keep capturing in seconds. - /// The maximum frame length in bytes (Optional). - /// The Blob URL to store capture file. - /// The cancellation token to use. - /// or is null. - public Response StartNetworkTrace(string resourceGroupName, string name, int? durationInSeconds = null, int? maxFrameLength = null, string sasUrl = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStartNetworkTraceRequest(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStopRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/stop", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Stops an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task StopAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStopRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Stops an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response Stop(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStopRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateStopNetworkTraceRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/stopNetworkTrace", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Stop ongoing capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The cancellation token to use. - /// or is null. - public async Task StopNetworkTraceAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStopNetworkTraceRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Stop ongoing capturing network packets for the site. - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The cancellation token to use. - /// or is null. - public Response StopNetworkTrace(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateStopNetworkTraceRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateSyncRepositoryRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/sync", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Sync web app repository. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public async Task SyncRepositoryAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateSyncRepositoryRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Sync web app repository. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// The cancellation token to use. - /// or is null. - public Response SyncRepository(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateSyncRepositoryRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateSyncFunctionTriggersRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/syncfunctiontriggers", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Syncs function trigger metadata to the management database. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task SyncFunctionTriggersAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateSyncFunctionTriggersRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Syncs function trigger metadata to the management database. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response SyncFunctionTriggers(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateSyncFunctionTriggersRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListTriggeredWebJobsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/triggeredwebjobs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List triggered web jobs for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public async Task> ListTriggeredWebJobsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListTriggeredWebJobsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TriggeredWebJobCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List triggered web jobs for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public Response ListTriggeredWebJobs(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListTriggeredWebJobsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TriggeredWebJobCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetTriggeredWebJobRequest(string resourceGroupName, string name, string webJobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/triggeredwebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a triggered web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetTriggeredWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateGetTriggeredWebJobRequest(resourceGroupName, name, webJobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TriggeredWebJob value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TriggeredWebJob.DeserializeTriggeredWebJob(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredWebJob)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a triggered web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public Response GetTriggeredWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateGetTriggeredWebJobRequest(resourceGroupName, name, webJobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TriggeredWebJob value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TriggeredWebJob.DeserializeTriggeredWebJob(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredWebJob)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteTriggeredWebJobRequest(string resourceGroupName, string name, string webJobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/triggeredwebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Delete a triggered web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteTriggeredWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateDeleteTriggeredWebJobRequest(resourceGroupName, name, webJobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Delete a triggered web job by its ID for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteTriggeredWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateDeleteTriggeredWebJobRequest(resourceGroupName, name, webJobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListTriggeredWebJobHistoryRequest(string resourceGroupName, string name, string webJobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/triggeredwebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendPath("/history", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List a triggered web job's history for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListTriggeredWebJobHistoryAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateListTriggeredWebJobHistoryRequest(resourceGroupName, name, webJobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TriggeredJobHistoryCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List a triggered web job's history for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public Response ListTriggeredWebJobHistory(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateListTriggeredWebJobHistoryRequest(resourceGroupName, name, webJobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TriggeredJobHistoryCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetTriggeredWebJobHistoryRequest(string resourceGroupName, string name, string webJobName, string id) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/triggeredwebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendPath("/history/", false); - uri.AppendPath(id, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a triggered web job's history by its ID for an app, , or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// History ID. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetTriggeredWebJobHistoryAsync(string resourceGroupName, string name, string webJobName, string id, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - - using var message = CreateGetTriggeredWebJobHistoryRequest(resourceGroupName, name, webJobName, id); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TriggeredJobHistory value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TriggeredJobHistory.DeserializeTriggeredJobHistory(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredJobHistory)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a triggered web job's history by its ID for an app, , or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// History ID. - /// The cancellation token to use. - /// , , , or is null. - public Response GetTriggeredWebJobHistory(string resourceGroupName, string name, string webJobName, string id, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - - using var message = CreateGetTriggeredWebJobHistoryRequest(resourceGroupName, name, webJobName, id); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TriggeredJobHistory value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TriggeredJobHistory.DeserializeTriggeredJobHistory(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredJobHistory)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRunTriggeredWebJobRequest(string resourceGroupName, string name, string webJobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/triggeredwebjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendPath("/run", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Run a triggered web job for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public async Task RunTriggeredWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateRunTriggeredWebJobRequest(resourceGroupName, name, webJobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Run a triggered web job for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , or is null. - public Response RunTriggeredWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateRunTriggeredWebJobRequest(resourceGroupName, name, webJobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string name, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/usages", false); - uri.AppendQuery("api-version", apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, false); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the quota usage information of an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// or is null. - public async Task> ListUsagesAsync(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListUsagesRequest(resourceGroupName, name, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the quota usage information of an app (or deployment slot, if specified). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// or is null. - public Response ListUsages(string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListUsagesRequest(resourceGroupName, name, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListVnetConnectionsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the virtual networks the app (or deployment slot) is connected to. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public async Task>> ListVnetConnectionsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListVnetConnectionsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(VnetInfo.DeserializeVnetInfo(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the virtual networks the app (or deployment slot) is connected to. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// or is null. - public Response> ListVnetConnections(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListVnetConnectionsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IReadOnlyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - List array = new List(); - foreach (var item in document.RootElement.EnumerateArray()) - { - array.Add(VnetInfo.DeserializeVnetInfo(item)); - } - value = array; - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetVnetConnectionRequest(string resourceGroupName, string name, string vnetName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a virtual network the app (or deployment slot) is connected to by name. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the virtual network. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetVnetConnectionAsync(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - - using var message = CreateGetVnetConnectionRequest(resourceGroupName, name, vnetName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a virtual network the app (or deployment slot) is connected to by name. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the virtual network. - /// The cancellation token to use. - /// , , or is null. - public Response GetVnetConnection(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - - using var message = CreateGetVnetConnectionRequest(resourceGroupName, name, vnetName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateVnetConnectionRequest(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of an existing Virtual Network. - /// Properties of the Virtual Network connection. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task> CreateOrUpdateVnetConnectionAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateVnetConnectionRequest(resourceGroupName, name, vnetName, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of an existing Virtual Network. - /// Properties of the Virtual Network connection. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response CreateOrUpdateVnetConnection(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateVnetConnectionRequest(resourceGroupName, name, vnetName, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteVnetConnectionRequest(string resourceGroupName, string name, string vnetName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Deletes a connection from an app (or deployment slot to a named virtual network. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the virtual network. - /// The cancellation token to use. - /// , , or is null. - public async Task DeleteVnetConnectionAsync(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - - using var message = CreateDeleteVnetConnectionRequest(resourceGroupName, name, vnetName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Deletes a connection from an app (or deployment slot to a named virtual network. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the virtual network. - /// The cancellation token to use. - /// , , or is null. - public Response DeleteVnetConnection(string resourceGroupName, string name, string vnetName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - - using var message = CreateDeleteVnetConnectionRequest(resourceGroupName, name, vnetName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 404: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateVnetConnectionRequest(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of an existing Virtual Network. - /// Properties of the Virtual Network connection. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task> UpdateVnetConnectionAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateVnetConnectionRequest(resourceGroupName, name, vnetName, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of an existing Virtual Network. - /// Properties of the Virtual Network connection. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response UpdateVnetConnection(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateVnetConnectionRequest(resourceGroupName, name, vnetName, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetInfo.DeserializeVnetInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetVnetConnectionGatewayRequest(string resourceGroupName, string name, string vnetName, string gatewayName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets an app's Virtual Network gateway. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the Virtual Network. - /// Name of the gateway. Currently, the only supported string is "primary". - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetVnetConnectionGatewayAsync(string resourceGroupName, string name, string vnetName, string gatewayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - - using var message = CreateGetVnetConnectionGatewayRequest(resourceGroupName, name, vnetName, gatewayName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((VnetGateway)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets an app's Virtual Network gateway. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the Virtual Network. - /// Name of the gateway. Currently, the only supported string is "primary". - /// The cancellation token to use. - /// , , , or is null. - public Response GetVnetConnectionGateway(string resourceGroupName, string name, string vnetName, string gatewayName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - - using var message = CreateGetVnetConnectionGatewayRequest(resourceGroupName, name, vnetName, gatewayName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((VnetGateway)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateVnetConnectionGatewayRequest(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the Virtual Network. - /// Name of the gateway. Currently, the only supported string is "primary". - /// The properties to update this gateway with. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> CreateOrUpdateVnetConnectionGatewayAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateVnetConnectionGatewayRequest(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the Virtual Network. - /// Name of the gateway. Currently, the only supported string is "primary". - /// The properties to update this gateway with. - /// The cancellation token to use. - /// , , , , or is null. - public Response CreateOrUpdateVnetConnectionGateway(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateCreateOrUpdateVnetConnectionGatewayRequest(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateVnetConnectionGatewayRequest(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/virtualNetworkConnections/", false); - uri.AppendPath(vnetName, true); - uri.AppendPath("/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(connectionEnvelope); - request.Content = content; - return message; - } - - /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the Virtual Network. - /// Name of the gateway. Currently, the only supported string is "primary". - /// The properties to update this gateway with. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> UpdateVnetConnectionGatewayAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateVnetConnectionGatewayRequest(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the Virtual Network. - /// Name of the gateway. Currently, the only supported string is "primary". - /// The properties to update this gateway with. - /// The cancellation token to use. - /// , , , , or is null. - public Response UpdateVnetConnectionGateway(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (vnetName == null) - { - throw new ArgumentNullException(nameof(vnetName)); - } - if (gatewayName == null) - { - throw new ArgumentNullException(nameof(gatewayName)); - } - if (connectionEnvelope == null) - { - throw new ArgumentNullException(nameof(connectionEnvelope)); - } - - using var message = CreateUpdateVnetConnectionGatewayRequest(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetGateway value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetGateway.DeserializeVnetGateway(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebJobsRequest(string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/webjobs", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List webjobs for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public async Task> ListWebJobsAsync(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWebJobsRequest(resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebJobCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List webjobs for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// or is null. - public Response ListWebJobs(string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWebJobsRequest(resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebJobCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetWebJobRequest(string resourceGroupName, string name, string webJobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/webjobs/", false); - uri.AppendPath(webJobName, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get webjob information for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the web job. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetWebJobAsync(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateGetWebJobRequest(resourceGroupName, name, webJobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebJob value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebJob.DeserializeWebJob(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get webjob information for an app, or a deployment slot. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the web job. - /// The cancellation token to use. - /// , , or is null. - public Response GetWebJob(string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateGetWebJobRequest(resourceGroupName, name, webJobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebJob value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebJob.DeserializeWebJob(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get all apps for a subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get all apps for a subscription. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName, bool? includeSlots) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all web, mobile, and API apps in the specified resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Specify <strong>true</strong> to include deployment slots in results. The default is false, which only gives you the production slot of all apps. - /// The cancellation token to use. - /// or is null. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string resourceGroupName, bool? includeSlots = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName, includeSlots); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all web, mobile, and API apps in the specified resource group. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Specify <strong>true</strong> to include deployment slots in results. The default is false, which only gives you the production slot of all apps. - /// The cancellation token to use. - /// or is null. - public Response ListByResourceGroupNextPage(string nextLink, string resourceGroupName, bool? includeSlots = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName, includeSlots); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBackupsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets existing backups of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListBackupsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListBackupsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets existing backups of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public Response ListBackupsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListBackupsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConfigurationsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the configurations of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListConfigurationsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListConfigurationsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResourceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the configurations of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public Response ListConfigurationsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListConfigurationsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResourceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAppSettingsKeyVaultReferencesNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the config reference app settings and status of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetAppSettingsKeyVaultReferencesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetAppSettingsKeyVaultReferencesNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the config reference app settings and status of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public Response GetAppSettingsKeyVaultReferencesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetAppSettingsKeyVaultReferencesNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteConnectionStringKeyVaultReferencesNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the config reference app settings and status of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetSiteConnectionStringKeyVaultReferencesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetSiteConnectionStringKeyVaultReferencesNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the config reference app settings and status of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public Response GetSiteConnectionStringKeyVaultReferencesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetSiteConnectionStringKeyVaultReferencesNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConfigurationSnapshotInfoNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListConfigurationSnapshotInfoNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListConfigurationSnapshotInfoNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigurationSnapshotInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public Response ListConfigurationSnapshotInfoNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListConfigurationSnapshotInfoNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigurationSnapshotInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListContinuousWebJobsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List continuous web jobs for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListContinuousWebJobsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListContinuousWebJobsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContinuousWebJobCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List continuous web jobs for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// , , or is null. - public Response ListContinuousWebJobsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListContinuousWebJobsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContinuousWebJobCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListDeploymentsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List deployments for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListDeploymentsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListDeploymentsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeploymentCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List deployments for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public Response ListDeploymentsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListDeploymentsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeploymentCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListDomainOwnershipIdentifiersNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Lists ownership identifiers for domain associated with web app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListDomainOwnershipIdentifiersNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListDomainOwnershipIdentifiersNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IdentifierCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Lists ownership identifiers for domain associated with web app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public Response ListDomainOwnershipIdentifiersNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListDomainOwnershipIdentifiersNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IdentifierCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListFunctionsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the functions for a web site, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListFunctionsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListFunctionsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionEnvelopeCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the functions for a web site, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// , , or is null. - public Response ListFunctionsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListFunctionsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionEnvelopeCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHostNameBindingsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get hostname bindings for an app or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListHostNameBindingsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHostNameBindingsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HostNameBindingCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get hostname bindings for an app or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public Response ListHostNameBindingsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListHostNameBindingsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HostNameBindingCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceIdentifiersNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all scale-out instances of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListInstanceIdentifiersNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListInstanceIdentifiersNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppInstanceStatusCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all scale-out instances of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public Response ListInstanceIdentifiersNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListInstanceIdentifiersNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppInstanceStatusCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceProcessesNextPageRequest(string nextLink, string resourceGroupName, string name, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListInstanceProcessesNextPageAsync(string nextLink, string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessesNextPageRequest(nextLink, resourceGroupName, name, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , or is null. - public Response ListInstanceProcessesNextPage(string nextLink, string resourceGroupName, string name, string instanceId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessesNextPageRequest(nextLink, resourceGroupName, name, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceProcessModulesNextPageRequest(string nextLink, string resourceGroupName, string name, string processId, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListInstanceProcessModulesNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessModulesNextPageRequest(nextLink, resourceGroupName, name, processId, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public Response ListInstanceProcessModulesNextPage(string nextLink, string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessModulesNextPageRequest(nextLink, resourceGroupName, name, processId, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceProcessThreadsNextPageRequest(string nextLink, string resourceGroupName, string name, string processId, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListInstanceProcessThreadsNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessThreadsNextPageRequest(nextLink, resourceGroupName, name, processId, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public Response ListInstanceProcessThreadsNextPage(string nextLink, string resourceGroupName, string name, string processId, string instanceId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessThreadsNextPageRequest(nextLink, resourceGroupName, name, processId, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteBackupsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets existing backups of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSiteBackupsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSiteBackupsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets existing backups of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public Response ListSiteBackupsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSiteBackupsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPerfMonCountersNextPageRequest(string nextLink, string resourceGroupName, string name, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets perfmon counters for web app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListPerfMonCountersNextPageAsync(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListPerfMonCountersNextPageRequest(nextLink, resourceGroupName, name, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PerfMonCounterCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets perfmon counters for web app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , or is null. - public Response ListPerfMonCountersNextPage(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListPerfMonCountersNextPageRequest(nextLink, resourceGroupName, name, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PerfMonCounterCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateEndpointConnectionListNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the list of private endpoint connections associated with a site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The cancellation token to use. - /// , , or is null. - public async Task> GetPrivateEndpointConnectionListNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateEndpointConnectionListNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the list of private endpoint connections associated with a site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// The cancellation token to use. - /// , , or is null. - public Response GetPrivateEndpointConnectionListNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateGetPrivateEndpointConnectionListNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProcessesNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListProcessesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListProcessesNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// , , or is null. - public Response ListProcessesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListProcessesNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProcessModulesNextPageRequest(string nextLink, string resourceGroupName, string name, string processId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListProcessModulesNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateListProcessModulesNextPageRequest(nextLink, resourceGroupName, name, processId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , , or is null. - public Response ListProcessModulesNextPage(string nextLink, string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateListProcessModulesNextPageRequest(nextLink, resourceGroupName, name, processId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProcessThreadsNextPageRequest(string nextLink, string resourceGroupName, string name, string processId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListProcessThreadsNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateListProcessThreadsNextPageRequest(nextLink, resourceGroupName, name, processId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// The cancellation token to use. - /// , , , or is null. - public Response ListProcessThreadsNextPage(string nextLink, string resourceGroupName, string name, string processId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - - using var message = CreateListProcessThreadsNextPageRequest(nextLink, resourceGroupName, name, processId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPublicCertificatesNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get public certificates for an app or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListPublicCertificatesNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListPublicCertificatesNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PublicCertificateCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get public certificates for an app or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public Response ListPublicCertificatesNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListPublicCertificatesNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PublicCertificateCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteExtensionsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get list of siteextensions for a web site, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSiteExtensionsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSiteExtensionsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteExtensionInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get list of siteextensions for a web site, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// , , or is null. - public Response ListSiteExtensionsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSiteExtensionsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteExtensionInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSlotsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets an app's deployment slots. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSlotsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSlotsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets an app's deployment slots. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The cancellation token to use. - /// , , or is null. - public Response ListSlotsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSlotsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppCollection.DeserializeWebAppCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBackupsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets existing backups of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListBackupsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListBackupsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets existing backups of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListBackupsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListBackupsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConfigurationsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the configurations of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListConfigurationsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListConfigurationsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResourceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the configurations of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListConfigurationsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListConfigurationsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigResourceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigResourceCollection.DeserializeSiteConfigResourceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAppSettingsKeyVaultReferencesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the config reference app settings and status of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetAppSettingsKeyVaultReferencesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetAppSettingsKeyVaultReferencesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the config reference app settings and status of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , , or is null. - public Response GetAppSettingsKeyVaultReferencesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetAppSettingsKeyVaultReferencesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSiteConnectionStringKeyVaultReferencesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the config reference app settings and status of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetSiteConnectionStringKeyVaultReferencesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteConnectionStringKeyVaultReferencesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the config reference app settings and status of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// The String to use. - /// The cancellation token to use. - /// , , , or is null. - public Response GetSiteConnectionStringKeyVaultReferencesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetSiteConnectionStringKeyVaultReferencesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApiKVReferenceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApiKVReferenceCollection.DeserializeApiKVReferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConfigurationSnapshotInfoSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListConfigurationSnapshotInfoSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListConfigurationSnapshotInfoSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteConfigurationSnapshotInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListConfigurationSnapshotInfoSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListConfigurationSnapshotInfoSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteConfigurationSnapshotInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteConfigurationSnapshotInfoCollection.DeserializeSiteConfigurationSnapshotInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListContinuousWebJobsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List continuous web jobs for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListContinuousWebJobsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListContinuousWebJobsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContinuousWebJobCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List continuous web jobs for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListContinuousWebJobsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListContinuousWebJobsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContinuousWebJobCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContinuousWebJobCollection.DeserializeContinuousWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListDeploymentsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List deployments for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListDeploymentsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListDeploymentsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeploymentCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List deployments for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListDeploymentsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListDeploymentsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeploymentCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeploymentCollection.DeserializeDeploymentCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListDomainOwnershipIdentifiersSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Lists ownership identifiers for domain associated with web app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListDomainOwnershipIdentifiersSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListDomainOwnershipIdentifiersSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IdentifierCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Lists ownership identifiers for domain associated with web app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListDomainOwnershipIdentifiersSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListDomainOwnershipIdentifiersSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IdentifierCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceFunctionsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the functions for a web site, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListInstanceFunctionsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListInstanceFunctionsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - FunctionEnvelopeCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the functions for a web site, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListInstanceFunctionsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListInstanceFunctionsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - FunctionEnvelopeCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = FunctionEnvelopeCollection.DeserializeFunctionEnvelopeCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((FunctionEnvelopeCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListHostNameBindingsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get hostname bindings for an app or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListHostNameBindingsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListHostNameBindingsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HostNameBindingCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get hostname bindings for an app or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListHostNameBindingsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListHostNameBindingsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HostNameBindingCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HostNameBindingCollection.DeserializeHostNameBindingCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceIdentifiersSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets all scale-out instances of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListInstanceIdentifiersSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListInstanceIdentifiersSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebAppInstanceStatusCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets all scale-out instances of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API gets the production slot instances. - /// The cancellation token to use. - /// , , , or is null. - public Response ListInstanceIdentifiersSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListInstanceIdentifiersSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebAppInstanceStatusCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebAppInstanceStatusCollection.DeserializeWebAppInstanceStatusCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceProcessesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListInstanceProcessesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessesSlotNextPageRequest(nextLink, resourceGroupName, name, slot, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , or is null. - public Response ListInstanceProcessesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessesSlotNextPageRequest(nextLink, resourceGroupName, name, slot, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceProcessModulesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string processId, string slot, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , , or is null. - public async Task> ListInstanceProcessModulesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessModulesSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , , or is null. - public Response ListInstanceProcessModulesSlotNextPage(string nextLink, string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessModulesSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListInstanceProcessThreadsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string processId, string slot, string instanceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , , or is null. - public async Task> ListInstanceProcessThreadsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessThreadsSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot, instanceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET api/sites/{siteName}/instances". - /// The cancellation token to use. - /// , , , , , or is null. - public Response ListInstanceProcessThreadsSlotNextPage(string nextLink, string resourceGroupName, string name, string processId, string slot, string instanceId, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (instanceId == null) - { - throw new ArgumentNullException(nameof(instanceId)); - } - - using var message = CreateListInstanceProcessThreadsSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot, instanceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteBackupsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets existing backups of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListSiteBackupsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteBackupsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets existing backups of an app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListSiteBackupsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteBackupsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BackupItemCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupItemCollection.DeserializeBackupItemCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPerfMonCountersSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets perfmon counters for web app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListPerfMonCountersSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListPerfMonCountersSlotNextPageRequest(nextLink, resourceGroupName, name, slot, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PerfMonCounterCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets perfmon counters for web app. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of web app. - /// Name of web app slot. If not specified then will default to production slot. - /// Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , , or is null. - public Response ListPerfMonCountersSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListPerfMonCountersSlotNextPageRequest(nextLink, resourceGroupName, name, slot, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PerfMonCounterCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PerfMonCounterCollection.DeserializePerfMonCounterCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPrivateEndpointConnectionListSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the list of private endpoint connections associated with a site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// Name of the site deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> GetPrivateEndpointConnectionListSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetPrivateEndpointConnectionListSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the list of private endpoint connections associated with a site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the site. - /// Name of the site deployment slot. - /// The cancellation token to use. - /// , , , or is null. - public Response GetPrivateEndpointConnectionListSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateGetPrivateEndpointConnectionListSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PrivateEndpointConnectionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProcessesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListProcessesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListProcessesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListProcessesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListProcessesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessInfoCollection.DeserializeProcessInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProcessModulesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string processId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListProcessModulesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListProcessModulesSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List module information for a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , , or is null. - public Response ListProcessModulesSlotNextPage(string nextLink, string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListProcessModulesSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessModuleInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessModuleInfoCollection.DeserializeProcessModuleInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessModuleInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProcessThreadsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string processId, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListProcessThreadsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListProcessThreadsSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// PID. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , , or is null. - public Response ListProcessThreadsSlotNextPage(string nextLink, string resourceGroupName, string name, string processId, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (processId == null) - { - throw new ArgumentNullException(nameof(processId)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListProcessThreadsSlotNextPageRequest(nextLink, resourceGroupName, name, processId, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProcessThreadInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProcessThreadInfoCollection.DeserializeProcessThreadInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ProcessThreadInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPublicCertificatesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get public certificates for an app or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListPublicCertificatesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListPublicCertificatesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PublicCertificateCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get public certificates for an app or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListPublicCertificatesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListPublicCertificatesSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PublicCertificateCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PublicCertificateCollection.DeserializePublicCertificateCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteExtensionsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get list of siteextensions for a web site, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListSiteExtensionsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteExtensionsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SiteExtensionInfoCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get list of siteextensions for a web site, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListSiteExtensionsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSiteExtensionsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SiteExtensionInfoCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SiteExtensionInfoCollection.DeserializeSiteExtensionInfoCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SiteExtensionInfoCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSlotDifferencesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the difference in configuration settings between two web app slots. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListSlotDifferencesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateListSlotDifferencesSlotNextPageRequest(nextLink, resourceGroupName, name, slot, slotSwapEntity); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SlotDifferenceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the difference in configuration settings between two web app slots. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , , , or is null. - public Response ListSlotDifferencesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateListSlotDifferencesSlotNextPageRequest(nextLink, resourceGroupName, name, slot, slotSwapEntity); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SlotDifferenceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSnapshotsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns all Snapshots to the user. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// Website Slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListSnapshotsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSnapshotsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns all Snapshots to the user. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// Website Slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListSnapshotsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSnapshotsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSnapshotsFromDRSecondarySlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns all Snapshots to the user from DRSecondary endpoint. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// Website Slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListSnapshotsFromDRSecondarySlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSnapshotsFromDRSecondarySlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns all Snapshots to the user from DRSecondary endpoint. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// Website Slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListSnapshotsFromDRSecondarySlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListSnapshotsFromDRSecondarySlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListTriggeredWebJobsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List triggered web jobs for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListTriggeredWebJobsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListTriggeredWebJobsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TriggeredWebJobCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List triggered web jobs for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListTriggeredWebJobsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListTriggeredWebJobsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TriggeredWebJobCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListTriggeredWebJobHistorySlotNextPageRequest(string nextLink, string resourceGroupName, string name, string webJobName, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List a triggered web job's history for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , , or is null. - public async Task> ListTriggeredWebJobHistorySlotNextPageAsync(string nextLink, string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListTriggeredWebJobHistorySlotNextPageRequest(nextLink, resourceGroupName, name, webJobName, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TriggeredJobHistoryCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List a triggered web job's history for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// Name of the deployment slot. If a slot is not specified, the API uses the production slot. - /// The cancellation token to use. - /// , , , , or is null. - public Response ListTriggeredWebJobHistorySlotNextPage(string nextLink, string resourceGroupName, string name, string webJobName, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListTriggeredWebJobHistorySlotNextPageRequest(nextLink, resourceGroupName, name, webJobName, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TriggeredJobHistoryCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListUsagesSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the quota usage information of an app (or deployment slot, if specified). - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get quota information of the production slot. - /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListUsagesSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListUsagesSlotNextPageRequest(nextLink, resourceGroupName, name, slot, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the quota usage information of an app (or deployment slot, if specified). - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Name of the deployment slot. If a slot is not specified, the API will get quota information of the production slot. - /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , , or is null. - public Response ListUsagesSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListUsagesSlotNextPageRequest(nextLink, resourceGroupName, name, slot, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebJobsSlotNextPageRequest(string nextLink, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List webjobs for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListWebJobsSlotNextPageAsync(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListWebJobsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebJobCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List webjobs for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. - /// The cancellation token to use. - /// , , , or is null. - public Response ListWebJobsSlotNextPage(string nextLink, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slot == null) - { - throw new ArgumentNullException(nameof(slot)); - } - - using var message = CreateListWebJobsSlotNextPageRequest(nextLink, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebJobCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSlotDifferencesFromProductionNextPageRequest(string nextLink, string resourceGroupName, string name, CsmSlotEntity slotSwapEntity) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get the difference in configuration settings between two web app slots. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListSlotDifferencesFromProductionNextPageAsync(string nextLink, string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateListSlotDifferencesFromProductionNextPageRequest(nextLink, resourceGroupName, name, slotSwapEntity); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SlotDifferenceCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get the difference in configuration settings between two web app slots. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// JSON object that contains the target slot name. See example. - /// The cancellation token to use. - /// , , , or is null. - public Response ListSlotDifferencesFromProductionNextPage(string nextLink, string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (slotSwapEntity == null) - { - throw new ArgumentNullException(nameof(slotSwapEntity)); - } - - using var message = CreateListSlotDifferencesFromProductionNextPageRequest(nextLink, resourceGroupName, name, slotSwapEntity); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SlotDifferenceCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SlotDifferenceCollection.DeserializeSlotDifferenceCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSnapshotsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns all Snapshots to the user. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSnapshotsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSnapshotsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns all Snapshots to the user. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// The cancellation token to use. - /// , , or is null. - public Response ListSnapshotsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSnapshotsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSnapshotsFromDRSecondaryNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Returns all Snapshots to the user from DRSecondary endpoint. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListSnapshotsFromDRSecondaryNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSnapshotsFromDRSecondaryNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Returns all Snapshots to the user from DRSecondary endpoint. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Website Name. - /// The cancellation token to use. - /// , , or is null. - public Response ListSnapshotsFromDRSecondaryNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListSnapshotsFromDRSecondaryNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SnapshotCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SnapshotCollection.DeserializeSnapshotCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListTriggeredWebJobsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List triggered web jobs for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListTriggeredWebJobsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListTriggeredWebJobsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TriggeredWebJobCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List triggered web jobs for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// , , or is null. - public Response ListTriggeredWebJobsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListTriggeredWebJobsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TriggeredWebJobCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TriggeredWebJobCollection.DeserializeTriggeredWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListTriggeredWebJobHistoryNextPageRequest(string nextLink, string resourceGroupName, string name, string webJobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List a triggered web job's history for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , , or is null. - public async Task> ListTriggeredWebJobHistoryNextPageAsync(string nextLink, string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateListTriggeredWebJobHistoryNextPageRequest(nextLink, resourceGroupName, name, webJobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TriggeredJobHistoryCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List a triggered web job's history for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// Name of Web Job. - /// The cancellation token to use. - /// , , , or is null. - public Response ListTriggeredWebJobHistoryNextPage(string nextLink, string resourceGroupName, string name, string webJobName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - if (webJobName == null) - { - throw new ArgumentNullException(nameof(webJobName)); - } - - using var message = CreateListTriggeredWebJobHistoryNextPageRequest(nextLink, resourceGroupName, name, webJobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TriggeredJobHistoryCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TriggeredJobHistoryCollection.DeserializeTriggeredJobHistoryCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((TriggeredJobHistoryCollection)null, message.Response); - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListUsagesNextPageRequest(string nextLink, string resourceGroupName, string name, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the quota usage information of an app (or deployment slot, if specified). - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListUsagesNextPageAsync(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListUsagesNextPageRequest(nextLink, resourceGroupName, name, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the quota usage information of an app (or deployment slot, if specified). - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Name of the app. - /// Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. - /// The cancellation token to use. - /// , , or is null. - public Response ListUsagesNextPage(string nextLink, string resourceGroupName, string name, string filter = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListUsagesNextPageRequest(nextLink, resourceGroupName, name, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CsmUsageQuotaCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CsmUsageQuotaCollection.DeserializeCsmUsageQuotaCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListWebJobsNextPageRequest(string nextLink, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List webjobs for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListWebJobsNextPageAsync(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWebJobsNextPageRequest(nextLink, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WebJobCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List webjobs for an app, or a deployment slot. - /// The URL to the next page of results. - /// Name of the resource group to which the resource belongs. - /// Site name. - /// The cancellation token to use. - /// , , or is null. - public Response ListWebJobsNextPage(string nextLink, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateListWebJobsNextPageRequest(nextLink, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WebJobCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WebJobCollection.DeserializeWebJobCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementRestClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementRestClient.cs deleted file mode 100644 index 43bfc547188a..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementRestClient.cs +++ /dev/null @@ -1,1609 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Microsoft.Azure.Management.WebSites.Models; - -namespace Microsoft.Azure.Management.WebSites -{ - internal partial class WebSiteManagementRestClient - { - private string subscriptionId; - private Uri endpoint; - private string apiVersion; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of WebSiteManagementRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// server parameter. - /// Api Version. - /// or is null. - public WebSiteManagementRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-12-01") - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - endpoint ??= new Uri("https://management.azure.com"); - if (apiVersion == null) - { - throw new ArgumentNullException(nameof(apiVersion)); - } - - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = apiVersion; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateGenerateGithubAccessTokenForAppserviceCLIAsyncRequest(string code, string state) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.Web/generateGithubAccessTokenForAppserviceCLI", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var model = new AppserviceGithubTokenRequest(code, state); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(model); - request.Content = content; - return message; - } - - /// Description for Exchange code for GitHub access token for AppService CLI. - /// Code string to exchange for Github Access token. - /// State string used for verification. - /// The cancellation token to use. - /// or is null. - public async Task> GenerateGithubAccessTokenForAppserviceCLIAsyncAsync(string code, string state, CancellationToken cancellationToken = default) - { - if (code == null) - { - throw new ArgumentNullException(nameof(code)); - } - if (state == null) - { - throw new ArgumentNullException(nameof(state)); - } - - using var message = CreateGenerateGithubAccessTokenForAppserviceCLIAsyncRequest(code, state); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AppserviceGithubToken value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AppserviceGithubToken.DeserializeAppserviceGithubToken(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Exchange code for GitHub access token for AppService CLI. - /// Code string to exchange for Github Access token. - /// State string used for verification. - /// The cancellation token to use. - /// or is null. - public Response GenerateGithubAccessTokenForAppserviceCLIAsync(string code, string state, CancellationToken cancellationToken = default) - { - if (code == null) - { - throw new ArgumentNullException(nameof(code)); - } - if (state == null) - { - throw new ArgumentNullException(nameof(state)); - } - - using var message = CreateGenerateGithubAccessTokenForAppserviceCLIAsyncRequest(code, state); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AppserviceGithubToken value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AppserviceGithubToken.DeserializeAppserviceGithubToken(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetPublishingUserRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.Web/publishingUsers/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets publishing user. - /// The cancellation token to use. - public async Task> GetPublishingUserAsync(CancellationToken cancellationToken = default) - { - using var message = CreateGetPublishingUserRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - User value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = User.DeserializeUser(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets publishing user. - /// The cancellation token to use. - public Response GetPublishingUser(CancellationToken cancellationToken = default) - { - using var message = CreateGetPublishingUserRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - User value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = User.DeserializeUser(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdatePublishingUserRequest(User userDetails) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.Web/publishingUsers/web", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(userDetails); - request.Content = content; - return message; - } - - /// Description for Updates publishing user. - /// Details of publishing user. - /// The cancellation token to use. - /// is null. - public async Task> UpdatePublishingUserAsync(User userDetails, CancellationToken cancellationToken = default) - { - if (userDetails == null) - { - throw new ArgumentNullException(nameof(userDetails)); - } - - using var message = CreateUpdatePublishingUserRequest(userDetails); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - User value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = User.DeserializeUser(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates publishing user. - /// Details of publishing user. - /// The cancellation token to use. - /// is null. - public Response UpdatePublishingUser(User userDetails, CancellationToken cancellationToken = default) - { - if (userDetails == null) - { - throw new ArgumentNullException(nameof(userDetails)); - } - - using var message = CreateUpdatePublishingUserRequest(userDetails); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - User value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = User.DeserializeUser(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSourceControlsRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.Web/sourcecontrols", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the source controls available for Azure websites. - /// The cancellation token to use. - public async Task> ListSourceControlsAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListSourceControlsRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SourceControlCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SourceControlCollection.DeserializeSourceControlCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the source controls available for Azure websites. - /// The cancellation token to use. - public Response ListSourceControls(CancellationToken cancellationToken = default) - { - using var message = CreateListSourceControlsRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SourceControlCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SourceControlCollection.DeserializeSourceControlCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSourceControlRequest(string sourceControlType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.Web/sourcecontrols/", false); - uri.AppendPath(sourceControlType, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets source control token. - /// Type of source control. - /// The cancellation token to use. - /// is null. - public async Task> GetSourceControlAsync(string sourceControlType, CancellationToken cancellationToken = default) - { - if (sourceControlType == null) - { - throw new ArgumentNullException(nameof(sourceControlType)); - } - - using var message = CreateGetSourceControlRequest(sourceControlType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SourceControl value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SourceControl.DeserializeSourceControl(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets source control token. - /// Type of source control. - /// The cancellation token to use. - /// is null. - public Response GetSourceControl(string sourceControlType, CancellationToken cancellationToken = default) - { - if (sourceControlType == null) - { - throw new ArgumentNullException(nameof(sourceControlType)); - } - - using var message = CreateGetSourceControlRequest(sourceControlType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SourceControl value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SourceControl.DeserializeSourceControl(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateSourceControlRequest(string sourceControlType, SourceControl requestMessage) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/providers/Microsoft.Web/sourcecontrols/", false); - uri.AppendPath(sourceControlType, true); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(requestMessage); - request.Content = content; - return message; - } - - /// Description for Updates source control token. - /// Type of source control. - /// Source control token information. - /// The cancellation token to use. - /// or is null. - public async Task> UpdateSourceControlAsync(string sourceControlType, SourceControl requestMessage, CancellationToken cancellationToken = default) - { - if (sourceControlType == null) - { - throw new ArgumentNullException(nameof(sourceControlType)); - } - if (requestMessage == null) - { - throw new ArgumentNullException(nameof(requestMessage)); - } - - using var message = CreateUpdateSourceControlRequest(sourceControlType, requestMessage); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SourceControl value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SourceControl.DeserializeSourceControl(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Updates source control token. - /// Type of source control. - /// Source control token information. - /// The cancellation token to use. - /// or is null. - public Response UpdateSourceControl(string sourceControlType, SourceControl requestMessage, CancellationToken cancellationToken = default) - { - if (sourceControlType == null) - { - throw new ArgumentNullException(nameof(sourceControlType)); - } - if (requestMessage == null) - { - throw new ArgumentNullException(nameof(requestMessage)); - } - - using var message = CreateUpdateSourceControlRequest(sourceControlType, requestMessage); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SourceControl value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SourceControl.DeserializeSourceControl(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBillingMetersRequest(string billingLocation, string osType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/billingMeters", false); - if (billingLocation != null) - { - uri.AppendQuery("billingLocation", billingLocation, true); - } - if (osType != null) - { - uri.AppendQuery("osType", osType, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a list of meters for a given location. - /// Azure Location of billable resource. - /// App Service OS type meters used for. - /// The cancellation token to use. - public async Task> ListBillingMetersAsync(string billingLocation = null, string osType = null, CancellationToken cancellationToken = default) - { - using var message = CreateListBillingMetersRequest(billingLocation, osType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BillingMeterCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BillingMeterCollection.DeserializeBillingMeterCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a list of meters for a given location. - /// Azure Location of billable resource. - /// App Service OS type meters used for. - /// The cancellation token to use. - public Response ListBillingMeters(string billingLocation = null, string osType = null, CancellationToken cancellationToken = default) - { - using var message = CreateListBillingMetersRequest(billingLocation, osType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BillingMeterCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BillingMeterCollection.DeserializeBillingMeterCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCheckNameAvailabilityRequest(string name, CheckNameResourceTypes type, bool? isFqdn) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/checknameavailability", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var model = new ResourceNameAvailabilityRequest(name, type) - { - IsFqdn = isFqdn - }; - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(model); - request.Content = content; - return message; - } - - /// Description for Check if a resource name is available. - /// Resource name to verify. - /// Resource type used for verification. - /// Is fully qualified domain name. - /// The cancellation token to use. - /// is null. - public async Task> CheckNameAvailabilityAsync(string name, CheckNameResourceTypes type, bool? isFqdn = null, CancellationToken cancellationToken = default) - { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateCheckNameAvailabilityRequest(name, type, isFqdn); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ResourceNameAvailability value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ResourceNameAvailability.DeserializeResourceNameAvailability(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Check if a resource name is available. - /// Resource name to verify. - /// Resource type used for verification. - /// Is fully qualified domain name. - /// The cancellation token to use. - /// is null. - public Response CheckNameAvailability(string name, CheckNameResourceTypes type, bool? isFqdn = null, CancellationToken cancellationToken = default) - { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - using var message = CreateCheckNameAvailabilityRequest(name, type, isFqdn); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ResourceNameAvailability value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ResourceNameAvailability.DeserializeResourceNameAvailability(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSubscriptionDeploymentLocationsRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/deploymentLocations", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets list of available geo regions plus ministamps. - /// The cancellation token to use. - public async Task> GetSubscriptionDeploymentLocationsAsync(CancellationToken cancellationToken = default) - { - using var message = CreateGetSubscriptionDeploymentLocationsRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeploymentLocations value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeploymentLocations.DeserializeDeploymentLocations(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets list of available geo regions plus ministamps. - /// The cancellation token to use. - public Response GetSubscriptionDeploymentLocations(CancellationToken cancellationToken = default) - { - using var message = CreateGetSubscriptionDeploymentLocationsRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeploymentLocations value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeploymentLocations.DeserializeDeploymentLocations(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListGeoRegionsRequest(SkuName? sku, bool? linuxWorkersEnabled, bool? xenonWorkersEnabled, bool? linuxDynamicWorkersEnabled) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/geoRegions", false); - if (sku != null) - { - uri.AppendQuery("sku", sku.Value.ToString(), true); - } - if (linuxWorkersEnabled != null) - { - uri.AppendQuery("linuxWorkersEnabled", linuxWorkersEnabled.Value, true); - } - if (xenonWorkersEnabled != null) - { - uri.AppendQuery("xenonWorkersEnabled", xenonWorkersEnabled.Value, true); - } - if (linuxDynamicWorkersEnabled != null) - { - uri.AppendQuery("linuxDynamicWorkersEnabled", linuxDynamicWorkersEnabled.Value, true); - } - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a list of available geographical regions. - /// Name of SKU used to filter the regions. - /// Specify <code>true</code> if you want to filter to only regions that support Linux workers. - /// Specify <code>true</code> if you want to filter to only regions that support Xenon workers. - /// Specify <code>true</code> if you want to filter to only regions that support Linux Consumption Workers. - /// The cancellation token to use. - public async Task> ListGeoRegionsAsync(SkuName? sku = null, bool? linuxWorkersEnabled = null, bool? xenonWorkersEnabled = null, bool? linuxDynamicWorkersEnabled = null, CancellationToken cancellationToken = default) - { - using var message = CreateListGeoRegionsRequest(sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GeoRegionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GeoRegionCollection.DeserializeGeoRegionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a list of available geographical regions. - /// Name of SKU used to filter the regions. - /// Specify <code>true</code> if you want to filter to only regions that support Linux workers. - /// Specify <code>true</code> if you want to filter to only regions that support Xenon workers. - /// Specify <code>true</code> if you want to filter to only regions that support Linux Consumption Workers. - /// The cancellation token to use. - public Response ListGeoRegions(SkuName? sku = null, bool? linuxWorkersEnabled = null, bool? xenonWorkersEnabled = null, bool? linuxDynamicWorkersEnabled = null, CancellationToken cancellationToken = default) - { - using var message = CreateListGeoRegionsRequest(sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GeoRegionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GeoRegionCollection.DeserializeGeoRegionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteIdentifiersAssignedToHostNameRequest(NameIdentifier nameIdentifier) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/listSitesAssignedToHostName", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(nameIdentifier); - request.Content = content; - return message; - } - - /// Description for List all apps that are assigned to a hostname. - /// Hostname information. - /// The cancellation token to use. - /// is null. - public async Task> ListSiteIdentifiersAssignedToHostNameAsync(NameIdentifier nameIdentifier, CancellationToken cancellationToken = default) - { - if (nameIdentifier == null) - { - throw new ArgumentNullException(nameof(nameIdentifier)); - } - - using var message = CreateListSiteIdentifiersAssignedToHostNameRequest(nameIdentifier); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IdentifierCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all apps that are assigned to a hostname. - /// Hostname information. - /// The cancellation token to use. - /// is null. - public Response ListSiteIdentifiersAssignedToHostName(NameIdentifier nameIdentifier, CancellationToken cancellationToken = default) - { - if (nameIdentifier == null) - { - throw new ArgumentNullException(nameof(nameIdentifier)); - } - - using var message = CreateListSiteIdentifiersAssignedToHostNameRequest(nameIdentifier); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IdentifierCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPremierAddOnOffersRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/premieraddonoffers", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all premier add-on offers. - /// The cancellation token to use. - public async Task> ListPremierAddOnOffersAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListPremierAddOnOffersRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PremierAddOnOfferCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PremierAddOnOfferCollection.DeserializePremierAddOnOfferCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all premier add-on offers. - /// The cancellation token to use. - public Response ListPremierAddOnOffers(CancellationToken cancellationToken = default) - { - using var message = CreateListPremierAddOnOffersRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PremierAddOnOfferCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PremierAddOnOfferCollection.DeserializePremierAddOnOfferCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSkusRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/skus", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all SKUs. - /// The cancellation token to use. - public async Task> ListSkusAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListSkusRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SkuInfos value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SkuInfos.DeserializeSkuInfos(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all SKUs. - /// The cancellation token to use. - public Response ListSkus(CancellationToken cancellationToken = default) - { - using var message = CreateListSkusRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SkuInfos value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SkuInfos.DeserializeSkuInfos(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateVerifyHostingEnvironmentVnetRequest(VnetParameters parameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Web/verifyHostingEnvironmentVnet", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(parameters); - request.Content = content; - return message; - } - - /// Description for Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. - /// VNET information. - /// The cancellation token to use. - /// is null. - public async Task> VerifyHostingEnvironmentVnetAsync(VnetParameters parameters, CancellationToken cancellationToken = default) - { - if (parameters == null) - { - throw new ArgumentNullException(nameof(parameters)); - } - - using var message = CreateVerifyHostingEnvironmentVnetRequest(parameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VnetValidationFailureDetails value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = VnetValidationFailureDetails.DeserializeVnetValidationFailureDetails(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. - /// VNET information. - /// The cancellation token to use. - /// is null. - public Response VerifyHostingEnvironmentVnet(VnetParameters parameters, CancellationToken cancellationToken = default) - { - if (parameters == null) - { - throw new ArgumentNullException(nameof(parameters)); - } - - using var message = CreateVerifyHostingEnvironmentVnetRequest(parameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VnetValidationFailureDetails value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = VnetValidationFailureDetails.DeserializeVnetValidationFailureDetails(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateMoveRequest(string resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/moveResources", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(moveResourceEnvelope); - request.Content = content; - return message; - } - - /// Description for Move resources between resource groups. - /// Name of the resource group to which the resource belongs. - /// Object that represents the resource to move. - /// The cancellation token to use. - /// or is null. - public async Task MoveAsync(string resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (moveResourceEnvelope == null) - { - throw new ArgumentNullException(nameof(moveResourceEnvelope)); - } - - using var message = CreateMoveRequest(resourceGroupName, moveResourceEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Move resources between resource groups. - /// Name of the resource group to which the resource belongs. - /// Object that represents the resource to move. - /// The cancellation token to use. - /// or is null. - public Response Move(string resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (moveResourceEnvelope == null) - { - throw new ArgumentNullException(nameof(moveResourceEnvelope)); - } - - using var message = CreateMoveRequest(resourceGroupName, moveResourceEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateValidateRequest(string resourceGroupName, ValidateRequest validateRequest) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/validate", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(validateRequest); - request.Content = content; - return message; - } - - /// Description for Validate if a resource can be created. - /// Name of the resource group to which the resource belongs. - /// Request with the resources to validate. - /// The cancellation token to use. - /// or is null. - public async Task> ValidateAsync(string resourceGroupName, ValidateRequest validateRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (validateRequest == null) - { - throw new ArgumentNullException(nameof(validateRequest)); - } - - using var message = CreateValidateRequest(resourceGroupName, validateRequest); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ValidateResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ValidateResponse.DeserializeValidateResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Validate if a resource can be created. - /// Name of the resource group to which the resource belongs. - /// Request with the resources to validate. - /// The cancellation token to use. - /// or is null. - public Response Validate(string resourceGroupName, ValidateRequest validateRequest, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (validateRequest == null) - { - throw new ArgumentNullException(nameof(validateRequest)); - } - - using var message = CreateValidateRequest(resourceGroupName, validateRequest); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ValidateResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ValidateResponse.DeserializeValidateResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateValidateMoveRequest(string resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/validateMoveResources", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(moveResourceEnvelope); - request.Content = content; - return message; - } - - /// Description for Validate whether a resource can be moved. - /// Name of the resource group to which the resource belongs. - /// Object that represents the resource to move. - /// The cancellation token to use. - /// or is null. - public async Task ValidateMoveAsync(string resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (moveResourceEnvelope == null) - { - throw new ArgumentNullException(nameof(moveResourceEnvelope)); - } - - using var message = CreateValidateMoveRequest(resourceGroupName, moveResourceEnvelope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Validate whether a resource can be moved. - /// Name of the resource group to which the resource belongs. - /// Object that represents the resource to move. - /// The cancellation token to use. - /// or is null. - public Response ValidateMove(string resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (moveResourceEnvelope == null) - { - throw new ArgumentNullException(nameof(moveResourceEnvelope)); - } - - using var message = CreateValidateMoveRequest(resourceGroupName, moveResourceEnvelope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSourceControlsNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets the source controls available for Azure websites. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListSourceControlsNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListSourceControlsNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SourceControlCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SourceControlCollection.DeserializeSourceControlCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets the source controls available for Azure websites. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListSourceControlsNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListSourceControlsNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SourceControlCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SourceControlCollection.DeserializeSourceControlCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBillingMetersNextPageRequest(string nextLink, string billingLocation, string osType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Gets a list of meters for a given location. - /// The URL to the next page of results. - /// Azure Location of billable resource. - /// App Service OS type meters used for. - /// The cancellation token to use. - /// is null. - public async Task> ListBillingMetersNextPageAsync(string nextLink, string billingLocation = null, string osType = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListBillingMetersNextPageRequest(nextLink, billingLocation, osType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BillingMeterCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BillingMeterCollection.DeserializeBillingMeterCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Gets a list of meters for a given location. - /// The URL to the next page of results. - /// Azure Location of billable resource. - /// App Service OS type meters used for. - /// The cancellation token to use. - /// is null. - public Response ListBillingMetersNextPage(string nextLink, string billingLocation = null, string osType = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListBillingMetersNextPageRequest(nextLink, billingLocation, osType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BillingMeterCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BillingMeterCollection.DeserializeBillingMeterCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListGeoRegionsNextPageRequest(string nextLink, SkuName? sku, bool? linuxWorkersEnabled, bool? xenonWorkersEnabled, bool? linuxDynamicWorkersEnabled) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for Get a list of available geographical regions. - /// The URL to the next page of results. - /// Name of SKU used to filter the regions. - /// Specify <code>true</code> if you want to filter to only regions that support Linux workers. - /// Specify <code>true</code> if you want to filter to only regions that support Xenon workers. - /// Specify <code>true</code> if you want to filter to only regions that support Linux Consumption Workers. - /// The cancellation token to use. - /// is null. - public async Task> ListGeoRegionsNextPageAsync(string nextLink, SkuName? sku = null, bool? linuxWorkersEnabled = null, bool? xenonWorkersEnabled = null, bool? linuxDynamicWorkersEnabled = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListGeoRegionsNextPageRequest(nextLink, sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GeoRegionCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GeoRegionCollection.DeserializeGeoRegionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for Get a list of available geographical regions. - /// The URL to the next page of results. - /// Name of SKU used to filter the regions. - /// Specify <code>true</code> if you want to filter to only regions that support Linux workers. - /// Specify <code>true</code> if you want to filter to only regions that support Xenon workers. - /// Specify <code>true</code> if you want to filter to only regions that support Linux Consumption Workers. - /// The cancellation token to use. - /// is null. - public Response ListGeoRegionsNextPage(string nextLink, SkuName? sku = null, bool? linuxWorkersEnabled = null, bool? xenonWorkersEnabled = null, bool? linuxDynamicWorkersEnabled = null, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListGeoRegionsNextPageRequest(nextLink, sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GeoRegionCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GeoRegionCollection.DeserializeGeoRegionCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSiteIdentifiersAssignedToHostNameNextPageRequest(string nextLink, NameIdentifier nameIdentifier) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all apps that are assigned to a hostname. - /// The URL to the next page of results. - /// Hostname information. - /// The cancellation token to use. - /// or is null. - public async Task> ListSiteIdentifiersAssignedToHostNameNextPageAsync(string nextLink, NameIdentifier nameIdentifier, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (nameIdentifier == null) - { - throw new ArgumentNullException(nameof(nameIdentifier)); - } - - using var message = CreateListSiteIdentifiersAssignedToHostNameNextPageRequest(nextLink, nameIdentifier); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IdentifierCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all apps that are assigned to a hostname. - /// The URL to the next page of results. - /// Hostname information. - /// The cancellation token to use. - /// or is null. - public Response ListSiteIdentifiersAssignedToHostNameNextPage(string nextLink, NameIdentifier nameIdentifier, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (nameIdentifier == null) - { - throw new ArgumentNullException(nameof(nameIdentifier)); - } - - using var message = CreateListSiteIdentifiersAssignedToHostNameNextPageRequest(nextLink, nameIdentifier); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IdentifierCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IdentifierCollection.DeserializeIdentifierCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListPremierAddOnOffersNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - return message; - } - - /// Description for List all premier add-on offers. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListPremierAddOnOffersNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListPremierAddOnOffersNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PremierAddOnOfferCollection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PremierAddOnOfferCollection.DeserializePremierAddOnOfferCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Description for List all premier add-on offers. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListPremierAddOnOffersNextPage(string nextLink, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - - using var message = CreateListPremierAddOnOffersNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PremierAddOnOfferCollection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PremierAddOnOfferCollection.DeserializePremierAddOnOfferCollection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj index a71fb40a259f..6746aec79a70 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj @@ -1,23 +1,24 @@ - + + + + - - netstandard2.0 - true - annotations - + + Microsoft.Azure.Management.Websites + Provides website management capabilities for Microsoft Azure. + Microsoft.Azure.Management.Websites + 3.1.0 + Microsoft Azure website management;website management; + + + + $(SdkTargetFx) + - - 8.0 - true - https://azuresdkartifacts.blob.core.windows.net/azure-sdk-tools/index.json - - - - - - - - - - - + + + + + + + \ No newline at end of file diff --git a/src/SDKs/_metadata/web_resource-manager.txt b/src/SDKs/_metadata/web_resource-manager.txt deleted file mode 100644 index 38b42a0e7b6d..000000000000 --- a/src/SDKs/_metadata/web_resource-manager.txt +++ /dev/null @@ -1,11 +0,0 @@ -2021-05-06 15:51:44 UTC - -1) azure-rest-api-specs repository information -GitHub user: Azure -Branch: master -Commit: e401e457b5e95941f241f5c71bc56d42d431a4e0 - -2) AutoRest information -Requested version: latest -Bootstrapper version: C:\Program Files\nodejs `-- autorest@3.2.0 -Latest installed version: From 33b7eb5bca4a7c21a1397976cd75b1c43c73c098 Mon Sep 17 00:00:00 2001 From: Kota Sudhakar Reddy <60102891+Kotasudhakarreddy@users.noreply.github.com> Date: Mon, 10 May 2021 23:49:30 +0530 Subject: [PATCH 6/7] .Net SDK generated for version "2020-12-01" --- .../mgmtmetadata/web_resource-manager.txt | 7 +- .../AzSdk.RP.props | 2 +- .../AppServiceEnvironmentsOperations.cs | 2922 +- ...ServiceEnvironmentsOperationsExtensions.cs | 494 + .../Generated/AppServicePlansOperations.cs | 16 +- .../CertificateOrdersDiagnosticsOperations.cs | 687 + ...teOrdersDiagnosticsOperationsExtensions.cs | 189 + .../src/Generated/CertificatesOperations.cs | 11 +- .../CertificatesOperationsExtensions.cs | 16 +- .../src/Generated/DomainsOperations.cs | 8 +- .../Generated/DomainsOperationsExtensions.cs | 16 +- .../src/Generated/GlobalModelOperations.cs | 597 + .../GlobalModelOperationsExtensions.cs | 150 + .../IAppServiceEnvironmentsOperations.cs | 300 + ...ICertificateOrdersDiagnosticsOperations.cs | 126 + .../src/Generated/ICertificatesOperations.cs | 6 +- .../src/Generated/IDomainsOperations.cs | 8 +- .../src/Generated/IGlobalModelOperations.cs | 103 + .../src/Generated/IProviderOperations.cs | 218 +- .../src/Generated/IStaticSitesOperations.cs | 1450 +- .../src/Generated/IWebAppsOperations.cs | 1383 +- .../src/Generated/IWebSiteManagementClient.cs | 34 +- .../Models/AccessControlEntryAction.cs | 60 - .../src/Generated/Models/ApiKVReference.cs | 117 + .../Models/AppInsightsWebAppStackSettings.cs | 69 + .../src/Generated/Models/AppRegistration.cs | 9 + .../Models/AppServiceCertificateOrder.cs | 24 +- ...AppServiceCertificateOrderPatchResource.cs | 24 +- .../Generated/Models/AppServiceEnvironment.cs | 278 +- .../AppServiceEnvironmentPatchResource.cs | 279 +- .../Models/AppServiceEnvironmentResource.cs | 279 +- .../src/Generated/Models/AppServicePlan.cs | 20 +- .../Models/AppServicePlanPatchResource.cs | 35 +- .../src/Generated/Models/Apple.cs | 81 + .../src/Generated/Models/AppleRegistration.cs | 69 + .../src/Generated/Models/ApplicationStack.cs | 14 +- .../Models/ApplicationStackResource.cs | 14 +- .../Generated/Models/AppserviceGithubToken.cs | 87 + .../Models/AppserviceGithubTokenRequest.cs | 80 + .../src/Generated/Models/ArmPlan.cs | 84 + .../Models/AseV3NetworkingConfiguration.cs | 77 + .../src/Generated/Models/AuthPlatform.cs | 25 + .../src/Generated/Models/AutoHealTriggers.cs | 20 +- .../Generated/Models/AzureActiveDirectory.cs | 33 + .../Models/AzureActiveDirectoryLogin.cs | 10 + .../AzureActiveDirectoryRegistration.cs | 48 + .../Models/AzureActiveDirectoryValidation.cs | 12 + .../Generated/Models/AzureStaticWebApps.cs | 74 + .../Models/AzureStaticWebAppsRegistration.cs | 63 + .../Generated/Models/AzureStorageInfoValue.cs | 5 +- .../src/Generated/Models/AzureStorageState.cs | 8 +- .../src/Generated/Models/BillingMeter.cs | 10 +- .../Generated/Models/BlobStorageTokenStore.cs | 9 + .../src/Generated/Models/Certificate.cs | 31 +- .../Models/CertificateOrderContact.cs | 64 + .../Models/CertificatePatchResource.cs | 36 +- .../src/Generated/Models/ClientCertMode.cs | 8 +- .../Generated/Models/ClientRegistration.cs | 10 + .../Generated/Models/ConfigReferenceSource.cs | 54 + .../src/Generated/Models/CookieExpiration.cs | 13 +- .../src/Generated/Models/CsmCopySlotEntity.cs | 93 - .../Generated/Models/CustomDomainStatus.cs | 26 + .../Models/CustomOpenIdConnectProvider.cs | 17 + .../Generated/Models/DataProviderMetadata.cs | 59 + .../src/Generated/Models/DetectorInfo.cs | 80 +- .../src/Generated/Models/DetectorResponse.cs | 31 +- .../src/Generated/Models/DetectorType.cs | 66 + .../src/Generated/Models/Facebook.cs | 21 + .../Generated/Models/FileSystemTokenStore.cs | 7 + .../src/Generated/Models/ForwardProxy.cs | 18 +- .../Models/FunctionAppMajorVersion.cs | 71 + .../Models/FunctionAppMinorVersion.cs | 69 + .../Models/FunctionAppRuntimeSettings.cs | 193 + .../Generated/Models/FunctionAppRuntimes.cs | 61 + .../src/Generated/Models/FunctionAppStack.cs | 97 + .../src/Generated/Models/GitHub.cs | 16 + .../Models/GitHubActionCodeConfiguration.cs | 65 + .../Models/GitHubActionConfiguration.cs | 82 + .../GitHubActionContainerConfiguration.cs | 83 + .../Models/GitHubActionWebAppStackSettings.cs | 66 + .../src/Generated/Models/GlobalValidation.cs | 36 +- .../src/Generated/Models/Google.cs | 20 + .../src/Generated/Models/HttpSettings.cs | 19 + .../Generated/Models/HttpSettingsRoutes.cs | 7 + .../src/Generated/Models/IdentityProviders.cs | 58 +- .../src/Generated/Models/InsightStatus.cs | 78 + .../src/Generated/Models/JwtClaimChecks.cs | 9 + .../Models/KeyValuePairStringObject.cs | 52 + .../Models/KubeEnvironmentProfile.cs | 68 + .../Models/LegacyMicrosoftAccount.cs | 93 + .../Models/LinuxJavaContainerSettings.cs | 127 + .../src/Generated/Models/LoadBalancingMode.cs | 2 +- .../src/Generated/Models/Login.cs | 40 + .../src/Generated/Models/LoginRoutes.cs | 7 + .../src/Generated/Models/LoginScopes.cs | 8 + .../Models/NetworkAccessControlEntry.cs | 78 - .../src/Generated/Models/Nonce.cs | 13 + .../Models/OpenIdConnectClientCredential.cs | 15 +- .../Generated/Models/OpenIdConnectConfig.cs | 21 + .../Generated/Models/OpenIdConnectLogin.cs | 11 + .../Models/OpenIdConnectRegistration.cs | 16 + .../Generated/Models/QueryUtterancesResult.cs | 59 + .../Models/QueryUtterancesResults.cs | 62 + ....cs => RemotePrivateEndpointConnection.cs} | 24 +- ...otePrivateEndpointConnectionARMResource.cs | 87 + .../src/Generated/Models/Rendering.cs | 14 +- .../src/Generated/Models/RenderingType.cs | 128 +- .../src/Generated/Models/ResolveStatus.cs | 114 + ...EnvelopeRemotePrivateEndpointConnection.cs | 158 + .../src/Generated/Models/SampleUtterance.cs | 71 + .../src/Generated/Models/Site.cs | 41 +- .../src/Generated/Models/SiteAuthSettings.cs | 16 +- .../Generated/Models/SiteAuthSettingsV2.cs | 30 + .../src/Generated/Models/SiteConfig.cs | 148 +- .../Models/SiteConfigPropertiesDictionary.cs | 84 + .../Generated/Models/SiteConfigResource.cs | 148 +- .../src/Generated/Models/SiteLoadBalancing.cs | 8 +- .../src/Generated/Models/SitePatchResource.cs | 41 +- .../src/Generated/Models/SiteSourceControl.cs | 12 +- .../src/Generated/Models/SkuCapacity.cs | 12 +- .../src/Generated/Models/SkuName.cs | 3 + .../Models/SlowRequestsBasedTrigger.cs | 10 +- .../src/Generated/Models/StackMajorVersion.cs | 38 +- .../src/Generated/Models/StackPreferredOs.cs | 60 + .../Models/StagingEnvironmentPolicy.cs | 60 + .../src/Generated/Models/StampCapacity.cs | 9 +- .../Generated/Models/StaticSiteARMResource.cs | 87 +- .../Models/StaticSiteBuildARMResource.cs | 14 +- .../Models/StaticSiteBuildProperties.cs | 57 +- ...aticSiteCustomDomainOverviewARMResource.cs | 29 +- ...ustomDomainRequestPropertiesARMResource.cs | 62 + .../Models/StaticSitePatchResource.cs | 81 +- .../Models/StaticSiteTemplateOptions.cs | 91 + .../StaticSiteUserProvidedFunctionApp.cs | 83 + ...cSiteUserProvidedFunctionAppARMResource.cs | 83 + .../StaticSiteZipDeploymentARMResource.cs | 96 + .../Models/StaticSitesWorkflowPreview.cs | 69 + .../StaticSitesWorkflowPreviewRequest.cs | 79 + .../src/Generated/Models/Status.cs | 64 + .../Models/StatusCodesBasedTrigger.cs | 10 +- .../Models/StatusCodesRangeBasedTrigger.cs | 75 + .../src/Generated/Models/StringList.cs | 58 + .../src/Generated/Models/SupportTopic.cs | 59 + .../src/Generated/Models/TokenStore.cs | 26 + .../src/Generated/Models/Twitter.cs | 14 + .../Generated/Models/TwitterRegistration.cs | 19 + .../src/Generated/Models/ValidateRequest.cs | 20 +- .../Generated/Models/ValidateResourceTypes.cs | 1 + .../Generated/Models/VirtualNetworkProfile.cs | 16 +- .../src/Generated/Models/VnetParameters.cs | 11 +- .../Models/VnetValidationFailureDetails.cs | 20 +- .../Generated/Models/WebAppMajorVersion.cs | 71 + .../Generated/Models/WebAppMinorVersion.cs | 69 + .../Generated/Models/WebAppRuntimeSettings.cs | 152 + .../src/Generated/Models/WebAppRuntimes.cs | 81 + .../src/Generated/Models/WebAppStack.cs | 96 + .../Models/WindowsJavaContainerSettings.cs | 130 + .../src/Generated/Models/WorkerPool.cs | 91 - .../src/Generated/Models/WorkerSizeOptions.cs | 24 + .../src/Generated/ProviderOperations.cs | 1520 +- .../Generated/ProviderOperationsExtensions.cs | 348 +- .../Generated/RecommendationsOperations.cs | 40 +- .../SdkInfo_WebSiteManagementClient.cs | 69 +- .../src/Generated/StaticSitesOperations.cs | 7199 ++++- .../StaticSitesOperationsExtensions.cs | 2425 +- .../src/Generated/WebAppsOperations.cs | 25351 +++++++++------- .../Generated/WebAppsOperationsExtensions.cs | 2110 +- .../src/Generated/WebSiteManagementClient.cs | 215 +- .../WebSiteManagementClientExtensions.cs | 52 +- ...Microsoft.Azure.Management.Websites.csproj | 4 +- .../src/Properties/AssemblyInfo.cs | 4 +- 171 files changed, 41109 insertions(+), 14578 deletions(-) create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperations.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperationsExtensions.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperations.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperationsExtensions.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificateOrdersDiagnosticsOperations.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IGlobalModelOperations.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AccessControlEntryAction.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConfigReferenceSource.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmCopySlotEntity.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkAccessControlEntry.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs rename sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/{PrivateEndpointConnectionResource.cs => RemotePrivateEndpointConnection.cs} (64%) create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs create mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs delete mode 100644 sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPool.cs diff --git a/eng/mgmt/mgmtmetadata/web_resource-manager.txt b/eng/mgmt/mgmtmetadata/web_resource-manager.txt index f3ded863f84d..073cfde26c42 100644 --- a/eng/mgmt/mgmtmetadata/web_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/web_resource-manager.txt @@ -3,12 +3,13 @@ AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-06 --csharp-sdks-folder=K:\DotNet-SDK\Sep-2020\azure-sdk-for-net\sdk -2020-09-18 04:29:17 UTC +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=K:\DotNet-SDK\Apr-2021\azure-sdk-for-net\sdk +Autorest CSharp Version: 2.3.84 +2021-05-10 18:10:58 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: 1b04f5fce19cd330dcc0eec11a98e499c0cda50d +Commit: f1b7ba2a910b4195e1e2109b7c69852d4af4aa40 AutoRest information Requested version: v2 Bootstrapper version: autorest@2.0.4413 diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/AzSdk.RP.props b/sdk/websites/Microsoft.Azure.Management.WebSites/AzSdk.RP.props index a6ad5fd5e9ac..5e8eb9669936 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/AzSdk.RP.props +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/AzSdk.RP.props @@ -1,7 +1,7 @@ - CertificateRegistration_2020-06-01;DomainRegistration_2020-06-01;Web_2020-06-01;Web_2020-06-01;WebSiteManagementClient_2020-06-01; + CertificateRegistration_2020-12-01;DomainRegistration_2020-12-01;Web_2020-12-01;Web_2020-12-01;WebSiteManagementClient_2020-12-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperations.cs index dd3bef96890c..ce6e56da299e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperations.cs @@ -1401,10 +1401,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get diagnostic information for an App Service Environment. + /// Get networking configuration of an App Service Environment /// /// - /// Description for Get diagnostic information for an App Service Environment. + /// Description for Get networking configuration of an App Service Environment /// /// /// Name of the resource group to which the resource belongs. @@ -1433,7 +1433,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDiagnosticsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAseV3NetworkingConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1476,11 +1476,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDiagnostics", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAseV3NetworkingConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -1577,7 +1577,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1590,7 +1590,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1610,10 +1610,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get a diagnostics item for an App Service Environment. + /// Update networking configuration of an App Service Environment /// /// - /// Description for Get a diagnostics item for an App Service Environment. + /// Description for Update networking configuration of an App Service + /// Environment /// /// /// Name of the resource group to which the resource belongs. @@ -1621,8 +1622,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the diagnostics item. + /// /// /// /// Headers that will be added to request. @@ -1645,7 +1645,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDiagnosticsItemWithHttpMessagesAsync(string resourceGroupName, string name, string diagnosticsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAseNetworkingConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1670,9 +1670,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (diagnosticsName == null) + if (aseNetworkingConfiguration == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "diagnosticsName"); + throw new ValidationException(ValidationRules.CannotBeNull, "aseNetworkingConfiguration"); } if (Client.SubscriptionId == null) { @@ -1691,16 +1691,15 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("diagnosticsName", diagnosticsName); + tracingParameters.Add("aseNetworkingConfiguration", aseNetworkingConfiguration); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticsItem", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAseNetworkingConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{diagnosticsName}", System.Uri.EscapeDataString(diagnosticsName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1714,7 +1713,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1745,6 +1744,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(aseNetworkingConfiguration != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(aseNetworkingConfiguration, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -1795,7 +1800,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1808,7 +1813,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1828,12 +1833,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get the network endpoints of all inbound dependencies of an App Service - /// Environment. + /// Get diagnostic information for an App Service Environment. /// /// - /// Description for Get the network endpoints of all inbound dependencies of an - /// App Service Environment. + /// Description for Get diagnostic information for an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -1862,7 +1865,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetInboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDiagnosticsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1905,11 +1908,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInboundNetworkDependenciesEndpoints", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDiagnostics", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -2006,7 +2009,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2019,7 +2022,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2039,10 +2042,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get all multi-role pools. + /// Get a diagnostics item for an App Service Environment. /// /// - /// Description for Get all multi-role pools. + /// Description for Get a diagnostics item for an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -2050,6 +2053,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Name of the diagnostics item. + /// /// /// Headers that will be added to request. /// @@ -2071,7 +2077,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRolePoolsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDiagnosticsItemWithHttpMessagesAsync(string resourceGroupName, string name, string diagnosticsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2096,6 +2102,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (diagnosticsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "diagnosticsName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2113,14 +2123,16 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("diagnosticsName", diagnosticsName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePools", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticsItem", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{diagnosticsName}", System.Uri.EscapeDataString(diagnosticsName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2215,7 +2227,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2228,7 +2240,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2248,10 +2260,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get properties of a multi-role pool. + /// Get the network endpoints of all inbound dependencies of an App Service + /// Environment. /// /// - /// Description for Get properties of a multi-role pool. + /// Description for Get the network endpoints of all inbound dependencies of an + /// App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -2280,7 +2294,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetInboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2323,11 +2337,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMultiRolePool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInboundNetworkDependenciesEndpoints", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -2424,7 +2438,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2437,7 +2451,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2457,38 +2471,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Create or update a multi-role pool. - /// - /// - /// Description for Create or update a multi-role pool. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Properties of the multi-role pool. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(resourceGroupName, name, multiRolePoolEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Create or update a multi-role pool. + /// Get all multi-role pools. /// /// - /// Description for Create or update a multi-role pool. + /// Description for Get all multi-role pools. /// /// /// Name of the resource group to which the resource belongs. @@ -2496,9 +2482,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Properties of the multi-role pool. - /// /// /// Headers that will be added to request. /// @@ -2520,7 +2503,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRolePoolsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2545,10 +2528,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (multiRolePoolEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "multiRolePoolEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2566,13 +2545,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("multiRolePoolEnvelope", multiRolePoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateMultiRolePool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePools", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -2588,7 +2566,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2619,12 +2597,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(multiRolePoolEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(multiRolePoolEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -2645,7 +2617,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2675,7 +2647,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2688,25 +2660,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2726,12 +2680,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get metric definitions for a specific instance of a multi-role pool of an - /// App Service Environment. + /// Get properties of a multi-role pool. /// /// - /// Description for Get metric definitions for a specific instance of a - /// multi-role pool of an App Service Environment. + /// Description for Get properties of a multi-role pool. /// /// /// Name of the resource group to which the resource belongs. @@ -2739,9 +2691,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the instance in the multi-role pool. - /// /// /// Headers that will be added to request. /// @@ -2763,7 +2712,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRolePoolInstanceMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string instance, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2788,10 +2737,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instance == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instance"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2809,16 +2754,14 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instance", instance); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePoolInstanceMetricDefinitions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMultiRolePool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instance}", System.Uri.EscapeDataString(instance)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2913,7 +2856,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2926,7 +2869,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2946,11 +2889,38 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get metric definitions for a multi-role pool of an App Service Environment. + /// Create or update a multi-role pool. /// /// - /// Description for Get metric definitions for a multi-role pool of an App - /// Service Environment. + /// Description for Create or update a multi-role pool. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Properties of the multi-role pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(resourceGroupName, name, multiRolePoolEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a multi-role pool. + /// + /// + /// Description for Create or update a multi-role pool. /// /// /// Name of the resource group to which the resource belongs. @@ -2958,6 +2928,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Properties of the multi-role pool. + /// /// /// Headers that will be added to request. /// @@ -2979,7 +2952,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRoleMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3004,6 +2977,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (multiRolePoolEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "multiRolePoolEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -3021,12 +2998,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("multiRolePoolEnvelope", multiRolePoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRoleMetricDefinitions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateMultiRolePool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -3042,7 +3020,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3073,6 +3051,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(multiRolePoolEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(multiRolePoolEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -3093,7 +3077,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3123,7 +3107,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3136,7 +3120,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3148,18 +3132,38 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - if (_shouldTrace) + // Deserialize Response + if ((int)_statusCode == 202) { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get available SKUs for scaling a multi-role pool. - /// + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get metric definitions for a specific instance of a multi-role pool of an + /// App Service Environment. + /// /// - /// Description for Get available SKUs for scaling a multi-role pool. + /// Description for Get metric definitions for a specific instance of a + /// multi-role pool of an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -3167,6 +3171,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// Name of the instance in the multi-role pool. + /// /// /// Headers that will be added to request. /// @@ -3188,7 +3195,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRolePoolSkusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRolePoolInstanceMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string instance, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3213,6 +3220,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (instance == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instance"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -3230,14 +3241,16 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("instance", instance); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePoolSkus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePoolInstanceMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{instance}", System.Uri.EscapeDataString(instance)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3332,7 +3345,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3345,7 +3358,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3365,11 +3378,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get usage metrics for a multi-role pool of an App Service Environment. + /// Get metric definitions for a multi-role pool of an App Service Environment. /// /// - /// Description for Get usage metrics for a multi-role pool of an App Service - /// Environment. + /// Description for Get metric definitions for a multi-role pool of an App + /// Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -3398,7 +3411,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListMultiRoleUsagesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRoleMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3441,11 +3454,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMultiRoleUsages", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRoleMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -3542,7 +3555,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3555,7 +3568,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3575,11 +3588,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// List all currently running operations on the App Service Environment. + /// Get available SKUs for scaling a multi-role pool. /// /// - /// Description for List all currently running operations on the App Service - /// Environment. + /// Description for Get available SKUs for scaling a multi-role pool. /// /// /// Name of the resource group to which the resource belongs. @@ -3608,7 +3620,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListOperationsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRolePoolSkusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3651,11 +3663,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRolePoolSkus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -3752,7 +3764,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3765,7 +3777,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3785,12 +3797,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get the network endpoints of all outbound dependencies of an App Service - /// Environment. + /// Get usage metrics for a multi-role pool of an App Service Environment. /// /// - /// Description for Get the network endpoints of all outbound dependencies of - /// an App Service Environment. + /// Description for Get usage metrics for a multi-role pool of an App Service + /// Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -3819,7 +3830,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListMultiRoleUsagesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3862,11 +3873,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetOutboundNetworkDependenciesEndpoints", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMultiRoleUsages", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -3963,7 +3974,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3976,7 +3987,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3996,10 +4007,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Reboot all machines in an App Service Environment. + /// List all currently running operations on the App Service Environment. /// /// - /// Description for Reboot all machines in an App Service Environment. + /// Description for List all currently running operations on the App Service + /// Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -4016,6 +4028,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -4025,7 +4040,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RebootWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListOperationsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4068,11 +4083,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Reboot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -4088,7 +4103,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -4139,7 +4154,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4169,13 +4184,31 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4184,35 +4217,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Resume an App Service Environment. - /// - /// - /// Description for Resume an App Service Environment. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> ResumeWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginResumeWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get all App Service plans in an App Service Environment. + /// Get the network endpoints of all outbound dependencies of an App Service + /// Environment. /// /// - /// Description for Get all App Service plans in an App Service Environment. + /// Description for Get the network endpoints of all outbound dependencies of + /// an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -4241,7 +4251,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAppServicePlansWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4284,11 +4294,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAppServicePlans", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetOutboundNetworkDependenciesEndpoints", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -4385,7 +4395,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4398,7 +4408,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4418,10 +4428,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get all apps in an App Service Environment. + /// Gets the list of private endpoints associated with a hosting environment /// /// - /// Description for Get all apps in an App Service Environment. + /// Description for Gets the list of private endpoints associated with a + /// hosting environment /// /// /// Name of the resource group to which the resource belongs. @@ -4429,9 +4440,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Comma separated list of app properties to include. - /// /// /// Headers that will be added to request. /// @@ -4453,7 +4461,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebAppsWithHttpMessagesAsync(string resourceGroupName, string name, string propertiesToInclude = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4495,21 +4503,16 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("propertiesToInclude", propertiesToInclude); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebApps", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionList", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (propertiesToInclude != null) - { - _queryParameters.Add(string.Format("propertiesToInclude={0}", System.Uri.EscapeDataString(propertiesToInclude))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -4602,7 +4605,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4615,7 +4618,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4635,35 +4638,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Suspend an App Service Environment. - /// - /// - /// Description for Suspend an App Service Environment. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> SuspendWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginSuspendWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get global usage metrics of an App Service Environment. + /// Gets a private endpoint connection /// /// - /// Description for Get global usage metrics of an App Service Environment. + /// Description for Gets a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. @@ -4671,11 +4649,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Return only usages/metrics specified in the filter. Filter conforms to - /// odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq - /// 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq - /// 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// + /// Name of the private endpoint connection. /// /// /// Headers that will be added to request. @@ -4698,7 +4673,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4723,6 +4698,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -4740,21 +4719,18 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("filter", filter); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -4847,7 +4823,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4860,7 +4836,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4880,10 +4856,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get all worker pools of an App Service Environment. + /// Approves or rejects a private endpoint connection /// /// - /// Description for Get all worker pools of an App Service Environment. + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. @@ -4891,28 +4867,1641 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// + /// + /// + /// + /// /// - /// Headers that will be added to request. + /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListWorkerPoolsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// 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> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateLinkResources").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Reboot all machines in an App Service Environment. + /// + /// + /// Description for Reboot all machines in an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// 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 RebootWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Reboot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Resume an App Service Environment. + /// + /// + /// Description for Resume an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> ResumeWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginResumeWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get all App Service plans in an App Service Environment. + /// + /// + /// Description for Get all App Service plans in an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// 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>> ListAppServicePlansWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAppServicePlans", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all apps in an App Service Environment. + /// + /// + /// Description for Get all apps in an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Comma separated list of app properties to include. + /// + /// + /// 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>> ListWebAppsWithHttpMessagesAsync(string resourceGroupName, string name, string propertiesToInclude = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("propertiesToInclude", propertiesToInclude); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListWebApps", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (propertiesToInclude != null) + { + _queryParameters.Add(string.Format("propertiesToInclude={0}", System.Uri.EscapeDataString(propertiesToInclude))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Suspend an App Service Environment. + /// + /// + /// Description for Suspend an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> SuspendWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginSuspendWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get global usage metrics of an App Service Environment. + /// + /// + /// Description for Get global usage metrics of an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Return only usages/metrics specified in the filter. Filter conforms to + /// odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq + /// 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq + /// 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + /// + /// + /// 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>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all worker pools of an App Service Environment. + /// + /// + /// Description for Get all worker pools of an App Service Environment. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// 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>> ListWorkerPoolsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPools", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get properties of a worker pool. + /// + /// + /// Description for Get properties of a worker pool. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Name of the worker pool. + /// + /// + /// 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> GetWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (workerPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("workerPoolName", workerPoolName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetWorkerPool", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update a worker pool. + /// + /// + /// Description for Create or update a worker pool. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Name of the worker pool. + /// + /// + /// Properties of the worker pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWorkerPoolWithHttpMessagesAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a worker pool. + /// + /// + /// Description for Create or update a worker pool. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Name of the worker pool. + /// + /// + /// Properties of the worker pool. + /// + /// + /// 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> UpdateWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4937,6 +6526,14 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (workerPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); + } + if (workerPoolEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -4954,14 +6551,17 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("workerPoolName", workerPoolName); + tracingParameters.Add("workerPoolEnvelope", workerPoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPools", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateWorkerPool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4975,7 +6575,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5006,6 +6606,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(workerPoolEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workerPoolEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -5026,7 +6632,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -5056,7 +6662,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5069,7 +6675,25 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5089,10 +6713,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get properties of a worker pool. + /// Get metric definitions for a specific instance of a worker pool of an App + /// Service Environment. /// /// - /// Description for Get properties of a worker pool. + /// Description for Get metric definitions for a specific instance of a worker + /// pool of an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -5103,6 +6729,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the worker pool. /// + /// + /// Name of the instance in the worker pool. + /// /// /// Headers that will be added to request. /// @@ -5124,7 +6753,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWorkerPoolInstanceMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, string instance, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5153,6 +6782,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); } + if (instance == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instance"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5171,15 +6804,17 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("workerPoolName", workerPoolName); + tracingParameters.Add("instance", instance); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWorkerPool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPoolInstanceMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); + _url = _url.Replace("{instance}", System.Uri.EscapeDataString(instance)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -5274,7 +6909,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5287,7 +6922,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5307,41 +6942,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Create or update a worker pool. - /// - /// - /// Description for Create or update a worker pool. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the App Service Environment. - /// - /// - /// Name of the worker pool. - /// - /// - /// Properties of the worker pool. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWorkerPoolWithHttpMessagesAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Create or update a worker pool. + /// Get metric definitions for a worker pool of an App Service Environment. /// /// - /// Description for Create or update a worker pool. + /// Description for Get metric definitions for a worker pool of an App Service + /// Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -5352,9 +6957,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the worker pool. /// - /// - /// Properties of the worker pool. - /// /// /// Headers that will be added to request. /// @@ -5376,7 +6978,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWorkerPoolWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, WorkerPoolResource workerPoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebWorkerMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5405,10 +7007,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); } - if (workerPoolEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5427,13 +7025,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("workerPoolName", workerPoolName); - tracingParameters.Add("workerPoolEnvelope", workerPoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateWorkerPool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebWorkerMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); @@ -5450,7 +7047,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5481,12 +7078,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(workerPoolEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workerPoolEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -5507,7 +7098,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -5537,7 +7128,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5550,25 +7141,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5588,12 +7161,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get metric definitions for a specific instance of a worker pool of an App - /// Service Environment. + /// Get available SKUs for scaling a worker pool. /// /// - /// Description for Get metric definitions for a specific instance of a worker - /// pool of an App Service Environment. + /// Description for Get available SKUs for scaling a worker pool. /// /// /// Name of the resource group to which the resource belongs. @@ -5604,9 +7175,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the worker pool. /// - /// - /// Name of the instance in the worker pool. - /// /// /// Headers that will be added to request. /// @@ -5628,7 +7196,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWorkerPoolInstanceMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, string instance, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWorkerPoolSkusWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5657,10 +7225,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); } - if (instance == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instance"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5679,17 +7243,15 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("workerPoolName", workerPoolName); - tracingParameters.Add("instance", instance); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPoolInstanceMetricDefinitions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPoolSkus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); - _url = _url.Replace("{instance}", System.Uri.EscapeDataString(instance)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -5784,7 +7346,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5797,7 +7359,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5817,10 +7379,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get metric definitions for a worker pool of an App Service Environment. + /// Get usage metrics for a worker pool of an App Service Environment. /// /// - /// Description for Get metric definitions for a worker pool of an App Service + /// Description for Get usage metrics for a worker pool of an App Service /// Environment. /// /// @@ -5853,7 +7415,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebWorkerMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebWorkerUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -5901,11 +7463,11 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("workerPoolName", workerPoolName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebWorkerMetricDefinitions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebWorkerUsages", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); @@ -6003,7 +7565,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6016,7 +7578,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6036,10 +7598,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get available SKUs for scaling a worker pool. + /// Create or update an App Service Environment. /// /// - /// Description for Get available SKUs for scaling a worker pool. + /// Description for Create or update an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -6047,8 +7609,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the worker pool. + /// + /// Configuration details of the App Service Environment. /// /// /// Headers that will be added to request. @@ -6071,7 +7633,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWorkerPoolSkusWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, AppServiceEnvironmentResource hostingEnvironmentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6096,9 +7658,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (workerPoolName == null) + if (hostingEnvironmentEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostingEnvironmentEnvelope"); + } + if (hostingEnvironmentEnvelope != null) + { + hostingEnvironmentEnvelope.Validate(); } if (Client.SubscriptionId == null) { @@ -6117,16 +7683,15 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("workerPoolName", workerPoolName); + tracingParameters.Add("hostingEnvironmentEnvelope", hostingEnvironmentEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWorkerPoolSkus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -6140,7 +7705,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6171,6 +7736,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(hostingEnvironmentEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostingEnvironmentEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -6191,7 +7762,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6221,7 +7792,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6234,7 +7805,43 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6254,11 +7861,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Get usage metrics for a worker pool of an App Service Environment. + /// Delete an App Service Environment. /// /// - /// Description for Get usage metrics for a worker pool of an App Service - /// Environment. + /// Description for Delete an App Service Environment. /// /// /// Name of the resource group to which the resource belongs. @@ -6266,8 +7872,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Name of the worker pool. + /// + /// Specify <code>true</code> to force the deletion even if the App + /// Service Environment contains resources. The default is + /// <code>false</code>. /// /// /// Headers that will be added to request. @@ -6278,9 +7886,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -6290,7 +7895,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebWorkerUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string workerPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string name, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6315,10 +7920,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (workerPoolName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "workerPoolName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -6336,18 +7937,21 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("workerPoolName", workerPoolName); + tracingParameters.Add("forceDelete", forceDelete); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebWorkerUsages", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{workerPoolName}", System.Uri.EscapeDataString(workerPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (forceDelete != null) + { + _queryParameters.Add(string.Format("forceDelete={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDelete, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -6359,7 +7963,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6410,7 +8014,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6440,31 +8044,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -6473,10 +8059,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Create or update an App Service Environment. + /// Move an App Service Environment to a different VNET. /// /// - /// Description for Create or update an App Service Environment. + /// Description for Move an App Service Environment to a different VNET. /// /// /// Name of the resource group to which the resource belongs. @@ -6484,8 +8070,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Configuration details of the App Service Environment. + /// + /// Details for the new virtual network. /// /// /// Headers that will be added to request. @@ -6508,7 +8094,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, AppServiceEnvironmentResource hostingEnvironmentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> BeginChangeVnetWithHttpMessagesAsync(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6533,13 +8119,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostingEnvironmentEnvelope == null) + if (vnetInfo == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostingEnvironmentEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetInfo"); } - if (hostingEnvironmentEnvelope != null) + if (vnetInfo != null) { - hostingEnvironmentEnvelope.Validate(); + vnetInfo.Validate(); } if (Client.SubscriptionId == null) { @@ -6558,13 +8144,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostingEnvironmentEnvelope", hostingEnvironmentEnvelope); + tracingParameters.Add("vnetInfo", vnetInfo); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginChangeVnet", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -6580,7 +8166,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6611,9 +8197,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(hostingEnvironmentEnvelope != null) + if(vnetInfo != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostingEnvironmentEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vnetInfo, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -6637,7 +8223,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6667,7 +8253,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6680,25 +8266,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6716,7 +8284,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6736,10 +8304,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Delete an App Service Environment. + /// Create or update a multi-role pool. /// /// - /// Description for Delete an App Service Environment. + /// Description for Create or update a multi-role pool. /// /// /// Name of the resource group to which the resource belongs. @@ -6747,10 +8315,8 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Specify <code>true</code> to force the deletion even if the App - /// Service Environment contains resources. The default is - /// <code>false</code>. + /// + /// Properties of the multi-role pool. /// /// /// Headers that will be added to request. @@ -6761,6 +8327,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -6770,7 +8339,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string name, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6795,6 +8364,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (multiRolePoolEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "multiRolePoolEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -6812,21 +8385,17 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("forceDelete", forceDelete); + tracingParameters.Add("multiRolePoolEnvelope", multiRolePoolEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateMultiRolePool", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (forceDelete != null) - { - _queryParameters.Add(string.Format("forceDelete={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDelete, Client.SerializationSettings).Trim('"')))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -6838,7 +8407,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6869,6 +8438,12 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(multiRolePoolEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(multiRolePoolEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -6889,7 +8464,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6911,20 +8486,56 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { ServiceClientTracing.Error(_invocationId, ex); } - _httpRequest.Dispose(); - if (_httpResponse != null) + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) { - _httpResponse.Dispose(); + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } - throw ex; } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) + // Deserialize Response + if ((int)_statusCode == 202) { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -6934,10 +8545,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Move an App Service Environment to a different VNET. + /// Approves or rejects a private endpoint connection /// /// - /// Description for Move an App Service Environment to a different VNET. + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. @@ -6945,8 +8556,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Details for the new virtual network. + /// + /// + /// /// /// /// Headers that will be added to request. @@ -6969,7 +8581,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginChangeVnetWithHttpMessagesAsync(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6994,9 +8606,13 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetInfo == null) + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetInfo"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (privateEndpointWrapper == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); } if (Client.SubscriptionId == null) { @@ -7015,15 +8631,17 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetInfo", vnetInfo); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginChangeVnet", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -7037,7 +8655,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7068,9 +8686,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(vnetInfo != null) + if(privateEndpointWrapper != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vnetInfo, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -7124,7 +8742,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7137,7 +8755,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7155,7 +8773,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7175,10 +8793,10 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) } /// - /// Create or update a multi-role pool. + /// Deletes a private endpoint connection /// /// - /// Description for Create or update a multi-role pool. + /// Description for Deletes a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. @@ -7186,8 +8804,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// Name of the App Service Environment. /// - /// - /// Properties of the multi-role pool. + /// /// /// /// Headers that will be added to request. @@ -7210,7 +8827,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7235,9 +8852,9 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (multiRolePoolEnvelope == null) + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "multiRolePoolEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } if (Client.SubscriptionId == null) { @@ -7256,15 +8873,16 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("multiRolePoolEnvelope", multiRolePoolEnvelope); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateMultiRolePool", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -7278,7 +8896,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7309,12 +8927,6 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(multiRolePoolEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(multiRolePoolEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -7335,7 +8947,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -7365,7 +8977,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7378,7 +8990,7 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7396,7 +9008,25 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 204) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -9861,6 +11491,178 @@ internal AppServiceEnvironmentsOperations(WebSiteManagementClient client) return _result; } + /// + /// Gets the list of private endpoints associated with a hosting environment + /// + /// + /// Description for Gets the list of private endpoints associated with a + /// hosting environment + /// + /// + /// 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>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(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, "GetPrivateEndpointConnectionListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Resume an App Service Environment. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperationsExtensions.cs index e4a6d169b17e..b77535a589eb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServiceEnvironmentsOperationsExtensions.cs @@ -448,6 +448,104 @@ public static IPage ChangeVnet(this IAppServiceEnvironmentsOperations oper } } + /// + /// Get networking configuration of an App Service Environment + /// + /// + /// Description for Get networking configuration of an App Service Environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + public static AseV3NetworkingConfiguration GetAseV3NetworkingConfiguration(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name) + { + return operations.GetAseV3NetworkingConfigurationAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Get networking configuration of an App Service Environment + /// + /// + /// Description for Get networking configuration of an App Service Environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The cancellation token. + /// + public static async Task GetAseV3NetworkingConfigurationAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAseV3NetworkingConfigurationWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update networking configuration of an App Service Environment + /// + /// + /// Description for Update networking configuration of an App Service + /// Environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + public static AseV3NetworkingConfiguration UpdateAseNetworkingConfiguration(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration) + { + return operations.UpdateAseNetworkingConfigurationAsync(resourceGroupName, name, aseNetworkingConfiguration).GetAwaiter().GetResult(); + } + + /// + /// Update networking configuration of an App Service Environment + /// + /// + /// Description for Update networking configuration of an App Service + /// Environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAseNetworkingConfigurationAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateAseNetworkingConfigurationWithHttpMessagesAsync(resourceGroupName, name, aseNetworkingConfiguration, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get diagnostic information for an App Service Environment. /// @@ -1088,6 +1186,256 @@ public static IPage GetOutboundNetworkDependenciesE } } + /// + /// Gets the list of private endpoints associated with a hosting environment + /// + /// + /// Description for Gets the list of private endpoints associated with a + /// hosting environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + public static IPage GetPrivateEndpointConnectionList(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name) + { + return operations.GetPrivateEndpointConnectionListAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of private endpoints associated with a hosting environment + /// + /// + /// Description for Gets the list of private endpoints associated with a + /// hosting environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Name of the private endpoint connection. + /// + public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// + public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + return operations.ApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApproveOrRejectPrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + public static object DeletePrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task DeletePrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name) + { + return operations.GetPrivateLinkResourcesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateLinkResourcesAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Reboot all machines in an App Service Environment. /// @@ -2024,6 +2372,110 @@ public static WorkerPoolResource BeginCreateOrUpdateMultiRolePool(this IAppServi } } + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// + public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + return operations.BeginApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginApproveOrRejectPrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + public static object BeginDeletePrivateEndpointConnection(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeletePrivateEndpointConnectionAsync(this IAppServiceEnvironmentsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Resume an App Service Environment. /// @@ -2634,6 +3086,48 @@ public static IPage GetOutboundNetworkDependenciesE } } + /// + /// Gets the list of private endpoints associated with a hosting environment + /// + /// + /// Description for Gets the list of private endpoints associated with a + /// hosting environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetPrivateEndpointConnectionListNext(this IAppServiceEnvironmentsOperations operations, string nextPageLink) + { + return operations.GetPrivateEndpointConnectionListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of private endpoints associated with a hosting environment + /// + /// + /// Description for Gets the list of private endpoints associated with a + /// hosting environment + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListNextAsync(this IAppServiceEnvironmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Resume an App Service Environment. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServicePlansOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServicePlansOperations.cs index f0fd1ce9ff47..4c48686441f0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServicePlansOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/AppServicePlansOperations.cs @@ -2921,6 +2921,10 @@ internal AppServicePlansOperations(WebSiteManagementClient client) _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); @@ -2933,10 +2937,6 @@ internal AppServicePlansOperations(WebSiteManagementClient client) { _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(top))); } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -3357,14 +3357,14 @@ internal AppServicePlansOperations(WebSiteManagementClient client) _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperations.cs new file mode 100644 index 000000000000..de6c8f12dfda --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperations.cs @@ -0,0 +1,687 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CertificateOrdersDiagnosticsOperations operations. + /// + internal partial class CertificateOrdersDiagnosticsOperations : IServiceOperations, ICertificateOrdersDiagnosticsOperations + { + /// + /// Initializes a new instance of the CertificateOrdersDiagnosticsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal CertificateOrdersDiagnosticsOperations(WebSiteManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the WebSiteManagementClient + /// + public WebSiteManagementClient Client { get; private set; } + + /// + /// Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list of + /// detectors for this RP. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// 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>> ListAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(string resourceGroupName, string certificateOrderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (certificateOrderName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "certificateOrderName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("certificateOrderName", certificateOrderName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAppServiceCertificateOrderDetectorResponse", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{certificateOrderName}", System.Uri.EscapeDataString(certificateOrderName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Microsoft.CertificateRegistration call to get a detector response from App + /// Lens. + /// + /// + /// Description for Microsoft.CertificateRegistration call to get a detector + /// response from App Lens. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// The detector name which needs to be run. + /// + /// + /// The start time for detector response. + /// + /// + /// The end time for the detector response. + /// + /// + /// The time grain for the detector response. + /// + /// + /// 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> GetAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(string resourceGroupName, string certificateOrderName, string detectorName, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (certificateOrderName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "certificateOrderName"); + } + if (detectorName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "detectorName"); + } + if (timeGrain != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(timeGrain, "PT[1-9][0-9]+[SMH]")) + { + throw new ValidationException(ValidationRules.Pattern, "timeGrain", "PT[1-9][0-9]+[SMH]"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("certificateOrderName", certificateOrderName); + tracingParameters.Add("detectorName", detectorName); + tracingParameters.Add("startTime", startTime); + tracingParameters.Add("endTime", endTime); + tracingParameters.Add("timeGrain", timeGrain); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAppServiceCertificateOrderDetectorResponse", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors/{detectorName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{certificateOrderName}", System.Uri.EscapeDataString(certificateOrderName)); + _url = _url.Replace("{detectorName}", System.Uri.EscapeDataString(detectorName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (startTime != null) + { + _queryParameters.Add(string.Format("startTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(startTime, Client.SerializationSettings).Trim('"')))); + } + if (endTime != null) + { + _queryParameters.Add(string.Format("endTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(endTime, Client.SerializationSettings).Trim('"')))); + } + if (timeGrain != null) + { + _queryParameters.Add(string.Format("timeGrain={0}", System.Uri.EscapeDataString(timeGrain))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list of + /// detectors for this RP. + /// + /// + /// 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>> ListAppServiceCertificateOrderDetectorResponseNextWithHttpMessagesAsync(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, "ListAppServiceCertificateOrderDetectorResponseNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperationsExtensions.cs new file mode 100644 index 000000000000..c9696717ab5a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificateOrdersDiagnosticsOperationsExtensions.cs @@ -0,0 +1,189 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for CertificateOrdersDiagnosticsOperations. + /// + public static partial class CertificateOrdersDiagnosticsOperationsExtensions + { + /// + /// Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list of + /// detectors for this RP. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + public static IPage ListAppServiceCertificateOrderDetectorResponse(this ICertificateOrdersDiagnosticsOperations operations, string resourceGroupName, string certificateOrderName) + { + return operations.ListAppServiceCertificateOrderDetectorResponseAsync(resourceGroupName, certificateOrderName).GetAwaiter().GetResult(); + } + + /// + /// Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list of + /// detectors for this RP. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAppServiceCertificateOrderDetectorResponseAsync(this ICertificateOrdersDiagnosticsOperations operations, string resourceGroupName, string certificateOrderName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(resourceGroupName, certificateOrderName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Microsoft.CertificateRegistration call to get a detector response from App + /// Lens. + /// + /// + /// Description for Microsoft.CertificateRegistration call to get a detector + /// response from App Lens. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// The detector name which needs to be run. + /// + /// + /// The start time for detector response. + /// + /// + /// The end time for the detector response. + /// + /// + /// The time grain for the detector response. + /// + public static DetectorResponse GetAppServiceCertificateOrderDetectorResponse(this ICertificateOrdersDiagnosticsOperations operations, string resourceGroupName, string certificateOrderName, string detectorName, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string)) + { + return operations.GetAppServiceCertificateOrderDetectorResponseAsync(resourceGroupName, certificateOrderName, detectorName, startTime, endTime, timeGrain).GetAwaiter().GetResult(); + } + + /// + /// Microsoft.CertificateRegistration call to get a detector response from App + /// Lens. + /// + /// + /// Description for Microsoft.CertificateRegistration call to get a detector + /// response from App Lens. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// The detector name which needs to be run. + /// + /// + /// The start time for detector response. + /// + /// + /// The end time for the detector response. + /// + /// + /// The time grain for the detector response. + /// + /// + /// The cancellation token. + /// + public static async Task GetAppServiceCertificateOrderDetectorResponseAsync(this ICertificateOrdersDiagnosticsOperations operations, string resourceGroupName, string certificateOrderName, string detectorName, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(resourceGroupName, certificateOrderName, detectorName, startTime, endTime, timeGrain, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list of + /// detectors for this RP. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListAppServiceCertificateOrderDetectorResponseNext(this ICertificateOrdersDiagnosticsOperations operations, string nextPageLink) + { + return operations.ListAppServiceCertificateOrderDetectorResponseNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Microsoft.CertificateRegistration to get the list of detectors for this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list of + /// detectors for this RP. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAppServiceCertificateOrderDetectorResponseNextAsync(this ICertificateOrdersDiagnosticsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAppServiceCertificateOrderDetectorResponseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs index 583856b5039f..fea3e9de0871 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperations.cs @@ -56,6 +56,10 @@ internal CertificatesOperations(WebSiteManagementClient client) /// /// Description for Get all certificates for a subscription. /// + /// + /// Return only information specified in the filter (using OData syntax). For + /// example: $filter=KeyVaultId eq 'KeyVaultId' + /// /// /// Headers that will be added to request. /// @@ -77,7 +81,7 @@ internal CertificatesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -94,6 +98,7 @@ internal CertificatesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -106,6 +111,10 @@ internal CertificatesOperations(WebSiteManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs index 2f310ccda8e3..0b12b9a8b490 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/CertificatesOperationsExtensions.cs @@ -30,9 +30,13 @@ public static partial class CertificatesOperationsExtensions /// /// The operations group for this extension method. /// - public static IPage List(this ICertificatesOperations operations) + /// + /// Return only information specified in the filter (using OData syntax). For + /// example: $filter=KeyVaultId eq 'KeyVaultId' + /// + public static IPage List(this ICertificatesOperations operations, string filter = default(string)) { - return operations.ListAsync().GetAwaiter().GetResult(); + return operations.ListAsync(filter).GetAwaiter().GetResult(); } /// @@ -44,12 +48,16 @@ public static IPage List(this ICertificatesOperations operations) /// /// The operations group for this extension method. /// + /// + /// Return only information specified in the filter (using OData syntax). For + /// example: $filter=KeyVaultId eq 'KeyVaultId' + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ICertificatesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ICertificatesOperations operations, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperations.cs index 32d276db9b8f..08d58ad3005c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperations.cs @@ -2095,11 +2095,11 @@ internal DomainsOperations(WebSiteManagementClient client) /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifer + /// for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifer + /// identifier details for an existing identifier /// /// /// Name of the resource group to which the resource belongs. @@ -2526,11 +2526,11 @@ internal DomainsOperations(WebSiteManagementClient client) /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifer + /// for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifer + /// identifier details for an existing identifier /// /// /// Name of the resource group to which the resource belongs. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperationsExtensions.cs index d6580c16cf14..ea9c034cf240 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/DomainsOperationsExtensions.cs @@ -514,11 +514,11 @@ public static DomainOwnershipIdentifier GetOwnershipIdentifier(this IDomainsOper /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifer + /// for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifer + /// identifier details for an existing identifier /// /// /// The operations group for this extension method. @@ -542,11 +542,11 @@ public static DomainOwnershipIdentifier CreateOrUpdateOwnershipIdentifier(this I /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifer + /// for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifer + /// identifier details for an existing identifier /// /// /// The operations group for this extension method. @@ -625,11 +625,11 @@ public static void DeleteOwnershipIdentifier(this IDomainsOperations operations, /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifer + /// for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifer + /// identifier details for an existing identifier /// /// /// The operations group for this extension method. @@ -653,11 +653,11 @@ public static DomainOwnershipIdentifier UpdateOwnershipIdentifier(this IDomainsO /// /// Creates an ownership identifier for a domain or updates identifier details - /// for an existing identifer + /// for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or updates - /// identifier details for an existing identifer + /// identifier details for an existing identifier /// /// /// The operations group for this extension method. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperations.cs new file mode 100644 index 000000000000..4e9e2829d289 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperations.cs @@ -0,0 +1,597 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// GlobalModelOperations operations. + /// + internal partial class GlobalModelOperations : IServiceOperations, IGlobalModelOperations + { + /// + /// Initializes a new instance of the GlobalModelOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal GlobalModelOperations(WebSiteManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the WebSiteManagementClient + /// + public WebSiteManagementClient Client { get; private set; } + + /// + /// Get deleted app for a subscription. + /// + /// + /// Description for Get deleted app for a subscription. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + /// + /// 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> GetDeletedWebAppWithHttpMessagesAsync(string deletedSiteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deletedSiteId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deletedSiteId"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deletedSiteId", deletedSiteId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDeletedWebApp", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}").ToString(); + _url = _url.Replace("{deletedSiteId}", System.Uri.EscapeDataString(deletedSiteId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all deleted apps for a subscription. + /// + /// + /// Description for Get all deleted apps for a subscription. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + /// + /// 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>> GetDeletedWebAppSnapshotsWithHttpMessagesAsync(string deletedSiteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deletedSiteId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deletedSiteId"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deletedSiteId", deletedSiteId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDeletedWebAppSnapshots", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}/snapshots").ToString(); + _url = _url.Replace("{deletedSiteId}", System.Uri.EscapeDataString(deletedSiteId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets an operation in a subscription and given region + /// + /// + /// Description for Gets an operation in a subscription and given region + /// + /// + /// Location name + /// + /// + /// Operation Id + /// + /// + /// 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 GetSubscriptionOperationWithAsyncResponseWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSubscriptionOperationWithAsyncResponse", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/operations/{operationId}").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperationsExtensions.cs new file mode 100644 index 000000000000..f9234d348ca7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/GlobalModelOperationsExtensions.cs @@ -0,0 +1,150 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for GlobalModelOperations. + /// + public static partial class GlobalModelOperationsExtensions + { + /// + /// Get deleted app for a subscription. + /// + /// + /// Description for Get deleted app for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + public static DeletedSite GetDeletedWebApp(this IGlobalModelOperations operations, string deletedSiteId) + { + return operations.GetDeletedWebAppAsync(deletedSiteId).GetAwaiter().GetResult(); + } + + /// + /// Get deleted app for a subscription. + /// + /// + /// Description for Get deleted app for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + /// + /// The cancellation token. + /// + public static async Task GetDeletedWebAppAsync(this IGlobalModelOperations operations, string deletedSiteId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDeletedWebAppWithHttpMessagesAsync(deletedSiteId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get all deleted apps for a subscription. + /// + /// + /// Description for Get all deleted apps for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + public static IList GetDeletedWebAppSnapshots(this IGlobalModelOperations operations, string deletedSiteId) + { + return operations.GetDeletedWebAppSnapshotsAsync(deletedSiteId).GetAwaiter().GetResult(); + } + + /// + /// Get all deleted apps for a subscription. + /// + /// + /// Description for Get all deleted apps for a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + /// + /// The cancellation token. + /// + public static async Task> GetDeletedWebAppSnapshotsAsync(this IGlobalModelOperations operations, string deletedSiteId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDeletedWebAppSnapshotsWithHttpMessagesAsync(deletedSiteId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets an operation in a subscription and given region + /// + /// + /// Description for Gets an operation in a subscription and given region + /// + /// + /// The operations group for this extension method. + /// + /// + /// Location name + /// + /// + /// Operation Id + /// + public static void GetSubscriptionOperationWithAsyncResponse(this IGlobalModelOperations operations, string location, string operationId) + { + operations.GetSubscriptionOperationWithAsyncResponseAsync(location, operationId).GetAwaiter().GetResult(); + } + + /// + /// Gets an operation in a subscription and given region + /// + /// + /// Description for Gets an operation in a subscription and given region + /// + /// + /// The operations group for this extension method. + /// + /// + /// Location name + /// + /// + /// Operation Id + /// + /// + /// The cancellation token. + /// + public static async Task GetSubscriptionOperationWithAsyncResponseAsync(this IGlobalModelOperations operations, string location, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.GetSubscriptionOperationWithAsyncResponseWithHttpMessagesAsync(location, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IAppServiceEnvironmentsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IAppServiceEnvironmentsOperations.cs index a95032f627c6..4afcf71a451e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IAppServiceEnvironmentsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IAppServiceEnvironmentsOperations.cs @@ -284,6 +284,66 @@ public partial interface IAppServiceEnvironmentsOperations /// Task>> ChangeVnetWithHttpMessagesAsync(string resourceGroupName, string name, VirtualNetworkProfile vnetInfo, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get networking configuration of an App Service Environment + /// + /// + /// Description for Get networking configuration of an App Service + /// Environment + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAseV3NetworkingConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update networking configuration of an App Service Environment + /// + /// + /// Description for Update networking configuration of an App Service + /// Environment + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateAseNetworkingConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, AseV3NetworkingConfiguration aseNetworkingConfiguration, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get diagnostic information for an App Service Environment. /// /// @@ -674,6 +734,157 @@ public partial interface IAppServiceEnvironmentsOperations /// Task>> GetOutboundNetworkDependenciesEndpointsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the list of private endpoints associated with a hosting + /// environment + /// + /// + /// Description for Gets the list of private endpoints associated with + /// a hosting environment + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Reboot all machines in an App Service Environment. /// /// @@ -1234,6 +1445,68 @@ public partial interface IAppServiceEnvironmentsOperations /// Task> BeginCreateOrUpdateMultiRolePoolWithHttpMessagesAsync(string resourceGroupName, string name, WorkerPoolResource multiRolePoolEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the App Service Environment. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Resume an App Service Environment. /// /// @@ -1614,6 +1887,33 @@ public partial interface IAppServiceEnvironmentsOperations /// Task>> GetOutboundNetworkDependenciesEndpointsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the list of private endpoints associated with a hosting + /// environment + /// + /// + /// Description for Gets the list of private endpoints associated with + /// a hosting environment + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Resume an App Service Environment. /// /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificateOrdersDiagnosticsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificateOrdersDiagnosticsOperations.cs new file mode 100644 index 000000000000..27a71c5b91d6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificateOrdersDiagnosticsOperations.cs @@ -0,0 +1,126 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CertificateOrdersDiagnosticsOperations operations. + /// + public partial interface ICertificateOrdersDiagnosticsOperations + { + /// + /// Microsoft.CertificateRegistration to get the list of detectors for + /// this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list + /// of detectors for this RP. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(string resourceGroupName, string certificateOrderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Microsoft.CertificateRegistration call to get a detector response + /// from App Lens. + /// + /// + /// Description for Microsoft.CertificateRegistration call to get a + /// detector response from App Lens. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The certificate order name for which the response is needed. + /// + /// + /// The detector name which needs to be run. + /// + /// + /// The start time for detector response. + /// + /// + /// The end time for the detector response. + /// + /// + /// The time grain for the detector response. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAppServiceCertificateOrderDetectorResponseWithHttpMessagesAsync(string resourceGroupName, string certificateOrderName, string detectorName, System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string timeGrain = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Microsoft.CertificateRegistration to get the list of detectors for + /// this RP. + /// + /// + /// Description for Microsoft.CertificateRegistration to get the list + /// of detectors for this RP. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListAppServiceCertificateOrderDetectorResponseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs index 949867d9a615..86f6dcfa701d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ICertificatesOperations.cs @@ -29,6 +29,10 @@ public partial interface ICertificatesOperations /// /// Description for Get all certificates for a subscription. /// + /// + /// Return only information specified in the filter (using OData + /// syntax). For example: $filter=KeyVaultId eq 'KeyVaultId' + /// /// /// The headers that will be added to request. /// @@ -44,7 +48,7 @@ public partial interface ICertificatesOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all certificates in a resource group. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IDomainsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IDomainsOperations.cs index 26350ec4d859..e1aebe7efb72 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IDomainsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IDomainsOperations.cs @@ -324,11 +324,11 @@ public partial interface IDomainsOperations Task> GetOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string domainName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates an ownership identifier for a domain or updates identifier - /// details for an existing identifer + /// details for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or - /// updates identifier details for an existing identifer + /// updates identifier details for an existing identifier /// /// /// Name of the resource group to which the resource belongs. @@ -388,11 +388,11 @@ public partial interface IDomainsOperations Task DeleteOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string domainName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates an ownership identifier for a domain or updates identifier - /// details for an existing identifer + /// details for an existing identifier /// /// /// Description for Creates an ownership identifier for a domain or - /// updates identifier details for an existing identifer + /// updates identifier details for an existing identifier /// /// /// Name of the resource group to which the resource belongs. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IGlobalModelOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IGlobalModelOperations.cs new file mode 100644 index 000000000000..c71309c9de0f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IGlobalModelOperations.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.WebSites +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// GlobalModelOperations operations. + /// + public partial interface IGlobalModelOperations + { + /// + /// Get deleted app for a subscription. + /// + /// + /// Description for Get deleted app for a subscription. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetDeletedWebAppWithHttpMessagesAsync(string deletedSiteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all deleted apps for a subscription. + /// + /// + /// Description for Get all deleted apps for a subscription. + /// + /// + /// The numeric ID of the deleted app, e.g. 12345 + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetDeletedWebAppSnapshotsWithHttpMessagesAsync(string deletedSiteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets an operation in a subscription and given region + /// + /// + /// Description for Gets an operation in a subscription and given + /// region + /// + /// + /// Location name + /// + /// + /// Operation Id + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task GetSubscriptionOperationWithAsyncResponseWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IProviderOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IProviderOperations.cs index 662c53798b81..ed6bf7f9bd67 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IProviderOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IProviderOperations.cs @@ -32,7 +32,7 @@ public partial interface IProviderOperations /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// /// /// The headers that will be added to request. @@ -51,6 +51,91 @@ public partial interface IProviderOperations /// Task>> GetAvailableStacksWithHttpMessagesAsync(string osTypeSelected = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their + /// versions + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetFunctionAppStacksWithHttpMessagesAsync(string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get available Function app frameworks and their versions for + /// location + /// + /// + /// Description for Get available Function app frameworks and their + /// versions for location + /// + /// + /// Function App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetFunctionAppStacksForLocationWithHttpMessagesAsync(string location, string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions + /// for location + /// + /// + /// Web App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetWebAppStacksForLocationWithHttpMessagesAsync(string location, string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets all available operations for the Microsoft.Web resource /// provider. Also exposes resource metric definitions /// @@ -75,6 +160,31 @@ public partial interface IProviderOperations /// Task>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetWebAppStacksWithHttpMessagesAsync(string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get available application frameworks and their versions /// /// @@ -83,7 +193,7 @@ public partial interface IProviderOperations /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// /// /// The headers that will be added to request. @@ -128,6 +238,85 @@ public partial interface IProviderOperations /// Task>> GetAvailableStacksNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their + /// versions + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetFunctionAppStacksNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get available Function app frameworks and their versions for + /// location + /// + /// + /// Description for Get available Function app frameworks and their + /// versions for location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetFunctionAppStacksForLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions + /// for location + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetWebAppStacksForLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets all available operations for the Microsoft.Web resource /// provider. Also exposes resource metric definitions /// @@ -155,6 +344,31 @@ public partial interface IProviderOperations /// Task>> ListOperationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetWebAppStacksNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get available application frameworks and their versions /// /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IStaticSitesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IStaticSitesOperations.cs index d417e4d033a4..27111b69f27c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IStaticSitesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IStaticSitesOperations.cs @@ -23,6 +23,36 @@ namespace Microsoft.Azure.Management.WebSites /// public partial interface IStaticSitesOperations { + /// + /// Generates a preview workflow file for the static site + /// + /// + /// Description for Generates a preview workflow file for the static + /// site + /// + /// + /// Location where you plan to create the static site. + /// + /// + /// A JSON representation of the StaticSitesWorkflowPreviewRequest + /// properties. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PreviewWorkflowWithHttpMessagesAsync(string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all Static Sites for a subscription. /// @@ -331,7 +361,7 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -349,7 +379,7 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> GetStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a static site build. /// @@ -362,9 +392,41 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates the app settings of a static site build. + /// + /// + /// Description for Creates or updates the app settings of a static + /// site build. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// /// The stage site identifier. /// + /// + /// The dictionary containing the static site app settings to update. + /// /// /// The headers that will be added to request. /// @@ -374,10 +436,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteBuildAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates the function app settings of a static site /// build. @@ -392,10 +457,12 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// + /// The dictionary containing the static site function app settings to + /// update. /// /// /// The headers that will be added to request. @@ -412,7 +479,7 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the functions of a particular static site build. /// @@ -426,7 +493,7 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -444,12 +511,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteBuildFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListStaticSiteBuildFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the application settings of a static site. + /// Gets the application settings of a static site build. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Gets the application settings of a static site + /// build. /// /// /// Name of the resource group to which the resource belongs. @@ -457,7 +525,7 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -475,13 +543,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListStaticSiteBuildAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates the function app settings of a static site. + /// Gets the application settings of a static site build. /// /// - /// Description for Creates or updates the function app settings of a - /// static site. + /// Description for Gets the application settings of a static site + /// build. /// /// /// Name of the resource group to which the resource belongs. @@ -489,7 +557,8 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// /// /// The headers that will be added to request. @@ -506,12 +575,14 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates an invitation link for a user with the role + /// Gets the details of the user provided function apps registered with + /// a static site build /// /// - /// Description for Creates an invitation link for a user with the role + /// Description for Gets the details of the user provided function apps + /// registered with a static site build /// /// /// Name of the resource group to which the resource belongs. @@ -519,7 +590,8 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// /// /// The headers that will be added to request. @@ -536,19 +608,26 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> CreateUserRolesInvitationLinkWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetUserProvidedFunctionAppsForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all static site custom domains for a particular static site. + /// Gets the details of the user provided function app registered with + /// a static site build /// /// - /// Description for Gets all static site custom domains for a - /// particular static site. + /// Description for Gets the details of the user provided function app + /// registered with a static site build /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// /// /// The headers that will be added to request. @@ -565,14 +644,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteCustomDomainsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetUserProvidedFunctionAppForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a new static site custom domain in an existing resource - /// group and static site. + /// Register a user provided function app with a static site build /// /// - /// Description for Creates a new static site custom domain in an - /// existing resource group and static site. + /// Description for Register a user provided function app with a static + /// site build /// /// /// Name of the resource group to which the resource belongs. @@ -580,8 +658,21 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// The custom domain to create. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. + /// See example. + /// + /// + /// Specify <code>true</code> to force the update of the + /// auth configuration on the function app even if an + /// AzureStaticWebApps provider is already configured on the function + /// app. The default is <code>false</code>. /// /// /// The headers that will be added to request. @@ -598,12 +689,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a custom domain. + /// Detach the user provided function app from the static site build /// /// - /// Description for Deletes a custom domain. + /// Description for Detach the user provided function app from the + /// static site build /// /// /// Name of the resource group to which the resource belongs. @@ -611,8 +703,11 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// The custom domain to delete. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// /// /// The headers that will be added to request. @@ -626,13 +721,13 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task DeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DetachUserProvidedFunctionAppFromStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Validates a particular custom domain can be added to a static site. + /// Deploys zipped content to a specific environment of a static site. /// /// - /// Description for Validates a particular custom domain can be added - /// to a static site. + /// Description for Deploys zipped content to a specific environment of + /// a static site. /// /// /// Name of the resource group to which the resource belongs. @@ -640,8 +735,12 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// - /// - /// The custom domain to validate. + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. + /// See example. /// /// /// The headers that will be added to request. @@ -655,18 +754,22 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task CreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Detaches a static site. + /// Creates or updates the app settings of a static site. /// /// - /// Description for Detaches a static site. + /// Description for Creates or updates the app settings of a static + /// site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site to detach. + /// Name of the static site. + /// + /// + /// The dictionary containing the static site app settings to update. /// /// /// The headers that will be added to request. @@ -677,15 +780,19 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the functions of a static site. + /// Creates or updates the function app settings of a static site. /// /// - /// Description for Gets the functions of a static site. + /// Description for Creates or updates the function app settings of a + /// static site. /// /// /// Name of the resource group to which the resource belongs. @@ -693,6 +800,10 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// + /// + /// The dictionary containing the static site function app settings to + /// update. + /// /// /// The headers that will be added to request. /// @@ -708,12 +819,12 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the application settings of a static site. + /// Creates an invitation link for a user with the role /// /// - /// Description for Gets the application settings of a static site. + /// Description for Creates an invitation link for a user with the role /// /// /// Name of the resource group to which the resource belongs. @@ -721,6 +832,8 @@ public partial interface IStaticSitesOperations /// /// Name of the static site. /// + /// + /// /// /// The headers that will be added to request. /// @@ -736,18 +849,19 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateUserRolesInvitationLinkWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the secrets for an existing static site. + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Lists the secrets for an existing static site. + /// Description for Gets all static site custom domains for a + /// particular static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. + /// Name of the static site resource to search in. /// /// /// The headers that will be added to request. @@ -764,20 +878,22 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task> ListStaticSiteSecretsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListStaticSiteCustomDomainsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Resets the api key for an existing static site. + /// Gets an existing custom domain for a particular static site. /// /// - /// Description for Resets the api key for an existing static site. + /// Description for Gets an existing custom domain for a particular + /// static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. + /// Name of the static site resource to search in. /// - /// + /// + /// The custom domain name. /// /// /// The headers that will be added to request. @@ -788,18 +904,33 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task ResetStaticSiteApiKeyWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get all Static Sites for a subscription. + /// Creates a new static site custom domain in an existing resource + /// group and static site. /// /// - /// Description for Get all Static Sites for a subscription. + /// Description for Creates a new static site custom domain in an + /// existing resource group and static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request + /// properties. See example. /// /// /// The headers that will be added to request. @@ -816,16 +947,21 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all static sites in the specified resource group. + /// Deletes a custom domain. /// /// - /// Description for Gets all static sites in the specified resource - /// group. + /// Description for Deletes a custom domain. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. /// /// /// The headers that will be added to request. @@ -836,21 +972,29 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> GetStaticSitesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the list of users of a static site. + /// Validates a particular custom domain can be added to a static site. /// /// - /// Description for Gets the list of users of a static site. + /// Description for Validates a particular custom domain can be added + /// to a static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request + /// properties. See example. /// /// /// The headers that will be added to request. @@ -861,22 +1005,21 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteUsersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all static site builds for a particular static site. + /// Detaches a static site. /// /// - /// Description for Gets all static site builds for a particular static - /// site. + /// Description for Detaches a static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. /// /// /// The headers that will be added to request. @@ -887,22 +1030,21 @@ public partial interface IStaticSitesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> GetStaticSiteBuildsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the functions of a particular static site build. + /// Gets the functions of a static site. /// /// - /// Description for Gets the functions of a particular static site - /// build. + /// Description for Gets the functions of a static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. /// /// /// The headers that will be added to request. @@ -919,16 +1061,18 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteBuildFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListStaticSiteFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all static site custom domains for a particular static site. + /// Gets the application settings of a static site. /// /// - /// Description for Gets all static site custom domains for a - /// particular static site. + /// Description for Gets the application settings of a static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. /// /// /// The headers that will be added to request. @@ -945,15 +1089,1047 @@ public partial interface IStaticSitesOperations /// /// Thrown when a required parameter is null /// - Task>> ListStaticSiteCustomDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListStaticSiteAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the functions of a static site. + /// Lists the roles configured for the static site. /// /// - /// Description for Gets the functions of a static site. + /// Description for Lists the roles configured for the static site. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListStaticSiteConfiguredRolesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the secrets for an existing static site. + /// + /// + /// Description for Lists the secrets for an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListStaticSiteSecretsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of private endpoint connections associated with a + /// static site + /// + /// + /// Description for Gets the list of private endpoint connections + /// associated with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Resets the api key for an existing static site. + /// + /// + /// Description for Resets the api key for an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ResetStaticSiteApiKeyWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the details of the user provided function apps registered with + /// a static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetUserProvidedFunctionAppsForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the details of the user provided function app registered with + /// a static site + /// + /// + /// Description for Gets the details of the user provided function app + /// registered with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetUserProvidedFunctionAppForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static + /// site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. + /// See example. + /// + /// + /// Specify <code>true</code> to force the update of the + /// auth configuration on the function app even if an + /// AzureStaticWebApps provider is already configured on the function + /// app. The default is <code>false</code>. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> RegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Detach the user provided function app from the static site + /// + /// + /// Description for Detach the user provided function app from the + /// static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DetachUserProvidedFunctionAppFromStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. + /// See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task CreateZipDeploymentForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new static site in an existing resource group, or updates + /// an existing static site. + /// + /// + /// Description for Creates a new static site in an existing resource + /// group, or updates an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a static site. + /// + /// + /// Description for Deletes a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a static site build. + /// + /// + /// Description for Deletes a static site build. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Register a user provided function app with a static site build + /// + /// + /// Description for Register a user provided function app with a static + /// site build + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. + /// See example. + /// + /// + /// Specify <code>true</code> to force the update of the + /// auth configuration on the function app even if an + /// AzureStaticWebApps provider is already configured on the function + /// app. The default is <code>false</code>. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deploys zipped content to a specific environment of a static site. + /// + /// + /// Description for Deploys zipped content to a specific environment of + /// a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. + /// See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginCreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new static site custom domain in an existing resource + /// group and static site. + /// + /// + /// Description for Creates a new static site custom domain in an + /// existing resource group and static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request + /// properties. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added + /// to a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request + /// properties. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static + /// site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. + /// See example. + /// + /// + /// Specify <code>true</code> to force the update of the + /// auth configuration on the function app even if an + /// AzureStaticWebApps provider is already configured on the function + /// app. The default is <code>false</code>. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginRegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. + /// See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginCreateZipDeploymentForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all Static Sites for a subscription. + /// + /// + /// Description for Get all Static Sites for a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all static sites in the specified resource group. + /// + /// + /// Description for Gets all static sites in the specified resource + /// group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetStaticSitesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of users of a static site. + /// + /// + /// Description for Gets the list of users of a static site. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListStaticSiteUsersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all static site builds for a particular static site. + /// + /// + /// Description for Gets all static site builds for a particular static + /// site. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetStaticSiteBuildsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the functions of a particular static site build. + /// + /// + /// Description for Gets the functions of a particular static site + /// build. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListStaticSiteBuildFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the details of the user provided function apps registered with + /// a static site build + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site build + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetUserProvidedFunctionAppsForStaticSiteBuildNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all static site custom domains for a particular static site. + /// + /// + /// Description for Gets all static site custom domains for a + /// particular static site. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListStaticSiteCustomDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the functions of a static site. + /// + /// + /// Description for Gets the functions of a static site. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -971,5 +2147,59 @@ public partial interface IStaticSitesOperations /// Thrown when a required parameter is null /// Task>> ListStaticSiteFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of private endpoint connections associated with a + /// static site + /// + /// + /// Description for Gets the list of private endpoint connections + /// associated with a static site + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the details of the user provided function apps registered with + /// a static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetUserProvidedFunctionAppsForStaticSiteNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebAppsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebAppsOperations.cs index 4cd486e4521f..1b54aedbd05c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebAppsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebAppsOperations.cs @@ -966,6 +966,125 @@ public partial interface IWebAppsOperations /// Task> GetBackupConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetAppSettingsKeyVaultReferencesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// App Setting key name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAppSettingKeyVaultReferenceWithHttpMessagesAsync(string resourceGroupName, string name, string appSettingKey, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetSiteConnectionStringKeyVaultReferencesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSiteConnectionStringKeyVaultReferenceWithHttpMessagesAsync(string resourceGroupName, string name, string connectionStringKey, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Replaces the connection strings of an app. /// /// @@ -3697,7 +3816,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a Swift Virtual Network connection from an app (or /// deployment slot). @@ -3726,47 +3845,6 @@ public partial interface IWebAppsOperations /// Task DeleteSwiftVirtualNetworkWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Integrates this Web App with a Virtual Network. This requires that - /// 1) "swiftSupported" is true when doing a GET against this resource, - /// and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. - /// This requires that 1) "swiftSupported" is true when doing a GET - /// against this resource, and 2) that the target Subnet has already - /// been delegated, and is not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all network features used by the app (or deployment slot, if /// specified). /// @@ -3781,7 +3859,7 @@ public partial interface IWebAppsOperations /// Name of the app. /// /// - /// The type of view. This can either be "summary" or "detailed". + /// The type of view. Only "summary" is supported at this time. /// /// /// The headers that will be added to request. @@ -4340,19 +4418,18 @@ public partial interface IWebAppsOperations /// Task> PutPrivateAccessVnetWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get list of processes for a web site, or a deployment slot, or for - /// a specific scaled-out instance in a web site. + /// Gets the list of private endpoint connections associated with a + /// site /// /// - /// Description for Get list of processes for a web site, or a - /// deployment slot, or for a specific scaled-out instance in a web - /// site. + /// Description for Gets the list of private endpoint connections + /// associated with a site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. /// /// /// The headers that will be added to request. @@ -4369,23 +4446,21 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task>> ListProcessesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Gets a private endpoint connection /// /// - /// Description for Get process information by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. /// - /// - /// PID. + /// + /// Name of the private endpoint connection. /// /// /// The headers that will be added to request. @@ -4402,23 +4477,22 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> GetProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Terminate a process by its ID for a web site, or a deployment slot, - /// or specific scaled-out instance in a web site. + /// Approves or rejects a private endpoint connection /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. /// - /// - /// PID. + /// + /// + /// /// /// /// The headers that will be added to request. @@ -4429,26 +4503,26 @@ public partial interface IWebAppsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a memory dump of a process by its ID for a specific scaled-out - /// instance in a web site. + /// Deletes a private endpoint connection /// /// - /// Description for Get a memory dump of a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Deletes a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. /// - /// - /// PID. + /// /// /// /// The headers that will be added to request. @@ -4465,23 +4539,18 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> GetProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List module information for a process by its ID for a specific - /// scaled-out instance in a web site. + /// Gets the private link resources /// /// - /// Description for List module information for a process by its ID for - /// a specific scaled-out instance in a web site. + /// Description for Gets the private link resources /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the site. /// /// /// The headers that will be added to request. @@ -4498,14 +4567,15 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task>> ListProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Get list of processes for a web site, or a deployment slot, or for + /// a specific scaled-out instance in a web site. /// /// - /// Description for Get process information by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Get list of processes for a web site, or a + /// deployment slot, or for a specific scaled-out instance in a web + /// site. /// /// /// Name of the resource group to which the resource belongs. @@ -4513,12 +4583,6 @@ public partial interface IWebAppsOperations /// /// Site name. /// - /// - /// PID. - /// - /// - /// Module base address. - /// /// /// The headers that will be added to request. /// @@ -4534,14 +4598,14 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> GetProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListProcessesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List the threads in a process by its ID for a specific scaled-out + /// Get process information by its ID for a specific scaled-out /// instance in a web site. /// /// - /// Description for List the threads in a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Get process information by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -4567,19 +4631,23 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task>> ListProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get public certificates for an app or a deployment slot. + /// Terminate a process by its ID for a web site, or a deployment slot, + /// or specific scaled-out instance in a web site. /// /// - /// Description for Get public certificates for an app or a deployment - /// slot. + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. /// /// /// The headers that will be added to request. @@ -4590,20 +4658,181 @@ public partial interface IWebAppsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task>> ListPublicCertificatesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get the named public certificate for an app (or deployment slot, if - /// specified). + /// Get a memory dump of a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Get the named public certificate for an app (or - /// deployment slot, if specified). + /// Description for Get a memory dump of a process by its ID for a + /// specific scaled-out instance in a web site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// PID. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List module information for a process by its ID for a specific + /// scaled-out instance in a web site. + /// + /// + /// Description for List module information for a process by its ID for + /// a specific scaled-out instance in a web site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// PID. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get process information by its ID for a specific scaled-out + /// instance in a web site. + /// + /// + /// Description for Get process information by its ID for a specific + /// scaled-out instance in a web site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// PID. + /// + /// + /// Module base address. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List the threads in a process by its ID for a specific scaled-out + /// instance in a web site. + /// + /// + /// Description for List the threads in a process by its ID for a + /// specific scaled-out instance in a web site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// PID. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get public certificates for an app or a deployment slot. + /// + /// + /// Description for Get public certificates for an app or a deployment + /// slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListPublicCertificatesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the named public certificate for an app (or deployment slot, if + /// specified). + /// + /// + /// Description for Get the named public certificate for an app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -4999,36 +5228,6 @@ public partial interface IWebAppsOperations /// Task DeleteSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot - /// of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config - /// properties to override the source slot config. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task CopyProductionSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets an app's deployment slots. /// /// @@ -5147,9 +5346,8 @@ public partial interface IWebAppsOperations /// If true, web app metrics are also deleted. /// /// - /// Specify true if the App Service plan will be empty after app - /// deletion and you want to delete the empty App Service plan. By - /// default, the empty App Service plan is not deleted. + /// Specify false if you want to keep empty App Service plan. By + /// default, empty App Service plan is deleted. /// /// /// The headers that will be added to request. @@ -5488,6 +5686,165 @@ public partial interface IWebAppsOperations /// Task RestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Returns whether Scm basic auth is allowed and whether Ftp is + /// allowed for a given site. + /// + /// + /// Description for Returns whether Scm basic auth is allowed and + /// whether Ftp is allowed for a given site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetBasicPublishingCredentialsPoliciesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns whether FTP is allowed on the site or not. + /// + /// + /// Description for Returns whether FTP is allowed on the site or not. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetFtpAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates whether FTP is allowed on the site or not. + /// + /// + /// Description for Updates whether FTP is allowed on the site or not. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateFtpAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns whether Scm basic auth is allowed on the site or not. + /// + /// + /// Description for Returns whether Scm basic auth is allowed on the + /// site or not. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetScmAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates whether user publishing credentials are allowed on the site + /// or not. + /// + /// + /// Description for Updates whether user publishing credentials are + /// allowed on the site or not. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateScmAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// List the configurations of an app /// /// @@ -5591,20 +5948,161 @@ public partial interface IWebAppsOperations /// web app. /// /// - /// Description for Updates the Authentication / Authorization settings - /// associated with web app. + /// Description for Updates the Authentication / Authorization settings + /// associated with web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Auth settings associated with web app. + /// + /// + /// Name of web app slot. If not specified then will default to + /// production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the Authentication/Authorization settings of an app. + /// + /// + /// Description for Gets the Authentication/Authorization settings of + /// an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API + /// will get the settings for the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates site's Authentication / Authorization settings for apps via + /// the V2 format + /// + /// + /// Description for Updates site's Authentication / Authorization + /// settings for apps via the V2 format + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Auth settings associated with web app. + /// + /// + /// Name of web app slot. If not specified then will default to + /// production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets site's Authentication / Authorization settings for apps via + /// the V2 format + /// + /// + /// Description for Gets site's Authentication / Authorization settings + /// for apps via the V2 format + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API + /// will get the settings for the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates the Azure storage account configurations of an app. + /// + /// + /// Description for Updates the Azure storage account configurations of + /// an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Auth settings associated with web app. + /// + /// Azure storage accounts of the app. /// /// - /// Name of web app slot. If not specified then will default to + /// Name of the deployment slot. If a slot is not specified, the API + /// will update the Azure storage account configurations for the /// production slot. /// /// @@ -5622,13 +6120,13 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the Authentication/Authorization settings of an app. + /// Gets the Azure storage account configurations of an app. /// /// - /// Description for Gets the Authentication/Authorization settings of - /// an app. + /// Description for Gets the Azure storage account configurations of an + /// app. /// /// /// Name of the resource group to which the resource belongs. @@ -5638,7 +6136,8 @@ public partial interface IWebAppsOperations /// /// /// Name of the deployment slot. If a slot is not specified, the API - /// will get the settings for the production slot. + /// will update the Azure storage account configurations for the + /// production slot. /// /// /// The headers that will be added to request. @@ -5655,27 +6154,25 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> GetAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates site's Authentication / Authorization settings for apps via - /// the V2 format + /// Updates the backup configuration of an app. /// /// - /// Description for Updates site's Authentication / Authorization - /// settings for apps via the V2 format + /// Description for Updates the backup configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Auth settings associated with web app. + /// + /// Edited backup configuration. /// /// - /// Name of web app slot. If not specified then will default to - /// production slot. + /// Name of the deployment slot. If a slot is not specified, the API + /// will update the backup configuration for the production slot. /// /// /// The headers that will be added to request. @@ -5692,14 +6189,12 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets site's Authentication / Authorization settings for apps via - /// the V2 format + /// Deletes the backup configuration of an app. /// /// - /// Description for Gets site's Authentication / Authorization settings - /// for apps via the V2 format + /// Description for Deletes the backup configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -5709,7 +6204,7 @@ public partial interface IWebAppsOperations /// /// /// Name of the deployment slot. If a slot is not specified, the API - /// will get the settings for the production slot. + /// will delete the backup configuration for the production slot. /// /// /// The headers that will be added to request. @@ -5720,19 +6215,15 @@ public partial interface IWebAppsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> GetAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates the Azure storage account configurations of an app. + /// Gets the backup configuration of an app. /// /// - /// Description for Updates the Azure storage account configurations of - /// an app. + /// Description for Gets the backup configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -5740,13 +6231,9 @@ public partial interface IWebAppsOperations /// /// Name of the app. /// - /// - /// Azure storage accounts of the app. - /// /// /// Name of the deployment slot. If a slot is not specified, the API - /// will update the Azure storage account configurations for the - /// production slot. + /// will get the backup configuration for the production slot. /// /// /// The headers that will be added to request. @@ -5763,13 +6250,13 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the Azure storage account configurations of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Gets the Azure storage account configurations of an - /// app. + /// Description for Gets the config reference app settings and status + /// of an app /// /// /// Name of the resource group to which the resource belongs. @@ -5778,9 +6265,6 @@ public partial interface IWebAppsOperations /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API - /// will update the Azure storage account configurations for the - /// production slot. /// /// /// The headers that will be added to request. @@ -5797,12 +6281,12 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> ListAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetAppSettingsKeyVaultReferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates the backup configuration of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Updates the backup configuration of an app. + /// Description for Gets the config reference and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -5810,12 +6294,10 @@ public partial interface IWebAppsOperations /// /// Name of the app. /// - /// - /// Edited backup configuration. + /// + /// App Setting key name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API - /// will update the backup configuration for the production slot. /// /// /// The headers that will be added to request. @@ -5832,12 +6314,13 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetAppSettingKeyVaultReferenceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string appSettingKey, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the backup configuration of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Deletes the backup configuration of an app. + /// Description for Gets the config reference app settings and status + /// of an app /// /// /// Name of the resource group to which the resource belongs. @@ -5846,8 +6329,6 @@ public partial interface IWebAppsOperations /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API - /// will delete the backup configuration for the production slot. /// /// /// The headers that will be added to request. @@ -5858,15 +6339,18 @@ public partial interface IWebAppsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetSiteConnectionStringKeyVaultReferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the backup configuration of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Gets the backup configuration of an app. + /// Description for Gets the config reference and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -5874,9 +6358,9 @@ public partial interface IWebAppsOperations /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API - /// will get the backup configuration for the production slot. /// /// /// The headers that will be added to request. @@ -5893,7 +6377,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> GetBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetSiteConnectionStringKeyVaultReferenceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string connectionStringKey, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Replaces the connection strings of an app. /// @@ -8761,51 +9245,6 @@ public partial interface IWebAppsOperations /// Task> GetSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Integrates this Web App with a Virtual Network. This requires that - /// 1) "swiftSupported" is true when doing a GET against this resource, - /// and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. - /// This requires that 1) "swiftSupported" is true when doing a GET - /// against this resource, and 2) that the target Subnet has already - /// been delegated, and is not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API - /// will add or update connections for the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Deletes a Swift Virtual Network connection from an app (or /// deployment slot). /// @@ -8837,51 +9276,6 @@ public partial interface IWebAppsOperations /// Task DeleteSwiftVirtualNetworkSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Integrates this Web App with a Virtual Network. This requires that - /// 1) "swiftSupported" is true when doing a GET against this resource, - /// and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. - /// This requires that 1) "swiftSupported" is true when doing a GET - /// against this resource, and 2) that the target Subnet has already - /// been delegated, and is not - /// in use by another App Service Plan other than the one this App is - /// in. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API - /// will add or update connections for the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all network features used by the app (or deployment slot, if /// specified). /// @@ -8896,7 +9290,7 @@ public partial interface IWebAppsOperations /// Name of the app. /// /// - /// The type of view. This can either be "summary" or "detailed". + /// The type of view. Only "summary" is supported at this time. /// /// /// Name of the deployment slot. If a slot is not specified, the API @@ -9522,6 +9916,39 @@ public partial interface IWebAppsOperations /// Task> PutPrivateAccessVnetSlotWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the list of private endpoint connections associated with a + /// site + /// + /// + /// Description for Gets the list of private endpoint connections + /// associated with a site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// Name of the site deployment slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a private endpoint connection /// /// @@ -9534,6 +9961,10 @@ public partial interface IWebAppsOperations /// Name of the site. /// /// + /// Name of the private endpoint connection. + /// + /// + /// Name of the site deployment slot. /// /// /// The headers that will be added to request. @@ -9550,7 +9981,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Approves or rejects a private endpoint connection /// @@ -9567,6 +9998,8 @@ public partial interface IWebAppsOperations /// /// /// + /// + /// /// /// The headers that will be added to request. /// @@ -9582,7 +10015,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a private endpoint connection /// @@ -9597,6 +10030,8 @@ public partial interface IWebAppsOperations /// /// /// + /// + /// /// /// The headers that will be added to request. /// @@ -9612,7 +10047,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the private link resources /// @@ -9625,6 +10060,8 @@ public partial interface IWebAppsOperations /// /// Name of the site. /// + /// + /// /// /// The headers that will be added to request. /// @@ -9640,7 +10077,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetPrivateLinkResourcesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get list of processes for a web site, or a deployment slot, or for /// a specific scaled-out instance in a web site. @@ -10367,43 +10804,9 @@ public partial interface IWebAppsOperations /// /// Site extension name. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API - /// deletes a deployment for the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot - /// of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config - /// properties to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production - /// slot is used as the source slot. + /// + /// Name of the deployment slot. If a slot is not specified, the API + /// deletes a deployment for the production slot. /// /// /// The headers that will be added to request. @@ -10417,7 +10820,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task CopySlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the difference in configuration settings between two web app /// slots. @@ -10635,6 +11038,8 @@ public partial interface IWebAppsOperations /// will delete the source control configuration for the production /// slot. /// + /// + /// /// /// The headers that will be added to request. /// @@ -10647,7 +11052,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task DeleteSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string additionalFlags = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the source control configuration of an app. /// @@ -11695,6 +12100,8 @@ public partial interface IWebAppsOperations /// /// Name of the app. /// + /// + /// /// /// The headers that will be added to request. /// @@ -11707,7 +12114,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task DeleteSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, string additionalFlags = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the source control configuration of an app. /// @@ -12769,6 +13176,68 @@ public partial interface IWebAppsOperations /// Task>> BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Restores an app from a backup blob in Azure Storage. /// /// @@ -12887,36 +13356,6 @@ public partial interface IWebAppsOperations /// Task> BeginInstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot - /// of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config - /// properties to override the source slot config. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginCopyProductionSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Creates a new web, mobile, or API app in an existing resource /// group, or updates an existing app. /// @@ -13189,6 +13628,8 @@ public partial interface IWebAppsOperations /// /// /// + /// + /// /// /// The headers that will be added to request. /// @@ -13204,7 +13645,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a private endpoint connection /// @@ -13219,6 +13660,8 @@ public partial interface IWebAppsOperations /// /// /// + /// + /// /// /// The headers that will be added to request. /// @@ -13234,7 +13677,7 @@ public partial interface IWebAppsOperations /// /// Thrown when a required parameter is null /// - Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Restores an app from a backup blob in Azure Storage. /// @@ -13370,40 +13813,6 @@ public partial interface IWebAppsOperations /// Task> BeginInstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot - /// of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config - /// properties to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production - /// slot is used as the source slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginCopySlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Swaps two deployment slots of an app. /// /// @@ -13709,6 +14118,58 @@ public partial interface IWebAppsOperations /// Task>> ListConfigurationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetAppSettingsKeyVaultReferencesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetSiteConnectionStringKeyVaultReferencesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a list of web app configuration snapshots identifiers. Each /// element of the list contains a timestamp and the ID of the /// snapshot. @@ -14024,6 +14485,33 @@ public partial interface IWebAppsOperations /// Task>> ListPerfMonCountersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the list of private endpoint connections associated with a + /// site + /// + /// + /// Description for Gets the list of private endpoint connections + /// associated with a site + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get list of processes for a web site, or a deployment slot, or for /// a specific scaled-out instance in a web site. /// @@ -14233,6 +14721,58 @@ public partial interface IWebAppsOperations /// Task>> ListConfigurationsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetAppSettingsKeyVaultReferencesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status + /// of an app + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetSiteConnectionStringKeyVaultReferencesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a list of web app configuration snapshots identifiers. Each /// element of the list contains a timestamp and the ID of the /// snapshot. @@ -14548,6 +15088,33 @@ public partial interface IWebAppsOperations /// Task>> ListPerfMonCountersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the list of private endpoint connections associated with a + /// site + /// + /// + /// Description for Gets the list of private endpoint connections + /// associated with a site + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> GetPrivateEndpointConnectionListSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get list of processes for a web site, or a deployment slot, or for /// a specific scaled-out instance in a web site. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs index 3481e85ddd9b..2c6b10eea2a4 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/IWebSiteManagementClient.cs @@ -79,6 +79,11 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// IAppServiceCertificateOrdersOperations AppServiceCertificateOrders { get; } + /// + /// Gets the ICertificateOrdersDiagnosticsOperations. + /// + ICertificateOrdersDiagnosticsOperations CertificateOrdersDiagnostics { get; } + /// /// Gets the ICertificateRegistrationProviderOperations. /// @@ -114,6 +119,11 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// IDiagnosticsOperations Diagnostics { get; } + /// + /// Gets the IGlobalModelOperations. + /// + IGlobalModelOperations GlobalModel { get; } + /// /// Gets the IProviderOperations. /// @@ -149,6 +159,27 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// IResourceHealthMetadataOperations ResourceHealthMetadata { get; } + /// + /// Exchange code for GitHub access token for AppService CLI + /// + /// + /// Description for Exchange code for GitHub access token for + /// AppService CLI + /// + /// + /// Code string to exchange for Github Access token + /// + /// + /// State string used for verification. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GenerateGithubAccessTokenForAppserviceCLIAsyncWithHttpMessagesAsync(string code, string state, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets publishing user /// @@ -302,7 +333,8 @@ public partial interface IWebSiteManagementClient : System.IDisposable /// /// Name of SKU used to filter the regions. Possible values include: /// 'Free', 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', - /// 'Isolated', 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' + /// 'Isolated', 'IsolatedV2', 'PremiumV2', 'PremiumV3', + /// 'PremiumContainer', 'ElasticPremium', 'ElasticIsolated' /// /// /// Specify <code>true</code> if you want to filter to only diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AccessControlEntryAction.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AccessControlEntryAction.cs deleted file mode 100644 index d9b41f1ca064..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AccessControlEntryAction.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for AccessControlEntryAction. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum AccessControlEntryAction - { - [EnumMember(Value = "Permit")] - Permit, - [EnumMember(Value = "Deny")] - Deny - } - internal static class AccessControlEntryActionEnumExtension - { - internal static string ToSerializedValue(this AccessControlEntryAction? value) - { - return value == null ? null : ((AccessControlEntryAction)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this AccessControlEntryAction value) - { - switch( value ) - { - case AccessControlEntryAction.Permit: - return "Permit"; - case AccessControlEntryAction.Deny: - return "Deny"; - } - return null; - } - - internal static AccessControlEntryAction? ParseAccessControlEntryAction(this string value) - { - switch( value ) - { - case "Permit": - return AccessControlEntryAction.Permit; - case "Deny": - return AccessControlEntryAction.Deny; - } - return null; - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs new file mode 100644 index 000000000000..bfd067ed6a02 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApiKVReference.cs @@ -0,0 +1,117 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Description of site key vault references. + /// + [Rest.Serialization.JsonTransformation] + public partial class ApiKVReference : ProxyOnlyResource + { + /// + /// Initializes a new instance of the ApiKVReference class. + /// + public ApiKVReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiKVReference class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Possible values include: 'Initialized', + /// 'Resolved', 'InvalidSyntax', 'MSINotEnabled', 'VaultNotFound', + /// 'SecretNotFound', 'SecretVersionNotFound', + /// 'AccessToKeyVaultDenied', 'OtherReasons', 'FetchTimedOut', + /// 'UnauthorizedClient' + /// Possible values include: 'KeyVault' + public ApiKVReference(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string reference = default(string), ResolveStatus? status = default(ResolveStatus?), string vaultName = default(string), string secretName = default(string), string secretVersion = default(string), ManagedServiceIdentity identityType = default(ManagedServiceIdentity), string details = default(string), ConfigReferenceSource? source = default(ConfigReferenceSource?), string activeVersion = default(string)) + : base(id, name, kind, type) + { + Reference = reference; + Status = status; + VaultName = vaultName; + SecretName = secretName; + SecretVersion = secretVersion; + IdentityType = identityType; + Details = details; + Source = source; + ActiveVersion = activeVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.reference")] + public string Reference { get; set; } + + /// + /// Gets or sets possible values include: 'Initialized', 'Resolved', + /// 'InvalidSyntax', 'MSINotEnabled', 'VaultNotFound', + /// 'SecretNotFound', 'SecretVersionNotFound', + /// 'AccessToKeyVaultDenied', 'OtherReasons', 'FetchTimedOut', + /// 'UnauthorizedClient' + /// + [JsonProperty(PropertyName = "properties.status")] + public ResolveStatus? Status { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.vaultName")] + public string VaultName { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.secretName")] + public string SecretName { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.secretVersion")] + public string SecretVersion { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.identityType")] + public ManagedServiceIdentity IdentityType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.details")] + public string Details { get; set; } + + /// + /// Gets or sets possible values include: 'KeyVault' + /// + [JsonProperty(PropertyName = "properties.source")] + public ConfigReferenceSource? Source { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.activeVersion")] + public string ActiveVersion { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.cs new file mode 100644 index 000000000000..ba4ae64ca04e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppInsightsWebAppStackSettings.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// App Insights Web App stack settings. + /// + public partial class AppInsightsWebAppStackSettings + { + /// + /// Initializes a new instance of the AppInsightsWebAppStackSettings + /// class. + /// + public AppInsightsWebAppStackSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AppInsightsWebAppStackSettings + /// class. + /// + /// <code>true</code> if remote + /// Application Insights is supported for the stack; otherwise, + /// <code>false</code>. + /// <code>true</code> if + /// Application Insights is disabled by default for the stack; + /// otherwise, <code>false</code>. + public AppInsightsWebAppStackSettings(bool? isSupported = default(bool?), bool? isDefaultOff = default(bool?)) + { + IsSupported = isSupported; + IsDefaultOff = isDefaultOff; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if remote + /// Application Insights is supported for the stack; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isSupported")] + public bool? IsSupported { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if Application + /// Insights is disabled by default for the stack; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDefaultOff")] + public bool? IsDefaultOff { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.cs index a1e6ff47661a..ded5ddc3c77c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppRegistration.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the app registration for providers that + /// have app ids and app secrets + /// [Rest.Serialization.JsonTransformation] public partial class AppRegistration : ProxyOnlyResource { @@ -33,6 +37,9 @@ public AppRegistration() /// Resource Name. /// Kind of resource. /// Resource type. + /// The App ID of the app used for login. + /// The app setting name that + /// contains the app secret. public AppRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string appId = default(string), string appSecretSettingName = default(string)) : base(id, name, kind, type) { @@ -47,11 +54,13 @@ public AppRegistration() partial void CustomInit(); /// + /// Gets or sets the App ID of the app used for login. /// [JsonProperty(PropertyName = "properties.appId")] public string AppId { get; set; } /// + /// Gets or sets the app setting name that contains the app secret. /// [JsonProperty(PropertyName = "properties.appSecretSettingName")] public string AppSecretSettingName { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs index fba67b6ee17a..aee5531d6910 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrder.cs @@ -48,8 +48,8 @@ public AppServiceCertificateOrder() /// name. /// Domain verification /// token. - /// Duration in years (must be between 1 - /// and 3). + /// Duration in years (must be + /// 1). /// Certificate key size. /// <code>true</code> if the /// certificate should be automatically renewed when it expires; @@ -78,7 +78,8 @@ public AppServiceCertificateOrder() /// moment. /// Time stamp when the /// certificate would be auto renewed next - public AppServiceCertificateOrder(string location, CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?)) + /// Contact info + public AppServiceCertificateOrder(string location, CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?), CertificateOrderContact contact = default(CertificateOrderContact)) : base(location, id, name, kind, type, tags) { Certificates = certificates; @@ -100,6 +101,7 @@ public AppServiceCertificateOrder() IsPrivateKeyExternal = isPrivateKeyExternal; AppServiceCertificateNotRenewableReasons = appServiceCertificateNotRenewableReasons; NextAutoRenewalTimeStamp = nextAutoRenewalTimeStamp; + Contact = contact; CustomInit(); } @@ -127,7 +129,7 @@ public AppServiceCertificateOrder() public string DomainVerificationToken { get; private set; } /// - /// Gets or sets duration in years (must be between 1 and 3). + /// Gets or sets duration in years (must be 1). /// [JsonProperty(PropertyName = "properties.validityInYears")] public int? ValidityInYears { get; set; } @@ -232,6 +234,12 @@ public AppServiceCertificateOrder() [JsonProperty(PropertyName = "properties.nextAutoRenewalTimeStamp")] public System.DateTime? NextAutoRenewalTimeStamp { get; private set; } + /// + /// Gets contact info + /// + [JsonProperty(PropertyName = "properties.contact")] + public CertificateOrderContact Contact { get; private set; } + /// /// Validate the object. /// @@ -241,14 +249,6 @@ public AppServiceCertificateOrder() public override void Validate() { base.Validate(); - if (ValidityInYears > 3) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ValidityInYears", 3); - } - if (ValidityInYears < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ValidityInYears", 1); - } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs index a9284452f4d4..0badb4580486 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceCertificateOrderPatchResource.cs @@ -48,8 +48,8 @@ public AppServiceCertificateOrderPatchResource() /// name. /// Domain verification /// token. - /// Duration in years (must be between 1 - /// and 3). + /// Duration in years (must be + /// 1). /// Certificate key size. /// <code>true</code> if the /// certificate should be automatically renewed when it expires; @@ -78,7 +78,8 @@ public AppServiceCertificateOrderPatchResource() /// moment. /// Time stamp when the /// certificate would be auto renewed next - public AppServiceCertificateOrderPatchResource(CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?)) + /// Contact info + public AppServiceCertificateOrderPatchResource(CertificateProductType productType, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary certificates = default(IDictionary), string distinguishedName = default(string), string domainVerificationToken = default(string), int? validityInYears = default(int?), int? keySize = default(int?), bool? autoRenew = default(bool?), ProvisioningState? provisioningState = default(ProvisioningState?), CertificateOrderStatus? status = default(CertificateOrderStatus?), CertificateDetails signedCertificate = default(CertificateDetails), string csr = default(string), CertificateDetails intermediate = default(CertificateDetails), CertificateDetails root = default(CertificateDetails), string serialNumber = default(string), System.DateTime? lastCertificateIssuanceTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), bool? isPrivateKeyExternal = default(bool?), IList appServiceCertificateNotRenewableReasons = default(IList), System.DateTime? nextAutoRenewalTimeStamp = default(System.DateTime?), CertificateOrderContact contact = default(CertificateOrderContact)) : base(id, name, kind, type) { Certificates = certificates; @@ -100,6 +101,7 @@ public AppServiceCertificateOrderPatchResource() IsPrivateKeyExternal = isPrivateKeyExternal; AppServiceCertificateNotRenewableReasons = appServiceCertificateNotRenewableReasons; NextAutoRenewalTimeStamp = nextAutoRenewalTimeStamp; + Contact = contact; CustomInit(); } @@ -127,7 +129,7 @@ public AppServiceCertificateOrderPatchResource() public string DomainVerificationToken { get; private set; } /// - /// Gets or sets duration in years (must be between 1 and 3). + /// Gets or sets duration in years (must be 1). /// [JsonProperty(PropertyName = "properties.validityInYears")] public int? ValidityInYears { get; set; } @@ -232,6 +234,12 @@ public AppServiceCertificateOrderPatchResource() [JsonProperty(PropertyName = "properties.nextAutoRenewalTimeStamp")] public System.DateTime? NextAutoRenewalTimeStamp { get; private set; } + /// + /// Gets contact info + /// + [JsonProperty(PropertyName = "properties.contact")] + public CertificateOrderContact Contact { get; private set; } + /// /// Validate the object. /// @@ -240,14 +248,6 @@ public AppServiceCertificateOrderPatchResource() /// public virtual void Validate() { - if (ValidityInYears > 3) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ValidityInYears", 3); - } - if (ValidityInYears < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ValidityInYears", 1); - } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs index d7562b769f24..312d9255fffd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironment.cs @@ -32,132 +32,58 @@ public AppServiceEnvironment() /// /// Initializes a new instance of the AppServiceEnvironment class. /// - /// Name of the App Service Environment. - /// Location of the App Service Environment, - /// e.g. "West US". /// Description of the Virtual /// Network. - /// Description of worker pools with worker - /// size IDs, VM sizes, and number of workers in each pool. /// Provisioning state of the App /// Service Environment. Possible values include: 'Succeeded', /// 'Failed', 'Canceled', 'InProgress', 'Deleting' /// Current status of the App Service Environment. /// Possible values include: 'Preparing', 'Ready', 'Scaling', /// 'Deleting' - /// Name of the Virtual Network for the App - /// Service Environment. - /// Resource group of the Virtual - /// Network. - /// Subnet of the Virtual Network. /// Specifies which endpoints /// to serve internally in the Virtual Network for the App Service /// Environment. Possible values include: 'None', 'Web', 'Publishing', - /// 'Web,Publishing' + /// 'Web, Publishing' /// Front-end VM size, e.g. "Medium", /// "Large". /// Number of front-end instances. /// Number of IP SSL addresses reserved /// for the App Service Environment. - /// Edition of the metadata database for - /// the App Service Environment, e.g. "Standard". - /// Service objective of the - /// metadata database for the App Service Environment, e.g. - /// "S0". - /// Number of upgrade domains of the App - /// Service Environment. - /// Subscription of the App Service - /// Environment. /// DNS suffix of the App Service /// Environment. - /// Last deployment action on the App Service - /// Environment. - /// Result of the last deployment action - /// on the App Service Environment. - /// List of comma separated strings - /// describing which VM sizes are allowed for front-ends. - /// List of comma separated strings - /// describing which VM sizes are allowed for workers. /// Maximum number of VMs in the /// App Service Environment. - /// Description of IP SSL mapping for the App - /// Service Environment. - /// Current total, used, and - /// available worker capacities. - /// Access control list for - /// controlling traffic to the App Service Environment. - /// True/false indicating whether - /// the App Service Environment is healthy. - /// Detailed message about with results - /// of the last check of the App Service Environment. - /// Resource group of the App Service - /// Environment. /// Scale factor for /// front-ends. - /// Default Scale Factor for - /// FrontEnds. - /// API Management Account - /// associated with the App Service Environment. /// <code>true</code> if the App /// Service Environment is suspended; otherwise, /// <code>false</code>. The environment can be suspended, /// e.g. when the management endpoint is no longer available /// (most likely because NSG blocked the incoming traffic). - /// True/false indicating whether the - /// App Service Environment is suspended. The environment can be - /// suspended e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). /// Custom settings for changing the /// behavior of the App Service Environment. /// User added ip ranges to /// whitelist on ASE db /// Flag that displays whether an ASE has /// linux workers or not - /// Key Vault ID for ILB App Service - /// Environment default SSL certificate - /// Key Vault Secret Name for - /// ILB App Service Environment default SSL certificate - public AppServiceEnvironment(string name, string location, VirtualNetworkProfile virtualNetwork, IList workerPools, ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) + /// Dedicated Host Count + public AppServiceEnvironment(VirtualNetworkProfile virtualNetwork, ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string dnsSuffix = default(string), int? maximumNumberOfMachines = default(int?), int? frontEndScaleFactor = default(int?), bool? suspended = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), int? dedicatedHostCount = default(int?)) { - Name = name; - Location = location; ProvisioningState = provisioningState; Status = status; - VnetName = vnetName; - VnetResourceGroupName = vnetResourceGroupName; - VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; - WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; - DatabaseEdition = databaseEdition; - DatabaseServiceObjective = databaseServiceObjective; - UpgradeDomains = upgradeDomains; - SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; - LastAction = lastAction; - LastActionResult = lastActionResult; - AllowedMultiSizes = allowedMultiSizes; - AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; - VipMappings = vipMappings; - EnvironmentCapacities = environmentCapacities; - NetworkAccessControlList = networkAccessControlList; - EnvironmentIsHealthy = environmentIsHealthy; - EnvironmentStatus = environmentStatus; - ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; - DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; - ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; - DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - SslCertKeyVaultId = sslCertKeyVaultId; - SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; + DedicatedHostCount = dedicatedHostCount; CustomInit(); } @@ -166,19 +92,6 @@ public AppServiceEnvironment() /// partial void CustomInit(); - /// - /// Gets or sets name of the App Service Environment. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets location of the App Service Environment, e.g. "West - /// US". - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - /// /// Gets provisioning state of the App Service Environment. Possible /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', @@ -194,25 +107,6 @@ public AppServiceEnvironment() [JsonProperty(PropertyName = "status")] public HostingEnvironmentStatus? Status { get; private set; } - /// - /// Gets or sets name of the Virtual Network for the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "vnetName")] - public string VnetName { get; set; } - - /// - /// Gets or sets resource group of the Virtual Network. - /// - [JsonProperty(PropertyName = "vnetResourceGroupName")] - public string VnetResourceGroupName { get; set; } - - /// - /// Gets or sets subnet of the Virtual Network. - /// - [JsonProperty(PropertyName = "vnetSubnetName")] - public string VnetSubnetName { get; set; } - /// /// Gets or sets description of the Virtual Network. /// @@ -222,7 +116,7 @@ public AppServiceEnvironment() /// /// Gets or sets specifies which endpoints to serve internally in the /// Virtual Network for the App Service Environment. Possible values - /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' + /// include: 'None', 'Web', 'Publishing', 'Web, Publishing' /// [JsonProperty(PropertyName = "internalLoadBalancingMode")] public string InternalLoadBalancingMode { get; set; } @@ -234,17 +128,10 @@ public AppServiceEnvironment() public string MultiSize { get; set; } /// - /// Gets or sets number of front-end instances. + /// Gets number of front-end instances. /// [JsonProperty(PropertyName = "multiRoleCount")] - public int? MultiRoleCount { get; set; } - - /// - /// Gets or sets description of worker pools with worker size IDs, VM - /// sizes, and number of workers in each pool. - /// - [JsonProperty(PropertyName = "workerPools")] - public IList WorkerPools { get; set; } + public int? MultiRoleCount { get; private set; } /// /// Gets or sets number of IP SSL addresses reserved for the App @@ -253,110 +140,18 @@ public AppServiceEnvironment() [JsonProperty(PropertyName = "ipsslAddressCount")] public int? IpsslAddressCount { get; set; } - /// - /// Gets edition of the metadata database for the App Service - /// Environment, e.g. "Standard". - /// - [JsonProperty(PropertyName = "databaseEdition")] - public string DatabaseEdition { get; private set; } - - /// - /// Gets service objective of the metadata database for the App Service - /// Environment, e.g. "S0". - /// - [JsonProperty(PropertyName = "databaseServiceObjective")] - public string DatabaseServiceObjective { get; private set; } - - /// - /// Gets number of upgrade domains of the App Service Environment. - /// - [JsonProperty(PropertyName = "upgradeDomains")] - public int? UpgradeDomains { get; private set; } - - /// - /// Gets subscription of the App Service Environment. - /// - [JsonProperty(PropertyName = "subscriptionId")] - public string SubscriptionId { get; private set; } - /// /// Gets or sets DNS suffix of the App Service Environment. /// [JsonProperty(PropertyName = "dnsSuffix")] public string DnsSuffix { get; set; } - /// - /// Gets last deployment action on the App Service Environment. - /// - [JsonProperty(PropertyName = "lastAction")] - public string LastAction { get; private set; } - - /// - /// Gets result of the last deployment action on the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "lastActionResult")] - public string LastActionResult { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for front-ends. - /// - [JsonProperty(PropertyName = "allowedMultiSizes")] - public string AllowedMultiSizes { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for workers. - /// - [JsonProperty(PropertyName = "allowedWorkerSizes")] - public string AllowedWorkerSizes { get; private set; } - /// /// Gets maximum number of VMs in the App Service Environment. /// [JsonProperty(PropertyName = "maximumNumberOfMachines")] public int? MaximumNumberOfMachines { get; private set; } - /// - /// Gets description of IP SSL mapping for the App Service Environment. - /// - [JsonProperty(PropertyName = "vipMappings")] - public IList VipMappings { get; private set; } - - /// - /// Gets current total, used, and available worker capacities. - /// - [JsonProperty(PropertyName = "environmentCapacities")] - public IList EnvironmentCapacities { get; private set; } - - /// - /// Gets or sets access control list for controlling traffic to the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "networkAccessControlList")] - public IList NetworkAccessControlList { get; set; } - - /// - /// Gets true/false indicating whether the App Service Environment is - /// healthy. - /// - [JsonProperty(PropertyName = "environmentIsHealthy")] - public bool? EnvironmentIsHealthy { get; private set; } - - /// - /// Gets detailed message about with results of the last check of the - /// App Service Environment. - /// - [JsonProperty(PropertyName = "environmentStatus")] - public string EnvironmentStatus { get; private set; } - - /// - /// Gets resource group of the App Service Environment. - /// - [JsonProperty(PropertyName = "resourceGroup")] - public string ResourceGroup { get; private set; } - /// /// Gets or sets scale factor for front-ends. /// @@ -364,37 +159,15 @@ public AppServiceEnvironment() public int? FrontEndScaleFactor { get; set; } /// - /// Gets default Scale Factor for FrontEnds. - /// - [JsonProperty(PropertyName = "defaultFrontEndScaleFactor")] - public int? DefaultFrontEndScaleFactor { get; private set; } - - /// - /// Gets or sets API Management Account associated with the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "apiManagementAccountId")] - public string ApiManagementAccountId { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// App Service Environment is suspended; otherwise, + /// Gets &lt;code&gt;true&lt;/code&gt; if the App + /// Service Environment is suspended; otherwise, /// &lt;code&gt;false&lt;/code&gt;. The environment can /// be suspended, e.g. when the management endpoint is no longer /// available /// (most likely because NSG blocked the incoming traffic). /// [JsonProperty(PropertyName = "suspended")] - public bool? Suspended { get; set; } - - /// - /// Gets or sets true/false indicating whether the App Service - /// Environment is suspended. The environment can be suspended e.g. - /// when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - [JsonProperty(PropertyName = "dynamicCacheEnabled")] - public bool? DynamicCacheEnabled { get; set; } + public bool? Suspended { get; private set; } /// /// Gets or sets custom settings for changing the behavior of the App @@ -410,25 +183,16 @@ public AppServiceEnvironment() public IList UserWhitelistedIpRanges { get; set; } /// - /// Gets or sets flag that displays whether an ASE has linux workers or - /// not + /// Gets flag that displays whether an ASE has linux workers or not /// [JsonProperty(PropertyName = "hasLinuxWorkers")] - public bool? HasLinuxWorkers { get; set; } - - /// - /// Gets or sets key Vault ID for ILB App Service Environment default - /// SSL certificate - /// - [JsonProperty(PropertyName = "sslCertKeyVaultId")] - public string SslCertKeyVaultId { get; set; } + public bool? HasLinuxWorkers { get; private set; } /// - /// Gets or sets key Vault Secret Name for ILB App Service Environment - /// default SSL certificate + /// Gets dedicated Host Count /// - [JsonProperty(PropertyName = "sslCertKeyVaultSecretName")] - public string SslCertKeyVaultSecretName { get; set; } + [JsonProperty(PropertyName = "dedicatedHostCount")] + public int? DedicatedHostCount { get; private set; } /// /// Validate the object. @@ -438,21 +202,13 @@ public AppServiceEnvironment() /// public virtual void Validate() { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } if (VirtualNetwork == null) { throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); } - if (WorkerPools == null) + if (VirtualNetwork != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); + VirtualNetwork.Validate(); } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs index bf9e55680b03..724562c731b2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentPatchResource.cs @@ -36,14 +36,8 @@ public AppServiceEnvironmentPatchResource() /// Initializes a new instance of the /// AppServiceEnvironmentPatchResource class. /// - /// Name of the - /// App Service Environment. - /// Location of the App Service Environment, - /// e.g. "West US". /// Description of the Virtual /// Network. - /// Description of worker pools with worker - /// size IDs, VM sizes, and number of workers in each pool. /// Resource Id. /// Resource Name. /// Kind of resource. @@ -54,120 +48,51 @@ public AppServiceEnvironmentPatchResource() /// Current status of the App Service Environment. /// Possible values include: 'Preparing', 'Ready', 'Scaling', /// 'Deleting' - /// Name of the Virtual Network for the App - /// Service Environment. - /// Resource group of the Virtual - /// Network. - /// Subnet of the Virtual Network. /// Specifies which endpoints /// to serve internally in the Virtual Network for the App Service /// Environment. Possible values include: 'None', 'Web', 'Publishing', - /// 'Web,Publishing' + /// 'Web, Publishing' /// Front-end VM size, e.g. "Medium", /// "Large". /// Number of front-end instances. /// Number of IP SSL addresses reserved /// for the App Service Environment. - /// Edition of the metadata database for - /// the App Service Environment, e.g. "Standard". - /// Service objective of the - /// metadata database for the App Service Environment, e.g. - /// "S0". - /// Number of upgrade domains of the App - /// Service Environment. - /// Subscription of the App Service - /// Environment. /// DNS suffix of the App Service /// Environment. - /// Last deployment action on the App Service - /// Environment. - /// Result of the last deployment action - /// on the App Service Environment. - /// List of comma separated strings - /// describing which VM sizes are allowed for front-ends. - /// List of comma separated strings - /// describing which VM sizes are allowed for workers. /// Maximum number of VMs in the /// App Service Environment. - /// Description of IP SSL mapping for the App - /// Service Environment. - /// Current total, used, and - /// available worker capacities. - /// Access control list for - /// controlling traffic to the App Service Environment. - /// True/false indicating whether - /// the App Service Environment is healthy. - /// Detailed message about with results - /// of the last check of the App Service Environment. - /// Resource group of the App Service - /// Environment. /// Scale factor for /// front-ends. - /// Default Scale Factor for - /// FrontEnds. - /// API Management Account - /// associated with the App Service Environment. /// <code>true</code> if the App /// Service Environment is suspended; otherwise, /// <code>false</code>. The environment can be suspended, /// e.g. when the management endpoint is no longer available /// (most likely because NSG blocked the incoming traffic). - /// True/false indicating whether the - /// App Service Environment is suspended. The environment can be - /// suspended e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). /// Custom settings for changing the /// behavior of the App Service Environment. /// User added ip ranges to /// whitelist on ASE db /// Flag that displays whether an ASE has /// linux workers or not - /// Key Vault ID for ILB App Service - /// Environment default SSL certificate - /// Key Vault Secret Name for - /// ILB App Service Environment default SSL certificate - public AppServiceEnvironmentPatchResource(string appServiceEnvironmentPatchResourceName, string location, VirtualNetworkProfile virtualNetwork, IList workerPools, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) + /// Dedicated Host Count + public AppServiceEnvironmentPatchResource(VirtualNetworkProfile virtualNetwork, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string dnsSuffix = default(string), int? maximumNumberOfMachines = default(int?), int? frontEndScaleFactor = default(int?), bool? suspended = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), int? dedicatedHostCount = default(int?)) : base(id, name, kind, type) { - AppServiceEnvironmentPatchResourceName = appServiceEnvironmentPatchResourceName; - Location = location; ProvisioningState = provisioningState; Status = status; - VnetName = vnetName; - VnetResourceGroupName = vnetResourceGroupName; - VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; - WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; - DatabaseEdition = databaseEdition; - DatabaseServiceObjective = databaseServiceObjective; - UpgradeDomains = upgradeDomains; - SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; - LastAction = lastAction; - LastActionResult = lastActionResult; - AllowedMultiSizes = allowedMultiSizes; - AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; - VipMappings = vipMappings; - EnvironmentCapacities = environmentCapacities; - NetworkAccessControlList = networkAccessControlList; - EnvironmentIsHealthy = environmentIsHealthy; - EnvironmentStatus = environmentStatus; - ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; - DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; - ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; - DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - SslCertKeyVaultId = sslCertKeyVaultId; - SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; + DedicatedHostCount = dedicatedHostCount; CustomInit(); } @@ -176,19 +101,6 @@ public AppServiceEnvironmentPatchResource() /// partial void CustomInit(); - /// - /// Gets or sets name of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.name")] - public string AppServiceEnvironmentPatchResourceName { get; set; } - - /// - /// Gets or sets location of the App Service Environment, e.g. "West - /// US". - /// - [JsonProperty(PropertyName = "properties.location")] - public string Location { get; set; } - /// /// Gets provisioning state of the App Service Environment. Possible /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', @@ -204,25 +116,6 @@ public AppServiceEnvironmentPatchResource() [JsonProperty(PropertyName = "properties.status")] public HostingEnvironmentStatus? Status { get; private set; } - /// - /// Gets or sets name of the Virtual Network for the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.vnetName")] - public string VnetName { get; set; } - - /// - /// Gets or sets resource group of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.vnetResourceGroupName")] - public string VnetResourceGroupName { get; set; } - - /// - /// Gets or sets subnet of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.vnetSubnetName")] - public string VnetSubnetName { get; set; } - /// /// Gets or sets description of the Virtual Network. /// @@ -232,7 +125,7 @@ public AppServiceEnvironmentPatchResource() /// /// Gets or sets specifies which endpoints to serve internally in the /// Virtual Network for the App Service Environment. Possible values - /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' + /// include: 'None', 'Web', 'Publishing', 'Web, Publishing' /// [JsonProperty(PropertyName = "properties.internalLoadBalancingMode")] public string InternalLoadBalancingMode { get; set; } @@ -244,17 +137,10 @@ public AppServiceEnvironmentPatchResource() public string MultiSize { get; set; } /// - /// Gets or sets number of front-end instances. + /// Gets number of front-end instances. /// [JsonProperty(PropertyName = "properties.multiRoleCount")] - public int? MultiRoleCount { get; set; } - - /// - /// Gets or sets description of worker pools with worker size IDs, VM - /// sizes, and number of workers in each pool. - /// - [JsonProperty(PropertyName = "properties.workerPools")] - public IList WorkerPools { get; set; } + public int? MultiRoleCount { get; private set; } /// /// Gets or sets number of IP SSL addresses reserved for the App @@ -263,110 +149,18 @@ public AppServiceEnvironmentPatchResource() [JsonProperty(PropertyName = "properties.ipsslAddressCount")] public int? IpsslAddressCount { get; set; } - /// - /// Gets edition of the metadata database for the App Service - /// Environment, e.g. "Standard". - /// - [JsonProperty(PropertyName = "properties.databaseEdition")] - public string DatabaseEdition { get; private set; } - - /// - /// Gets service objective of the metadata database for the App Service - /// Environment, e.g. "S0". - /// - [JsonProperty(PropertyName = "properties.databaseServiceObjective")] - public string DatabaseServiceObjective { get; private set; } - - /// - /// Gets number of upgrade domains of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.upgradeDomains")] - public int? UpgradeDomains { get; private set; } - - /// - /// Gets subscription of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.subscriptionId")] - public string SubscriptionId { get; private set; } - /// /// Gets or sets DNS suffix of the App Service Environment. /// [JsonProperty(PropertyName = "properties.dnsSuffix")] public string DnsSuffix { get; set; } - /// - /// Gets last deployment action on the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.lastAction")] - public string LastAction { get; private set; } - - /// - /// Gets result of the last deployment action on the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.lastActionResult")] - public string LastActionResult { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for front-ends. - /// - [JsonProperty(PropertyName = "properties.allowedMultiSizes")] - public string AllowedMultiSizes { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for workers. - /// - [JsonProperty(PropertyName = "properties.allowedWorkerSizes")] - public string AllowedWorkerSizes { get; private set; } - /// /// Gets maximum number of VMs in the App Service Environment. /// [JsonProperty(PropertyName = "properties.maximumNumberOfMachines")] public int? MaximumNumberOfMachines { get; private set; } - /// - /// Gets description of IP SSL mapping for the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.vipMappings")] - public IList VipMappings { get; private set; } - - /// - /// Gets current total, used, and available worker capacities. - /// - [JsonProperty(PropertyName = "properties.environmentCapacities")] - public IList EnvironmentCapacities { get; private set; } - - /// - /// Gets or sets access control list for controlling traffic to the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "properties.networkAccessControlList")] - public IList NetworkAccessControlList { get; set; } - - /// - /// Gets true/false indicating whether the App Service Environment is - /// healthy. - /// - [JsonProperty(PropertyName = "properties.environmentIsHealthy")] - public bool? EnvironmentIsHealthy { get; private set; } - - /// - /// Gets detailed message about with results of the last check of the - /// App Service Environment. - /// - [JsonProperty(PropertyName = "properties.environmentStatus")] - public string EnvironmentStatus { get; private set; } - - /// - /// Gets resource group of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.resourceGroup")] - public string ResourceGroup { get; private set; } - /// /// Gets or sets scale factor for front-ends. /// @@ -374,37 +168,15 @@ public AppServiceEnvironmentPatchResource() public int? FrontEndScaleFactor { get; set; } /// - /// Gets default Scale Factor for FrontEnds. - /// - [JsonProperty(PropertyName = "properties.defaultFrontEndScaleFactor")] - public int? DefaultFrontEndScaleFactor { get; private set; } - - /// - /// Gets or sets API Management Account associated with the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.apiManagementAccountId")] - public string ApiManagementAccountId { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// App Service Environment is suspended; otherwise, + /// Gets &lt;code&gt;true&lt;/code&gt; if the App + /// Service Environment is suspended; otherwise, /// &lt;code&gt;false&lt;/code&gt;. The environment can /// be suspended, e.g. when the management endpoint is no longer /// available /// (most likely because NSG blocked the incoming traffic). /// [JsonProperty(PropertyName = "properties.suspended")] - public bool? Suspended { get; set; } - - /// - /// Gets or sets true/false indicating whether the App Service - /// Environment is suspended. The environment can be suspended e.g. - /// when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - [JsonProperty(PropertyName = "properties.dynamicCacheEnabled")] - public bool? DynamicCacheEnabled { get; set; } + public bool? Suspended { get; private set; } /// /// Gets or sets custom settings for changing the behavior of the App @@ -420,25 +192,16 @@ public AppServiceEnvironmentPatchResource() public IList UserWhitelistedIpRanges { get; set; } /// - /// Gets or sets flag that displays whether an ASE has linux workers or - /// not + /// Gets flag that displays whether an ASE has linux workers or not /// [JsonProperty(PropertyName = "properties.hasLinuxWorkers")] - public bool? HasLinuxWorkers { get; set; } - - /// - /// Gets or sets key Vault ID for ILB App Service Environment default - /// SSL certificate - /// - [JsonProperty(PropertyName = "properties.sslCertKeyVaultId")] - public string SslCertKeyVaultId { get; set; } + public bool? HasLinuxWorkers { get; private set; } /// - /// Gets or sets key Vault Secret Name for ILB App Service Environment - /// default SSL certificate + /// Gets dedicated Host Count /// - [JsonProperty(PropertyName = "properties.sslCertKeyVaultSecretName")] - public string SslCertKeyVaultSecretName { get; set; } + [JsonProperty(PropertyName = "properties.dedicatedHostCount")] + public int? DedicatedHostCount { get; private set; } /// /// Validate the object. @@ -448,21 +211,13 @@ public AppServiceEnvironmentPatchResource() /// public virtual void Validate() { - if (AppServiceEnvironmentPatchResourceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentPatchResourceName"); - } - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } if (VirtualNetwork == null) { throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); } - if (WorkerPools == null) + if (VirtualNetwork != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); + VirtualNetwork.Validate(); } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs index 910c484a40d3..25cb6fbebdb6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServiceEnvironmentResource.cs @@ -37,14 +37,8 @@ public AppServiceEnvironmentResource() /// class. /// /// Resource Location. - /// Name of the App - /// Service Environment. - /// Location of the - /// App Service Environment, e.g. "West US". /// Description of the Virtual /// Network. - /// Description of worker pools with worker - /// size IDs, VM sizes, and number of workers in each pool. /// Resource Id. /// Resource Name. /// Kind of resource. @@ -56,120 +50,51 @@ public AppServiceEnvironmentResource() /// Current status of the App Service Environment. /// Possible values include: 'Preparing', 'Ready', 'Scaling', /// 'Deleting' - /// Name of the Virtual Network for the App - /// Service Environment. - /// Resource group of the Virtual - /// Network. - /// Subnet of the Virtual Network. /// Specifies which endpoints /// to serve internally in the Virtual Network for the App Service /// Environment. Possible values include: 'None', 'Web', 'Publishing', - /// 'Web,Publishing' + /// 'Web, Publishing' /// Front-end VM size, e.g. "Medium", /// "Large". /// Number of front-end instances. /// Number of IP SSL addresses reserved /// for the App Service Environment. - /// Edition of the metadata database for - /// the App Service Environment, e.g. "Standard". - /// Service objective of the - /// metadata database for the App Service Environment, e.g. - /// "S0". - /// Number of upgrade domains of the App - /// Service Environment. - /// Subscription of the App Service - /// Environment. /// DNS suffix of the App Service /// Environment. - /// Last deployment action on the App Service - /// Environment. - /// Result of the last deployment action - /// on the App Service Environment. - /// List of comma separated strings - /// describing which VM sizes are allowed for front-ends. - /// List of comma separated strings - /// describing which VM sizes are allowed for workers. /// Maximum number of VMs in the /// App Service Environment. - /// Description of IP SSL mapping for the App - /// Service Environment. - /// Current total, used, and - /// available worker capacities. - /// Access control list for - /// controlling traffic to the App Service Environment. - /// True/false indicating whether - /// the App Service Environment is healthy. - /// Detailed message about with results - /// of the last check of the App Service Environment. - /// Resource group of the App Service - /// Environment. /// Scale factor for /// front-ends. - /// Default Scale Factor for - /// FrontEnds. - /// API Management Account - /// associated with the App Service Environment. /// <code>true</code> if the App /// Service Environment is suspended; otherwise, /// <code>false</code>. The environment can be suspended, /// e.g. when the management endpoint is no longer available /// (most likely because NSG blocked the incoming traffic). - /// True/false indicating whether the - /// App Service Environment is suspended. The environment can be - /// suspended e.g. when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). /// Custom settings for changing the /// behavior of the App Service Environment. /// User added ip ranges to /// whitelist on ASE db /// Flag that displays whether an ASE has /// linux workers or not - /// Key Vault ID for ILB App Service - /// Environment default SSL certificate - /// Key Vault Secret Name for - /// ILB App Service Environment default SSL certificate - public AppServiceEnvironmentResource(string location, string appServiceEnvironmentResourceName, string appServiceEnvironmentResourceLocation, VirtualNetworkProfile virtualNetwork, IList workerPools, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string vnetName = default(string), string vnetResourceGroupName = default(string), string vnetSubnetName = default(string), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string databaseEdition = default(string), string databaseServiceObjective = default(string), int? upgradeDomains = default(int?), string subscriptionId = default(string), string dnsSuffix = default(string), string lastAction = default(string), string lastActionResult = default(string), string allowedMultiSizes = default(string), string allowedWorkerSizes = default(string), int? maximumNumberOfMachines = default(int?), IList vipMappings = default(IList), IList environmentCapacities = default(IList), IList networkAccessControlList = default(IList), bool? environmentIsHealthy = default(bool?), string environmentStatus = default(string), string resourceGroup = default(string), int? frontEndScaleFactor = default(int?), int? defaultFrontEndScaleFactor = default(int?), string apiManagementAccountId = default(string), bool? suspended = default(bool?), bool? dynamicCacheEnabled = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), string sslCertKeyVaultId = default(string), string sslCertKeyVaultSecretName = default(string)) + /// Dedicated Host Count + public AppServiceEnvironmentResource(string location, VirtualNetworkProfile virtualNetwork, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), HostingEnvironmentStatus? status = default(HostingEnvironmentStatus?), string internalLoadBalancingMode = default(string), string multiSize = default(string), int? multiRoleCount = default(int?), int? ipsslAddressCount = default(int?), string dnsSuffix = default(string), int? maximumNumberOfMachines = default(int?), int? frontEndScaleFactor = default(int?), bool? suspended = default(bool?), IList clusterSettings = default(IList), IList userWhitelistedIpRanges = default(IList), bool? hasLinuxWorkers = default(bool?), int? dedicatedHostCount = default(int?)) : base(location, id, name, kind, type, tags) { - AppServiceEnvironmentResourceName = appServiceEnvironmentResourceName; - AppServiceEnvironmentResourceLocation = appServiceEnvironmentResourceLocation; ProvisioningState = provisioningState; Status = status; - VnetName = vnetName; - VnetResourceGroupName = vnetResourceGroupName; - VnetSubnetName = vnetSubnetName; VirtualNetwork = virtualNetwork; InternalLoadBalancingMode = internalLoadBalancingMode; MultiSize = multiSize; MultiRoleCount = multiRoleCount; - WorkerPools = workerPools; IpsslAddressCount = ipsslAddressCount; - DatabaseEdition = databaseEdition; - DatabaseServiceObjective = databaseServiceObjective; - UpgradeDomains = upgradeDomains; - SubscriptionId = subscriptionId; DnsSuffix = dnsSuffix; - LastAction = lastAction; - LastActionResult = lastActionResult; - AllowedMultiSizes = allowedMultiSizes; - AllowedWorkerSizes = allowedWorkerSizes; MaximumNumberOfMachines = maximumNumberOfMachines; - VipMappings = vipMappings; - EnvironmentCapacities = environmentCapacities; - NetworkAccessControlList = networkAccessControlList; - EnvironmentIsHealthy = environmentIsHealthy; - EnvironmentStatus = environmentStatus; - ResourceGroup = resourceGroup; FrontEndScaleFactor = frontEndScaleFactor; - DefaultFrontEndScaleFactor = defaultFrontEndScaleFactor; - ApiManagementAccountId = apiManagementAccountId; Suspended = suspended; - DynamicCacheEnabled = dynamicCacheEnabled; ClusterSettings = clusterSettings; UserWhitelistedIpRanges = userWhitelistedIpRanges; HasLinuxWorkers = hasLinuxWorkers; - SslCertKeyVaultId = sslCertKeyVaultId; - SslCertKeyVaultSecretName = sslCertKeyVaultSecretName; + DedicatedHostCount = dedicatedHostCount; CustomInit(); } @@ -178,19 +103,6 @@ public AppServiceEnvironmentResource() /// partial void CustomInit(); - /// - /// Gets or sets name of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.name")] - public string AppServiceEnvironmentResourceName { get; set; } - - /// - /// Gets or sets location of the App Service Environment, e.g. "West - /// US". - /// - [JsonProperty(PropertyName = "properties.location")] - public string AppServiceEnvironmentResourceLocation { get; set; } - /// /// Gets provisioning state of the App Service Environment. Possible /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', @@ -206,25 +118,6 @@ public AppServiceEnvironmentResource() [JsonProperty(PropertyName = "properties.status")] public HostingEnvironmentStatus? Status { get; private set; } - /// - /// Gets or sets name of the Virtual Network for the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.vnetName")] - public string VnetName { get; set; } - - /// - /// Gets or sets resource group of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.vnetResourceGroupName")] - public string VnetResourceGroupName { get; set; } - - /// - /// Gets or sets subnet of the Virtual Network. - /// - [JsonProperty(PropertyName = "properties.vnetSubnetName")] - public string VnetSubnetName { get; set; } - /// /// Gets or sets description of the Virtual Network. /// @@ -234,7 +127,7 @@ public AppServiceEnvironmentResource() /// /// Gets or sets specifies which endpoints to serve internally in the /// Virtual Network for the App Service Environment. Possible values - /// include: 'None', 'Web', 'Publishing', 'Web,Publishing' + /// include: 'None', 'Web', 'Publishing', 'Web, Publishing' /// [JsonProperty(PropertyName = "properties.internalLoadBalancingMode")] public string InternalLoadBalancingMode { get; set; } @@ -246,17 +139,10 @@ public AppServiceEnvironmentResource() public string MultiSize { get; set; } /// - /// Gets or sets number of front-end instances. + /// Gets number of front-end instances. /// [JsonProperty(PropertyName = "properties.multiRoleCount")] - public int? MultiRoleCount { get; set; } - - /// - /// Gets or sets description of worker pools with worker size IDs, VM - /// sizes, and number of workers in each pool. - /// - [JsonProperty(PropertyName = "properties.workerPools")] - public IList WorkerPools { get; set; } + public int? MultiRoleCount { get; private set; } /// /// Gets or sets number of IP SSL addresses reserved for the App @@ -265,110 +151,18 @@ public AppServiceEnvironmentResource() [JsonProperty(PropertyName = "properties.ipsslAddressCount")] public int? IpsslAddressCount { get; set; } - /// - /// Gets edition of the metadata database for the App Service - /// Environment, e.g. "Standard". - /// - [JsonProperty(PropertyName = "properties.databaseEdition")] - public string DatabaseEdition { get; private set; } - - /// - /// Gets service objective of the metadata database for the App Service - /// Environment, e.g. "S0". - /// - [JsonProperty(PropertyName = "properties.databaseServiceObjective")] - public string DatabaseServiceObjective { get; private set; } - - /// - /// Gets number of upgrade domains of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.upgradeDomains")] - public int? UpgradeDomains { get; private set; } - - /// - /// Gets subscription of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.subscriptionId")] - public string SubscriptionId { get; private set; } - /// /// Gets or sets DNS suffix of the App Service Environment. /// [JsonProperty(PropertyName = "properties.dnsSuffix")] public string DnsSuffix { get; set; } - /// - /// Gets last deployment action on the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.lastAction")] - public string LastAction { get; private set; } - - /// - /// Gets result of the last deployment action on the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.lastActionResult")] - public string LastActionResult { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for front-ends. - /// - [JsonProperty(PropertyName = "properties.allowedMultiSizes")] - public string AllowedMultiSizes { get; private set; } - - /// - /// Gets list of comma separated strings describing which VM sizes are - /// allowed for workers. - /// - [JsonProperty(PropertyName = "properties.allowedWorkerSizes")] - public string AllowedWorkerSizes { get; private set; } - /// /// Gets maximum number of VMs in the App Service Environment. /// [JsonProperty(PropertyName = "properties.maximumNumberOfMachines")] public int? MaximumNumberOfMachines { get; private set; } - /// - /// Gets description of IP SSL mapping for the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.vipMappings")] - public IList VipMappings { get; private set; } - - /// - /// Gets current total, used, and available worker capacities. - /// - [JsonProperty(PropertyName = "properties.environmentCapacities")] - public IList EnvironmentCapacities { get; private set; } - - /// - /// Gets or sets access control list for controlling traffic to the App - /// Service Environment. - /// - [JsonProperty(PropertyName = "properties.networkAccessControlList")] - public IList NetworkAccessControlList { get; set; } - - /// - /// Gets true/false indicating whether the App Service Environment is - /// healthy. - /// - [JsonProperty(PropertyName = "properties.environmentIsHealthy")] - public bool? EnvironmentIsHealthy { get; private set; } - - /// - /// Gets detailed message about with results of the last check of the - /// App Service Environment. - /// - [JsonProperty(PropertyName = "properties.environmentStatus")] - public string EnvironmentStatus { get; private set; } - - /// - /// Gets resource group of the App Service Environment. - /// - [JsonProperty(PropertyName = "properties.resourceGroup")] - public string ResourceGroup { get; private set; } - /// /// Gets or sets scale factor for front-ends. /// @@ -376,37 +170,15 @@ public AppServiceEnvironmentResource() public int? FrontEndScaleFactor { get; set; } /// - /// Gets default Scale Factor for FrontEnds. - /// - [JsonProperty(PropertyName = "properties.defaultFrontEndScaleFactor")] - public int? DefaultFrontEndScaleFactor { get; private set; } - - /// - /// Gets or sets API Management Account associated with the App Service - /// Environment. - /// - [JsonProperty(PropertyName = "properties.apiManagementAccountId")] - public string ApiManagementAccountId { get; set; } - - /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the - /// App Service Environment is suspended; otherwise, + /// Gets &lt;code&gt;true&lt;/code&gt; if the App + /// Service Environment is suspended; otherwise, /// &lt;code&gt;false&lt;/code&gt;. The environment can /// be suspended, e.g. when the management endpoint is no longer /// available /// (most likely because NSG blocked the incoming traffic). /// [JsonProperty(PropertyName = "properties.suspended")] - public bool? Suspended { get; set; } - - /// - /// Gets or sets true/false indicating whether the App Service - /// Environment is suspended. The environment can be suspended e.g. - /// when the management endpoint is no longer available - /// (most likely because NSG blocked the incoming traffic). - /// - [JsonProperty(PropertyName = "properties.dynamicCacheEnabled")] - public bool? DynamicCacheEnabled { get; set; } + public bool? Suspended { get; private set; } /// /// Gets or sets custom settings for changing the behavior of the App @@ -422,25 +194,16 @@ public AppServiceEnvironmentResource() public IList UserWhitelistedIpRanges { get; set; } /// - /// Gets or sets flag that displays whether an ASE has linux workers or - /// not + /// Gets flag that displays whether an ASE has linux workers or not /// [JsonProperty(PropertyName = "properties.hasLinuxWorkers")] - public bool? HasLinuxWorkers { get; set; } - - /// - /// Gets or sets key Vault ID for ILB App Service Environment default - /// SSL certificate - /// - [JsonProperty(PropertyName = "properties.sslCertKeyVaultId")] - public string SslCertKeyVaultId { get; set; } + public bool? HasLinuxWorkers { get; private set; } /// - /// Gets or sets key Vault Secret Name for ILB App Service Environment - /// default SSL certificate + /// Gets dedicated Host Count /// - [JsonProperty(PropertyName = "properties.sslCertKeyVaultSecretName")] - public string SslCertKeyVaultSecretName { get; set; } + [JsonProperty(PropertyName = "properties.dedicatedHostCount")] + public int? DedicatedHostCount { get; private set; } /// /// Validate the object. @@ -451,21 +214,13 @@ public AppServiceEnvironmentResource() public override void Validate() { base.Validate(); - if (AppServiceEnvironmentResourceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentResourceName"); - } - if (AppServiceEnvironmentResourceLocation == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AppServiceEnvironmentResourceLocation"); - } if (VirtualNetwork == null) { throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetwork"); } - if (WorkerPools == null) + if (VirtualNetwork != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "WorkerPools"); + VirtualNetwork.Validate(); } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs index 6f5f763da3eb..b77592992597 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlan.cs @@ -80,9 +80,11 @@ public AppServicePlan() /// Scaling worker count. /// Scaling worker size ID. /// Provisioning state of the App - /// Service Environment. Possible values include: 'Succeeded', - /// 'Failed', 'Canceled', 'InProgress', 'Deleting' - public AppServicePlan(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), SkuDescription sku = default(SkuDescription)) + /// Service Plan. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled', 'InProgress', 'Deleting' + /// Specification for the + /// Kubernetes Environment to use for the App Service plan. + public AppServicePlan(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), KubeEnvironmentProfile kubeEnvironmentProfile = default(KubeEnvironmentProfile), SkuDescription sku = default(SkuDescription)) : base(location, id, name, kind, type, tags) { WorkerTierName = workerTierName; @@ -104,6 +106,7 @@ public AppServicePlan() TargetWorkerCount = targetWorkerCount; TargetWorkerSizeId = targetWorkerSizeId; ProvisioningState = provisioningState; + KubeEnvironmentProfile = kubeEnvironmentProfile; Sku = sku; CustomInit(); } @@ -237,13 +240,20 @@ public AppServicePlan() public int? TargetWorkerSizeId { get; set; } /// - /// Gets provisioning state of the App Service Environment. Possible - /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// Gets provisioning state of the App Service Plan. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', /// 'Deleting' /// [JsonProperty(PropertyName = "properties.provisioningState")] public ProvisioningState? ProvisioningState { get; private set; } + /// + /// Gets or sets specification for the Kubernetes Environment to use + /// for the App Service plan. + /// + [JsonProperty(PropertyName = "properties.kubeEnvironmentProfile")] + public KubeEnvironmentProfile KubeEnvironmentProfile { get; set; } + /// /// [JsonProperty(PropertyName = "sku")] diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs index 55716222a405..87b7050495c3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppServicePlanPatchResource.cs @@ -66,11 +66,9 @@ public AppServicePlanPatchResource() /// free offer expires. /// Resource group of the App Service /// plan. - /// This needs to set to - /// <code>true</code> when creating a Linux App Service - /// Plan, along with <code>kind</code> set to - /// <code>Linux</code>. It should be - /// <code>false</code> otherwise. + /// If Linux app service plan + /// <code>true</code>, <code>false</code> + /// otherwise. /// Obsolete: If Hyper-V container app service /// plan <code>true</code>, <code>false</code> /// otherwise. @@ -80,9 +78,11 @@ public AppServicePlanPatchResource() /// Scaling worker count. /// Scaling worker size ID. /// Provisioning state of the App - /// Service Environment. Possible values include: 'Succeeded', - /// 'Failed', 'Canceled', 'InProgress', 'Deleting' - public AppServicePlanPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?)) + /// Service Plan. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled', 'InProgress', 'Deleting' + /// Specification for the + /// Kubernetes Environment to use for the App Service plan. + public AppServicePlanPatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string workerTierName = default(string), StatusOptions? status = default(StatusOptions?), string subscription = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), int? maximumNumberOfWorkers = default(int?), string geoRegion = default(string), bool? perSiteScaling = default(bool?), int? maximumElasticWorkerCount = default(int?), int? numberOfSites = default(int?), bool? isSpot = default(bool?), System.DateTime? spotExpirationTime = default(System.DateTime?), System.DateTime? freeOfferExpirationTime = default(System.DateTime?), string resourceGroup = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), int? targetWorkerCount = default(int?), int? targetWorkerSizeId = default(int?), ProvisioningState? provisioningState = default(ProvisioningState?), KubeEnvironmentProfile kubeEnvironmentProfile = default(KubeEnvironmentProfile)) : base(id, name, kind, type) { WorkerTierName = workerTierName; @@ -104,6 +104,7 @@ public AppServicePlanPatchResource() TargetWorkerCount = targetWorkerCount; TargetWorkerSizeId = targetWorkerSizeId; ProvisioningState = provisioningState; + KubeEnvironmentProfile = kubeEnvironmentProfile; CustomInit(); } @@ -200,11 +201,8 @@ public AppServicePlanPatchResource() public string ResourceGroup { get; private set; } /// - /// Gets or sets this needs to set to - /// &lt;code&gt;true&lt;/code&gt; when creating a Linux - /// App Service Plan, along with - /// &lt;code&gt;kind&lt;/code&gt; set to - /// &lt;code&gt;Linux&lt;/code&gt;. It should be + /// Gets or sets if Linux app service plan + /// &lt;code&gt;true&lt;/code&gt;, /// &lt;code&gt;false&lt;/code&gt; otherwise. /// [JsonProperty(PropertyName = "properties.reserved")] @@ -239,12 +237,19 @@ public AppServicePlanPatchResource() public int? TargetWorkerSizeId { get; set; } /// - /// Gets provisioning state of the App Service Environment. Possible - /// values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', + /// Gets provisioning state of the App Service Plan. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', /// 'Deleting' /// [JsonProperty(PropertyName = "properties.provisioningState")] public ProvisioningState? ProvisioningState { get; private set; } + /// + /// Gets or sets specification for the Kubernetes Environment to use + /// for the App Service plan. + /// + [JsonProperty(PropertyName = "properties.kubeEnvironmentProfile")] + public KubeEnvironmentProfile KubeEnvironmentProfile { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.cs new file mode 100644 index 000000000000..899a3bad46e9 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Apple.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The configuration settings of the Apple provider. + /// + [Rest.Serialization.JsonTransformation] + public partial class Apple : ProxyOnlyResource + { + /// + /// Initializes a new instance of the Apple class. + /// + public Apple() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Apple class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the Apple + /// provider should not be enabled despite the set registration; + /// otherwise, <code>true</code>. + /// The configuration settings of the Apple + /// registration. + /// The configuration settings of the login + /// flow. + public Apple(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), AppleRegistration registration = default(AppleRegistration), LoginScopes login = default(LoginScopes)) + : base(id, name, kind, type) + { + Enabled = enabled; + Registration = registration; + Login = login; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if the + /// Apple provider should not be enabled despite the set registration; + /// otherwise, &lt;code&gt;true&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled { get; set; } + + /// + /// Gets or sets the configuration settings of the Apple registration. + /// + [JsonProperty(PropertyName = "properties.registration")] + public AppleRegistration Registration { get; set; } + + /// + /// Gets or sets the configuration settings of the login flow. + /// + [JsonProperty(PropertyName = "properties.login")] + public LoginScopes Login { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.cs new file mode 100644 index 000000000000..7de4212f76b3 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppleRegistration.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The configuration settings of the registration for the Apple provider + /// + [Rest.Serialization.JsonTransformation] + public partial class AppleRegistration : ProxyOnlyResource + { + /// + /// Initializes a new instance of the AppleRegistration class. + /// + public AppleRegistration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AppleRegistration class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Client ID of the app used for + /// login. + /// The app setting name that + /// contains the client secret. + public AppleRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string clientId = default(string), string clientSecretSettingName = default(string)) + : base(id, name, kind, type) + { + ClientId = clientId; + ClientSecretSettingName = clientSecretSettingName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Client ID of the app used for login. + /// + [JsonProperty(PropertyName = "properties.clientId")] + public string ClientId { get; set; } + + /// + /// Gets or sets the app setting name that contains the client secret. + /// + [JsonProperty(PropertyName = "properties.clientSecretSettingName")] + public string ClientSecretSettingName { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs index 1eb2589b59e0..581290a604fe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStack.cs @@ -38,13 +38,17 @@ public ApplicationStack() /// available. /// List of frameworks associated with /// application stack. - public ApplicationStack(string name = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList)) + /// <code>true</code> if this is + /// the stack is deprecated; otherwise, + /// <code>false</code>. + public ApplicationStack(string name = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList), IList isDeprecated = default(IList)) { Name = name; Display = display; Dependency = dependency; MajorVersions = majorVersions; Frameworks = frameworks; + IsDeprecated = isDeprecated; CustomInit(); } @@ -83,5 +87,13 @@ public ApplicationStack() [JsonProperty(PropertyName = "frameworks")] public IList Frameworks { get; set; } + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this + /// is the stack is deprecated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDeprecated")] + public IList IsDeprecated { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs index ac8153b7ec12..ace998a07c8a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ApplicationStackResource.cs @@ -46,7 +46,10 @@ public ApplicationStackResource() /// available. /// List of frameworks associated with /// application stack. - public ApplicationStackResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string applicationStackResourceName = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList)) + /// <code>true</code> if this is + /// the stack is deprecated; otherwise, + /// <code>false</code>. + public ApplicationStackResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string applicationStackResourceName = default(string), string display = default(string), string dependency = default(string), IList majorVersions = default(IList), IList frameworks = default(IList), IList isDeprecated = default(IList)) : base(id, name, kind, type) { ApplicationStackResourceName = applicationStackResourceName; @@ -54,6 +57,7 @@ public ApplicationStackResource() Dependency = dependency; MajorVersions = majorVersions; Frameworks = frameworks; + IsDeprecated = isDeprecated; CustomInit(); } @@ -92,5 +96,13 @@ public ApplicationStackResource() [JsonProperty(PropertyName = "properties.frameworks")] public IList Frameworks { get; set; } + /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if this + /// is the stack is deprecated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.isDeprecated")] + public IList IsDeprecated { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.cs new file mode 100644 index 000000000000..a4a1226ce6af --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubToken.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Github access token for Appservice CLI github integration. + /// + public partial class AppserviceGithubToken + { + /// + /// Initializes a new instance of the AppserviceGithubToken class. + /// + public AppserviceGithubToken() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AppserviceGithubToken class. + /// + /// Github access token for Appservice CLI + /// github integration + /// Scope of the github access token + /// token type + /// True if valid github token received, False + /// otherwise + /// Error message if unable to get + /// token + public AppserviceGithubToken(string accessToken = default(string), string scope = default(string), string tokenType = default(string), bool? gotToken = default(bool?), string errorMessage = default(string)) + { + AccessToken = accessToken; + Scope = scope; + TokenType = tokenType; + GotToken = gotToken; + ErrorMessage = errorMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets github access token for Appservice CLI github + /// integration + /// + [JsonProperty(PropertyName = "accessToken")] + public string AccessToken { get; set; } + + /// + /// Gets or sets scope of the github access token + /// + [JsonProperty(PropertyName = "scope")] + public string Scope { get; set; } + + /// + /// Gets or sets token type + /// + [JsonProperty(PropertyName = "tokenType")] + public string TokenType { get; set; } + + /// + /// Gets or sets true if valid github token received, False otherwise + /// + [JsonProperty(PropertyName = "gotToken")] + public bool? GotToken { get; set; } + + /// + /// Gets or sets error message if unable to get token + /// + [JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs new file mode 100644 index 000000000000..e99bcc39cb0f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AppserviceGithubTokenRequest.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Appservice Github token request content. + /// + public partial class AppserviceGithubTokenRequest + { + /// + /// Initializes a new instance of the AppserviceGithubTokenRequest + /// class. + /// + public AppserviceGithubTokenRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AppserviceGithubTokenRequest + /// class. + /// + /// Code string to exchange for Github Access + /// token + /// State string used for verification. + public AppserviceGithubTokenRequest(string code, string state) + { + Code = code; + State = state; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets code string to exchange for Github Access token + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets state string used for verification. + /// + [JsonProperty(PropertyName = "state")] + public string State { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Code == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Code"); + } + if (State == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "State"); + } + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.cs new file mode 100644 index 000000000000..fc74b705a4e6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ArmPlan.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The plan object in Azure Resource Manager, represents a marketplace + /// plan. + /// + public partial class ArmPlan + { + /// + /// Initializes a new instance of the ArmPlan class. + /// + public ArmPlan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ArmPlan class. + /// + /// The name. + /// The publisher. + /// The product. + /// The promotion code. + /// Version of product. + public ArmPlan(string name = default(string), string publisher = default(string), string product = default(string), string promotionCode = default(string), string version = default(string)) + { + Name = name; + Publisher = publisher; + Product = product; + PromotionCode = promotionCode; + Version = version; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the publisher. + /// + [JsonProperty(PropertyName = "publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets the product. + /// + [JsonProperty(PropertyName = "product")] + public string Product { get; set; } + + /// + /// Gets or sets the promotion code. + /// + [JsonProperty(PropertyName = "promotionCode")] + public string PromotionCode { get; set; } + + /// + /// Gets or sets version of product. + /// + [JsonProperty(PropertyName = "version")] + public string Version { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.cs new file mode 100644 index 000000000000..57dca6849502 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AseV3NetworkingConfiguration.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Full view of networking configuration for an ASE. + /// + [Rest.Serialization.JsonTransformation] + public partial class AseV3NetworkingConfiguration : ProxyOnlyResource + { + /// + /// Initializes a new instance of the AseV3NetworkingConfiguration + /// class. + /// + public AseV3NetworkingConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AseV3NetworkingConfiguration + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Property to enable + /// and disable new private endpoint connection creation on ASE + public AseV3NetworkingConfiguration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList windowsOutboundIpAddresses = default(IList), IList linuxOutboundIpAddresses = default(IList), bool? allowNewPrivateEndpointConnections = default(bool?)) + : base(id, name, kind, type) + { + WindowsOutboundIpAddresses = windowsOutboundIpAddresses; + LinuxOutboundIpAddresses = linuxOutboundIpAddresses; + AllowNewPrivateEndpointConnections = allowNewPrivateEndpointConnections; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.windowsOutboundIpAddresses")] + public IList WindowsOutboundIpAddresses { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "properties.linuxOutboundIpAddresses")] + public IList LinuxOutboundIpAddresses { get; private set; } + + /// + /// Gets or sets property to enable and disable new private endpoint + /// connection creation on ASE + /// + [JsonProperty(PropertyName = "properties.allowNewPrivateEndpointConnections")] + public bool? AllowNewPrivateEndpointConnections { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.cs index fcb76de8feff..fc7e0949a009 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AuthPlatform.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the platform of App Service + /// Authentication/Authorization. + /// [Rest.Serialization.JsonTransformation] public partial class AuthPlatform : ProxyOnlyResource { @@ -33,6 +37,17 @@ public AuthPlatform() /// Resource Name. /// Kind of resource. /// Resource type. + /// <code>true</code> if the + /// Authentication / Authorization feature is enabled for the current + /// app; otherwise, <code>false</code>. + /// The RuntimeVersion of the + /// Authentication / Authorization feature in use for the current app. + /// The setting in this value can control the behavior of certain + /// features in the Authentication / Authorization module. + /// The path of the config file containing + /// auth settings if they come from a file. + /// If the path is relative, base will the site's root + /// directory. public AuthPlatform(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), string runtimeVersion = default(string), string configFilePath = default(string)) : base(id, name, kind, type) { @@ -48,16 +63,26 @@ public AuthPlatform() partial void CustomInit(); /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// Authentication / Authorization feature is enabled for the current + /// app; otherwise, &lt;code&gt;false&lt;/code&gt;. /// [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } /// + /// Gets or sets the RuntimeVersion of the Authentication / + /// Authorization feature in use for the current app. + /// The setting in this value can control the behavior of certain + /// features in the Authentication / Authorization module. /// [JsonProperty(PropertyName = "properties.runtimeVersion")] public string RuntimeVersion { get; set; } /// + /// Gets or sets the path of the config file containing auth settings + /// if they come from a file. + /// If the path is relative, base will the site's root directory. /// [JsonProperty(PropertyName = "properties.configFilePath")] public string ConfigFilePath { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs index 1249271bac0a..9d375020a49e 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AutoHealTriggers.cs @@ -37,12 +37,18 @@ public AutoHealTriggers() /// A rule based on status codes. /// A rule based on request execution /// time. - public AutoHealTriggers(RequestsBasedTrigger requests = default(RequestsBasedTrigger), int? privateBytesInKB = default(int?), IList statusCodes = default(IList), SlowRequestsBasedTrigger slowRequests = default(SlowRequestsBasedTrigger)) + /// A rule based on multiple Slow + /// Requests Rule with path + /// A rule based on status codes + /// ranges. + public AutoHealTriggers(RequestsBasedTrigger requests = default(RequestsBasedTrigger), int? privateBytesInKB = default(int?), IList statusCodes = default(IList), SlowRequestsBasedTrigger slowRequests = default(SlowRequestsBasedTrigger), IList slowRequestsWithPath = default(IList), IList statusCodesRange = default(IList)) { Requests = requests; PrivateBytesInKB = privateBytesInKB; StatusCodes = statusCodes; SlowRequests = slowRequests; + SlowRequestsWithPath = slowRequestsWithPath; + StatusCodesRange = statusCodesRange; CustomInit(); } @@ -75,5 +81,17 @@ public AutoHealTriggers() [JsonProperty(PropertyName = "slowRequests")] public SlowRequestsBasedTrigger SlowRequests { get; set; } + /// + /// Gets or sets a rule based on multiple Slow Requests Rule with path + /// + [JsonProperty(PropertyName = "slowRequestsWithPath")] + public IList SlowRequestsWithPath { get; set; } + + /// + /// Gets or sets a rule based on status codes ranges. + /// + [JsonProperty(PropertyName = "statusCodesRange")] + public IList StatusCodesRange { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.cs index 1adab0d29484..4c5adc65d09f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectory.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the Azure Active directory provider. + /// [Rest.Serialization.JsonTransformation] public partial class AzureActiveDirectory : ProxyOnlyResource { @@ -33,6 +36,21 @@ public AzureActiveDirectory() /// Resource Name. /// Kind of resource. /// Resource type. + /// <code>false</code> if the Azure + /// Active Directory provider should not be enabled despite the set + /// registration; otherwise, <code>true</code>. + /// The configuration settings of the Azure + /// Active Directory app registration. + /// The configuration settings of the Azure Active + /// Directory login flow. + /// The configuration settings of the Azure + /// Active Directory token validation flow. + /// Gets a value indicating whether the + /// Azure AD configuration was auto-provisioned using 1st party + /// tooling. + /// This is an internal flag primarily intended to support the Azure + /// Management Portal. Users should not + /// read or write to this property. public AzureActiveDirectory(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), AzureActiveDirectoryRegistration registration = default(AzureActiveDirectoryRegistration), AzureActiveDirectoryLogin login = default(AzureActiveDirectoryLogin), AzureActiveDirectoryValidation validation = default(AzureActiveDirectoryValidation), bool? isAutoProvisioned = default(bool?)) : base(id, name, kind, type) { @@ -50,26 +68,41 @@ public AzureActiveDirectory() partial void CustomInit(); /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if the + /// Azure Active Directory provider should not be enabled despite the + /// set registration; otherwise, + /// &lt;code&gt;true&lt;/code&gt;. /// [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } /// + /// Gets or sets the configuration settings of the Azure Active + /// Directory app registration. /// [JsonProperty(PropertyName = "properties.registration")] public AzureActiveDirectoryRegistration Registration { get; set; } /// + /// Gets or sets the configuration settings of the Azure Active + /// Directory login flow. /// [JsonProperty(PropertyName = "properties.login")] public AzureActiveDirectoryLogin Login { get; set; } /// + /// Gets or sets the configuration settings of the Azure Active + /// Directory token validation flow. /// [JsonProperty(PropertyName = "properties.validation")] public AzureActiveDirectoryValidation Validation { get; set; } /// + /// Gets a value indicating whether the Azure AD configuration was + /// auto-provisioned using 1st party tooling. + /// This is an internal flag primarily intended to support the Azure + /// Management Portal. Users should not + /// read or write to this property. /// [JsonProperty(PropertyName = "properties.isAutoProvisioned")] public bool? IsAutoProvisioned { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.cs index 108a38b756cf..5f18bf96b2fe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryLogin.cs @@ -17,6 +17,9 @@ namespace Microsoft.Azure.Management.WebSites.Models using System.Collections.Generic; using System.Linq; + /// + /// The configuration settings of the Azure Active Directory login flow. + /// [Rest.Serialization.JsonTransformation] public partial class AzureActiveDirectoryLogin : ProxyOnlyResource { @@ -35,6 +38,10 @@ public AzureActiveDirectoryLogin() /// Resource Name. /// Kind of resource. /// Resource type. + /// Login parameters to send to the + /// OpenID Connect authorization endpoint when + /// a user logs in. Each parameter must be in the form + /// "key=value". public AzureActiveDirectoryLogin(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? disableWWWAuthenticate = default(bool?), IList loginParameters = default(IList)) : base(id, name, kind, type) { @@ -54,6 +61,9 @@ public AzureActiveDirectoryLogin() public bool? DisableWWWAuthenticate { get; set; } /// + /// Gets or sets login parameters to send to the OpenID Connect + /// authorization endpoint when + /// a user logs in. Each parameter must be in the form "key=value". /// [JsonProperty(PropertyName = "properties.loginParameters")] public IList LoginParameters { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.cs index 28c6a7986420..e8d86b417f10 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryRegistration.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the Azure Active Directory app + /// registration. + /// [Rest.Serialization.JsonTransformation] public partial class AzureActiveDirectoryRegistration : ProxyOnlyResource { @@ -35,6 +39,29 @@ public AzureActiveDirectoryRegistration() /// Resource Name. /// Kind of resource. /// Resource type. + /// The OpenID Connect Issuer URI that + /// represents the entity which issues access tokens for this + /// application. + /// When using Azure Active Directory, this value is the URI of the + /// directory tenant, e.g. + /// https://login.microsoftonline.com/v2.0/{tenant-guid}/. + /// This URI is a case-sensitive identifier for the token issuer. + /// More information on OpenID Connect Discovery: + /// http://openid.net/specs/openid-connect-discovery-1_0.html + /// The Client ID of this relying party + /// application, known as the client_id. + /// This setting is required for enabling OpenID Connection + /// authentication with Azure Active Directory or + /// other 3rd party OpenID Connect providers. + /// More information on OpenID Connect: + /// http://openid.net/specs/openid-connect-core-1_0.html + /// The app setting name that + /// contains the client secret of the relying party + /// application. + /// An alternative to + /// the client secret, that is the thumbprint of a certificate used for + /// signing purposes. This property acts as + /// a replacement for the Client Secret. It is also optional. public AzureActiveDirectoryRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string openIdIssuer = default(string), string clientId = default(string), string clientSecretSettingName = default(string), string clientSecretCertificateThumbprint = default(string)) : base(id, name, kind, type) { @@ -51,21 +78,42 @@ public AzureActiveDirectoryRegistration() partial void CustomInit(); /// + /// Gets or sets the OpenID Connect Issuer URI that represents the + /// entity which issues access tokens for this application. + /// When using Azure Active Directory, this value is the URI of the + /// directory tenant, e.g. + /// https://login.microsoftonline.com/v2.0/{tenant-guid}/. + /// This URI is a case-sensitive identifier for the token issuer. + /// More information on OpenID Connect Discovery: + /// http://openid.net/specs/openid-connect-discovery-1_0.html /// [JsonProperty(PropertyName = "properties.openIdIssuer")] public string OpenIdIssuer { get; set; } /// + /// Gets or sets the Client ID of this relying party application, known + /// as the client_id. + /// This setting is required for enabling OpenID Connection + /// authentication with Azure Active Directory or + /// other 3rd party OpenID Connect providers. + /// More information on OpenID Connect: + /// http://openid.net/specs/openid-connect-core-1_0.html /// [JsonProperty(PropertyName = "properties.clientId")] public string ClientId { get; set; } /// + /// Gets or sets the app setting name that contains the client secret + /// of the relying party application. /// [JsonProperty(PropertyName = "properties.clientSecretSettingName")] public string ClientSecretSettingName { get; set; } /// + /// Gets or sets an alternative to the client secret, that is the + /// thumbprint of a certificate used for signing purposes. This + /// property acts as + /// a replacement for the Client Secret. It is also optional. /// [JsonProperty(PropertyName = "properties.clientSecretCertificateThumbprint")] public string ClientSecretCertificateThumbprint { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.cs index 4122b36d7f76..3b81d7a90c8b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureActiveDirectoryValidation.cs @@ -17,6 +17,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using System.Collections.Generic; using System.Linq; + /// + /// The configuration settings of the Azure Active Directory token + /// validation flow. + /// [Rest.Serialization.JsonTransformation] public partial class AzureActiveDirectoryValidation : ProxyOnlyResource { @@ -37,6 +41,10 @@ public AzureActiveDirectoryValidation() /// Resource Name. /// Kind of resource. /// Resource type. + /// The configuration settings of the + /// checks that should be made while validating the JWT Claims. + /// The list of audiences that can make + /// successful authentication/authorization requests. public AzureActiveDirectoryValidation(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), JwtClaimChecks jwtClaimChecks = default(JwtClaimChecks), IList allowedAudiences = default(IList)) : base(id, name, kind, type) { @@ -51,11 +59,15 @@ public AzureActiveDirectoryValidation() partial void CustomInit(); /// + /// Gets or sets the configuration settings of the checks that should + /// be made while validating the JWT Claims. /// [JsonProperty(PropertyName = "properties.jwtClaimChecks")] public JwtClaimChecks JwtClaimChecks { get; set; } /// + /// Gets or sets the list of audiences that can make successful + /// authentication/authorization requests. /// [JsonProperty(PropertyName = "properties.allowedAudiences")] public IList AllowedAudiences { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs new file mode 100644 index 000000000000..46b15f342424 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebApps.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The configuration settings of the Azure Static Web Apps provider. + /// + [Rest.Serialization.JsonTransformation] + public partial class AzureStaticWebApps : ProxyOnlyResource + { + /// + /// Initializes a new instance of the AzureStaticWebApps class. + /// + public AzureStaticWebApps() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureStaticWebApps class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the Azure + /// Static Web Apps provider should not be enabled despite the set + /// registration; otherwise, <code>true</code>. + /// The configuration settings of the Azure + /// Static Web Apps registration. + public AzureStaticWebApps(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), AzureStaticWebAppsRegistration registration = default(AzureStaticWebAppsRegistration)) + : base(id, name, kind, type) + { + Enabled = enabled; + Registration = registration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if the + /// Azure Static Web Apps provider should not be enabled despite the + /// set registration; otherwise, + /// &lt;code&gt;true&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled { get; set; } + + /// + /// Gets or sets the configuration settings of the Azure Static Web + /// Apps registration. + /// + [JsonProperty(PropertyName = "properties.registration")] + public AzureStaticWebAppsRegistration Registration { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.cs new file mode 100644 index 000000000000..7f65e2ba278d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStaticWebAppsRegistration.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The configuration settings of the registration for the Azure Static Web + /// Apps provider + /// + [Rest.Serialization.JsonTransformation] + public partial class AzureStaticWebAppsRegistration : ProxyOnlyResource + { + /// + /// Initializes a new instance of the AzureStaticWebAppsRegistration + /// class. + /// + public AzureStaticWebAppsRegistration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureStaticWebAppsRegistration + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The Client ID of the app used for + /// login. + public AzureStaticWebAppsRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string clientId = default(string)) + : base(id, name, kind, type) + { + ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Client ID of the app used for login. + /// + [JsonProperty(PropertyName = "properties.clientId")] + public string ClientId { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs index a0dec36fc138..58973e11d2a7 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageInfoValue.cs @@ -39,7 +39,8 @@ public AzureStorageInfoValue() /// Path to mount the storage within the site's /// runtime environment. /// State of the storage account. Possible values - /// include: 'Ok', 'InvalidCredentials', 'InvalidShare' + /// include: 'Ok', 'InvalidCredentials', 'InvalidShare', + /// 'NotValidated' public AzureStorageInfoValue(AzureStorageType? type = default(AzureStorageType?), string accountName = default(string), string shareName = default(string), string accessKey = default(string), string mountPath = default(string), AzureStorageState? state = default(AzureStorageState?)) { Type = type; @@ -91,7 +92,7 @@ public AzureStorageInfoValue() /// /// Gets state of the storage account. Possible values include: 'Ok', - /// 'InvalidCredentials', 'InvalidShare' + /// 'InvalidCredentials', 'InvalidShare', 'NotValidated' /// [JsonProperty(PropertyName = "state")] public AzureStorageState? State { get; private set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs index 49d68d686c25..dd8e18dc45a5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/AzureStorageState.cs @@ -26,7 +26,9 @@ public enum AzureStorageState [EnumMember(Value = "InvalidCredentials")] InvalidCredentials, [EnumMember(Value = "InvalidShare")] - InvalidShare + InvalidShare, + [EnumMember(Value = "NotValidated")] + NotValidated } internal static class AzureStorageStateEnumExtension { @@ -45,6 +47,8 @@ internal static string ToSerializedValue(this AzureStorageState value) return "InvalidCredentials"; case AzureStorageState.InvalidShare: return "InvalidShare"; + case AzureStorageState.NotValidated: + return "NotValidated"; } return null; } @@ -59,6 +63,8 @@ internal static string ToSerializedValue(this AzureStorageState value) return AzureStorageState.InvalidCredentials; case "InvalidShare": return AzureStorageState.InvalidShare; + case "NotValidated": + return AzureStorageState.NotValidated; } return null; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs index 2e6698cad5cd..592906a09b62 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BillingMeter.cs @@ -46,7 +46,8 @@ public BillingMeter() /// App Service ResourceType meter used /// for /// App Service OS type meter used for - public BillingMeter(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string meterId = default(string), string billingLocation = default(string), string shortName = default(string), string friendlyName = default(string), string resourceType = default(string), string osType = default(string)) + /// Meter Multiplier + public BillingMeter(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string meterId = default(string), string billingLocation = default(string), string shortName = default(string), string friendlyName = default(string), string resourceType = default(string), string osType = default(string), double? multiplier = default(double?)) : base(id, name, kind, type) { MeterId = meterId; @@ -55,6 +56,7 @@ public BillingMeter() FriendlyName = friendlyName; ResourceType = resourceType; OsType = osType; + Multiplier = multiplier; CustomInit(); } @@ -99,5 +101,11 @@ public BillingMeter() [JsonProperty(PropertyName = "properties.osType")] public string OsType { get; set; } + /// + /// Gets or sets meter Multiplier + /// + [JsonProperty(PropertyName = "properties.multiplier")] + public double? Multiplier { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.cs index 477633b938cb..312e424b75d5 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/BlobStorageTokenStore.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the storage of the tokens if blob storage + /// is used. + /// [Rest.Serialization.JsonTransformation] public partial class BlobStorageTokenStore : ProxyOnlyResource { @@ -33,6 +37,9 @@ public BlobStorageTokenStore() /// Resource Name. /// Kind of resource. /// Resource type. + /// The name of the app setting + /// containing the SAS URL of the blob storage containing the + /// tokens. public BlobStorageTokenStore(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string sasUrlSettingName = default(string)) : base(id, name, kind, type) { @@ -46,6 +53,8 @@ public BlobStorageTokenStore() partial void CustomInit(); /// + /// Gets or sets the name of the app setting containing the SAS URL of + /// the blob storage containing the tokens. /// [JsonProperty(PropertyName = "properties.sasUrlSettingName")] public string SasUrlSettingName { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs index d46eb9c0661c..3b586e1571db 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Certificate.cs @@ -35,12 +35,12 @@ public Certificate() /// Initializes a new instance of the Certificate class. /// /// Resource Location. - /// Certificate password. /// Resource Id. /// Resource Name. /// Kind of resource. /// Resource type. /// Resource tags. + /// Certificate password. /// Friendly name of the /// certificate. /// Subject name of the certificate. @@ -72,9 +72,12 @@ public Certificate() /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". /// CNAME of the certificate to be issued /// via free certificate - public Certificate(string location, string password, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string)) + /// Method of domain validation + /// for free cert + public Certificate(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string password = default(string), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string), string domainValidationMethod = default(string)) : base(location, id, name, kind, type, tags) { + Password = password; FriendlyName = friendlyName; SubjectName = subjectName; HostNames = hostNames; @@ -84,7 +87,6 @@ public Certificate() Issuer = issuer; IssueDate = issueDate; ExpirationDate = expirationDate; - Password = password; Thumbprint = thumbprint; Valid = valid; CerBlob = cerBlob; @@ -95,6 +97,7 @@ public Certificate() KeyVaultSecretStatus = keyVaultSecretStatus; ServerFarmId = serverFarmId; CanonicalName = canonicalName; + DomainValidationMethod = domainValidationMethod; CustomInit(); } @@ -103,6 +106,12 @@ public Certificate() /// partial void CustomInit(); + /// + /// Gets or sets certificate password. + /// + [JsonProperty(PropertyName = "properties.password")] + public string Password { get; set; } + /// /// Gets friendly name of the certificate. /// @@ -157,12 +166,6 @@ public Certificate() [JsonProperty(PropertyName = "properties.expirationDate")] public System.DateTime? ExpirationDate { get; private set; } - /// - /// Gets or sets certificate password. - /// - [JsonProperty(PropertyName = "properties.password")] - public string Password { get; set; } - /// /// Gets certificate thumbprint. /// @@ -232,6 +235,12 @@ public Certificate() [JsonProperty(PropertyName = "properties.canonicalName")] public string CanonicalName { get; set; } + /// + /// Gets or sets method of domain validation for free cert + /// + [JsonProperty(PropertyName = "properties.domainValidationMethod")] + public string DomainValidationMethod { get; set; } + /// /// Validate the object. /// @@ -241,10 +250,6 @@ public Certificate() public override void Validate() { base.Validate(); - if (Password == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Password"); - } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs new file mode 100644 index 000000000000..e5e1e23fea6c --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificateOrderContact.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class CertificateOrderContact + { + /// + /// Initializes a new instance of the CertificateOrderContact class. + /// + public CertificateOrderContact() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CertificateOrderContact class. + /// + public CertificateOrderContact(string email = default(string), string nameFirst = default(string), string nameLast = default(string), string phone = default(string)) + { + Email = email; + NameFirst = nameFirst; + NameLast = nameLast; + Phone = phone; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "email")] + public string Email { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nameFirst")] + public string NameFirst { get; set; } + + /// + /// + [JsonProperty(PropertyName = "nameLast")] + public string NameLast { get; set; } + + /// + /// + [JsonProperty(PropertyName = "phone")] + public string Phone { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs index f2579bd985bc..126494ed2d53 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CertificatePatchResource.cs @@ -34,11 +34,11 @@ public CertificatePatchResource() /// /// Initializes a new instance of the CertificatePatchResource class. /// - /// Certificate password. /// Resource Id. /// Resource Name. /// Kind of resource. /// Resource type. + /// Certificate password. /// Friendly name of the /// certificate. /// Subject name of the certificate. @@ -70,9 +70,12 @@ public CertificatePatchResource() /// "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". /// CNAME of the certificate to be issued /// via free certificate - public CertificatePatchResource(string password, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string)) + /// Method of domain validation + /// for free cert + public CertificatePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string password = default(string), string friendlyName = default(string), string subjectName = default(string), IList hostNames = default(IList), byte[] pfxBlob = default(byte[]), string siteName = default(string), string selfLink = default(string), string issuer = default(string), System.DateTime? issueDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), string thumbprint = default(string), bool? valid = default(bool?), byte[] cerBlob = default(byte[]), string publicKeyHash = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), string keyVaultId = default(string), string keyVaultSecretName = default(string), KeyVaultSecretStatus? keyVaultSecretStatus = default(KeyVaultSecretStatus?), string serverFarmId = default(string), string canonicalName = default(string), string domainValidationMethod = default(string)) : base(id, name, kind, type) { + Password = password; FriendlyName = friendlyName; SubjectName = subjectName; HostNames = hostNames; @@ -82,7 +85,6 @@ public CertificatePatchResource() Issuer = issuer; IssueDate = issueDate; ExpirationDate = expirationDate; - Password = password; Thumbprint = thumbprint; Valid = valid; CerBlob = cerBlob; @@ -93,6 +95,7 @@ public CertificatePatchResource() KeyVaultSecretStatus = keyVaultSecretStatus; ServerFarmId = serverFarmId; CanonicalName = canonicalName; + DomainValidationMethod = domainValidationMethod; CustomInit(); } @@ -101,6 +104,12 @@ public CertificatePatchResource() /// partial void CustomInit(); + /// + /// Gets or sets certificate password. + /// + [JsonProperty(PropertyName = "properties.password")] + public string Password { get; set; } + /// /// Gets friendly name of the certificate. /// @@ -155,12 +164,6 @@ public CertificatePatchResource() [JsonProperty(PropertyName = "properties.expirationDate")] public System.DateTime? ExpirationDate { get; private set; } - /// - /// Gets or sets certificate password. - /// - [JsonProperty(PropertyName = "properties.password")] - public string Password { get; set; } - /// /// Gets certificate thumbprint. /// @@ -231,17 +234,10 @@ public CertificatePatchResource() public string CanonicalName { get; set; } /// - /// Validate the object. + /// Gets or sets method of domain validation for free cert /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Password == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Password"); - } - } + [JsonProperty(PropertyName = "properties.domainValidationMethod")] + public string DomainValidationMethod { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs index 422855315598..5c9bd29f7e2d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientCertMode.cs @@ -24,7 +24,9 @@ public enum ClientCertMode [EnumMember(Value = "Required")] Required, [EnumMember(Value = "Optional")] - Optional + Optional, + [EnumMember(Value = "OptionalInteractiveUser")] + OptionalInteractiveUser } internal static class ClientCertModeEnumExtension { @@ -41,6 +43,8 @@ internal static string ToSerializedValue(this ClientCertMode value) return "Required"; case ClientCertMode.Optional: return "Optional"; + case ClientCertMode.OptionalInteractiveUser: + return "OptionalInteractiveUser"; } return null; } @@ -53,6 +57,8 @@ internal static string ToSerializedValue(this ClientCertMode value) return ClientCertMode.Required; case "Optional": return ClientCertMode.Optional; + case "OptionalInteractiveUser": + return ClientCertMode.OptionalInteractiveUser; } return null; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.cs index 516e1eda692c..53c9e5bc455f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ClientRegistration.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the app registration for providers that + /// have client ids and client secrets + /// [Rest.Serialization.JsonTransformation] public partial class ClientRegistration : ProxyOnlyResource { @@ -33,6 +37,10 @@ public ClientRegistration() /// Resource Name. /// Kind of resource. /// Resource type. + /// The Client ID of the app used for + /// login. + /// The app setting name that + /// contains the client secret. public ClientRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string clientId = default(string), string clientSecretSettingName = default(string)) : base(id, name, kind, type) { @@ -47,11 +55,13 @@ public ClientRegistration() partial void CustomInit(); /// + /// Gets or sets the Client ID of the app used for login. /// [JsonProperty(PropertyName = "properties.clientId")] public string ClientId { get; set; } /// + /// Gets or sets the app setting name that contains the client secret. /// [JsonProperty(PropertyName = "properties.clientSecretSettingName")] public string ClientSecretSettingName { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConfigReferenceSource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConfigReferenceSource.cs new file mode 100644 index 000000000000..621c4362c717 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ConfigReferenceSource.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.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ConfigReferenceSource. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ConfigReferenceSource + { + [EnumMember(Value = "KeyVault")] + KeyVault + } + internal static class ConfigReferenceSourceEnumExtension + { + internal static string ToSerializedValue(this ConfigReferenceSource? value) + { + return value == null ? null : ((ConfigReferenceSource)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ConfigReferenceSource value) + { + switch( value ) + { + case ConfigReferenceSource.KeyVault: + return "KeyVault"; + } + return null; + } + + internal static ConfigReferenceSource? ParseConfigReferenceSource(this string value) + { + switch( value ) + { + case "KeyVault": + return ConfigReferenceSource.KeyVault; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.cs index 2bad787f8310..8c65dc752591 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CookieExpiration.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the session cookie's expiration. + /// [Rest.Serialization.JsonTransformation] public partial class CookieExpiration : ProxyOnlyResource { @@ -33,8 +36,11 @@ public CookieExpiration() /// Resource Name. /// Kind of resource. /// Resource type. - /// Possible values include: 'FixedTime', + /// The convention used when determining the + /// session cookie's expiration. Possible values include: 'FixedTime', /// 'IdentityProviderDerived' + /// The time after the request is made + /// when the session cookie should expire. public CookieExpiration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), CookieExpirationConvention? convention = default(CookieExpirationConvention?), string timeToExpiration = default(string)) : base(id, name, kind, type) { @@ -49,13 +55,16 @@ public CookieExpiration() partial void CustomInit(); /// - /// Gets or sets possible values include: 'FixedTime', + /// Gets or sets the convention used when determining the session + /// cookie's expiration. Possible values include: 'FixedTime', /// 'IdentityProviderDerived' /// [JsonProperty(PropertyName = "properties.convention")] public CookieExpirationConvention? Convention { get; set; } /// + /// Gets or sets the time after the request is made when the session + /// cookie should expire. /// [JsonProperty(PropertyName = "properties.timeToExpiration")] public string TimeToExpiration { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmCopySlotEntity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmCopySlotEntity.cs deleted file mode 100644 index 0c117e09339b..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CsmCopySlotEntity.cs +++ /dev/null @@ -1,93 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Copy deployment slot parameters. - /// - public partial class CsmCopySlotEntity - { - /// - /// Initializes a new instance of the CsmCopySlotEntity class. - /// - public CsmCopySlotEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CsmCopySlotEntity class. - /// - /// Destination deployment slot during copy - /// operation. - /// The site object which will be merged with - /// the source slot site - /// to produce new destination slot site object. - /// <code>null</code> to just copy source slot content. - /// Otherwise a <code>Site</code> - /// object with properties to override source slot site. - public CsmCopySlotEntity(string targetSlot, SiteConfig siteConfig) - { - TargetSlot = targetSlot; - SiteConfig = siteConfig; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets destination deployment slot during copy operation. - /// - [JsonProperty(PropertyName = "targetSlot")] - public string TargetSlot { get; set; } - - /// - /// Gets or sets the site object which will be merged with the source - /// slot site - /// to produce new destination slot site object. - /// &lt;code&gt;null&lt;/code&gt; to just copy source - /// slot content. Otherwise a - /// &lt;code&gt;Site&lt;/code&gt; - /// object with properties to override source slot site. - /// - [JsonProperty(PropertyName = "siteConfig")] - public SiteConfig SiteConfig { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TargetSlot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetSlot"); - } - if (SiteConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SiteConfig"); - } - if (SiteConfig != null) - { - SiteConfig.Validate(); - } - } - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs new file mode 100644 index 000000000000..7a18aa9698bf --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomDomainStatus.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + + /// + /// Defines values for CustomDomainStatus. + /// + public static class CustomDomainStatus + { + public const string RetrievingValidationToken = "RetrievingValidationToken"; + public const string Validating = "Validating"; + public const string Adding = "Adding"; + public const string Ready = "Ready"; + public const string Failed = "Failed"; + public const string Deleting = "Deleting"; + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.cs index c6bcf20e8429..3a5ff17ecd4b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/CustomOpenIdConnectProvider.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the custom Open ID Connect provider. + /// [Rest.Serialization.JsonTransformation] public partial class CustomOpenIdConnectProvider : ProxyOnlyResource { @@ -35,6 +38,13 @@ public CustomOpenIdConnectProvider() /// Resource Name. /// Kind of resource. /// Resource type. + /// <code>false</code> if the custom + /// Open ID provider provider should not be enabled; otherwise, + /// <code>true</code>. + /// The configuration settings of the app + /// registration for the custom Open ID Connect provider. + /// The configuration settings of the login flow of + /// the custom Open ID Connect provider. public CustomOpenIdConnectProvider(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), OpenIdConnectRegistration registration = default(OpenIdConnectRegistration), OpenIdConnectLogin login = default(OpenIdConnectLogin)) : base(id, name, kind, type) { @@ -50,16 +60,23 @@ public CustomOpenIdConnectProvider() partial void CustomInit(); /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if the + /// custom Open ID provider provider should not be enabled; otherwise, + /// &lt;code&gt;true&lt;/code&gt;. /// [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } /// + /// Gets or sets the configuration settings of the app registration for + /// the custom Open ID Connect provider. /// [JsonProperty(PropertyName = "properties.registration")] public OpenIdConnectRegistration Registration { get; set; } /// + /// Gets or sets the configuration settings of the login flow of the + /// custom Open ID Connect provider. /// [JsonProperty(PropertyName = "properties.login")] public OpenIdConnectLogin Login { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.cs new file mode 100644 index 000000000000..74f97c70231f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DataProviderMetadata.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Additional configuration for a data providers + /// + public partial class DataProviderMetadata + { + /// + /// Initializes a new instance of the DataProviderMetadata class. + /// + public DataProviderMetadata() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataProviderMetadata class. + /// + /// Settings for the data provider + public DataProviderMetadata(string providerName = default(string), IList propertyBag = default(IList)) + { + ProviderName = providerName; + PropertyBag = propertyBag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "providerName")] + public string ProviderName { get; set; } + + /// + /// Gets settings for the data provider + /// + [JsonProperty(PropertyName = "propertyBag")] + public IList PropertyBag { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs index 78af46d0f5c1..6bef8197eb83 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorInfo.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.Management.WebSites.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -29,17 +31,33 @@ public DetectorInfo() /// /// Initializes a new instance of the DetectorInfo class. /// + /// Id of detector + /// Name of detector /// Short description of the detector and its - /// purpose - /// Support Category - /// Support Sub Category - /// Support Topic Id - public DetectorInfo(string description = default(string), string category = default(string), string subCategory = default(string), string supportTopicId = default(string)) + /// purpose. + /// Author of the detector. + /// Problem category. This serves for organizing + /// group for detectors. + /// List of Support Topics for which + /// this detector is enabled. + /// Analysis Types for which this detector + /// should apply to. + /// Whether this detector is an Analysis Detector or + /// not. Possible values include: 'Detector', 'Analysis', + /// 'CategoryOverview' + /// Defines score of a detector to power ML based + /// matching. + public DetectorInfo(string id = default(string), string name = default(string), string description = default(string), string author = default(string), string category = default(string), IList supportTopicList = default(IList), IList analysisType = default(IList), DetectorType? type = default(DetectorType?), double? score = default(double?)) { + Id = id; + Name = name; Description = description; + Author = author; Category = category; - SubCategory = subCategory; - SupportTopicId = supportTopicId; + SupportTopicList = supportTopicList; + AnalysisType = analysisType; + Type = type; + Score = score; CustomInit(); } @@ -49,28 +67,60 @@ public DetectorInfo() partial void CustomInit(); /// - /// Gets short description of the detector and its purpose + /// Gets id of detector + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets name of detector + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets short description of the detector and its purpose. /// [JsonProperty(PropertyName = "description")] public string Description { get; private set; } /// - /// Gets support Category + /// Gets author of the detector. + /// + [JsonProperty(PropertyName = "author")] + public string Author { get; private set; } + + /// + /// Gets problem category. This serves for organizing group for + /// detectors. /// [JsonProperty(PropertyName = "category")] public string Category { get; private set; } /// - /// Gets support Sub Category + /// Gets list of Support Topics for which this detector is enabled. + /// + [JsonProperty(PropertyName = "supportTopicList")] + public IList SupportTopicList { get; private set; } + + /// + /// Gets analysis Types for which this detector should apply to. + /// + [JsonProperty(PropertyName = "analysisType")] + public IList AnalysisType { get; private set; } + + /// + /// Gets whether this detector is an Analysis Detector or not. Possible + /// values include: 'Detector', 'Analysis', 'CategoryOverview' /// - [JsonProperty(PropertyName = "subCategory")] - public string SubCategory { get; private set; } + [JsonProperty(PropertyName = "type")] + public DetectorType? Type { get; private set; } /// - /// Gets support Topic Id + /// Gets defines score of a detector to power ML based matching. /// - [JsonProperty(PropertyName = "supportTopicId")] - public string SupportTopicId { get; private set; } + [JsonProperty(PropertyName = "score")] + public double? Score { get; private set; } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs index 853860a84c5c..79366fbad0af 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorResponse.cs @@ -40,11 +40,20 @@ public DetectorResponse() /// Resource type. /// metadata for the detector /// Data Set - public DetectorResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), DetectorInfo metadata = default(DetectorInfo), IList dataset = default(IList)) + /// Indicates status of the most severe + /// insight. + /// Additional configuration for + /// different data providers to be used by the UI + /// Suggested utterances where the + /// detector can be applicable. + public DetectorResponse(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), DetectorInfo metadata = default(DetectorInfo), IList dataset = default(IList), Status status = default(Status), IList dataProvidersMetadata = default(IList), QueryUtterancesResults suggestedUtterances = default(QueryUtterancesResults)) : base(id, name, kind, type) { Metadata = metadata; Dataset = dataset; + Status = status; + DataProvidersMetadata = dataProvidersMetadata; + SuggestedUtterances = suggestedUtterances; CustomInit(); } @@ -65,5 +74,25 @@ public DetectorResponse() [JsonProperty(PropertyName = "properties.dataset")] public IList Dataset { get; set; } + /// + /// Gets or sets indicates status of the most severe insight. + /// + [JsonProperty(PropertyName = "properties.status")] + public Status Status { get; set; } + + /// + /// Gets or sets additional configuration for different data providers + /// to be used by the UI + /// + [JsonProperty(PropertyName = "properties.dataProvidersMetadata")] + public IList DataProvidersMetadata { get; set; } + + /// + /// Gets or sets suggested utterances where the detector can be + /// applicable. + /// + [JsonProperty(PropertyName = "properties.suggestedUtterances")] + public QueryUtterancesResults SuggestedUtterances { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs new file mode 100644 index 000000000000..23370a2c5fec --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/DetectorType.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DetectorType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DetectorType + { + [EnumMember(Value = "Detector")] + Detector, + [EnumMember(Value = "Analysis")] + Analysis, + [EnumMember(Value = "CategoryOverview")] + CategoryOverview + } + internal static class DetectorTypeEnumExtension + { + internal static string ToSerializedValue(this DetectorType? value) + { + return value == null ? null : ((DetectorType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DetectorType value) + { + switch( value ) + { + case DetectorType.Detector: + return "Detector"; + case DetectorType.Analysis: + return "Analysis"; + case DetectorType.CategoryOverview: + return "CategoryOverview"; + } + return null; + } + + internal static DetectorType? ParseDetectorType(this string value) + { + switch( value ) + { + case "Detector": + return DetectorType.Detector; + case "Analysis": + return DetectorType.Analysis; + case "CategoryOverview": + return DetectorType.CategoryOverview; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.cs index 5d66f50d57a6..2cab9bdfebc6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Facebook.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the Facebook provider. + /// [Rest.Serialization.JsonTransformation] public partial class Facebook : ProxyOnlyResource { @@ -33,6 +36,15 @@ public Facebook() /// Resource Name. /// Kind of resource. /// Resource type. + /// <code>false</code> if the + /// Facebook provider should not be enabled despite the set + /// registration; otherwise, <code>true</code>. + /// The configuration settings of the app + /// registration for the Facebook provider. + /// The version of the Facebook api to be + /// used while logging in. + /// The configuration settings of the login + /// flow. public Facebook(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), AppRegistration registration = default(AppRegistration), string graphApiVersion = default(string), LoginScopes login = default(LoginScopes)) : base(id, name, kind, type) { @@ -49,21 +61,30 @@ public Facebook() partial void CustomInit(); /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if the + /// Facebook provider should not be enabled despite the set + /// registration; otherwise, + /// &lt;code&gt;true&lt;/code&gt;. /// [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } /// + /// Gets or sets the configuration settings of the app registration for + /// the Facebook provider. /// [JsonProperty(PropertyName = "properties.registration")] public AppRegistration Registration { get; set; } /// + /// Gets or sets the version of the Facebook api to be used while + /// logging in. /// [JsonProperty(PropertyName = "properties.graphApiVersion")] public string GraphApiVersion { get; set; } /// + /// Gets or sets the configuration settings of the login flow. /// [JsonProperty(PropertyName = "properties.login")] public LoginScopes Login { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.cs index d56ea63988fe..405d456abb74 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FileSystemTokenStore.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the storage of the tokens if a file + /// system is used. + /// [Rest.Serialization.JsonTransformation] public partial class FileSystemTokenStore : ProxyOnlyResource { @@ -33,6 +37,8 @@ public FileSystemTokenStore() /// Resource Name. /// Kind of resource. /// Resource type. + /// The directory in which the tokens will be + /// stored. public FileSystemTokenStore(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string directory = default(string)) : base(id, name, kind, type) { @@ -46,6 +52,7 @@ public FileSystemTokenStore() partial void CustomInit(); /// + /// Gets or sets the directory in which the tokens will be stored. /// [JsonProperty(PropertyName = "properties.directory")] public string Directory { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.cs index 239718fe2b4e..bd53d61ffe31 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ForwardProxy.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of a forward proxy used to make the + /// requests. + /// [Rest.Serialization.JsonTransformation] public partial class ForwardProxy : ProxyOnlyResource { @@ -33,8 +37,13 @@ public ForwardProxy() /// Resource Name. /// Kind of resource. /// Resource type. - /// Possible values include: 'NoProxy', + /// The convention used to determine the url + /// of the request made. Possible values include: 'NoProxy', /// 'Standard', 'Custom' + /// The name of the header + /// containing the host of the request. + /// The name of the header + /// containing the scheme of the request. public ForwardProxy(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ForwardProxyConvention? convention = default(ForwardProxyConvention?), string customHostHeaderName = default(string), string customProtoHeaderName = default(string)) : base(id, name, kind, type) { @@ -50,18 +59,23 @@ public ForwardProxy() partial void CustomInit(); /// - /// Gets or sets possible values include: 'NoProxy', 'Standard', + /// Gets or sets the convention used to determine the url of the + /// request made. Possible values include: 'NoProxy', 'Standard', /// 'Custom' /// [JsonProperty(PropertyName = "properties.convention")] public ForwardProxyConvention? Convention { get; set; } /// + /// Gets or sets the name of the header containing the host of the + /// request. /// [JsonProperty(PropertyName = "properties.customHostHeaderName")] public string CustomHostHeaderName { get; set; } /// + /// Gets or sets the name of the header containing the scheme of the + /// request. /// [JsonProperty(PropertyName = "properties.customProtoHeaderName")] public string CustomProtoHeaderName { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs new file mode 100644 index 000000000000..8dee701ca524 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMajorVersion.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Function App stack major version. + /// + public partial class FunctionAppMajorVersion + { + /// + /// Initializes a new instance of the FunctionAppMajorVersion class. + /// + public FunctionAppMajorVersion() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FunctionAppMajorVersion class. + /// + /// Function App stack major version (display + /// only). + /// Function App stack major version name. + /// Minor versions associated with the + /// major version. + public FunctionAppMajorVersion(string displayText = default(string), string value = default(string), IList minorVersions = default(IList)) + { + DisplayText = displayText; + Value = value; + MinorVersions = minorVersions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets function App stack major version (display only). + /// + [JsonProperty(PropertyName = "displayText")] + public string DisplayText { get; private set; } + + /// + /// Gets function App stack major version name. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Gets minor versions associated with the major version. + /// + [JsonProperty(PropertyName = "minorVersions")] + public IList MinorVersions { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.cs new file mode 100644 index 000000000000..bf288f1db6fc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppMinorVersion.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Function App stack minor version. + /// + public partial class FunctionAppMinorVersion + { + /// + /// Initializes a new instance of the FunctionAppMinorVersion class. + /// + public FunctionAppMinorVersion() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FunctionAppMinorVersion class. + /// + /// Function App stack (display + /// only). + /// Function App stack name. + /// Settings associated with the minor + /// version. + public FunctionAppMinorVersion(string displayText = default(string), string value = default(string), FunctionAppRuntimes stackSettings = default(FunctionAppRuntimes)) + { + DisplayText = displayText; + Value = value; + StackSettings = stackSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets function App stack (display only). + /// + [JsonProperty(PropertyName = "displayText")] + public string DisplayText { get; private set; } + + /// + /// Gets function App stack name. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Gets settings associated with the minor version. + /// + [JsonProperty(PropertyName = "stackSettings")] + public FunctionAppRuntimes StackSettings { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs new file mode 100644 index 000000000000..9077c3cdc7bc --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimeSettings.cs @@ -0,0 +1,193 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Function App runtime settings. + /// + public partial class FunctionAppRuntimeSettings + { + /// + /// Initializes a new instance of the FunctionAppRuntimeSettings class. + /// + public FunctionAppRuntimeSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FunctionAppRuntimeSettings class. + /// + /// Function App stack minor version + /// (runtime only). + /// <code>true</code> if + /// remote debugging is supported for the stack; otherwise, + /// <code>false</code>. + /// Application Insights settings + /// associated with the minor version. + /// GitHub Actions settings + /// associated with the minor version. + /// Application settings associated + /// with the minor version. + /// Configuration settings + /// associated with the minor version. + /// List of supported + /// Functions extension versions. + /// <code>true</code> if the stack + /// is in preview; otherwise, <code>false</code>. + /// <code>true</code> if the + /// stack is deprecated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the stack + /// should be hidden; otherwise, + /// <code>false</code>. + /// End-of-life date for the minor + /// version. + /// <code>true</code> if the + /// stack version is auto-updated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the + /// minor version is early-access; otherwise, + /// <code>false</code>. + /// <code>true</code> if the minor + /// version the default; otherwise, + /// <code>false</code>. + public FunctionAppRuntimeSettings(string runtimeVersion = default(string), bool? remoteDebuggingSupported = default(bool?), AppInsightsWebAppStackSettings appInsightsSettings = default(AppInsightsWebAppStackSettings), GitHubActionWebAppStackSettings gitHubActionSettings = default(GitHubActionWebAppStackSettings), IDictionary appSettingsDictionary = default(IDictionary), SiteConfigPropertiesDictionary siteConfigPropertiesDictionary = default(SiteConfigPropertiesDictionary), IList supportedFunctionsExtensionVersions = default(IList), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?), bool? isDefault = default(bool?)) + { + RuntimeVersion = runtimeVersion; + RemoteDebuggingSupported = remoteDebuggingSupported; + AppInsightsSettings = appInsightsSettings; + GitHubActionSettings = gitHubActionSettings; + AppSettingsDictionary = appSettingsDictionary; + SiteConfigPropertiesDictionary = siteConfigPropertiesDictionary; + SupportedFunctionsExtensionVersions = supportedFunctionsExtensionVersions; + IsPreview = isPreview; + IsDeprecated = isDeprecated; + IsHidden = isHidden; + EndOfLifeDate = endOfLifeDate; + IsAutoUpdate = isAutoUpdate; + IsEarlyAccess = isEarlyAccess; + IsDefault = isDefault; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets function App stack minor version (runtime only). + /// + [JsonProperty(PropertyName = "runtimeVersion")] + public string RuntimeVersion { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if remote + /// debugging is supported for the stack; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "remoteDebuggingSupported")] + public bool? RemoteDebuggingSupported { get; private set; } + + /// + /// Gets application Insights settings associated with the minor + /// version. + /// + [JsonProperty(PropertyName = "appInsightsSettings")] + public AppInsightsWebAppStackSettings AppInsightsSettings { get; private set; } + + /// + /// Gets gitHub Actions settings associated with the minor version. + /// + [JsonProperty(PropertyName = "gitHubActionSettings")] + public GitHubActionWebAppStackSettings GitHubActionSettings { get; private set; } + + /// + /// Gets application settings associated with the minor version. + /// + [JsonProperty(PropertyName = "appSettingsDictionary")] + public IDictionary AppSettingsDictionary { get; private set; } + + /// + /// Gets configuration settings associated with the minor version. + /// + [JsonProperty(PropertyName = "siteConfigPropertiesDictionary")] + public SiteConfigPropertiesDictionary SiteConfigPropertiesDictionary { get; private set; } + + /// + /// Gets list of supported Functions extension versions. + /// + [JsonProperty(PropertyName = "supportedFunctionsExtensionVersions")] + public IList SupportedFunctionsExtensionVersions { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// in preview; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isPreview")] + public bool? IsPreview { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// deprecated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDeprecated")] + public bool? IsDeprecated { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// should be hidden; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden { get; private set; } + + /// + /// Gets end-of-life date for the minor version. + /// + [JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// version is auto-updated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isAutoUpdate")] + public bool? IsAutoUpdate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the minor + /// version is early-access; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isEarlyAccess")] + public bool? IsEarlyAccess { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the minor + /// version the default; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDefault")] + public bool? IsDefault { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.cs new file mode 100644 index 000000000000..eab82eef40de --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppRuntimes.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Function App stack runtimes. + /// + public partial class FunctionAppRuntimes + { + /// + /// Initializes a new instance of the FunctionAppRuntimes class. + /// + public FunctionAppRuntimes() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FunctionAppRuntimes class. + /// + /// Linux-specific settings + /// associated with the minor version. + /// Windows-specific settings + /// associated with the minor version. + public FunctionAppRuntimes(FunctionAppRuntimeSettings linuxRuntimeSettings = default(FunctionAppRuntimeSettings), FunctionAppRuntimeSettings windowsRuntimeSettings = default(FunctionAppRuntimeSettings)) + { + LinuxRuntimeSettings = linuxRuntimeSettings; + WindowsRuntimeSettings = windowsRuntimeSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets linux-specific settings associated with the minor version. + /// + [JsonProperty(PropertyName = "linuxRuntimeSettings")] + public FunctionAppRuntimeSettings LinuxRuntimeSettings { get; private set; } + + /// + /// Gets windows-specific settings associated with the minor version. + /// + [JsonProperty(PropertyName = "windowsRuntimeSettings")] + public FunctionAppRuntimeSettings WindowsRuntimeSettings { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs new file mode 100644 index 000000000000..542801585fbf --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/FunctionAppStack.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Function App Stack. + /// + [Rest.Serialization.JsonTransformation] + public partial class FunctionAppStack : ProxyOnlyResource + { + /// + /// Initializes a new instance of the FunctionAppStack class. + /// + public FunctionAppStack() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FunctionAppStack class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Function App stack location. + /// Function App stack (display + /// only). + /// Function App stack name. + /// List of major versions + /// available. + /// Function App stack preferred OS. Possible + /// values include: 'Windows', 'Linux' + public FunctionAppStack(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string location = default(string), string displayText = default(string), string value = default(string), IList majorVersions = default(IList), StackPreferredOs? preferredOs = default(StackPreferredOs?)) + : base(id, name, kind, type) + { + Location = location; + DisplayText = displayText; + Value = value; + MajorVersions = majorVersions; + PreferredOs = preferredOs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets function App stack location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets function App stack (display only). + /// + [JsonProperty(PropertyName = "properties.displayText")] + public string DisplayText { get; private set; } + + /// + /// Gets function App stack name. + /// + [JsonProperty(PropertyName = "properties.value")] + public string Value { get; private set; } + + /// + /// Gets list of major versions available. + /// + [JsonProperty(PropertyName = "properties.majorVersions")] + public IList MajorVersions { get; private set; } + + /// + /// Gets function App stack preferred OS. Possible values include: + /// 'Windows', 'Linux' + /// + [JsonProperty(PropertyName = "properties.preferredOs")] + public StackPreferredOs? PreferredOs { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.cs index 8555c23b8f92..01a3ecabe7bb 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHub.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the GitHub provider. + /// [Rest.Serialization.JsonTransformation] public partial class GitHub : ProxyOnlyResource { @@ -33,6 +36,13 @@ public GitHub() /// Resource Name. /// Kind of resource. /// Resource type. + /// <code>false</code> if the GitHub + /// provider should not be enabled despite the set registration; + /// otherwise, <code>true</code>. + /// The configuration settings of the app + /// registration for the GitHub provider. + /// The configuration settings of the login + /// flow. public GitHub(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), ClientRegistration registration = default(ClientRegistration), LoginScopes login = default(LoginScopes)) : base(id, name, kind, type) { @@ -48,16 +58,22 @@ public GitHub() partial void CustomInit(); /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if the + /// GitHub provider should not be enabled despite the set registration; + /// otherwise, &lt;code&gt;true&lt;/code&gt;. /// [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } /// + /// Gets or sets the configuration settings of the app registration for + /// the GitHub provider. /// [JsonProperty(PropertyName = "properties.registration")] public ClientRegistration Registration { get; set; } /// + /// Gets or sets the configuration settings of the login flow. /// [JsonProperty(PropertyName = "properties.login")] public LoginScopes Login { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.cs new file mode 100644 index 000000000000..6db239e1d461 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionCodeConfiguration.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The GitHub action code configuration. + /// + public partial class GitHubActionCodeConfiguration + { + /// + /// Initializes a new instance of the GitHubActionCodeConfiguration + /// class. + /// + public GitHubActionCodeConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GitHubActionCodeConfiguration + /// class. + /// + /// Runtime stack is used to determine the + /// workflow file content for code base apps. + /// Runtime version is used to determine + /// what build version to set in the workflow file. + public GitHubActionCodeConfiguration(string runtimeStack = default(string), string runtimeVersion = default(string)) + { + RuntimeStack = runtimeStack; + RuntimeVersion = runtimeVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets runtime stack is used to determine the workflow file + /// content for code base apps. + /// + [JsonProperty(PropertyName = "runtimeStack")] + public string RuntimeStack { get; set; } + + /// + /// Gets or sets runtime version is used to determine what build + /// version to set in the workflow file. + /// + [JsonProperty(PropertyName = "runtimeVersion")] + public string RuntimeVersion { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs new file mode 100644 index 000000000000..80fbadc40478 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionConfiguration.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The GitHub action configuration. + /// + public partial class GitHubActionConfiguration + { + /// + /// Initializes a new instance of the GitHubActionConfiguration class. + /// + public GitHubActionConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GitHubActionConfiguration class. + /// + /// GitHub Action code + /// configuration. + /// GitHub Action container + /// configuration. + /// This will help determine the workflow + /// configuration to select. + /// Workflow option to determine + /// whether the workflow file should be generated and written to the + /// repository. + public GitHubActionConfiguration(GitHubActionCodeConfiguration codeConfiguration = default(GitHubActionCodeConfiguration), GitHubActionContainerConfiguration containerConfiguration = default(GitHubActionContainerConfiguration), bool? isLinux = default(bool?), bool? generateWorkflowFile = default(bool?)) + { + CodeConfiguration = codeConfiguration; + ContainerConfiguration = containerConfiguration; + IsLinux = isLinux; + GenerateWorkflowFile = generateWorkflowFile; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets gitHub Action code configuration. + /// + [JsonProperty(PropertyName = "codeConfiguration")] + public GitHubActionCodeConfiguration CodeConfiguration { get; set; } + + /// + /// Gets or sets gitHub Action container configuration. + /// + [JsonProperty(PropertyName = "containerConfiguration")] + public GitHubActionContainerConfiguration ContainerConfiguration { get; set; } + + /// + /// Gets or sets this will help determine the workflow configuration to + /// select. + /// + [JsonProperty(PropertyName = "isLinux")] + public bool? IsLinux { get; set; } + + /// + /// Gets or sets workflow option to determine whether the workflow file + /// should be generated and written to the repository. + /// + [JsonProperty(PropertyName = "generateWorkflowFile")] + public bool? GenerateWorkflowFile { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.cs new file mode 100644 index 000000000000..07b4058844c6 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionContainerConfiguration.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The GitHub action container configuration. + /// + public partial class GitHubActionContainerConfiguration + { + /// + /// Initializes a new instance of the + /// GitHubActionContainerConfiguration class. + /// + public GitHubActionContainerConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GitHubActionContainerConfiguration class. + /// + /// The server URL for the container registry + /// where the build will be hosted. + /// The image name for the build. + /// The username used to upload the image to the + /// container registry. + /// The password used to upload the image to the + /// container registry. + public GitHubActionContainerConfiguration(string serverUrl = default(string), string imageName = default(string), string username = default(string), string password = default(string)) + { + ServerUrl = serverUrl; + ImageName = imageName; + Username = username; + Password = password; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the server URL for the container registry where the + /// build will be hosted. + /// + [JsonProperty(PropertyName = "serverUrl")] + public string ServerUrl { get; set; } + + /// + /// Gets or sets the image name for the build. + /// + [JsonProperty(PropertyName = "imageName")] + public string ImageName { get; set; } + + /// + /// Gets or sets the username used to upload the image to the container + /// registry. + /// + [JsonProperty(PropertyName = "username")] + public string Username { get; set; } + + /// + /// Gets or sets the password used to upload the image to the container + /// registry. + /// + [JsonProperty(PropertyName = "password")] + public string Password { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs new file mode 100644 index 000000000000..6a49283cffe7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GitHubActionWebAppStackSettings.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// GitHub Actions Web App stack settings. + /// + public partial class GitHubActionWebAppStackSettings + { + /// + /// Initializes a new instance of the GitHubActionWebAppStackSettings + /// class. + /// + public GitHubActionWebAppStackSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GitHubActionWebAppStackSettings + /// class. + /// + /// <code>true</code> if GitHub + /// Actions is supported for the stack; otherwise, + /// <code>false</code>. + /// The minor version that is supported + /// for GitHub Actions. + public GitHubActionWebAppStackSettings(bool? isSupported = default(bool?), string supportedVersion = default(string)) + { + IsSupported = isSupported; + SupportedVersion = supportedVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if GitHub + /// Actions is supported for the stack; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isSupported")] + public bool? IsSupported { get; private set; } + + /// + /// Gets the minor version that is supported for GitHub Actions. + /// + [JsonProperty(PropertyName = "supportedVersion")] + public string SupportedVersion { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.cs index 6e668cba711c..10a361a69831 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/GlobalValidation.cs @@ -17,6 +17,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using System.Collections.Generic; using System.Linq; + /// + /// The configuration settings that determines the validation flow of users + /// using App Service Authentication/Authorization. + /// [Rest.Serialization.JsonTransformation] public partial class GlobalValidation : ProxyOnlyResource { @@ -35,9 +39,20 @@ public GlobalValidation() /// Resource Name. /// Kind of resource. /// Resource type. - /// Possible values include: - /// 'RedirectToLoginPage', 'AllowAnonymous', 'Return401', - /// 'Return403' + /// <code>true</code> + /// if the authentication flow is required any request is made; + /// otherwise, <code>false</code>. + /// The action to take when + /// an unauthenticated client attempts to access the app. Possible + /// values include: 'RedirectToLoginPage', 'AllowAnonymous', + /// 'Return401', 'Return403' + /// The default authentication + /// provider to use when multiple providers are configured. + /// This setting is only needed if multiple providers are configured + /// and the unauthenticated client + /// action is set to "RedirectToLoginPage". + /// The paths for which unauthenticated + /// flow would not be redirected to the login page. public GlobalValidation(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? requireAuthentication = default(bool?), UnauthenticatedClientActionV2? unauthenticatedClientAction = default(UnauthenticatedClientActionV2?), string redirectToProvider = default(string), IList excludedPaths = default(IList)) : base(id, name, kind, type) { @@ -54,23 +69,34 @@ public GlobalValidation() partial void CustomInit(); /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// authentication flow is required any request is made; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. /// [JsonProperty(PropertyName = "properties.requireAuthentication")] public bool? RequireAuthentication { get; set; } /// - /// Gets or sets possible values include: 'RedirectToLoginPage', - /// 'AllowAnonymous', 'Return401', 'Return403' + /// Gets or sets the action to take when an unauthenticated client + /// attempts to access the app. Possible values include: + /// 'RedirectToLoginPage', 'AllowAnonymous', 'Return401', 'Return403' /// [JsonProperty(PropertyName = "properties.unauthenticatedClientAction")] public UnauthenticatedClientActionV2? UnauthenticatedClientAction { get; set; } /// + /// Gets or sets the default authentication provider to use when + /// multiple providers are configured. + /// This setting is only needed if multiple providers are configured + /// and the unauthenticated client + /// action is set to "RedirectToLoginPage". /// [JsonProperty(PropertyName = "properties.redirectToProvider")] public string RedirectToProvider { get; set; } /// + /// Gets or sets the paths for which unauthenticated flow would not be + /// redirected to the login page. /// [JsonProperty(PropertyName = "properties.excludedPaths")] public IList ExcludedPaths { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.cs index 26af1e210ab7..88a648867d73 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Google.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the Google provider. + /// [Rest.Serialization.JsonTransformation] public partial class Google : ProxyOnlyResource { @@ -33,6 +36,15 @@ public Google() /// Resource Name. /// Kind of resource. /// Resource type. + /// <code>false</code> if the Google + /// provider should not be enabled despite the set registration; + /// otherwise, <code>true</code>. + /// The configuration settings of the app + /// registration for the Google provider. + /// The configuration settings of the login + /// flow. + /// The configuration settings of the Azure + /// Active Directory token validation flow. public Google(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), ClientRegistration registration = default(ClientRegistration), LoginScopes login = default(LoginScopes), AllowedAudiencesValidation validation = default(AllowedAudiencesValidation)) : base(id, name, kind, type) { @@ -49,21 +61,29 @@ public Google() partial void CustomInit(); /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if the + /// Google provider should not be enabled despite the set registration; + /// otherwise, &lt;code&gt;true&lt;/code&gt;. /// [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } /// + /// Gets or sets the configuration settings of the app registration for + /// the Google provider. /// [JsonProperty(PropertyName = "properties.registration")] public ClientRegistration Registration { get; set; } /// + /// Gets or sets the configuration settings of the login flow. /// [JsonProperty(PropertyName = "properties.login")] public LoginScopes Login { get; set; } /// + /// Gets or sets the configuration settings of the Azure Active + /// Directory token validation flow. /// [JsonProperty(PropertyName = "properties.validation")] public AllowedAudiencesValidation Validation { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.cs index b5090a80f932..e57e53390fcd 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettings.cs @@ -15,6 +15,11 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the HTTP requests for authentication and + /// authorization requests made against App Service + /// Authentication/Authorization. + /// [Rest.Serialization.JsonTransformation] public partial class HttpSettings : ProxyOnlyResource { @@ -33,6 +38,13 @@ public HttpSettings() /// Resource Name. /// Kind of resource. /// Resource type. + /// <code>false</code> if the + /// authentication/authorization responses not having the HTTPS scheme + /// are permissible; otherwise, <code>true</code>. + /// The configuration settings of the paths HTTP + /// requests. + /// The configuration settings of a forward + /// proxy used to make the requests. public HttpSettings(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? requireHttps = default(bool?), HttpSettingsRoutes routes = default(HttpSettingsRoutes), ForwardProxy forwardProxy = default(ForwardProxy)) : base(id, name, kind, type) { @@ -48,16 +60,23 @@ public HttpSettings() partial void CustomInit(); /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if the + /// authentication/authorization responses not having the HTTPS scheme + /// are permissible; otherwise, + /// &lt;code&gt;true&lt;/code&gt;. /// [JsonProperty(PropertyName = "properties.requireHttps")] public bool? RequireHttps { get; set; } /// + /// Gets or sets the configuration settings of the paths HTTP requests. /// [JsonProperty(PropertyName = "properties.routes")] public HttpSettingsRoutes Routes { get; set; } /// + /// Gets or sets the configuration settings of a forward proxy used to + /// make the requests. /// [JsonProperty(PropertyName = "properties.forwardProxy")] public ForwardProxy ForwardProxy { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.cs index 1c71deecd7f2..92ac617b5368 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/HttpSettingsRoutes.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the paths HTTP requests. + /// [Rest.Serialization.JsonTransformation] public partial class HttpSettingsRoutes : ProxyOnlyResource { @@ -33,6 +36,8 @@ public HttpSettingsRoutes() /// Resource Name. /// Kind of resource. /// Resource type. + /// The prefix that should precede all the + /// authentication/authorization paths. public HttpSettingsRoutes(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string apiPrefix = default(string)) : base(id, name, kind, type) { @@ -46,6 +51,8 @@ public HttpSettingsRoutes() partial void CustomInit(); /// + /// Gets or sets the prefix that should precede all the + /// authentication/authorization paths. /// [JsonProperty(PropertyName = "properties.apiPrefix")] public string ApiPrefix { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs index 25b7f98e559f..df08efecfb75 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/IdentityProviders.cs @@ -17,6 +17,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using System.Collections.Generic; using System.Linq; + /// + /// The configuration settings of each of the identity providers used to + /// configure App Service Authentication/Authorization. + /// [Rest.Serialization.JsonTransformation] public partial class IdentityProviders : ProxyOnlyResource { @@ -35,7 +39,27 @@ public IdentityProviders() /// Resource Name. /// Kind of resource. /// Resource type. - public IdentityProviders(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), Facebook facebook = default(Facebook), GitHub gitHub = default(GitHub), Google google = default(Google), Twitter twitter = default(Twitter), IDictionary customOpenIdConnectProviders = default(IDictionary)) + /// The configuration settings of + /// the Azure Active directory provider. + /// The configuration settings of the Facebook + /// provider. + /// The configuration settings of the GitHub + /// provider. + /// The configuration settings of the Google + /// provider. + /// The configuration settings of the Twitter + /// provider. + /// The map of the name of + /// the alias of each custom Open ID Connect provider to the + /// configuration settings of the custom Open ID Connect + /// provider. + /// The configuration settings of + /// the legacy Microsoft Account provider. + /// The configuration settings of the Apple + /// provider. + /// The configuration settings of the + /// Azure Static Web Apps provider. + public IdentityProviders(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), Facebook facebook = default(Facebook), GitHub gitHub = default(GitHub), Google google = default(Google), Twitter twitter = default(Twitter), IDictionary customOpenIdConnectProviders = default(IDictionary), LegacyMicrosoftAccount legacyMicrosoftAccount = default(LegacyMicrosoftAccount), Apple apple = default(Apple), AzureStaticWebApps azureStaticWebApps = default(AzureStaticWebApps)) : base(id, name, kind, type) { AzureActiveDirectory = azureActiveDirectory; @@ -44,6 +68,9 @@ public IdentityProviders() Google = google; Twitter = twitter; CustomOpenIdConnectProviders = customOpenIdConnectProviders; + LegacyMicrosoftAccount = legacyMicrosoftAccount; + Apple = apple; + AzureStaticWebApps = azureStaticWebApps; CustomInit(); } @@ -53,34 +80,63 @@ public IdentityProviders() partial void CustomInit(); /// + /// Gets or sets the configuration settings of the Azure Active + /// directory provider. /// [JsonProperty(PropertyName = "properties.azureActiveDirectory")] public AzureActiveDirectory AzureActiveDirectory { get; set; } /// + /// Gets or sets the configuration settings of the Facebook provider. /// [JsonProperty(PropertyName = "properties.facebook")] public Facebook Facebook { get; set; } /// + /// Gets or sets the configuration settings of the GitHub provider. /// [JsonProperty(PropertyName = "properties.gitHub")] public GitHub GitHub { get; set; } /// + /// Gets or sets the configuration settings of the Google provider. /// [JsonProperty(PropertyName = "properties.google")] public Google Google { get; set; } /// + /// Gets or sets the configuration settings of the Twitter provider. /// [JsonProperty(PropertyName = "properties.twitter")] public Twitter Twitter { get; set; } /// + /// Gets or sets the map of the name of the alias of each custom Open + /// ID Connect provider to the + /// configuration settings of the custom Open ID Connect provider. /// [JsonProperty(PropertyName = "properties.customOpenIdConnectProviders")] public IDictionary CustomOpenIdConnectProviders { get; set; } + /// + /// Gets or sets the configuration settings of the legacy Microsoft + /// Account provider. + /// + [JsonProperty(PropertyName = "properties.legacyMicrosoftAccount")] + public LegacyMicrosoftAccount LegacyMicrosoftAccount { get; set; } + + /// + /// Gets or sets the configuration settings of the Apple provider. + /// + [JsonProperty(PropertyName = "properties.apple")] + public Apple Apple { get; set; } + + /// + /// Gets or sets the configuration settings of the Azure Static Web + /// Apps provider. + /// + [JsonProperty(PropertyName = "properties.azureStaticWebApps")] + public AzureStaticWebApps AzureStaticWebApps { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.cs new file mode 100644 index 000000000000..e625bc5841cd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/InsightStatus.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.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for InsightStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum InsightStatus + { + [EnumMember(Value = "Critical")] + Critical, + [EnumMember(Value = "Warning")] + Warning, + [EnumMember(Value = "Info")] + Info, + [EnumMember(Value = "Success")] + Success, + [EnumMember(Value = "None")] + None + } + internal static class InsightStatusEnumExtension + { + internal static string ToSerializedValue(this InsightStatus? value) + { + return value == null ? null : ((InsightStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this InsightStatus value) + { + switch( value ) + { + case InsightStatus.Critical: + return "Critical"; + case InsightStatus.Warning: + return "Warning"; + case InsightStatus.Info: + return "Info"; + case InsightStatus.Success: + return "Success"; + case InsightStatus.None: + return "None"; + } + return null; + } + + internal static InsightStatus? ParseInsightStatus(this string value) + { + switch( value ) + { + case "Critical": + return InsightStatus.Critical; + case "Warning": + return InsightStatus.Warning; + case "Info": + return InsightStatus.Info; + case "Success": + return InsightStatus.Success; + case "None": + return InsightStatus.None; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.cs index b6ac7bf567d9..509b9ba41405 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/JwtClaimChecks.cs @@ -17,6 +17,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using System.Collections.Generic; using System.Linq; + /// + /// The configuration settings of the checks that should be made while + /// validating the JWT Claims. + /// [Rest.Serialization.JsonTransformation] public partial class JwtClaimChecks : ProxyOnlyResource { @@ -35,6 +39,9 @@ public JwtClaimChecks() /// Resource Name. /// Kind of resource. /// Resource type. + /// The list of the allowed groups. + /// The list of the allowed + /// client applications. public JwtClaimChecks(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList allowedGroups = default(IList), IList allowedClientApplications = default(IList)) : base(id, name, kind, type) { @@ -49,11 +56,13 @@ public JwtClaimChecks() partial void CustomInit(); /// + /// Gets or sets the list of the allowed groups. /// [JsonProperty(PropertyName = "properties.allowedGroups")] public IList AllowedGroups { get; set; } /// + /// Gets or sets the list of the allowed client applications. /// [JsonProperty(PropertyName = "properties.allowedClientApplications")] public IList AllowedClientApplications { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs new file mode 100644 index 000000000000..bcad1cb1452e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KeyValuePairStringObject.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class KeyValuePairStringObject + { + /// + /// Initializes a new instance of the KeyValuePairStringObject class. + /// + public KeyValuePairStringObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KeyValuePairStringObject class. + /// + public KeyValuePairStringObject(string key = default(string), object value = default(object)) + { + Key = key; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "value")] + public object Value { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.cs new file mode 100644 index 000000000000..9153aca339a0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/KubeEnvironmentProfile.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specification for a Kubernetes Environment to use for this resource. + /// + public partial class KubeEnvironmentProfile + { + /// + /// Initializes a new instance of the KubeEnvironmentProfile class. + /// + public KubeEnvironmentProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KubeEnvironmentProfile class. + /// + /// Resource ID of the Kubernetes Environment. + /// Name of the Kubernetes Environment. + /// Resource type of the Kubernetes + /// Environment. + public KubeEnvironmentProfile(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 or sets resource ID of the Kubernetes Environment. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets name of the Kubernetes Environment. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type of the Kubernetes Environment. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.cs new file mode 100644 index 000000000000..44d19dd1bcfe --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LegacyMicrosoftAccount.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The configuration settings of the legacy Microsoft Account provider. + /// + [Rest.Serialization.JsonTransformation] + public partial class LegacyMicrosoftAccount : ProxyOnlyResource + { + /// + /// Initializes a new instance of the LegacyMicrosoftAccount class. + /// + public LegacyMicrosoftAccount() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LegacyMicrosoftAccount class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// <code>false</code> if the legacy + /// Microsoft Account provider should not be enabled despite the set + /// registration; otherwise, <code>true</code>. + /// The configuration settings of the app + /// registration for the legacy Microsoft Account provider. + /// The configuration settings of the login + /// flow. + /// The configuration settings of the legacy + /// Microsoft Account provider token validation flow. + public LegacyMicrosoftAccount(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), ClientRegistration registration = default(ClientRegistration), LoginScopes login = default(LoginScopes), AllowedAudiencesValidation validation = default(AllowedAudiencesValidation)) + : base(id, name, kind, type) + { + Enabled = enabled; + Registration = registration; + Login = login; + Validation = validation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if the + /// legacy Microsoft Account provider should not be enabled despite the + /// set registration; otherwise, + /// &lt;code&gt;true&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled { get; set; } + + /// + /// Gets or sets the configuration settings of the app registration for + /// the legacy Microsoft Account provider. + /// + [JsonProperty(PropertyName = "properties.registration")] + public ClientRegistration Registration { get; set; } + + /// + /// Gets or sets the configuration settings of the login flow. + /// + [JsonProperty(PropertyName = "properties.login")] + public LoginScopes Login { get; set; } + + /// + /// Gets or sets the configuration settings of the legacy Microsoft + /// Account provider token validation flow. + /// + [JsonProperty(PropertyName = "properties.validation")] + public AllowedAudiencesValidation Validation { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs new file mode 100644 index 000000000000..7abd94c002c7 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LinuxJavaContainerSettings.cs @@ -0,0 +1,127 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Linux Java Container settings. + /// + public partial class LinuxJavaContainerSettings + { + /// + /// Initializes a new instance of the LinuxJavaContainerSettings class. + /// + public LinuxJavaContainerSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinuxJavaContainerSettings class. + /// + /// Java 11 version (runtime only). + /// Java 8 version (runtime only). + /// <code>true</code> if the stack + /// is in preview; otherwise, <code>false</code>. + /// <code>true</code> if the + /// stack is deprecated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the stack + /// should be hidden; otherwise, + /// <code>false</code>. + /// End-of-life date for the minor + /// version. + /// <code>true</code> if the + /// stack version is auto-updated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the + /// minor version is early-access; otherwise, + /// <code>false</code>. + public LinuxJavaContainerSettings(string java11Runtime = default(string), string java8Runtime = default(string), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) + { + Java11Runtime = java11Runtime; + Java8Runtime = java8Runtime; + IsPreview = isPreview; + IsDeprecated = isDeprecated; + IsHidden = isHidden; + EndOfLifeDate = endOfLifeDate; + IsAutoUpdate = isAutoUpdate; + IsEarlyAccess = isEarlyAccess; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets java 11 version (runtime only). + /// + [JsonProperty(PropertyName = "java11Runtime")] + public string Java11Runtime { get; private set; } + + /// + /// Gets java 8 version (runtime only). + /// + [JsonProperty(PropertyName = "java8Runtime")] + public string Java8Runtime { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// in preview; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isPreview")] + public bool? IsPreview { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// deprecated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDeprecated")] + public bool? IsDeprecated { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// should be hidden; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden { get; private set; } + + /// + /// Gets end-of-life date for the minor version. + /// + [JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// version is auto-updated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isAutoUpdate")] + public bool? IsAutoUpdate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the minor + /// version is early-access; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isEarlyAccess")] + public bool? IsEarlyAccess { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs index a4a9f849e4f9..b635569ca214 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoadBalancingMode.cs @@ -19,6 +19,6 @@ public static class LoadBalancingMode public const string None = "None"; public const string Web = "Web"; public const string Publishing = "Publishing"; - public const string WebPublishing = "Web,Publishing"; + public const string WebPublishing = "Web, Publishing"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.cs index d14e1bc90117..f88dd3ce8e9b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Login.cs @@ -17,6 +17,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using System.Collections.Generic; using System.Linq; + /// + /// The configuration settings of the login flow of users using App Service + /// Authentication/Authorization. + /// [Rest.Serialization.JsonTransformation] public partial class Login : ProxyOnlyResource { @@ -35,6 +39,25 @@ public Login() /// Resource Name. /// Kind of resource. /// Resource type. + /// The routes that specify the endpoints used for + /// login and logout requests. + /// The configuration settings of the token + /// store. + /// <code>true</code> + /// if the fragments from the request are preserved after the login + /// request is made; otherwise, <code>false</code>. + /// External URLs that can be + /// redirected to as part of logging in or logging out of the app. Note + /// that the query string part of the URL is ignored. + /// This is an advanced setting typically only needed by Windows Store + /// application backends. + /// Note that URLs within the current domain are always implicitly + /// allowed. + /// The configuration settings of the + /// session cookie's expiration. + /// The configuration settings of the nonce used in + /// the login flow. public Login(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), LoginRoutes routes = default(LoginRoutes), TokenStore tokenStore = default(TokenStore), bool? preserveUrlFragmentsForLogins = default(bool?), IList allowedExternalRedirectUrls = default(IList), CookieExpiration cookieExpiration = default(CookieExpiration), Nonce nonce = default(Nonce)) : base(id, name, kind, type) { @@ -53,31 +76,48 @@ public Login() partial void CustomInit(); /// + /// Gets or sets the routes that specify the endpoints used for login + /// and logout requests. /// [JsonProperty(PropertyName = "properties.routes")] public LoginRoutes Routes { get; set; } /// + /// Gets or sets the configuration settings of the token store. /// [JsonProperty(PropertyName = "properties.tokenStore")] public TokenStore TokenStore { get; set; } /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the + /// fragments from the request are preserved after the login request is + /// made; otherwise, &lt;code&gt;false&lt;/code&gt;. /// [JsonProperty(PropertyName = "properties.preserveUrlFragmentsForLogins")] public bool? PreserveUrlFragmentsForLogins { get; set; } /// + /// Gets or sets external URLs that can be redirected to as part of + /// logging in or logging out of the app. Note that the query string + /// part of the URL is ignored. + /// This is an advanced setting typically only needed by Windows Store + /// application backends. + /// Note that URLs within the current domain are always implicitly + /// allowed. /// [JsonProperty(PropertyName = "properties.allowedExternalRedirectUrls")] public IList AllowedExternalRedirectUrls { get; set; } /// + /// Gets or sets the configuration settings of the session cookie's + /// expiration. /// [JsonProperty(PropertyName = "properties.cookieExpiration")] public CookieExpiration CookieExpiration { get; set; } /// + /// Gets or sets the configuration settings of the nonce used in the + /// login flow. /// [JsonProperty(PropertyName = "properties.nonce")] public Nonce Nonce { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.cs index 9b31fe5653bb..34b86a866e14 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginRoutes.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The routes that specify the endpoints used for login and logout + /// requests. + /// [Rest.Serialization.JsonTransformation] public partial class LoginRoutes : ProxyOnlyResource { @@ -33,6 +37,8 @@ public LoginRoutes() /// Resource Name. /// Kind of resource. /// Resource type. + /// The endpoint at which a logout request + /// should be made. public LoginRoutes(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string logoutEndpoint = default(string)) : base(id, name, kind, type) { @@ -46,6 +52,7 @@ public LoginRoutes() partial void CustomInit(); /// + /// Gets or sets the endpoint at which a logout request should be made. /// [JsonProperty(PropertyName = "properties.logoutEndpoint")] public string LogoutEndpoint { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.cs index ec2430e910eb..6c64485bc850 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/LoginScopes.cs @@ -17,6 +17,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using System.Collections.Generic; using System.Linq; + /// + /// The configuration settings of the login flow, including the scopes that + /// should be requested. + /// [Rest.Serialization.JsonTransformation] public partial class LoginScopes : ProxyOnlyResource { @@ -35,6 +39,8 @@ public LoginScopes() /// Resource Name. /// Kind of resource. /// Resource type. + /// A list of the scopes that should be requested + /// while authenticating. public LoginScopes(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList scopes = default(IList)) : base(id, name, kind, type) { @@ -48,6 +54,8 @@ public LoginScopes() partial void CustomInit(); /// + /// Gets or sets a list of the scopes that should be requested while + /// authenticating. /// [JsonProperty(PropertyName = "properties.scopes")] public IList Scopes { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkAccessControlEntry.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkAccessControlEntry.cs deleted file mode 100644 index a09d92546938..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/NetworkAccessControlEntry.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Network access control entry. - /// - public partial class NetworkAccessControlEntry - { - /// - /// Initializes a new instance of the NetworkAccessControlEntry class. - /// - public NetworkAccessControlEntry() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NetworkAccessControlEntry class. - /// - /// Action object. Possible values include: - /// 'Permit', 'Deny' - /// Description of network access control - /// entry. - /// Order of precedence. - /// Remote subnet. - public NetworkAccessControlEntry(AccessControlEntryAction? action = default(AccessControlEntryAction?), string description = default(string), int? order = default(int?), string remoteSubnet = default(string)) - { - Action = action; - Description = description; - Order = order; - RemoteSubnet = remoteSubnet; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets action object. Possible values include: 'Permit', - /// 'Deny' - /// - [JsonProperty(PropertyName = "action")] - public AccessControlEntryAction? Action { get; set; } - - /// - /// Gets or sets description of network access control entry. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets or sets order of precedence. - /// - [JsonProperty(PropertyName = "order")] - public int? Order { get; set; } - - /// - /// Gets or sets remote subnet. - /// - [JsonProperty(PropertyName = "remoteSubnet")] - public string RemoteSubnet { get; set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.cs index 0057825eab8b..97bf46e1c018 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Nonce.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the nonce used in the login flow. + /// [Rest.Serialization.JsonTransformation] public partial class Nonce : ProxyOnlyResource { @@ -33,6 +36,11 @@ public Nonce() /// Resource Name. /// Kind of resource. /// Resource type. + /// <code>false</code> if the + /// nonce should not be validated while completing the login flow; + /// otherwise, <code>true</code>. + /// The time after the request is + /// made when the nonce should expire. public Nonce(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? validateNonce = default(bool?), string nonceExpirationInterval = default(string)) : base(id, name, kind, type) { @@ -47,11 +55,16 @@ public Nonce() partial void CustomInit(); /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if the + /// nonce should not be validated while completing the login flow; + /// otherwise, &lt;code&gt;true&lt;/code&gt;. /// [JsonProperty(PropertyName = "properties.validateNonce")] public bool? ValidateNonce { get; set; } /// + /// Gets or sets the time after the request is made when the nonce + /// should expire. /// [JsonProperty(PropertyName = "properties.nonceExpirationInterval")] public string NonceExpirationInterval { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.cs index c0ce182af5cf..18a8ac948d82 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectClientCredential.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The authentication client credentials of the custom Open ID Connect + /// provider. + /// [Rest.Serialization.JsonTransformation] public partial class OpenIdConnectClientCredential : ProxyOnlyResource { @@ -35,8 +39,10 @@ public OpenIdConnectClientCredential() /// Resource Name. /// Kind of resource. /// Resource type. - /// Possible values include: - /// 'ClientSecretPost' + /// The method that should be used to authenticate + /// the user. Possible values include: 'ClientSecretPost' + /// The app setting that contains + /// the client secret for the custom Open ID Connect provider. public OpenIdConnectClientCredential(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), ClientCredentialMethod? method = default(ClientCredentialMethod?), string clientSecretSettingName = default(string)) : base(id, name, kind, type) { @@ -51,12 +57,15 @@ public OpenIdConnectClientCredential() partial void CustomInit(); /// - /// Gets or sets possible values include: 'ClientSecretPost' + /// Gets or sets the method that should be used to authenticate the + /// user. Possible values include: 'ClientSecretPost' /// [JsonProperty(PropertyName = "properties.method")] public ClientCredentialMethod? Method { get; set; } /// + /// Gets or sets the app setting that contains the client secret for + /// the custom Open ID Connect provider. /// [JsonProperty(PropertyName = "properties.clientSecretSettingName")] public string ClientSecretSettingName { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.cs index fe09ee1f099d..70fddef9457a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectConfig.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the endpoints used for the custom Open ID + /// Connect provider. + /// [Rest.Serialization.JsonTransformation] public partial class OpenIdConnectConfig : ProxyOnlyResource { @@ -33,6 +37,15 @@ public OpenIdConnectConfig() /// Resource Name. /// Kind of resource. /// Resource type. + /// The endpoint to be used to make + /// an authorization request. + /// The endpoint to be used to request a + /// token. + /// The endpoint that issues the token. + /// The endpoint that provides the keys + /// necessary to validate the token. + /// The endpoint that + /// contains all the configuration endpoints for the provider. public OpenIdConnectConfig(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string authorizationEndpoint = default(string), string tokenEndpoint = default(string), string issuer = default(string), string certificationUri = default(string), string wellKnownOpenIdConfiguration = default(string)) : base(id, name, kind, type) { @@ -50,26 +63,34 @@ public OpenIdConnectConfig() partial void CustomInit(); /// + /// Gets or sets the endpoint to be used to make an authorization + /// request. /// [JsonProperty(PropertyName = "properties.authorizationEndpoint")] public string AuthorizationEndpoint { get; set; } /// + /// Gets or sets the endpoint to be used to request a token. /// [JsonProperty(PropertyName = "properties.tokenEndpoint")] public string TokenEndpoint { get; set; } /// + /// Gets or sets the endpoint that issues the token. /// [JsonProperty(PropertyName = "properties.issuer")] public string Issuer { get; set; } /// + /// Gets or sets the endpoint that provides the keys necessary to + /// validate the token. /// [JsonProperty(PropertyName = "properties.certificationUri")] public string CertificationUri { get; set; } /// + /// Gets or sets the endpoint that contains all the configuration + /// endpoints for the provider. /// [JsonProperty(PropertyName = "properties.wellKnownOpenIdConfiguration")] public string WellKnownOpenIdConfiguration { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.cs index cc0fe8682df0..cc9c4fecabc8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectLogin.cs @@ -17,6 +17,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using System.Collections.Generic; using System.Linq; + /// + /// The configuration settings of the login flow of the custom Open ID + /// Connect provider. + /// [Rest.Serialization.JsonTransformation] public partial class OpenIdConnectLogin : ProxyOnlyResource { @@ -35,6 +39,10 @@ public OpenIdConnectLogin() /// Resource Name. /// Kind of resource. /// Resource type. + /// The name of the claim that contains the + /// users name. + /// A list of the scopes that should be requested + /// while authenticating. public OpenIdConnectLogin(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string nameClaimType = default(string), IList scopes = default(IList)) : base(id, name, kind, type) { @@ -49,11 +57,14 @@ public OpenIdConnectLogin() partial void CustomInit(); /// + /// Gets or sets the name of the claim that contains the users name. /// [JsonProperty(PropertyName = "properties.nameClaimType")] public string NameClaimType { get; set; } /// + /// Gets or sets a list of the scopes that should be requested while + /// authenticating. /// [JsonProperty(PropertyName = "properties.scopes")] public IList Scopes { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.cs index 810737d9830a..f9ae80692d1a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/OpenIdConnectRegistration.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the app registration for the custom Open + /// ID Connect provider. + /// [Rest.Serialization.JsonTransformation] public partial class OpenIdConnectRegistration : ProxyOnlyResource { @@ -33,6 +37,13 @@ public OpenIdConnectRegistration() /// Resource Name. /// Kind of resource. /// Resource type. + /// The client id of the custom Open ID Connect + /// provider. + /// The authentication credentials of + /// the custom Open ID Connect provider. + /// The configuration settings + /// of the endpoints used for the custom Open ID Connect + /// provider. public OpenIdConnectRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string clientId = default(string), OpenIdConnectClientCredential clientCredential = default(OpenIdConnectClientCredential), OpenIdConnectConfig openIdConnectConfiguration = default(OpenIdConnectConfig)) : base(id, name, kind, type) { @@ -48,16 +59,21 @@ public OpenIdConnectRegistration() partial void CustomInit(); /// + /// Gets or sets the client id of the custom Open ID Connect provider. /// [JsonProperty(PropertyName = "properties.clientId")] public string ClientId { get; set; } /// + /// Gets or sets the authentication credentials of the custom Open ID + /// Connect provider. /// [JsonProperty(PropertyName = "properties.clientCredential")] public OpenIdConnectClientCredential ClientCredential { get; set; } /// + /// Gets or sets the configuration settings of the endpoints used for + /// the custom Open ID Connect provider. /// [JsonProperty(PropertyName = "properties.openIdConnectConfiguration")] public OpenIdConnectConfig OpenIdConnectConfiguration { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.cs new file mode 100644 index 000000000000..eeffe769f026 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResult.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Result for utterances query. + /// + public partial class QueryUtterancesResult + { + /// + /// Initializes a new instance of the QueryUtterancesResult class. + /// + public QueryUtterancesResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryUtterancesResult class. + /// + /// A sample utterance. + /// Score of a sample utterance. + public QueryUtterancesResult(SampleUtterance sampleUtterance = default(SampleUtterance), double? score = default(double?)) + { + SampleUtterance = sampleUtterance; + Score = score; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a sample utterance. + /// + [JsonProperty(PropertyName = "sampleUtterance")] + public SampleUtterance SampleUtterance { get; set; } + + /// + /// Gets or sets score of a sample utterance. + /// + [JsonProperty(PropertyName = "score")] + public double? Score { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.cs new file mode 100644 index 000000000000..9d352753d920 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/QueryUtterancesResults.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Suggested utterances where the detector can be applicable + /// + public partial class QueryUtterancesResults + { + /// + /// Initializes a new instance of the QueryUtterancesResults class. + /// + public QueryUtterancesResults() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryUtterancesResults class. + /// + /// Search Query. + /// Array of utterance results for search + /// query. + public QueryUtterancesResults(string query = default(string), IList results = default(IList)) + { + Query = query; + Results = results; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets search Query. + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; set; } + + /// + /// Gets or sets array of utterance results for search query. + /// + [JsonProperty(PropertyName = "results")] + public IList Results { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.cs similarity index 64% rename from sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionResource.cs rename to sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.cs index 2785fb08e062..e2e9a33b6d78 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/PrivateEndpointConnectionResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnection.cs @@ -13,25 +13,27 @@ namespace Microsoft.Azure.Management.WebSites.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Private Endpoint Connection ARM resource. + /// A remote private endpoint connection /// [Rest.Serialization.JsonTransformation] - public partial class PrivateEndpointConnectionResource : ProxyOnlyResource + public partial class RemotePrivateEndpointConnection : ProxyOnlyResource { /// - /// Initializes a new instance of the PrivateEndpointConnectionResource + /// Initializes a new instance of the RemotePrivateEndpointConnection /// class. /// - public PrivateEndpointConnectionResource() + public RemotePrivateEndpointConnection() { CustomInit(); } /// - /// Initializes a new instance of the PrivateEndpointConnectionResource + /// Initializes a new instance of the RemotePrivateEndpointConnection /// class. /// /// Resource Id. @@ -40,12 +42,15 @@ public PrivateEndpointConnectionResource() /// Resource type. /// PrivateEndpoint of a remote private /// endpoint connection - public PrivateEndpointConnectionResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string provisioningState = default(string), ArmIdWrapper privateEndpoint = default(ArmIdWrapper), PrivateLinkConnectionState privateLinkServiceConnectionState = default(PrivateLinkConnectionState)) + /// Private IPAddresses mapped to the remote + /// private endpoint + public RemotePrivateEndpointConnection(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string provisioningState = default(string), ArmIdWrapper privateEndpoint = default(ArmIdWrapper), PrivateLinkConnectionState privateLinkServiceConnectionState = default(PrivateLinkConnectionState), IList ipAddresses = default(IList)) : base(id, name, kind, type) { ProvisioningState = provisioningState; PrivateEndpoint = privateEndpoint; PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + IpAddresses = ipAddresses; CustomInit(); } @@ -71,5 +76,12 @@ public PrivateEndpointConnectionResource() [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] public PrivateLinkConnectionState PrivateLinkServiceConnectionState { get; set; } + /// + /// Gets or sets private IPAddresses mapped to the remote private + /// endpoint + /// + [JsonProperty(PropertyName = "properties.ipAddresses")] + public IList IpAddresses { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.cs new file mode 100644 index 000000000000..0d506eacfa07 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RemotePrivateEndpointConnectionARMResource.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Remote Private Endpoint Connection ARM resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class RemotePrivateEndpointConnectionARMResource : ProxyOnlyResource + { + /// + /// Initializes a new instance of the + /// RemotePrivateEndpointConnectionARMResource class. + /// + public RemotePrivateEndpointConnectionARMResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// RemotePrivateEndpointConnectionARMResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// PrivateEndpoint of a remote private + /// endpoint connection + /// Private IPAddresses mapped to the remote + /// private endpoint + public RemotePrivateEndpointConnectionARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string provisioningState = default(string), ArmIdWrapper privateEndpoint = default(ArmIdWrapper), PrivateLinkConnectionState privateLinkServiceConnectionState = default(PrivateLinkConnectionState), IList ipAddresses = default(IList)) + : base(id, name, kind, type) + { + ProvisioningState = provisioningState; + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + IpAddresses = ipAddresses; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets privateEndpoint of a remote private endpoint + /// connection + /// + [JsonProperty(PropertyName = "properties.privateEndpoint")] + public ArmIdWrapper PrivateEndpoint { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] + public PrivateLinkConnectionState PrivateLinkServiceConnectionState { get; set; } + + /// + /// Gets or sets private IPAddresses mapped to the remote private + /// endpoint + /// + [JsonProperty(PropertyName = "properties.ipAddresses")] + public IList IpAddresses { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs index 8080fa872330..b9628aacb6f1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Rendering.cs @@ -30,7 +30,12 @@ public Rendering() /// Initializes a new instance of the Rendering class. /// /// Rendering Type. Possible values include: - /// 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + /// 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance', + /// 'PieChart', 'DataSummary', 'Email', 'Insights', 'DynamicInsight', + /// 'Markdown', 'Detector', 'DropDown', 'Card', 'Solution', 'Guage', + /// 'Form', 'ChangeSets', 'ChangeAnalysisOnboarding', 'ChangesView', + /// 'AppInsight', 'DependencyGraph', 'DownTime', 'SummaryCard', + /// 'SearchComponent', 'AppInsightEnablement' /// Title of data /// Description of the data that will help it /// be interpreted @@ -49,7 +54,12 @@ public Rendering() /// /// Gets or sets rendering Type. Possible values include: 'NoGraph', - /// 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + /// 'Table', 'TimeSeries', 'TimeSeriesPerInstance', 'PieChart', + /// 'DataSummary', 'Email', 'Insights', 'DynamicInsight', 'Markdown', + /// 'Detector', 'DropDown', 'Card', 'Solution', 'Guage', 'Form', + /// 'ChangeSets', 'ChangeAnalysisOnboarding', 'ChangesView', + /// 'AppInsight', 'DependencyGraph', 'DownTime', 'SummaryCard', + /// 'SearchComponent', 'AppInsightEnablement' /// [JsonProperty(PropertyName = "type")] public RenderingType? Type { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs index bf0ebdff16f5..727d7df75757 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/RenderingType.cs @@ -28,7 +28,49 @@ public enum RenderingType [EnumMember(Value = "TimeSeries")] TimeSeries, [EnumMember(Value = "TimeSeriesPerInstance")] - TimeSeriesPerInstance + TimeSeriesPerInstance, + [EnumMember(Value = "PieChart")] + PieChart, + [EnumMember(Value = "DataSummary")] + DataSummary, + [EnumMember(Value = "Email")] + Email, + [EnumMember(Value = "Insights")] + Insights, + [EnumMember(Value = "DynamicInsight")] + DynamicInsight, + [EnumMember(Value = "Markdown")] + Markdown, + [EnumMember(Value = "Detector")] + Detector, + [EnumMember(Value = "DropDown")] + DropDown, + [EnumMember(Value = "Card")] + Card, + [EnumMember(Value = "Solution")] + Solution, + [EnumMember(Value = "Guage")] + Guage, + [EnumMember(Value = "Form")] + Form, + [EnumMember(Value = "ChangeSets")] + ChangeSets, + [EnumMember(Value = "ChangeAnalysisOnboarding")] + ChangeAnalysisOnboarding, + [EnumMember(Value = "ChangesView")] + ChangesView, + [EnumMember(Value = "AppInsight")] + AppInsight, + [EnumMember(Value = "DependencyGraph")] + DependencyGraph, + [EnumMember(Value = "DownTime")] + DownTime, + [EnumMember(Value = "SummaryCard")] + SummaryCard, + [EnumMember(Value = "SearchComponent")] + SearchComponent, + [EnumMember(Value = "AppInsightEnablement")] + AppInsightEnablement } internal static class RenderingTypeEnumExtension { @@ -49,6 +91,48 @@ internal static string ToSerializedValue(this RenderingType value) return "TimeSeries"; case RenderingType.TimeSeriesPerInstance: return "TimeSeriesPerInstance"; + case RenderingType.PieChart: + return "PieChart"; + case RenderingType.DataSummary: + return "DataSummary"; + case RenderingType.Email: + return "Email"; + case RenderingType.Insights: + return "Insights"; + case RenderingType.DynamicInsight: + return "DynamicInsight"; + case RenderingType.Markdown: + return "Markdown"; + case RenderingType.Detector: + return "Detector"; + case RenderingType.DropDown: + return "DropDown"; + case RenderingType.Card: + return "Card"; + case RenderingType.Solution: + return "Solution"; + case RenderingType.Guage: + return "Guage"; + case RenderingType.Form: + return "Form"; + case RenderingType.ChangeSets: + return "ChangeSets"; + case RenderingType.ChangeAnalysisOnboarding: + return "ChangeAnalysisOnboarding"; + case RenderingType.ChangesView: + return "ChangesView"; + case RenderingType.AppInsight: + return "AppInsight"; + case RenderingType.DependencyGraph: + return "DependencyGraph"; + case RenderingType.DownTime: + return "DownTime"; + case RenderingType.SummaryCard: + return "SummaryCard"; + case RenderingType.SearchComponent: + return "SearchComponent"; + case RenderingType.AppInsightEnablement: + return "AppInsightEnablement"; } return null; } @@ -65,6 +149,48 @@ internal static string ToSerializedValue(this RenderingType value) return RenderingType.TimeSeries; case "TimeSeriesPerInstance": return RenderingType.TimeSeriesPerInstance; + case "PieChart": + return RenderingType.PieChart; + case "DataSummary": + return RenderingType.DataSummary; + case "Email": + return RenderingType.Email; + case "Insights": + return RenderingType.Insights; + case "DynamicInsight": + return RenderingType.DynamicInsight; + case "Markdown": + return RenderingType.Markdown; + case "Detector": + return RenderingType.Detector; + case "DropDown": + return RenderingType.DropDown; + case "Card": + return RenderingType.Card; + case "Solution": + return RenderingType.Solution; + case "Guage": + return RenderingType.Guage; + case "Form": + return RenderingType.Form; + case "ChangeSets": + return RenderingType.ChangeSets; + case "ChangeAnalysisOnboarding": + return RenderingType.ChangeAnalysisOnboarding; + case "ChangesView": + return RenderingType.ChangesView; + case "AppInsight": + return RenderingType.AppInsight; + case "DependencyGraph": + return RenderingType.DependencyGraph; + case "DownTime": + return RenderingType.DownTime; + case "SummaryCard": + return RenderingType.SummaryCard; + case "SearchComponent": + return RenderingType.SearchComponent; + case "AppInsightEnablement": + return RenderingType.AppInsightEnablement; } return null; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs new file mode 100644 index 000000000000..a83588884f36 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResolveStatus.cs @@ -0,0 +1,114 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ResolveStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ResolveStatus + { + [EnumMember(Value = "Initialized")] + Initialized, + [EnumMember(Value = "Resolved")] + Resolved, + [EnumMember(Value = "InvalidSyntax")] + InvalidSyntax, + [EnumMember(Value = "MSINotEnabled")] + MSINotEnabled, + [EnumMember(Value = "VaultNotFound")] + VaultNotFound, + [EnumMember(Value = "SecretNotFound")] + SecretNotFound, + [EnumMember(Value = "SecretVersionNotFound")] + SecretVersionNotFound, + [EnumMember(Value = "AccessToKeyVaultDenied")] + AccessToKeyVaultDenied, + [EnumMember(Value = "OtherReasons")] + OtherReasons, + [EnumMember(Value = "FetchTimedOut")] + FetchTimedOut, + [EnumMember(Value = "UnauthorizedClient")] + UnauthorizedClient + } + internal static class ResolveStatusEnumExtension + { + internal static string ToSerializedValue(this ResolveStatus? value) + { + return value == null ? null : ((ResolveStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ResolveStatus value) + { + switch( value ) + { + case ResolveStatus.Initialized: + return "Initialized"; + case ResolveStatus.Resolved: + return "Resolved"; + case ResolveStatus.InvalidSyntax: + return "InvalidSyntax"; + case ResolveStatus.MSINotEnabled: + return "MSINotEnabled"; + case ResolveStatus.VaultNotFound: + return "VaultNotFound"; + case ResolveStatus.SecretNotFound: + return "SecretNotFound"; + case ResolveStatus.SecretVersionNotFound: + return "SecretVersionNotFound"; + case ResolveStatus.AccessToKeyVaultDenied: + return "AccessToKeyVaultDenied"; + case ResolveStatus.OtherReasons: + return "OtherReasons"; + case ResolveStatus.FetchTimedOut: + return "FetchTimedOut"; + case ResolveStatus.UnauthorizedClient: + return "UnauthorizedClient"; + } + return null; + } + + internal static ResolveStatus? ParseResolveStatus(this string value) + { + switch( value ) + { + case "Initialized": + return ResolveStatus.Initialized; + case "Resolved": + return ResolveStatus.Resolved; + case "InvalidSyntax": + return ResolveStatus.InvalidSyntax; + case "MSINotEnabled": + return ResolveStatus.MSINotEnabled; + case "VaultNotFound": + return ResolveStatus.VaultNotFound; + case "SecretNotFound": + return ResolveStatus.SecretNotFound; + case "SecretVersionNotFound": + return ResolveStatus.SecretVersionNotFound; + case "AccessToKeyVaultDenied": + return ResolveStatus.AccessToKeyVaultDenied; + case "OtherReasons": + return ResolveStatus.OtherReasons; + case "FetchTimedOut": + return ResolveStatus.FetchTimedOut; + case "UnauthorizedClient": + return ResolveStatus.UnauthorizedClient; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs new file mode 100644 index 000000000000..9626aeccc566 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ResponseMessageEnvelopeRemotePrivateEndpointConnection.cs @@ -0,0 +1,158 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Message envelope that contains the common Azure resource manager + /// properties and the resource provider specific content. + /// + public partial class ResponseMessageEnvelopeRemotePrivateEndpointConnection + { + /// + /// Initializes a new instance of the + /// ResponseMessageEnvelopeRemotePrivateEndpointConnection class. + /// + public ResponseMessageEnvelopeRemotePrivateEndpointConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResponseMessageEnvelopeRemotePrivateEndpointConnection class. + /// + /// Resource Id. Typically ID is populated only for + /// responses to GET requests. Caller is responsible for passing in + /// this + /// value for GET requests only. + /// For example: + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupId}/providers/Microsoft.Web/sites/{sitename} + /// Name of resource. + /// Type of resource e.g + /// "Microsoft.Web/sites". + /// Geographical region resource belongs to e.g. + /// SouthCentralUS, SouthEastAsia. + /// Tags associated with resource. + /// Azure resource manager plan. + /// Resource specific properties. + /// SKU description of the resource. + /// Azure-AsyncOperation Status info. + /// Azure-AsyncOperation Error info. + /// MSI resource + /// Logical Availability Zones the service is + /// hosted in + public ResponseMessageEnvelopeRemotePrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ArmPlan plan = default(ArmPlan), RemotePrivateEndpointConnection properties = default(RemotePrivateEndpointConnection), SkuDescription sku = default(SkuDescription), string status = default(string), ErrorEntity error = default(ErrorEntity), ManagedServiceIdentity identity = default(ManagedServiceIdentity), IList zones = default(IList)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + Plan = plan; + Properties = properties; + Sku = sku; + Status = status; + Error = error; + Identity = identity; + Zones = zones; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource Id. Typically ID is populated only for + /// responses to GET requests. Caller is responsible for passing in + /// this + /// value for GET requests only. + /// For example: + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupId}/providers/Microsoft.Web/sites/{sitename} + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets name of resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets type of resource e.g "Microsoft.Web/sites". + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets geographical region resource belongs to e.g. + /// SouthCentralUS, SouthEastAsia. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets tags associated with resource. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets azure resource manager plan. + /// + [JsonProperty(PropertyName = "plan")] + public ArmPlan Plan { get; set; } + + /// + /// Gets or sets resource specific properties. + /// + [JsonProperty(PropertyName = "properties")] + public RemotePrivateEndpointConnection Properties { get; set; } + + /// + /// Gets or sets SKU description of the resource. + /// + [JsonProperty(PropertyName = "sku")] + public SkuDescription Sku { get; set; } + + /// + /// Gets or sets azure-AsyncOperation Status info. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets azure-AsyncOperation Error info. + /// + [JsonProperty(PropertyName = "error")] + public ErrorEntity Error { get; set; } + + /// + /// Gets or sets MSI resource + /// + [JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity { get; set; } + + /// + /// Gets or sets logical Availability Zones the service is hosted in + /// + [JsonProperty(PropertyName = "zones")] + public IList Zones { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs new file mode 100644 index 000000000000..f649b929bc22 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SampleUtterance.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Sample utterance. + /// + public partial class SampleUtterance + { + /// + /// Initializes a new instance of the SampleUtterance class. + /// + public SampleUtterance() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SampleUtterance class. + /// + /// Text attribute of sample utterance. + /// Links attribute of sample utterance. + /// Question id of sample utterance (for + /// stackoverflow questions titles). + public SampleUtterance(string text = default(string), IList links = default(IList), string qid = default(string)) + { + Text = text; + Links = links; + Qid = qid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets text attribute of sample utterance. + /// + [JsonProperty(PropertyName = "text")] + public string Text { get; set; } + + /// + /// Gets or sets links attribute of sample utterance. + /// + [JsonProperty(PropertyName = "links")] + public IList Links { get; set; } + + /// + /// Gets or sets question id of sample utterance (for stackoverflow + /// questions titles). + /// + [JsonProperty(PropertyName = "qid")] + public string Qid { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs index 5a5d96d804c3..9d2e1ed4bb32 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Site.cs @@ -95,7 +95,7 @@ public Site() /// ClientCert is required. /// - ClientCertEnabled: true and ClientCertMode: Optional means /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional' + /// 'Required', 'Optional', 'OptionalInteractiveUser' /// client certificate /// authentication comma-separated exclusion paths /// <code>true</code> to @@ -140,7 +140,16 @@ public Site() /// 'GeoRedundant' /// Specifies an operation id if /// this site has a pending operation. - public Site(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + /// Checks if Customer provided + /// storage account is required + /// Identity to use for Key + /// Vault Reference authentication. + /// Azure Resource Manager ID of + /// the Virtual network and subnet to be joined by Regional VNET + /// Integration. + /// This must be of the form + /// /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} + public Site(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), bool? storageAccountRequired = default(bool?), string keyVaultReferenceIdentity = default(string), string virtualNetworkSubnetId = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) : base(location, id, name, kind, type, tags) { State = state; @@ -181,6 +190,9 @@ public Site() HttpsOnly = httpsOnly; RedundancyMode = redundancyMode; InProgressOperationId = inProgressOperationId; + StorageAccountRequired = storageAccountRequired; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + VirtualNetworkSubnetId = virtualNetworkSubnetId; Identity = identity; CustomInit(); } @@ -344,7 +356,7 @@ public Site() /// ClientCert is required. /// - ClientCertEnabled: true and ClientCertMode: Optional means /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional' + /// 'Required', 'Optional', 'OptionalInteractiveUser' /// [JsonProperty(PropertyName = "properties.clientCertMode")] public ClientCertMode? ClientCertMode { get; set; } @@ -471,6 +483,29 @@ public Site() [JsonProperty(PropertyName = "properties.inProgressOperationId")] public System.Guid? InProgressOperationId { get; private set; } + /// + /// Gets or sets checks if Customer provided storage account is + /// required + /// + [JsonProperty(PropertyName = "properties.storageAccountRequired")] + public bool? StorageAccountRequired { get; set; } + + /// + /// Gets or sets identity to use for Key Vault Reference + /// authentication. + /// + [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] + public string KeyVaultReferenceIdentity { get; set; } + + /// + /// Gets or sets azure Resource Manager ID of the Virtual network and + /// subnet to be joined by Regional VNET Integration. + /// This must be of the form + /// /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} + /// + [JsonProperty(PropertyName = "properties.virtualNetworkSubnetId")] + public string VirtualNetworkSubnetId { get; set; } + /// /// [JsonProperty(PropertyName = "identity")] diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs index a87bf293faac..892ce24ecff1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettings.cs @@ -205,7 +205,11 @@ public SiteAuthSettings() /// auth settings. /// If the path is relative, base will the site's root /// directory. - public SiteAuthSettings(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), string runtimeVersion = default(string), UnauthenticatedClientAction? unauthenticatedClientAction = default(UnauthenticatedClientAction?), bool? tokenStoreEnabled = default(bool?), IList allowedExternalRedirectUrls = default(IList), BuiltInAuthenticationProvider? defaultProvider = default(BuiltInAuthenticationProvider?), double? tokenRefreshExtensionHours = default(double?), string clientId = default(string), string clientSecret = default(string), string clientSecretSettingName = default(string), string clientSecretCertificateThumbprint = default(string), string issuer = default(string), bool? validateIssuer = default(bool?), IList allowedAudiences = default(IList), IList additionalLoginParams = default(IList), string aadClaimsAuthorization = default(string), string googleClientId = default(string), string googleClientSecret = default(string), string googleClientSecretSettingName = default(string), IList googleOAuthScopes = default(IList), string facebookAppId = default(string), string facebookAppSecret = default(string), string facebookAppSecretSettingName = default(string), IList facebookOAuthScopes = default(IList), string gitHubClientId = default(string), string gitHubClientSecret = default(string), string gitHubClientSecretSettingName = default(string), IList gitHubOAuthScopes = default(IList), string twitterConsumerKey = default(string), string twitterConsumerSecret = default(string), string twitterConsumerSecretSettingName = default(string), string microsoftAccountClientId = default(string), string microsoftAccountClientSecret = default(string), string microsoftAccountClientSecretSettingName = default(string), IList microsoftAccountOAuthScopes = default(IList), string isAuthFromFile = default(string), string authFilePath = default(string)) + /// The ConfigVersion of the Authentication + /// / Authorization feature in use for the current app. + /// The setting in this value can control the behavior of the control + /// plane for Authentication / Authorization. + public SiteAuthSettings(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), string runtimeVersion = default(string), UnauthenticatedClientAction? unauthenticatedClientAction = default(UnauthenticatedClientAction?), bool? tokenStoreEnabled = default(bool?), IList allowedExternalRedirectUrls = default(IList), BuiltInAuthenticationProvider? defaultProvider = default(BuiltInAuthenticationProvider?), double? tokenRefreshExtensionHours = default(double?), string clientId = default(string), string clientSecret = default(string), string clientSecretSettingName = default(string), string clientSecretCertificateThumbprint = default(string), string issuer = default(string), bool? validateIssuer = default(bool?), IList allowedAudiences = default(IList), IList additionalLoginParams = default(IList), string aadClaimsAuthorization = default(string), string googleClientId = default(string), string googleClientSecret = default(string), string googleClientSecretSettingName = default(string), IList googleOAuthScopes = default(IList), string facebookAppId = default(string), string facebookAppSecret = default(string), string facebookAppSecretSettingName = default(string), IList facebookOAuthScopes = default(IList), string gitHubClientId = default(string), string gitHubClientSecret = default(string), string gitHubClientSecretSettingName = default(string), IList gitHubOAuthScopes = default(IList), string twitterConsumerKey = default(string), string twitterConsumerSecret = default(string), string twitterConsumerSecretSettingName = default(string), string microsoftAccountClientId = default(string), string microsoftAccountClientSecret = default(string), string microsoftAccountClientSecretSettingName = default(string), IList microsoftAccountOAuthScopes = default(IList), string isAuthFromFile = default(string), string authFilePath = default(string), string configVersion = default(string)) : base(id, name, kind, type) { Enabled = enabled; @@ -245,6 +249,7 @@ public SiteAuthSettings() MicrosoftAccountOAuthScopes = microsoftAccountOAuthScopes; IsAuthFromFile = isAuthFromFile; AuthFilePath = authFilePath; + ConfigVersion = configVersion; CustomInit(); } @@ -594,5 +599,14 @@ public SiteAuthSettings() [JsonProperty(PropertyName = "properties.authFilePath")] public string AuthFilePath { get; set; } + /// + /// Gets or sets the ConfigVersion of the Authentication / + /// Authorization feature in use for the current app. + /// The setting in this value can control the behavior of the control + /// plane for Authentication / Authorization. + /// + [JsonProperty(PropertyName = "properties.configVersion")] + public string ConfigVersion { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.cs index 5a587a3976c4..b2ab90429587 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteAuthSettingsV2.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// Configuration settings for the Azure App Service Authentication / + /// Authorization V2 feature. + /// [Rest.Serialization.JsonTransformation] public partial class SiteAuthSettingsV2 : ProxyOnlyResource { @@ -33,6 +37,19 @@ public SiteAuthSettingsV2() /// Resource Name. /// Kind of resource. /// Resource type. + /// The configuration settings of the platform + /// of App Service Authentication/Authorization. + /// The configuration settings that + /// determines the validation flow of users using App Service + /// Authentication/Authorization. + /// The configuration settings of each + /// of the identity providers used to configure App Service + /// Authentication/Authorization. + /// The configuration settings of the login flow of + /// users using App Service Authentication/Authorization. + /// The configuration settings of the HTTP + /// requests for authentication and authorization requests made against + /// App Service Authentication/Authorization. public SiteAuthSettingsV2(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), AuthPlatform platform = default(AuthPlatform), GlobalValidation globalValidation = default(GlobalValidation), IdentityProviders identityProviders = default(IdentityProviders), Login login = default(Login), HttpSettings httpSettings = default(HttpSettings)) : base(id, name, kind, type) { @@ -50,26 +67,39 @@ public SiteAuthSettingsV2() partial void CustomInit(); /// + /// Gets or sets the configuration settings of the platform of App + /// Service Authentication/Authorization. /// [JsonProperty(PropertyName = "properties.platform")] public AuthPlatform Platform { get; set; } /// + /// Gets or sets the configuration settings that determines the + /// validation flow of users using App Service + /// Authentication/Authorization. /// [JsonProperty(PropertyName = "properties.globalValidation")] public GlobalValidation GlobalValidation { get; set; } /// + /// Gets or sets the configuration settings of each of the identity + /// providers used to configure App Service + /// Authentication/Authorization. /// [JsonProperty(PropertyName = "properties.identityProviders")] public IdentityProviders IdentityProviders { get; set; } /// + /// Gets or sets the configuration settings of the login flow of users + /// using App Service Authentication/Authorization. /// [JsonProperty(PropertyName = "properties.login")] public Login Login { get; set; } /// + /// Gets or sets the configuration settings of the HTTP requests for + /// authentication and authorization requests made against App Service + /// Authentication/Authorization. /// [JsonProperty(PropertyName = "properties.httpSettings")] public HttpSettings HttpSettings { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs index 09a72225be37..a32ecd8ec971 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs @@ -89,7 +89,8 @@ public SiteConfig() /// Virtual applications. /// Site load balancing. Possible values /// include: 'WeightedRoundRobin', 'LeastRequests', - /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash', + /// 'PerSiteRoundRobin' /// This is work around for polymorphic /// types. /// Site limits. @@ -98,6 +99,12 @@ public SiteConfig() /// Auto Heal rules. /// Tracing options. /// Virtual Network name. + /// Virtual Network Route All + /// enabled. This causes all outbound traffic to have Virtual Network + /// Security Groups and User Defined Routes applied. + /// The number of private ports + /// assigned to this app. These will be assigned dynamically on + /// runtime. /// Cross-Origin Resource Sharing (CORS) /// settings. /// Push endpoint settings. @@ -113,6 +120,8 @@ public SiteConfig() /// Id /// Explicit Managed Service /// Identity Id + /// Identity to use for Key + /// Vault Reference authentication. /// IP security restrictions for /// main. /// IP security restrictions @@ -124,13 +133,42 @@ public SiteConfig() /// MinTlsVersion: configures the minimum /// version of TLS required for SSL requests. Possible values include: /// '1.0', '1.1', '1.2' + /// ScmMinTlsVersion: configures the + /// minimum version of TLS required for SSL requests for SCM site. + /// Possible values include: '1.0', '1.1', '1.2' /// State of FTP / FTPS service. Possible /// values include: 'AllAllowed', 'FtpsOnly', 'Disabled' /// Number of preWarmed instances. /// This setting only applies to the Consumption and Elastic /// Plans + /// Maximum number of workers that + /// a site can scale out to. + /// This setting only applies to the Consumption and Elastic Premium + /// Plans /// Health check path - public SiteConfig(int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), string healthCheckPath = default(string)) + /// Gets or sets a + /// value indicating whether functions runtime scale monitoring is + /// enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but + /// will instead call to the + /// runtime to get scale status. + /// Sets the time zone a site uses for + /// generating timestamps. Compatible with Linux and Windows App + /// Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence + /// over this config. For Linux, expects tz database values + /// https://www.iana.org/time-zones (for a quick reference see + /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For + /// Windows, expects one of the time zones listed under + /// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows + /// NT\CurrentVersion\Time Zones + /// Number of minimum + /// instance count for a site + /// This setting only applies to the Elastic Plans + /// List of Azure Storage + /// Accounts. + /// Property to allow or block all + /// public traffic. + public SiteConfig(int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), bool? vnetRouteAllEnabled = default(bool?), int? vnetPrivatePortsCount = default(int?), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), string keyVaultReferenceIdentity = default(string), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string scmMinTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), int? functionAppScaleLimit = default(int?), string healthCheckPath = default(string), bool? functionsRuntimeScaleMonitoringEnabled = default(bool?), string websiteTimeZone = default(string), int? minimumElasticInstanceCount = default(int?), IDictionary azureStorageAccounts = default(IDictionary), string publicNetworkAccess = default(string)) { NumberOfWorkers = numberOfWorkers; DefaultDocuments = defaultDocuments; @@ -171,6 +209,8 @@ public SiteConfig() AutoHealRules = autoHealRules; TracingOptions = tracingOptions; VnetName = vnetName; + VnetRouteAllEnabled = vnetRouteAllEnabled; + VnetPrivatePortsCount = vnetPrivatePortsCount; Cors = cors; Push = push; ApiDefinition = apiDefinition; @@ -179,14 +219,22 @@ public SiteConfig() LocalMySqlEnabled = localMySqlEnabled; ManagedServiceIdentityId = managedServiceIdentityId; XManagedServiceIdentityId = xManagedServiceIdentityId; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; IpSecurityRestrictions = ipSecurityRestrictions; ScmIpSecurityRestrictions = scmIpSecurityRestrictions; ScmIpSecurityRestrictionsUseMain = scmIpSecurityRestrictionsUseMain; Http20Enabled = http20Enabled; MinTlsVersion = minTlsVersion; + ScmMinTlsVersion = scmMinTlsVersion; FtpsState = ftpsState; PreWarmedInstanceCount = preWarmedInstanceCount; + FunctionAppScaleLimit = functionAppScaleLimit; HealthCheckPath = healthCheckPath; + FunctionsRuntimeScaleMonitoringEnabled = functionsRuntimeScaleMonitoringEnabled; + WebsiteTimeZone = websiteTimeZone; + MinimumElasticInstanceCount = minimumElasticInstanceCount; + AzureStorageAccounts = azureStorageAccounts; + PublicNetworkAccess = publicNetworkAccess; CustomInit(); } @@ -408,7 +456,7 @@ public SiteConfig() /// /// Gets or sets site load balancing. Possible values include: /// 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - /// 'WeightedTotalTraffic', 'RequestHash' + /// 'WeightedTotalTraffic', 'RequestHash', 'PerSiteRoundRobin' /// [JsonProperty(PropertyName = "loadBalancing")] public SiteLoadBalancing? LoadBalancing { get; set; } @@ -451,6 +499,21 @@ public SiteConfig() [JsonProperty(PropertyName = "vnetName")] public string VnetName { get; set; } + /// + /// Gets or sets virtual Network Route All enabled. This causes all + /// outbound traffic to have Virtual Network Security Groups and User + /// Defined Routes applied. + /// + [JsonProperty(PropertyName = "vnetRouteAllEnabled")] + public bool? VnetRouteAllEnabled { get; set; } + + /// + /// Gets or sets the number of private ports assigned to this app. + /// These will be assigned dynamically on runtime. + /// + [JsonProperty(PropertyName = "vnetPrivatePortsCount")] + public int? VnetPrivatePortsCount { get; set; } + /// /// Gets or sets cross-Origin Resource Sharing (CORS) settings. /// @@ -502,6 +565,13 @@ public SiteConfig() [JsonProperty(PropertyName = "xManagedServiceIdentityId")] public int? XManagedServiceIdentityId { get; set; } + /// + /// Gets or sets identity to use for Key Vault Reference + /// authentication. + /// + [JsonProperty(PropertyName = "keyVaultReferenceIdentity")] + public string KeyVaultReferenceIdentity { get; set; } + /// /// Gets or sets IP security restrictions for main. /// @@ -535,6 +605,14 @@ public SiteConfig() [JsonProperty(PropertyName = "minTlsVersion")] public string MinTlsVersion { get; set; } + /// + /// Gets or sets scmMinTlsVersion: configures the minimum version of + /// TLS required for SSL requests for SCM site. Possible values + /// include: '1.0', '1.1', '1.2' + /// + [JsonProperty(PropertyName = "scmMinTlsVersion")] + public string ScmMinTlsVersion { get; set; } + /// /// Gets or sets state of FTP / FTPS service. Possible values include: /// 'AllAllowed', 'FtpsOnly', 'Disabled' @@ -549,12 +627,64 @@ public SiteConfig() [JsonProperty(PropertyName = "preWarmedInstanceCount")] public int? PreWarmedInstanceCount { get; set; } + /// + /// Gets or sets maximum number of workers that a site can scale out + /// to. + /// This setting only applies to the Consumption and Elastic Premium + /// Plans + /// + [JsonProperty(PropertyName = "functionAppScaleLimit")] + public int? FunctionAppScaleLimit { get; set; } + /// /// Gets or sets health check path /// [JsonProperty(PropertyName = "healthCheckPath")] public string HealthCheckPath { get; set; } + /// + /// Gets or sets a value indicating whether functions runtime scale + /// monitoring is enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but + /// will instead call to the + /// runtime to get scale status. + /// + [JsonProperty(PropertyName = "functionsRuntimeScaleMonitoringEnabled")] + public bool? FunctionsRuntimeScaleMonitoringEnabled { get; set; } + + /// + /// Gets or sets sets the time zone a site uses for generating + /// timestamps. Compatible with Linux and Windows App Service. Setting + /// the WEBSITE_TIME_ZONE app setting takes precedence over this + /// config. For Linux, expects tz database values + /// https://www.iana.org/time-zones (for a quick reference see + /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For + /// Windows, expects one of the time zones listed under + /// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows + /// NT\CurrentVersion\Time Zones + /// + [JsonProperty(PropertyName = "websiteTimeZone")] + public string WebsiteTimeZone { get; set; } + + /// + /// Gets or sets number of minimum instance count for a site + /// This setting only applies to the Elastic Plans + /// + [JsonProperty(PropertyName = "minimumElasticInstanceCount")] + public int? MinimumElasticInstanceCount { get; set; } + + /// + /// Gets or sets list of Azure Storage Accounts. + /// + [JsonProperty(PropertyName = "azureStorageAccounts")] + public IDictionary AzureStorageAccounts { get; set; } + + /// + /// Gets or sets property to allow or block all public traffic. + /// + [JsonProperty(PropertyName = "publicNetworkAccess")] + public string PublicNetworkAccess { get; set; } + /// /// Validate the object. /// @@ -575,6 +705,18 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "PreWarmedInstanceCount", 0); } + if (FunctionAppScaleLimit < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "FunctionAppScaleLimit", 0); + } + if (MinimumElasticInstanceCount > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MinimumElasticInstanceCount", 20); + } + if (MinimumElasticInstanceCount < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MinimumElasticInstanceCount", 0); + } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs new file mode 100644 index 000000000000..d331ddb6de0e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigPropertiesDictionary.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Site config properties dictionary. + /// + public partial class SiteConfigPropertiesDictionary + { + /// + /// Initializes a new instance of the SiteConfigPropertiesDictionary + /// class. + /// + public SiteConfigPropertiesDictionary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SiteConfigPropertiesDictionary + /// class. + /// + /// <code>true</code> + /// if use32BitWorkerProcess should be set to true for the stack; + /// otherwise, <code>false</code>. + /// LinuxFxVersion configuration + /// setting. + /// JavaVersion configuration + /// setting. + /// PowerShellVersion configuration + /// setting. + public SiteConfigPropertiesDictionary(bool? use32BitWorkerProcess = default(bool?), string linuxFxVersion = default(string), string javaVersion = default(string), string powerShellVersion = default(string)) + { + Use32BitWorkerProcess = use32BitWorkerProcess; + LinuxFxVersion = linuxFxVersion; + JavaVersion = javaVersion; + PowerShellVersion = powerShellVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if + /// use32BitWorkerProcess should be set to true for the stack; + /// otherwise, &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "use32BitWorkerProcess")] + public bool? Use32BitWorkerProcess { get; private set; } + + /// + /// Gets linuxFxVersion configuration setting. + /// + [JsonProperty(PropertyName = "linuxFxVersion")] + public string LinuxFxVersion { get; private set; } + + /// + /// Gets javaVersion configuration setting. + /// + [JsonProperty(PropertyName = "javaVersion")] + public string JavaVersion { get; private set; } + + /// + /// Gets powerShellVersion configuration setting. + /// + [JsonProperty(PropertyName = "powerShellVersion")] + public string PowerShellVersion { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs index c51daa41c62e..5142f2099da2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs @@ -95,7 +95,8 @@ public SiteConfigResource() /// Virtual applications. /// Site load balancing. Possible values /// include: 'WeightedRoundRobin', 'LeastRequests', - /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + /// 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash', + /// 'PerSiteRoundRobin' /// This is work around for polymorphic /// types. /// Site limits. @@ -104,6 +105,12 @@ public SiteConfigResource() /// Auto Heal rules. /// Tracing options. /// Virtual Network name. + /// Virtual Network Route All + /// enabled. This causes all outbound traffic to have Virtual Network + /// Security Groups and User Defined Routes applied. + /// The number of private ports + /// assigned to this app. These will be assigned dynamically on + /// runtime. /// Cross-Origin Resource Sharing (CORS) /// settings. /// Push endpoint settings. @@ -119,6 +126,8 @@ public SiteConfigResource() /// Id /// Explicit Managed Service /// Identity Id + /// Identity to use for Key + /// Vault Reference authentication. /// IP security restrictions for /// main. /// IP security restrictions @@ -130,13 +139,42 @@ public SiteConfigResource() /// MinTlsVersion: configures the minimum /// version of TLS required for SSL requests. Possible values include: /// '1.0', '1.1', '1.2' + /// ScmMinTlsVersion: configures the + /// minimum version of TLS required for SSL requests for SCM site. + /// Possible values include: '1.0', '1.1', '1.2' /// State of FTP / FTPS service. Possible /// values include: 'AllAllowed', 'FtpsOnly', 'Disabled' /// Number of preWarmed instances. /// This setting only applies to the Consumption and Elastic /// Plans + /// Maximum number of workers that + /// a site can scale out to. + /// This setting only applies to the Consumption and Elastic Premium + /// Plans /// Health check path - public SiteConfigResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), string healthCheckPath = default(string)) + /// Gets or sets a + /// value indicating whether functions runtime scale monitoring is + /// enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but + /// will instead call to the + /// runtime to get scale status. + /// Sets the time zone a site uses for + /// generating timestamps. Compatible with Linux and Windows App + /// Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence + /// over this config. For Linux, expects tz database values + /// https://www.iana.org/time-zones (for a quick reference see + /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For + /// Windows, expects one of the time zones listed under + /// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows + /// NT\CurrentVersion\Time Zones + /// Number of minimum + /// instance count for a site + /// This setting only applies to the Elastic Plans + /// List of Azure Storage + /// Accounts. + /// Property to allow or block all + /// public traffic. + public SiteConfigResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), bool? vnetRouteAllEnabled = default(bool?), int? vnetPrivatePortsCount = default(int?), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), string keyVaultReferenceIdentity = default(string), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string scmMinTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), int? functionAppScaleLimit = default(int?), string healthCheckPath = default(string), bool? functionsRuntimeScaleMonitoringEnabled = default(bool?), string websiteTimeZone = default(string), int? minimumElasticInstanceCount = default(int?), IDictionary azureStorageAccounts = default(IDictionary), string publicNetworkAccess = default(string)) : base(id, name, kind, type) { NumberOfWorkers = numberOfWorkers; @@ -178,6 +216,8 @@ public SiteConfigResource() AutoHealRules = autoHealRules; TracingOptions = tracingOptions; VnetName = vnetName; + VnetRouteAllEnabled = vnetRouteAllEnabled; + VnetPrivatePortsCount = vnetPrivatePortsCount; Cors = cors; Push = push; ApiDefinition = apiDefinition; @@ -186,14 +226,22 @@ public SiteConfigResource() LocalMySqlEnabled = localMySqlEnabled; ManagedServiceIdentityId = managedServiceIdentityId; XManagedServiceIdentityId = xManagedServiceIdentityId; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; IpSecurityRestrictions = ipSecurityRestrictions; ScmIpSecurityRestrictions = scmIpSecurityRestrictions; ScmIpSecurityRestrictionsUseMain = scmIpSecurityRestrictionsUseMain; Http20Enabled = http20Enabled; MinTlsVersion = minTlsVersion; + ScmMinTlsVersion = scmMinTlsVersion; FtpsState = ftpsState; PreWarmedInstanceCount = preWarmedInstanceCount; + FunctionAppScaleLimit = functionAppScaleLimit; HealthCheckPath = healthCheckPath; + FunctionsRuntimeScaleMonitoringEnabled = functionsRuntimeScaleMonitoringEnabled; + WebsiteTimeZone = websiteTimeZone; + MinimumElasticInstanceCount = minimumElasticInstanceCount; + AzureStorageAccounts = azureStorageAccounts; + PublicNetworkAccess = publicNetworkAccess; CustomInit(); } @@ -415,7 +463,7 @@ public SiteConfigResource() /// /// Gets or sets site load balancing. Possible values include: /// 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - /// 'WeightedTotalTraffic', 'RequestHash' + /// 'WeightedTotalTraffic', 'RequestHash', 'PerSiteRoundRobin' /// [JsonProperty(PropertyName = "properties.loadBalancing")] public SiteLoadBalancing? LoadBalancing { get; set; } @@ -458,6 +506,21 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.vnetName")] public string VnetName { get; set; } + /// + /// Gets or sets virtual Network Route All enabled. This causes all + /// outbound traffic to have Virtual Network Security Groups and User + /// Defined Routes applied. + /// + [JsonProperty(PropertyName = "properties.vnetRouteAllEnabled")] + public bool? VnetRouteAllEnabled { get; set; } + + /// + /// Gets or sets the number of private ports assigned to this app. + /// These will be assigned dynamically on runtime. + /// + [JsonProperty(PropertyName = "properties.vnetPrivatePortsCount")] + public int? VnetPrivatePortsCount { get; set; } + /// /// Gets or sets cross-Origin Resource Sharing (CORS) settings. /// @@ -509,6 +572,13 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.xManagedServiceIdentityId")] public int? XManagedServiceIdentityId { get; set; } + /// + /// Gets or sets identity to use for Key Vault Reference + /// authentication. + /// + [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] + public string KeyVaultReferenceIdentity { get; set; } + /// /// Gets or sets IP security restrictions for main. /// @@ -542,6 +612,14 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.minTlsVersion")] public string MinTlsVersion { get; set; } + /// + /// Gets or sets scmMinTlsVersion: configures the minimum version of + /// TLS required for SSL requests for SCM site. Possible values + /// include: '1.0', '1.1', '1.2' + /// + [JsonProperty(PropertyName = "properties.scmMinTlsVersion")] + public string ScmMinTlsVersion { get; set; } + /// /// Gets or sets state of FTP / FTPS service. Possible values include: /// 'AllAllowed', 'FtpsOnly', 'Disabled' @@ -556,12 +634,64 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.preWarmedInstanceCount")] public int? PreWarmedInstanceCount { get; set; } + /// + /// Gets or sets maximum number of workers that a site can scale out + /// to. + /// This setting only applies to the Consumption and Elastic Premium + /// Plans + /// + [JsonProperty(PropertyName = "properties.functionAppScaleLimit")] + public int? FunctionAppScaleLimit { get; set; } + /// /// Gets or sets health check path /// [JsonProperty(PropertyName = "properties.healthCheckPath")] public string HealthCheckPath { get; set; } + /// + /// Gets or sets a value indicating whether functions runtime scale + /// monitoring is enabled. When enabled, + /// the ScaleController will not monitor event sources directly, but + /// will instead call to the + /// runtime to get scale status. + /// + [JsonProperty(PropertyName = "properties.functionsRuntimeScaleMonitoringEnabled")] + public bool? FunctionsRuntimeScaleMonitoringEnabled { get; set; } + + /// + /// Gets or sets sets the time zone a site uses for generating + /// timestamps. Compatible with Linux and Windows App Service. Setting + /// the WEBSITE_TIME_ZONE app setting takes precedence over this + /// config. For Linux, expects tz database values + /// https://www.iana.org/time-zones (for a quick reference see + /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For + /// Windows, expects one of the time zones listed under + /// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows + /// NT\CurrentVersion\Time Zones + /// + [JsonProperty(PropertyName = "properties.websiteTimeZone")] + public string WebsiteTimeZone { get; set; } + + /// + /// Gets or sets number of minimum instance count for a site + /// This setting only applies to the Elastic Plans + /// + [JsonProperty(PropertyName = "properties.minimumElasticInstanceCount")] + public int? MinimumElasticInstanceCount { get; set; } + + /// + /// Gets or sets list of Azure Storage Accounts. + /// + [JsonProperty(PropertyName = "properties.azureStorageAccounts")] + public IDictionary AzureStorageAccounts { get; set; } + + /// + /// Gets or sets property to allow or block all public traffic. + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public string PublicNetworkAccess { get; set; } + /// /// Validate the object. /// @@ -582,6 +712,18 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "PreWarmedInstanceCount", 0); } + if (FunctionAppScaleLimit < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "FunctionAppScaleLimit", 0); + } + if (MinimumElasticInstanceCount > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MinimumElasticInstanceCount", 20); + } + if (MinimumElasticInstanceCount < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MinimumElasticInstanceCount", 0); + } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs index f7bae36f84b6..8b93ae4f1798 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteLoadBalancing.cs @@ -30,7 +30,9 @@ public enum SiteLoadBalancing [EnumMember(Value = "WeightedTotalTraffic")] WeightedTotalTraffic, [EnumMember(Value = "RequestHash")] - RequestHash + RequestHash, + [EnumMember(Value = "PerSiteRoundRobin")] + PerSiteRoundRobin } internal static class SiteLoadBalancingEnumExtension { @@ -53,6 +55,8 @@ internal static string ToSerializedValue(this SiteLoadBalancing value) return "WeightedTotalTraffic"; case SiteLoadBalancing.RequestHash: return "RequestHash"; + case SiteLoadBalancing.PerSiteRoundRobin: + return "PerSiteRoundRobin"; } return null; } @@ -71,6 +75,8 @@ internal static string ToSerializedValue(this SiteLoadBalancing value) return SiteLoadBalancing.WeightedTotalTraffic; case "RequestHash": return SiteLoadBalancing.RequestHash; + case "PerSiteRoundRobin": + return SiteLoadBalancing.PerSiteRoundRobin; } return null; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs index 567a5fb54af7..9d1f55080f11 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SitePatchResource.cs @@ -93,7 +93,7 @@ public SitePatchResource() /// ClientCert is required. /// - ClientCertEnabled: true and ClientCertMode: Optional means /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional' + /// 'Required', 'Optional', 'OptionalInteractiveUser' /// client certificate /// authentication comma-separated exclusion paths /// <code>true</code> to @@ -138,7 +138,16 @@ public SitePatchResource() /// 'GeoRedundant' /// Specifies an operation id if /// this site has a pending operation. - public SitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + /// Checks if Customer provided + /// storage account is required + /// Identity to use for Key + /// Vault Reference authentication. + /// Azure Resource Manager ID of + /// the Virtual network and subnet to be joined by Regional VNET + /// Integration. + /// This must be of the form + /// /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} + public SitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string state = default(string), IList hostNames = default(IList), string repositorySiteName = default(string), UsageState? usageState = default(UsageState?), bool? enabled = default(bool?), IList enabledHostNames = default(IList), SiteAvailabilityState? availabilityState = default(SiteAvailabilityState?), IList hostNameSslStates = default(IList), string serverFarmId = default(string), bool? reserved = default(bool?), bool? isXenon = default(bool?), bool? hyperV = default(bool?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), SiteConfig siteConfig = default(SiteConfig), IList trafficManagerHostNames = default(IList), bool? scmSiteAlsoStopped = default(bool?), string targetSwapSlot = default(string), HostingEnvironmentProfile hostingEnvironmentProfile = default(HostingEnvironmentProfile), bool? clientAffinityEnabled = default(bool?), bool? clientCertEnabled = default(bool?), ClientCertMode? clientCertMode = default(ClientCertMode?), string clientCertExclusionPaths = default(string), bool? hostNamesDisabled = default(bool?), string customDomainVerificationId = default(string), string outboundIpAddresses = default(string), string possibleOutboundIpAddresses = default(string), int? containerSize = default(int?), int? dailyMemoryTimeQuota = default(int?), System.DateTime? suspendedTill = default(System.DateTime?), int? maxNumberOfWorkers = default(int?), CloningInfo cloningInfo = default(CloningInfo), string resourceGroup = default(string), bool? isDefaultContainer = default(bool?), string defaultHostName = default(string), SlotSwapStatus slotSwapStatus = default(SlotSwapStatus), bool? httpsOnly = default(bool?), RedundancyMode? redundancyMode = default(RedundancyMode?), System.Guid? inProgressOperationId = default(System.Guid?), bool? storageAccountRequired = default(bool?), string keyVaultReferenceIdentity = default(string), string virtualNetworkSubnetId = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) : base(id, name, kind, type) { State = state; @@ -179,6 +188,9 @@ public SitePatchResource() HttpsOnly = httpsOnly; RedundancyMode = redundancyMode; InProgressOperationId = inProgressOperationId; + StorageAccountRequired = storageAccountRequired; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + VirtualNetworkSubnetId = virtualNetworkSubnetId; Identity = identity; CustomInit(); } @@ -342,7 +354,7 @@ public SitePatchResource() /// ClientCert is required. /// - ClientCertEnabled: true and ClientCertMode: Optional means /// ClientCert is optional or accepted. Possible values include: - /// 'Required', 'Optional' + /// 'Required', 'Optional', 'OptionalInteractiveUser' /// [JsonProperty(PropertyName = "properties.clientCertMode")] public ClientCertMode? ClientCertMode { get; set; } @@ -469,6 +481,29 @@ public SitePatchResource() [JsonProperty(PropertyName = "properties.inProgressOperationId")] public System.Guid? InProgressOperationId { get; private set; } + /// + /// Gets or sets checks if Customer provided storage account is + /// required + /// + [JsonProperty(PropertyName = "properties.storageAccountRequired")] + public bool? StorageAccountRequired { get; set; } + + /// + /// Gets or sets identity to use for Key Vault Reference + /// authentication. + /// + [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] + public string KeyVaultReferenceIdentity { get; set; } + + /// + /// Gets or sets azure Resource Manager ID of the Virtual network and + /// subnet to be joined by Regional VNET Integration. + /// This must be of the form + /// /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} + /// + [JsonProperty(PropertyName = "properties.virtualNetworkSubnetId")] + public string VirtualNetworkSubnetId { get; set; } + /// /// [JsonProperty(PropertyName = "identity")] diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs index c2544d5f558f..5cd75347d76b 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteSourceControl.cs @@ -51,7 +51,9 @@ public SiteSourceControl() /// <code>true</code> for a /// Mercurial repository; <code>false</code> for a Git /// repository. - public SiteSourceControl(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repoUrl = default(string), string branch = default(string), bool? isManualIntegration = default(bool?), bool? isGitHubAction = default(bool?), bool? deploymentRollbackEnabled = default(bool?), bool? isMercurial = default(bool?)) + /// If GitHub Action is + /// selected, than the associated configuration. + public SiteSourceControl(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repoUrl = default(string), string branch = default(string), bool? isManualIntegration = default(bool?), bool? isGitHubAction = default(bool?), bool? deploymentRollbackEnabled = default(bool?), bool? isMercurial = default(bool?), GitHubActionConfiguration gitHubActionConfiguration = default(GitHubActionConfiguration)) : base(id, name, kind, type) { RepoUrl = repoUrl; @@ -60,6 +62,7 @@ public SiteSourceControl() IsGitHubAction = isGitHubAction; DeploymentRollbackEnabled = deploymentRollbackEnabled; IsMercurial = isMercurial; + GitHubActionConfiguration = gitHubActionConfiguration; CustomInit(); } @@ -114,5 +117,12 @@ public SiteSourceControl() [JsonProperty(PropertyName = "properties.isMercurial")] public bool? IsMercurial { get; set; } + /// + /// Gets or sets if GitHub Action is selected, than the associated + /// configuration. + /// + [JsonProperty(PropertyName = "properties.gitHubActionConfiguration")] + public GitHubActionConfiguration GitHubActionConfiguration { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs index 87d1de6bc667..dfa25b2e6273 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuCapacity.cs @@ -33,14 +33,17 @@ public SkuCapacity() /// Service plan SKU. /// Maximum number of workers for this App /// Service plan SKU. + /// Maximum number of Elastic workers for + /// this App Service plan SKU. /// Default number of workers for this /// App Service plan SKU. /// Available scale configurations for an App /// Service plan. - public SkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string)) + public SkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? elasticMaximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string)) { Minimum = minimum; Maximum = maximum; + ElasticMaximum = elasticMaximum; DefaultProperty = defaultProperty; ScaleType = scaleType; CustomInit(); @@ -65,6 +68,13 @@ public SkuCapacity() [JsonProperty(PropertyName = "maximum")] public int? Maximum { get; set; } + /// + /// Gets or sets maximum number of Elastic workers for this App Service + /// plan SKU. + /// + [JsonProperty(PropertyName = "elasticMaximum")] + public int? ElasticMaximum { get; set; } + /// /// Gets or sets default number of workers for this App Service plan /// SKU. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs index a990199a9a26..a3a68be1409f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SkuName.cs @@ -23,7 +23,10 @@ public static class SkuName public const string Premium = "Premium"; public const string Dynamic = "Dynamic"; public const string Isolated = "Isolated"; + public const string IsolatedV2 = "IsolatedV2"; public const string PremiumV2 = "PremiumV2"; + public const string PremiumV3 = "PremiumV3"; + public const string PremiumContainer = "PremiumContainer"; public const string ElasticPremium = "ElasticPremium"; public const string ElasticIsolated = "ElasticIsolated"; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs index 72d2b4cc304e..8eb176a65999 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SlowRequestsBasedTrigger.cs @@ -30,11 +30,13 @@ public SlowRequestsBasedTrigger() /// Initializes a new instance of the SlowRequestsBasedTrigger class. /// /// Time taken. + /// Request Path. /// Request Count. /// Time interval. - public SlowRequestsBasedTrigger(string timeTaken = default(string), int? count = default(int?), string timeInterval = default(string)) + public SlowRequestsBasedTrigger(string timeTaken = default(string), string path = default(string), int? count = default(int?), string timeInterval = default(string)) { TimeTaken = timeTaken; + Path = path; Count = count; TimeInterval = timeInterval; CustomInit(); @@ -51,6 +53,12 @@ public SlowRequestsBasedTrigger() [JsonProperty(PropertyName = "timeTaken")] public string TimeTaken { get; set; } + /// + /// Gets or sets request Path. + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + /// /// Gets or sets request Count. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs index 4bc2716c9e59..cb090801ecf0 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackMajorVersion.cs @@ -51,7 +51,19 @@ public StackMajorVersion() /// <code>true</code> if this stack /// should be hidden for new customers on portal, otherwise /// <code>false</code>. - public StackMajorVersion(string displayVersion = default(string), string runtimeVersion = default(string), bool? isDefault = default(bool?), IList minorVersions = default(IList), bool? applicationInsights = default(bool?), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?)) + /// <appSettings> + /// <appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" /> + /// </appSettings> + /// Example: All the function apps need AppSetting: + /// "FUNCTIONS_WORKER_RUNTIME" to be set stack name + /// <siteConfigProperties> + /// <siteConfigProperty name="Use32BitWorkerProcess" value="false" + /// /> + /// </siteConfigProperties> + /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be + /// set to 0 + public StackMajorVersion(string displayVersion = default(string), string runtimeVersion = default(string), bool? isDefault = default(bool?), IList minorVersions = default(IList), bool? applicationInsights = default(bool?), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), IDictionary appSettingsDictionary = default(IDictionary), IDictionary siteConfigPropertiesDictionary = default(IDictionary)) { DisplayVersion = displayVersion; RuntimeVersion = runtimeVersion; @@ -61,6 +73,8 @@ public StackMajorVersion() IsPreview = isPreview; IsDeprecated = isDeprecated; IsHidden = isHidden; + AppSettingsDictionary = appSettingsDictionary; + SiteConfigPropertiesDictionary = siteConfigPropertiesDictionary; CustomInit(); } @@ -127,5 +141,27 @@ public StackMajorVersion() [JsonProperty(PropertyName = "isHidden")] public bool? IsHidden { get; set; } + /// + /// Gets or sets &lt;appSettings&gt; + /// &lt;appSetting name="FUNCTIONS_WORKER_RUNTIME" value="dotnet" + /// /&gt; + /// &lt;/appSettings&gt; + /// Example: All the function apps need AppSetting: + /// "FUNCTIONS_WORKER_RUNTIME" to be set stack name + /// + [JsonProperty(PropertyName = "appSettingsDictionary")] + public IDictionary AppSettingsDictionary { get; set; } + + /// + /// Gets or sets &lt;siteConfigProperties&gt; + /// &lt;siteConfigProperty name="Use32BitWorkerProcess" + /// value="false" /&gt; + /// &lt;/siteConfigProperties&gt; + /// Example: All Linux Function Apps, need Use32BitWorkerProcess to be + /// set to 0 + /// + [JsonProperty(PropertyName = "siteConfigPropertiesDictionary")] + public IDictionary SiteConfigPropertiesDictionary { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs new file mode 100644 index 000000000000..d12283ab5958 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StackPreferredOs.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for StackPreferredOs. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum StackPreferredOs + { + [EnumMember(Value = "Windows")] + Windows, + [EnumMember(Value = "Linux")] + Linux + } + internal static class StackPreferredOsEnumExtension + { + internal static string ToSerializedValue(this StackPreferredOs? value) + { + return value == null ? null : ((StackPreferredOs)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this StackPreferredOs value) + { + switch( value ) + { + case StackPreferredOs.Windows: + return "Windows"; + case StackPreferredOs.Linux: + return "Linux"; + } + return null; + } + + internal static StackPreferredOs? ParseStackPreferredOs(this string value) + { + switch( value ) + { + case "Windows": + return StackPreferredOs.Windows; + case "Linux": + return StackPreferredOs.Linux; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.cs new file mode 100644 index 000000000000..ecc4ba1af774 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StagingEnvironmentPolicy.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for StagingEnvironmentPolicy. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum StagingEnvironmentPolicy + { + [EnumMember(Value = "Enabled")] + Enabled, + [EnumMember(Value = "Disabled")] + Disabled + } + internal static class StagingEnvironmentPolicyEnumExtension + { + internal static string ToSerializedValue(this StagingEnvironmentPolicy? value) + { + return value == null ? null : ((StagingEnvironmentPolicy)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this StagingEnvironmentPolicy value) + { + switch( value ) + { + case StagingEnvironmentPolicy.Enabled: + return "Enabled"; + case StagingEnvironmentPolicy.Disabled: + return "Disabled"; + } + return null; + } + + internal static StagingEnvironmentPolicy? ParseStagingEnvironmentPolicy(this string value) + { + switch( value ) + { + case "Enabled": + return StagingEnvironmentPolicy.Enabled; + case "Disabled": + return StagingEnvironmentPolicy.Disabled; + } + return null; + } + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs index c775cdc8eb11..05fb910f6b8d 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StampCapacity.cs @@ -38,8 +38,9 @@ public StampCapacity() /// Shared/dedicated workers. Possible values /// include: 'Shared', 'Dedicated', 'Dynamic' /// Size of the machines. Possible values - /// include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', - /// 'NestedSmall', 'Default' + /// include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'SmallV3', + /// 'MediumV3', 'LargeV3', 'NestedSmall', 'NestedSmallLinux', + /// 'Default' /// Size ID of machines: /// 0 - Small /// 1 - Medium @@ -109,8 +110,8 @@ public StampCapacity() /// /// Gets or sets size of the machines. Possible values include: - /// 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'NestedSmall', - /// 'Default' + /// 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'SmallV3', + /// 'MediumV3', 'LargeV3', 'NestedSmall', 'NestedSmallLinux', 'Default' /// [JsonProperty(PropertyName = "workerSize")] public WorkerSizeOptions? WorkerSize { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs index 656ca9e54a50..01182698e415 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteARMResource.cs @@ -52,7 +52,25 @@ public StaticSiteARMResource() /// secrets. /// Build properties to configure on the /// repository. - public StaticSiteARMResource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), SkuDescription sku = default(SkuDescription)) + /// Private endpoint + /// connections + /// State indicating whether + /// staging environments are allowed or not allowed for a static web + /// app. Possible values include: 'Enabled', 'Disabled' + /// <code>false</code> + /// if config file is locked for this static web app; otherwise, + /// <code>true</code>. + /// Template options for generating a + /// new repository. + /// The content distribution + /// endpoint for the static site. + /// Identity to use for Key + /// Vault Reference authentication. + /// User provided function apps + /// registered with the static site + /// The provider that submitted the last + /// deployment to the primary environment of the static site. + public StaticSiteARMResource(string location, string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IDictionary tags = default(IDictionary), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), IList privateEndpointConnections = default(IList), StagingEnvironmentPolicy? stagingEnvironmentPolicy = default(StagingEnvironmentPolicy?), bool? allowConfigFileUpdates = default(bool?), StaticSiteTemplateOptions templateProperties = default(StaticSiteTemplateOptions), string contentDistributionEndpoint = default(string), string keyVaultReferenceIdentity = default(string), IList userProvidedFunctionApps = default(IList), string provider = default(string), SkuDescription sku = default(SkuDescription), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) : base(location, id, name, kind, type, tags) { DefaultHostname = defaultHostname; @@ -61,7 +79,16 @@ public StaticSiteARMResource() CustomDomains = customDomains; RepositoryToken = repositoryToken; BuildProperties = buildProperties; + PrivateEndpointConnections = privateEndpointConnections; + StagingEnvironmentPolicy = stagingEnvironmentPolicy; + AllowConfigFileUpdates = allowConfigFileUpdates; + TemplateProperties = templateProperties; + ContentDistributionEndpoint = contentDistributionEndpoint; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + UserProvidedFunctionApps = userProvidedFunctionApps; + Provider = provider; Sku = sku; + Identity = identity; CustomInit(); } @@ -107,11 +134,69 @@ public StaticSiteARMResource() [JsonProperty(PropertyName = "properties.buildProperties")] public StaticSiteBuildProperties BuildProperties { get; set; } + /// + /// Gets private endpoint connections + /// + [JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public IList PrivateEndpointConnections { get; private set; } + + /// + /// Gets or sets state indicating whether staging environments are + /// allowed or not allowed for a static web app. Possible values + /// include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.stagingEnvironmentPolicy")] + public StagingEnvironmentPolicy? StagingEnvironmentPolicy { get; set; } + + /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if + /// config file is locked for this static web app; otherwise, + /// &lt;code&gt;true&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.allowConfigFileUpdates")] + public bool? AllowConfigFileUpdates { get; set; } + + /// + /// Gets or sets template options for generating a new repository. + /// + [JsonProperty(PropertyName = "properties.templateProperties")] + public StaticSiteTemplateOptions TemplateProperties { get; set; } + + /// + /// Gets the content distribution endpoint for the static site. + /// + [JsonProperty(PropertyName = "properties.contentDistributionEndpoint")] + public string ContentDistributionEndpoint { get; private set; } + + /// + /// Gets identity to use for Key Vault Reference authentication. + /// + [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] + public string KeyVaultReferenceIdentity { get; private set; } + + /// + /// Gets user provided function apps registered with the static site + /// + [JsonProperty(PropertyName = "properties.userProvidedFunctionApps")] + public IList UserProvidedFunctionApps { get; private set; } + + /// + /// Gets the provider that submitted the last deployment to the primary + /// environment of the static site. + /// + [JsonProperty(PropertyName = "properties.provider")] + public string Provider { get; private set; } + /// /// [JsonProperty(PropertyName = "sku")] public SkuDescription Sku { get; set; } + /// + /// + [JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity { get; set; } + /// /// Validate the object. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs index b82f1efcf925..12a4c431d1fe 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildARMResource.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.WebSites.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -48,7 +50,9 @@ public StaticSiteBuildARMResource() /// The status of the static site build. Possible /// values include: 'WaitingForDeployment', 'Uploading', 'Deploying', /// 'Ready', 'Failed', 'Deleting', 'Detached' - public StaticSiteBuildARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string buildId = default(string), string sourceBranch = default(string), string pullRequestTitle = default(string), string hostname = default(string), System.DateTime? createdTimeUtc = default(System.DateTime?), System.DateTime? lastUpdatedOn = default(System.DateTime?), string status = default(string)) + /// User provided function apps + /// registered with the static site build + public StaticSiteBuildARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string buildId = default(string), string sourceBranch = default(string), string pullRequestTitle = default(string), string hostname = default(string), System.DateTime? createdTimeUtc = default(System.DateTime?), System.DateTime? lastUpdatedOn = default(System.DateTime?), string status = default(string), IList userProvidedFunctionApps = default(IList)) : base(id, name, kind, type) { BuildId = buildId; @@ -58,6 +62,7 @@ public StaticSiteBuildARMResource() CreatedTimeUtc = createdTimeUtc; LastUpdatedOn = lastUpdatedOn; Status = status; + UserProvidedFunctionApps = userProvidedFunctionApps; CustomInit(); } @@ -111,5 +116,12 @@ public StaticSiteBuildARMResource() [JsonProperty(PropertyName = "properties.status")] public string Status { get; private set; } + /// + /// Gets user provided function apps registered with the static site + /// build + /// + [JsonProperty(PropertyName = "properties.userProvidedFunctionApps")] + public IList UserProvidedFunctionApps { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs index be1c6117947d..1fb669c33640 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteBuildProperties.cs @@ -33,13 +33,29 @@ public StaticSiteBuildProperties() /// repository. /// The path to the api code within the /// repository. - /// The path of the app artifacts - /// after building. - public StaticSiteBuildProperties(string appLocation = default(string), string apiLocation = default(string), string appArtifactLocation = default(string)) + /// Deprecated: The path of the app + /// artifacts after building (deprecated in favor of + /// OutputLocation) + /// The output path of the app after + /// building. + /// A custom command to run during + /// deployment of the static content application. + /// A custom command to run during + /// deployment of the Azure Functions API application. + /// Skip Github Action + /// workflow generation. + /// Github Action secret + /// name override. + public StaticSiteBuildProperties(string appLocation = default(string), string apiLocation = default(string), string appArtifactLocation = default(string), string outputLocation = default(string), string appBuildCommand = default(string), string apiBuildCommand = default(string), bool? skipGithubActionWorkflowGeneration = default(bool?), string githubActionSecretNameOverride = default(string)) { AppLocation = appLocation; ApiLocation = apiLocation; AppArtifactLocation = appArtifactLocation; + OutputLocation = outputLocation; + AppBuildCommand = appBuildCommand; + ApiBuildCommand = apiBuildCommand; + SkipGithubActionWorkflowGeneration = skipGithubActionWorkflowGeneration; + GithubActionSecretNameOverride = githubActionSecretNameOverride; CustomInit(); } @@ -61,10 +77,43 @@ public StaticSiteBuildProperties() public string ApiLocation { get; set; } /// - /// Gets or sets the path of the app artifacts after building. + /// Gets or sets deprecated: The path of the app artifacts after + /// building (deprecated in favor of OutputLocation) /// [JsonProperty(PropertyName = "appArtifactLocation")] public string AppArtifactLocation { get; set; } + /// + /// Gets or sets the output path of the app after building. + /// + [JsonProperty(PropertyName = "outputLocation")] + public string OutputLocation { get; set; } + + /// + /// Gets or sets a custom command to run during deployment of the + /// static content application. + /// + [JsonProperty(PropertyName = "appBuildCommand")] + public string AppBuildCommand { get; set; } + + /// + /// Gets or sets a custom command to run during deployment of the Azure + /// Functions API application. + /// + [JsonProperty(PropertyName = "apiBuildCommand")] + public string ApiBuildCommand { get; set; } + + /// + /// Gets or sets skip Github Action workflow generation. + /// + [JsonProperty(PropertyName = "skipGithubActionWorkflowGeneration")] + public bool? SkipGithubActionWorkflowGeneration { get; set; } + + /// + /// Gets or sets github Action secret name override. + /// + [JsonProperty(PropertyName = "githubActionSecretNameOverride")] + public string GithubActionSecretNameOverride { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs index b2dca77065cf..2a2403117477 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainOverviewARMResource.cs @@ -42,11 +42,19 @@ public StaticSiteCustomDomainOverviewARMResource() /// domain. /// The date and time on which the custom /// domain was created for the static site. - public StaticSiteCustomDomainOverviewARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string domainName = default(string), System.DateTime? createdOn = default(System.DateTime?)) + /// The status of the custom domain. Possible + /// values include: 'RetrievingValidationToken', 'Validating', + /// 'Adding', 'Ready', 'Failed', 'Deleting' + /// The TXT record validation + /// token + public StaticSiteCustomDomainOverviewARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string domainName = default(string), System.DateTime? createdOn = default(System.DateTime?), string status = default(string), string validationToken = default(string), string errorMessage = default(string)) : base(id, name, kind, type) { DomainName = domainName; CreatedOn = createdOn; + Status = status; + ValidationToken = validationToken; + ErrorMessage = errorMessage; CustomInit(); } @@ -68,5 +76,24 @@ public StaticSiteCustomDomainOverviewARMResource() [JsonProperty(PropertyName = "properties.createdOn")] public System.DateTime? CreatedOn { get; private set; } + /// + /// Gets the status of the custom domain. Possible values include: + /// 'RetrievingValidationToken', 'Validating', 'Adding', 'Ready', + /// 'Failed', 'Deleting' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets the TXT record validation token + /// + [JsonProperty(PropertyName = "properties.validationToken")] + public string ValidationToken { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "properties.errorMessage")] + public string ErrorMessage { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.cs new file mode 100644 index 000000000000..caee85ae6064 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteCustomDomainRequestPropertiesARMResource.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static Site Custom Domain Request Properties ARM resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticSiteCustomDomainRequestPropertiesARMResource : ProxyOnlyResource + { + /// + /// Initializes a new instance of the + /// StaticSiteCustomDomainRequestPropertiesARMResource class. + /// + public StaticSiteCustomDomainRequestPropertiesARMResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// StaticSiteCustomDomainRequestPropertiesARMResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Validation method for adding a + /// custom domain + public StaticSiteCustomDomainRequestPropertiesARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string validationMethod = default(string)) + : base(id, name, kind, type) + { + ValidationMethod = validationMethod; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets validation method for adding a custom domain + /// + [JsonProperty(PropertyName = "properties.validationMethod")] + public string ValidationMethod { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs index a4de50863546..c7c8eb15aff9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitePatchResource.cs @@ -50,7 +50,25 @@ public StaticSitePatchResource() /// secrets. /// Build properties to configure on the /// repository. - public StaticSitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties)) + /// Private endpoint + /// connections + /// State indicating whether + /// staging environments are allowed or not allowed for a static web + /// app. Possible values include: 'Enabled', 'Disabled' + /// <code>false</code> + /// if config file is locked for this static web app; otherwise, + /// <code>true</code>. + /// Template options for generating a + /// new repository. + /// The content distribution + /// endpoint for the static site. + /// Identity to use for Key + /// Vault Reference authentication. + /// User provided function apps + /// registered with the static site + /// The provider that submitted the last + /// deployment to the primary environment of the static site. + public StaticSitePatchResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string defaultHostname = default(string), string repositoryUrl = default(string), string branch = default(string), IList customDomains = default(IList), string repositoryToken = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties), IList privateEndpointConnections = default(IList), StagingEnvironmentPolicy? stagingEnvironmentPolicy = default(StagingEnvironmentPolicy?), bool? allowConfigFileUpdates = default(bool?), StaticSiteTemplateOptions templateProperties = default(StaticSiteTemplateOptions), string contentDistributionEndpoint = default(string), string keyVaultReferenceIdentity = default(string), IList userProvidedFunctionApps = default(IList), string provider = default(string)) : base(id, name, kind, type) { DefaultHostname = defaultHostname; @@ -59,6 +77,14 @@ public StaticSitePatchResource() CustomDomains = customDomains; RepositoryToken = repositoryToken; BuildProperties = buildProperties; + PrivateEndpointConnections = privateEndpointConnections; + StagingEnvironmentPolicy = stagingEnvironmentPolicy; + AllowConfigFileUpdates = allowConfigFileUpdates; + TemplateProperties = templateProperties; + ContentDistributionEndpoint = contentDistributionEndpoint; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + UserProvidedFunctionApps = userProvidedFunctionApps; + Provider = provider; CustomInit(); } @@ -104,5 +130,58 @@ public StaticSitePatchResource() [JsonProperty(PropertyName = "properties.buildProperties")] public StaticSiteBuildProperties BuildProperties { get; set; } + /// + /// Gets private endpoint connections + /// + [JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public IList PrivateEndpointConnections { get; private set; } + + /// + /// Gets or sets state indicating whether staging environments are + /// allowed or not allowed for a static web app. Possible values + /// include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.stagingEnvironmentPolicy")] + public StagingEnvironmentPolicy? StagingEnvironmentPolicy { get; set; } + + /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if + /// config file is locked for this static web app; otherwise, + /// &lt;code&gt;true&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "properties.allowConfigFileUpdates")] + public bool? AllowConfigFileUpdates { get; set; } + + /// + /// Gets or sets template options for generating a new repository. + /// + [JsonProperty(PropertyName = "properties.templateProperties")] + public StaticSiteTemplateOptions TemplateProperties { get; set; } + + /// + /// Gets the content distribution endpoint for the static site. + /// + [JsonProperty(PropertyName = "properties.contentDistributionEndpoint")] + public string ContentDistributionEndpoint { get; private set; } + + /// + /// Gets identity to use for Key Vault Reference authentication. + /// + [JsonProperty(PropertyName = "properties.keyVaultReferenceIdentity")] + public string KeyVaultReferenceIdentity { get; private set; } + + /// + /// Gets user provided function apps registered with the static site + /// + [JsonProperty(PropertyName = "properties.userProvidedFunctionApps")] + public IList UserProvidedFunctionApps { get; private set; } + + /// + /// Gets the provider that submitted the last deployment to the primary + /// environment of the static site. + /// + [JsonProperty(PropertyName = "properties.provider")] + public string Provider { get; private set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs new file mode 100644 index 000000000000..ad8cb9674adf --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteTemplateOptions.cs @@ -0,0 +1,91 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Template Options for the static site. + /// + public partial class StaticSiteTemplateOptions + { + /// + /// Initializes a new instance of the StaticSiteTemplateOptions class. + /// + public StaticSiteTemplateOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StaticSiteTemplateOptions class. + /// + /// URL of the template repository. + /// The newly generated repository will be based on this one. + /// Owner of the newly generated + /// repository. + /// Name of the newly generated + /// repository. + /// Description of the newly generated + /// repository. + /// Whether or not the newly generated + /// repository is a private repository. Defaults to false (i.e. + /// public). + public StaticSiteTemplateOptions(string templateRepositoryUrl = default(string), string owner = default(string), string repositoryName = default(string), string description = default(string), bool? isPrivate = default(bool?)) + { + TemplateRepositoryUrl = templateRepositoryUrl; + Owner = owner; + RepositoryName = repositoryName; + Description = description; + IsPrivate = isPrivate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URL of the template repository. The newly generated + /// repository will be based on this one. + /// + [JsonProperty(PropertyName = "templateRepositoryUrl")] + public string TemplateRepositoryUrl { get; set; } + + /// + /// Gets or sets owner of the newly generated repository. + /// + [JsonProperty(PropertyName = "owner")] + public string Owner { get; set; } + + /// + /// Gets or sets name of the newly generated repository. + /// + [JsonProperty(PropertyName = "repositoryName")] + public string RepositoryName { get; set; } + + /// + /// Gets or sets description of the newly generated repository. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets whether or not the newly generated repository is a + /// private repository. Defaults to false (i.e. public). + /// + [JsonProperty(PropertyName = "isPrivate")] + public bool? IsPrivate { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.cs new file mode 100644 index 000000000000..d21a687e9567 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionApp.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A static site user provided function. + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticSiteUserProvidedFunctionApp : ProxyOnlyResource + { + /// + /// Initializes a new instance of the StaticSiteUserProvidedFunctionApp + /// class. + /// + public StaticSiteUserProvidedFunctionApp() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StaticSiteUserProvidedFunctionApp + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The resource id of the function + /// app registered with the static site + /// The region of the function app + /// registered with the static site + /// The date and time on which the function app + /// was registered with the static site. + public StaticSiteUserProvidedFunctionApp(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string functionAppResourceId = default(string), string functionAppRegion = default(string), System.DateTime? createdOn = default(System.DateTime?)) + : base(id, name, kind, type) + { + FunctionAppResourceId = functionAppResourceId; + FunctionAppRegion = functionAppRegion; + CreatedOn = createdOn; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource id of the function app registered with + /// the static site + /// + [JsonProperty(PropertyName = "properties.functionAppResourceId")] + public string FunctionAppResourceId { get; set; } + + /// + /// Gets or sets the region of the function app registered with the + /// static site + /// + [JsonProperty(PropertyName = "properties.functionAppRegion")] + public string FunctionAppRegion { get; set; } + + /// + /// Gets the date and time on which the function app was registered + /// with the static site. + /// + [JsonProperty(PropertyName = "properties.createdOn")] + public System.DateTime? CreatedOn { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.cs new file mode 100644 index 000000000000..b7652412f1c0 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteUserProvidedFunctionAppARMResource.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static Site User Provided Function App ARM resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticSiteUserProvidedFunctionAppARMResource : ProxyOnlyResource + { + /// + /// Initializes a new instance of the + /// StaticSiteUserProvidedFunctionAppARMResource class. + /// + public StaticSiteUserProvidedFunctionAppARMResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// StaticSiteUserProvidedFunctionAppARMResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The resource id of the function + /// app registered with the static site + /// The region of the function app + /// registered with the static site + /// The date and time on which the function app + /// was registered with the static site. + public StaticSiteUserProvidedFunctionAppARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string functionAppResourceId = default(string), string functionAppRegion = default(string), System.DateTime? createdOn = default(System.DateTime?)) + : base(id, name, kind, type) + { + FunctionAppResourceId = functionAppResourceId; + FunctionAppRegion = functionAppRegion; + CreatedOn = createdOn; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource id of the function app registered with + /// the static site + /// + [JsonProperty(PropertyName = "properties.functionAppResourceId")] + public string FunctionAppResourceId { get; set; } + + /// + /// Gets or sets the region of the function app registered with the + /// static site + /// + [JsonProperty(PropertyName = "properties.functionAppRegion")] + public string FunctionAppRegion { get; set; } + + /// + /// Gets the date and time on which the function app was registered + /// with the static site. + /// + [JsonProperty(PropertyName = "properties.createdOn")] + public System.DateTime? CreatedOn { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.cs new file mode 100644 index 000000000000..ec3255096a8f --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSiteZipDeploymentARMResource.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static site zip deployment ARM resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticSiteZipDeploymentARMResource : ProxyOnlyResource + { + /// + /// Initializes a new instance of the + /// StaticSiteZipDeploymentARMResource class. + /// + public StaticSiteZipDeploymentARMResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// StaticSiteZipDeploymentARMResource class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// URL for the zipped app content + /// URL for the zipped api content + /// A title to label the + /// deployment + /// The provider submitting this + /// deployment + /// The language of the api content, if + /// it exists + public StaticSiteZipDeploymentARMResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string appZipUrl = default(string), string apiZipUrl = default(string), string deploymentTitle = default(string), string provider = default(string), string functionLanguage = default(string)) + : base(id, name, kind, type) + { + AppZipUrl = appZipUrl; + ApiZipUrl = apiZipUrl; + DeploymentTitle = deploymentTitle; + Provider = provider; + FunctionLanguage = functionLanguage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URL for the zipped app content + /// + [JsonProperty(PropertyName = "properties.appZipUrl")] + public string AppZipUrl { get; set; } + + /// + /// Gets or sets URL for the zipped api content + /// + [JsonProperty(PropertyName = "properties.apiZipUrl")] + public string ApiZipUrl { get; set; } + + /// + /// Gets or sets a title to label the deployment + /// + [JsonProperty(PropertyName = "properties.deploymentTitle")] + public string DeploymentTitle { get; set; } + + /// + /// Gets or sets the provider submitting this deployment + /// + [JsonProperty(PropertyName = "properties.provider")] + public string Provider { get; set; } + + /// + /// Gets or sets the language of the api content, if it exists + /// + [JsonProperty(PropertyName = "properties.functionLanguage")] + public string FunctionLanguage { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.cs new file mode 100644 index 000000000000..33b41a8623e2 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreview.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Preview for the Static Site Workflow to be generated + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticSitesWorkflowPreview : ProxyOnlyResource + { + /// + /// Initializes a new instance of the StaticSitesWorkflowPreview class. + /// + public StaticSitesWorkflowPreview() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StaticSitesWorkflowPreview class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// The path for the workflow file to be + /// generated + /// The contents for the workflow file to be + /// generated + public StaticSitesWorkflowPreview(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string path = default(string), string contents = default(string)) + : base(id, name, kind, type) + { + Path = path; + Contents = contents; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the path for the workflow file to be generated + /// + [JsonProperty(PropertyName = "properties.path")] + public string Path { get; private set; } + + /// + /// Gets the contents for the workflow file to be generated + /// + [JsonProperty(PropertyName = "properties.contents")] + public string Contents { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.cs new file mode 100644 index 000000000000..98297a655dbd --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StaticSitesWorkflowPreviewRequest.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request entity for previewing the Static Site workflow + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticSitesWorkflowPreviewRequest : ProxyOnlyResource + { + /// + /// Initializes a new instance of the StaticSitesWorkflowPreviewRequest + /// class. + /// + public StaticSitesWorkflowPreviewRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StaticSitesWorkflowPreviewRequest + /// class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// URL for the repository of the static + /// site. + /// The target branch in the repository. + /// Build properties to configure on the + /// repository. + public StaticSitesWorkflowPreviewRequest(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string repositoryUrl = default(string), string branch = default(string), StaticSiteBuildProperties buildProperties = default(StaticSiteBuildProperties)) + : base(id, name, kind, type) + { + RepositoryUrl = repositoryUrl; + Branch = branch; + BuildProperties = buildProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URL for the repository of the static site. + /// + [JsonProperty(PropertyName = "properties.repositoryUrl")] + public string RepositoryUrl { get; set; } + + /// + /// Gets or sets the target branch in the repository. + /// + [JsonProperty(PropertyName = "properties.branch")] + public string Branch { get; set; } + + /// + /// Gets or sets build properties to configure on the repository. + /// + [JsonProperty(PropertyName = "properties.buildProperties")] + public StaticSiteBuildProperties BuildProperties { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs new file mode 100644 index 000000000000..c53ab12d6064 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Status.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Identify the status of the most severe insight generated by the + /// detector. + /// + public partial class Status + { + /// + /// Initializes a new instance of the Status class. + /// + public Status() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Status class. + /// + /// Descriptive message. + /// Level of the most severe insight generated + /// by the detector. Possible values include: 'Critical', 'Warning', + /// 'Info', 'Success', 'None' + public Status(string message = default(string), InsightStatus? statusId = default(InsightStatus?)) + { + Message = message; + StatusId = statusId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets descriptive message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets level of the most severe insight generated by the + /// detector. Possible values include: 'Critical', 'Warning', 'Info', + /// 'Success', 'None' + /// + [JsonProperty(PropertyName = "statusId")] + public InsightStatus? StatusId { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs index f5a0016591e9..de810774d66c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesBasedTrigger.cs @@ -34,13 +34,15 @@ public StatusCodesBasedTrigger() /// Win32 error code. /// Request Count. /// Time interval. - public StatusCodesBasedTrigger(int? status = default(int?), int? subStatus = default(int?), int? win32Status = default(int?), int? count = default(int?), string timeInterval = default(string)) + /// Request Path + public StatusCodesBasedTrigger(int? status = default(int?), int? subStatus = default(int?), int? win32Status = default(int?), int? count = default(int?), string timeInterval = default(string), string path = default(string)) { Status = status; SubStatus = subStatus; Win32Status = win32Status; Count = count; TimeInterval = timeInterval; + Path = path; CustomInit(); } @@ -79,5 +81,11 @@ public StatusCodesBasedTrigger() [JsonProperty(PropertyName = "timeInterval")] public string TimeInterval { get; set; } + /// + /// Gets or sets request Path + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs new file mode 100644 index 000000000000..e3d3dfe55380 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StatusCodesRangeBasedTrigger.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Trigger based on range of status codes. + /// + public partial class StatusCodesRangeBasedTrigger + { + /// + /// Initializes a new instance of the StatusCodesRangeBasedTrigger + /// class. + /// + public StatusCodesRangeBasedTrigger() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StatusCodesRangeBasedTrigger + /// class. + /// + /// HTTP status code. + /// Request Count. + /// Time interval. + public StatusCodesRangeBasedTrigger(string statusCodes = default(string), string path = default(string), int? count = default(int?), string timeInterval = default(string)) + { + StatusCodes = statusCodes; + Path = path; + Count = count; + TimeInterval = timeInterval; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets HTTP status code. + /// + [JsonProperty(PropertyName = "statusCodes")] + public string StatusCodes { get; set; } + + /// + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + + /// + /// Gets or sets request Count. + /// + [JsonProperty(PropertyName = "count")] + public int? Count { get; set; } + + /// + /// Gets or sets time interval. + /// + [JsonProperty(PropertyName = "timeInterval")] + public string TimeInterval { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.cs new file mode 100644 index 000000000000..cb1f2518c84d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/StringList.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// String list resource. + /// + public partial class StringList : ProxyOnlyResource + { + /// + /// Initializes a new instance of the StringList class. + /// + public StringList() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StringList class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// List of string resources. + public StringList(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), IList properties = default(IList)) + : base(id, name, kind, type) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of string resources. + /// + [JsonProperty(PropertyName = "properties")] + public IList Properties { get; set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.cs new file mode 100644 index 000000000000..46fd238f182d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SupportTopic.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines a unique Support Topic + /// + public partial class SupportTopic + { + /// + /// Initializes a new instance of the SupportTopic class. + /// + public SupportTopic() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SupportTopic class. + /// + /// Support Topic Id + /// Unique resource Id + public SupportTopic(string id = default(string), string pesId = default(string)) + { + Id = id; + PesId = pesId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets support Topic Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets unique resource Id + /// + [JsonProperty(PropertyName = "pesId")] + public string PesId { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.cs index ffe3edf35446..3bab06bd3ab3 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TokenStore.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the token store. + /// [Rest.Serialization.JsonTransformation] public partial class TokenStore : ProxyOnlyResource { @@ -33,6 +36,17 @@ public TokenStore() /// Resource Name. /// Kind of resource. /// Resource type. + /// <code>true</code> to durably + /// store platform-specific security tokens that are obtained during + /// login flows; otherwise, <code>false</code>. + /// The default is <code>false</code>. + /// The number of hours after + /// session token expiration that a session token can be used to + /// call the token refresh API. The default is 72 hours. + /// The configuration settings of the storage + /// of the tokens if a file system is used. + /// The configuration settings of the + /// storage of the tokens if blob storage is used. public TokenStore(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), double? tokenRefreshExtensionHours = default(double?), FileSystemTokenStore fileSystem = default(FileSystemTokenStore), BlobStorageTokenStore azureBlobStorage = default(BlobStorageTokenStore)) : base(id, name, kind, type) { @@ -49,21 +63,33 @@ public TokenStore() partial void CustomInit(); /// + /// Gets or sets &lt;code&gt;true&lt;/code&gt; to + /// durably store platform-specific security tokens that are obtained + /// during login flows; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// The default is &lt;code&gt;false&lt;/code&gt;. /// [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } /// + /// Gets or sets the number of hours after session token expiration + /// that a session token can be used to + /// call the token refresh API. The default is 72 hours. /// [JsonProperty(PropertyName = "properties.tokenRefreshExtensionHours")] public double? TokenRefreshExtensionHours { get; set; } /// + /// Gets or sets the configuration settings of the storage of the + /// tokens if a file system is used. /// [JsonProperty(PropertyName = "properties.fileSystem")] public FileSystemTokenStore FileSystem { get; set; } /// + /// Gets or sets the configuration settings of the storage of the + /// tokens if blob storage is used. /// [JsonProperty(PropertyName = "properties.azureBlobStorage")] public BlobStorageTokenStore AzureBlobStorage { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.cs index c2c7bdf49b9c..32d8b05a116a 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/Twitter.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the Twitter provider. + /// [Rest.Serialization.JsonTransformation] public partial class Twitter : ProxyOnlyResource { @@ -33,6 +36,11 @@ public Twitter() /// Resource Name. /// Kind of resource. /// Resource type. + /// <code>false</code> if the Twitter + /// provider should not be enabled despite the set registration; + /// otherwise, <code>true</code>. + /// The configuration settings of the app + /// registration for the Twitter provider. public Twitter(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? enabled = default(bool?), TwitterRegistration registration = default(TwitterRegistration)) : base(id, name, kind, type) { @@ -47,11 +55,17 @@ public Twitter() partial void CustomInit(); /// + /// Gets or sets &lt;code&gt;false&lt;/code&gt; if the + /// Twitter provider should not be enabled despite the set + /// registration; otherwise, + /// &lt;code&gt;true&lt;/code&gt;. /// [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } /// + /// Gets or sets the configuration settings of the app registration for + /// the Twitter provider. /// [JsonProperty(PropertyName = "properties.registration")] public TwitterRegistration Registration { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.cs index 92b77941cf02..466cd1f256f8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/TwitterRegistration.cs @@ -15,6 +15,10 @@ namespace Microsoft.Azure.Management.WebSites.Models using Newtonsoft.Json; using System.Linq; + /// + /// The configuration settings of the app registration for the Twitter + /// provider. + /// [Rest.Serialization.JsonTransformation] public partial class TwitterRegistration : ProxyOnlyResource { @@ -33,6 +37,14 @@ public TwitterRegistration() /// Resource Name. /// Kind of resource. /// Resource type. + /// The OAuth 1.0a consumer key of the + /// Twitter application used for sign-in. + /// This setting is required for enabling Twitter Sign-In. + /// Twitter Sign-In documentation: + /// https://dev.twitter.com/web/sign-in + /// The app setting name that + /// contains the OAuth 1.0a consumer secret of the Twitter + /// application used for sign-in. public TwitterRegistration(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string consumerKey = default(string), string consumerSecretSettingName = default(string)) : base(id, name, kind, type) { @@ -47,11 +59,18 @@ public TwitterRegistration() partial void CustomInit(); /// + /// Gets or sets the OAuth 1.0a consumer key of the Twitter application + /// used for sign-in. + /// This setting is required for enabling Twitter Sign-In. + /// Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in /// [JsonProperty(PropertyName = "properties.consumerKey")] public string ConsumerKey { get; set; } /// + /// Gets or sets the app setting name that contains the OAuth 1.0a + /// consumer secret of the Twitter + /// application used for sign-in. /// [JsonProperty(PropertyName = "properties.consumerSecretSettingName")] public string ConsumerSecretSettingName { get; set; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs index a582a0780b0e..cfab40caac5c 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateRequest.cs @@ -34,7 +34,8 @@ public ValidateRequest() /// /// Resource name to verify. /// Resource type used for verification. Possible - /// values include: 'ServerFarm', 'Site' + /// values include: 'ServerFarm', 'Site', + /// 'Microsoft.Web/hostingEnvironments' /// Expected location of the resource. /// ARM resource ID of an App Service plan /// that would host the app. @@ -63,7 +64,9 @@ public ValidateRequest() /// Image tag /// Platform (windows or /// linux) - public ValidateRequest(string name, string type, string location, string serverFarmId = default(string), string skuName = default(string), bool? needLinuxWorkers = default(bool?), bool? isSpot = default(bool?), int? capacity = default(int?), string hostingEnvironment = default(string), bool? isXenon = default(bool?), string containerRegistryBaseUrl = default(string), string containerRegistryUsername = default(string), string containerRegistryPassword = default(string), string containerImageRepository = default(string), string containerImageTag = default(string), string containerImagePlatform = default(string)) + /// App Service Environment + /// Properties + public ValidateRequest(string name, string type, string location, string serverFarmId = default(string), string skuName = default(string), bool? needLinuxWorkers = default(bool?), bool? isSpot = default(bool?), int? capacity = default(int?), string hostingEnvironment = default(string), bool? isXenon = default(bool?), string containerRegistryBaseUrl = default(string), string containerRegistryUsername = default(string), string containerRegistryPassword = default(string), string containerImageRepository = default(string), string containerImageTag = default(string), string containerImagePlatform = default(string), AppServiceEnvironment appServiceEnvironment = default(AppServiceEnvironment)) { Name = name; Type = type; @@ -81,6 +84,7 @@ public ValidateRequest() ContainerImageRepository = containerImageRepository; ContainerImageTag = containerImageTag; ContainerImagePlatform = containerImagePlatform; + AppServiceEnvironment = appServiceEnvironment; CustomInit(); } @@ -97,7 +101,7 @@ public ValidateRequest() /// /// Gets or sets resource type used for verification. Possible values - /// include: 'ServerFarm', 'Site' + /// include: 'ServerFarm', 'Site', 'Microsoft.Web/hostingEnvironments' /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } @@ -194,6 +198,12 @@ public ValidateRequest() [JsonProperty(PropertyName = "properties.containerImagePlatform")] public string ContainerImagePlatform { get; set; } + /// + /// Gets or sets app Service Environment Properties + /// + [JsonProperty(PropertyName = "properties.appServiceEnvironment")] + public AppServiceEnvironment AppServiceEnvironment { get; set; } + /// /// Validate the object. /// @@ -218,6 +228,10 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "Capacity", 1); } + if (AppServiceEnvironment != null) + { + AppServiceEnvironment.Validate(); + } } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs index 511049be371b..1c771a665519 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/ValidateResourceTypes.cs @@ -18,5 +18,6 @@ public static class ValidateResourceTypes { public const string ServerFarm = "ServerFarm"; public const string Site = "Site"; + public const string MicrosoftWebHostingEnvironments = "Microsoft.Web/hostingEnvironments"; } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs index a9162d3a1626..55e03d256121 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VirtualNetworkProfile.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.WebSites.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -34,7 +35,7 @@ public VirtualNetworkProfile() /// Resource type of the Virtual Network /// (read-only). /// Subnet within the Virtual Network. - public VirtualNetworkProfile(string id = default(string), string name = default(string), string type = default(string), string subnet = default(string)) + public VirtualNetworkProfile(string id, string name = default(string), string type = default(string), string subnet = default(string)) { Id = id; Name = name; @@ -72,5 +73,18 @@ public VirtualNetworkProfile() [JsonProperty(PropertyName = "subnet")] public string Subnet { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + } + } } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs index 0afb85613b5f..bfd2641e12d9 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetParameters.cs @@ -41,12 +41,15 @@ public VnetParameters() /// The name of the VNET to be validated /// The subnet name to be /// validated - public VnetParameters(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string vnetResourceGroup = default(string), string vnetName = default(string), string vnetSubnetName = default(string)) + /// The ARM Resource ID of the subnet to + /// validate + public VnetParameters(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string vnetResourceGroup = default(string), string vnetName = default(string), string vnetSubnetName = default(string), string subnetResourceId = default(string)) : base(id, name, kind, type) { VnetResourceGroup = vnetResourceGroup; VnetName = vnetName; VnetSubnetName = vnetSubnetName; + SubnetResourceId = subnetResourceId; CustomInit(); } @@ -73,5 +76,11 @@ public VnetParameters() [JsonProperty(PropertyName = "properties.vnetSubnetName")] public string VnetSubnetName { get; set; } + /// + /// Gets or sets the ARM Resource ID of the subnet to validate + /// + [JsonProperty(PropertyName = "properties.subnetResourceId")] + public string SubnetResourceId { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs index f72ab080b2cf..fc6cb6a7c8e2 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/VnetValidationFailureDetails.cs @@ -40,15 +40,21 @@ public VnetValidationFailureDetails() /// Resource Name. /// Kind of resource. /// Resource type. + /// Text describing the validation + /// outcome. /// A flag describing whether or not validation /// failed. /// A list of tests that failed in the /// validation. - public VnetValidationFailureDetails(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), bool? failed = default(bool?), IList failedTests = default(IList)) + /// A list of warnings generated during + /// validation. + public VnetValidationFailureDetails(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string message = default(string), bool? failed = default(bool?), IList failedTests = default(IList), IList warnings = default(IList)) : base(id, name, kind, type) { + Message = message; Failed = failed; FailedTests = failedTests; + Warnings = warnings; CustomInit(); } @@ -57,6 +63,12 @@ public VnetValidationFailureDetails() /// partial void CustomInit(); + /// + /// Gets or sets text describing the validation outcome. + /// + [JsonProperty(PropertyName = "properties.message")] + public string Message { get; set; } + /// /// Gets or sets a flag describing whether or not validation failed. /// @@ -69,5 +81,11 @@ public VnetValidationFailureDetails() [JsonProperty(PropertyName = "properties.failedTests")] public IList FailedTests { get; set; } + /// + /// Gets or sets a list of warnings generated during validation. + /// + [JsonProperty(PropertyName = "properties.warnings")] + public IList Warnings { get; set; } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs new file mode 100644 index 000000000000..1401f5751420 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMajorVersion.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.WebSites.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Web App stack major version. + /// + public partial class WebAppMajorVersion + { + /// + /// Initializes a new instance of the WebAppMajorVersion class. + /// + public WebAppMajorVersion() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebAppMajorVersion class. + /// + /// Web App stack major version (display + /// only). + /// Web App stack major version name. + /// Minor versions associated with the + /// major version. + public WebAppMajorVersion(string displayText = default(string), string value = default(string), IList minorVersions = default(IList)) + { + DisplayText = displayText; + Value = value; + MinorVersions = minorVersions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets web App stack major version (display only). + /// + [JsonProperty(PropertyName = "displayText")] + public string DisplayText { get; private set; } + + /// + /// Gets web App stack major version name. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Gets minor versions associated with the major version. + /// + [JsonProperty(PropertyName = "minorVersions")] + public IList MinorVersions { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.cs new file mode 100644 index 000000000000..3b7864390773 --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppMinorVersion.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Web App stack minor version. + /// + public partial class WebAppMinorVersion + { + /// + /// Initializes a new instance of the WebAppMinorVersion class. + /// + public WebAppMinorVersion() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebAppMinorVersion class. + /// + /// Web App stack minor version (display + /// only). + /// Web App stack major version name. + /// Settings associated with the minor + /// version. + public WebAppMinorVersion(string displayText = default(string), string value = default(string), WebAppRuntimes stackSettings = default(WebAppRuntimes)) + { + DisplayText = displayText; + Value = value; + StackSettings = stackSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets web App stack minor version (display only). + /// + [JsonProperty(PropertyName = "displayText")] + public string DisplayText { get; private set; } + + /// + /// Gets web App stack major version name. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + /// + /// Gets settings associated with the minor version. + /// + [JsonProperty(PropertyName = "stackSettings")] + public WebAppRuntimes StackSettings { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs new file mode 100644 index 000000000000..9b2842b0248a --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimeSettings.cs @@ -0,0 +1,152 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Web App runtime settings. + /// + public partial class WebAppRuntimeSettings + { + /// + /// Initializes a new instance of the WebAppRuntimeSettings class. + /// + public WebAppRuntimeSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebAppRuntimeSettings class. + /// + /// Web App stack minor version (runtime + /// only). + /// <code>true</code> if + /// remote debugging is supported for the stack; otherwise, + /// <code>false</code>. + /// Application Insights settings + /// associated with the minor version. + /// GitHub Actions settings + /// associated with the minor version. + /// <code>true</code> if the stack + /// is in preview; otherwise, <code>false</code>. + /// <code>true</code> if the + /// stack is deprecated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the stack + /// should be hidden; otherwise, + /// <code>false</code>. + /// End-of-life date for the minor + /// version. + /// <code>true</code> if the + /// stack version is auto-updated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the + /// minor version is early-access; otherwise, + /// <code>false</code>. + public WebAppRuntimeSettings(string runtimeVersion = default(string), bool? remoteDebuggingSupported = default(bool?), AppInsightsWebAppStackSettings appInsightsSettings = default(AppInsightsWebAppStackSettings), GitHubActionWebAppStackSettings gitHubActionSettings = default(GitHubActionWebAppStackSettings), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) + { + RuntimeVersion = runtimeVersion; + RemoteDebuggingSupported = remoteDebuggingSupported; + AppInsightsSettings = appInsightsSettings; + GitHubActionSettings = gitHubActionSettings; + IsPreview = isPreview; + IsDeprecated = isDeprecated; + IsHidden = isHidden; + EndOfLifeDate = endOfLifeDate; + IsAutoUpdate = isAutoUpdate; + IsEarlyAccess = isEarlyAccess; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets web App stack minor version (runtime only). + /// + [JsonProperty(PropertyName = "runtimeVersion")] + public string RuntimeVersion { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if remote + /// debugging is supported for the stack; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "remoteDebuggingSupported")] + public bool? RemoteDebuggingSupported { get; private set; } + + /// + /// Gets application Insights settings associated with the minor + /// version. + /// + [JsonProperty(PropertyName = "appInsightsSettings")] + public AppInsightsWebAppStackSettings AppInsightsSettings { get; private set; } + + /// + /// Gets gitHub Actions settings associated with the minor version. + /// + [JsonProperty(PropertyName = "gitHubActionSettings")] + public GitHubActionWebAppStackSettings GitHubActionSettings { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// in preview; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isPreview")] + public bool? IsPreview { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// deprecated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDeprecated")] + public bool? IsDeprecated { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// should be hidden; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden { get; private set; } + + /// + /// Gets end-of-life date for the minor version. + /// + [JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// version is auto-updated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isAutoUpdate")] + public bool? IsAutoUpdate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the minor + /// version is early-access; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isEarlyAccess")] + public bool? IsEarlyAccess { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.cs new file mode 100644 index 000000000000..06510ee15e8e --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppRuntimes.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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Web App stack runtimes. + /// + public partial class WebAppRuntimes + { + /// + /// Initializes a new instance of the WebAppRuntimes class. + /// + public WebAppRuntimes() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebAppRuntimes class. + /// + /// Linux-specific settings + /// associated with the minor version. + /// Windows-specific settings + /// associated with the minor version. + /// Linux-specific settings + /// associated with the Java container minor version. + /// Windows-specific settings + /// associated with the Java container minor version. + public WebAppRuntimes(WebAppRuntimeSettings linuxRuntimeSettings = default(WebAppRuntimeSettings), WebAppRuntimeSettings windowsRuntimeSettings = default(WebAppRuntimeSettings), LinuxJavaContainerSettings linuxContainerSettings = default(LinuxJavaContainerSettings), WindowsJavaContainerSettings windowsContainerSettings = default(WindowsJavaContainerSettings)) + { + LinuxRuntimeSettings = linuxRuntimeSettings; + WindowsRuntimeSettings = windowsRuntimeSettings; + LinuxContainerSettings = linuxContainerSettings; + WindowsContainerSettings = windowsContainerSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets linux-specific settings associated with the minor version. + /// + [JsonProperty(PropertyName = "linuxRuntimeSettings")] + public WebAppRuntimeSettings LinuxRuntimeSettings { get; private set; } + + /// + /// Gets windows-specific settings associated with the minor version. + /// + [JsonProperty(PropertyName = "windowsRuntimeSettings")] + public WebAppRuntimeSettings WindowsRuntimeSettings { get; private set; } + + /// + /// Gets linux-specific settings associated with the Java container + /// minor version. + /// + [JsonProperty(PropertyName = "linuxContainerSettings")] + public LinuxJavaContainerSettings LinuxContainerSettings { get; private set; } + + /// + /// Gets windows-specific settings associated with the Java container + /// minor version. + /// + [JsonProperty(PropertyName = "windowsContainerSettings")] + public WindowsJavaContainerSettings WindowsContainerSettings { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.cs new file mode 100644 index 000000000000..37690ec2fb2d --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WebAppStack.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.WebSites.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Web App stack. + /// + [Rest.Serialization.JsonTransformation] + public partial class WebAppStack : ProxyOnlyResource + { + /// + /// Initializes a new instance of the WebAppStack class. + /// + public WebAppStack() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebAppStack class. + /// + /// Resource Id. + /// Resource Name. + /// Kind of resource. + /// Resource type. + /// Web App stack location. + /// Web App stack (display only). + /// Web App stack name. + /// List of major versions + /// available. + /// Web App stack preferred OS. Possible + /// values include: 'Windows', 'Linux' + public WebAppStack(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string location = default(string), string displayText = default(string), string value = default(string), IList majorVersions = default(IList), StackPreferredOs? preferredOs = default(StackPreferredOs?)) + : base(id, name, kind, type) + { + Location = location; + DisplayText = displayText; + Value = value; + MajorVersions = majorVersions; + PreferredOs = preferredOs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets web App stack location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets web App stack (display only). + /// + [JsonProperty(PropertyName = "properties.displayText")] + public string DisplayText { get; private set; } + + /// + /// Gets web App stack name. + /// + [JsonProperty(PropertyName = "properties.value")] + public string Value { get; private set; } + + /// + /// Gets list of major versions available. + /// + [JsonProperty(PropertyName = "properties.majorVersions")] + public IList MajorVersions { get; private set; } + + /// + /// Gets web App stack preferred OS. Possible values include: + /// 'Windows', 'Linux' + /// + [JsonProperty(PropertyName = "properties.preferredOs")] + public StackPreferredOs? PreferredOs { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs new file mode 100644 index 000000000000..a773a9d589ab --- /dev/null +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WindowsJavaContainerSettings.cs @@ -0,0 +1,130 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.WebSites.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Windows Java Container settings. + /// + public partial class WindowsJavaContainerSettings + { + /// + /// Initializes a new instance of the WindowsJavaContainerSettings + /// class. + /// + public WindowsJavaContainerSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WindowsJavaContainerSettings + /// class. + /// + /// Java container (runtime only). + /// Java container version (runtime + /// only). + /// <code>true</code> if the stack + /// is in preview; otherwise, <code>false</code>. + /// <code>true</code> if the + /// stack is deprecated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the stack + /// should be hidden; otherwise, + /// <code>false</code>. + /// End-of-life date for the minor + /// version. + /// <code>true</code> if the + /// stack version is auto-updated; otherwise, + /// <code>false</code>. + /// <code>true</code> if the + /// minor version is early-access; otherwise, + /// <code>false</code>. + public WindowsJavaContainerSettings(string javaContainer = default(string), string javaContainerVersion = default(string), bool? isPreview = default(bool?), bool? isDeprecated = default(bool?), bool? isHidden = default(bool?), System.DateTime? endOfLifeDate = default(System.DateTime?), bool? isAutoUpdate = default(bool?), bool? isEarlyAccess = default(bool?)) + { + JavaContainer = javaContainer; + JavaContainerVersion = javaContainerVersion; + IsPreview = isPreview; + IsDeprecated = isDeprecated; + IsHidden = isHidden; + EndOfLifeDate = endOfLifeDate; + IsAutoUpdate = isAutoUpdate; + IsEarlyAccess = isEarlyAccess; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets java container (runtime only). + /// + [JsonProperty(PropertyName = "javaContainer")] + public string JavaContainer { get; private set; } + + /// + /// Gets java container version (runtime only). + /// + [JsonProperty(PropertyName = "javaContainerVersion")] + public string JavaContainerVersion { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// in preview; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isPreview")] + public bool? IsPreview { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack is + /// deprecated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isDeprecated")] + public bool? IsDeprecated { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// should be hidden; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden { get; private set; } + + /// + /// Gets end-of-life date for the minor version. + /// + [JsonProperty(PropertyName = "endOfLifeDate")] + public System.DateTime? EndOfLifeDate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the stack + /// version is auto-updated; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isAutoUpdate")] + public bool? IsAutoUpdate { get; private set; } + + /// + /// Gets &lt;code&gt;true&lt;/code&gt; if the minor + /// version is early-access; otherwise, + /// &lt;code&gt;false&lt;/code&gt;. + /// + [JsonProperty(PropertyName = "isEarlyAccess")] + public bool? IsEarlyAccess { get; private set; } + + } +} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPool.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPool.cs deleted file mode 100644 index 326c9ba160f2..000000000000 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerPool.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.WebSites.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Worker pool of an App Service Environment. - /// - public partial class WorkerPool - { - /// - /// Initializes a new instance of the WorkerPool class. - /// - public WorkerPool() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WorkerPool class. - /// - /// Worker size ID for referencing this - /// worker pool. - /// Shared or dedicated app hosting. Possible - /// values include: 'Shared', 'Dedicated', 'Dynamic' - /// VM size of the worker pool - /// instances. - /// Number of instances in the worker - /// pool. - /// Names of all instances in the worker - /// pool (read only). - public WorkerPool(int? workerSizeId = default(int?), ComputeModeOptions? computeMode = default(ComputeModeOptions?), string workerSize = default(string), int? workerCount = default(int?), IList instanceNames = default(IList)) - { - WorkerSizeId = workerSizeId; - ComputeMode = computeMode; - WorkerSize = workerSize; - WorkerCount = workerCount; - InstanceNames = instanceNames; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets worker size ID for referencing this worker pool. - /// - [JsonProperty(PropertyName = "workerSizeId")] - public int? WorkerSizeId { get; set; } - - /// - /// Gets or sets shared or dedicated app hosting. Possible values - /// include: 'Shared', 'Dedicated', 'Dynamic' - /// - [JsonProperty(PropertyName = "computeMode")] - public ComputeModeOptions? ComputeMode { get; set; } - - /// - /// Gets or sets VM size of the worker pool instances. - /// - [JsonProperty(PropertyName = "workerSize")] - public string WorkerSize { get; set; } - - /// - /// Gets or sets number of instances in the worker pool. - /// - [JsonProperty(PropertyName = "workerCount")] - public int? WorkerCount { get; set; } - - /// - /// Gets names of all instances in the worker pool (read only). - /// - [JsonProperty(PropertyName = "instanceNames")] - public IList InstanceNames { get; private set; } - - } -} diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs index 32d869df6f66..0d125a3fdfe8 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/WorkerSizeOptions.cs @@ -33,8 +33,16 @@ public enum WorkerSizeOptions D2, [EnumMember(Value = "D3")] D3, + [EnumMember(Value = "SmallV3")] + SmallV3, + [EnumMember(Value = "MediumV3")] + MediumV3, + [EnumMember(Value = "LargeV3")] + LargeV3, [EnumMember(Value = "NestedSmall")] NestedSmall, + [EnumMember(Value = "NestedSmallLinux")] + NestedSmallLinux, [EnumMember(Value = "Default")] Default } @@ -61,8 +69,16 @@ internal static string ToSerializedValue(this WorkerSizeOptions value) return "D2"; case WorkerSizeOptions.D3: return "D3"; + case WorkerSizeOptions.SmallV3: + return "SmallV3"; + case WorkerSizeOptions.MediumV3: + return "MediumV3"; + case WorkerSizeOptions.LargeV3: + return "LargeV3"; case WorkerSizeOptions.NestedSmall: return "NestedSmall"; + case WorkerSizeOptions.NestedSmallLinux: + return "NestedSmallLinux"; case WorkerSizeOptions.Default: return "Default"; } @@ -85,8 +101,16 @@ internal static string ToSerializedValue(this WorkerSizeOptions value) return WorkerSizeOptions.D2; case "D3": return WorkerSizeOptions.D3; + case "SmallV3": + return WorkerSizeOptions.SmallV3; + case "MediumV3": + return WorkerSizeOptions.MediumV3; + case "LargeV3": + return WorkerSizeOptions.LargeV3; case "NestedSmall": return WorkerSizeOptions.NestedSmall; + case "NestedSmallLinux": + return WorkerSizeOptions.NestedSmallLinux; case "Default": return WorkerSizeOptions.Default; } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperations.cs index 547de71de032..cb24dc93b4ce 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperations.cs @@ -58,7 +58,7 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// /// /// Headers that will be added to request. @@ -231,13 +231,14 @@ internal ProviderOperations(WebSiteManagementClient client) } /// - /// Gets all available operations for the Microsoft.Web resource provider. Also - /// exposes resource metric definitions + /// Get available Function app frameworks and their versions /// /// - /// Description for Gets all available operations for the Microsoft.Web - /// resource provider. Also exposes resource metric definitions + /// Description for Get available Function app frameworks and their versions /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// /// /// Headers that will be added to request. /// @@ -259,7 +260,7 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetFunctionAppStacksWithHttpMessagesAsync(string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -272,13 +273,18 @@ internal ProviderOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("stackOsType", stackOsType); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunctionAppStacks", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/operations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/functionAppStacks").ToString(); List _queryParameters = new List(); + if (stackOsType != null) + { + _queryParameters.Add(string.Format("stackOsType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(stackOsType, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -371,7 +377,7 @@ internal ProviderOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -384,7 +390,7 @@ internal ProviderOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -404,14 +410,17 @@ internal ProviderOperations(WebSiteManagementClient client) } /// - /// Get available application frameworks and their versions + /// Get available Function app frameworks and their versions for location /// /// - /// Description for Get available application frameworks and their versions + /// Description for Get available Function app frameworks and their versions + /// for location /// - /// - /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// + /// Function App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' /// /// /// Headers that will be added to request. @@ -434,11 +443,11 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAvailableStacksOnPremWithHttpMessagesAsync(string osTypeSelected = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetFunctionAppStacksForLocationWithHttpMessagesAsync(string location, string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); } if (Client.ApiVersion == null) { @@ -451,18 +460,19 @@ internal ProviderOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("osTypeSelected", osTypeSelected); + tracingParameters.Add("location", location); + tracingParameters.Add("stackOsType", stackOsType); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAvailableStacksOnPrem", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunctionAppStacksForLocation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/locations/{location}/functionAppStacks").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); List _queryParameters = new List(); - if (osTypeSelected != null) + if (stackOsType != null) { - _queryParameters.Add(string.Format("osTypeSelected={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(osTypeSelected, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("stackOsType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(stackOsType, Client.SerializationSettings).Trim('"')))); } if (Client.ApiVersion != null) { @@ -556,7 +566,7 @@ internal ProviderOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -569,7 +579,7 @@ internal ProviderOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -589,13 +599,17 @@ internal ProviderOperations(WebSiteManagementClient client) } /// - /// Get available application frameworks and their versions + /// Get available Web app frameworks and their versions for location /// /// - /// Description for Get available application frameworks and their versions + /// Description for Get available Web app frameworks and their versions for + /// location /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Web App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' /// /// /// Headers that will be added to request. @@ -618,11 +632,15 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAvailableStacksNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetWebAppStacksForLocationWithHttpMessagesAsync(string location, string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -631,14 +649,24 @@ internal ProviderOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("location", location); + tracingParameters.Add("stackOsType", stackOsType); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAvailableStacksNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebAppStacksForLocation", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/locations/{location}/webAppStacks").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); List _queryParameters = new List(); + if (stackOsType != null) + { + _queryParameters.Add(string.Format("stackOsType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(stackOsType, Client.SerializationSettings).Trim('"')))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -727,7 +755,7 @@ internal ProviderOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -740,7 +768,7 @@ internal ProviderOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -767,9 +795,6 @@ internal ProviderOperations(WebSiteManagementClient client) /// Description for Gets all available operations for the Microsoft.Web /// resource provider. Also exposes resource metric definitions /// - /// - /// The NextLink from the previous successful call to List operation. - /// /// /// Headers that will be added to request. /// @@ -791,11 +816,11 @@ internal ProviderOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListOperationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -804,14 +829,17 @@ internal ProviderOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListOperationsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListOperations", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/operations").ToString(); List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -932,6 +960,1400 @@ internal ProviderOperations(WebSiteManagementClient client) return _result; } + /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// 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>> GetWebAppStacksWithHttpMessagesAsync(string stackOsType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("stackOsType", stackOsType); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetWebAppStacks", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/webAppStacks").ToString(); + List _queryParameters = new List(); + if (stackOsType != null) + { + _queryParameters.Add(string.Format("stackOsType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(stackOsType, Client.SerializationSettings).Trim('"')))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get available application frameworks and their versions + /// + /// + /// Description for Get available application frameworks and their versions + /// + /// + /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', + /// 'LinuxFunctions', 'All' + /// + /// + /// 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>> GetAvailableStacksOnPremWithHttpMessagesAsync(string osTypeSelected = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("osTypeSelected", osTypeSelected); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAvailableStacksOnPrem", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (osTypeSelected != null) + { + _queryParameters.Add(string.Format("osTypeSelected={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(osTypeSelected, Client.SerializationSettings).Trim('"')))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get available application frameworks and their versions + /// + /// + /// Description for Get available application frameworks and their versions + /// + /// + /// 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>> GetAvailableStacksNextWithHttpMessagesAsync(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, "GetAvailableStacksNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their versions + /// + /// + /// 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>> GetFunctionAppStacksNextWithHttpMessagesAsync(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, "GetFunctionAppStacksNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get available Function app frameworks and their versions for location + /// + /// + /// Description for Get available Function app frameworks and their versions + /// for location + /// + /// + /// 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>> GetFunctionAppStacksForLocationNextWithHttpMessagesAsync(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, "GetFunctionAppStacksForLocationNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions for + /// location + /// + /// + /// 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>> GetWebAppStacksForLocationNextWithHttpMessagesAsync(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, "GetWebAppStacksForLocationNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all available operations for the Microsoft.Web resource provider. Also + /// exposes resource metric definitions + /// + /// + /// Description for Gets all available operations for the Microsoft.Web + /// resource provider. Also exposes resource metric definitions + /// + /// + /// 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 (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// 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>> GetWebAppStacksNextWithHttpMessagesAsync(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, "GetWebAppStacksNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Get available application frameworks and their versions /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperationsExtensions.cs index 0e9f90c4e7ac..0ee4f139be05 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/ProviderOperationsExtensions.cs @@ -32,7 +32,7 @@ public static partial class ProviderOperationsExtensions /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// public static IPage GetAvailableStacks(this IProviderOperations operations, string osTypeSelected = default(string)) { @@ -50,7 +50,7 @@ public static partial class ProviderOperationsExtensions /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// /// /// The cancellation token. @@ -63,6 +63,142 @@ public static partial class ProviderOperationsExtensions } } + /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + public static IPage GetFunctionAppStacks(this IProviderOperations operations, string stackOsType = default(string)) + { + return operations.GetFunctionAppStacksAsync(stackOsType).GetAwaiter().GetResult(); + } + + /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The cancellation token. + /// + public static async Task> GetFunctionAppStacksAsync(this IProviderOperations operations, string stackOsType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetFunctionAppStacksWithHttpMessagesAsync(stackOsType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get available Function app frameworks and their versions for location + /// + /// + /// Description for Get available Function app frameworks and their versions + /// for location + /// + /// + /// The operations group for this extension method. + /// + /// + /// Function App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + public static IPage GetFunctionAppStacksForLocation(this IProviderOperations operations, string location, string stackOsType = default(string)) + { + return operations.GetFunctionAppStacksForLocationAsync(location, stackOsType).GetAwaiter().GetResult(); + } + + /// + /// Get available Function app frameworks and their versions for location + /// + /// + /// Description for Get available Function app frameworks and their versions + /// for location + /// + /// + /// The operations group for this extension method. + /// + /// + /// Function App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The cancellation token. + /// + public static async Task> GetFunctionAppStacksForLocationAsync(this IProviderOperations operations, string location, string stackOsType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetFunctionAppStacksForLocationWithHttpMessagesAsync(location, stackOsType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions for + /// location + /// + /// + /// The operations group for this extension method. + /// + /// + /// Web App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + public static IPage GetWebAppStacksForLocation(this IProviderOperations operations, string location, string stackOsType = default(string)) + { + return operations.GetWebAppStacksForLocationAsync(location, stackOsType).GetAwaiter().GetResult(); + } + + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions for + /// location + /// + /// + /// The operations group for this extension method. + /// + /// + /// Web App stack location. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The cancellation token. + /// + public static async Task> GetWebAppStacksForLocationAsync(this IProviderOperations operations, string location, string stackOsType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWebAppStacksForLocationWithHttpMessagesAsync(location, stackOsType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets all available operations for the Microsoft.Web resource provider. Also /// exposes resource metric definitions @@ -101,6 +237,46 @@ public static IPage ListOperations(this IProviderOperat } } + /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + public static IPage GetWebAppStacks(this IProviderOperations operations, string stackOsType = default(string)) + { + return operations.GetWebAppStacksAsync(stackOsType).GetAwaiter().GetResult(); + } + + /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// Stack OS Type. Possible values include: 'Windows', 'Linux', 'All' + /// + /// + /// The cancellation token. + /// + public static async Task> GetWebAppStacksAsync(this IProviderOperations operations, string stackOsType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWebAppStacksWithHttpMessagesAsync(stackOsType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get available application frameworks and their versions /// @@ -112,7 +288,7 @@ public static IPage ListOperations(this IProviderOperat /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// public static IPage GetAvailableStacksOnPrem(this IProviderOperations operations, string osTypeSelected = default(string)) { @@ -130,7 +306,7 @@ public static IPage ListOperations(this IProviderOperat /// /// /// Possible values include: 'Windows', 'Linux', 'WindowsFunctions', - /// 'LinuxFunctions' + /// 'LinuxFunctions', 'All' /// /// /// The cancellation token. @@ -183,6 +359,130 @@ public static IPage GetAvailableStacksNext(this IProvi } } + /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetFunctionAppStacksNext(this IProviderOperations operations, string nextPageLink) + { + return operations.GetFunctionAppStacksNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get available Function app frameworks and their versions + /// + /// + /// Description for Get available Function app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetFunctionAppStacksNextAsync(this IProviderOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetFunctionAppStacksNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get available Function app frameworks and their versions for location + /// + /// + /// Description for Get available Function app frameworks and their versions + /// for location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetFunctionAppStacksForLocationNext(this IProviderOperations operations, string nextPageLink) + { + return operations.GetFunctionAppStacksForLocationNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get available Function app frameworks and their versions for location + /// + /// + /// Description for Get available Function app frameworks and their versions + /// for location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetFunctionAppStacksForLocationNextAsync(this IProviderOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetFunctionAppStacksForLocationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions for + /// location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetWebAppStacksForLocationNext(this IProviderOperations operations, string nextPageLink) + { + return operations.GetWebAppStacksForLocationNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get available Web app frameworks and their versions for location + /// + /// + /// Description for Get available Web app frameworks and their versions for + /// location + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetWebAppStacksForLocationNextAsync(this IProviderOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWebAppStacksForLocationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets all available operations for the Microsoft.Web resource provider. Also /// exposes resource metric definitions @@ -227,6 +527,46 @@ public static IPage ListOperationsNext(this IProviderOp } } + /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetWebAppStacksNext(this IProviderOperations operations, string nextPageLink) + { + return operations.GetWebAppStacksNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get available Web app frameworks and their versions + /// + /// + /// Description for Get available Web app frameworks and their versions + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetWebAppStacksNextAsync(this IProviderOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWebAppStacksNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get available application frameworks and their versions /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/RecommendationsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/RecommendationsOperations.cs index 984a84495f08..728f46e9f9c6 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/RecommendationsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/RecommendationsOperations.cs @@ -119,14 +119,14 @@ internal RecommendationsOperations(WebSiteManagementClient client) { _queryParameters.Add(string.Format("featured={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(featured, Client.SerializationSettings).Trim('"')))); } - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -673,14 +673,14 @@ internal RecommendationsOperations(WebSiteManagementClient client) { _queryParameters.Add(string.Format("expiredOnly={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expiredOnly, Client.SerializationSettings).Trim('"')))); } - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -902,14 +902,14 @@ internal RecommendationsOperations(WebSiteManagementClient client) { _queryParameters.Add(string.Format("featured={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(featured, Client.SerializationSettings).Trim('"')))); } - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1976,14 +1976,14 @@ internal RecommendationsOperations(WebSiteManagementClient client) { _queryParameters.Add(string.Format("expiredOnly={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expiredOnly, Client.SerializationSettings).Trim('"')))); } - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -2205,14 +2205,14 @@ internal RecommendationsOperations(WebSiteManagementClient client) { _queryParameters.Add(string.Format("featured={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(featured, Client.SerializationSettings).Trim('"')))); } - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs index 1c65562c417c..5d3969b7dfbf 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs @@ -19,47 +19,50 @@ public static IEnumerable> ApiInfo_WebSiteManageme { return new Tuple[] { - new Tuple("CertificateRegistration", "AppServiceCertificateOrders", "2020-06-01"), - new Tuple("CertificateRegistration", "CertificateRegistrationProvider", "2020-06-01"), - new Tuple("DomainRegistration", "DomainRegistrationProvider", "2020-06-01"), - new Tuple("DomainRegistration", "Domains", "2020-06-01"), - new Tuple("DomainRegistration", "TopLevelDomains", "2020-06-01"), - new Tuple("Web", "AppServiceEnvironments", "2020-06-01"), - new Tuple("Web", "AppServicePlans", "2020-06-01"), - new Tuple("Web", "Certificates", "2020-06-01"), - new Tuple("Web", "CheckNameAvailability", "2020-06-01"), - new Tuple("Web", "DeletedWebApps", "2020-06-01"), - new Tuple("Web", "Diagnostics", "2020-06-01"), - new Tuple("Web", "GetPublishingUser", "2020-06-01"), - new Tuple("Web", "GetSourceControl", "2020-06-01"), - new Tuple("Web", "GetSubscriptionDeploymentLocations", "2020-06-01"), - new Tuple("Web", "ListBillingMeters", "2020-06-01"), - new Tuple("Web", "ListGeoRegions", "2020-06-01"), - new Tuple("Web", "ListPremierAddOnOffers", "2020-06-01"), - new Tuple("Web", "ListSiteIdentifiersAssignedToHostName", "2020-06-01"), - new Tuple("Web", "ListSkus", "2020-06-01"), - new Tuple("Web", "ListSourceControls", "2020-06-01"), - new Tuple("Web", "Provider", "2020-06-01"), - new Tuple("Web", "Recommendations", "2020-06-01"), - new Tuple("Web", "ResourceHealthMetadata", "2020-06-01"), - new Tuple("Web", "StaticSites", "2020-06-01"), - new Tuple("Web", "UpdatePublishingUser", "2020-06-01"), - new Tuple("Web", "UpdateSourceControl", "2020-06-01"), - new Tuple("Web", "Validate", "2020-06-01"), - new Tuple("Web", "VerifyHostingEnvironmentVnet", "2020-06-01"), - new Tuple("Web", "WebApps", "2020-06-01"), - new Tuple("WebSiteManagementClient", "Move", "2020-06-01"), - new Tuple("WebSiteManagementClient", "ValidateMove", "2020-06-01"), + new Tuple("CertificateRegistration", "AppServiceCertificateOrders", "2020-12-01"), + new Tuple("CertificateRegistration", "CertificateOrdersDiagnostics", "2020-12-01"), + new Tuple("CertificateRegistration", "CertificateRegistrationProvider", "2020-12-01"), + new Tuple("DomainRegistration", "DomainRegistrationProvider", "2020-12-01"), + new Tuple("DomainRegistration", "Domains", "2020-12-01"), + new Tuple("DomainRegistration", "TopLevelDomains", "2020-12-01"), + new Tuple("Web", "AppServiceEnvironments", "2020-12-01"), + new Tuple("Web", "AppServicePlans", "2020-12-01"), + new Tuple("Web", "Certificates", "2020-12-01"), + new Tuple("Web", "CheckNameAvailability", "2020-12-01"), + new Tuple("Web", "DeletedWebApps", "2020-12-01"), + new Tuple("Web", "Diagnostics", "2020-12-01"), + new Tuple("Web", "GenerateGithubAccessTokenForAppserviceCLIAsync", "2020-12-01"), + new Tuple("Web", "GetPublishingUser", "2020-12-01"), + new Tuple("Web", "GetSourceControl", "2020-12-01"), + new Tuple("Web", "GetSubscriptionDeploymentLocations", "2020-12-01"), + new Tuple("Web", "Global", "2020-12-01"), + new Tuple("Web", "ListBillingMeters", "2020-12-01"), + new Tuple("Web", "ListGeoRegions", "2020-12-01"), + new Tuple("Web", "ListPremierAddOnOffers", "2020-12-01"), + new Tuple("Web", "ListSiteIdentifiersAssignedToHostName", "2020-12-01"), + new Tuple("Web", "ListSkus", "2020-12-01"), + new Tuple("Web", "ListSourceControls", "2020-12-01"), + new Tuple("Web", "Provider", "2020-12-01"), + new Tuple("Web", "Recommendations", "2020-12-01"), + new Tuple("Web", "ResourceHealthMetadata", "2020-12-01"), + new Tuple("Web", "StaticSites", "2020-12-01"), + new Tuple("Web", "UpdatePublishingUser", "2020-12-01"), + new Tuple("Web", "UpdateSourceControl", "2020-12-01"), + new Tuple("Web", "Validate", "2020-12-01"), + new Tuple("Web", "VerifyHostingEnvironmentVnet", "2020-12-01"), + new Tuple("Web", "WebApps", "2020-12-01"), + new Tuple("WebSiteManagementClient", "Move", "2020-12-01"), + new Tuple("WebSiteManagementClient", "ValidateMove", "2020-12-01"), }.AsEnumerable(); } } // BEGIN: Code Generation Metadata Section public static readonly String AutoRestVersion = "v2"; public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-06 --csharp-sdks-folder=K:\\DotNet-SDK\\Sep-2020\\azure-sdk-for-net\\sdk"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=K:\\DotNet-SDK\\Apr-2021\\azure-sdk-for-net\\sdk"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "1b04f5fce19cd330dcc0eec11a98e499c0cda50d"; + public static readonly String GithubCommidId = "f1b7ba2a910b4195e1e2109b7c69852d4af4aa40"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperations.cs index a8a84874472b..197075937acc 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperations.cs @@ -51,11 +51,18 @@ internal StaticSitesOperations(WebSiteManagementClient client) public WebSiteManagementClient Client { get; private set; } /// - /// Get all Static Sites for a subscription. + /// Generates a preview workflow file for the static site /// /// - /// Description for Get all Static Sites for a subscription. + /// Description for Generates a preview workflow file for the static site /// + /// + /// Location where you plan to create the static site. + /// + /// + /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. + /// See example. + /// /// /// Headers that will be added to request. /// @@ -77,8 +84,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PreviewWorkflowWithHttpMessagesAsync(string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (staticSitesWorkflowPreviewRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSitesWorkflowPreviewRequest"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -94,12 +109,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("staticSitesWorkflowPreviewRequest", staticSitesWorkflowPreviewRequest); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "PreviewWorkflow", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/previewStaticSiteWorkflowFile").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -113,7 +131,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -144,6 +162,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(staticSitesWorkflowPreviewRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSitesWorkflowPreviewRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -194,7 +218,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -207,7 +231,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -227,14 +251,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static sites in the specified resource group. + /// Get all Static Sites for a subscription. /// /// - /// Description for Gets all static sites in the specified resource group. + /// Description for Get all Static Sites for a subscription. /// - /// - /// Name of the resource group to which the resource belongs. - /// /// /// Headers that will be added to request. /// @@ -256,27 +277,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetStaticSitesByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -292,14 +294,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSitesByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -427,17 +427,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the details of a static site. + /// Gets all static sites in the specified resource group. /// /// - /// Description for Gets the details of a static site. + /// Description for Gets all static sites in the specified resource group. /// /// /// Name of the resource group to which the resource belongs. /// - /// - /// Name of the static site. - /// /// /// Headers that will be added to request. /// @@ -459,7 +456,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetStaticSitesByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -480,10 +477,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); } } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -500,15 +493,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSitesByResourceGroup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -603,7 +594,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -616,7 +607,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -636,21 +627,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates a new static site in an existing resource group, or updates an - /// existing static site. + /// Gets the details of a static site. /// /// - /// Description for Creates a new static site in an existing resource group, or - /// updates an existing static site. + /// Description for Gets the details of a static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site to create or update. - /// - /// - /// A JSON representation of the staticsite properties. See example. + /// Name of the static site. /// /// /// Headers that will be added to request. @@ -673,7 +659,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -698,14 +684,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (staticSiteEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteEnvelope"); - } - if (staticSiteEnvelope != null) - { - staticSiteEnvelope.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -723,9 +701,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("staticSiteEnvelope", staticSiteEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSite", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -745,7 +722,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -776,12 +753,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(staticSiteEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -802,7 +773,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -857,24 +828,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -882,6 +835,36 @@ internal StaticSitesOperations(WebSiteManagementClient client) return _result; } + /// + /// Creates a new static site in an existing resource group, or updates an + /// existing static site. + /// + /// + /// Description for Creates a new static site in an existing resource group, or + /// updates an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Deletes a static site. /// @@ -895,6 +878,36 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// Name of the static site to delete. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteStaticSiteWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a new static site in an existing resource group, or updates an + /// existing static site. + /// + /// + /// Description for Creates a new static site in an existing resource group, or + /// updates an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. + /// + /// /// Headers that will be added to request. /// /// @@ -903,6 +916,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -912,7 +928,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSitePatchResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -937,6 +953,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (staticSiteEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -954,8 +974,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("staticSiteEnvelope", staticSiteEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateStaticSite", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -975,7 +996,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1006,6 +1027,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(staticSiteEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -1056,13 +1083,49 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1071,21 +1134,19 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates a new static site in an existing resource group, or updates an - /// existing static site. + /// Gets the list of users of a static site. /// /// - /// Description for Creates a new static site in an existing resource group, or - /// updates an existing static site. + /// Description for Gets the list of users of a static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site to create or update. + /// Name of the static site. /// - /// - /// A JSON representation of the staticsite properties. See example. + /// + /// The auth provider for the users. /// /// /// Headers that will be added to request. @@ -1108,7 +1169,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSitePatchResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteUsersWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1133,9 +1194,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (staticSiteEnvelope == null) + if (authprovider == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "authprovider"); } if (Client.SubscriptionId == null) { @@ -1154,15 +1215,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("staticSiteEnvelope", staticSiteEnvelope); + tracingParameters.Add("authprovider", authprovider); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteUsers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{authprovider}", System.Uri.EscapeDataString(authprovider)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1176,7 +1238,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1207,12 +1269,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(staticSiteEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1233,7 +1289,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1263,7 +1319,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1276,25 +1332,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1314,19 +1352,22 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the list of users of a static site. + /// Deletes the user entry from the static site. /// /// - /// Description for Gets the list of users of a static site. + /// Description for Deletes the user entry from the static site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. + /// Name of the staticsite. /// /// - /// The auth provider for the users. + /// The auth provider for this user. + /// + /// + /// The user id of the user. /// /// /// Headers that will be added to request. @@ -1337,9 +1378,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1349,7 +1387,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteUsersWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteStaticSiteUserWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, string userid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1378,6 +1416,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "authprovider"); } + if (userid == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "userid"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1396,15 +1438,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("authprovider", authprovider); + tracingParameters.Add("userid", userid); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteUsers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSiteUser", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{authprovider}", System.Uri.EscapeDataString(authprovider)); + _url = _url.Replace("{userid}", System.Uri.EscapeDataString(userid)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1418,7 +1462,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1499,31 +1543,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1532,16 +1558,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Deletes the user entry from the static site. + /// Updates a user entry with the listed roles /// /// - /// Description for Deletes the user entry from the static site. + /// Description for Updates a user entry with the listed roles /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the staticsite. + /// Name of the static site. /// /// /// The auth provider for this user. @@ -1549,6 +1575,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// The user id of the user. /// + /// + /// A JSON representation of the StaticSiteUser properties. See example. + /// /// /// Headers that will be added to request. /// @@ -1558,6 +1587,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1567,7 +1599,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteStaticSiteUserWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, string userid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateStaticSiteUserWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, string userid, StaticSiteUserARMResource staticSiteUserEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1600,6 +1632,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "userid"); } + if (staticSiteUserEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1619,8 +1655,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("authprovider", authprovider); tracingParameters.Add("userid", userid); + tracingParameters.Add("staticSiteUserEnvelope", staticSiteUserEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSiteUser", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateStaticSiteUser", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1642,7 +1679,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1673,6 +1710,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(staticSiteUserEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -1723,13 +1766,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1738,10 +1799,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Updates a user entry with the listed roles + /// Gets all static site builds for a particular static site. /// /// - /// Description for Updates a user entry with the listed roles + /// Description for Gets all static site builds for a particular static site. /// /// /// Name of the resource group to which the resource belongs. @@ -1749,15 +1810,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The auth provider for this user. - /// - /// - /// The user id of the user. - /// - /// - /// A JSON representation of the StaticSiteUser properties. See example. - /// /// /// Headers that will be added to request. /// @@ -1779,7 +1831,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateStaticSiteUserWithHttpMessagesAsync(string resourceGroupName, string name, string authprovider, string userid, StaticSiteUserARMResource staticSiteUserEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetStaticSiteBuildsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1804,18 +1856,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (authprovider == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authprovider"); - } - if (userid == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "userid"); - } - if (staticSiteUserEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1833,19 +1873,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("authprovider", authprovider); - tracingParameters.Add("userid", userid); - tracingParameters.Add("staticSiteUserEnvelope", staticSiteUserEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateStaticSiteUser", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuilds", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{authprovider}", System.Uri.EscapeDataString(authprovider)); - _url = _url.Replace("{userid}", System.Uri.EscapeDataString(userid)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1859,7 +1894,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1890,12 +1925,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(staticSiteUserEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1946,7 +1975,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1959,7 +1988,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1979,10 +2008,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static site builds for a particular static site. + /// Gets the details of a static site build. /// /// - /// Description for Gets all static site builds for a particular static site. + /// Description for Gets the details of a static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -1990,6 +2019,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// + /// + /// The stage site identifier. + /// /// /// Headers that will be added to request. /// @@ -2011,7 +2043,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetStaticSiteBuildsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2036,6 +2068,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (environmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2053,14 +2089,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("environmentName", environmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuilds", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuild", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2155,7 +2193,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2168,7 +2206,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2188,10 +2226,38 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the details of a static site build. + /// Deletes a static site build. /// /// - /// Description for Gets the details of a static site build. + /// Description for Deletes a static site build. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates the app settings of a static site build. + /// + /// + /// Description for Creates or updates the app settings of a static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -2199,9 +2265,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// + /// + /// The dictionary containing the static site app settings to update. + /// /// /// Headers that will be added to request. /// @@ -2223,7 +2292,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteBuildAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2248,9 +2317,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (prId == null) + if (environmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } + if (appSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "prId"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); } if (Client.SubscriptionId == null) { @@ -2269,16 +2342,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("prId", prId); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuild", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteBuildAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/appsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2292,7 +2366,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2323,6 +2397,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(appSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -2373,7 +2453,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2386,7 +2466,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2406,10 +2486,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Deletes a static site build. + /// Creates or updates the function app settings of a static site build. /// /// - /// Description for Deletes a static site build. + /// Description for Creates or updates the function app settings of a static + /// site build. /// /// /// Name of the resource group to which the resource belongs. @@ -2417,9 +2498,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// + /// + /// The dictionary containing the static site function app settings to update. + /// /// /// Headers that will be added to request. /// @@ -2429,6 +2513,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -2438,7 +2525,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2463,13 +2550,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (prId == null) + if (environmentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "prId"); + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); } - if (Client.SubscriptionId == null) + if (appSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (Client.ApiVersion == null) { @@ -2484,16 +2575,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("prId", prId); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSiteBuild", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteBuildFunctionAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/functionappsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2507,7 +2599,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2538,6 +2630,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(appSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -2558,7 +2656,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2588,13 +2686,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -2603,11 +2719,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates or updates the function app settings of a static site build. + /// Gets the functions of a particular static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site build. + /// Description for Gets the functions of a particular static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -2615,11 +2730,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - /// - /// /// /// Headers that will be added to request. /// @@ -2641,7 +2754,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteBuildFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2666,13 +2779,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (prId == null) + if (environmentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "prId"); - } - if (appSettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); } if (Client.SubscriptionId == null) { @@ -2691,17 +2800,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("prId", prId); - tracingParameters.Add("appSettings", appSettings); + tracingParameters.Add("environmentName", environmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteBuildFunctionAppSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/config/functionappsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/functions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2715,7 +2823,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2746,12 +2854,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(appSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -2772,7 +2874,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2802,7 +2904,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2815,25 +2917,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2853,10 +2937,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the functions of a particular static site build. + /// Gets the application settings of a static site build. /// /// - /// Description for Gets the functions of a particular static site build. + /// Description for Gets the application settings of a static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -2864,7 +2948,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -2888,7 +2972,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteBuildFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListStaticSiteBuildAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2913,9 +2997,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (prId == null) + if (environmentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "prId"); + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); } if (Client.SubscriptionId == null) { @@ -2934,16 +3018,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("prId", prId); + tracingParameters.Add("environmentName", environmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/functions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listAppSettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2957,7 +3041,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3038,7 +3122,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3051,7 +3135,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3071,10 +3155,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the application settings of a static site. + /// Gets the application settings of a static site build. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Gets the application settings of a static site build. /// /// /// Name of the resource group to which the resource belongs. @@ -3082,7 +3166,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// @@ -3106,7 +3190,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string prId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3131,9 +3215,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (prId == null) + if (environmentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "prId"); + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); } if (Client.SubscriptionId == null) { @@ -3152,16 +3236,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("prId", prId); + tracingParameters.Add("environmentName", environmentName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctionAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{prId}/listFunctionAppSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listFunctionAppSettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{prId}", System.Uri.EscapeDataString(prId)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3226,7 +3310,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3281,24 +3365,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -3307,11 +3373,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates or updates the function app settings of a static site. + /// Gets the details of the user provided function apps registered with a + /// static site build /// /// - /// Description for Creates or updates the function app settings of a static - /// site. + /// Description for Gets the details of the user provided function apps + /// registered with a static site build /// /// /// Name of the resource group to which the resource belongs. @@ -3319,7 +3386,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// /// /// Headers that will be added to request. @@ -3342,7 +3410,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetUserProvidedFunctionAppsForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3367,9 +3435,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (appSettings == null) + if (environmentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); } if (Client.SubscriptionId == null) { @@ -3388,15 +3456,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("appSettings", appSettings); + tracingParameters.Add("environmentName", environmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteFunctionAppSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppsForStaticSiteBuild", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3410,7 +3479,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3441,12 +3510,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(appSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -3467,7 +3530,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3497,7 +3560,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3510,25 +3573,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3548,10 +3593,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates an invitation link for a user with the role + /// Gets the details of the user provided function app registered with a static + /// site build /// /// - /// Description for Creates an invitation link for a user with the role + /// Description for Gets the details of the user provided function app + /// registered with a static site build /// /// /// Name of the resource group to which the resource belongs. @@ -3559,7 +3606,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// /// /// Headers that will be added to request. @@ -3582,7 +3633,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateUserRolesInvitationLinkWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetUserProvidedFunctionAppForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3607,9 +3658,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (staticSiteUserRolesInvitationEnvelope == null) + if (environmentName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserRolesInvitationEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } + if (functionAppName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); } if (Client.SubscriptionId == null) { @@ -3628,15 +3683,18 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("staticSiteUserRolesInvitationEnvelope", staticSiteUserRolesInvitationEnvelope); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("functionAppName", functionAppName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateUserRolesInvitationLink", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppForStaticSiteBuild", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3650,7 +3708,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3681,12 +3739,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(staticSiteUserRolesInvitationEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserRolesInvitationEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -3737,7 +3789,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3750,7 +3802,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -3770,17 +3822,65 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static site custom domains for a particular static site. + /// Register a user provided function app with a static site build /// /// - /// Description for Gets all static site custom domains for a particular static - /// site. + /// Description for Register a user provided function app with a static site + /// build /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> RegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Detach the user provided function app from the static site build + /// + /// + /// Description for Detach the user provided function app from the static site + /// build + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// /// /// Headers that will be added to request. @@ -3791,9 +3891,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -3803,7 +3900,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteCustomDomainsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DetachUserProvidedFunctionAppFromStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3828,6 +3925,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (environmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } + if (functionAppName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -3845,14 +3950,18 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("functionAppName", functionAppName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteCustomDomains", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DetachUserProvidedFunctionAppFromStaticSiteBuild", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3866,7 +3975,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3917,7 +4026,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -3947,31 +4056,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -3980,12 +4071,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Creates a new static site custom domain in an existing resource group and - /// static site. + /// Deploys zipped content to a specific environment of a static site. /// /// - /// Description for Creates a new static site custom domain in an existing - /// resource group and static site. + /// Description for Deploys zipped content to a specific environment of a + /// static site. /// /// /// Name of the resource group to which the resource belongs. @@ -3993,19 +4083,51 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The custom domain to create. + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. /// /// - /// Headers that will be added to request. + /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// + public async Task CreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginCreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates the app settings of a static site. + /// + /// + /// Description for Creates or updates the app settings of a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The dictionary containing the static site app settings to update. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// /// Thrown when unable to deserialize the response /// /// @@ -4017,7 +4139,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4042,9 +4164,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainName == null) + if (appSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); } if (Client.SubscriptionId == null) { @@ -4063,16 +4185,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainName", domainName); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteCustomDomain", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/appsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4117,6 +4238,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(appSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -4137,7 +4264,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4167,7 +4294,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4180,25 +4307,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4218,10 +4327,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Deletes a custom domain. + /// Creates or updates the function app settings of a static site. /// /// - /// Description for Deletes a custom domain. + /// Description for Creates or updates the function app settings of a static + /// site. /// /// /// Name of the resource group to which the resource belongs. @@ -4229,8 +4339,8 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The custom domain to delete. + /// + /// The dictionary containing the static site function app settings to update. /// /// /// Headers that will be added to request. @@ -4241,6 +4351,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -4250,7 +4363,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4275,9 +4388,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainName == null) + if (appSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); } if (Client.SubscriptionId == null) { @@ -4296,16 +4409,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainName", domainName); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteStaticSiteCustomDomain", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateStaticSiteFunctionAppSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4319,7 +4431,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -4350,6 +4462,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(appSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -4370,7 +4488,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4400,13 +4518,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4415,11 +4551,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Validates a particular custom domain can be added to a static site. + /// Creates an invitation link for a user with the role /// /// - /// Description for Validates a particular custom domain can be added to a - /// static site. + /// Description for Creates an invitation link for a user with the role /// /// /// Name of the resource group to which the resource belongs. @@ -4427,8 +4562,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// - /// - /// The custom domain to validate. + /// /// /// /// Headers that will be added to request. @@ -4439,6 +4573,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -4448,7 +4585,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateUserRolesInvitationLinkWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4473,9 +4610,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainName == null) + if (staticSiteUserRolesInvitationEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserRolesInvitationEnvelope"); } if (Client.SubscriptionId == null) { @@ -4494,16 +4631,15 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainName", domainName); + tracingParameters.Add("staticSiteUserRolesInvitationEnvelope", staticSiteUserRolesInvitationEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ValidateCustomDomainCanBeAddedToStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateUserRolesInvitationLink", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4548,6 +4684,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(staticSiteUserRolesInvitationEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserRolesInvitationEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -4568,7 +4710,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4598,13 +4740,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4613,16 +4773,17 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Detaches a static site. + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Detaches a static site. + /// Description for Gets all static site custom domains for a particular static + /// site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site to detach. + /// Name of the static site resource to search in. /// /// /// Headers that will be added to request. @@ -4633,6 +4794,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -4642,7 +4806,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteCustomDomainsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4685,11 +4849,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DetachStaticSite", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteCustomDomains", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -4705,7 +4869,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -4756,7 +4920,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4786,13 +4950,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -4801,16 +4983,20 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the functions of a static site. + /// Gets an existing custom domain for a particular static site. /// /// - /// Description for Gets the functions of a static site. + /// Description for Gets an existing custom domain for a particular static + /// site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. + /// Name of the static site resource to search in. + /// + /// + /// The custom domain name. /// /// /// Headers that will be added to request. @@ -4833,7 +5019,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4858,6 +5044,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -4875,14 +5065,16 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainName", domainName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteCustomDomain", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -4977,7 +5169,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -4990,7 +5182,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5010,10 +5202,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the application settings of a static site. + /// Creates a new static site custom domain in an existing resource group and + /// static site. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. /// /// /// Name of the resource group to which the resource belongs. @@ -5021,32 +5215,5522 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Name of the static site. /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// /// - /// Headers that will be added to request. + /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added to a + /// static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDetachStaticSiteWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the functions of a static site. + /// + /// + /// Description for Gets the functions of a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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>> ListStaticSiteFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctions", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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> ListStaticSiteAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteAppSettings", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listAppSettings").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the roles configured for the static site. + /// + /// + /// Description for Lists the roles configured for the static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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> ListStaticSiteConfiguredRolesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteConfiguredRoles", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listConfiguredRoles").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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> ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctionAppSettings", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the secrets for an existing static site. + /// + /// + /// Description for Lists the secrets for an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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> ListStaticSiteSecretsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteSecrets", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the list of private endpoint connections associated with a static site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionList", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// 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> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// 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> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateLinkResources").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Resets the api key for an existing static site. + /// + /// + /// Description for Resets the api key for an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// + /// + /// 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 ResetStaticSiteApiKeyWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (resetPropertiesEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resetPropertiesEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("resetPropertiesEnvelope", resetPropertiesEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ResetStaticSiteApiKey", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(resetPropertiesEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(resetPropertiesEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Gets the details of the user provided function apps registered with a + /// static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// 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>> GetUserProvidedFunctionAppsForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppsForStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the details of the user provided function app registered with a static + /// site + /// + /// + /// Description for Gets the details of the user provided function app + /// registered with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + /// + /// 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> GetUserProvidedFunctionAppForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (functionAppName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("functionAppName", functionAppName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppForStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> RegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginRegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Detach the user provided function app from the static site + /// + /// + /// Description for Detach the user provided function app from the static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + /// + /// 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 DetachUserProvidedFunctionAppFromStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (functionAppName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("functionAppName", functionAppName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "DetachUserProvidedFunctionAppFromStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task CreateZipDeploymentForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginCreateZipDeploymentForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a new static site in an existing resource group, or updates an + /// existing static site. + /// + /// + /// Description for Creates a new static site in an existing resource group, or + /// updates an existing static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. + /// + /// + /// 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> BeginCreateOrUpdateStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (staticSiteEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteEnvelope"); + } + if (staticSiteEnvelope != null) + { + staticSiteEnvelope.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("staticSiteEnvelope", staticSiteEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a static site. + /// + /// + /// Description for Deletes a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to delete. + /// + /// + /// 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 BeginDeleteStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Deletes a static site build. + /// + /// + /// Description for Deletes a static site build. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// 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 BeginDeleteStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (environmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteStaticSiteBuild", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Register a user provided function app with a static site build + /// + /// + /// Description for Register a user provided function app with a static site + /// build + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// 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> BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (environmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } + if (functionAppName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); + } + if (staticSiteUserProvidedFunctionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserProvidedFunctionEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("functionAppName", functionAppName); + tracingParameters.Add("staticSiteUserProvidedFunctionEnvelope", staticSiteUserProvidedFunctionEnvelope); + tracingParameters.Add("isForced", isForced); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRegisterUserProvidedFunctionAppWithStaticSiteBuild", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (isForced != null) + { + _queryParameters.Add(string.Format("isForced={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(isForced, Client.SerializationSettings).Trim('"')))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteUserProvidedFunctionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserProvidedFunctionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deploys zipped content to a specific environment of a static site. + /// + /// + /// Description for Deploys zipped content to a specific environment of a + /// static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + /// + /// 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 BeginCreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (environmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "environmentName"); + } + if (staticSiteZipDeploymentEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteZipDeploymentEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("environmentName", environmentName); + tracingParameters.Add("staticSiteZipDeploymentEnvelope", staticSiteZipDeploymentEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateZipDeploymentForStaticSiteBuild", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/zipdeploy").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{environmentName}", System.Uri.EscapeDataString(environmentName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteZipDeploymentEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteZipDeploymentEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Creates a new static site custom domain in an existing resource group and + /// static site. + /// + /// + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// 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> BeginCreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (domainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + } + if (staticSiteCustomDomainRequestPropertiesEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteCustomDomainRequestPropertiesEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("domainName", domainName); + tracingParameters.Add("staticSiteCustomDomainRequestPropertiesEnvelope", staticSiteCustomDomainRequestPropertiesEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateStaticSiteCustomDomain", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteCustomDomainRequestPropertiesEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteCustomDomainRequestPropertiesEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + /// + /// 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 BeginDeleteStaticSiteCustomDomainWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (domainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("domainName", domainName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteStaticSiteCustomDomain", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added to a + /// static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// 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 BeginValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (domainName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainName"); + } + if (staticSiteCustomDomainRequestPropertiesEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteCustomDomainRequestPropertiesEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("domainName", domainName); + tracingParameters.Add("staticSiteCustomDomainRequestPropertiesEnvelope", staticSiteCustomDomainRequestPropertiesEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginValidateCustomDomainCanBeAddedToStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainName}", System.Uri.EscapeDataString(domainName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteCustomDomainRequestPropertiesEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteCustomDomainRequestPropertiesEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + /// + /// 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 BeginDetachStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDetachStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// 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> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (privateEndpointWrapper == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnection", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(privateEndpointWrapper != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// 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> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 204) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static site + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// 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> BeginRegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (functionAppName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionAppName"); + } + if (staticSiteUserProvidedFunctionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteUserProvidedFunctionEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("functionAppName", functionAppName); + tracingParameters.Add("staticSiteUserProvidedFunctionEnvelope", staticSiteUserProvidedFunctionEnvelope); + tracingParameters.Add("isForced", isForced); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRegisterUserProvidedFunctionAppWithStaticSite", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionAppName}", System.Uri.EscapeDataString(functionAppName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (isForced != null) + { + _queryParameters.Add(string.Format("isForced={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(isForced, Client.SerializationSettings).Trim('"')))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteUserProvidedFunctionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteUserProvidedFunctionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + /// + /// 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 BeginCreateZipDeploymentForStaticSiteWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { @@ -5067,6 +10751,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (staticSiteZipDeploymentEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticSiteZipDeploymentEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -5084,12 +10772,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("staticSiteZipDeploymentEnvelope", staticSiteZipDeploymentEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctionAppSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateZipDeploymentForStaticSite", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/zipdeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -5105,7 +10794,166 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(staticSiteZipDeploymentEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(staticSiteZipDeploymentEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Get all Static Sites for a subscription. + /// + /// + /// Description for Get all Static Sites for a 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5156,7 +11004,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -5186,7 +11034,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5199,25 +11047,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5237,16 +11067,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Lists the secrets for an existing static site. + /// Gets all static sites in the specified resource group. /// /// - /// Description for Lists the secrets for an existing static site. + /// Description for Gets all static sites in the specified resource group. /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -5269,38 +11096,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListStaticSiteSecretsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetStaticSitesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -5309,22 +11109,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteSecrets", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSitesByResourceGroupNext", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -5332,7 +11124,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5413,7 +11205,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5426,7 +11218,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5446,18 +11238,13 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Resets the api key for an existing static site. + /// Gets the list of users of a static site. /// /// - /// Description for Resets the api key for an existing static site. + /// Description for Gets the list of users of a static site. /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the static site. - /// - /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -5468,6 +11255,9 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -5477,42 +11267,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ResetStaticSiteApiKeyWithHttpMessagesAsync(string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteUsersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (resetPropertiesEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resetPropertiesEnvelope"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -5521,23 +11280,14 @@ internal StaticSitesOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("resetPropertiesEnvelope", resetPropertiesEnvelope); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ResetStaticSiteApiKey", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteUsersNext", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -5576,12 +11326,6 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(resetPropertiesEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(resetPropertiesEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -5632,13 +11376,31 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -5647,10 +11409,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Get all Static Sites for a subscription. + /// Gets all static site builds for a particular static site. /// /// - /// Description for Get all Static Sites for a subscription. + /// Description for Gets all static site builds for a particular static site. /// /// /// The NextLink from the previous successful call to List operation. @@ -5676,7 +11438,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetStaticSiteBuildsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -5691,7 +11453,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuildsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -5785,7 +11547,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5798,7 +11560,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5818,10 +11580,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static sites in the specified resource group. + /// Gets the functions of a particular static site build. /// /// - /// Description for Gets all static sites in the specified resource group. + /// Description for Gets the functions of a particular static site build. /// /// /// The NextLink from the previous successful call to List operation. @@ -5847,7 +11609,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetStaticSitesByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteBuildFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -5862,7 +11624,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSitesByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -5956,7 +11718,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -5969,7 +11731,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -5989,10 +11751,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the list of users of a static site. + /// Gets the details of the user provided function apps registered with a + /// static site build /// /// - /// Description for Gets the list of users of a static site. + /// Description for Gets the details of the user provided function apps + /// registered with a static site build /// /// /// The NextLink from the previous successful call to List operation. @@ -6018,7 +11782,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteUsersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetUserProvidedFunctionAppsForStaticSiteBuildNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -6033,7 +11797,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteUsersNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppsForStaticSiteBuildNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -6046,7 +11810,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6127,7 +11891,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6140,7 +11904,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6160,10 +11924,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static site builds for a particular static site. + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Gets all static site builds for a particular static site. + /// Description for Gets all static site custom domains for a particular static + /// site. /// /// /// The NextLink from the previous successful call to List operation. @@ -6189,7 +11954,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetStaticSiteBuildsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteCustomDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -6204,7 +11969,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStaticSiteBuildsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteCustomDomainsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -6298,7 +12063,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6311,7 +12076,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6331,10 +12096,10 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the functions of a particular static site build. + /// Gets the functions of a static site. /// /// - /// Description for Gets the functions of a particular static site build. + /// Description for Gets the functions of a static site. /// /// /// The NextLink from the previous successful call to List operation. @@ -6360,7 +12125,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteBuildFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListStaticSiteFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -6375,7 +12140,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteBuildFunctionsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -6502,11 +12267,11 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets all static site custom domains for a particular static site. + /// Gets the list of private endpoint connections associated with a static site /// /// - /// Description for Gets all static site custom domains for a particular static - /// site. + /// Description for Gets the list of private endpoint connections associated + /// with a static site /// /// /// The NextLink from the previous successful call to List operation. @@ -6532,7 +12297,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteCustomDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -6547,7 +12312,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteCustomDomainsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -6641,7 +12406,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6654,7 +12419,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6674,10 +12439,12 @@ internal StaticSitesOperations(WebSiteManagementClient client) } /// - /// Gets the functions of a static site. + /// Gets the details of the user provided function apps registered with a + /// static site /// /// - /// Description for Gets the functions of a static site. + /// Description for Gets the details of the user provided function apps + /// registered with a static site /// /// /// The NextLink from the previous successful call to List operation. @@ -6703,7 +12470,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListStaticSiteFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetUserProvidedFunctionAppsForStaticSiteNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -6718,7 +12485,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStaticSiteFunctionsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetUserProvidedFunctionAppsForStaticSiteNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -6812,7 +12579,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6825,7 +12592,7 @@ internal StaticSitesOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperationsExtensions.cs index 4fea3668e831..78c4805f4470 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/StaticSitesOperationsExtensions.cs @@ -21,6 +21,54 @@ namespace Microsoft.Azure.Management.WebSites /// public static partial class StaticSitesOperationsExtensions { + /// + /// Generates a preview workflow file for the static site + /// + /// + /// Description for Generates a preview workflow file for the static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Location where you plan to create the static site. + /// + /// + /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. + /// See example. + /// + public static StaticSitesWorkflowPreview PreviewWorkflow(this IStaticSitesOperations operations, string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest) + { + return operations.PreviewWorkflowAsync(location, staticSitesWorkflowPreviewRequest).GetAwaiter().GetResult(); + } + + /// + /// Generates a preview workflow file for the static site + /// + /// + /// Description for Generates a preview workflow file for the static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Location where you plan to create the static site. + /// + /// + /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. + /// See example. + /// + /// + /// The cancellation token. + /// + public static async Task PreviewWorkflowAsync(this IStaticSitesOperations operations, string location, StaticSitesWorkflowPreviewRequest staticSitesWorkflowPreviewRequest, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PreviewWorkflowWithHttpMessagesAsync(location, staticSitesWorkflowPreviewRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get all Static Sites for a subscription. /// @@ -528,12 +576,12 @@ public static IPage GetStaticSiteBuilds(this IStatic /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - public static StaticSiteBuildARMResource GetStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId) + public static StaticSiteBuildARMResource GetStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) { - return operations.GetStaticSiteBuildAsync(resourceGroupName, name, prId).GetAwaiter().GetResult(); + return operations.GetStaticSiteBuildAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); } /// @@ -551,15 +599,15 @@ public static StaticSiteBuildARMResource GetStaticSiteBuild(this IStaticSitesOpe /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task GetStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, prId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -580,12 +628,12 @@ public static StaticSiteBuildARMResource GetStaticSiteBuild(this IStaticSitesOpe /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - public static void DeleteStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId) + public static void DeleteStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) { - operations.DeleteStaticSiteBuildAsync(resourceGroupName, name, prId).GetAwaiter().GetResult(); + operations.DeleteStaticSiteBuildAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); } /// @@ -603,23 +651,22 @@ public static void DeleteStaticSiteBuild(this IStaticSitesOperations operations, /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task DeleteStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, prId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Creates or updates the function app settings of a static site build. + /// Creates or updates the app settings of a static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site build. + /// Description for Creates or updates the app settings of a static site build. /// /// /// The operations group for this extension method. @@ -630,22 +677,22 @@ public static void DeleteStaticSiteBuild(this IStaticSitesOperations operations, /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// + /// The dictionary containing the static site app settings to update. /// - public static StringDictionary CreateOrUpdateStaticSiteBuildFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, StringDictionary appSettings) + public static StringDictionary CreateOrUpdateStaticSiteBuildAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StringDictionary appSettings) { - return operations.CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(resourceGroupName, name, prId, appSettings).GetAwaiter().GetResult(); + return operations.CreateOrUpdateStaticSiteBuildAppSettingsAsync(resourceGroupName, name, environmentName, appSettings).GetAwaiter().GetResult(); } /// - /// Creates or updates the function app settings of a static site build. + /// Creates or updates the app settings of a static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site build. + /// Description for Creates or updates the app settings of a static site build. /// /// /// The operations group for this extension method. @@ -656,27 +703,29 @@ public static StringDictionary CreateOrUpdateStaticSiteBuildFunctionAppSettings( /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// + /// The dictionary containing the static site app settings to update. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateStaticSiteBuildAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, prId, appSettings, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateStaticSiteBuildAppSettingsWithHttpMessagesAsync(resourceGroupName, name, environmentName, appSettings, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the functions of a particular static site build. + /// Creates or updates the function app settings of a static site build. /// /// - /// Description for Gets the functions of a particular static site build. + /// Description for Creates or updates the function app settings of a static + /// site build. /// /// /// The operations group for this extension method. @@ -687,19 +736,23 @@ public static StringDictionary CreateOrUpdateStaticSiteBuildFunctionAppSettings( /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - public static IPage ListStaticSiteBuildFunctions(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId) + /// + /// The dictionary containing the static site function app settings to update. + /// + public static StringDictionary CreateOrUpdateStaticSiteBuildFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StringDictionary appSettings) { - return operations.ListStaticSiteBuildFunctionsAsync(resourceGroupName, name, prId).GetAwaiter().GetResult(); + return operations.CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(resourceGroupName, name, environmentName, appSettings).GetAwaiter().GetResult(); } /// - /// Gets the functions of a particular static site build. + /// Creates or updates the function app settings of a static site build. /// /// - /// Description for Gets the functions of a particular static site build. + /// Description for Creates or updates the function app settings of a static + /// site build. /// /// /// The operations group for this extension method. @@ -710,25 +763,28 @@ public static IPage ListStaticSiteBuildFu /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// + /// + /// The dictionary containing the static site function app settings to update. + /// /// /// The cancellation token. /// - public static async Task> ListStaticSiteBuildFunctionsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateStaticSiteBuildFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteBuildFunctionsWithHttpMessagesAsync(resourceGroupName, name, prId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, environmentName, appSettings, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the application settings of a static site. + /// Gets the functions of a particular static site build. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Gets the functions of a particular static site build. /// /// /// The operations group for this extension method. @@ -739,19 +795,19 @@ public static IPage ListStaticSiteBuildFu /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// - public static StringDictionary ListStaticSiteBuildFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId) + public static IPage ListStaticSiteBuildFunctions(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) { - return operations.ListStaticSiteBuildFunctionAppSettingsAsync(resourceGroupName, name, prId).GetAwaiter().GetResult(); + return operations.ListStaticSiteBuildFunctionsAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); } /// - /// Gets the application settings of a static site. + /// Gets the functions of a particular static site build. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Gets the functions of a particular static site build. /// /// /// The operations group for this extension method. @@ -762,26 +818,25 @@ public static StringDictionary ListStaticSiteBuildFunctionAppSettings(this IStat /// /// Name of the static site. /// - /// + /// /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task ListStaticSiteBuildFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string prId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListStaticSiteBuildFunctionsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, prId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListStaticSiteBuildFunctionsWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates the function app settings of a static site. + /// Gets the application settings of a static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site. + /// Description for Gets the application settings of a static site build. /// /// /// The operations group for this extension method. @@ -792,19 +847,19 @@ public static StringDictionary ListStaticSiteBuildFunctionAppSettings(this IStat /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// - public static StringDictionary CreateOrUpdateStaticSiteFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings) + public static StringDictionary ListStaticSiteBuildAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) { - return operations.CreateOrUpdateStaticSiteFunctionAppSettingsAsync(resourceGroupName, name, appSettings).GetAwaiter().GetResult(); + return operations.ListStaticSiteBuildAppSettingsAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); } /// - /// Creates or updates the function app settings of a static site. + /// Gets the application settings of a static site build. /// /// - /// Description for Creates or updates the function app settings of a static - /// site. + /// Description for Gets the application settings of a static site build. /// /// /// The operations group for this extension method. @@ -815,24 +870,25 @@ public static StringDictionary CreateOrUpdateStaticSiteFunctionAppSettings(this /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateStaticSiteFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListStaticSiteBuildAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, appSettings, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListStaticSiteBuildAppSettingsWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates an invitation link for a user with the role + /// Gets the application settings of a static site build. /// /// - /// Description for Creates an invitation link for a user with the role + /// Description for Gets the application settings of a static site build. /// /// /// The operations group for this extension method. @@ -843,18 +899,19 @@ public static StringDictionary CreateOrUpdateStaticSiteFunctionAppSettings(this /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// - public static StaticSiteUserInvitationResponseResource CreateUserRolesInvitationLink(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope) + public static StringDictionary ListStaticSiteBuildFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) { - return operations.CreateUserRolesInvitationLinkAsync(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope).GetAwaiter().GetResult(); + return operations.ListStaticSiteBuildFunctionAppSettingsAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); } /// - /// Creates an invitation link for a user with the role + /// Gets the application settings of a static site build. /// /// - /// Description for Creates an invitation link for a user with the role + /// Description for Gets the application settings of a static site build. /// /// /// The operations group for this extension method. @@ -865,25 +922,27 @@ public static StaticSiteUserInvitationResponseResource CreateUserRolesInvitation /// /// Name of the static site. /// - /// + /// + /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task CreateUserRolesInvitationLinkAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListStaticSiteBuildFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateUserRolesInvitationLinkWithHttpMessagesAsync(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListStaticSiteBuildFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all static site custom domains for a particular static site. + /// Gets the details of the user provided function apps registered with a + /// static site build /// /// - /// Description for Gets all static site custom domains for a particular static - /// site. + /// Description for Gets the details of the user provided function apps + /// registered with a static site build /// /// /// The operations group for this extension method. @@ -892,19 +951,23 @@ public static StaticSiteUserInvitationResponseResource CreateUserRolesInvitation /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site. /// - public static IPage ListStaticSiteCustomDomains(this IStaticSitesOperations operations, string resourceGroupName, string name) + /// + /// The stage site identifier. + /// + public static IPage GetUserProvidedFunctionAppsForStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) { - return operations.ListStaticSiteCustomDomainsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.GetUserProvidedFunctionAppsForStaticSiteBuildAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); } /// - /// Gets all static site custom domains for a particular static site. + /// Gets the details of the user provided function apps registered with a + /// static site build /// /// - /// Description for Gets all static site custom domains for a particular static - /// site. + /// Description for Gets the details of the user provided function apps + /// registered with a static site build /// /// /// The operations group for this extension method. @@ -913,26 +976,29 @@ public static IPage ListStaticSiteCus /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site resource to search in. + /// Name of the static site. + /// + /// + /// The stage site identifier. /// /// /// The cancellation token. /// - public static async Task> ListStaticSiteCustomDomainsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetUserProvidedFunctionAppsForStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteCustomDomainsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetUserProvidedFunctionAppsForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates a new static site custom domain in an existing resource group and - /// static site. + /// Gets the details of the user provided function app registered with a static + /// site build /// /// - /// Description for Creates a new static site custom domain in an existing - /// resource group and static site. + /// Description for Gets the details of the user provided function app + /// registered with a static site build /// /// /// The operations group for this extension method. @@ -943,21 +1009,24 @@ public static IPage ListStaticSiteCus /// /// Name of the static site. /// - /// - /// The custom domain to create. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// - public static StaticSiteCustomDomainOverviewARMResource CreateOrUpdateStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) + public static StaticSiteUserProvidedFunctionAppARMResource GetUserProvidedFunctionAppForStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName) { - return operations.CreateOrUpdateStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); + return operations.GetUserProvidedFunctionAppForStaticSiteBuildAsync(resourceGroupName, name, environmentName, functionAppName).GetAwaiter().GetResult(); } /// - /// Creates a new static site custom domain in an existing resource group and - /// static site. + /// Gets the details of the user provided function app registered with a static + /// site build /// /// - /// Description for Creates a new static site custom domain in an existing - /// resource group and static site. + /// Description for Gets the details of the user provided function app + /// registered with a static site build /// /// /// The operations group for this extension method. @@ -968,25 +1037,29 @@ public static StaticSiteCustomDomainOverviewARMResource CreateOrUpdateStaticSite /// /// Name of the static site. /// - /// - /// The custom domain to create. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetUserProvidedFunctionAppForStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetUserProvidedFunctionAppForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes a custom domain. + /// Register a user provided function app with a static site build /// /// - /// Description for Deletes a custom domain. + /// Description for Register a user provided function app with a static site + /// build /// /// /// The operations group for this extension method. @@ -997,19 +1070,33 @@ public static StaticSiteCustomDomainOverviewARMResource CreateOrUpdateStaticSite /// /// Name of the static site. /// - /// - /// The custom domain to delete. + /// + /// The stage site identifier. /// - public static void DeleteStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + public static StaticSiteUserProvidedFunctionAppARMResource RegisterUserProvidedFunctionAppWithStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?)) { - operations.DeleteStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); + return operations.RegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced).GetAwaiter().GetResult(); } /// - /// Deletes a custom domain. + /// Register a user provided function app with a static site build /// /// - /// Description for Deletes a custom domain. + /// Description for Register a user provided function app with a static site + /// build /// /// /// The operations group for this extension method. @@ -1020,23 +1107,39 @@ public static void DeleteStaticSiteCustomDomain(this IStaticSitesOperations oper /// /// Name of the static site. /// - /// - /// The custom domain to delete. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. /// /// /// The cancellation token. /// - public static async Task DeleteStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.RegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Validates a particular custom domain can be added to a static site. + /// Detach the user provided function app from the static site build /// /// - /// Description for Validates a particular custom domain can be added to a - /// static site. + /// Description for Detach the user provided function app from the static site + /// build /// /// /// The operations group for this extension method. @@ -1047,20 +1150,23 @@ public static void DeleteStaticSiteCustomDomain(this IStaticSitesOperations oper /// /// Name of the static site. /// - /// - /// The custom domain to validate. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// - public static void ValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) + public static void DetachUserProvidedFunctionAppFromStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName) { - operations.ValidateCustomDomainCanBeAddedToStaticSiteAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); + operations.DetachUserProvidedFunctionAppFromStaticSiteBuildAsync(resourceGroupName, name, environmentName, functionAppName).GetAwaiter().GetResult(); } /// - /// Validates a particular custom domain can be added to a static site. + /// Detach the user provided function app from the static site build /// /// - /// Description for Validates a particular custom domain can be added to a - /// static site. + /// Description for Detach the user provided function app from the static site + /// build /// /// /// The operations group for this extension method. @@ -1071,22 +1177,26 @@ public static void ValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesO /// /// Name of the static site. /// - /// - /// The custom domain to validate. + /// + /// The stage site identifier. + /// + /// + /// Name of the function app registered with the static site build. /// /// /// The cancellation token. /// - public static async Task ValidateCustomDomainCanBeAddedToStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DetachUserProvidedFunctionAppFromStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DetachUserProvidedFunctionAppFromStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Detaches a static site. + /// Deploys zipped content to a specific environment of a static site. /// /// - /// Description for Detaches a static site. + /// Description for Deploys zipped content to a specific environment of a + /// static site. /// /// /// The operations group for this extension method. @@ -1095,18 +1205,26 @@ public static void ValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesO /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site to detach. + /// Name of the static site. /// - public static void DetachStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + public static void CreateZipDeploymentForStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) { - operations.DetachStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + operations.CreateZipDeploymentForStaticSiteBuildAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope).GetAwaiter().GetResult(); } /// - /// Detaches a static site. + /// Deploys zipped content to a specific environment of a static site. /// /// - /// Description for Detaches a static site. + /// Description for Deploys zipped content to a specific environment of a + /// static site. /// /// /// The operations group for this extension method. @@ -1115,21 +1233,28 @@ public static void DetachStaticSite(this IStaticSitesOperations operations, stri /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site to detach. + /// Name of the static site. + /// + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. /// /// /// The cancellation token. /// - public static async Task DetachStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateZipDeploymentForStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DetachStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.CreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Gets the functions of a static site. + /// Creates or updates the app settings of a static site. /// /// - /// Description for Gets the functions of a static site. + /// Description for Creates or updates the app settings of a static site. /// /// /// The operations group for this extension method. @@ -1140,16 +1265,19 @@ public static void DetachStaticSite(this IStaticSitesOperations operations, stri /// /// Name of the static site. /// - public static IPage ListStaticSiteFunctions(this IStaticSitesOperations operations, string resourceGroupName, string name) + /// + /// The dictionary containing the static site app settings to update. + /// + public static StringDictionary CreateOrUpdateStaticSiteAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings) { - return operations.ListStaticSiteFunctionsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.CreateOrUpdateStaticSiteAppSettingsAsync(resourceGroupName, name, appSettings).GetAwaiter().GetResult(); } /// - /// Gets the functions of a static site. + /// Creates or updates the app settings of a static site. /// /// - /// Description for Gets the functions of a static site. + /// Description for Creates or updates the app settings of a static site. /// /// /// The operations group for this extension method. @@ -1160,22 +1288,26 @@ public static IPage ListStaticSiteFunctio /// /// Name of the static site. /// + /// + /// The dictionary containing the static site app settings to update. + /// /// /// The cancellation token. /// - public static async Task> ListStaticSiteFunctionsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateStaticSiteAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteFunctionsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateStaticSiteAppSettingsWithHttpMessagesAsync(resourceGroupName, name, appSettings, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the application settings of a static site. + /// Creates or updates the function app settings of a static site. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Creates or updates the function app settings of a static + /// site. /// /// /// The operations group for this extension method. @@ -1186,16 +1318,20 @@ public static IPage ListStaticSiteFunctio /// /// Name of the static site. /// - public static StringDictionary ListStaticSiteFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name) + /// + /// The dictionary containing the static site function app settings to update. + /// + public static StringDictionary CreateOrUpdateStaticSiteFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings) { - return operations.ListStaticSiteFunctionAppSettingsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.CreateOrUpdateStaticSiteFunctionAppSettingsAsync(resourceGroupName, name, appSettings).GetAwaiter().GetResult(); } /// - /// Gets the application settings of a static site. + /// Creates or updates the function app settings of a static site. /// /// - /// Description for Gets the application settings of a static site. + /// Description for Creates or updates the function app settings of a static + /// site. /// /// /// The operations group for this extension method. @@ -1206,22 +1342,25 @@ public static StringDictionary ListStaticSiteFunctionAppSettings(this IStaticSit /// /// Name of the static site. /// + /// + /// The dictionary containing the static site function app settings to update. + /// /// /// The cancellation token. /// - public static async Task ListStaticSiteFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateStaticSiteFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StringDictionary appSettings, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateStaticSiteFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, appSettings, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists the secrets for an existing static site. + /// Creates an invitation link for a user with the role /// /// - /// Description for Lists the secrets for an existing static site. + /// Description for Creates an invitation link for a user with the role /// /// /// The operations group for this extension method. @@ -1232,16 +1371,18 @@ public static StringDictionary ListStaticSiteFunctionAppSettings(this IStaticSit /// /// Name of the static site. /// - public static StringDictionary ListStaticSiteSecrets(this IStaticSitesOperations operations, string resourceGroupName, string name) + /// + /// + public static StaticSiteUserInvitationResponseResource CreateUserRolesInvitationLink(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope) { - return operations.ListStaticSiteSecretsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.CreateUserRolesInvitationLinkAsync(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope).GetAwaiter().GetResult(); } /// - /// Lists the secrets for an existing static site. + /// Creates an invitation link for a user with the role /// /// - /// Description for Lists the secrets for an existing static site. + /// Description for Creates an invitation link for a user with the role /// /// /// The operations group for this extension method. @@ -1252,22 +1393,25 @@ public static StringDictionary ListStaticSiteSecrets(this IStaticSitesOperations /// /// Name of the static site. /// + /// + /// /// /// The cancellation token. /// - public static async Task ListStaticSiteSecretsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateUserRolesInvitationLinkAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteUserInvitationRequestResource staticSiteUserRolesInvitationEnvelope, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListStaticSiteSecretsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUserRolesInvitationLinkWithHttpMessagesAsync(resourceGroupName, name, staticSiteUserRolesInvitationEnvelope, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Resets the api key for an existing static site. + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Resets the api key for an existing static site. + /// Description for Gets all static site custom domains for a particular static + /// site. /// /// /// The operations group for this extension method. @@ -1276,20 +1420,19 @@ public static StringDictionary ListStaticSiteSecrets(this IStaticSitesOperations /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. - /// - /// + /// Name of the static site resource to search in. /// - public static void ResetStaticSiteApiKey(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope) + public static IPage ListStaticSiteCustomDomains(this IStaticSitesOperations operations, string resourceGroupName, string name) { - operations.ResetStaticSiteApiKeyAsync(resourceGroupName, name, resetPropertiesEnvelope).GetAwaiter().GetResult(); + return operations.ListStaticSiteCustomDomainsAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// - /// Resets the api key for an existing static site. + /// Gets all static site custom domains for a particular static site. /// /// - /// Description for Resets the api key for an existing static site. + /// Description for Gets all static site custom domains for a particular static + /// site. /// /// /// The operations group for this extension method. @@ -1298,16 +1441,1832 @@ public static void ResetStaticSiteApiKey(this IStaticSitesOperations operations, /// Name of the resource group to which the resource belongs. /// /// - /// Name of the static site. - /// - /// + /// Name of the static site resource to search in. /// /// /// The cancellation token. /// - public static async Task ResetStaticSiteApiKeyAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListStaticSiteCustomDomainsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.ResetStaticSiteApiKeyWithHttpMessagesAsync(resourceGroupName, name, resetPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListStaticSiteCustomDomainsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets an existing custom domain for a particular static site. + /// + /// + /// Description for Gets an existing custom domain for a particular static + /// site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site resource to search in. + /// + /// + /// The custom domain name. + /// + public static StaticSiteCustomDomainOverviewARMResource GetStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) + { + return operations.GetStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); + } + + /// + /// Gets an existing custom domain for a particular static site. + /// + /// + /// Description for Gets an existing custom domain for a particular static + /// site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site resource to search in. + /// + /// + /// The custom domain name. + /// + /// + /// The cancellation token. + /// + public static async Task GetStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new static site custom domain in an existing resource group and + /// static site. + /// + /// + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + public static StaticSiteCustomDomainOverviewARMResource CreateOrUpdateStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) + { + return operations.CreateOrUpdateStaticSiteCustomDomainAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Creates a new static site custom domain in an existing resource group and + /// static site. + /// + /// + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + public static void DeleteStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) + { + operations.DeleteStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added to a + /// static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + public static void ValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) + { + operations.ValidateCustomDomainCanBeAddedToStaticSiteAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added to a + /// static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// The cancellation token. + /// + public static async Task ValidateCustomDomainCanBeAddedToStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + public static void DetachStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + operations.DetachStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + /// + /// The cancellation token. + /// + public static async Task DetachStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DetachStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the functions of a static site. + /// + /// + /// Description for Gets the functions of a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static IPage ListStaticSiteFunctions(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.ListStaticSiteFunctionsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the functions of a static site. + /// + /// + /// Description for Gets the functions of a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task> ListStaticSiteFunctionsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStaticSiteFunctionsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static StringDictionary ListStaticSiteAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.ListStaticSiteAppSettingsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task ListStaticSiteAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStaticSiteAppSettingsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the roles configured for the static site. + /// + /// + /// Description for Lists the roles configured for the static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static StringList ListStaticSiteConfiguredRoles(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.ListStaticSiteConfiguredRolesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Lists the roles configured for the static site. + /// + /// + /// Description for Lists the roles configured for the static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task ListStaticSiteConfiguredRolesAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStaticSiteConfiguredRolesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static StringDictionary ListStaticSiteFunctionAppSettings(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.ListStaticSiteFunctionAppSettingsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the application settings of a static site. + /// + /// + /// Description for Gets the application settings of a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task ListStaticSiteFunctionAppSettingsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStaticSiteFunctionAppSettingsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the secrets for an existing static site. + /// + /// + /// Description for Lists the secrets for an existing static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static StringDictionary ListStaticSiteSecrets(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.ListStaticSiteSecretsAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Lists the secrets for an existing static site. + /// + /// + /// Description for Lists the secrets for an existing static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task ListStaticSiteSecretsAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListStaticSiteSecretsWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the list of private endpoint connections associated with a static site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static IPage GetPrivateEndpointConnectionList(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.GetPrivateEndpointConnectionListAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of private endpoint connections associated with a static site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets a private endpoint connection + /// + /// + /// Description for Gets a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + return operations.ApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + /// + /// The cancellation token. + /// + public static async Task ApproveOrRejectPrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + public static object DeletePrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task DeletePrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.GetPrivateLinkResourcesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateLinkResourcesAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Resets the api key for an existing static site. + /// + /// + /// Description for Resets the api key for an existing static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// + public static void ResetStaticSiteApiKey(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope) + { + operations.ResetStaticSiteApiKeyAsync(resourceGroupName, name, resetPropertiesEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Resets the api key for an existing static site. + /// + /// + /// Description for Resets the api key for an existing static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ResetStaticSiteApiKeyAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteResetPropertiesARMResource resetPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ResetStaticSiteApiKeyWithHttpMessagesAsync(resourceGroupName, name, resetPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the details of the user provided function apps registered with a + /// static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + public static IPage GetUserProvidedFunctionAppsForStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + return operations.GetUserProvidedFunctionAppsForStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the details of the user provided function apps registered with a + /// static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The cancellation token. + /// + public static async Task> GetUserProvidedFunctionAppsForStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUserProvidedFunctionAppsForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the details of the user provided function app registered with a static + /// site + /// + /// + /// Description for Gets the details of the user provided function app + /// registered with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + public static StaticSiteUserProvidedFunctionAppARMResource GetUserProvidedFunctionAppForStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName) + { + return operations.GetUserProvidedFunctionAppForStaticSiteAsync(resourceGroupName, name, functionAppName).GetAwaiter().GetResult(); + } + + /// + /// Gets the details of the user provided function app registered with a static + /// site + /// + /// + /// Description for Gets the details of the user provided function app + /// registered with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + /// + /// The cancellation token. + /// + public static async Task GetUserProvidedFunctionAppForStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUserProvidedFunctionAppForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + public static StaticSiteUserProvidedFunctionAppARMResource RegisterUserProvidedFunctionAppWithStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?)) + { + return operations.RegisterUserProvidedFunctionAppWithStaticSiteAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced).GetAwaiter().GetResult(); + } + + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// The cancellation token. + /// + public static async Task RegisterUserProvidedFunctionAppWithStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Detach the user provided function app from the static site + /// + /// + /// Description for Detach the user provided function app from the static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + public static void DetachUserProvidedFunctionAppFromStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName) + { + operations.DetachUserProvidedFunctionAppFromStaticSiteAsync(resourceGroupName, name, functionAppName).GetAwaiter().GetResult(); + } + + /// + /// Detach the user provided function app from the static site + /// + /// + /// Description for Detach the user provided function app from the static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app registered with the static site. + /// + /// + /// The cancellation token. + /// + public static async Task DetachUserProvidedFunctionAppFromStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DetachUserProvidedFunctionAppFromStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + public static void CreateZipDeploymentForStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) + { + operations.CreateZipDeploymentForStaticSiteAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + /// + /// The cancellation token. + /// + public static async Task CreateZipDeploymentForStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.CreateZipDeploymentForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates a new static site in an existing resource group, or updates an + /// existing static site. + /// + /// + /// Description for Creates a new static site in an existing resource group, or + /// updates an existing static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. + /// + public static StaticSiteARMResource BeginCreateOrUpdateStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope) + { + return operations.BeginCreateOrUpdateStaticSiteAsync(resourceGroupName, name, staticSiteEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Creates a new static site in an existing resource group, or updates an + /// existing static site. + /// + /// + /// Description for Creates a new static site in an existing resource group, or + /// updates an existing static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to create or update. + /// + /// + /// A JSON representation of the staticsite properties. See example. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteARMResource staticSiteEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteEnvelope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a static site. + /// + /// + /// Description for Deletes a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to delete. + /// + public static void BeginDeleteStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + operations.BeginDeleteStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Deletes a static site. + /// + /// + /// Description for Deletes a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to delete. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deletes a static site build. + /// + /// + /// Description for Deletes a static site build. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + public static void BeginDeleteStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName) + { + operations.BeginDeleteStaticSiteBuildAsync(resourceGroupName, name, environmentName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a static site build. + /// + /// + /// Description for Deletes a static site build. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Register a user provided function app with a static site build + /// + /// + /// Description for Register a user provided function app with a static site + /// build + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + public static StaticSiteUserProvidedFunctionAppARMResource BeginRegisterUserProvidedFunctionAppWithStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?)) + { + return operations.BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced).GetAwaiter().GetResult(); + } + + /// + /// Register a user provided function app with a static site build + /// + /// + /// Description for Register a user provided function app with a static site + /// build + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The stage site identifier. + /// + /// + /// Name of the function app to register with the static site build. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginRegisterUserProvidedFunctionAppWithStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deploys zipped content to a specific environment of a static site. + /// + /// + /// Description for Deploys zipped content to a specific environment of a + /// static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + public static void BeginCreateZipDeploymentForStaticSiteBuild(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) + { + operations.BeginCreateZipDeploymentForStaticSiteBuildAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Deploys zipped content to a specific environment of a static site. + /// + /// + /// Description for Deploys zipped content to a specific environment of a + /// static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the environment. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateZipDeploymentForStaticSiteBuildAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string environmentName, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginCreateZipDeploymentForStaticSiteBuildWithHttpMessagesAsync(resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates a new static site custom domain in an existing resource group and + /// static site. + /// + /// + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + public static StaticSiteCustomDomainOverviewARMResource BeginCreateOrUpdateStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) + { + return operations.BeginCreateOrUpdateStaticSiteCustomDomainAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Creates a new static site custom domain in an existing resource group and + /// static site. + /// + /// + /// Description for Creates a new static site custom domain in an existing + /// resource group and static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to create. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + public static void BeginDeleteStaticSiteCustomDomain(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName) + { + operations.BeginDeleteStaticSiteCustomDomainAsync(resourceGroupName, name, domainName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a custom domain. + /// + /// + /// Description for Deletes a custom domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to delete. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteStaticSiteCustomDomainAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteStaticSiteCustomDomainWithHttpMessagesAsync(resourceGroupName, name, domainName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added to a + /// static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + public static void BeginValidateCustomDomainCanBeAddedToStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope) + { + operations.BeginValidateCustomDomainCanBeAddedToStaticSiteAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Validates a particular custom domain can be added to a static site. + /// + /// + /// Description for Validates a particular custom domain can be added to a + /// static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// The custom domain to validate. + /// + /// + /// A JSON representation of the static site custom domain request properties. + /// See example. + /// + /// + /// The cancellation token. + /// + public static async Task BeginValidateCustomDomainCanBeAddedToStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string domainName, StaticSiteCustomDomainRequestPropertiesARMResource staticSiteCustomDomainRequestPropertiesEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginValidateCustomDomainCanBeAddedToStaticSiteWithHttpMessagesAsync(resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + public static void BeginDetachStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name) + { + operations.BeginDetachStaticSiteAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Detaches a static site. + /// + /// + /// Description for Detaches a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site to detach. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDetachStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDetachStaticSiteWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + return operations.BeginApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// Request body. + /// + /// + /// The cancellation token. + /// + public static async Task BeginApproveOrRejectPrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + public static object BeginDeletePrivateEndpointConnection(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeletePrivateEndpointConnectionAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + public static StaticSiteUserProvidedFunctionAppARMResource BeginRegisterUserProvidedFunctionAppWithStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?)) + { + return operations.BeginRegisterUserProvidedFunctionAppWithStaticSiteAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced).GetAwaiter().GetResult(); + } + + /// + /// Register a user provided function app with a static site + /// + /// + /// Description for Register a user provided function app with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// Name of the function app to register with the static site. + /// + /// + /// A JSON representation of the user provided function app properties. See + /// example. + /// + /// + /// Specify <code>true</code> to force the update of the auth + /// configuration on the function app even if an AzureStaticWebApps provider is + /// already configured on the function app. The default is + /// <code>false</code>. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRegisterUserProvidedFunctionAppWithStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, string functionAppName, StaticSiteUserProvidedFunctionAppARMResource staticSiteUserProvidedFunctionEnvelope, bool? isForced = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginRegisterUserProvidedFunctionAppWithStaticSiteWithHttpMessagesAsync(resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + public static void BeginCreateZipDeploymentForStaticSite(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope) + { + operations.BeginCreateZipDeploymentForStaticSiteAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope).GetAwaiter().GetResult(); + } + + /// + /// Deploys zipped content to a static site. + /// + /// + /// Description for Deploys zipped content to a static site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the static site. + /// + /// + /// A JSON representation of the StaticSiteZipDeployment properties. See + /// example. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateZipDeploymentForStaticSiteAsync(this IStaticSitesOperations operations, string resourceGroupName, string name, StaticSiteZipDeploymentARMResource staticSiteZipDeploymentEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginCreateZipDeploymentForStaticSiteWithHttpMessagesAsync(resourceGroupName, name, staticSiteZipDeploymentEnvelope, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -1510,6 +3469,50 @@ public static IPage ListStaticSiteBuildFu } } + /// + /// Gets the details of the user provided function apps registered with a + /// static site build + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site build + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetUserProvidedFunctionAppsForStaticSiteBuildNext(this IStaticSitesOperations operations, string nextPageLink) + { + return operations.GetUserProvidedFunctionAppsForStaticSiteBuildNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the details of the user provided function apps registered with a + /// static site build + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site build + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetUserProvidedFunctionAppsForStaticSiteBuildNextAsync(this IStaticSitesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUserProvidedFunctionAppsForStaticSiteBuildNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets all static site custom domains for a particular static site. /// @@ -1592,5 +3595,91 @@ public static IPage ListStaticSiteFunctio } } + /// + /// Gets the list of private endpoint connections associated with a static site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetPrivateEndpointConnectionListNext(this IStaticSitesOperations operations, string nextPageLink) + { + return operations.GetPrivateEndpointConnectionListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of private endpoint connections associated with a static site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListNextAsync(this IStaticSitesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the details of the user provided function apps registered with a + /// static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetUserProvidedFunctionAppsForStaticSiteNext(this IStaticSitesOperations operations, string nextPageLink) + { + return operations.GetUserProvidedFunctionAppsForStaticSiteNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the details of the user provided function apps registered with a + /// static site + /// + /// + /// Description for Gets the details of the user provided function apps + /// registered with a static site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetUserProvidedFunctionAppsForStaticSiteNextAsync(this IStaticSitesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUserProvidedFunctionAppsForStaticSiteNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperations.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperations.cs index 4329eceb1edf..37159f875601 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperations.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperations.cs @@ -6331,10 +6331,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the connection strings of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Replaces the connection strings of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -6342,9 +6342,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Connection strings of the app or deployment slot. See example. - /// /// /// Headers that will be added to request. /// @@ -6366,7 +6363,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetAppSettingsKeyVaultReferencesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6391,10 +6388,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionStrings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionStrings"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -6412,13 +6405,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionStrings", connectionStrings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateConnectionStrings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingsKeyVaultReferences", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -6434,7 +6426,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6465,12 +6457,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionStrings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionStrings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -6521,7 +6507,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6534,7 +6520,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6554,10 +6540,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the connection strings of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Gets the connection strings of an app. + /// Description for Gets the config reference and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -6565,6 +6551,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// App Setting key name. + /// /// /// Headers that will be added to request. /// @@ -6586,7 +6575,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAppSettingKeyVaultReferenceWithHttpMessagesAsync(string resourceGroupName, string name, string appSettingKey, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -6611,214 +6600,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStrings", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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")) + if (appSettingKey == null) { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the logging configuration of an app. - /// - /// - /// Description for Gets the logging configuration of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// 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> GetDiagnosticLogsConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + throw new ValidationException(ValidationRules.CannotBeNull, "appSettingKey"); } if (Client.SubscriptionId == null) { @@ -6837,14 +6621,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("appSettingKey", appSettingKey); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticLogsConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingKeyVaultReference", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings/{appSettingKey}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{appSettingKey}", System.Uri.EscapeDataString(appSettingKey)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -6939,7 +6725,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -6952,7 +6738,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -6972,10 +6758,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the logging configuration of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Updates the logging configuration of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -6983,10 +6769,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// A SiteLogsConfig JSON object that contains the logging configuration to - /// change in the "properties" property. - /// /// /// Headers that will be added to request. /// @@ -7008,7 +6790,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateDiagnosticLogsConfigWithHttpMessagesAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetSiteConnectionStringKeyVaultReferencesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7033,14 +6815,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteLogsConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteLogsConfig"); - } - if (siteLogsConfig != null) - { - siteLogsConfig.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -7058,13 +6832,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteLogsConfig", siteLogsConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateDiagnosticLogsConfig", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReferences", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -7080,7 +6853,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7111,12 +6884,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteLogsConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteLogsConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -7167,7 +6934,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7180,7 +6947,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7200,10 +6967,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the metadata of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Replaces the metadata of an app. + /// Description for Gets the config reference and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -7211,8 +6978,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Edited metadata of the app or deployment slot. See example. + /// /// /// /// Headers that will be added to request. @@ -7235,7 +7001,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateMetadataWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary metadata, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSiteConnectionStringKeyVaultReferenceWithHttpMessagesAsync(string resourceGroupName, string name, string connectionStringKey, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7260,9 +7026,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (metadata == null) + if (connectionStringKey == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionStringKey"); } if (Client.SubscriptionId == null) { @@ -7281,15 +7047,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("metadata", metadata); + tracingParameters.Add("connectionStringKey", connectionStringKey); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateMetadata", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReference", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings/{connectionStringKey}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{connectionStringKey}", System.Uri.EscapeDataString(connectionStringKey)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -7303,7 +7070,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7334,12 +7101,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(metadata != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -7390,7 +7151,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7403,7 +7164,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7423,10 +7184,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the metadata of an app. + /// Replaces the connection strings of an app. /// /// - /// Description for Gets the metadata of an app. + /// Description for Replaces the connection strings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -7434,6 +7195,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Connection strings of the app or deployment slot. See example. + /// /// /// Headers that will be added to request. /// @@ -7455,7 +7219,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListMetadataWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7480,6 +7244,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (connectionStrings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionStrings"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -7497,12 +7265,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("connectionStrings", connectionStrings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMetadata", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateConnectionStrings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -7518,7 +7287,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7549,6 +7318,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionStrings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionStrings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -7599,7 +7374,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7612,7 +7387,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7632,10 +7407,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Git/FTP publishing credentials of an app. + /// Gets the connection strings of an app. /// /// - /// Description for Gets the Git/FTP publishing credentials of an app. + /// Description for Gets the connection strings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -7644,32 +7419,213 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListPublishingCredentialsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// 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> ListConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListPublishingCredentialsWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStrings", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; } /// - /// Updates the Push settings associated with web app. + /// Gets the logging configuration of an app. /// /// - /// Description for Updates the Push settings associated with web app. + /// Description for Gets the logging configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Push settings associated with web app. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -7692,7 +7648,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSitePushSettingsWithHttpMessagesAsync(string resourceGroupName, string name, PushSettings pushSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDiagnosticLogsConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7717,14 +7673,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (pushSettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "pushSettings"); - } - if (pushSettings != null) - { - pushSettings.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -7742,13 +7690,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("pushSettings", pushSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSitePushSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticLogsConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -7764,7 +7711,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7795,12 +7742,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(pushSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pushSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -7851,7 +7792,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -7864,7 +7805,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -7884,16 +7825,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Push settings associated with web app. + /// Updates the logging configuration of an app. /// /// - /// Description for Gets the Push settings associated with web app. + /// Description for Updates the logging configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// A SiteLogsConfig JSON object that contains the logging configuration to + /// change in the "properties" property. /// /// /// Headers that will be added to request. @@ -7916,7 +7861,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSitePushSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDiagnosticLogsConfigWithHttpMessagesAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -7941,6 +7886,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteLogsConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteLogsConfig"); + } + if (siteLogsConfig != null) + { + siteLogsConfig.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -7958,12 +7911,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteLogsConfig", siteLogsConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSitePushSettings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateDiagnosticLogsConfig", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -7979,7 +7933,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8010,6 +7964,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteLogsConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteLogsConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -8060,7 +8020,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8073,7 +8033,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8093,12 +8053,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the names of app settings and connection strings that stick to the - /// slot (not swapped). + /// Replaces the metadata of an app. /// /// - /// Description for Gets the names of app settings and connection strings that - /// stick to the slot (not swapped). + /// Description for Replaces the metadata of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -8106,6 +8064,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Edited metadata of the app or deployment slot. See example. + /// /// /// Headers that will be added to request. /// @@ -8127,7 +8088,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSlotConfigurationNamesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateMetadataWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary metadata, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8152,6 +8113,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (metadata == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -8169,12 +8134,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("metadata", metadata); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlotConfigurationNames", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateMetadata", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -8190,7 +8156,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8221,6 +8187,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(metadata != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -8271,7 +8243,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8284,7 +8256,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8304,12 +8276,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the names of application settings and connection string that remain - /// with the slot during swap operation. + /// Gets the metadata of an app. /// /// - /// Description for Updates the names of application settings and connection - /// string that remain with the slot during swap operation. + /// Description for Gets the metadata of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -8317,9 +8287,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Names of application settings and connection strings. See example. - /// /// /// Headers that will be added to request. /// @@ -8341,7 +8308,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSlotConfigurationNamesWithHttpMessagesAsync(string resourceGroupName, string name, SlotConfigNamesResource slotConfigNames, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListMetadataWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8366,10 +8333,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotConfigNames == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotConfigNames"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -8387,13 +8350,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotConfigNames", slotConfigNames); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSlotConfigurationNames", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMetadata", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -8409,7 +8371,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8440,12 +8402,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotConfigNames != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotConfigNames, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -8496,7 +8452,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8509,7 +8465,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8529,12 +8485,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the configuration of an app, such as platform version and bitness, - /// default documents, virtual applications, Always On, etc. + /// Gets the Git/FTP publishing credentials of an app. /// /// - /// Description for Gets the configuration of an app, such as platform version - /// and bitness, default documents, virtual applications, Always On, etc. + /// Description for Gets the Git/FTP publishing credentials of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -8543,6 +8497,34 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListPublishingCredentialsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListPublishingCredentialsWithHttpMessagesAsync(resourceGroupName, name, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the Push settings associated with web app. + /// + /// + /// Description for Updates the Push settings associated with web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Push settings associated with web app. + /// + /// /// Headers that will be added to request. /// /// @@ -8563,7 +8545,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSitePushSettingsWithHttpMessagesAsync(string resourceGroupName, string name, PushSettings pushSettings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8588,6 +8570,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (pushSettings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "pushSettings"); + } + if (pushSettings != null) + { + pushSettings.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -8605,12 +8595,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("pushSettings", pushSettings); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSitePushSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -8626,7 +8617,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8657,6 +8648,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(pushSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pushSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -8707,7 +8704,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8720,7 +8717,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8740,19 +8737,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the configuration of an app. + /// Gets the Push settings associated with web app. /// /// - /// Description for Updates the configuration of an app. + /// Description for Gets the Push settings associated with web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON representation of a SiteConfig object. See example. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -8775,7 +8769,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSitePushSettingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -8800,14 +8794,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); - } - if (siteConfig != null) - { - siteConfig.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -8825,13 +8811,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSitePushSettings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -8847,7 +8832,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8878,12 +8863,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -8934,7 +8913,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -8947,7 +8926,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -8967,10 +8946,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the configuration of an app. + /// Gets the names of app settings and connection strings that stick to the + /// slot (not swapped). /// /// - /// Description for Updates the configuration of an app. + /// Description for Gets the names of app settings and connection strings that + /// stick to the slot (not swapped). /// /// /// Name of the resource group to which the resource belongs. @@ -8978,9 +8959,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteConfig object. See example. - /// /// /// Headers that will be added to request. /// @@ -9002,7 +8980,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSlotConfigurationNamesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9027,10 +9005,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -9048,13 +9022,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateConfiguration", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlotConfigurationNames", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -9070,7 +9043,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -9101,12 +9074,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -9157,7 +9124,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -9170,7 +9137,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -9190,12 +9157,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a list of web app configuration snapshots identifiers. Each element of - /// the list contains a timestamp and the ID of the snapshot. + /// Updates the names of application settings and connection string that remain + /// with the slot during swap operation. /// /// - /// Description for Gets a list of web app configuration snapshots identifiers. - /// Each element of the list contains a timestamp and the ID of the snapshot. + /// Description for Updates the names of application settings and connection + /// string that remain with the slot during swap operation. /// /// /// Name of the resource group to which the resource belongs. @@ -9203,6 +9170,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Names of application settings and connection strings. See example. + /// /// /// Headers that will be added to request. /// @@ -9224,7 +9194,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationSnapshotInfoWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSlotConfigurationNamesWithHttpMessagesAsync(string resourceGroupName, string name, SlotConfigNamesResource slotConfigNames, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9249,6 +9219,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slotConfigNames == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slotConfigNames"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -9266,12 +9240,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slotConfigNames", slotConfigNames); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfo", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSlotConfigurationNames", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -9287,7 +9262,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -9318,6 +9293,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotConfigNames != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotConfigNames, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -9368,7 +9349,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -9381,7 +9362,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -9401,11 +9382,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a snapshot of the configuration of an app at a previous point in time. + /// Gets the configuration of an app, such as platform version and bitness, + /// default documents, virtual applications, Always On, etc. /// /// - /// Description for Gets a snapshot of the configuration of an app at a - /// previous point in time. + /// Description for Gets the configuration of an app, such as platform version + /// and bitness, default documents, virtual applications, Always On, etc. /// /// /// Name of the resource group to which the resource belongs. @@ -9413,9 +9395,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of the snapshot to read. - /// /// /// Headers that will be added to request. /// @@ -9437,7 +9416,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetConfigurationSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9462,10 +9441,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (snapshotId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -9483,16 +9458,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSnapshot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -9620,10 +9593,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Reverts the configuration of an app to a previous snapshot. + /// Updates the configuration of an app. /// /// - /// Description for Reverts the configuration of an app to a previous snapshot. + /// Description for Updates the configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -9631,8 +9604,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of the snapshot to read. + /// + /// JSON representation of a SiteConfig object. See example. /// /// /// Headers that will be added to request. @@ -9643,6 +9616,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -9652,7 +9628,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RecoverSiteConfigurationSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -9677,202 +9653,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (snapshotId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("snapshotId", snapshotId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RecoverSiteConfigurationSnapshot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 204) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; - } - - /// - /// Gets the last lines of docker logs for the given site - /// - /// - /// Description for Gets the last lines of docker logs for the given site - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// 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> GetWebSiteContainerLogsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) + if (siteConfig == null) { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } + throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); } - if (name == null) + if (siteConfig != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); + siteConfig.Validate(); } if (Client.SubscriptionId == null) { @@ -9891,12 +9678,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebSiteContainerLogs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -9912,7 +9700,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -9943,6 +9731,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -9955,7 +9749,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -9963,16 +9757,15 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -9982,10 +9775,6 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -9998,7 +9787,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -10008,7 +9797,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -10018,16 +9820,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the ZIP archived docker log files for the given site + /// Updates the configuration of an app. /// /// - /// Description for Gets the ZIP archived docker log files for the given site + /// Description for Updates the configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// JSON representation of a SiteConfig object. See example. /// /// /// Headers that will be added to request. @@ -10035,7 +9840,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -10050,7 +9855,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContainerLogsZipWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateConfigurationWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10075,6 +9880,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -10092,12 +9901,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetContainerLogsZip", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -10113,7 +9923,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -10144,6 +9954,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -10156,7 +9972,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -10164,16 +9980,15 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -10183,10 +9998,6 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -10199,7 +10010,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -10209,7 +10020,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -10219,16 +10043,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List continuous web jobs for an app, or a deployment slot. + /// Gets a list of web app configuration snapshots identifiers. Each element of + /// the list contains a timestamp and the ID of the snapshot. /// /// - /// Description for List continuous web jobs for an app, or a deployment slot. + /// Description for Gets a list of web app configuration snapshots identifiers. + /// Each element of the list contains a timestamp and the ID of the snapshot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -10251,7 +10077,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListContinuousWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationSnapshotInfoWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10294,11 +10120,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfo", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -10395,7 +10221,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -10408,7 +10234,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -10428,20 +10254,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a continuous web job by its ID for an app, or a deployment slot. + /// Gets a snapshot of the configuration of an app at a previous point in time. /// /// - /// Description for Gets a continuous web job by its ID for an app, or a - /// deployment slot. + /// Description for Gets a snapshot of the configuration of an app at a + /// previous point in time. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// The ID of the snapshot to read. /// /// /// Headers that will be added to request. @@ -10464,7 +10290,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetConfigurationSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10489,9 +10315,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (snapshotId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); } if (Client.SubscriptionId == null) { @@ -10510,16 +10336,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetContinuousWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSnapshot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -10584,7 +10410,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -10614,7 +10440,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -10627,7 +10453,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -10647,20 +10473,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a continuous web job by its ID for an app, or a deployment slot. + /// Reverts the configuration of an app to a previous snapshot. /// /// - /// Description for Delete a continuous web job by its ID for an app, or a - /// deployment slot. + /// Description for Reverts the configuration of an app to a previous snapshot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// The ID of the snapshot to read. /// /// /// Headers that will be added to request. @@ -10680,7 +10505,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RecoverSiteConfigurationSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10705,9 +10530,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (snapshotId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); } if (Client.SubscriptionId == null) { @@ -10726,16 +10551,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteContinuousWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RecoverSiteConfigurationSnapshot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -10749,7 +10574,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -10800,7 +10625,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -10845,20 +10670,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start a continuous web job for an app, or a deployment slot. + /// Gets the last lines of docker logs for the given site /// /// - /// Description for Start a continuous web job for an app, or a deployment - /// slot. + /// Description for Gets the last lines of docker logs for the given site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -10866,9 +10687,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -10878,7 +10702,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWebSiteContainerLogsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -10903,10 +10727,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -10924,16 +10744,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartContinuousWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebSiteContainerLogs", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -10990,7 +10808,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -10998,15 +10816,16 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -11016,6 +10835,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -11028,13 +10851,18 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -11043,19 +10871,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Stop a continuous web job for an app, or a deployment slot. + /// Gets the ZIP archived docker log files for the given site /// /// - /// Description for Stop a continuous web job for an app, or a deployment slot. + /// Description for Gets the ZIP archived docker log files for the given site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -11063,9 +10888,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -11075,7 +10903,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContainerLogsZipWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11100,10 +10928,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -11121,16 +10945,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopContinuousWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetContainerLogsZip", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -11187,7 +11009,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -11195,15 +11017,16 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -11213,6 +11036,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -11225,13 +11052,18 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -11240,16 +11072,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployments for an app, or a deployment slot. + /// List continuous web jobs for an app, or a deployment slot. /// /// - /// Description for List deployments for an app, or a deployment slot. + /// Description for List continuous web jobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// /// /// Headers that will be added to request. @@ -11272,7 +11104,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDeploymentsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListContinuousWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11315,11 +11147,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeployments", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobs", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -11416,7 +11248,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -11429,7 +11261,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -11449,20 +11281,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a deployment by its ID for an app, or a deployment slot. + /// Gets a continuous web job by its ID for an app, or a deployment slot. /// /// - /// Description for Get a deployment by its ID for an app, or a deployment - /// slot. + /// Description for Gets a continuous web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Deployment ID. + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -11485,7 +11317,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11510,9 +11342,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -11531,16 +11363,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDeployment", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetContinuousWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -11605,7 +11437,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -11635,7 +11467,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -11648,7 +11480,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -11668,22 +11500,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create a deployment for an app, or a deployment slot. + /// Delete a continuous web job by its ID for an app, or a deployment slot. /// /// - /// Description for Create a deployment for an app, or a deployment slot. + /// Description for Delete a continuous web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// ID of an existing deployment. + /// Site name. /// - /// - /// Deployment details. + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -11694,9 +11524,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -11706,7 +11533,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Deployment deployment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11731,13 +11558,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); - } - if (deployment == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deployment"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -11756,17 +11579,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); - tracingParameters.Add("deployment", deployment); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateDeployment", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteContinuousWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -11780,7 +11602,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -11811,12 +11633,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(deployment != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deployment, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -11837,7 +11653,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -11867,31 +11683,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -11900,20 +11698,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a deployment by its ID for an app, or a deployment slot. + /// Start a continuous web job for an app, or a deployment slot. /// /// - /// Description for Delete a deployment by its ID for an app, or a deployment + /// Description for Start a continuous web job for an app, or a deployment /// slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Deployment ID. + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -11933,7 +11731,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StartContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -11958,9 +11756,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -11979,16 +11777,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteDeployment", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartContinuousWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -12002,7 +11800,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -12053,7 +11851,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -12098,22 +11896,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployment log for specific deployment for an app, or a deployment - /// slot. + /// Stop a continuous web job for an app, or a deployment slot. /// /// - /// Description for List deployment log for specific deployment for an app, or - /// a deployment slot. + /// Description for Stop a continuous web job for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// The ID of a specific deployment. This is the value of the name property in - /// the JSON response from "GET /api/sites/{siteName}/deployments". + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -12124,9 +11919,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -12136,7 +11928,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListDeploymentLogWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopContinuousWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -12161,9 +11953,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -12182,16 +11974,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentLog", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopContinuousWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -12205,7 +11997,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -12256,7 +12048,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -12286,31 +12078,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -12319,14 +12093,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Discovers an existing app backup that can be restored from a blob in Azure - /// storage. Use this to get information about the databases stored in a - /// backup. + /// List deployments for an app, or a deployment slot. /// /// - /// Description for Discovers an existing app backup that can be restored from - /// a blob in Azure storage. Use this to get information about the databases - /// stored in a backup. + /// Description for List deployments for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -12334,10 +12104,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// A RestoreRequest object that includes Azure storage URL and blog name for - /// discovery of backup. - /// /// /// Headers that will be added to request. /// @@ -12359,7 +12125,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DiscoverBackupWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDeploymentsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -12384,14 +12150,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -12409,13 +12167,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DiscoverBackup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeployments", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -12431,7 +12188,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -12462,12 +12219,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -12518,7 +12269,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -12531,7 +12282,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -12551,11 +12302,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Lists ownership identifiers for domain associated with web app. + /// Get a deployment by its ID for an app, or a deployment slot. /// /// - /// Description for Lists ownership identifiers for domain associated with web - /// app. + /// Description for Get a deployment by its ID for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. @@ -12563,6 +12314,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Deployment ID. + /// /// /// Headers that will be added to request. /// @@ -12584,7 +12338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDomainOwnershipIdentifiersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -12609,6 +12363,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -12626,14 +12384,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDeployment", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -12728,7 +12488,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -12741,7 +12501,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -12761,10 +12521,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get domain ownership identifier for web app. + /// Create a deployment for an app, or a deployment slot. /// /// - /// Description for Get domain ownership identifier for web app. + /// Description for Create a deployment for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -12772,8 +12532,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. + /// + /// ID of an existing deployment. + /// + /// + /// Deployment details. /// /// /// Headers that will be added to request. @@ -12796,7 +12559,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Deployment deployment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -12821,9 +12584,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } + if (deployment == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deployment"); } if (Client.SubscriptionId == null) { @@ -12842,16 +12609,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("id", id); + tracingParameters.Add("deployment", deployment); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifier", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateDeployment", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -12865,7 +12633,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -12896,6 +12664,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(deployment != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deployment, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -12946,7 +12720,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -12959,7 +12733,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -12979,12 +12753,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a domain ownership identifier for web app, or updates an existing - /// ownership identifier. + /// Delete a deployment by its ID for an app, or a deployment slot. /// /// - /// Description for Creates a domain ownership identifier for web app, or - /// updates an existing ownership identifier. + /// Description for Delete a deployment by its ID for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. @@ -12992,11 +12765,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. - /// - /// - /// A JSON representation of the domain ownership properties. + /// + /// Deployment ID. /// /// /// Headers that will be added to request. @@ -13007,9 +12777,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -13019,7 +12786,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteDeploymentWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13044,13 +12811,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } - if (domainOwnershipIdentifier == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (Client.SubscriptionId == null) { @@ -13069,17 +12832,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); - tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); + tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateDomainOwnershipIdentifier", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteDeployment", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -13093,7 +12855,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -13124,12 +12886,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(domainOwnershipIdentifier != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -13150,7 +12906,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -13180,31 +12936,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -13213,10 +12951,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a domain ownership identifier for a web app. + /// List deployment log for specific deployment for an app, or a deployment + /// slot. /// /// - /// Description for Deletes a domain ownership identifier for a web app. + /// Description for List deployment log for specific deployment for an app, or + /// a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -13224,8 +12964,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. + /// + /// The ID of a specific deployment. This is the value of the name property in + /// the JSON response from "GET /api/sites/{siteName}/deployments". /// /// /// Headers that will be added to request. @@ -13236,6 +12977,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -13245,7 +12989,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListDeploymentLogWithHttpMessagesAsync(string resourceGroupName, string name, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13270,9 +13014,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (Client.SubscriptionId == null) { @@ -13291,16 +13035,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteDomainOwnershipIdentifier", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentLog", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -13314,7 +13058,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -13365,7 +13109,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -13395,13 +13139,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -13410,12 +13172,14 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a domain ownership identifier for web app, or updates an existing - /// ownership identifier. + /// Discovers an existing app backup that can be restored from a blob in Azure + /// storage. Use this to get information about the databases stored in a + /// backup. /// /// - /// Description for Creates a domain ownership identifier for web app, or - /// updates an existing ownership identifier. + /// Description for Discovers an existing app backup that can be restored from + /// a blob in Azure storage. Use this to get information about the databases + /// stored in a backup. /// /// /// Name of the resource group to which the resource belongs. @@ -13423,11 +13187,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. - /// - /// - /// A JSON representation of the domain ownership properties. + /// + /// A RestoreRequest object that includes Azure storage URL and blog name for + /// discovery of backup. /// /// /// Headers that will be added to request. @@ -13450,7 +13212,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DiscoverBackupWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13475,13 +13237,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - if (domainOwnershipIdentifier == null) + if (request != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + request.Validate(); } if (Client.SubscriptionId == null) { @@ -13500,17 +13262,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); - tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); + tracingParameters.Add("request", request); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateDomainOwnershipIdentifier", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DiscoverBackup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -13524,7 +13284,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -13555,9 +13315,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(domainOwnershipIdentifier != null) + if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -13611,7 +13371,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -13624,7 +13384,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -13644,16 +13404,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the status of the last MSDeploy operation. + /// Lists ownership identifiers for domain associated with web app. /// /// - /// Description for Get the status of the last MSDeploy operation. + /// Description for Lists ownership identifiers for domain associated with web + /// app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -13676,7 +13437,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMSDeployStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDomainOwnershipIdentifiersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13719,11 +13480,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -13820,7 +13581,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -13833,7 +13594,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -13853,44 +13614,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Get domain ownership identifier for web app. /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Get domain ownership identifier for web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Details of MSDeploy operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateMSDeployOperationWithHttpMessagesAsync(resourceGroupName, name, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Description for Get the MSDeploy Log for the last MSDeploy operation. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Name of the app. /// - /// - /// Name of web app. + /// + /// Name of domain ownership identifier. /// /// /// Headers that will be added to request. @@ -13913,7 +13649,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMSDeployLogWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -13938,6 +13674,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainOwnershipIdentifierName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -13955,14 +13695,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployLog", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifier", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14027,7 +13769,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14057,7 +13799,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -14070,7 +13812,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -14090,16 +13832,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the functions for a web site, or a deployment slot. + /// Creates a domain ownership identifier for web app, or updates an existing + /// ownership identifier. /// /// - /// Description for List the functions for a web site, or a deployment slot. + /// Description for Creates a domain ownership identifier for web app, or + /// updates an existing ownership identifier. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// + /// Name of domain ownership identifier. + /// + /// + /// A JSON representation of the domain ownership properties. /// /// /// Headers that will be added to request. @@ -14122,7 +13872,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -14147,6 +13897,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainOwnershipIdentifierName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } + if (domainOwnershipIdentifier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -14164,14 +13922,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateDomainOwnershipIdentifier", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14185,7 +13946,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -14216,6 +13977,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(domainOwnershipIdentifier != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -14236,7 +14003,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14266,7 +14033,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -14279,7 +14046,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -14299,17 +14066,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Fetch a short lived token that can be exchanged for a master key. + /// Deletes a domain ownership identifier for a web app. /// /// - /// Description for Fetch a short lived token that can be exchanged for a - /// master key. + /// Description for Deletes a domain ownership identifier for a web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Name of domain ownership identifier. /// /// /// Headers that will be added to request. @@ -14320,9 +14089,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -14332,7 +14098,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetFunctionsAdminTokenWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -14357,6 +14123,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainOwnershipIdentifierName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -14374,14 +14144,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetFunctionsAdminToken", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteDomainOwnershipIdentifier", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14395,7 +14167,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -14446,7 +14218,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14476,31 +14248,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -14509,20 +14263,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function information by its ID for web site, or a deployment slot. + /// Creates a domain ownership identifier for web app, or updates an existing + /// ownership identifier. /// /// - /// Description for Get function information by its ID for web site, or a - /// deployment slot. + /// Description for Creates a domain ownership identifier for web app, or + /// updates an existing ownership identifier. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Function name. + /// + /// Name of domain ownership identifier. + /// + /// + /// A JSON representation of the domain ownership properties. /// /// /// Headers that will be added to request. @@ -14545,7 +14303,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDomainOwnershipIdentifierWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -14570,9 +14328,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } + if (domainOwnershipIdentifier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); } if (Client.SubscriptionId == null) { @@ -14591,16 +14353,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetFunction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateDomainOwnershipIdentifier", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14614,7 +14377,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -14645,6 +14408,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(domainOwnershipIdentifier != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -14665,7 +14434,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14695,7 +14464,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -14708,7 +14477,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -14728,50 +14497,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create function for web site, or a deployment slot. - /// - /// - /// Description for Create function for web site, or a deployment slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// - /// - /// Function name. - /// - /// - /// Function details. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateFunctionWithHttpMessagesAsync(resourceGroupName, name, functionName, functionEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Delete a function for web site, or a deployment slot. + /// Get the status of the last MSDeploy operation. /// /// - /// Description for Delete a function for web site, or a deployment slot. + /// Description for Get the status of the last MSDeploy operation. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Function name. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -14782,6 +14517,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -14791,7 +14529,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMSDeployStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -14816,10 +14554,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -14837,16 +14571,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteFunction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployStatus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -14860,7 +14592,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -14911,7 +14643,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -14941,13 +14673,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -14956,25 +14706,44 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Add or update a function secret. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Add or update a function secret. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of web app. /// - /// - /// The name of the function. + /// + /// Details of MSDeploy operation /// - /// - /// The name of the key. + /// + /// The headers that will be added to request. /// - /// - /// The key to create or update + /// + /// The cancellation token. + /// + public async Task> CreateMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateMSDeployOperationWithHttpMessagesAsync(resourceGroupName, name, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. /// /// /// Headers that will be added to request. @@ -14997,7 +14766,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateFunctionSecretWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMSDeployLogWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15022,18 +14791,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (keyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); - } - if (key == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "key"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -15051,19 +14808,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("keyName", keyName); - tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateFunctionSecret", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployLog", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -15077,7 +14829,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15108,12 +14860,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(key != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -15134,7 +14880,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -15164,7 +14910,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -15177,25 +14923,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -15215,10 +14943,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a function secret. + /// List the functions for a web site, or a deployment slot. /// /// - /// Description for Delete a function secret. + /// Description for List the functions for a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -15226,12 +14954,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// The name of the function. - /// - /// - /// The name of the key. - /// /// /// Headers that will be added to request. /// @@ -15241,6 +14963,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -15250,7 +14975,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteFunctionSecretWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15275,14 +15000,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (keyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -15300,18 +15017,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("keyName", keyName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteFunctionSecret", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -15325,7 +15038,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15376,7 +15089,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -15406,13 +15119,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -15421,20 +15152,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function keys for a function in a web site, or a deployment slot. + /// Fetch a short lived token that can be exchanged for a master key. /// /// - /// Description for Get function keys for a function in a web site, or a - /// deployment slot. + /// Description for Fetch a short lived token that can be exchanged for a + /// master key. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Function name. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -15457,7 +15185,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListFunctionKeysWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetFunctionsAdminTokenWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15482,10 +15210,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -15503,16 +15227,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunctionsAdminToken", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -15526,7 +15248,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15607,7 +15329,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -15620,7 +15342,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -15640,10 +15362,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function secrets for a function in a web site, or a deployment slot. + /// Get function information by its ID for web site, or a deployment slot. /// /// - /// Description for Get function secrets for a function in a web site, or a + /// Description for Get function information by its ID for web site, or a /// deployment slot. /// /// @@ -15676,7 +15398,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListFunctionSecretsWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15724,11 +15446,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionSecrets", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); @@ -15745,7 +15467,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -15796,7 +15518,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -15826,7 +15548,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -15839,7 +15561,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -15859,10 +15581,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get host secrets for a function app. + /// Create function for web site, or a deployment slot. /// /// - /// Description for Get host secrets for a function app. + /// Description for Create function for web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -15870,6 +15592,40 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// Function name. + /// + /// + /// Function details. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateFunctionWithHttpMessagesAsync(resourceGroupName, name, functionName, functionEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a function for web site, or a deployment slot. + /// + /// + /// Description for Delete a function for web site, or a deployment slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Function name. + /// /// /// Headers that will be added to request. /// @@ -15879,9 +15635,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -15891,7 +15644,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListHostKeysWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -15916,6 +15669,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -15933,14 +15690,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteFunction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -15954,7 +15713,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16005,7 +15764,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16035,31 +15794,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -16068,16 +15809,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// This is to allow calling via powershell and ARM template. + /// Add or update a function secret. /// /// - /// Description for This is to allow calling via powershell and ARM template. + /// Description for Add or update a function secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// The name of the function. + /// + /// + /// The name of the key. + /// + /// + /// The key to create or update /// /// /// Headers that will be added to request. @@ -16088,6 +15838,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -16097,7 +15850,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ListSyncStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateFunctionSecretWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16122,6 +15875,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } + if (key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "key"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -16139,14 +15904,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyName", keyName); + tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSyncStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateFunctionSecret", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -16160,7 +15930,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16191,6 +15961,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(key != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -16211,7 +15987,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16241,13 +16017,49 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -16256,16 +16068,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Syncs function trigger metadata to the management database + /// Delete a function secret. /// /// - /// Description for Syncs function trigger metadata to the management database + /// Description for Delete a function secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// The name of the function. + /// + /// + /// The name of the key. /// /// /// Headers that will be added to request. @@ -16285,7 +16103,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteFunctionSecretWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16310,6 +16128,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -16327,14 +16153,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncFunctions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteFunctionSecret", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -16348,7 +16178,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16399,7 +16229,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16444,10 +16274,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Add or update a host level secret. + /// Get function keys for a function in a web site, or a deployment slot. /// /// - /// Description for Add or update a host level secret. + /// Description for Get function keys for a function in a web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -16455,14 +16286,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// The type of host key. - /// - /// - /// The name of the key. - /// - /// - /// The key to create or update + /// + /// Function name. /// /// /// Headers that will be added to request. @@ -16485,7 +16310,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHostSecretWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListFunctionKeysWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16510,17 +16335,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (keyType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); - } - if (keyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); - } - if (key == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "key"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (Client.SubscriptionId == null) { @@ -16539,19 +16356,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("keyType", keyType); - tracingParameters.Add("keyName", keyName); - tracingParameters.Add("key", key); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostSecret", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionKeys", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -16565,7 +16379,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16596,12 +16410,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(key != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -16622,7 +16430,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16652,7 +16460,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -16665,25 +16473,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -16703,10 +16493,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a host level secret. + /// Get function secrets for a function in a web site, or a deployment slot. /// /// - /// Description for Delete a host level secret. + /// Description for Get function secrets for a function in a web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -16714,11 +16505,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// The type of host key. - /// - /// - /// The name of the key. + /// + /// Function name. /// /// /// Headers that will be added to request. @@ -16729,6 +16517,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -16738,7 +16529,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHostSecretWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListFunctionSecretsWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16763,13 +16554,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (keyType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); - } - if (keyName == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (Client.SubscriptionId == null) { @@ -16788,18 +16575,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("keyType", keyType); - tracingParameters.Add("keyName", keyName); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHostSecret", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionSecrets", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -16813,7 +16598,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -16864,7 +16649,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -16894,13 +16679,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -16909,16 +16712,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get hostname bindings for an app or a deployment slot. + /// Get host secrets for a function app. /// /// - /// Description for Get hostname bindings for an app or a deployment slot. + /// Description for Get host secrets for a function app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// /// /// Headers that will be added to request. @@ -16941,7 +16744,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListHostNameBindingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListHostKeysWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -16984,11 +16787,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindings", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostKeys", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -17004,7 +16807,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17085,7 +16888,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -17098,7 +16901,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -17118,12 +16921,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the named hostname binding for an app (or deployment slot, if - /// specified). + /// This is to allow calling via powershell and ARM template. /// /// - /// Description for Get the named hostname binding for an app (or deployment - /// slot, if specified). + /// Description for This is to allow calling via powershell and ARM template. /// /// /// Name of the resource group to which the resource belongs. @@ -17131,9 +16932,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Hostname in the hostname binding. - /// /// /// Headers that will be added to request. /// @@ -17143,9 +16941,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -17155,7 +16950,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ListSyncStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -17180,10 +16975,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -17201,16 +16992,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHostNameBinding", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncStatus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17224,7 +17013,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17275,7 +17064,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -17305,31 +17094,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -17338,10 +17109,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a hostname binding for an app. + /// Syncs function trigger metadata to the management database /// /// - /// Description for Creates a hostname binding for an app. + /// Description for Syncs function trigger metadata to the management database /// /// /// Name of the resource group to which the resource belongs. @@ -17349,13 +17120,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Hostname in the hostname binding. - /// - /// - /// Binding details. This is the JSON representation of a HostNameBinding - /// object. - /// /// /// Headers that will be added to request. /// @@ -17365,9 +17129,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -17377,7 +17138,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncFunctionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -17402,14 +17163,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } - if (hostNameBinding == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostNameBinding"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -17427,17 +17180,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostName", hostName); - tracingParameters.Add("hostNameBinding", hostNameBinding); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostNameBinding", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncFunctions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17451,7 +17201,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17482,12 +17232,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(hostNameBinding != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostNameBinding, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -17508,7 +17252,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -17538,31 +17282,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -17571,19 +17297,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a hostname binding for an app. + /// Add or update a host level secret. /// /// - /// Description for Deletes a hostname binding for an app. + /// Description for Add or update a host level secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Hostname in the hostname binding. + /// + /// The type of host key. + /// + /// + /// The name of the key. + /// + /// + /// The key to create or update /// /// /// Headers that will be added to request. @@ -17594,6 +17326,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -17603,7 +17338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHostSecretWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -17628,9 +17363,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostName == null) + if (keyType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } + if (key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "key"); } if (Client.SubscriptionId == null) { @@ -17649,16 +17392,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostName", hostName); + tracingParameters.Add("keyType", keyType); + tracingParameters.Add("keyName", keyName); + tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHostNameBinding", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostSecret", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); + _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17672,7 +17418,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17703,6 +17449,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(key != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -17723,7 +17475,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -17753,13 +17505,49 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -17768,23 +17556,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Retrieves a specific Service Bus Hybrid Connection used by this Web App. + /// Delete a host level secret. /// /// - /// Description for Retrieves a specific Service Bus Hybrid Connection used by - /// this Web App. + /// Description for Delete a host level secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Site name. /// - /// - /// The namespace for this hybrid connection. + /// + /// The type of host key. /// - /// - /// The relay name for this hybrid connection. + /// + /// The name of the key. /// /// /// Headers that will be added to request. @@ -17795,9 +17582,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -17807,7 +17591,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHostSecretWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -17832,13 +17616,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) + if (keyType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); } - if (relayName == null) + if (keyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); } if (Client.SubscriptionId == null) { @@ -17857,18 +17641,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); + tracingParameters.Add("keyType", keyType); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHybridConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHostSecret", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -17882,7 +17666,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -17933,7 +17717,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -17963,31 +17747,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -17996,25 +17762,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new Hybrid Connection using a Service Bus relay. + /// Get hostname bindings for an app or a deployment slot. /// /// - /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Description for Get hostname bindings for an app or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. - /// - /// - /// The relay name for this hybrid connection. - /// - /// - /// The details of the hybrid connection. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -18037,7 +17794,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListHostNameBindingsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18062,18 +17819,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -18091,19 +17836,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHybridConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindings", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18117,7 +17857,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -18148,12 +17888,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -18204,7 +17938,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -18217,7 +17951,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -18237,22 +17971,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Removes a Hybrid Connection from this site. + /// Get the named hostname binding for an app (or deployment slot, if + /// specified). /// /// - /// Description for Removes a Hybrid Connection from this site. + /// Description for Get the named hostname binding for an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. + /// Name of the app. /// - /// - /// The relay name for this hybrid connection. + /// + /// Hostname in the hostname binding. /// /// /// Headers that will be added to request. @@ -18263,6 +17996,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -18272,7 +18008,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18297,13 +18033,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); } if (Client.SubscriptionId == null) { @@ -18322,18 +18054,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHybridConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetHostNameBinding", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18347,7 +18077,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -18398,7 +18128,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -18428,13 +18158,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -18443,25 +18191,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new Hybrid Connection using a Service Bus relay. + /// Creates a hostname binding for an app. /// /// - /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Description for Creates a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. + /// Name of the app. /// - /// - /// The relay name for this hybrid connection. + /// + /// Hostname in the hostname binding. /// - /// - /// The details of the hybrid connection. + /// + /// Binding details. This is the JSON representation of a HostNameBinding + /// object. /// /// /// Headers that will be added to request. @@ -18484,7 +18230,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18509,17 +18255,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); } - if (connectionEnvelope == null) + if (hostNameBinding == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostNameBinding"); } if (Client.SubscriptionId == null) { @@ -18538,19 +18280,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("hostName", hostName); + tracingParameters.Add("hostNameBinding", hostNameBinding); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateHybridConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostNameBinding", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18564,7 +18304,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -18595,9 +18335,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) + if(hostNameBinding != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostNameBinding, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -18651,7 +18391,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -18664,7 +18404,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -18684,17 +18424,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Deletes a hostname binding for an app. /// /// - /// Description for Retrieves all Service Bus Hybrid Connections used by this - /// Web App. + /// Description for Deletes a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. + /// + /// + /// Hostname in the hostname binding. /// /// /// Headers that will be added to request. @@ -18705,9 +18447,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -18717,7 +18456,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListHybridConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHostNameBindingWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18742,6 +18481,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (hostName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -18759,14 +18502,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHybridConnections", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHostNameBinding", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -18780,7 +18525,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -18831,7 +18576,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -18861,31 +18606,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -18894,18 +18621,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets hybrid connections configured for an app (or deployment slot, if - /// specified). + /// Retrieves a specific Service Bus Hybrid Connection used by this Web App. /// /// - /// Description for Gets hybrid connections configured for an app (or - /// deployment slot, if specified). + /// Description for Retrieves a specific Service Bus Hybrid Connection used by + /// this Web App. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. + /// + /// + /// The namespace for this hybrid connection. + /// + /// + /// The relay name for this hybrid connection. /// /// /// Headers that will be added to request. @@ -18928,7 +18660,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListRelayServiceConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -18953,6 +18685,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (namespaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (relayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -18970,14 +18710,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRelayServiceConnections", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetHybridConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19072,7 +18816,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -19085,7 +18829,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -19105,19 +18849,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a hybrid connection configuration by its name. + /// Creates a new Hybrid Connection using a Service Bus relay. /// /// - /// Description for Gets a hybrid connection configuration by its name. + /// Description for Creates a new Hybrid Connection using a Service Bus relay. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of the hybrid connection. + /// + /// The namespace for this hybrid connection. + /// + /// + /// The relay name for this hybrid connection. + /// + /// + /// The details of the hybrid connection. /// /// /// Headers that will be added to request. @@ -19140,7 +18890,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -19165,9 +18915,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (relayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -19186,16 +18944,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetRelayServiceConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHybridConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19209,7 +18970,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -19240,6 +19001,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -19290,7 +19057,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -19303,7 +19070,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -19323,24 +19090,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new hybrid connection configuration (PUT), or updates an existing - /// one (PATCH). + /// Removes a Hybrid Connection from this site. /// /// - /// Description for Creates a new hybrid connection configuration (PUT), or - /// updates an existing one (PATCH). + /// Description for Removes a Hybrid Connection from this site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of the hybrid connection configuration. + /// + /// The namespace for this hybrid connection. /// - /// - /// Details of the hybrid connection configuration. + /// + /// The relay name for this hybrid connection. /// /// /// Headers that will be added to request. @@ -19351,9 +19116,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -19363,7 +19125,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -19388,13 +19150,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (connectionEnvelope == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } if (Client.SubscriptionId == null) { @@ -19413,17 +19175,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateRelayServiceConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHybridConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19437,7 +19200,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -19468,12 +19231,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -19494,7 +19251,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -19524,31 +19281,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -19557,19 +19296,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a relay service connection by its name. + /// Creates a new Hybrid Connection using a Service Bus relay. /// /// - /// Description for Deletes a relay service connection by its name. + /// Description for Creates a new Hybrid Connection using a Service Bus relay. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of the hybrid connection configuration. + /// + /// The namespace for this hybrid connection. + /// + /// + /// The relay name for this hybrid connection. + /// + /// + /// The details of the hybrid connection. /// /// /// Headers that will be added to request. @@ -19580,6 +19325,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -19589,7 +19337,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateHybridConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -19614,9 +19362,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (relayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -19635,16 +19391,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteRelayServiceConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateHybridConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19658,7 +19417,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -19689,6 +19448,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -19709,7 +19474,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -19739,13 +19504,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -19754,24 +19537,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new hybrid connection configuration (PUT), or updates an existing - /// one (PATCH). + /// Retrieves all Service Bus Hybrid Connections used by this Web App. /// /// - /// Description for Creates a new hybrid connection configuration (PUT), or - /// updates an existing one (PATCH). + /// Description for Retrieves all Service Bus Hybrid Connections used by this + /// Web App. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the hybrid connection configuration. - /// - /// - /// Details of the hybrid connection configuration. + /// The name of the web app. /// /// /// Headers that will be added to request. @@ -19794,7 +19570,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListHybridConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -19819,14 +19595,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -19844,17 +19612,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateRelayServiceConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHybridConnections", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -19868,7 +19633,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -19899,12 +19664,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -19955,7 +19714,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -19968,7 +19727,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -19988,10 +19747,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Gets hybrid connections configured for an app (or deployment slot, if + /// specified). /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Gets hybrid connections configured for an app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -20020,7 +19781,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceIdentifiersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListRelayServiceConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20063,11 +19824,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListRelayServiceConnections", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -20164,7 +19925,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -20177,7 +19938,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -20197,10 +19958,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Gets a hybrid connection configuration by its name. /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Gets a hybrid connection configuration by its name. /// /// /// Name of the resource group to which the resource belongs. @@ -20208,7 +19969,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// + /// + /// Name of the hybrid connection. /// /// /// Headers that will be added to request. @@ -20231,7 +19993,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceInfoWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20256,9 +20018,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) + if (entityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); } if (Client.SubscriptionId == null) { @@ -20277,16 +20039,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceInfo", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetRelayServiceConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20381,7 +20143,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -20394,7 +20156,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -20414,19 +20176,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the status of the last MSDeploy operation. + /// Creates a new hybrid connection configuration (PUT), or updates an existing + /// one (PATCH). /// /// - /// Description for Get the status of the last MSDeploy operation. + /// Description for Creates a new hybrid connection configuration (PUT), or + /// updates an existing one (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// ID of web app instance. + /// + /// Name of the hybrid connection configuration. + /// + /// + /// Details of the hybrid connection configuration. /// /// /// Headers that will be added to request. @@ -20449,7 +20216,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceMsDeployStatusWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20474,9 +20241,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) + if (entityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -20495,16 +20266,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("entityName", entityName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMsDeployStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateRelayServiceConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20518,7 +20290,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -20549,6 +20321,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -20599,7 +20377,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -20612,7 +20390,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -20632,50 +20410,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. - /// - /// - /// Description for Invoke the MSDeploy web app extension. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// ID of web app instance. - /// - /// - /// Details of MSDeploy operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateInstanceMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateInstanceMSDeployOperationWithHttpMessagesAsync(resourceGroupName, name, instanceId, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the MSDeploy Log for the last MSDeploy operation. + /// Deletes a relay service connection by its name. /// /// - /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Description for Deletes a relay service connection by its name. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// ID of web app instance. + /// + /// Name of the hybrid connection configuration. /// /// /// Headers that will be added to request. @@ -20686,9 +20433,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -20698,7 +20442,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceMSDeployLogWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20723,9 +20467,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) + if (entityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); } if (Client.SubscriptionId == null) { @@ -20744,16 +20488,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMSDeployLog", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteRelayServiceConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20767,7 +20511,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -20848,31 +20592,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -20881,22 +20607,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Creates a new hybrid connection configuration (PUT), or updates an existing + /// one (PATCH). /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Creates a new hybrid connection configuration (PUT), or + /// updates an existing one (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// Name of the hybrid connection configuration. + /// + /// + /// Details of the hybrid connection configuration. /// /// /// Headers that will be added to request. @@ -20919,7 +20647,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessesWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateRelayServiceConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -20944,9 +20672,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) + if (entityName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -20965,16 +20697,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("entityName", entityName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcesses", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateRelayServiceConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -20988,7 +20721,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -21019,6 +20752,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -21039,7 +20778,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -21069,7 +20808,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -21082,7 +20821,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -21102,25 +20841,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Gets all scale-out instances of an app. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Gets all scale-out instances of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. - /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// Name of the app. /// /// /// Headers that will be added to request. @@ -21143,7 +20873,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceIdentifiersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -21168,14 +20898,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -21193,18 +20915,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -21269,7 +20987,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -21299,7 +21017,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -21312,7 +21030,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -21332,25 +21050,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Terminate a process by its ID for a web site, or a deployment slot, or - /// specific scaled-out instance in a web site. + /// Gets all scale-out instances of an app. /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Gets all scale-out instances of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -21361,6 +21072,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -21370,7 +21084,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteInstanceProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceInfoWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -21395,10 +21109,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -21420,17 +21130,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceProcess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceInfo", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -21445,7 +21153,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -21496,7 +21204,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -21526,13 +21234,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -21541,25 +21267,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a memory dump of a process by its ID for a specific scaled-out instance - /// in a web site. + /// Get the status of the last MSDeploy operation. /// /// - /// Description for Get a memory dump of a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Get the status of the last MSDeploy operation. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of web app. /// /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// ID of web app instance. /// /// /// Headers that will be added to request. @@ -21582,7 +21302,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceMsDeployStatusWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -21607,10 +21327,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -21632,17 +21348,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessDump", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMsDeployStatus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -21700,7 +21414,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -21708,7 +21422,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -21738,7 +21452,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -21748,7 +21462,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -21758,25 +21485,50 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of web app. /// - /// - /// PID. + /// + /// ID of web app instance. + /// + /// + /// Details of MSDeploy operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateInstanceMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateInstanceMSDeployOperationWithHttpMessagesAsync(resourceGroupName, name, instanceId, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. /// /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// ID of web app instance. /// /// /// Headers that will be added to request. @@ -21799,7 +21551,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceMSDeployLogWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -21824,10 +21576,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -21849,17 +21597,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModules", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMSDeployLog", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -21955,7 +21701,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -21968,7 +21714,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -21988,12 +21734,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -22001,12 +21747,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// PID. - /// - /// - /// Module base address. - /// /// /// ID of a specific scaled-out instance. This is the value of the name /// property in the JSON response from "GET api/sites/{siteName}/instances". @@ -22032,7 +21772,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessesWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22057,14 +21797,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (baseAddress == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); - } if (instanceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); @@ -22086,19 +21818,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessModule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcesses", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -22194,7 +21922,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -22207,7 +21935,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -22227,12 +21955,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -22268,7 +21996,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22321,11 +22049,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("processId", processId); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreads", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); @@ -22424,7 +22152,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -22437,7 +22165,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -22457,18 +22185,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Shows whether an app can be cloned to another resource group or - /// subscription. + /// Terminate a process by its ID for a web site, or a deployment slot, or + /// specific scaled-out instance in a web site. /// /// - /// Description for Shows whether an app can be cloned to another resource - /// group or subscription. + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -22479,9 +22214,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -22491,7 +22223,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> IsCloneableWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteInstanceProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22516,6 +22248,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -22533,14 +22273,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "IsCloneable", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceProcess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -22554,7 +22298,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -22605,7 +22349,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -22635,31 +22379,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -22668,16 +22394,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Get a memory dump of a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets existing backups of an app. + /// Description for Get a memory dump of a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -22700,7 +22435,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteBackupsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22725,6 +22460,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -22742,14 +22485,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackups", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessDump", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -22763,7 +22510,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -22806,7 +22553,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -22814,7 +22561,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -22844,7 +22591,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -22854,20 +22601,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -22877,16 +22611,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// This is to allow calling via powershell and ARM template. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for This is to allow calling via powershell and ARM template. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -22909,7 +22652,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSyncFunctionTriggersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -22934,6 +22677,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -22951,14 +22702,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSyncFunctionTriggers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModules", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -22972,7 +22727,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -23023,7 +22778,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -23053,7 +22808,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -23066,7 +22821,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -23086,78 +22841,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a web app. - /// - /// - /// Description for Restores a web app. - /// - /// - /// Azure subscription. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Migration migrationOptions. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> MigrateStorageWithHttpMessagesAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginMigrateStorageWithHttpMessagesAsync(subscriptionName, resourceGroupName, name, migrationOptions, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrates a local (in-app) MySql database to a remote MySql database. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Migrates a local (in-app) MySql database to a remote MySql - /// database. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// MySql migration options. - /// - /// - /// The headers that will be added to request. + /// Site name. /// - /// - /// The cancellation token. + /// + /// PID. /// - public async Task> MigrateMySqlWithHttpMessagesAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginMigrateMySqlWithHttpMessagesAsync(resourceGroupName, name, migrationRequestEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns the status of MySql in app migration, if one is active, and whether - /// or not MySql in app is enabled - /// - /// - /// Description for Returns the status of MySql in app migration, if one is - /// active, and whether or not MySql in app is enabled - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Module base address. /// - /// - /// Name of web app. + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -23180,7 +22885,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMigrateMySqlStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -23205,6 +22910,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (baseAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -23222,14 +22939,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("baseAddress", baseAddress); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMigrateMySqlStatus", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessModule", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -23294,7 +23017,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -23324,7 +23047,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -23337,7 +23060,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -23357,16 +23080,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a Swift Virtual Network connection. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets a Swift Virtual Network connection. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -23389,7 +23121,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -23414,6 +23146,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -23431,14 +23171,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSwiftVirtualNetworkConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreads", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -23503,7 +23247,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -23533,7 +23277,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -23546,7 +23290,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -23566,17 +23310,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. + /// Shows whether an app can be cloned to another resource group or + /// subscription. /// /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. + /// Description for Shows whether an app can be cloned to another resource + /// group or subscription. /// /// /// Name of the resource group to which the resource belongs. @@ -23584,9 +23323,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Properties of the Virtual Network connection. See example. - /// /// /// Headers that will be added to request. /// @@ -23608,7 +23344,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> IsCloneableWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -23633,10 +23369,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -23654,13 +23386,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateSwiftVirtualNetworkConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "IsCloneable", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -23676,7 +23407,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -23707,12 +23438,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -23763,7 +23488,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -23776,7 +23501,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -23796,12 +23521,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a Swift Virtual Network connection from an app (or deployment - /// slot). + /// Gets existing backups of an app. /// /// - /// Description for Deletes a Swift Virtual Network connection from an app (or - /// deployment slot). + /// Description for Gets existing backups of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -23818,6 +23541,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -23827,7 +23553,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSwiftVirtualNetworkWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteBackupsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -23870,11 +23596,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSwiftVirtualNetwork", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackups", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -23890,7 +23616,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -23941,7 +23667,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -23971,13 +23697,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -23986,17 +23730,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. + /// This is to allow calling via powershell and ARM template. /// /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. + /// Description for This is to allow calling via powershell and ARM template. /// /// /// Name of the resource group to which the resource belongs. @@ -24004,9 +23741,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Properties of the Virtual Network connection. See example. - /// /// /// Headers that will be added to request. /// @@ -24028,7 +23762,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSyncFunctionTriggersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24053,10 +23787,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -24074,13 +23804,12 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSwiftVirtualNetworkConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncFunctionTriggers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -24096,7 +23825,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -24127,12 +23856,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -24183,7 +23906,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -24196,7 +23919,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -24216,21 +23939,78 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all network features used by the app (or deployment slot, if - /// specified). + /// Restores a web app. /// /// - /// Description for Gets all network features used by the app (or deployment - /// slot, if specified). + /// Description for Restores a web app. /// + /// + /// Azure subscription. + /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// The type of view. This can either be "summary" or "detailed". + /// + /// Migration migrationOptions. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> MigrateStorageWithHttpMessagesAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginMigrateStorageWithHttpMessagesAsync(subscriptionName, resourceGroupName, name, migrationOptions, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Migrates a local (in-app) MySql database to a remote MySql database. + /// + /// + /// Description for Migrates a local (in-app) MySql database to a remote MySql + /// database. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// MySql migration options. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> MigrateMySqlWithHttpMessagesAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginMigrateMySqlWithHttpMessagesAsync(resourceGroupName, name, migrationRequestEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the status of MySql in app migration, if one is active, and whether + /// or not MySql in app is enabled + /// + /// + /// Description for Returns the status of MySql in app migration, if one is + /// active, and whether or not MySql in app is enabled + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. /// /// /// Headers that will be added to request. @@ -24253,7 +24033,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListNetworkFeaturesWithHttpMessagesAsync(string resourceGroupName, string name, string view, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMigrateMySqlStatusWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24278,10 +24058,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (view == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "view"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -24299,16 +24075,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("view", view); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNetworkFeatures", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMigrateMySqlStatus", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{view}", System.Uri.EscapeDataString(view)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -24373,7 +24147,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -24403,7 +24177,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -24416,7 +24190,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -24436,12 +24210,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Gets a Swift Virtual Network connection. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Gets a Swift Virtual Network connection. /// /// /// Name of the resource group to which the resource belongs. @@ -24449,9 +24221,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// GUID of the operation. - /// /// /// Headers that will be added to request. /// @@ -24473,7 +24242,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSwiftVirtualNetworkConnectionWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24498,10 +24267,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -24519,16 +24284,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSwiftVirtualNetworkConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -24593,7 +24356,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -24623,7 +24386,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -24636,25 +24399,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -24674,26 +24419,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site (To be deprecated). + /// Integrates this Web App with a Virtual Network. This requires that 1) + /// "swiftSupported" is true when doing a GET against this resource, and 2) + /// that the target Subnet has already been delegated, and is not + /// in use by another App Service Plan other than the one this App is in. /// /// - /// Description for Start capturing network packets for the site (To be - /// deprecated). + /// Description for Integrates this Web App with a Virtual Network. This + /// requires that 1) "swiftSupported" is true when doing a GET against this + /// resource, and 2) that the target Subnet has already been delegated, and is + /// not + /// in use by another App Service Plan other than the one this App is in. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). + /// Name of the app. /// - /// - /// The Blob URL to store capture file. + /// + /// Properties of the Virtual Network connection. See example. /// /// /// Headers that will be added to request. @@ -24716,7 +24461,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> StartWebSiteNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -24741,6 +24486,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -24758,31 +24507,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartWebSiteNetworkTrace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -24794,7 +24529,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -24825,6 +24560,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -24875,7 +24616,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -24888,7 +24629,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -24908,50 +24649,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. - /// - /// - /// Description for Start capturing network packets for the site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> StartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stop ongoing capturing network packets for the site. + /// Deletes a Swift Virtual Network connection from an app (or deployment + /// slot). /// /// - /// Description for Stop ongoing capturing network packets for the site. + /// Description for Deletes a Swift Virtual Network connection from an app (or + /// deployment slot). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -24971,7 +24680,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopWebSiteNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSwiftVirtualNetworkWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -25014,11 +24723,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopWebSiteNetworkTrace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSwiftVirtualNetwork", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -25034,7 +24743,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -25085,7 +24794,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25130,12 +24839,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Gets all network features used by the app (or deployment slot, if + /// specified). /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Gets all network features used by the app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -25143,8 +24852,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// GUID of the operation. + /// + /// The type of view. Only "summary" is supported at this time. /// /// /// Headers that will be added to request. @@ -25167,7 +24876,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTracesWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListNetworkFeaturesWithHttpMessagesAsync(string resourceGroupName, string name, string view, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -25192,9 +24901,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) + if (view == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "view"); } if (Client.SubscriptionId == null) { @@ -25213,16 +24922,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); + tracingParameters.Add("view", view); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraces", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNetworkFeatures", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + _url = _url.Replace("{view}", System.Uri.EscapeDataString(view)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -25287,7 +24996,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25317,7 +25026,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -25330,7 +25039,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -25387,7 +25096,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTraceOperationV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -25435,11 +25144,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationV2", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); @@ -25588,238 +25297,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). - /// - /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// GUID of the operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> GetNetworkTracesV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesV2", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Generates a new publishing password for an app (or deployment slot, if - /// specified). + /// Start capturing network packets for the site (To be deprecated). /// /// - /// Description for Generates a new publishing password for an app (or - /// deployment slot, if specified). + /// Description for Start capturing network packets for the site (To be + /// deprecated). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. /// /// /// Headers that will be added to request. @@ -25830,6 +25327,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -25839,7 +25339,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task GenerateNewSitePublishingPasswordWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> StartWebSiteNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -25881,16 +25381,31 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GenerateNewSitePublishingPassword", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartWebSiteNetworkTrace", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -25953,7 +25468,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -25983,13 +25498,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -25998,22 +25531,50 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets perfmon counters for web app. + /// Start capturing network packets for the site. /// /// - /// Description for Gets perfmon counters for web app. + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// The name of the web app. /// - /// - /// Return only usages/metrics specified in the filter. Filter conforms to - /// odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and - /// endTime eq 2014-12-31T23:59:59Z and timeGrain eq - /// duration'[Hour|Minute|Day]'. + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> StartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stop ongoing capturing network packets for the site. + /// + /// + /// Description for Stop ongoing capturing network packets for the site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. /// /// /// Headers that will be added to request. @@ -26024,9 +25585,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -26036,7 +25594,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPerfMonCountersWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopWebSiteNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26078,21 +25636,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCounters", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopWebSiteNetworkTrace", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -26104,7 +25657,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -26155,7 +25708,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -26185,31 +25738,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -26218,16 +25753,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets web app's event logs. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Gets web app's event logs. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// GUID of the operation. /// /// /// Headers that will be added to request. @@ -26250,7 +25790,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSitePhpErrorLogFlagWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTracesWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26275,6 +25815,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -26292,14 +25836,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSitePhpErrorLogFlag", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraces", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -26394,7 +25940,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -26407,7 +25953,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -26427,10 +25973,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the premier add-ons of an app. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Gets the premier add-ons of an app. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -26438,6 +25986,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// GUID of the operation. + /// /// /// Headers that will be added to request. /// @@ -26459,7 +26010,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListPremierAddOnsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTraceOperationV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26484,6 +26035,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -26501,14 +26056,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPremierAddOns", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationV2", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -26573,7 +26130,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -26603,7 +26160,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -26616,7 +26173,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -26636,10 +26211,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named add-on of an app. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Gets a named add-on of an app. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -26647,8 +26224,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Add-on name. + /// + /// GUID of the operation. /// /// /// Headers that will be added to request. @@ -26671,7 +26248,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTracesV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26696,9 +26273,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } if (Client.SubscriptionId == null) { @@ -26717,16 +26294,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPremierAddOn", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesV2", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -26821,7 +26398,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -26834,7 +26411,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -26854,10 +26431,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates a named add-on of an app. + /// Generates a new publishing password for an app (or deployment slot, if + /// specified). /// /// - /// Description for Updates a named add-on of an app. + /// Description for Generates a new publishing password for an app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -26865,12 +26444,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Add-on name. - /// - /// - /// A JSON representation of the edited premier add-on. - /// /// /// Headers that will be added to request. /// @@ -26880,9 +26453,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -26892,7 +26462,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddPremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task GenerateNewSitePublishingPasswordWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -26917,18 +26487,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } - if (premierAddOn == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); - } - if (premierAddOn != null) - { - premierAddOn.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -26946,17 +26504,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); - tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddPremierAddOn", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GenerateNewSitePublishingPassword", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -26970,7 +26525,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27001,12 +26556,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(premierAddOn != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -27027,7 +26576,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -27057,31 +26606,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -27090,19 +26621,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a premier add-on from an app. + /// Gets perfmon counters for web app. /// /// - /// Description for Delete a premier add-on from an app. + /// Description for Gets perfmon counters for web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// Add-on name. + /// + /// Return only usages/metrics specified in the filter. Filter conforms to + /// odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and + /// endTime eq 2014-12-31T23:59:59Z and timeGrain eq + /// duration'[Hour|Minute|Day]'. /// /// /// Headers that will be added to request. @@ -27113,6 +26647,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -27122,7 +26659,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeletePremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPerfMonCountersWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27147,10 +26684,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -27168,22 +26701,25 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeletePremierAddOn", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCounters", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -27191,7 +26727,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27272,13 +26808,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -27287,22 +26841,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates a named add-on of an app. + /// Gets web app's event logs. /// /// - /// Description for Updates a named add-on of an app. + /// Description for Gets web app's event logs. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Add-on name. - /// - /// - /// A JSON representation of the edited premier add-on. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -27325,7 +26873,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdatePremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSitePhpErrorLogFlagWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27350,14 +26898,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } - if (premierAddOn == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -27375,17 +26915,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); - tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdatePremierAddOn", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSitePhpErrorLogFlag", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -27399,7 +26936,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27430,12 +26967,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(premierAddOn != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -27486,7 +27017,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -27499,7 +27030,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -27519,18 +27050,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Gets the premier add-ons of an app. /// /// - /// Description for Gets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Gets the premier add-ons of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -27553,7 +27082,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateAccessWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPremierAddOnsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27596,11 +27125,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateAccess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPremierAddOns", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -27697,7 +27226,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -27710,7 +27239,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -27730,21 +27259,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Sets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Gets a named add-on of an app. /// /// - /// Description for Sets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Gets a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. /// - /// - /// The information for the private access + /// + /// Add-on name. /// /// /// Headers that will be added to request. @@ -27767,7 +27294,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PutPrivateAccessVnetWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -27792,9 +27319,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (access == null) + if (premierAddOnName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "access"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); } if (Client.SubscriptionId == null) { @@ -27813,15 +27340,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("access", access); + tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PutPrivateAccessVnet", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPremierAddOn", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -27835,7 +27363,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -27866,12 +27394,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(access != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(access, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -27922,7 +27444,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -27935,7 +27457,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -27955,18 +27477,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Updates a named add-on of an app. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Updates a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// + /// Add-on name. + /// + /// + /// A JSON representation of the edited premier add-on. /// /// /// Headers that will be added to request. @@ -27989,7 +27515,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AddPremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28014,6 +27540,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (premierAddOnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } + if (premierAddOn == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); + } + if (premierAddOn != null) + { + premierAddOn.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -28031,14 +27569,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcesses", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddPremierAddOn", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28052,7 +27593,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -28083,6 +27624,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(premierAddOn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -28103,7 +27650,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28133,7 +27680,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -28146,7 +27693,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -28166,21 +27713,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Delete a premier add-on from an app. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Delete a premier add-on from an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// Add-on name. /// /// /// Headers that will be added to request. @@ -28191,9 +27736,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -28203,7 +27745,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeletePremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28228,9 +27770,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (premierAddOnName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); } if (Client.SubscriptionId == null) { @@ -28249,16 +27791,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeletePremierAddOn", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28272,7 +27814,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -28323,7 +27865,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28353,31 +27895,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -28386,21 +27910,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Terminate a process by its ID for a web site, or a deployment slot, or - /// specific scaled-out instance in a web site. + /// Updates a named add-on of an app. /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Updates a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// Add-on name. + /// + /// + /// A JSON representation of the edited premier add-on. /// /// /// Headers that will be added to request. @@ -28411,6 +27936,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -28420,7 +27948,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdatePremierAddOnWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28445,9 +27973,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (premierAddOnName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } + if (premierAddOn == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); } if (Client.SubscriptionId == null) { @@ -28466,16 +27998,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteProcess", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdatePremierAddOn", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28489,7 +28022,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -28520,6 +28053,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(premierAddOn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -28540,7 +28079,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28570,13 +28109,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -28585,21 +28142,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a memory dump of a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Get a memory dump of a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// The name of the web app. /// /// /// Headers that will be added to request. @@ -28622,7 +28176,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateAccessWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28647,10 +28201,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -28668,16 +28218,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessDump", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateAccess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28734,7 +28282,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -28742,7 +28290,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28772,7 +28320,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -28782,7 +28330,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -28792,21 +28353,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Sets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Sets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// PID. + /// + /// The information for the private access /// /// /// Headers that will be added to request. @@ -28829,7 +28390,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PutPrivateAccessVnetWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -28854,9 +28415,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (access == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "access"); } if (Client.SubscriptionId == null) { @@ -28875,16 +28436,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("access", access); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessModules", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "PutPrivateAccessVnet", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -28898,7 +28458,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -28929,6 +28489,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(access != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(access, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -28949,7 +28515,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -28979,7 +28545,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -28992,7 +28558,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -29012,24 +28578,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. - /// - /// - /// Module base address. + /// Name of the site. /// /// /// Headers that will be added to request. @@ -29052,7 +28611,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetPrivateEndpointConnectionListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29077,14 +28636,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (baseAddress == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -29102,18 +28653,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessModule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionList", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -29178,7 +28725,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -29208,7 +28755,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -29221,7 +28768,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -29241,21 +28788,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets a private endpoint connection /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. /// - /// - /// PID. + /// + /// Name of the private endpoint connection. /// /// /// Headers that will be added to request. @@ -29278,7 +28823,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29303,9 +28848,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } if (Client.SubscriptionId == null) { @@ -29324,16 +28869,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreads", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -29398,7 +28943,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -29428,7 +28973,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -29441,7 +28986,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -29461,16 +29006,72 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get public certificates for an app or a deployment slot. + /// Approves or rejects a private endpoint connection /// /// - /// Description for Get public certificates for an app or a deployment slot. + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. /// /// /// Headers that will be added to request. @@ -29493,7 +29094,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublicCertificatesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29536,11 +29137,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificates", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -29637,7 +29238,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -29650,7 +29251,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -29670,21 +29271,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the named public certificate for an app (or deployment slot, if - /// specified). + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Get the named public certificate for an app (or deployment - /// slot, if specified). + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Public certificate name. + /// Site name. /// /// /// Headers that will be added to request. @@ -29707,7 +29305,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29732,10 +29330,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publicCertificateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -29753,16 +29347,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPublicCertificate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcesses", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -29827,7 +29419,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -29857,7 +29449,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -29870,7 +29462,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -29890,23 +29482,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a hostname binding for an app. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Creates a hostname binding for an app. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Public certificate name. + /// Site name. /// - /// - /// Public certificate details. This is the JSON representation of a - /// PublicCertificate object. + /// + /// PID. /// /// /// Headers that will be added to request. @@ -29929,7 +29519,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdatePublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -29954,13 +29544,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publicCertificateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); - } - if (publicCertificate == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificate"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (Client.SubscriptionId == null) { @@ -29979,17 +29565,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publicCertificateName", publicCertificateName); - tracingParameters.Add("publicCertificate", publicCertificate); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdatePublicCertificate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -30003,7 +29588,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30034,12 +29619,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(publicCertificate != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publicCertificate, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -30060,7 +29639,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30090,7 +29669,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -30103,7 +29682,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -30123,19 +29702,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a hostname binding for an app. + /// Terminate a process by its ID for a web site, or a deployment slot, or + /// specific scaled-out instance in a web site. /// /// - /// Description for Deletes a hostname binding for an app. + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Public certificate name. + /// + /// PID. /// /// /// Headers that will be added to request. @@ -30155,7 +29736,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeletePublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteProcessWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -30180,9 +29761,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publicCertificateName == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (Client.SubscriptionId == null) { @@ -30201,16 +29782,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publicCertificateName", publicCertificateName); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeletePublicCertificate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteProcess", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -30275,7 +29856,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30320,21 +29901,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the publishing profile for an app (or deployment slot, if specified). + /// Get a memory dump of a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets the publishing profile for an app (or deployment slot, - /// if specified). + /// Description for Get a memory dump of a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Specifies publishingProfileOptions for publishing profile. For example, use - /// {"format": "FileZilla3"} to get a FileZilla publishing profile. + /// + /// PID. /// /// /// Headers that will be added to request. @@ -30357,7 +29938,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListPublishingProfileXmlWithSecretsWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessDumpWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -30382,9 +29963,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publishingProfileOptions == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publishingProfileOptions"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (Client.SubscriptionId == null) { @@ -30403,15 +29984,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publishingProfileOptions", publishingProfileOptions); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublishingProfileXmlWithSecrets", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessDump", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -30425,7 +30007,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30456,12 +30038,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(publishingProfileOptions != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publishingProfileOptions, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -30482,7 +30058,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30532,18 +30108,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Resets the configuration settings of the current slot if they were - /// previously modified by calling the API with POST. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Resets the configuration settings of the current slot if - /// they were previously modified by calling the API with POST. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. /// /// /// Headers that will be added to request. @@ -30554,6 +30133,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -30563,7 +30145,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ResetProductionSlotConfigWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessModulesWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -30588,6 +30170,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -30605,14 +30191,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ResetProductionSlotConfig", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessModules", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -30626,7 +30214,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30677,7 +30265,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30707,13 +30295,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -30722,24 +30328,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restarts an app (or deployment slot, if specified). + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Restarts an app (or deployment slot, if specified). + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Specify true to apply the configuration settings and restarts the app only - /// if necessary. By default, the API always restarts and reprovisions the app. + /// + /// PID. /// - /// - /// Specify true to block until the app is restarted. By default, it is set to - /// false, and the API responds immediately (asynchronous). + /// + /// Module base address. /// /// /// Headers that will be added to request. @@ -30750,6 +30356,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -30759,7 +30368,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string name, bool? softRestart = default(bool?), bool? synchronous = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessModuleWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -30784,6 +30393,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (baseAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -30801,26 +30418,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("softRestart", softRestart); - tracingParameters.Add("synchronous", synchronous); + tracingParameters.Add("processId", processId); + tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Restart", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessModule", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (softRestart != null) - { - _queryParameters.Add(string.Format("softRestart={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softRestart, Client.SerializationSettings).Trim('"')))); - } - if (synchronous != null) - { - _queryParameters.Add(string.Format("synchronous={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(synchronous, Client.SerializationSettings).Trim('"')))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -30832,7 +30443,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -30883,7 +30494,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -30913,13 +30524,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -30928,96 +30557,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores an app from a backup blob in Azure Storage. - /// - /// - /// Description for Restores an app from a backup blob in Azure Storage. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Information on restore request . - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreFromBackupBlobWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreFromBackupBlobWithHttpMessagesAsync(resourceGroupName, name, request, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Restores a deleted web app to this web app. - /// - /// - /// Description for Restores a deleted web app to this web app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Deleted web app restore information. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreFromDeletedAppWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreFromDeletedAppWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Restores a web app from a snapshot. - /// - /// - /// Description for Restores a web app from a snapshot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Snapshot restore settings. Snapshot information can be obtained by calling - /// GetDeletedSites or GetSiteSnapshots API. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreSnapshotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get list of siteextensions for a web site, or a deployment slot. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Get list of siteextensions for a web site, or a deployment - /// slot. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -31025,6 +30570,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// PID. + /// /// /// Headers that will be added to request. /// @@ -31046,7 +30594,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteExtensionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessThreadsWithHttpMessagesAsync(string resourceGroupName, string name, string processId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31071,6 +30619,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -31088,14 +30640,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensions", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreads", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -31190,7 +30744,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -31203,7 +30757,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -31223,21 +30777,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get site extension information by its ID for a web site, or a deployment - /// slot. + /// Get public certificates for an app or a deployment slot. /// /// - /// Description for Get site extension information by its ID for a web site, or - /// a deployment slot. + /// Description for Get public certificates for an app or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Site extension name. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -31260,7 +30809,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPublicCertificatesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31285,10 +30834,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -31306,16 +30851,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSiteExtension", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificates", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -31380,7 +30923,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -31410,7 +30953,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -31423,7 +30966,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -31443,48 +30986,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Install site extension on a web site, or a deployment slot. - /// - /// - /// Description for Install site extension on a web site, or a deployment slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// - /// - /// Site extension name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> InstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginInstallSiteExtensionWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Remove a site extension from a web site, or a deployment slot. + /// Get the named public certificate for an app (or deployment slot, if + /// specified). /// /// - /// Description for Remove a site extension from a web site, or a deployment - /// slot. + /// Description for Get the named public certificate for an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Site extension name. + /// + /// Public certificate name. /// /// /// Headers that will be added to request. @@ -31495,6 +31011,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -31504,7 +31023,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31529,9 +31048,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) + if (publicCertificateName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); } if (Client.SubscriptionId == null) { @@ -31550,16 +31069,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSiteExtension", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPublicCertificate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -31573,7 +31092,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -31624,7 +31143,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -31654,13 +31173,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -31669,11 +31206,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Copies a deployment slot to another deployment slot of an app. + /// Creates a hostname binding for an app. /// /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. + /// Description for Creates a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. @@ -31681,34 +31217,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task CopyProductionSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginCopyProductionSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets an app's deployment slots. - /// - /// - /// Description for Gets an app's deployment slots. - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Public certificate name. /// - /// - /// Name of the app. + /// + /// Public certificate details. This is the JSON representation of a + /// PublicCertificate object. /// /// /// Headers that will be added to request. @@ -31731,7 +31245,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSlotsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdatePublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31756,6 +31270,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (publicCertificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } + if (publicCertificate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificate"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -31773,14 +31295,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("publicCertificateName", publicCertificateName); + tracingParameters.Add("publicCertificate", publicCertificate); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlots", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdatePublicCertificate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -31794,7 +31319,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -31825,6 +31350,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(publicCertificate != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publicCertificate, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -31875,7 +31406,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -31888,7 +31419,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -31908,10 +31439,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the details of a web, mobile, or API app. + /// Deletes a hostname binding for an app. /// /// - /// Description for Gets the details of a web, mobile, or API app. + /// Description for Deletes a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. @@ -31919,9 +31450,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the deployment slot. By default, this API returns the production - /// slot. + /// + /// Public certificate name. /// /// /// Headers that will be added to request. @@ -31932,9 +31462,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -31944,7 +31471,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeletePublicCertificateWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -31969,9 +31496,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (publicCertificateName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); } if (Client.SubscriptionId == null) { @@ -31990,16 +31517,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); + tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeletePublicCertificate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -32013,7 +31540,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -32064,7 +31591,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -32094,31 +31621,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -32127,64 +31636,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new web, mobile, or API app in an existing resource group, or - /// updates an existing app. - /// - /// - /// Description for Creates a new web, mobile, or API app in an existing - /// resource group, or updates an existing app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Unique name of the app to create or update. To create or update a - /// deployment slot, use the {slot} parameter. - /// - /// - /// A JSON representation of the app properties. See example. - /// - /// - /// Name of the deployment slot to create or update. By default, this API - /// attempts to create or modify the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateSlotWithHttpMessagesAsync(resourceGroupName, name, siteEnvelope, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a web, mobile, or API app, or one of the deployment slots. + /// Gets the publishing profile for an app (or deployment slot, if specified). /// /// - /// Description for Deletes a web, mobile, or API app, or one of the deployment - /// slots. + /// Description for Gets the publishing profile for an app (or deployment slot, + /// if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app to delete. - /// - /// - /// Name of the deployment slot to delete. By default, the API deletes the - /// production slot. - /// - /// - /// If true, web app metrics are also deleted. + /// Name of the app. /// - /// - /// Specify true if the App Service plan will be empty after app deletion and - /// you want to delete the empty App Service plan. By default, the empty App - /// Service plan is not deleted. + /// + /// Specifies publishingProfileOptions for publishing profile. For example, use + /// {"format": "FileZilla3"} to get a FileZilla publishing profile. /// /// /// Headers that will be added to request. @@ -32195,6 +31661,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -32204,7 +31673,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, bool? deleteMetrics = default(bool?), bool? deleteEmptyServerFarm = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPublishingProfileXmlWithSecretsWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -32229,9 +31698,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (publishingProfileOptions == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "publishingProfileOptions"); } if (Client.SubscriptionId == null) { @@ -32250,28 +31719,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("deleteMetrics", deleteMetrics); - tracingParameters.Add("deleteEmptyServerFarm", deleteEmptyServerFarm); + tracingParameters.Add("publishingProfileOptions", publishingProfileOptions); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublishingProfileXmlWithSecrets", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (deleteMetrics != null) - { - _queryParameters.Add(string.Format("deleteMetrics={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteMetrics, Client.SerializationSettings).Trim('"')))); - } - if (deleteEmptyServerFarm != null) - { - _queryParameters.Add(string.Format("deleteEmptyServerFarm={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteEmptyServerFarm, Client.SerializationSettings).Trim('"')))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -32283,7 +31741,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -32314,6 +31772,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(publishingProfileOptions != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publishingProfileOptions, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -32326,7 +31790,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -32334,7 +31798,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -32364,13 +31828,18 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -32379,26 +31848,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new web, mobile, or API app in an existing resource group, or - /// updates an existing app. + /// Resets the configuration settings of the current slot if they were + /// previously modified by calling the API with POST. /// /// - /// Description for Creates a new web, mobile, or API app in an existing - /// resource group, or updates an existing app. + /// Description for Resets the configuration settings of the current slot if + /// they were previously modified by calling the API with POST. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Unique name of the app to create or update. To create or update a - /// deployment slot, use the {slot} parameter. - /// - /// - /// A JSON representation of the app properties. See example. - /// - /// - /// Name of the deployment slot to create or update. By default, this API - /// attempts to create or modify the production slot. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -32409,9 +31870,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -32421,7 +31879,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, SitePatchResource siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ResetProductionSlotConfigWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -32446,14 +31904,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -32471,17 +31921,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteEnvelope", siteEnvelope); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ResetProductionSlotConfig", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -32495,7 +31942,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -32526,12 +31973,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -32552,7 +31993,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -32582,49 +32023,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -32633,23 +32038,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Analyze a custom hostname. + /// Restarts an app (or deployment slot, if specified). /// /// - /// Description for Analyze a custom hostname. + /// Description for Restarts an app (or deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// + /// Specify true to apply the configuration settings and restarts the app only + /// if necessary. By default, the API always restarts and reprovisions the app. /// - /// - /// Custom hostname. + /// + /// Specify true to block until the app is restarted. By default, it is set to + /// false, and the API responds immediately (asynchronous). /// /// /// Headers that will be added to request. @@ -32660,9 +32066,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -32672,7 +32075,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AnalyzeCustomHostnameSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string name, bool? softRestart = default(bool?), bool? synchronous = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -32697,10 +32100,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -32718,22 +32117,25 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("hostName", hostName); + tracingParameters.Add("softRestart", softRestart); + tracingParameters.Add("synchronous", synchronous); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AnalyzeCustomHostnameSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Restart", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (hostName != null) + if (softRestart != null) { - _queryParameters.Add(string.Format("hostName={0}", System.Uri.EscapeDataString(hostName))); + _queryParameters.Add(string.Format("softRestart={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softRestart, Client.SerializationSettings).Trim('"')))); + } + if (synchronous != null) + { + _queryParameters.Add(string.Format("synchronous={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(synchronous, Client.SerializationSettings).Trim('"')))); } if (Client.ApiVersion != null) { @@ -32746,7 +32148,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -32827,31 +32229,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -32860,12 +32244,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Applies the configuration settings from the target slot onto the current - /// slot. + /// Restores an app from a backup blob in Azure Storage. /// /// - /// Description for Applies the configuration settings from the target slot - /// onto the current slot. + /// Description for Restores an app from a backup blob in Azure Storage. /// /// /// Name of the resource group to which the resource belongs. @@ -32873,12 +32255,91 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON object that contains the target slot name. See example. + /// + /// Information on restore request . /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFromBackupBlobWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFromBackupBlobWithHttpMessagesAsync(resourceGroupName, name, request, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores a deleted web app to this web app. + /// + /// + /// Description for Restores a deleted web app to this web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Deleted web app restore information. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFromDeletedAppWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFromDeletedAppWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores a web app from a snapshot. + /// + /// + /// Description for Restores a web app from a snapshot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Snapshot restore settings. Snapshot information can be obtained by calling + /// GetDeletedSites or GetSiteSnapshots API. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreSnapshotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get list of siteextensions for a web site, or a deployment slot. + /// + /// + /// Description for Get list of siteextensions for a web site, or a deployment + /// slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. /// /// /// Headers that will be added to request. @@ -32889,6 +32350,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -32898,7 +32362,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ApplySlotConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteExtensionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -32923,18 +32387,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); - } - if (slotSwapEntity != null) - { - slotSwapEntity.Validate(); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -32952,17 +32404,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ApplySlotConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensions", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -32976,7 +32425,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -33007,12 +32456,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -33033,7 +32476,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -33063,13 +32506,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -33078,24 +32539,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a backup of an app. + /// Get site extension information by its ID for a web site, or a deployment + /// slot. /// /// - /// Description for Creates a backup of an app. + /// Description for Get site extension information by its ID for a web site, or + /// a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Backup configuration. You can use the JSON response from the POST action as - /// input here. + /// Site name. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// create a backup for the production slot. + /// + /// Site extension name. /// /// /// Headers that will be added to request. @@ -33118,7 +32576,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33143,17 +32601,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } - if (slot == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (Client.SubscriptionId == null) { @@ -33172,17 +32622,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); - tracingParameters.Add("slot", slot); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BackupSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteExtension", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -33196,7 +32645,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -33227,12 +32676,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -33253,7 +32696,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -33283,7 +32726,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -33296,7 +32739,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -33316,20 +32759,48 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Install site extension on a web site, or a deployment slot. /// /// - /// Description for Gets existing backups of an app. + /// Description for Install site extension on a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// backups of the production slot. + /// + /// Site extension name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> InstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginInstallSiteExtensionWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Remove a site extension from a web site, or a deployment slot. + /// + /// + /// Description for Remove a site extension from a web site, or a deployment + /// slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Site extension name. /// /// /// Headers that will be added to request. @@ -33340,9 +32811,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -33352,7 +32820,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBackupsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33377,9 +32845,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (Client.SubscriptionId == null) { @@ -33398,16 +32866,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBackupsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSiteExtension", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -33421,7 +32889,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -33472,7 +32940,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -33502,31 +32970,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -33535,10 +32985,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a backup of an app by its ID. + /// Gets an app's deployment slots. /// /// - /// Description for Gets a backup of an app by its ID. + /// Description for Gets an app's deployment slots. /// /// /// Name of the resource group to which the resource belongs. @@ -33546,13 +32996,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// ID of the backup. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get a - /// backup of the production slot. - /// /// /// Headers that will be added to request. /// @@ -33574,7 +33017,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetBackupStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSlotsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33599,14 +33042,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -33624,18 +33059,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetBackupStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlots", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -33730,7 +33161,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -33743,7 +33174,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -33763,10 +33194,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a backup of an app by its ID. + /// Gets the details of a web, mobile, or API app. /// /// - /// Description for Deletes a backup of an app by its ID. + /// Description for Gets the details of a web, mobile, or API app. /// /// /// Name of the resource group to which the resource belongs. @@ -33774,12 +33205,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// ID of the backup. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete a backup of the production slot. + /// Name of the deployment slot. By default, this API returns the production + /// slot. /// /// /// Headers that will be added to request. @@ -33790,6 +33218,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -33799,7 +33230,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteBackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -33824,10 +33255,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -33849,17 +33276,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteBackupSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -33874,7 +33299,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -33955,13 +33380,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -33970,32 +33413,63 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets status of a web app backup that may be in progress, including secrets - /// associated with the backup, such as the Azure Storage SAS URL. Also can be - /// used to update the SAS URL for the backup if a new URL is passed in the - /// request body. + /// Creates a new web, mobile, or API app in an existing resource group, or + /// updates an existing app. /// /// - /// Description for Gets status of a web app backup that may be in progress, - /// including secrets associated with the backup, such as the Azure Storage SAS - /// URL. Also can be used to update the SAS URL for the backup if a new URL is - /// passed in the request body. + /// Description for Creates a new web, mobile, or API app in an existing + /// resource group, or updates an existing app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Unique name of the app to create or update. To create or update a + /// deployment slot, use the {slot} parameter. /// - /// - /// ID of backup. + /// + /// A JSON representation of the app properties. See example. /// - /// - /// Information on backup request. + /// + /// Name of the deployment slot to create or update. By default, this API + /// attempts to create or modify the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateSlotWithHttpMessagesAsync(resourceGroupName, name, siteEnvelope, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a web, mobile, or API app, or one of the deployment slots. + /// + /// + /// Description for Deletes a web, mobile, or API app, or one of the deployment + /// slots. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app to delete. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot to delete. By default, the API deletes the + /// production slot. + /// + /// + /// If true, web app metrics are also deleted. + /// + /// + /// Specify false if you want to keep empty App Service plan. By default, empty + /// App Service plan is deleted. /// /// /// Headers that will be added to request. @@ -34006,9 +33480,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -34018,7 +33489,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListBackupStatusSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, bool? deleteMetrics = default(bool?), bool? deleteEmptyServerFarm = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34043,18 +33514,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); - } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -34076,21 +33535,28 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); - tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); + tracingParameters.Add("deleteMetrics", deleteMetrics); + tracingParameters.Add("deleteEmptyServerFarm", deleteEmptyServerFarm); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBackupStatusSecretsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (deleteMetrics != null) + { + _queryParameters.Add(string.Format("deleteMetrics={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteMetrics, Client.SerializationSettings).Trim('"')))); + } + if (deleteEmptyServerFarm != null) + { + _queryParameters.Add(string.Format("deleteEmptyServerFarm={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteEmptyServerFarm, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -34102,7 +33568,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -34133,12 +33599,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -34159,7 +33619,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -34189,31 +33649,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -34222,57 +33664,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a specific backup to another app (or deployment slot, if - /// specified). + /// Creates a new web, mobile, or API app in an existing resource group, or + /// updates an existing app. /// /// - /// Description for Restores a specific backup to another app (or deployment - /// slot, if specified). + /// Description for Creates a new web, mobile, or API app in an existing + /// resource group, or updates an existing app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// ID of the backup. - /// - /// - /// Information on restore request . - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restore a backup of the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreSlotWithHttpMessagesAsync(resourceGroupName, name, backupId, request, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// List the configurations of an app - /// - /// - /// Description for List the configurations of an app - /// - /// - /// Name of the resource group to which the resource belongs. + /// Unique name of the app to create or update. To create or update a + /// deployment slot, use the {slot} parameter. /// - /// - /// Name of the app. + /// + /// A JSON representation of the app properties. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// Name of the deployment slot to create or update. By default, this API + /// attempts to create or modify the production slot. /// /// /// Headers that will be added to request. @@ -34295,7 +33706,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, SitePatchResource siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34320,6 +33731,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -34341,13 +33756,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteEnvelope", siteEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -34364,7 +33780,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -34395,6 +33811,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -34415,7 +33837,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -34445,7 +33867,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -34458,7 +33880,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -34478,23 +33918,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the application settings of an app. + /// Analyze a custom hostname. /// /// - /// Description for Replaces the application settings of an app. + /// Description for Analyze a custom hostname. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Application settings of the app. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the application settings for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// Custom hostname. /// /// /// Headers that will be added to request. @@ -34517,7 +33957,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateApplicationSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AnalyzeCustomHostnameSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34542,10 +33982,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (appSettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -34567,19 +34003,23 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("slot", slot); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateApplicationSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AnalyzeCustomHostnameSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (hostName != null) + { + _queryParameters.Add(string.Format("hostName={0}", System.Uri.EscapeDataString(hostName))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -34591,7 +34031,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -34622,12 +34062,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(appSettings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -34678,7 +34112,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -34691,7 +34125,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -34711,10 +34145,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the application settings of an app. + /// Applies the configuration settings from the target slot onto the current + /// slot. /// /// - /// Description for Gets the application settings of an app. + /// Description for Applies the configuration settings from the target slot + /// onto the current slot. /// /// /// Name of the resource group to which the resource belongs. @@ -34722,9 +34158,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// JSON object that contains the target slot name. See example. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the application settings for the production slot. + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. /// /// /// Headers that will be added to request. @@ -34735,9 +34174,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -34747,7 +34183,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListApplicationSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ApplySlotConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34772,6 +34208,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slotSwapEntity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -34793,13 +34237,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListApplicationSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ApplySlotConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -34847,6 +34292,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -34897,31 +34348,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -34930,25 +34363,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the Authentication / Authorization settings associated with web - /// app. + /// Creates a backup of an app. /// /// - /// Description for Updates the Authentication / Authorization settings - /// associated with web app. + /// Description for Creates a backup of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Auth settings associated with web app. + /// + /// Backup configuration. You can use the JSON response from the POST action as + /// input here. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// create a backup for the production slot. /// /// /// Headers that will be added to request. @@ -34971,7 +34403,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -34996,9 +34428,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteAuthSettings == null) + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteAuthSettings"); + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); } if (slot == null) { @@ -35021,14 +34457,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteAuthSettings", siteAuthSettings); + tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAuthSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BackupSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -35045,7 +34481,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -35076,9 +34512,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteAuthSettings != null) + if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteAuthSettings, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -35132,7 +34568,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -35145,7 +34581,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -35165,10 +34601,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Authentication/Authorization settings of an app. + /// Gets existing backups of an app. /// /// - /// Description for Gets the Authentication/Authorization settings of an app. + /// Description for Gets existing backups of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -35178,7 +34614,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. + /// backups of the production slot. /// /// /// Headers that will be added to request. @@ -35201,7 +34637,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBackupsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -35249,11 +34685,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAuthSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBackupsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -35270,7 +34706,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -35351,7 +34787,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -35364,7 +34800,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -35384,25 +34820,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates site's Authentication / Authorization settings for apps via the V2 - /// format + /// Gets a backup of an app by its ID. /// /// - /// Description for Updates site's Authentication / Authorization settings for - /// apps via the V2 format + /// Description for Gets a backup of an app by its ID. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Auth settings associated with web app. + /// + /// ID of the backup. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will get a + /// backup of the production slot. /// /// /// Headers that will be added to request. @@ -35425,7 +34859,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetBackupStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -35450,9 +34884,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteAuthSettingsV2 == null) + if (backupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteAuthSettingsV2"); + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); } if (slot == null) { @@ -35475,16 +34909,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteAuthSettingsV2", siteAuthSettingsV2); + tracingParameters.Add("backupId", backupId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAuthSettingsV2Slot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetBackupStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -35499,7 +34934,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -35530,12 +34965,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteAuthSettingsV2 != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteAuthSettingsV2, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -35586,7 +35015,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -35599,7 +35028,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -35619,12 +35048,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets site's Authentication / Authorization settings for apps via the V2 - /// format + /// Deletes a backup of an app by its ID. /// /// - /// Description for Gets site's Authentication / Authorization settings for - /// apps via the V2 format + /// Description for Deletes a backup of an app by its ID. /// /// /// Name of the resource group to which the resource belongs. @@ -35632,9 +35059,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// ID of the backup. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the settings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete a backup of the production slot. /// /// /// Headers that will be added to request. @@ -35645,9 +35075,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -35657,7 +35084,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteBackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -35682,6 +35109,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (backupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -35703,15 +35134,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("backupId", backupId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAuthSettingsV2Slot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteBackupSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -35726,7 +35159,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -35777,7 +35210,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -35807,31 +35240,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -35840,23 +35255,32 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the Azure storage account configurations of an app. + /// Gets status of a web app backup that may be in progress, including secrets + /// associated with the backup, such as the Azure Storage SAS URL. Also can be + /// used to update the SAS URL for the backup if a new URL is passed in the + /// request body. /// /// - /// Description for Updates the Azure storage account configurations of an app. + /// Description for Gets status of a web app backup that may be in progress, + /// including secrets associated with the backup, such as the Azure Storage SAS + /// URL. Also can be used to update the SAS URL for the backup if a new URL is + /// passed in the request body. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// Azure storage accounts of the app. + /// + /// ID of backup. + /// + /// + /// Information on backup request. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -35879,7 +35303,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListBackupStatusSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -35904,9 +35328,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (azureStorageAccounts == null) + if (backupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "azureStorageAccounts"); + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); } if (slot == null) { @@ -35929,16 +35361,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("azureStorageAccounts", azureStorageAccounts); + tracingParameters.Add("backupId", backupId); + tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAzureStorageAccountsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBackupStatusSecretsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -35953,7 +35387,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -35984,9 +35418,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(azureStorageAccounts != null) + if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(azureStorageAccounts, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -36040,7 +35474,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -36053,7 +35487,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -36073,10 +35507,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Azure storage account configurations of an app. + /// Restores a specific backup to another app (or deployment slot, if + /// specified). /// /// - /// Description for Gets the Azure storage account configurations of an app. + /// Description for Restores a specific backup to another app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -36084,9 +35520,44 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// ID of the backup. + /// + /// + /// Information on restore request . + /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. + /// restore a backup of the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreSlotWithHttpMessagesAsync(resourceGroupName, name, backupId, request, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + /// given site. + /// + /// + /// Description for Returns whether Scm basic auth is allowed and whether Ftp + /// is allowed for a given site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// /// /// /// Headers that will be added to request. @@ -36109,7 +35580,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetBasicPublishingCredentialsPoliciesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36157,11 +35628,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAzureStorageAccountsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetBasicPublishingCredentialsPoliciesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -36178,7 +35649,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -36259,7 +35730,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -36272,7 +35743,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -36292,10 +35763,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the backup configuration of an app. + /// Returns whether FTP is allowed on the site or not. /// /// - /// Description for Updates the backup configuration of an app. + /// Description for Returns whether FTP is allowed on the site or not. /// /// /// Name of the resource group to which the resource belongs. @@ -36303,12 +35774,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Edited backup configuration. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -36331,7 +35797,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetFtpAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36356,14 +35822,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -36385,14 +35843,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateBackupConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFtpAllowedSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -36409,7 +35866,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -36440,12 +35897,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -36496,7 +35947,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -36509,7 +35960,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -36529,10 +35980,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes the backup configuration of an app. + /// Updates whether FTP is allowed on the site or not. /// /// - /// Description for Deletes the backup configuration of an app. + /// Description for Updates whether FTP is allowed on the site or not. /// /// /// Name of the resource group to which the resource belongs. @@ -36540,9 +35991,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -36553,6 +36004,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -36562,7 +36016,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateFtpAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36587,6 +36041,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (csmPublishingAccessPoliciesEntity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "csmPublishingAccessPoliciesEntity"); + } + if (csmPublishingAccessPoliciesEntity != null) + { + csmPublishingAccessPoliciesEntity.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -36608,13 +36070,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("csmPublishingAccessPoliciesEntity", csmPublishingAccessPoliciesEntity); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteBackupConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateFtpAllowedSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -36631,7 +36094,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -36662,6 +36125,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(csmPublishingAccessPoliciesEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(csmPublishingAccessPoliciesEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -36712,13 +36181,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -36727,10 +36214,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the backup configuration of an app. + /// Returns whether Scm basic auth is allowed on the site or not. /// /// - /// Description for Gets the backup configuration of an app. + /// Description for Returns whether Scm basic auth is allowed on the site or + /// not. /// /// /// Name of the resource group to which the resource belongs. @@ -36739,8 +36227,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -36763,7 +36249,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetScmAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -36811,11 +36297,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetBackupConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetScmAllowedSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -36832,7 +36318,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -36913,7 +36399,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -36926,7 +36412,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -36946,10 +36432,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the connection strings of an app. + /// Updates whether user publishing credentials are allowed on the site or not. /// /// - /// Description for Replaces the connection strings of an app. + /// Description for Updates whether user publishing credentials are allowed on + /// the site or not. /// /// /// Name of the resource group to which the resource belongs. @@ -36957,12 +36444,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Connection strings of the app or deployment slot. See example. + /// /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the connection settings for the production slot. /// /// /// Headers that will be added to request. @@ -36985,7 +36469,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateConnectionStringsSlotWithHttpMessagesAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateScmAllowedSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37010,9 +36494,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionStrings == null) + if (csmPublishingAccessPoliciesEntity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionStrings"); + throw new ValidationException(ValidationRules.CannotBeNull, "csmPublishingAccessPoliciesEntity"); + } + if (csmPublishingAccessPoliciesEntity != null) + { + csmPublishingAccessPoliciesEntity.Validate(); } if (slot == null) { @@ -37035,14 +36523,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionStrings", connectionStrings); + tracingParameters.Add("csmPublishingAccessPoliciesEntity", csmPublishingAccessPoliciesEntity); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateConnectionStringsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateScmAllowedSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37090,9 +36578,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionStrings != null) + if(csmPublishingAccessPoliciesEntity != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionStrings, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(csmPublishingAccessPoliciesEntity, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -37146,7 +36634,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37159,7 +36647,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -37179,10 +36667,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the connection strings of an app. + /// List the configurations of an app /// /// - /// Description for Gets the connection strings of an app. + /// Description for List the configurations of an app /// /// /// Name of the resource group to which the resource belongs. @@ -37191,8 +36679,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the connection settings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -37215,7 +36703,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListConnectionStringsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37263,11 +36751,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStringsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37284,7 +36772,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -37365,7 +36853,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37378,7 +36866,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -37398,10 +36886,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the logging configuration of an app. + /// Replaces the application settings of an app. /// /// - /// Description for Gets the logging configuration of an app. + /// Description for Replaces the application settings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -37409,9 +36897,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Application settings of the app. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the logging configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the application settings for the production slot. /// /// /// Headers that will be added to request. @@ -37434,7 +36925,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDiagnosticLogsConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateApplicationSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary appSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37459,6 +36950,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (appSettings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "appSettings"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -37480,13 +36975,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("appSettings", appSettings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticLogsConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateApplicationSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37503,7 +36999,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -37534,6 +37030,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(appSettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(appSettings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -37584,7 +37086,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37597,7 +37099,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -37617,10 +37119,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the logging configuration of an app. + /// Gets the application settings of an app. /// /// - /// Description for Updates the logging configuration of an app. + /// Description for Gets the application settings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -37628,13 +37130,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// A SiteLogsConfig JSON object that contains the logging configuration to - /// change in the "properties" property. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the logging configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the application settings for the production slot. /// /// /// Headers that will be added to request. @@ -37657,7 +37155,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateDiagnosticLogsConfigSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListApplicationSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37682,14 +37180,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteLogsConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteLogsConfig"); - } - if (siteLogsConfig != null) - { - siteLogsConfig.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -37711,14 +37201,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteLogsConfig", siteLogsConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateDiagnosticLogsConfigSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListApplicationSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37735,7 +37224,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -37766,12 +37255,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteLogsConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteLogsConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -37822,7 +37305,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -37835,7 +37318,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -37855,23 +37338,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Replaces the metadata of an app. + /// Updates the Authentication / Authorization settings associated with web + /// app. /// /// - /// Description for Replaces the metadata of an app. + /// Description for Updates the Authentication / Authorization settings + /// associated with web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// Edited metadata of the app or deployment slot. See example. + /// + /// Auth settings associated with web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the metadata for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -37894,7 +37379,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateMetadataSlotWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary metadata, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettings siteAuthSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -37919,9 +37404,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (metadata == null) + if (siteAuthSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteAuthSettings"); } if (slot == null) { @@ -37944,14 +37429,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("metadata", metadata); + tracingParameters.Add("siteAuthSettings", siteAuthSettings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateMetadataSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAuthSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -37999,9 +37484,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(metadata != null) + if(siteAuthSettings != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteAuthSettings, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -38055,7 +37540,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38068,7 +37553,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -38088,10 +37573,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the metadata of an app. + /// Gets the Authentication/Authorization settings of an app. /// /// - /// Description for Gets the metadata of an app. + /// Description for Gets the Authentication/Authorization settings of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -38101,7 +37586,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// /// Name of the deployment slot. If a slot is not specified, the API will get - /// the metadata for the production slot. + /// the settings for the production slot. /// /// /// Headers that will be added to request. @@ -38124,7 +37609,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListMetadataSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAuthSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38172,11 +37657,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListMetadataSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAuthSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -38274,7 +37759,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38287,7 +37772,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -38307,39 +37792,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Git/FTP publishing credentials of an app. - /// - /// - /// Description for Gets the Git/FTP publishing credentials of an app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the publishing credentials for the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ListPublishingCredentialsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginListPublishingCredentialsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates the Push settings associated with web app. + /// Updates site's Authentication / Authorization settings for apps via the V2 + /// format /// /// - /// Description for Updates the Push settings associated with web app. + /// Description for Updates site's Authentication / Authorization settings for + /// apps via the V2 format /// /// /// Name of the resource group to which the resource belongs. @@ -38347,8 +37805,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of web app. /// - /// - /// Push settings associated with web app. + /// + /// Auth settings associated with web app. /// /// /// Name of web app slot. If not specified then will default to production @@ -38375,7 +37833,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSitePushSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, PushSettings pushSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteAuthSettingsV2 siteAuthSettingsV2, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38400,13 +37858,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (pushSettings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "pushSettings"); - } - if (pushSettings != null) + if (siteAuthSettingsV2 == null) { - pushSettings.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "siteAuthSettingsV2"); } if (slot == null) { @@ -38429,14 +37883,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("pushSettings", pushSettings); + tracingParameters.Add("siteAuthSettingsV2", siteAuthSettingsV2); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSitePushSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAuthSettingsV2Slot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -38484,9 +37938,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(pushSettings != null) + if(siteAuthSettingsV2 != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pushSettings, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteAuthSettingsV2, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -38540,7 +37994,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38553,7 +38007,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -38573,20 +38027,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Push settings associated with web app. + /// Gets site's Authentication / Authorization settings for apps via the V2 + /// format /// /// - /// Description for Gets the Push settings associated with web app. + /// Description for Gets site's Authentication / Authorization settings for + /// apps via the V2 format /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the settings for the production slot. /// /// /// Headers that will be added to request. @@ -38609,7 +38065,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSitePushSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAuthSettingsV2SlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38657,11 +38113,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSitePushSettingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAuthSettingsV2Slot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -38678,7 +38134,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -38759,7 +38215,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38772,7 +38228,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -38792,12 +38248,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the configuration of an app, such as platform version and bitness, - /// default documents, virtual applications, Always On, etc. + /// Updates the Azure storage account configurations of an app. /// /// - /// Description for Gets the configuration of an app, such as platform version - /// and bitness, default documents, virtual applications, Always On, etc. + /// Description for Updates the Azure storage account configurations of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -38805,9 +38259,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Azure storage accounts of the app. + /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// update the Azure storage account configurations for the production slot. /// /// /// Headers that will be added to request. @@ -38830,7 +38287,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, AzureStoragePropertyDictionaryResource azureStorageAccounts, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -38855,6 +38312,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (azureStorageAccounts == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "azureStorageAccounts"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -38876,13 +38337,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("azureStorageAccounts", azureStorageAccounts); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAzureStorageAccountsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -38899,7 +38361,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -38930,6 +38392,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(azureStorageAccounts != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(azureStorageAccounts, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -38980,7 +38448,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -38993,7 +38461,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -39013,10 +38481,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the configuration of an app. + /// Gets the Azure storage account configurations of an app. /// /// - /// Description for Updates the configuration of an app. + /// Description for Gets the Azure storage account configurations of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -39024,12 +38492,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteConfig object. See example. - /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// update configuration for the production slot. + /// update the Azure storage account configurations for the production slot. /// /// /// Headers that will be added to request. @@ -39052,7 +38517,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListAzureStorageAccountsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39077,14 +38542,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteConfig == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); - } - if (siteConfig != null) - { - siteConfig.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -39106,14 +38563,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAzureStorageAccountsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -39130,7 +38586,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -39161,12 +38617,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteConfig != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -39217,7 +38667,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -39230,7 +38680,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -39250,10 +38700,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the configuration of an app. + /// Updates the backup configuration of an app. /// /// - /// Description for Updates the configuration of an app. + /// Description for Updates the backup configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -39261,12 +38711,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteConfig object. See example. + /// + /// Edited backup configuration. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// update configuration for the production slot. + /// update the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -39289,7 +38739,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, BackupRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39314,9 +38764,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteConfig == null) + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); } if (slot == null) { @@ -39339,14 +38793,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteConfig", siteConfig); + tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateBackupConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -39363,7 +38817,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -39394,9 +38848,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteConfig != null) + if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -39450,7 +38904,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -39463,7 +38917,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -39483,12 +38937,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a list of web app configuration snapshots identifiers. Each element of - /// the list contains a timestamp and the ID of the snapshot. + /// Deletes the backup configuration of an app. /// /// - /// Description for Gets a list of web app configuration snapshots identifiers. - /// Each element of the list contains a timestamp and the ID of the snapshot. + /// Description for Deletes the backup configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -39498,7 +38950,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// delete the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -39509,9 +38961,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -39521,7 +38970,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationSnapshotInfoSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39569,11 +39018,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteBackupConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -39590,7 +39039,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -39671,31 +39120,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -39704,11 +39135,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a snapshot of the configuration of an app at a previous point in time. + /// Gets the backup configuration of an app. /// /// - /// Description for Gets a snapshot of the configuration of an app at a - /// previous point in time. + /// Description for Gets the backup configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -39716,12 +39146,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of the snapshot to read. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the backup configuration for the production slot. /// /// /// Headers that will be added to request. @@ -39744,7 +39171,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetConfigurationSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetBackupConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39769,10 +39196,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (snapshotId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -39794,17 +39217,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSnapshotSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetBackupConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -39819,7 +39240,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -39900,7 +39321,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -39913,7 +39334,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -39933,10 +39354,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Reverts the configuration of an app to a previous snapshot. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Reverts the configuration of an app to a previous snapshot. + /// Description for Gets the config reference app settings and status of an app /// /// /// Name of the resource group to which the resource belongs. @@ -39944,12 +39365,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of the snapshot to read. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -39960,6 +39376,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -39969,7 +39388,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RecoverSiteConfigurationSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetAppSettingsKeyVaultReferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -39994,10 +39413,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (snapshotId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -40019,17 +39434,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RecoverSiteConfigurationSnapshotSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingsKeyVaultReferencesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -40044,7 +39457,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -40095,7 +39508,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -40125,13 +39538,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -40140,20 +39571,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the last lines of docker logs for the given site + /// Gets the config reference and status of an app /// /// - /// Description for Gets the last lines of docker logs for the given site + /// Description for Gets the config reference and status of an app /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// App Setting key name. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. /// /// /// Headers that will be added to request. @@ -40161,7 +39593,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -40176,7 +39608,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWebSiteContainerLogsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAppSettingKeyVaultReferenceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string appSettingKey, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40201,6 +39633,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (appSettingKey == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "appSettingKey"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -40222,15 +39658,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("appSettingKey", appSettingKey); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebSiteContainerLogsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingKeyVaultReferenceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings/{appSettingKey}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{appSettingKey}", System.Uri.EscapeDataString(appSettingKey)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -40245,7 +39683,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -40288,7 +39726,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -40296,16 +39734,15 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -40315,10 +39752,6 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -40331,7 +39764,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -40341,7 +39774,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -40351,20 +39797,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the ZIP archived docker log files for the given site + /// Gets the config reference app settings and status of an app /// /// - /// Description for Gets the ZIP archived docker log files for the given site + /// Description for Gets the config reference app settings and status of an app /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. /// /// /// Headers that will be added to request. @@ -40372,7 +39816,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -40387,7 +39831,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContainerLogsZipSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetSiteConnectionStringKeyVaultReferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40435,11 +39879,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetContainerLogsZipSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReferencesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -40456,7 +39900,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -40499,7 +39943,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -40507,16 +39951,15 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -40526,10 +39969,6 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -40542,7 +39981,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -40552,7 +39991,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -40562,20 +40014,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List continuous web jobs for an app, or a deployment slot. + /// Gets the config reference and status of an app /// /// - /// Description for List continuous web jobs for an app, or a deployment slot. + /// Description for Gets the config reference and status of an app /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -40598,7 +40050,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListContinuousWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSiteConnectionStringKeyVaultReferenceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string connectionStringKey, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40623,6 +40075,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (connectionStringKey == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionStringKey"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -40644,15 +40100,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("connectionStringKey", connectionStringKey); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReferenceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings/{connectionStringKey}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{connectionStringKey}", System.Uri.EscapeDataString(connectionStringKey)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -40748,7 +40206,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -40761,7 +40219,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -40781,24 +40239,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a continuous web job by its ID for an app, or a deployment slot. + /// Replaces the connection strings of an app. /// /// - /// Description for Gets a continuous web job by its ID for an app, or a - /// deployment slot. + /// Description for Replaces the connection strings of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// Connection strings of the app or deployment slot. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the connection settings for the production slot. /// /// /// Headers that will be added to request. @@ -40821,7 +40278,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateConnectionStringsSlotWithHttpMessagesAsync(string resourceGroupName, string name, ConnectionStringDictionary connectionStrings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -40846,9 +40303,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (connectionStrings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionStrings"); } if (slot == null) { @@ -40871,17 +40328,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("connectionStrings", connectionStrings); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetContinuousWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateConnectionStringsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -40896,7 +40352,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -40927,6 +40383,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionStrings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionStrings, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -40947,7 +40409,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -40977,7 +40439,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -40990,7 +40452,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -41010,24 +40472,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a continuous web job by its ID for an app, or a deployment slot. + /// Gets the connection strings of an app. /// /// - /// Description for Delete a continuous web job by its ID for an app, or a - /// deployment slot. + /// Description for Gets the connection strings of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the connection settings for the production slot. /// /// /// Headers that will be added to request. @@ -41038,6 +40496,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -41047,7 +40508,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListConnectionStringsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41072,10 +40533,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -41097,17 +40554,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteContinuousWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStringsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -41122,7 +40577,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -41173,7 +40628,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -41203,13 +40658,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -41218,24 +40691,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start a continuous web job for an app, or a deployment slot. + /// Gets the logging configuration of an app. /// /// - /// Description for Start a continuous web job for an app, or a deployment - /// slot. + /// Description for Gets the logging configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the logging configuration for the production slot. /// /// /// Headers that will be added to request. @@ -41246,6 +40715,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -41255,7 +40727,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDiagnosticLogsConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41280,10 +40752,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -41305,17 +40773,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartContinuousWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDiagnosticLogsConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -41330,7 +40796,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -41381,7 +40847,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -41411,13 +40877,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -41426,23 +40910,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Stop a continuous web job for an app, or a deployment slot. + /// Updates the logging configuration of an app. /// /// - /// Description for Stop a continuous web job for an app, or a deployment slot. + /// Description for Updates the logging configuration of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// A SiteLogsConfig JSON object that contains the logging configuration to + /// change in the "properties" property. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the logging configuration for the production slot. /// /// /// Headers that will be added to request. @@ -41453,6 +40938,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -41462,7 +40950,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDiagnosticLogsConfigSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteLogsConfig siteLogsConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41487,9 +40975,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (siteLogsConfig == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteLogsConfig"); + } + if (siteLogsConfig != null) + { + siteLogsConfig.Validate(); } if (slot == null) { @@ -41512,17 +41004,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("siteLogsConfig", siteLogsConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopContinuousWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateDiagnosticLogsConfigSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -41537,7 +41028,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -41568,6 +41059,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteLogsConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteLogsConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -41588,7 +41085,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -41618,13 +41115,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -41633,10 +41148,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployments for an app, or a deployment slot. + /// Replaces the metadata of an app. /// /// - /// Description for List deployments for an app, or a deployment slot. + /// Description for Replaces the metadata of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -41644,9 +41159,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Edited metadata of the app or deployment slot. See example. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the metadata for the production slot. /// /// /// Headers that will be added to request. @@ -41669,7 +41187,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDeploymentsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateMetadataSlotWithHttpMessagesAsync(string resourceGroupName, string name, StringDictionary metadata, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41694,6 +41212,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (metadata == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -41715,13 +41237,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("metadata", metadata); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateMetadataSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -41738,7 +41261,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -41769,6 +41292,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(metadata != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -41819,7 +41348,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -41832,7 +41361,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -41852,11 +41381,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a deployment by its ID for an app, or a deployment slot. + /// Gets the metadata of an app. /// /// - /// Description for Get a deployment by its ID for an app, or a deployment - /// slot. + /// Description for Gets the metadata of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -41864,12 +41392,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Deployment ID. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the metadata for the production slot. /// /// /// Headers that will be added to request. @@ -41892,7 +41417,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListMetadataSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -41917,10 +41442,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -41942,17 +41463,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDeploymentSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListMetadataSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -41967,7 +41486,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -42048,7 +41567,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -42061,7 +41580,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -42081,10 +41600,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create a deployment for an app, or a deployment slot. + /// Gets the Git/FTP publishing credentials of an app. /// /// - /// Description for Create a deployment for an app, or a deployment slot. + /// Description for Gets the Git/FTP publishing credentials of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -42092,15 +41611,41 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// ID of an existing deployment. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API creates a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the publishing credentials for the production slot. /// - /// - /// Deployment details. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListPublishingCredentialsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListPublishingCredentialsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the Push settings associated with web app. + /// + /// + /// Description for Updates the Push settings associated with web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Push settings associated with web app. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -42123,7 +41668,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Deployment deployment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSitePushSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, PushSettings pushSettings, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -42148,17 +41693,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) + if (pushSettings == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "pushSettings"); } - if (slot == null) + if (pushSettings != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + pushSettings.Validate(); } - if (deployment == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "deployment"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -42177,18 +41722,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); + tracingParameters.Add("pushSettings", pushSettings); tracingParameters.Add("slot", slot); - tracingParameters.Add("deployment", deployment); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateDeploymentSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSitePushSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -42234,9 +41777,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(deployment != null) + if(pushSettings != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deployment, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pushSettings, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -42290,7 +41833,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -42303,7 +41846,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -42323,24 +41866,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a deployment by its ID for an app, or a deployment slot. + /// Gets the Push settings associated with web app. /// /// - /// Description for Delete a deployment by its ID for an app, or a deployment - /// slot. + /// Description for Gets the Push settings associated with web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Deployment ID. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -42351,6 +41890,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -42360,7 +41902,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSitePushSettingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -42385,10 +41927,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -42410,17 +41948,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteDeploymentSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSitePushSettingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -42435,7 +41971,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -42486,7 +42022,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -42516,13 +42052,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -42531,12 +42085,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployment log for specific deployment for an app, or a deployment - /// slot. + /// Gets the configuration of an app, such as platform version and bitness, + /// default documents, virtual applications, Always On, etc. /// /// - /// Description for List deployment log for specific deployment for an app, or - /// a deployment slot. + /// Description for Gets the configuration of an app, such as platform version + /// and bitness, default documents, virtual applications, Always On, etc. /// /// /// Name of the resource group to which the resource belongs. @@ -42544,13 +42098,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// The ID of a specific deployment. This is the value of the name property in - /// the JSON response from "GET /api/sites/{siteName}/deployments". - /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -42573,7 +42123,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListDeploymentLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -42598,10 +42148,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -42623,17 +42169,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentLogSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -42729,7 +42273,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -42742,7 +42286,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -42762,14 +42306,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Discovers an existing app backup that can be restored from a blob in Azure - /// storage. Use this to get information about the databases stored in a - /// backup. + /// Updates the configuration of an app. /// /// - /// Description for Discovers an existing app backup that can be restored from - /// a blob in Azure storage. Use this to get information about the databases - /// stored in a backup. + /// Description for Updates the configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -42777,13 +42317,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// A RestoreRequest object that includes Azure storage URL and blog name for - /// discovery of backup. + /// + /// JSON representation of a SiteConfig object. See example. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// perform discovery for the production slot. + /// update configuration for the production slot. /// /// /// Headers that will be added to request. @@ -42806,7 +42345,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DiscoverBackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -42831,13 +42370,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) + if (siteConfig == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); } - if (request != null) + if (siteConfig != null) { - request.Validate(); + siteConfig.Validate(); } if (slot == null) { @@ -42860,14 +42399,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); + tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DiscoverBackupSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -42884,7 +42423,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -42915,9 +42454,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) + if(siteConfig != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -42971,7 +42510,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -42984,7 +42523,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -43004,11 +42543,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Lists ownership identifiers for domain associated with web app. + /// Updates the configuration of an app. /// /// - /// Description for Lists ownership identifiers for domain associated with web - /// app. + /// Description for Updates the configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -43016,9 +42554,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// JSON representation of a SiteConfig object. See example. + /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// update configuration for the production slot. /// /// /// Headers that will be added to request. @@ -43041,7 +42582,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDomainOwnershipIdentifiersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteConfigResource siteConfig, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43066,6 +42607,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (siteConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteConfig"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -43087,13 +42632,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("siteConfig", siteConfig); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -43110,7 +42656,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -43141,6 +42687,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteConfig, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -43191,7 +42743,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -43204,7 +42756,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -43224,10 +42776,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get domain ownership identifier for web app. + /// Gets a list of web app configuration snapshots identifiers. Each element of + /// the list contains a timestamp and the ID of the snapshot. /// /// - /// Description for Get domain ownership identifier for web app. + /// Description for Gets a list of web app configuration snapshots identifiers. + /// Each element of the list contains a timestamp and the ID of the snapshot. /// /// /// Name of the resource group to which the resource belongs. @@ -43235,12 +42789,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. - /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -43263,7 +42814,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationSnapshotInfoSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43288,10 +42839,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -43313,17 +42860,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifierSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -43419,7 +42964,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -43432,7 +42977,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -43452,12 +42997,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a domain ownership identifier for web app, or updates an existing - /// ownership identifier. + /// Gets a snapshot of the configuration of an app at a previous point in time. /// /// - /// Description for Creates a domain ownership identifier for web app, or - /// updates an existing ownership identifier. + /// Description for Gets a snapshot of the configuration of an app at a + /// previous point in time. /// /// /// Name of the resource group to which the resource belongs. @@ -43465,15 +43009,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. - /// - /// - /// A JSON representation of the domain ownership properties. + /// + /// The ID of the snapshot to read. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -43496,7 +43037,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetConfigurationSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43521,13 +43062,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } - if (domainOwnershipIdentifier == null) + if (snapshotId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); } if (slot == null) { @@ -43550,18 +43087,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); - tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); + tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateDomainOwnershipIdentifierSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetConfigurationSnapshotSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); + _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -43576,7 +43112,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -43607,12 +43143,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(domainOwnershipIdentifier != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -43663,7 +43193,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -43676,7 +43206,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -43696,10 +43226,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a domain ownership identifier for a web app. + /// Reverts the configuration of an app to a previous snapshot. /// /// - /// Description for Deletes a domain ownership identifier for a web app. + /// Description for Reverts the configuration of an app to a previous snapshot. /// /// /// Name of the resource group to which the resource belongs. @@ -43707,12 +43237,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of domain ownership identifier. + /// + /// The ID of the snapshot to read. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// return configuration for the production slot. /// /// /// Headers that will be added to request. @@ -43732,7 +43262,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RecoverSiteConfigurationSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, string snapshotId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43757,9 +43287,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) + if (snapshotId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotId"); } if (slot == null) { @@ -43782,17 +43312,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("snapshotId", snapshotId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteDomainOwnershipIdentifierSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RecoverSiteConfigurationSnapshotSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); + _url = _url.Replace("{snapshotId}", System.Uri.EscapeDataString(snapshotId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -43807,7 +43337,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -43858,7 +43388,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -43903,28 +43433,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a domain ownership identifier for web app, or updates an existing - /// ownership identifier. + /// Gets the last lines of docker logs for the given site /// /// - /// Description for Creates a domain ownership identifier for web app, or - /// updates an existing ownership identifier. + /// Description for Gets the last lines of docker logs for the given site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of domain ownership identifier. - /// - /// - /// A JSON representation of the domain ownership properties. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -43932,7 +43454,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -43947,7 +43469,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWebSiteContainerLogsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -43972,14 +43494,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (domainOwnershipIdentifierName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); - } - if (domainOwnershipIdentifier == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -44001,18 +43515,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); - tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateDomainOwnershipIdentifierSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebSiteContainerLogsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44027,7 +43538,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -44058,12 +43569,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(domainOwnershipIdentifier != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -44076,7 +43581,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -44084,15 +43589,16 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -44102,6 +43608,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -44114,7 +43624,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -44124,20 +43634,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -44147,10 +43644,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the status of the last MSDeploy operation. + /// Gets the ZIP archived docker log files for the given site /// /// - /// Description for Get the status of the last MSDeploy operation. + /// Description for Gets the ZIP archived docker log files for the given site /// /// /// Name of the resource group to which the resource belongs. @@ -44168,7 +43665,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -44183,7 +43680,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMSDeployStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContainerLogsZipSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44231,11 +43728,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetContainerLogsZipSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -44252,7 +43749,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -44295,7 +43792,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -44303,15 +43800,16 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -44321,6 +43819,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -44333,7 +43835,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -44343,20 +43845,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -44366,52 +43855,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. - /// - /// - /// Description for Invoke the MSDeploy web app extension. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// Details of MSDeploy operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateMSDeployOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the MSDeploy Log for the last MSDeploy operation. + /// List continuous web jobs for an app, or a deployment slot. /// /// - /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Description for List continuous web jobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -44434,7 +43891,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMSDeployLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListContinuousWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44482,11 +43939,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployLogSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -44554,7 +44011,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -44584,7 +44041,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -44597,7 +44054,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -44617,10 +44074,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the functions for a web site, or a deployment slot. + /// Gets a continuous web job by its ID for an app, or a deployment slot. /// /// - /// Description for List the functions for a web site, or a deployment slot. + /// Description for Gets a continuous web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -44628,8 +44086,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// + /// + /// Name of Web Job. + /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -44652,7 +44114,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceFunctionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44677,6 +44139,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -44698,15 +44164,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceFunctionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetContinuousWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44802,7 +44270,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -44815,7 +44283,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -44835,21 +44303,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Fetch a short lived token that can be exchanged for a master key. + /// Delete a continuous web job by its ID for an app, or a deployment slot. /// /// - /// Description for Fetch a short lived token that can be exchanged for a - /// master key. + /// Description for Delete a continuous web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. + /// + /// + /// Name of Web Job. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -44860,9 +44331,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -44872,7 +44340,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetFunctionsAdminTokenSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -44897,6 +44365,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -44918,15 +44390,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetFunctionsAdminTokenSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteContinuousWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -44941,7 +44415,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -44992,7 +44466,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -45022,31 +44496,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -45055,11 +44511,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function information by its ID for web site, or a deployment slot. + /// Start a continuous web job for an app, or a deployment slot. /// /// - /// Description for Get function information by its ID for web site, or a - /// deployment slot. + /// Description for Start a continuous web job for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. @@ -45067,11 +44523,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Function name. + /// + /// Name of Web Job. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -45082,9 +44539,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -45094,7 +44548,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StartContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -45119,9 +44573,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (slot == null) { @@ -45144,17 +44598,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceFunctionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartContinuousWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45169,7 +44623,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -45250,31 +44704,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -45283,44 +44719,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create function for web site, or a deployment slot. - /// - /// - /// Description for Create function for web site, or a deployment slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// - /// - /// Function name. - /// - /// - /// Name of the deployment slot. - /// - /// - /// Function details. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateInstanceFunctionSlotWithHttpMessagesAsync(resourceGroupName, name, functionName, slot, functionEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Delete a function for web site, or a deployment slot. + /// Stop a continuous web job for an app, or a deployment slot. /// /// - /// Description for Delete a function for web site, or a deployment slot. + /// Description for Stop a continuous web job for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -45328,11 +44730,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Function name. + /// + /// Name of Web Job. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -45352,7 +44755,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopContinuousWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -45377,9 +44780,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (slot == null) { @@ -45402,17 +44805,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceFunctionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopContinuousWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45427,7 +44830,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -45478,7 +44881,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -45523,28 +44926,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Add or update a function secret. + /// List deployments for an app, or a deployment slot. /// /// - /// Description for Add or update a function secret. + /// Description for List deployments for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// The name of the function. - /// - /// - /// The name of the key. + /// Name of the app. /// /// - /// Name of the deployment slot. - /// - /// - /// The key to create or update + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -45567,7 +44962,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateFunctionSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDeploymentsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -45592,22 +44987,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (keyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (key == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "key"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -45625,20 +45008,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); - tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateFunctionSecretSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45653,7 +45031,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -45684,12 +45062,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(key != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -45710,7 +45082,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -45740,7 +45112,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -45753,25 +45125,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -45791,25 +45145,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a function secret. + /// Get a deployment by its ID for an app, or a deployment slot. /// /// - /// Description for Delete a function secret. + /// Description for Get a deployment by its ID for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// The name of the function. + /// Name of the app. /// - /// - /// The name of the key. + /// + /// Deployment ID. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API gets a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -45820,6 +45173,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -45829,7 +45185,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteFunctionSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -45854,13 +45210,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (keyName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (slot == null) { @@ -45883,19 +45235,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("keyName", keyName); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteFunctionSecretSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDeploymentSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -45910,7 +45260,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -45961,7 +45311,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -45991,13 +45341,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -46006,23 +45374,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function keys for a function in a web site, or a deployment slot. + /// Create a deployment for an app, or a deployment slot. /// /// - /// Description for Get function keys for a function in a web site, or a - /// deployment slot. + /// Description for Create a deployment for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Function name. + /// + /// ID of an existing deployment. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API creates a + /// deployment for the production slot. + /// + /// + /// Deployment details. /// /// /// Headers that will be added to request. @@ -46045,7 +45416,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListFunctionKeysSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Deployment deployment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46070,14 +45441,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (deployment == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deployment"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -46095,17 +45470,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); + tracingParameters.Add("deployment", deployment); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionKeysSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateDeploymentSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -46120,7 +45496,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -46151,6 +45527,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(deployment != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deployment, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -46201,7 +45583,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -46214,7 +45596,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -46234,23 +45616,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get function secrets for a function in a web site, or a deployment slot. + /// Delete a deployment by its ID for an app, or a deployment slot. /// /// - /// Description for Get function secrets for a function in a web site, or a - /// deployment slot. + /// Description for Delete a deployment by its ID for an app, or a deployment + /// slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Function name. + /// + /// Deployment ID. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -46261,9 +45644,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -46273,7 +45653,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListFunctionSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteDeploymentSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46298,9 +45678,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) + if (id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (slot == null) { @@ -46323,17 +45703,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionSecretsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteDeploymentSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -46348,7 +45728,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -46399,7 +45779,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -46429,31 +45809,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -46462,19 +45824,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get host secrets for a function app. + /// List deployment log for specific deployment for an app, or a deployment + /// slot. /// /// - /// Description for Get host secrets for a function app. + /// Description for List deployment log for specific deployment for an app, or + /// a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// + /// The ID of a specific deployment. This is the value of the name property in + /// the JSON response from "GET /api/sites/{siteName}/deployments". /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -46497,7 +45866,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListHostKeysSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListDeploymentLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46522,6 +45891,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -46543,15 +45916,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("id", id); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostKeysSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentLogSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -46566,7 +45941,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -46647,7 +46022,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -46660,7 +46035,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -46680,10 +46055,14 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// This is to allow calling via powershell and ARM template. + /// Discovers an existing app backup that can be restored from a blob in Azure + /// storage. Use this to get information about the databases stored in a + /// backup. /// /// - /// Description for This is to allow calling via powershell and ARM template. + /// Description for Discovers an existing app backup that can be restored from + /// a blob in Azure storage. Use this to get information about the databases + /// stored in a backup. /// /// /// Name of the resource group to which the resource belongs. @@ -46691,8 +46070,13 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// A RestoreRequest object that includes Azure storage URL and blog name for + /// discovery of backup. + /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// perform discovery for the production slot. /// /// /// Headers that will be added to request. @@ -46703,6 +46087,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -46712,7 +46099,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ListSyncStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DiscoverBackupSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46737,6 +46124,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -46758,13 +46153,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("request", request); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSyncStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DiscoverBackupSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -46812,6 +46208,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -46832,7 +46234,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -46862,13 +46264,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -46877,10 +46297,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Syncs function trigger metadata to the management database + /// Lists ownership identifiers for domain associated with web app. /// /// - /// Description for Syncs function trigger metadata to the management database + /// Description for Lists ownership identifiers for domain associated with web + /// app. /// /// /// Name of the resource group to which the resource belongs. @@ -46889,7 +46310,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -46900,6 +46322,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -46909,7 +46334,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncFunctionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDomainOwnershipIdentifiersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -46957,11 +46382,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -46978,7 +46403,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -47029,7 +46454,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -47059,13 +46484,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -47074,28 +46517,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Add or update a host level secret. + /// Get domain ownership identifier for web app. /// /// - /// Description for Add or update a host level secret. + /// Description for Get domain ownership identifier for web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// The type of host key. + /// Name of the app. /// - /// - /// The name of the key. + /// + /// Name of domain ownership identifier. /// /// - /// Name of the deployment slot. - /// - /// - /// The key to create or update + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -47118,7 +46556,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHostSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47143,22 +46581,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (keyType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); - } - if (keyName == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (key == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "key"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -47176,20 +46606,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("keyType", keyType); - tracingParameters.Add("keyName", keyName); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("slot", slot); - tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostSecretSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDomainOwnershipIdentifierSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -47204,7 +46631,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -47235,12 +46662,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(key != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -47261,7 +46682,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -47291,7 +46712,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -47304,25 +46725,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -47342,25 +46745,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a host level secret. + /// Creates a domain ownership identifier for web app, or updates an existing + /// ownership identifier. /// /// - /// Description for Delete a host level secret. + /// Description for Creates a domain ownership identifier for web app, or + /// updates an existing ownership identifier. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// The type of host key. + /// + /// Name of domain ownership identifier. /// - /// - /// The name of the key. + /// + /// A JSON representation of the domain ownership properties. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -47371,6 +46777,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -47380,7 +46789,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHostSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47405,13 +46814,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (keyType == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); } - if (keyName == null) + if (domainOwnershipIdentifier == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); } if (slot == null) { @@ -47434,19 +46843,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("keyType", keyType); - tracingParameters.Add("keyName", keyName); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHostSecretSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateDomainOwnershipIdentifierSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); - _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -47461,7 +46869,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -47492,6 +46900,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(domainOwnershipIdentifier != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -47512,7 +46926,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -47542,13 +46956,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -47557,10 +46989,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get hostname bindings for an app or a deployment slot. + /// Deletes a domain ownership identifier for a web app. /// /// - /// Description for Get hostname bindings for an app or a deployment slot. + /// Description for Deletes a domain ownership identifier for a web app. /// /// /// Name of the resource group to which the resource belongs. @@ -47568,9 +47000,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of domain ownership identifier. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets - /// hostname bindings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -47581,9 +47016,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -47593,7 +47025,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListHostNameBindingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47618,6 +47050,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (domainOwnershipIdentifierName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -47639,15 +47075,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteDomainOwnershipIdentifierSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -47662,7 +47100,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -47713,7 +47151,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -47743,31 +47181,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -47776,12 +47196,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the named hostname binding for an app (or deployment slot, if - /// specified). + /// Creates a domain ownership identifier for web app, or updates an existing + /// ownership identifier. /// /// - /// Description for Get the named hostname binding for an app (or deployment - /// slot, if specified). + /// Description for Creates a domain ownership identifier for web app, or + /// updates an existing ownership identifier. /// /// /// Name of the resource group to which the resource belongs. @@ -47789,12 +47209,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API the named - /// binding for the production slot. + /// + /// Name of domain ownership identifier. /// - /// - /// Hostname in the hostname binding. + /// + /// A JSON representation of the domain ownership properties. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// /// /// Headers that will be added to request. @@ -47817,7 +47240,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDomainOwnershipIdentifierSlotWithHttpMessagesAsync(string resourceGroupName, string name, string domainOwnershipIdentifierName, Identifier domainOwnershipIdentifier, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -47842,13 +47265,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (domainOwnershipIdentifierName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifierName"); } - if (hostName == null) + if (domainOwnershipIdentifier == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); + throw new ValidationException(ValidationRules.CannotBeNull, "domainOwnershipIdentifier"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -47867,18 +47294,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("domainOwnershipIdentifierName", domainOwnershipIdentifierName); + tracingParameters.Add("domainOwnershipIdentifier", domainOwnershipIdentifier); tracingParameters.Add("slot", slot); - tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHostNameBindingSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateDomainOwnershipIdentifierSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{domainOwnershipIdentifierName}", System.Uri.EscapeDataString(domainOwnershipIdentifierName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -47892,7 +47320,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -47923,6 +47351,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(domainOwnershipIdentifier != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(domainOwnershipIdentifier, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -47973,7 +47407,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -47986,7 +47420,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -48006,27 +47440,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a hostname binding for an app. + /// Get the status of the last MSDeploy operation. /// /// - /// Description for Creates a hostname binding for an app. + /// Description for Get the status of the last MSDeploy operation. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Hostname in the hostname binding. - /// - /// - /// Binding details. This is the JSON representation of a HostNameBinding - /// object. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// create a binding for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -48049,7 +47476,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMSDeployStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -48074,14 +47501,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (hostName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } - if (hostNameBinding == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostNameBinding"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -48103,18 +47522,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("hostName", hostName); - tracingParameters.Add("hostNameBinding", hostNameBinding); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostNameBindingSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -48129,7 +47545,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -48160,12 +47576,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(hostNameBinding != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostNameBinding, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -48216,7 +47626,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -48229,7 +47639,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -48249,23 +47659,52 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a hostname binding for an app. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Deletes a hostname binding for an app. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// - /// - /// Hostname in the hostname binding. + /// + /// Details of MSDeploy operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateMSDeployOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -48276,6 +47715,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -48285,7 +47727,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMSDeployLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -48314,10 +47756,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (hostName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -48336,17 +47774,15 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHostNameBindingSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMSDeployLogSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -48360,7 +47796,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -48411,7 +47847,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -48441,13 +47877,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -48456,26 +47910,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Retrieves a specific Service Bus Hybrid Connection used by this Web App. + /// List the functions for a web site, or a deployment slot. /// /// - /// Description for Retrieves a specific Service Bus Hybrid Connection used by - /// this Web App. + /// Description for List the functions for a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. - /// - /// - /// The relay name for this hybrid connection. + /// Site name. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -48498,7 +47945,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceFunctionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -48523,14 +47970,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -48552,19 +47991,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHybridConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceFunctionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -48630,7 +48065,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -48660,7 +48095,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -48673,7 +48108,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -48693,28 +48128,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new Hybrid Connection using a Service Bus relay. + /// Fetch a short lived token that can be exchanged for a master key. /// /// - /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Description for Fetch a short lived token that can be exchanged for a + /// master key. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. - /// - /// - /// The relay name for this hybrid connection. - /// - /// - /// The details of the hybrid connection. + /// Name of web app. /// /// - /// The name of the slot for the web app. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -48737,7 +48165,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetFunctionsAdminTokenSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -48762,18 +48190,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -48795,20 +48211,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHybridConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetFunctionsAdminTokenSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -48823,7 +48234,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -48854,12 +48265,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -48910,7 +48315,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -48923,7 +48328,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -48943,25 +48348,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Removes a Hybrid Connection from this site. + /// Get function information by its ID for web site, or a deployment slot. /// /// - /// Description for Removes a Hybrid Connection from this site. + /// Description for Get function information by its ID for web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The namespace for this hybrid connection. + /// Site name. /// - /// - /// The relay name for this hybrid connection. + /// + /// Function name. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -48972,6 +48375,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -48981,7 +48387,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49006,13 +48412,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (slot == null) { @@ -49035,19 +48437,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteHybridConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceFunctionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49062,7 +48462,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -49143,13 +48543,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -49158,28 +48576,56 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new Hybrid Connection using a Service Bus relay. + /// Create function for web site, or a deployment slot. /// /// - /// Description for Creates a new Hybrid Connection using a Service Bus relay. + /// Description for Create function for web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Site name. /// - /// - /// The namespace for this hybrid connection. + /// + /// Function name. /// - /// - /// The relay name for this hybrid connection. + /// + /// Name of the deployment slot. /// - /// - /// The details of the hybrid connection. + /// + /// Function details. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateInstanceFunctionSlotWithHttpMessagesAsync(resourceGroupName, name, functionName, slot, functionEnvelope, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a function for web site, or a deployment slot. + /// + /// + /// Description for Delete a function for web site, or a deployment slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Function name. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -49190,9 +48636,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -49202,7 +48645,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49227,17 +48670,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (namespaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); - } - if (relayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); - } - if (connectionEnvelope == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (slot == null) { @@ -49260,20 +48695,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("relayName", relayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateHybridConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceFunctionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49288,7 +48720,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -49319,12 +48751,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -49345,7 +48771,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -49375,31 +48801,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -49408,20 +48816,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Add or update a function secret. /// /// - /// Description for Retrieves all Service Bus Hybrid Connections used by this - /// Web App. + /// Description for Add or update a function secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Site name. + /// + /// + /// The name of the function. + /// + /// + /// The name of the key. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. + /// + /// + /// The key to create or update /// /// /// Headers that will be added to request. @@ -49444,7 +48860,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListHybridConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateFunctionSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49469,10 +48885,22 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "key"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -49490,15 +48918,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); + tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHybridConnectionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateFunctionSecretSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49513,7 +48946,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -49544,6 +48977,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(key != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -49564,7 +49003,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -49594,7 +49033,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -49607,7 +49046,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -49627,22 +49084,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets hybrid connections configured for an app (or deployment slot, if - /// specified). + /// Delete a function secret. /// /// - /// Description for Gets hybrid connections configured for an app (or - /// deployment slot, if specified). + /// Description for Delete a function secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// The name of the function. + /// + /// + /// The name of the key. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// hybrid connections for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -49653,9 +49113,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -49665,7 +49122,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListRelayServiceConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteFunctionSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string keyName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49690,6 +49147,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -49711,15 +49176,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRelayServiceConnectionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteFunctionSecretSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49734,7 +49203,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -49785,7 +49254,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -49815,31 +49284,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -49848,23 +49299,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a hybrid connection configuration by its name. + /// Get function keys for a function in a web site, or a deployment slot. /// /// - /// Description for Gets a hybrid connection configuration by its name. + /// Description for Get function keys for a function in a web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// Name of the hybrid connection. + /// + /// Function name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get a - /// hybrid connection for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -49887,7 +49338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListFunctionKeysSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -49912,9 +49363,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (slot == null) { @@ -49937,17 +49388,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetRelayServiceConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionKeysSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -49962,7 +49413,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50043,7 +49494,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -50056,7 +49507,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -50076,28 +49527,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new hybrid connection configuration (PUT), or updates an existing - /// one (PATCH). + /// Get function secrets for a function in a web site, or a deployment slot. /// /// - /// Description for Creates a new hybrid connection configuration (PUT), or - /// updates an existing one (PATCH). + /// Description for Get function secrets for a function in a web site, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the hybrid connection configuration. + /// Site name. /// - /// - /// Details of the hybrid connection configuration. + /// + /// Function name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// create or update a hybrid connection for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -50120,7 +49566,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListFunctionSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -50145,13 +49591,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } - if (connectionEnvelope == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } if (slot == null) { @@ -50174,18 +49616,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("functionName", functionName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateRelayServiceConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionSecretsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -50200,7 +49641,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50231,12 +49672,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -50287,7 +49722,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -50300,7 +49735,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -50320,23 +49755,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a relay service connection by its name. + /// Get host secrets for a function app. /// /// - /// Description for Deletes a relay service connection by its name. + /// Description for Get host secrets for a function app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the hybrid connection configuration. + /// Site name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete a hybrid connection for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -50347,6 +49778,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -50356,7 +49790,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListHostKeysSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -50381,10 +49815,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -50406,17 +49836,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteRelayServiceConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostKeysSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -50431,7 +49859,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50482,7 +49910,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -50512,13 +49940,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -50527,12 +49973,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new hybrid connection configuration (PUT), or updates an existing - /// one (PATCH). + /// This is to allow calling via powershell and ARM template. /// /// - /// Description for Creates a new hybrid connection configuration (PUT), or - /// updates an existing one (PATCH). + /// Description for This is to allow calling via powershell and ARM template. /// /// /// Name of the resource group to which the resource belongs. @@ -50540,15 +49984,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the hybrid connection configuration. - /// - /// - /// Details of the hybrid connection configuration. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// create or update a hybrid connection for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -50559,9 +49996,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -50571,7 +50005,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ListSyncStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -50596,14 +50030,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (entityName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -50625,18 +50051,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("entityName", entityName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateRelayServiceConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -50651,7 +50074,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50682,12 +50105,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -50708,7 +50125,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -50738,31 +50155,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -50771,10 +50170,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Syncs function trigger metadata to the management database /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Syncs function trigger metadata to the management database /// /// /// Name of the resource group to which the resource belongs. @@ -50783,8 +50182,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets the - /// production slot instances. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -50795,9 +50193,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -50807,7 +50202,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceIdentifiersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncFunctionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -50855,11 +50250,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -50876,7 +50271,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -50927,7 +50322,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -50957,31 +50352,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -50990,22 +50367,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Add or update a host level secret. /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Add or update a host level secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// + /// + /// The type of host key. + /// + /// + /// The name of the key. /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets the - /// production slot instances. + /// Name of the deployment slot. + /// + /// + /// The key to create or update /// /// /// Headers that will be added to request. @@ -51028,7 +50411,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceInfoSlotWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHostSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, KeyInfo key, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -51053,14 +50436,22 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) + if (keyType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "key"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -51078,17 +50469,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("keyType", keyType); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); + tracingParameters.Add("key", key); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceInfoSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostSecretSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -51103,7 +50497,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -51134,6 +50528,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(key != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(key, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -51154,7 +50554,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -51184,7 +50584,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -51197,7 +50597,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -51217,23 +50635,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the status of the last MSDeploy operation. + /// Delete a host level secret. /// /// - /// Description for Get the status of the last MSDeploy operation. + /// Description for Delete a host level secret. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// + /// The type of host key. /// - /// - /// ID of web app instance. + /// + /// The name of the key. + /// + /// + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -51244,9 +50664,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -51256,7 +50673,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceMsDeployStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHostSecretSlotWithHttpMessagesAsync(string resourceGroupName, string name, string keyType, string keyName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -51281,13 +50698,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (keyType == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); } - if (instanceId == null) + if (keyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -51306,18 +50727,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("keyType", keyType); + tracingParameters.Add("keyName", keyName); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMsDeployStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHostSecretSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{keyType}", System.Uri.EscapeDataString(keyType)); + _url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -51331,7 +50754,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -51382,7 +50805,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -51412,31 +50835,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -51445,58 +50850,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. - /// - /// - /// Description for Invoke the MSDeploy web app extension. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of web app. - /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// ID of web app instance. - /// - /// - /// Details of MSDeploy operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, instanceId, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the MSDeploy Log for the last MSDeploy operation. + /// Get hostname bindings for an app or a deployment slot. /// /// - /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// Description for Get hostname bindings for an app or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// ID of web app instance. + /// Name of the deployment slot. If a slot is not specified, the API gets + /// hostname bindings for the production slot. /// /// /// Headers that will be added to request. @@ -51519,7 +50886,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceMSDeployLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListHostNameBindingsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -51548,10 +50915,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -51570,17 +50933,15 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMSDeployLogSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -51645,7 +51006,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -51675,7 +51036,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -51688,7 +51049,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -51708,26 +51069,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Get the named hostname binding for an app (or deployment slot, if + /// specified). /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Get the named hostname binding for an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API the named + /// binding for the production slot. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// Hostname in the hostname binding. /// /// /// Headers that will be added to request. @@ -51750,7 +51110,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -51779,9 +51139,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); } if (Client.SubscriptionId == null) { @@ -51801,17 +51161,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetHostNameBindingSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -51876,7 +51236,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -51906,7 +51266,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -51919,7 +51279,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -51939,29 +51299,27 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Creates a hostname binding for an app. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Creates a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// Hostname in the hostname binding. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// + /// Binding details. This is the JSON representation of a HostNameBinding + /// object. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// create a binding for the production slot. /// /// /// Headers that will be added to request. @@ -51984,7 +51342,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string hostName, HostNameBinding hostNameBinding, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52009,17 +51367,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); } - if (slot == null) + if (hostNameBinding == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostNameBinding"); } - if (instanceId == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -52038,20 +51396,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("hostName", hostName); + tracingParameters.Add("hostNameBinding", hostNameBinding); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHostNameBindingSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -52065,7 +51422,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -52096,6 +51453,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(hostNameBinding != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hostNameBinding, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -52116,7 +51479,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -52146,7 +51509,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -52159,7 +51522,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -52179,29 +51542,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Terminate a process by its ID for a web site, or a deployment slot, or - /// specific scaled-out instance in a web site. + /// Deletes a hostname binding for an app. /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Deletes a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// Hostname in the hostname binding. /// /// /// Headers that will be added to request. @@ -52221,7 +51578,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteInstanceProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHostNameBindingSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string hostName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52246,17 +51603,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) + if (hostName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "hostName"); } if (Client.SubscriptionId == null) { @@ -52275,20 +51628,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("hostName", hostName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceProcessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHostNameBindingSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{hostName}", System.Uri.EscapeDataString(hostName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -52353,7 +51704,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -52398,29 +51749,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a memory dump of a process by its ID for a specific scaled-out instance - /// in a web site. + /// Retrieves a specific Service Bus Hybrid Connection used by this Web App. /// /// - /// Description for Get a memory dump of a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Retrieves a specific Service Bus Hybrid Connection used by + /// this Web App. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// PID. + /// + /// The namespace for this hybrid connection. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// + /// The relay name for this hybrid connection. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -52443,7 +51791,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessDumpSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52468,17 +51816,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (slot == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } - if (instanceId == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -52497,20 +51845,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessDumpSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetHybridConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -52567,7 +51915,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -52575,7 +51923,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -52605,7 +51953,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -52615,7 +51963,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -52625,29 +51986,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Creates a new Hybrid Connection using a Service Bus relay. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Creates a new Hybrid Connection using a Service Bus relay. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// PID. + /// + /// The namespace for this hybrid connection. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// + /// The relay name for this hybrid connection. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// The details of the hybrid connection. + /// + /// + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -52670,7 +52030,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessModulesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52695,17 +52055,21 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (slot == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } - if (instanceId == null) + if (connectionEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -52724,20 +52088,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateHybridConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -52751,7 +52116,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -52782,6 +52147,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -52802,7 +52173,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -52832,7 +52203,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -52845,7 +52216,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -52865,32 +52236,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Removes a Hybrid Connection from this site. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Removes a Hybrid Connection from this site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// PID. + /// + /// The namespace for this hybrid connection. /// - /// - /// Module base address. + /// + /// The relay name for this hybrid connection. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. - /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -52901,9 +52265,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -52913,7 +52274,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetInstanceProcessModuleSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -52938,22 +52299,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (baseAddress == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -52971,22 +52328,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("baseAddress", baseAddress); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessModuleSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteHybridConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -53000,7 +52355,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53081,31 +52436,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -53114,29 +52451,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Creates a new Hybrid Connection using a Service Bus relay. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Creates a new Hybrid Connection using a Service Bus relay. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// The name of the web app. /// - /// - /// PID. + /// + /// The namespace for this hybrid connection. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// + /// The relay name for this hybrid connection. /// - /// - /// ID of a specific scaled-out instance. This is the value of the name - /// property in the JSON response from "GET api/sites/{siteName}/instances". + /// + /// The details of the hybrid connection. + /// + /// + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -53159,7 +52495,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessThreadsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateHybridConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string namespaceName, string relayName, HybridConnection connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -53184,17 +52520,21 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (namespaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); } - if (slot == null) + if (relayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "relayName"); } - if (instanceId == null) + if (connectionEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -53213,20 +52553,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("relayName", relayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateHybridConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{relayName}", System.Uri.EscapeDataString(relayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -53240,7 +52581,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53271,6 +52612,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -53291,7 +52638,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -53321,7 +52668,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -53334,7 +52681,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -53354,22 +52701,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Shows whether an app can be cloned to another resource group or - /// subscription. + /// Retrieves all Service Bus Hybrid Connections used by this Web App. /// /// - /// Description for Shows whether an app can be cloned to another resource - /// group or subscription. + /// Description for Retrieves all Service Bus Hybrid Connections used by this + /// Web App. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// /// - /// Name of the deployment slot. By default, this API returns information on - /// the production slot. + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -53392,7 +52737,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> IsCloneableSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListHybridConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -53440,11 +52785,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "IsCloneableSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHybridConnectionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -53461,7 +52806,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53542,7 +52887,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -53555,7 +52900,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -53575,10 +52920,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Gets hybrid connections configured for an app (or deployment slot, if + /// specified). /// /// - /// Description for Gets existing backups of an app. + /// Description for Gets hybrid connections configured for an app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -53588,7 +52935,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// /// Name of the deployment slot. If a slot is not specified, the API will get - /// backups of the production slot. + /// hybrid connections for the production slot. /// /// /// Headers that will be added to request. @@ -53611,7 +52958,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteBackupsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListRelayServiceConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -53659,11 +53006,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListRelayServiceConnectionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -53680,7 +53027,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53761,7 +53108,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -53774,7 +53121,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -53794,10 +53141,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// This is to allow calling via powershell and ARM template. + /// Gets a hybrid connection configuration by its name. /// /// - /// Description for This is to allow calling via powershell and ARM template. + /// Description for Gets a hybrid connection configuration by its name. /// /// /// Name of the resource group to which the resource belongs. @@ -53805,8 +53152,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the hybrid connection. + /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will get a + /// hybrid connection for the production slot. /// /// /// Headers that will be added to request. @@ -53829,7 +53180,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListSyncFunctionTriggersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -53854,6 +53205,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (entityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -53875,15 +53230,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSyncFunctionTriggersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetRelayServiceConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -53898,7 +53255,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -53979,7 +53336,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -53992,7 +53349,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -54012,21 +53369,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Returns the status of MySql in app migration, if one is active, and whether - /// or not MySql in app is enabled + /// Creates a new hybrid connection configuration (PUT), or updates an existing + /// one (PATCH). /// /// - /// Description for Returns the status of MySql in app migration, if one is - /// active, and whether or not MySql in app is enabled + /// Description for Creates a new hybrid connection configuration (PUT), or + /// updates an existing one (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Name of the hybrid connection configuration. + /// + /// + /// Details of the hybrid connection configuration. /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// create or update a hybrid connection for the production slot. /// /// /// Headers that will be added to request. @@ -54049,7 +53413,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMigrateMySqlStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54074,6 +53438,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (entityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -54095,15 +53467,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("entityName", entityName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMigrateMySqlStatusSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateRelayServiceConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -54118,7 +53493,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -54149,6 +53524,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -54199,7 +53580,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -54212,7 +53593,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -54232,10 +53613,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a Swift Virtual Network connection. + /// Deletes a relay service connection by its name. /// /// - /// Description for Gets a Swift Virtual Network connection. + /// Description for Deletes a relay service connection by its name. /// /// /// Name of the resource group to which the resource belongs. @@ -54243,9 +53624,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the hybrid connection configuration. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get a - /// gateway for the production slot's Virtual Network. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete a hybrid connection for the production slot. /// /// /// Headers that will be added to request. @@ -54256,9 +53640,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -54268,7 +53649,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54293,6 +53674,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (entityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -54314,15 +53699,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSwiftVirtualNetworkConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteRelayServiceConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -54337,7 +53724,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -54388,7 +53775,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -54418,31 +53805,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -54451,17 +53820,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. + /// Creates a new hybrid connection configuration (PUT), or updates an existing + /// one (PATCH). /// /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. + /// Description for Creates a new hybrid connection configuration (PUT), or + /// updates an existing one (PATCH). /// /// /// Name of the resource group to which the resource belongs. @@ -54469,12 +53833,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the hybrid connection configuration. + /// /// - /// Properties of the Virtual Network connection. See example. + /// Details of the hybrid connection configuration. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// create or update a hybrid connection for the production slot. /// /// /// Headers that will be added to request. @@ -54497,7 +53864,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateRelayServiceConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string entityName, RelayServiceConnectionEntity connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54522,6 +53889,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (entityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "entityName"); + } if (connectionEnvelope == null) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); @@ -54547,16 +53918,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("entityName", entityName); tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateSwiftVirtualNetworkConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateRelayServiceConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{entityName}", System.Uri.EscapeDataString(entityName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -54571,7 +53944,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -54658,7 +54031,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -54671,7 +54044,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -54691,12 +54064,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a Swift Virtual Network connection from an app (or deployment - /// slot). + /// Gets all scale-out instances of an app. /// /// - /// Description for Deletes a Swift Virtual Network connection from an app (or - /// deployment slot). + /// Description for Gets all scale-out instances of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -54705,8 +54076,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the connection for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API gets the + /// production slot instances. /// /// /// Headers that will be added to request. @@ -54717,6 +54088,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -54726,7 +54100,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSwiftVirtualNetworkSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceIdentifiersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54774,11 +54148,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSwiftVirtualNetworkSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -54795,7 +54169,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -54846,7 +54220,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -54876,13 +54250,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -54891,17 +54283,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. + /// Gets all scale-out instances of an app. /// /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. + /// Description for Gets all scale-out instances of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -54909,12 +54294,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Properties of the Virtual Network connection. See example. + /// /// /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API gets the + /// production slot instances. /// /// /// Headers that will be added to request. @@ -54937,7 +54321,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceInfoSlotWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -54962,9 +54346,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (connectionEnvelope == null) + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); } if (slot == null) { @@ -54987,16 +54371,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSwiftVirtualNetworkConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceInfoSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -55011,7 +54396,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -55042,12 +54427,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -55098,7 +54477,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -55111,7 +54490,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -55131,25 +54510,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all network features used by the app (or deployment slot, if - /// specified). + /// Get the status of the last MSDeploy operation. /// /// - /// Description for Gets all network features used by the app (or deployment - /// slot, if specified). + /// Description for Get the status of the last MSDeploy operation. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// The type of view. This can either be "summary" or "detailed". + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// network features for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// ID of web app instance. /// /// /// Headers that will be added to request. @@ -55172,7 +54549,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListNetworkFeaturesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string view, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceMsDeployStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -55197,14 +54574,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (view == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "view"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -55222,18 +54599,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("view", view); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNetworkFeaturesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMsDeployStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{view}", System.Uri.EscapeDataString(view)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -55298,7 +54675,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -55328,7 +54705,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -55341,7 +54718,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -55361,25 +54738,58 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of web app. /// - /// - /// GUID of the operation. + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// ID of web app instance. + /// + /// + /// Details of MSDeploy operation + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, instanceId, mSDeploy, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Description for Get the MSDeploy Log for the last MSDeploy operation. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// an operation for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// ID of web app instance. /// /// /// Headers that will be added to request. @@ -55402,7 +54812,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceMSDeployLogSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -55427,14 +54837,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -55452,18 +54862,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceMSDeployLogSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -55528,7 +54938,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -55558,7 +54968,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -55571,25 +54981,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -55609,29 +55001,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site (To be deprecated). + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Start capturing network packets for the site (To be - /// deprecated). + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Site name. /// /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// - /// - /// The Blob URL to store capture file. + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -55654,7 +55043,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> StartWebSiteNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -55683,6 +55072,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -55700,33 +55093,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); tracingParameters.Add("slot", slot); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartWebSiteNetworkTraceSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -55738,7 +55118,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -55789,7 +55169,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -55819,7 +55199,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -55832,7 +55212,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -55852,56 +55232,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Start capturing network packets for the site. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> StartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginStartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stop ongoing capturing network packets for the site. - /// - /// - /// Description for Stop ongoing capturing network packets for the site. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Site name. /// - /// - /// The name of the web app. + /// + /// PID. /// /// - /// The name of the slot for this web app. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -55912,6 +55265,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -55921,7 +55277,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopWebSiteNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -55946,10 +55302,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -55967,16 +55331,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopWebSiteNetworkTraceSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -55990,7 +55358,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -56041,7 +55409,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -56071,13 +55439,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -56086,25 +55472,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Terminate a process by its ID for a web site, or a deployment slot, or + /// specific scaled-out instance in a web site. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// GUID of the operation. + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// an operation for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -56115,9 +55505,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -56127,7 +55514,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTracesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteInstanceProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -56152,14 +55539,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -56177,18 +55568,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteInstanceProcessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -56202,7 +55595,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -56253,7 +55646,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -56283,31 +55676,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -56316,25 +55691,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// Get a memory dump of a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for Get a memory dump of a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// GUID of the operation. + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// an operation for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -56357,7 +55736,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTraceOperationSlotV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessDumpSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -56382,14 +55761,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -56407,18 +55790,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationSlotV2", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessDumpSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -56475,7 +55860,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -56483,7 +55868,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -56513,7 +55898,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -56523,38 +55908,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -56564,25 +55918,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named operation for a network trace capturing (or deployment slot, - /// if specified). + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Gets a named operation for a network trace capturing (or - /// deployment slot, if specified). + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// GUID of the operation. + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// an operation for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -56605,7 +55963,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetNetworkTracesSlotV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessModulesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -56630,14 +55988,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (operationId == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -56655,18 +56017,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("operationId", operationId); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesSlotV2", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -56731,7 +56095,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -56761,7 +56125,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -56774,7 +56138,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -56794,22 +56158,32 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Generates a new publishing password for an app (or deployment slot, if - /// specified). + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Generates a new publishing password for an app (or - /// deployment slot, if specified). + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. + /// + /// + /// Module base address. /// /// - /// Name of the deployment slot. If a slot is not specified, the API generate a - /// new publishing password for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. + /// + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -56820,6 +56194,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -56829,7 +56206,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task GenerateNewSitePublishingPasswordSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceProcessModuleSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -56854,10 +56231,22 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (baseAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -56875,16 +56264,22 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GenerateNewSitePublishingPasswordSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceProcessModuleSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -56898,7 +56293,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -56949,7 +56344,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -56979,13 +56374,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -56994,26 +56407,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets perfmon counters for web app. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets perfmon counters for web app. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. + /// + /// + /// PID. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// - /// - /// Return only usages/metrics specified in the filter. Filter conforms to - /// odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and - /// endTime eq 2014-12-31T23:59:59Z and timeGrain eq - /// duration'[Hour|Minute|Day]'. + /// + /// ID of a specific scaled-out instance. This is the value of the name + /// property in the JSON response from "GET api/sites/{siteName}/instances". /// /// /// Headers that will be added to request. @@ -57036,7 +56452,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPerfMonCountersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessThreadsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57061,10 +56477,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -57082,23 +56506,22 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); - tracingParameters.Add("filter", filter); + tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -57161,7 +56584,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -57191,7 +56614,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -57204,7 +56627,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -57224,20 +56647,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets web app's event logs. + /// Shows whether an app can be cloned to another resource group or + /// subscription. /// /// - /// Description for Gets web app's event logs. + /// Description for Shows whether an app can be cloned to another resource + /// group or subscription. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. By default, this API returns information on + /// the production slot. /// /// /// Headers that will be added to request. @@ -57260,7 +56685,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSitePhpErrorLogFlagSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> IsCloneableSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57308,11 +56733,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSitePhpErrorLogFlagSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "IsCloneableSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -57329,7 +56754,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -57410,7 +56835,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -57423,7 +56848,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -57443,10 +56868,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the premier add-ons of an app. + /// Gets existing backups of an app. /// /// - /// Description for Gets the premier add-ons of an app. + /// Description for Gets existing backups of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -57456,7 +56881,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// /// Name of the deployment slot. If a slot is not specified, the API will get - /// the premier add-ons for the production slot. + /// backups of the production slot. /// /// /// Headers that will be added to request. @@ -57479,7 +56904,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListPremierAddOnsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteBackupsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57527,11 +56952,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPremierAddOnsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -57548,7 +56973,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -57629,7 +57054,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -57642,7 +57067,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -57662,10 +57087,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a named add-on of an app. + /// This is to allow calling via powershell and ARM template. /// /// - /// Description for Gets a named add-on of an app. + /// Description for This is to allow calling via powershell and ARM template. /// /// /// Name of the resource group to which the resource belongs. @@ -57673,12 +57098,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Add-on name. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the named add-on for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -57701,7 +57122,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListSyncFunctionTriggersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57726,10 +57147,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -57751,17 +57168,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPremierAddOnSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSyncFunctionTriggersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -57776,7 +57191,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -57857,7 +57272,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -57870,7 +57285,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -57890,26 +57305,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates a named add-on of an app. + /// Returns the status of MySql in app migration, if one is active, and whether + /// or not MySql in app is enabled /// /// - /// Description for Updates a named add-on of an app. + /// Description for Returns the status of MySql in app migration, if one is + /// active, and whether or not MySql in app is enabled /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Add-on name. - /// - /// - /// A JSON representation of the edited premier add-on. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the named add-on for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -57932,7 +57342,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddPremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetMigrateMySqlStatusSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -57957,18 +57367,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } - if (premierAddOn == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); - } - if (premierAddOn != null) - { - premierAddOn.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -57990,18 +57388,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); - tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddPremierAddOnSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetMigrateMySqlStatusSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -58016,7 +57411,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -58047,12 +57442,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(premierAddOn != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -58103,7 +57492,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -58116,7 +57505,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -58136,10 +57525,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a premier add-on from an app. + /// Gets a Swift Virtual Network connection. /// /// - /// Description for Delete a premier add-on from an app. + /// Description for Gets a Swift Virtual Network connection. /// /// /// Name of the resource group to which the resource belongs. @@ -58147,12 +57536,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Add-on name. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the named add-on for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get a + /// gateway for the production slot's Virtual Network. /// /// /// Headers that will be added to request. @@ -58163,6 +57549,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -58172,7 +57561,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeletePremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58197,10 +57586,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -58222,17 +57607,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeletePremierAddOnSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSwiftVirtualNetworkConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -58247,7 +57630,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -58328,13 +57711,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -58343,10 +57744,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates a named add-on of an app. + /// Deletes a Swift Virtual Network connection from an app (or deployment + /// slot). /// /// - /// Description for Updates a named add-on of an app. + /// Description for Deletes a Swift Virtual Network connection from an app (or + /// deployment slot). /// /// /// Name of the resource group to which the resource belongs. @@ -58354,15 +57757,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Add-on name. - /// - /// - /// A JSON representation of the edited premier add-on. - /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// update the named add-on for the production slot. + /// delete the connection for the production slot. /// /// /// Headers that will be added to request. @@ -58373,9 +57770,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -58385,7 +57779,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdatePremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSwiftVirtualNetworkSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58410,14 +57804,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (premierAddOnName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); - } - if (premierAddOn == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -58439,18 +57825,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("premierAddOnName", premierAddOnName); - tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdatePremierAddOnSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSwiftVirtualNetworkSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -58465,7 +57848,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -58496,12 +57879,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(premierAddOn != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -58522,7 +57899,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -58552,31 +57929,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -58585,21 +57944,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Gets all network features used by the app (or deployment slot, if + /// specified). /// /// - /// Description for Gets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Gets all network features used by the app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. + /// + /// + /// The type of view. Only "summary" is supported at this time. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// network features for the production slot. /// /// /// Headers that will be added to request. @@ -58622,7 +57985,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateAccessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListNetworkFeaturesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string view, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58647,6 +58010,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (view == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "view"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -58668,15 +58035,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("view", view); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateAccessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNetworkFeaturesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{view}", System.Uri.EscapeDataString(view)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -58742,7 +58111,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -58772,7 +58141,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -58785,7 +58154,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -58805,24 +58174,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Sets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Sets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. /// - /// - /// The information for the private access + /// + /// GUID of the operation. /// /// - /// The name of the slot for the web app. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// an operation for the production slot. /// /// /// Headers that will be added to request. @@ -58845,7 +58215,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PutPrivateAccessVnetSlotWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -58870,9 +58240,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (access == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "access"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } if (slot == null) { @@ -58895,16 +58265,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("access", access); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PutPrivateAccessVnetSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -58919,7 +58290,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -58950,12 +58321,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(access != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(access, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -58976,7 +58341,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59006,7 +58371,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -59019,7 +58384,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -59039,18 +58422,29 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a private endpoint connection + /// Start capturing network packets for the site (To be deprecated). /// /// - /// Description for Gets a private endpoint connection + /// Description for Start capturing network packets for the site (To be + /// deprecated). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// The name of the web app. /// - /// + /// + /// The name of the slot for this web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. /// /// /// Headers that will be added to request. @@ -59073,7 +58467,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> StartWebSiteNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -59098,9 +58492,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -59119,18 +58513,33 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("slot", slot); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartWebSiteNetworkTraceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -59142,7 +58551,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -59223,7 +58632,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -59236,7 +58645,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -59256,47 +58665,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Approves or rejects a private endpoint connection + /// Start capturing network packets for the site. /// /// - /// Description for Approves or rejects a private endpoint connection + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. + /// The name of the web app. /// - /// - /// The cancellation token. + /// + /// The name of the slot for this web app. /// - public async Task> ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a private endpoint connection - /// - /// - /// Description for Deletes a private endpoint connection - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// The duration to keep capturing in seconds. /// - /// - /// Name of the site. + /// + /// The maximum frame length in bytes (Optional). /// - /// + /// + /// The Blob URL to store capture file. /// /// /// The headers that will be added to request. @@ -59304,24 +58694,27 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> StartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse> _response = await BeginStartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the private link resources + /// Stop ongoing capturing network packets for the site. /// /// - /// Description for Gets the private link resources + /// Description for Stop ongoing capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// The name of the web app. + /// + /// + /// The name of the slot for this web app. /// /// /// Headers that will be added to request. @@ -59332,9 +58725,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -59344,7 +58734,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopWebSiteNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -59369,6 +58759,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -59386,14 +58780,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopWebSiteNetworkTraceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -59407,7 +58803,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -59458,7 +58854,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59488,31 +58884,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -59521,22 +58899,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// + /// GUID of the operation. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// an operation for the production slot. /// /// /// Headers that will be added to request. @@ -59559,7 +58940,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTracesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -59584,6 +58965,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -59605,15 +58990,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -59679,7 +59066,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59709,7 +59096,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -59722,7 +59109,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -59742,25 +59129,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// GUID of the operation. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// an operation for the production slot. /// /// /// Headers that will be added to request. @@ -59783,7 +59170,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTraceOperationSlotV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -59808,9 +59195,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } if (slot == null) { @@ -59833,17 +59220,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTraceOperationSlotV2", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -59909,7 +59296,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -59939,7 +59326,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -59952,7 +59339,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -59972,25 +59377,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Terminate a process by its ID for a web site, or a deployment slot, or - /// specific scaled-out instance in a web site. + /// Gets a named operation for a network trace capturing (or deployment slot, + /// if specified). /// /// - /// Description for Terminate a process by its ID for a web site, or a - /// deployment slot, or specific scaled-out instance in a web site. + /// Description for Gets a named operation for a network trace capturing (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// PID. + /// + /// GUID of the operation. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// an operation for the production slot. /// /// /// Headers that will be added to request. @@ -60001,6 +59406,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -60010,7 +59418,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetNetworkTracesSlotV2WithHttpMessagesAsync(string resourceGroupName, string name, string operationId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60035,9 +59443,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } if (slot == null) { @@ -60060,17 +59468,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteProcessSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkTracesSlotV2", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -60085,7 +59493,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -60136,7 +59544,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -60166,13 +59574,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -60181,25 +59607,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get a memory dump of a process by its ID for a specific scaled-out instance - /// in a web site. + /// Generates a new publishing password for an app (or deployment slot, if + /// specified). /// /// - /// Description for Get a memory dump of a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Generates a new publishing password for an app (or + /// deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API generate a + /// new publishing password for the production slot. /// /// /// Headers that will be added to request. @@ -60210,9 +59633,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -60222,7 +59642,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessDumpSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task GenerateNewSitePublishingPasswordSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60247,10 +59667,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -60272,17 +59688,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessDumpSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GenerateNewSitePublishingPasswordSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -60297,7 +59711,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -60340,7 +59754,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -60348,7 +59762,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -60378,18 +59792,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) - { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -60398,25 +59807,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Gets perfmon counters for web app. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Gets perfmon counters for web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// Return only usages/metrics specified in the filter. Filter conforms to + /// odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and + /// endTime eq 2014-12-31T23:59:59Z and timeGrain eq + /// duration'[Hour|Minute|Day]'. /// /// /// Headers that will be added to request. @@ -60439,7 +59849,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessModulesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPerfMonCountersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60464,10 +59874,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -60489,17 +59895,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessModulesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -60507,6 +59912,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -60565,7 +59974,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -60595,7 +60004,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -60608,7 +60017,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -60628,28 +60037,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Gets web app's event logs. /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Gets web app's event logs. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. - /// - /// - /// Module base address. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -60672,7 +60073,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetProcessModuleSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSitePhpErrorLogFlagSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60697,14 +60098,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } - if (baseAddress == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -60726,19 +60119,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); - tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcessModuleSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSitePhpErrorLogFlagSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); - _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -60804,7 +60193,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -60834,7 +60223,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -60847,7 +60236,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -60867,25 +60256,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets the premier add-ons of an app. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets the premier add-ons of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// PID. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the premier add-ons for the production slot. /// /// /// Headers that will be added to request. @@ -60908,7 +60292,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessThreadsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPremierAddOnsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -60933,10 +60317,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (processId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "processId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -60958,17 +60338,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreadsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPremierAddOnsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -61034,7 +60412,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -61064,7 +60442,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -61077,7 +60455,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -61097,10 +60475,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get public certificates for an app or a deployment slot. + /// Gets a named add-on of an app. /// /// - /// Description for Get public certificates for an app or a deployment slot. + /// Description for Gets a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -61108,9 +60486,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Add-on name. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API gets - /// hostname bindings for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the named add-on for the production slot. /// /// /// Headers that will be added to request. @@ -61133,7 +60514,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublicCertificatesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -61158,6 +60539,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (premierAddOnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -61179,15 +60564,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificatesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPremierAddOnSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -61283,7 +60670,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -61296,7 +60683,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -61316,12 +60703,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the named public certificate for an app (or deployment slot, if - /// specified). + /// Updates a named add-on of an app. /// /// - /// Description for Get the named public certificate for an app (or deployment - /// slot, if specified). + /// Description for Updates a named add-on of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -61329,12 +60714,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API the named - /// binding for the production slot. + /// + /// Add-on name. /// - /// - /// Public certificate name. + /// + /// A JSON representation of the edited premier add-on. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the named add-on for the production slot. /// /// /// Headers that will be added to request. @@ -61357,7 +60745,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AddPremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOn premierAddOn, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -61382,13 +60770,21 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (premierAddOnName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); } - if (publicCertificateName == null) + if (premierAddOn == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); + } + if (premierAddOn != null) + { + premierAddOn.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -61407,18 +60803,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("premierAddOn", premierAddOn); tracingParameters.Add("slot", slot); - tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPublicCertificateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddPremierAddOnSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -61432,7 +60829,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -61463,6 +60860,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(premierAddOn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -61513,7 +60916,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -61526,7 +60929,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -61546,10 +60949,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a hostname binding for an app. + /// Delete a premier add-on from an app. /// /// - /// Description for Creates a hostname binding for an app. + /// Description for Delete a premier add-on from an app. /// /// /// Name of the resource group to which the resource belongs. @@ -61557,16 +60960,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Public certificate name. - /// - /// - /// Public certificate details. This is the JSON representation of a - /// PublicCertificate object. + /// + /// Add-on name. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// create a binding for the production slot. + /// delete the named add-on for the production slot. /// /// /// Headers that will be added to request. @@ -61577,9 +60976,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -61589,7 +60985,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdatePublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeletePremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -61614,13 +61010,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publicCertificateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); - } - if (publicCertificate == null) + if (premierAddOnName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificate"); + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); } if (slot == null) { @@ -61643,18 +61035,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publicCertificateName", publicCertificateName); - tracingParameters.Add("publicCertificate", publicCertificate); + tracingParameters.Add("premierAddOnName", premierAddOnName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdatePublicCertificateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeletePremierAddOnSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -61669,7 +61060,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -61700,9 +61091,227 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(publicCertificate != null) + // Set Credentials + if (Client.Credentials != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publicCertificate, Client.SerializationSettings); + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 a named add-on of an app. + /// + /// + /// Description for Updates a named add-on of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Add-on name. + /// + /// + /// A JSON representation of the edited premier add-on. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the named add-on for the production slot. + /// + /// + /// 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> UpdatePremierAddOnSlotWithHttpMessagesAsync(string resourceGroupName, string name, string premierAddOnName, PremierAddOnPatchResource premierAddOn, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (premierAddOnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOnName"); + } + if (premierAddOn == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "premierAddOn"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("premierAddOnName", premierAddOnName); + tracingParameters.Add("premierAddOn", premierAddOn); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdatePremierAddOnSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{premierAddOnName}", System.Uri.EscapeDataString(premierAddOnName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(premierAddOn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(premierAddOn, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -61756,7 +61365,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -61769,7 +61378,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -61789,23 +61398,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a hostname binding for an app. + /// Gets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Deletes a hostname binding for an app. + /// Description for Gets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the binding for the production slot. - /// - /// - /// Public certificate name. + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -61816,6 +61423,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -61825,7 +61435,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeletePublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateAccessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -61854,10 +61464,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } - if (publicCertificateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -61876,17 +61482,15 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeletePublicCertificateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateAccessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -61900,7 +61504,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -61951,7 +61555,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -61981,13 +61585,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -61996,25 +61618,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the publishing profile for an app (or deployment slot, if specified). + /// Sets data around private site access enablement and authorized Virtual + /// Networks that can access the site. /// /// - /// Description for Gets the publishing profile for an app (or deployment slot, - /// if specified). + /// Description for Sets data around private site access enablement and + /// authorized Virtual Networks that can access the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Specifies publishingProfileOptions for publishing profile. For example, use - /// {"format": "FileZilla3"} to get a FileZilla publishing profile. + /// + /// The information for the private access /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the publishing profile for the production slot. + /// The name of the slot for the web app. /// /// /// Headers that will be added to request. @@ -62037,7 +61658,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListPublishingProfileXmlWithSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PutPrivateAccessVnetSlotWithHttpMessagesAsync(string resourceGroupName, string name, PrivateAccess access, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -62062,9 +61683,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (publishingProfileOptions == null) + if (access == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publishingProfileOptions"); + throw new ValidationException(ValidationRules.CannotBeNull, "access"); } if (slot == null) { @@ -62087,14 +61708,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("publishingProfileOptions", publishingProfileOptions); + tracingParameters.Add("access", access); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublishingProfileXmlWithSecretsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "PutPrivateAccessVnetSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -62111,7 +61732,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -62142,9 +61763,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(publishingProfileOptions != null) + if(access != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publishingProfileOptions, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(access, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -62160,7 +61781,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -62198,7 +61819,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -62208,7 +61829,20 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -62218,22 +61852,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Resets the configuration settings of the current slot if they were - /// previously modified by calling the API with POST. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Resets the configuration settings of the current slot if - /// they were previously modified by calling the API with POST. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Name of the site. /// /// - /// Name of the deployment slot. If a slot is not specified, the API resets - /// configuration settings for the production slot. + /// Name of the site deployment slot. /// /// /// Headers that will be added to request. @@ -62244,6 +61876,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -62253,7 +61888,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ResetSlotConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetPrivateEndpointConnectionListSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -62301,11 +61936,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ResetSlotConfigurationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionListSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -62322,7 +61957,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -62403,13 +62038,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -62418,28 +62071,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restarts an app (or deployment slot, if specified). + /// Gets a private endpoint connection /// /// - /// Description for Restarts an app (or deployment slot, if specified). + /// Description for Gets a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restart the production slot. + /// Name of the site. /// - /// - /// Specify true to apply the configuration settings and restarts the app only - /// if necessary. By default, the API always restarts and reprovisions the app. + /// + /// Name of the private endpoint connection. /// - /// - /// Specify true to block until the app is restarted. By default, it is set to - /// false, and the API responds immediately (asynchronous). + /// + /// Name of the site deployment slot. /// /// /// Headers that will be added to request. @@ -62450,6 +62097,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -62459,7 +62109,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RestartSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, bool? softRestart = default(bool?), bool? synchronous = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -62484,6 +62134,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -62505,28 +62159,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("slot", slot); - tracingParameters.Add("softRestart", softRestart); - tracingParameters.Add("synchronous", synchronous); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RestartSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (softRestart != null) - { - _queryParameters.Add(string.Format("softRestart={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softRestart, Client.SerializationSettings).Trim('"')))); - } - if (synchronous != null) - { - _queryParameters.Add(string.Format("synchronous={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(synchronous, Client.SerializationSettings).Trim('"')))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -62538,7 +62184,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -62619,13 +62265,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -62634,55 +62298,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores an app from a backup blob in Azure Storage. + /// Approves or rejects a private endpoint connection /// /// - /// Description for Restores an app from a backup blob in Azure Storage. + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Information on restore request . - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restore a backup of the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RestoreFromBackupBlobSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRestoreFromBackupBlobSlotWithHttpMessagesAsync(resourceGroupName, name, request, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Restores a deleted web app to this web app. - /// - /// - /// Description for Restores a deleted web app to this web app. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Name of the site. /// - /// - /// Name of web app. + /// /// - /// - /// Deleted web app restore information. + /// /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. /// /// /// The headers that will be added to request. @@ -62690,32 +62321,28 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - public async Task RestoreFromDeletedAppSlotWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRestoreFromDeletedAppSlotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + AzureOperationResponse _response = await BeginApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Restores a web app from a snapshot. + /// Deletes a private endpoint connection /// /// - /// Description for Restores a web app from a snapshot. + /// Description for Deletes a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the site. /// - /// - /// Snapshot restore settings. Snapshot information can be obtained by calling - /// GetDeletedSites or GetSiteSnapshots API. + /// /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. /// /// /// The headers that will be added to request. @@ -62723,29 +62350,26 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// The cancellation token. /// - public async Task RestoreSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginRestoreSnapshotSlotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, slot, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, slot, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Get list of siteextensions for a web site, or a deployment slot. + /// Gets the private link resources /// /// - /// Description for Get list of siteextensions for a web site, or a deployment - /// slot. + /// Description for Gets the private link resources /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. /// /// /// Headers that will be added to request. @@ -62768,7 +62392,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteExtensionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPrivateLinkResourcesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -62816,11 +62440,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResourcesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateLinkResources").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -62888,7 +62512,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -62918,7 +62542,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -62931,7 +62555,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -62951,12 +62575,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get site extension information by its ID for a web site, or a deployment - /// slot. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Get site extension information by its ID for a web site, or - /// a deployment slot. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -62964,12 +62588,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Site extension name. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -62992,7 +62613,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -63017,10 +62638,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -63042,17 +62659,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSiteExtensionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -63148,7 +62763,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -63161,7 +62776,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -63181,43 +62796,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Install site extension on a web site, or a deployment slot. - /// - /// - /// Description for Install site extension on a web site, or a deployment slot. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Site name. - /// - /// - /// Site extension name. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> InstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginInstallSiteExtensionSlotWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Remove a site extension from a web site, or a deployment slot. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Remove a site extension from a web site, or a deployment - /// slot. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. @@ -63225,12 +62809,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Site extension name. + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -63241,6 +62825,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -63250,7 +62837,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -63275,9 +62862,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) + if (processId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { @@ -63300,17 +62887,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSiteExtensionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -63325,7 +62912,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -63376,7 +62963,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -63406,13 +62993,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -63421,58 +63026,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task CopySlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginCopySlotSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the difference in configuration settings between two web app slots. + /// Terminate a process by its ID for a web site, or a deployment slot, or + /// specific scaled-out instance in a web site. /// /// - /// Description for Get the difference in configuration settings between two - /// web app slots. + /// Description for Terminate a process by its ID for a web site, or a + /// deployment slot, or specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// JSON object that contains the target slot name. See example. + /// + /// PID. /// /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -63483,9 +63055,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -63495,7 +63064,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSlotDifferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteProcessSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -63520,13 +63089,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); - } - if (slotSwapEntity != null) + if (processId == null) { - slotSwapEntity.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); } if (slot == null) { @@ -63549,16 +63114,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlotDifferencesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteProcessSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -63573,7 +63139,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -63604,12 +63170,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -63630,7 +63190,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -63660,31 +63220,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -63693,51 +63235,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Swaps two deployment slots of an app. + /// Get a memory dump of a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Swaps two deployment slots of an app. + /// Description for Get a memory dump of a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task SwapSlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginSwapSlotSlotWithHttpMessagesAsync(resourceGroupName, name, slotSwapEntity, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns all Snapshots to the user. - /// - /// - /// Description for Returns all Snapshots to the user. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Site name. /// - /// - /// Website Name. + /// + /// PID. /// /// - /// Website Slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -63760,7 +63276,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSnapshotsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessDumpSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -63785,6 +63301,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -63806,15 +63326,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessDumpSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -63872,7 +63394,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -63880,7 +63402,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -63910,7 +63432,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -63920,20 +63442,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -63943,20 +63452,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Returns all Snapshots to the user from DRSecondary endpoint. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Returns all Snapshots to the user from DRSecondary - /// endpoint. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Website Name. + /// Site name. + /// + /// + /// PID. /// /// - /// Website Slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -63979,7 +63493,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSnapshotsFromDRSecondarySlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessModulesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64004,6 +63518,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -64025,15 +63543,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsFromDRSecondarySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessModulesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -64099,7 +63619,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -64129,7 +63649,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -64142,7 +63662,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -64162,20 +63682,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the source control configuration of an app. + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. /// /// - /// Description for Gets the source control configuration of an app. + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// PID. + /// + /// + /// Module base address. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the source control configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -64198,7 +63726,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetProcessModuleSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string baseAddress, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64223,6 +63751,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } + if (baseAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "baseAddress"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -64244,15 +63780,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); + tracingParameters.Add("baseAddress", baseAddress); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSourceControlSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetProcessModuleSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); + _url = _url.Replace("{baseAddress}", System.Uri.EscapeDataString(baseAddress)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -64318,7 +63858,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -64348,7 +63888,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -64361,43 +63901,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -64417,52 +63921,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Updates the source control configuration of an app. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON representation of a SiteSourceControl object. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the source control configuration for the production slot. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateSourceControlSlotWithHttpMessagesAsync(resourceGroupName, name, siteSourceControl, slot, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes the source control configuration of an app. - /// - /// - /// Description for Deletes the source control configuration of an app. - /// - /// - /// Name of the resource group to which the resource belongs. + /// Site name. /// - /// - /// Name of the app. + /// + /// PID. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the source control configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -64473,6 +63950,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -64482,7 +63962,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessThreadsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string processId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64507,6 +63987,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (processId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "processId"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -64528,15 +64012,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("processId", processId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSourceControlSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreadsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{processId}", System.Uri.EscapeDataString(processId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -64551,7 +64037,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -64602,7 +64088,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -64632,13 +64118,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -64647,10 +64151,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Get public certificates for an app or a deployment slot. /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Get public certificates for an app or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -64658,12 +64162,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteSourceControl object. See example. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the source control configuration for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API gets + /// hostname bindings for the production slot. /// /// /// Headers that will be added to request. @@ -64686,7 +64187,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPublicCertificatesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64711,10 +64212,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteSourceControl == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -64736,14 +64233,13 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteSourceControl", siteSourceControl); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSourceControlSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificatesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -64760,7 +64256,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -64791,12 +64287,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteSourceControl != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -64817,7 +64307,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -64847,7 +64337,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -64860,43 +64350,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -64916,10 +64370,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Starts an app (or deployment slot, if specified). + /// Get the named public certificate for an app (or deployment slot, if + /// specified). /// /// - /// Description for Starts an app (or deployment slot, if specified). + /// Description for Get the named public certificate for an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -64928,8 +64384,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will start - /// the production slot. + /// Name of the deployment slot. If a slot is not specified, the API the named + /// binding for the production slot. + /// + /// + /// Public certificate name. /// /// /// Headers that will be added to request. @@ -64940,6 +64399,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -64949,7 +64411,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -64978,6 +64440,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (publicCertificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -64996,15 +64462,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); + tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StartSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPublicCertificateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -65018,7 +64486,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -65099,13 +64567,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -65114,57 +64600,27 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Creates a hostname binding for an app. /// /// - /// Description for Start capturing network packets for the site. + /// Description for Creates a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// Name of the app. /// - public async Task>> StartNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginStartNetworkTraceSlotWithHttpMessagesAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stops an app (or deployment slot, if specified). - /// - /// - /// Description for Stops an app (or deployment slot, if specified). - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Public certificate name. /// - /// - /// Name of the app. + /// + /// Public certificate details. This is the JSON representation of a + /// PublicCertificate object. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will stop - /// the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// create a binding for the production slot. /// /// /// Headers that will be added to request. @@ -65175,6 +64631,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -65184,7 +64643,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdatePublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string publicCertificateName, PublicCertificate publicCertificate, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -65209,6 +64668,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (publicCertificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } + if (publicCertificate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificate"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -65230,15 +64697,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("publicCertificateName", publicCertificateName); + tracingParameters.Add("publicCertificate", publicCertificate); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdatePublicCertificateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -65253,7 +64723,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -65284,6 +64754,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(publicCertificate != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publicCertificate, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -65334,209 +64810,30 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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; - } - - /// - /// Stop ongoing capturing network packets for the site. - /// - /// - /// Description for Stop ongoing capturing network packets for the site. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. - /// - /// - /// 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 StopNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopNetworkTraceSlot", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) + // Deserialize Response + if ((int)_statusCode == 200) { - foreach(var _header in customHeaders) + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try + catch (JsonException ex) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex.Body = _errorBody; + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } - 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) { @@ -65546,20 +64843,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Sync web app repository. + /// Deletes a hostname binding for an app. /// /// - /// Description for Sync web app repository. + /// Description for Deletes a hostname binding for an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the binding for the production slot. + /// + /// + /// Public certificate name. /// /// /// Headers that will be added to request. @@ -65579,7 +64879,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncRepositorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeletePublicCertificateSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string publicCertificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -65608,6 +64908,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } + if (publicCertificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicCertificateName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -65626,15 +64930,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); + tracingParameters.Add("publicCertificateName", publicCertificateName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncRepositorySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeletePublicCertificateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{publicCertificateName}", System.Uri.EscapeDataString(publicCertificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -65648,7 +64954,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -65699,7 +65005,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -65744,10 +65050,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Syncs function trigger metadata to the management database + /// Gets the publishing profile for an app (or deployment slot, if specified). /// /// - /// Description for Syncs function trigger metadata to the management database + /// Description for Gets the publishing profile for an app (or deployment slot, + /// if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -65755,8 +65062,13 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Specifies publishingProfileOptions for publishing profile. For example, use + /// {"format": "FileZilla3"} to get a FileZilla publishing profile. + /// /// - /// Name of the deployment slot. + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the publishing profile for the production slot. /// /// /// Headers that will be added to request. @@ -65767,6 +65079,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -65776,7 +65091,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncFunctionTriggersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListPublishingProfileXmlWithSecretsSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmPublishingProfileOptions publishingProfileOptions, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -65801,6 +65116,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (publishingProfileOptions == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publishingProfileOptions"); + } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -65822,13 +65141,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("publishingProfileOptions", publishingProfileOptions); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionTriggersSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublishingProfileXmlWithSecretsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -65876,6 +65196,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(publishingProfileOptions != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(publishingProfileOptions, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -65888,7 +65214,7 @@ internal WebAppsOperations(WebSiteManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -65896,7 +65222,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -65926,13 +65252,18 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -65941,20 +65272,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List triggered web jobs for an app, or a deployment slot. + /// Resets the configuration settings of the current slot if they were + /// previously modified by calling the API with POST. /// /// - /// Description for List triggered web jobs for an app, or a deployment slot. + /// Description for Resets the configuration settings of the current slot if + /// they were previously modified by calling the API with POST. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes a - /// deployment for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API resets + /// configuration settings for the production slot. /// /// /// Headers that will be added to request. @@ -65965,9 +65298,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -65977,7 +65307,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTriggeredWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ResetSlotConfigurationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66025,11 +65355,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ResetSlotConfigurationSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -66046,7 +65376,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -66127,31 +65457,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -66160,24 +65472,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a triggered web job by its ID for an app, or a deployment slot. + /// Restarts an app (or deployment slot, if specified). /// /// - /// Description for Gets a triggered web job by its ID for an app, or a - /// deployment slot. + /// Description for Restarts an app (or deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Name of Web Job. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// restart the production slot. + /// + /// + /// Specify true to apply the configuration settings and restarts the app only + /// if necessary. By default, the API always restarts and reprovisions the app. + /// + /// + /// Specify true to block until the app is restarted. By default, it is set to + /// false, and the API responds immediately (asynchronous). /// /// /// Headers that will be added to request. @@ -66188,9 +65504,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -66200,7 +65513,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RestartSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, bool? softRestart = default(bool?), bool? synchronous = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66225,10 +65538,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -66250,20 +65559,28 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); + tracingParameters.Add("softRestart", softRestart); + tracingParameters.Add("synchronous", synchronous); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RestartSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (softRestart != null) + { + _queryParameters.Add(string.Format("softRestart={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softRestart, Client.SerializationSettings).Trim('"')))); + } + if (synchronous != null) + { + _queryParameters.Add(string.Format("synchronous={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(synchronous, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -66275,7 +65592,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -66326,7 +65643,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -66356,31 +65673,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -66389,24 +65688,118 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a triggered web job by its ID for an app, or a deployment slot. + /// Restores an app from a backup blob in Azure Storage. /// /// - /// Description for Delete a triggered web job by its ID for an app, or a - /// deployment slot. + /// Description for Restores an app from a backup blob in Azure Storage. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// Information on restore request . /// /// - /// Name of the deployment slot. If a slot is not specified, the API deletes - /// web job for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// restore a backup of the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFromBackupBlobSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFromBackupBlobSlotWithHttpMessagesAsync(resourceGroupName, name, request, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores a deleted web app to this web app. + /// + /// + /// Description for Restores a deleted web app to this web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Deleted web app restore information. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFromDeletedAppSlotWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFromDeletedAppSlotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restores a web app from a snapshot. + /// + /// + /// Description for Restores a web app from a snapshot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Snapshot restore settings. Snapshot information can be obtained by calling + /// GetDeletedSites or GetSiteSnapshots API. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreSnapshotSlotWithHttpMessagesAsync(resourceGroupName, name, restoreRequest, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get list of siteextensions for a web site, or a deployment slot. + /// + /// + /// Description for Get list of siteextensions for a web site, or a deployment + /// slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -66417,6 +65810,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -66426,7 +65822,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteExtensionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66451,10 +65847,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -66476,17 +65868,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteTriggeredWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -66501,7 +65891,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -66552,7 +65942,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -66582,13 +65972,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -66597,11 +66005,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List a triggered web job's history for an app, or a deployment slot. + /// Get site extension information by its ID for a web site, or a deployment + /// slot. /// /// - /// Description for List a triggered web job's history for an app, or a - /// deployment slot. + /// Description for Get site extension information by its ID for a web site, or + /// a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -66609,8 +66018,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Name of Web Job. + /// + /// Site extension name. /// /// /// Name of the deployment slot. If a slot is not specified, the API uses the @@ -66637,7 +66046,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTriggeredWebJobHistorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66662,9 +66071,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (slot == null) { @@ -66687,17 +66096,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobHistorySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteExtensionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -66793,7 +66202,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -66806,7 +66215,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -66826,12 +66235,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a triggered web job's history by its ID for an app, , or a deployment - /// slot. + /// Install site extension on a web site, or a deployment slot. /// /// - /// Description for Gets a triggered web job's history by its ID for an app, , - /// or a deployment slot. + /// Description for Install site extension on a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -66839,17 +66246,47 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Name of Web Job. - /// - /// - /// History ID. + /// + /// Site extension name. /// /// /// Name of the deployment slot. If a slot is not specified, the API uses the /// production slot. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> InstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginInstallSiteExtensionSlotWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Remove a site extension from a web site, or a deployment slot. + /// + /// + /// Description for Remove a site extension from a web site, or a deployment + /// slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Site extension name. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. + /// + /// /// Headers that will be added to request. /// /// @@ -66858,9 +66295,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -66870,7 +66304,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTriggeredWebJobHistorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -66895,13 +66329,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } - if (id == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (slot == null) { @@ -66924,19 +66354,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); - tracingParameters.Add("id", id); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobHistorySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSiteExtensionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -66951,7 +66379,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -67002,7 +66430,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 204 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -67032,31 +66460,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -67065,23 +66475,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Run a triggered web job for an app, or a deployment slot. + /// Get the difference in configuration settings between two web app slots. /// /// - /// Description for Run a triggered web job for an app, or a deployment slot. + /// Description for Get the difference in configuration settings between two + /// web app slots. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// JSON object that contains the target slot name. See example. /// /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. /// /// /// Headers that will be added to request. @@ -67092,6 +66503,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -67101,7 +66515,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RunTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSlotDifferencesSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -67126,9 +66540,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (slotSwapEntity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); } if (slot == null) { @@ -67151,17 +66569,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RunTriggeredWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlotDifferencesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -67207,6 +66624,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -67227,7 +66650,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -67257,13 +66680,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -67272,12 +66713,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the quota usage information of an app (or deployment slot, if - /// specified). + /// Swaps two deployment slots of an app. /// /// - /// Description for Gets the quota usage information of an app (or deployment - /// slot, if specified). + /// Description for Swaps two deployment slots of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -67285,15 +66724,40 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// JSON object that contains the target slot name. See example. + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// quota information of the production slot. + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. /// - /// - /// Return only information specified in the filter (using OData syntax). For - /// example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and - /// startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and - /// timeGrain eq duration'[Hour|Minute|Day]'. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task SwapSlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginSwapSlotSlotWithHttpMessagesAsync(resourceGroupName, name, slotSwapEntity, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns all Snapshots to the user. + /// + /// + /// Description for Returns all Snapshots to the user. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Website Name. + /// + /// + /// Website Slot. /// /// /// Headers that will be added to request. @@ -67316,7 +66780,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListUsagesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSnapshotsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -67363,22 +66827,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); - tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsagesSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -67471,7 +66930,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -67484,7 +66943,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -67504,21 +66963,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the virtual networks the app (or deployment slot) is connected to. + /// Returns all Snapshots to the user from DRSecondary endpoint. /// /// - /// Description for Gets the virtual networks the app (or deployment slot) is - /// connected to. + /// Description for Returns all Snapshots to the user from DRSecondary + /// endpoint. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Website Name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// virtual network connections for the production slot. + /// Website Slot. /// /// /// Headers that will be added to request. @@ -67541,7 +66999,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVnetConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSnapshotsFromDRSecondarySlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -67589,11 +67047,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVnetConnectionsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsFromDRSecondarySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -67691,7 +67149,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -67704,7 +67162,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -67724,12 +67182,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a virtual network the app (or deployment slot) is connected to by - /// name. + /// Gets the source control configuration of an app. /// /// - /// Description for Gets a virtual network the app (or deployment slot) is - /// connected to by name. + /// Description for Gets the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -67737,12 +67193,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the virtual network. - /// /// /// Name of the deployment slot. If a slot is not specified, the API will get - /// the named virtual network for the production slot. + /// the source control configuration for the production slot. /// /// /// Headers that will be added to request. @@ -67765,7 +67218,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -67790,10 +67243,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -67815,17 +67264,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSourceControlSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -67891,7 +67338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -67921,7 +67368,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -67934,7 +67381,43 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -67954,12 +67437,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a Virtual Network connection to an app or slot (PUT) or updates the - /// connection properties (PATCH). + /// Updates the source control configuration of an app. /// /// - /// Description for Adds a Virtual Network connection to an app or slot (PUT) - /// or updates the connection properties (PATCH). + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -67967,15 +67448,43 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of an existing Virtual Network. + /// + /// JSON representation of a SiteSourceControl object. See example. /// - /// - /// Properties of the Virtual Network connection. See example. + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the source control configuration for the production slot. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateSourceControlSlotWithHttpMessagesAsync(resourceGroupName, name, siteSourceControl, slot, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the source control configuration of an app. + /// + /// + /// Description for Deletes the source control configuration of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the source control configuration for the production slot. + /// + /// /// /// /// Headers that will be added to request. @@ -67986,9 +67495,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -67998,7 +67504,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string additionalFlags = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68023,14 +67529,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68052,21 +67550,23 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); + tracingParameters.Add("additionalFlags", additionalFlags); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSourceControlSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (additionalFlags != null) + { + _queryParameters.Add(string.Format("additionalFlags={0}", System.Uri.EscapeDataString(additionalFlags))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -68078,7 +67578,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68109,12 +67609,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -68135,7 +67629,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -68165,31 +67659,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -68198,12 +67674,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a connection from an app (or deployment slot to a named virtual - /// network. + /// Updates the source control configuration of an app. /// /// - /// Description for Deletes a connection from an app (or deployment slot to a - /// named virtual network. + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -68211,12 +67685,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the virtual network. + /// + /// JSON representation of a SiteSourceControl object. See example. /// /// /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the connection for the production slot. + /// update the source control configuration for the production slot. /// /// /// Headers that will be added to request. @@ -68227,6 +67701,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -68236,7 +67713,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68261,9 +67738,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) + if (siteSourceControl == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); } if (slot == null) { @@ -68286,17 +67763,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("siteSourceControl", siteSourceControl); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteVnetConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSourceControlSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -68311,7 +67787,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68342,6 +67818,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteSourceControl != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -68362,7 +67844,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -68392,13 +67874,67 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -68407,12 +67943,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a Virtual Network connection to an app or slot (PUT) or updates the - /// connection properties (PATCH). + /// Starts an app (or deployment slot, if specified). /// /// - /// Description for Adds a Virtual Network connection to an app or slot (PUT) - /// or updates the connection properties (PATCH). + /// Description for Starts an app (or deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -68420,15 +67954,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of an existing Virtual Network. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API will start + /// the production slot. /// /// /// Headers that will be added to request. @@ -68439,9 +67967,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -68451,7 +67976,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StartSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68476,14 +68001,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68505,18 +68022,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StartSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -68531,7 +68045,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68562,12 +68076,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -68618,31 +68126,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -68651,26 +68141,57 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets an app's Virtual Network gateway. + /// Start capturing network packets for the site. /// /// - /// Description for Gets an app's Virtual Network gateway. + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of the Virtual Network. + /// + /// The name of the slot for this web app. /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> StartNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginStartNetworkTraceSlotWithHttpMessagesAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stops an app (or deployment slot, if specified). + /// + /// + /// Description for Stops an app (or deployment slot, if specified). + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get a - /// gateway for the production slot's Virtual Network. + /// Name of the deployment slot. If a slot is not specified, the API will stop + /// the production slot. /// /// /// Headers that will be added to request. @@ -68681,9 +68202,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -68693,7 +68211,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68718,14 +68236,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68747,19 +68257,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionGatewaySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -68774,7 +68280,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -68825,7 +68331,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -68855,31 +68361,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -68888,30 +68376,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Stop ongoing capturing network packets for the site. /// /// - /// Description for Adds a gateway to a connected Virtual Network (PUT) or - /// updates it (PATCH). + /// Description for Stop ongoing capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". - /// - /// - /// The properties to update this gateway with. + /// The name of the web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update a gateway for the production slot's Virtual Network. + /// The name of the slot for this web app. /// /// /// Headers that will be added to request. @@ -68922,9 +68399,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -68934,7 +68408,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -68959,22 +68433,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } - if (connectionEnvelope != null) - { - connectionEnvelope.Validate(); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -68996,20 +68454,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionGatewaySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopNetworkTraceSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -69024,7 +68477,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -69055,12 +68508,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -69081,7 +68528,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -69111,31 +68558,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -69144,30 +68573,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Sync web app repository. /// /// - /// Description for Adds a gateway to a connected Virtual Network (PUT) or - /// updates it (PATCH). + /// Description for Sync web app repository. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". - /// - /// - /// The properties to update this gateway with. + /// Name of web app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update a gateway for the production slot's Virtual Network. + /// Name of web app slot. If not specified then will default to production + /// slot. /// /// /// Headers that will be added to request. @@ -69178,9 +68597,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -69190,7 +68606,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncRepositorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69215,18 +68631,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -69248,20 +68652,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionGatewaySlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncRepositorySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -69276,7 +68675,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -69307,12 +68706,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -69363,31 +68756,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -69396,20 +68771,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List webjobs for an app, or a deployment slot. + /// Syncs function trigger metadata to the management database /// /// - /// Description for List webjobs for an app, or a deployment slot. + /// Description for Syncs function trigger metadata to the management database /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. /// /// /// Headers that will be added to request. @@ -69420,9 +68794,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -69432,7 +68803,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncFunctionTriggersSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69480,11 +68851,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("name", name); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebJobsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionTriggersSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); @@ -69501,7 +68872,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -69552,7 +68923,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -69582,31 +68953,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -69615,10 +68968,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get webjob information for an app, or a deployment slot. + /// List triggered web jobs for an app, or a deployment slot. /// /// - /// Description for Get webjob information for an app, or a deployment slot. + /// Description for List triggered web jobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -69626,12 +68979,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Name of the web job. - /// /// - /// Name of the deployment slot. If a slot is not specified, the API returns - /// deployments for the production slot. + /// Name of the deployment slot. If a slot is not specified, the API deletes a + /// deployment for the production slot. /// /// /// Headers that will be added to request. @@ -69654,7 +69004,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListTriggeredWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69679,10 +69029,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (slot == null) { throw new ValidationException(ValidationRules.CannotBeNull, "slot"); @@ -69704,17 +69050,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebJobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -69810,7 +69154,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -69823,7 +69167,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -69843,20 +69187,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get the difference in configuration settings between two web app slots. + /// Gets a triggered web job by its ID for an app, or a deployment slot. /// /// - /// Description for Get the difference in configuration settings between two - /// web app slots. + /// Description for Gets a triggered web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. /// - /// - /// JSON object that contains the target slot name. See example. + /// + /// Name of Web Job. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -69879,7 +69227,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSlotDifferencesFromProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -69904,13 +69252,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } - if (slotSwapEntity != null) + if (slot == null) { - slotSwapEntity.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -69929,15 +69277,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlotDifferencesFromProduction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -69951,7 +69302,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -69982,12 +69333,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -70008,7 +69353,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70038,7 +69383,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -70051,7 +69396,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -70071,44 +69416,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Swaps two deployment slots of an app. + /// Delete a triggered web job by its ID for an app, or a deployment slot. /// /// - /// Description for Swaps two deployment slots of an app. + /// Description for Delete a triggered web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// Site name. /// - public async Task SwapSlotWithProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginSwapSlotWithProductionWithHttpMessagesAsync(resourceGroupName, name, slotSwapEntity, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns all Snapshots to the user. - /// - /// - /// Description for Returns all Snapshots to the user. - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Name of Web Job. /// - /// - /// Website Name. + /// + /// Name of the deployment slot. If a slot is not specified, the API deletes + /// web job for the production slot. /// /// /// Headers that will be added to request. @@ -70119,9 +69444,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -70131,7 +69453,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSnapshotsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -70156,6 +69478,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -70173,14 +69503,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSnapshots", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteTriggeredWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -70194,7 +69528,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -70245,7 +69579,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70275,31 +69609,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -70308,17 +69624,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Returns all Snapshots to the user from DRSecondary endpoint. + /// List a triggered web job's history for an app, or a deployment slot. /// /// - /// Description for Returns all Snapshots to the user from DRSecondary - /// endpoint. + /// Description for List a triggered web job's history for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Website Name. + /// Site name. + /// + /// + /// Name of Web Job. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -70341,7 +69664,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSnapshotsFromDRSecondaryWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListTriggeredWebJobHistorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -70366,6 +69689,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -70383,14 +69714,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsFromDRSecondary", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobHistorySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -70455,7 +69790,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70485,7 +69820,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -70498,7 +69833,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -70518,16 +69853,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the source control configuration of an app. + /// Gets a triggered web job's history by its ID for an app, , or a deployment + /// slot. /// /// - /// Description for Gets the source control configuration of an app. + /// Description for Gets a triggered web job's history by its ID for an app, , + /// or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// Name of Web Job. + /// + /// + /// History ID. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -70550,7 +69897,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetTriggeredWebJobHistorySlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string id, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -70575,6 +69922,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -70592,14 +69951,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("id", id); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSourceControl", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobHistorySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -70664,7 +70029,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70694,7 +70059,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -70707,43 +70072,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -70763,44 +70092,23 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Run a triggered web job for an app, or a deployment slot. /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Run a triggered web job for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON representation of a SiteSourceControl object. See example. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// Site name. /// - public async Task> CreateOrUpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateSourceControlWithHttpMessagesAsync(resourceGroupName, name, siteSourceControl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes the source control configuration of an app. - /// - /// - /// Description for Deletes the source control configuration of an app. - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Name of Web Job. /// - /// - /// Name of the app. + /// + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. /// /// /// Headers that will be added to request. @@ -70820,7 +70128,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RunTriggeredWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -70845,6 +70153,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -70862,14 +70178,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSourceControl", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RunTriggeredWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -70883,7 +70203,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -70934,7 +70254,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -70979,10 +70299,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Gets the quota usage information of an app (or deployment slot, if + /// specified). /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Gets the quota usage information of an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -70990,8 +70312,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteSourceControl object. See example. + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// quota information of the production slot. + /// + /// + /// Return only information specified in the filter (using OData syntax). For + /// example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and + /// startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and + /// timeGrain eq duration'[Hour|Minute|Day]'. /// /// /// Headers that will be added to request. @@ -71014,7 +70343,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListUsagesSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71039,9 +70368,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteSourceControl == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -71060,21 +70389,27 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteSourceControl", siteSourceControl); + tracingParameters.Add("slot", slot); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSourceControl", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListUsagesSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -71082,7 +70417,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71113,12 +70448,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteSourceControl != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -71139,7 +70468,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -71169,7 +70498,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -71182,43 +70511,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -71238,10 +70531,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Starts an app (or deployment slot, if specified). + /// Gets the virtual networks the app (or deployment slot) is connected to. /// /// - /// Description for Starts an app (or deployment slot, if specified). + /// Description for Gets the virtual networks the app (or deployment slot) is + /// connected to. /// /// /// Name of the resource group to which the resource belongs. @@ -71249,6 +70543,10 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// virtual network connections for the production slot. + /// /// /// Headers that will be added to request. /// @@ -71258,6 +70556,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -71267,7 +70568,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVnetConnectionsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71292,6 +70593,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -71309,14 +70614,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Start", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVnetConnectionsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71330,7 +70637,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71411,13 +70718,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -71426,50 +70751,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Gets a virtual network the app (or deployment slot) is connected to by + /// name. /// /// - /// Description for Start capturing network packets for the site. + /// Description for Gets a virtual network the app (or deployment slot) is + /// connected to by name. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). - /// - /// - /// The Blob URL to store capture file. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// Name of the app. /// - public async Task>> StartNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginStartNetworkTraceWithHttpMessagesAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stops an app (or deployment slot, if specified). - /// - /// - /// Description for Stops an app (or deployment slot, if specified). - /// - /// - /// Name of the resource group to which the resource belongs. + /// + /// Name of the virtual network. /// - /// - /// Name of the app. + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the named virtual network for the production slot. /// /// /// Headers that will be added to request. @@ -71480,6 +70780,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -71489,7 +70792,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71514,6 +70817,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -71531,14 +70842,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Stop", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71552,7 +70867,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71633,13 +70948,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -71648,16 +70981,28 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Stop ongoing capturing network packets for the site. + /// Adds a Virtual Network connection to an app or slot (PUT) or updates the + /// connection properties (PATCH). /// /// - /// Description for Stop ongoing capturing network packets for the site. + /// Description for Adds a Virtual Network connection to an app or slot (PUT) + /// or updates the connection properties (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of the app. + /// + /// + /// Name of an existing Virtual Network. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update connections for the production slot. /// /// /// Headers that will be added to request. @@ -71668,6 +71013,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -71677,7 +71025,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71702,6 +71050,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -71719,14 +71079,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "StopNetworkTrace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71740,7 +71105,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71771,6 +71136,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -71791,7 +71162,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -71821,13 +71192,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -71836,16 +71225,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Sync web app repository. + /// Deletes a connection from an app (or deployment slot to a named virtual + /// network. /// /// - /// Description for Sync web app repository. + /// Description for Deletes a connection from an app (or deployment slot to a + /// named virtual network. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. + /// + /// + /// Name of the virtual network. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the connection for the production slot. /// /// /// Headers that will be added to request. @@ -71865,7 +71263,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncRepositoryWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -71890,6 +71288,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -71907,14 +71313,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncRepository", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteVnetConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -71928,7 +71338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -71979,7 +71389,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -72024,10 +71434,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Syncs function trigger metadata to the management database + /// Adds a Virtual Network connection to an app or slot (PUT) or updates the + /// connection properties (PATCH). /// /// - /// Description for Syncs function trigger metadata to the management database + /// Description for Adds a Virtual Network connection to an app or slot (PUT) + /// or updates the connection properties (PATCH). /// /// /// Name of the resource group to which the resource belongs. @@ -72035,6 +71447,16 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// + /// + /// Name of an existing Virtual Network. + /// + /// + /// Properties of the Virtual Network connection. See example. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update connections for the production slot. + /// /// /// Headers that will be added to request. /// @@ -72044,6 +71466,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -72053,7 +71478,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task SyncFunctionTriggersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateVnetConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72078,6 +71503,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -72095,14 +71532,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionTriggers", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72116,7 +71558,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -72147,6 +71589,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -72167,7 +71615,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -72197,13 +71645,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -72212,16 +71678,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List triggered web jobs for an app, or a deployment slot. + /// Gets an app's Virtual Network gateway. /// /// - /// Description for List triggered web jobs for an app, or a deployment slot. + /// Description for Gets an app's Virtual Network gateway. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. + /// + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get a + /// gateway for the production slot's Virtual Network. /// /// /// Headers that will be added to request. @@ -72244,7 +71720,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTriggeredWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72269,6 +71745,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -72286,14 +71774,20 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionGatewaySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72358,7 +71852,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -72388,7 +71882,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -72401,7 +71895,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -72421,20 +71915,30 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a triggered web job by its ID for an app, or a deployment slot. + /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). /// /// - /// Description for Gets a triggered web job by its ID for an app, or a - /// deployment slot. + /// Description for Adds a gateway to a connected Virtual Network (PUT) or + /// updates it (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// The properties to update this gateway with. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update a gateway for the production slot's Virtual Network. /// /// /// Headers that will be added to request. @@ -72457,7 +71961,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72482,9 +71986,25 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (connectionEnvelope != null) + { + connectionEnvelope.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -72503,16 +72023,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionGatewaySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72526,7 +72051,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -72557,6 +72082,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -72577,7 +72108,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -72607,7 +72138,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -72620,7 +72151,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -72640,20 +72171,30 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Delete a triggered web job by its ID for an app, or a deployment slot. + /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). /// /// - /// Description for Delete a triggered web job by its ID for an app, or a - /// deployment slot. + /// Description for Adds a gateway to a connected Virtual Network (PUT) or + /// updates it (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// The properties to update this gateway with. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will add + /// or update a gateway for the production slot's Virtual Network. /// /// /// Headers that will be added to request. @@ -72664,6 +72205,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -72673,7 +72217,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateVnetConnectionGatewaySlotWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72698,9 +72242,21 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -72719,16 +72275,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteTriggeredWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionGatewaySlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72742,7 +72303,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -72773,6 +72334,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -72793,7 +72360,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -72823,13 +72390,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -72838,11 +72423,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List a triggered web job's history for an app, or a deployment slot. + /// List webjobs for an app, or a deployment slot. /// /// - /// Description for List a triggered web job's history for an app, or a - /// deployment slot. + /// Description for List webjobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -72850,8 +72434,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Name of Web Job. + /// + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -72874,7 +72459,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListTriggeredWebJobHistoryWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebJobsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -72899,9 +72484,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -72920,16 +72505,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobHistory", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebJobsSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -72994,7 +72579,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73024,7 +72609,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -73037,7 +72622,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -73057,12 +72642,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a triggered web job's history by its ID for an app, , or a deployment - /// slot. + /// Get webjob information for an app, or a deployment slot. /// /// - /// Description for Gets a triggered web job's history by its ID for an app, , - /// or a deployment slot. + /// Description for Get webjob information for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -73071,10 +72654,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// Site name. /// /// - /// Name of Web Job. + /// Name of the web job. /// - /// - /// History ID. + /// + /// Name of the deployment slot. If a slot is not specified, the API returns + /// deployments for the production slot. /// /// /// Headers that will be added to request. @@ -73097,7 +72681,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetTriggeredWebJobHistoryWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWebJobSlotWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73126,9 +72710,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } - if (id == null) + if (slot == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "id"); + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -73148,17 +72732,17 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("webJobName", webJobName); - tracingParameters.Add("id", id); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobHistory", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebJobSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); - _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -73223,7 +72807,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73253,7 +72837,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -73266,7 +72850,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -73286,19 +72870,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Run a triggered web job for an app, or a deployment slot. + /// Get the difference in configuration settings between two web app slots. /// /// - /// Description for Run a triggered web job for an app, or a deployment slot. + /// Description for Get the difference in configuration settings between two + /// web app slots. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Name of Web Job. + /// + /// JSON object that contains the target slot name. See example. /// /// /// Headers that will be added to request. @@ -73309,6 +72894,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -73318,7 +72906,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RunTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSlotDifferencesFromProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73343,9 +72931,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) + if (slotSwapEntity == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); } if (Client.SubscriptionId == null) { @@ -73364,16 +72956,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RunTriggeredWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlotDifferencesFromProduction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -73418,6 +73009,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -73438,7 +73035,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -73468,13 +73065,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -73483,12 +73098,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the quota usage information of an app (or deployment slot, if - /// specified). + /// Swaps two deployment slots of an app. /// /// - /// Description for Gets the quota usage information of an app (or deployment - /// slot, if specified). + /// Description for Swaps two deployment slots of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -73496,11 +73109,33 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Return only information specified in the filter (using OData syntax). For - /// example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and - /// startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and - /// timeGrain eq duration'[Hour|Minute|Day]'. + /// + /// JSON object that contains the target slot name. See example. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task SwapSlotWithProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginSwapSlotWithProductionWithHttpMessagesAsync(resourceGroupName, name, slotSwapEntity, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns all Snapshots to the user. + /// + /// + /// Description for Returns all Snapshots to the user. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Website Name. /// /// /// Headers that will be added to request. @@ -73523,7 +73158,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSnapshotsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73565,21 +73200,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSnapshots", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", filter)); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -73672,7 +73302,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -73685,7 +73315,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -73705,17 +73335,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the virtual networks the app (or deployment slot) is connected to. + /// Returns all Snapshots to the user from DRSecondary endpoint. /// /// - /// Description for Gets the virtual networks the app (or deployment slot) is - /// connected to. + /// Description for Returns all Snapshots to the user from DRSecondary + /// endpoint. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Website Name. /// /// /// Headers that will be added to request. @@ -73738,7 +73368,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVnetConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSnapshotsFromDRSecondaryWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73781,11 +73411,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVnetConnections", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSnapshotsFromDRSecondary", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -73882,7 +73512,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -73895,7 +73525,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -73915,12 +73545,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a virtual network the app (or deployment slot) is connected to by - /// name. + /// Gets the source control configuration of an app. /// /// - /// Description for Gets a virtual network the app (or deployment slot) is - /// connected to by name. + /// Description for Gets the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -73928,9 +73556,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the virtual network. - /// /// /// Headers that will be added to request. /// @@ -73952,7 +73577,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -73977,10 +73602,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -73998,16 +73619,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSourceControl", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74072,7 +73691,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -74102,7 +73721,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -74115,7 +73734,43 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -74135,12 +73790,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a Virtual Network connection to an app or slot (PUT) or updates the - /// connection properties (PATCH). + /// Updates the source control configuration of an app. /// /// - /// Description for Adds a Virtual Network connection to an app or slot (PUT) - /// or updates the connection properties (PATCH). + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -74148,11 +73801,35 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of an existing Virtual Network. + /// + /// JSON representation of a SiteSourceControl object. See example. /// - /// - /// Properties of the Virtual Network connection. See example. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateSourceControlWithHttpMessagesAsync(resourceGroupName, name, siteSourceControl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the source control configuration of an app. + /// + /// + /// Description for Deletes the source control configuration of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// /// /// /// Headers that will be added to request. @@ -74163,9 +73840,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -74175,7 +73849,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, string additionalFlags = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74200,14 +73874,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -74225,19 +73891,21 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); + tracingParameters.Add("additionalFlags", additionalFlags); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteSourceControl", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (additionalFlags != null) + { + _queryParameters.Add(string.Format("additionalFlags={0}", System.Uri.EscapeDataString(additionalFlags))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -74249,7 +73917,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74280,12 +73948,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -74306,7 +73968,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -74336,31 +73998,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -74369,12 +74013,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a connection from an app (or deployment slot to a named virtual - /// network. + /// Updates the source control configuration of an app. /// /// - /// Description for Deletes a connection from an app (or deployment slot to a - /// named virtual network. + /// Description for Updates the source control configuration of an app. /// /// /// Name of the resource group to which the resource belongs. @@ -74382,8 +74024,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of the virtual network. + /// + /// JSON representation of a SiteSourceControl object. See example. /// /// /// Headers that will be added to request. @@ -74394,6 +74036,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -74403,7 +74048,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74428,9 +74073,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) + if (siteSourceControl == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); } if (Client.SubscriptionId == null) { @@ -74449,16 +74094,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("siteSourceControl", siteSourceControl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteVnetConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateSourceControl", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74472,7 +74116,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74503,6 +74147,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteSourceControl != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -74523,7 +74173,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -74553,13 +74203,67 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -74568,12 +74272,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a Virtual Network connection to an app or slot (PUT) or updates the - /// connection properties (PATCH). + /// Starts an app (or deployment slot, if specified). /// /// - /// Description for Adds a Virtual Network connection to an app or slot (PUT) - /// or updates the connection properties (PATCH). + /// Description for Starts an app (or deployment slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -74581,12 +74283,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Name of an existing Virtual Network. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// /// /// Headers that will be added to request. /// @@ -74596,9 +74292,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -74608,7 +74301,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StartWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74633,14 +74326,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -74658,17 +74343,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Start", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74682,7 +74364,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74713,12 +74395,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -74769,31 +74445,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -74802,22 +74460,50 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets an app's Virtual Network gateway. + /// Start capturing network packets for the site. /// /// - /// Description for Gets an app's Virtual Network gateway. + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// The name of the web app. /// - /// - /// Name of the Virtual Network. + /// + /// The duration to keep capturing in seconds. /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task>> StartNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse> _response = await BeginStartNetworkTraceWithHttpMessagesAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stops an app (or deployment slot, if specified). + /// + /// + /// Description for Stops an app (or deployment slot, if specified). + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. /// /// /// Headers that will be added to request. @@ -74828,9 +74514,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -74840,7 +74523,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -74865,14 +74548,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -74890,18 +74565,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionGateway", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Stop", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -74915,7 +74586,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -74966,7 +74637,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -74996,31 +74667,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -75029,26 +74682,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Stop ongoing capturing network packets for the site. /// /// - /// Description for Adds a gateway to a connected Virtual Network (PUT) or - /// updates it (PATCH). + /// Description for Stop ongoing capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". - /// - /// - /// The properties to update this gateway with. + /// The name of the web app. /// /// /// Headers that will be added to request. @@ -75059,9 +74702,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -75071,7 +74711,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75096,22 +74736,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } - if (connectionEnvelope != null) - { - connectionEnvelope.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -75129,19 +74753,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionGateway", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "StopNetworkTrace", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -75155,7 +74774,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -75186,12 +74805,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -75212,7 +74825,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -75242,31 +74855,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -75275,26 +74870,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + /// Sync web app repository. /// /// - /// Description for Adds a gateway to a connected Virtual Network (PUT) or - /// updates it (PATCH). + /// Description for Sync web app repository. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Name of the Virtual Network. - /// - /// - /// Name of the gateway. Currently, the only supported string is "primary". - /// - /// - /// The properties to update this gateway with. + /// Name of web app. /// /// /// Headers that will be added to request. @@ -75305,9 +74890,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -75317,7 +74899,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncRepositoryWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75342,18 +74924,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (vnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (connectionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -75371,19 +74941,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("vnetName", vnetName); - tracingParameters.Add("gatewayName", gatewayName); - tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionGateway", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncRepository", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -75397,7 +74962,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -75428,12 +74993,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(connectionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -75484,31 +75043,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -75517,16 +75058,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List webjobs for an app, or a deployment slot. + /// Syncs function trigger metadata to the management database /// /// - /// Description for List webjobs for an app, or a deployment slot. + /// Description for Syncs function trigger metadata to the management database /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -75537,9 +75078,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -75549,7 +75087,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SyncFunctionTriggersWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75592,11 +75130,11 @@ internal WebAppsOperations(WebSiteManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListWebJobs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SyncFunctionTriggers", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -75612,7 +75150,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -75663,7 +75201,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -75693,31 +75231,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -75726,10 +75246,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get webjob information for an app, or a deployment slot. + /// List triggered web jobs for an app, or a deployment slot. /// /// - /// Description for Get webjob information for an app, or a deployment slot. + /// Description for List triggered web jobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -75737,9 +75257,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Name of the web job. - /// /// /// Headers that will be added to request. /// @@ -75761,7 +75278,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListTriggeredWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -75786,10 +75303,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (webJobName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -75807,16 +75320,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetWebJob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobs", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -75911,7 +75422,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -75924,7 +75435,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -75944,22 +75455,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new web, mobile, or API app in an existing resource group, or - /// updates an existing app. + /// Gets a triggered web job by its ID for an app, or a deployment slot. /// /// - /// Description for Creates a new web, mobile, or API app in an existing - /// resource group, or updates an existing app. + /// Description for Gets a triggered web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Unique name of the app to create or update. To create or update a - /// deployment slot, use the {slot} parameter. + /// Site name. /// - /// - /// A JSON representation of the app properties. See example. + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -75982,7 +75491,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76007,13 +75516,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); - } - if (siteEnvelope != null) + if (webJobName == null) { - siteEnvelope.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -76032,15 +75537,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteEnvelope", siteEnvelope); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -76054,7 +75560,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76085,12 +75591,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -76111,7 +75611,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76141,7 +75641,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -76154,25 +75654,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -76192,24 +75674,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a specific backup to another app (or deployment slot, if - /// specified). + /// Delete a triggered web job by its ID for an app, or a deployment slot. /// /// - /// Description for Restores a specific backup to another app (or deployment - /// slot, if specified). + /// Description for Delete a triggered web job by its ID for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// ID of the backup. + /// Site name. /// - /// - /// Information on restore request . + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -76229,7 +75707,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76254,17 +75732,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); - } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) + if (webJobName == null) { - request.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -76283,17 +75753,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); - tracingParameters.Add("request", request); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestore", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteTriggeredWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -76307,7 +75776,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76338,12 +75807,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -76364,7 +75827,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76409,16 +75872,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Git/FTP publishing credentials of an app. + /// List a triggered web job's history for an app, or a deployment slot. /// /// - /// Description for Gets the Git/FTP publishing credentials of an app. + /// Description for List a triggered web job's history for an app, or a + /// deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Site name. + /// + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -76441,7 +75908,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListPublishingCredentialsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListTriggeredWebJobHistoryWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76466,6 +75933,10 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (webJobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -76483,14 +75954,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListPublishingCredentials", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTriggeredWebJobHistory", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -76504,7 +75977,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76555,7 +76028,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76585,7 +76058,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -76598,7 +76071,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -76618,19 +76091,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Gets a triggered web job's history by its ID for an app, , or a deployment + /// slot. /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Gets a triggered web job's history by its ID for an app, , + /// or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Site name. /// - /// - /// Details of MSDeploy operation + /// + /// Name of Web Job. + /// + /// + /// History ID. /// /// /// Headers that will be added to request. @@ -76653,7 +76131,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetTriggeredWebJobHistoryWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, string id, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76678,9 +76156,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (mSDeploy == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); + } + if (id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "id"); } if (Client.SubscriptionId == null) { @@ -76699,15 +76181,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("mSDeploy", mSDeploy); + tracingParameters.Add("webJobName", webJobName); + tracingParameters.Add("id", id); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateMSDeployOperation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetTriggeredWebJobHistory", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); + _url = _url.Replace("{id}", System.Uri.EscapeDataString(id)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -76721,7 +76206,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76752,12 +76237,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(mSDeploy != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -76778,7 +76257,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 409) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -76808,7 +76287,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -76816,12 +76295,12 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -76841,10 +76320,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create function for web site, or a deployment slot. + /// Run a triggered web job for an app, or a deployment slot. /// /// - /// Description for Create function for web site, or a deployment slot. + /// Description for Run a triggered web job for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. @@ -76852,11 +76331,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Site name. /// - /// - /// Function name. - /// - /// - /// Function details. + /// + /// Name of Web Job. /// /// /// Headers that will be added to request. @@ -76867,9 +76343,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -76879,7 +76352,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RunTriggeredWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -76904,13 +76377,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (functionEnvelope == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "functionEnvelope"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -76929,17 +76398,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("functionEnvelope", functionEnvelope); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateFunction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RunTriggeredWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -76953,7 +76421,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -76984,12 +76452,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(functionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(functionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -77010,7 +76472,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -77040,31 +76502,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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 == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -77073,22 +76517,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Gets the quota usage information of an app (or deployment slot, if + /// specified). /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Gets the quota usage information of an app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// ID of web app instance. + /// Name of the app. /// - /// - /// Details of MSDeploy operation + /// + /// Return only information specified in the filter (using OData syntax). For + /// example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and + /// startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and + /// timeGrain eq duration'[Hour|Minute|Day]'. /// /// /// Headers that will be added to request. @@ -77111,7 +76557,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateInstanceMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string name, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -77136,14 +76582,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } - if (mSDeploy == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -77161,23 +76599,25 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("instanceId", instanceId); - tracingParameters.Add("mSDeploy", mSDeploy); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceMSDeployOperation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", filter)); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -77185,7 +76625,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -77216,12 +76656,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(mSDeploy != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -77242,7 +76676,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 409) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -77272,7 +76706,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -77280,12 +76714,12 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -77305,22 +76739,17 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a web app. + /// Gets the virtual networks the app (or deployment slot) is connected to. /// /// - /// Description for Restores a web app. + /// Description for Gets the virtual networks the app (or deployment slot) is + /// connected to. /// - /// - /// Azure subscription. - /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. - /// - /// - /// Migration migrationOptions. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -77343,12 +76772,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginMigrateStorageWithHttpMessagesAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVnetConnectionsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (subscriptionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionName"); - } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -77372,14 +76797,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (migrationOptions == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "migrationOptions"); - } - if (migrationOptions != null) - { - migrationOptions.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -77395,24 +76812,18 @@ internal WebAppsOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("subscriptionName", subscriptionName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("migrationOptions", migrationOptions); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateStorage", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVnetConnections", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (subscriptionName != null) - { - _queryParameters.Add(string.Format("subscriptionName={0}", System.Uri.EscapeDataString(subscriptionName))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -77424,7 +76835,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -77455,12 +76866,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(migrationOptions != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(migrationOptions, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -77511,7 +76916,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -77524,7 +76929,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -77544,20 +76949,21 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Migrates a local (in-app) MySql database to a remote MySql database. + /// Gets a virtual network the app (or deployment slot) is connected to by + /// name. /// /// - /// Description for Migrates a local (in-app) MySql database to a remote MySql - /// database. + /// Description for Gets a virtual network the app (or deployment slot) is + /// connected to by name. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// MySql migration options. + /// + /// Name of the virtual network. /// /// /// Headers that will be added to request. @@ -77580,7 +76986,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginMigrateMySqlWithHttpMessagesAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -77605,13 +77011,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (migrationRequestEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "migrationRequestEnvelope"); - } - if (migrationRequestEnvelope != null) + if (vnetName == null) { - migrationRequestEnvelope.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); } if (Client.SubscriptionId == null) { @@ -77630,15 +77032,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("migrationRequestEnvelope", migrationRequestEnvelope); + tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMySql", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -77652,7 +77055,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -77683,12 +77086,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(migrationRequestEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(migrationRequestEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -77739,7 +77136,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -77752,7 +77149,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -77772,25 +77169,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Adds a Virtual Network connection to an app or slot (PUT) or updates the + /// connection properties (PATCH). /// /// - /// Description for Start capturing network packets for the site. + /// Description for Adds a Virtual Network connection to an app or slot (PUT) + /// or updates the connection properties (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The duration to keep capturing in seconds. + /// Name of the app. /// - /// - /// The maximum frame length in bytes (Optional). + /// + /// Name of an existing Virtual Network. /// - /// - /// The Blob URL to store capture file. + /// + /// Properties of the Virtual Network connection. See example. /// /// /// Headers that will be added to request. @@ -77813,7 +77209,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -77838,6 +77234,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -77855,31 +77259,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartWebSiteNetworkTraceOperation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -77891,7 +77283,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -77922,6 +77314,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -77942,7 +77340,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -77972,7 +77370,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -77985,25 +77383,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -78023,10 +77403,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores an app from a backup blob in Azure Storage. + /// Deletes a connection from an app (or deployment slot to a named virtual + /// network. /// /// - /// Description for Restores an app from a backup blob in Azure Storage. + /// Description for Deletes a connection from an app (or deployment slot to a + /// named virtual network. /// /// /// Name of the resource group to which the resource belongs. @@ -78034,8 +77416,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// Information on restore request . + /// + /// Name of the virtual network. /// /// /// Headers that will be added to request. @@ -78055,7 +77437,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreFromBackupBlobWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78080,13 +77462,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) + if (vnetName == null) { - request.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); } if (Client.SubscriptionId == null) { @@ -78105,15 +77483,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); + tracingParameters.Add("vnetName", vnetName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromBackupBlob", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteVnetConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78127,7 +77506,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -78158,12 +77537,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -78184,7 +77557,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -78229,19 +77602,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a deleted web app to this web app. + /// Adds a Virtual Network connection to an app or slot (PUT) or updates the + /// connection properties (PATCH). /// /// - /// Description for Restores a deleted web app to this web app. + /// Description for Adds a Virtual Network connection to an app or slot (PUT) + /// or updates the connection properties (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Deleted web app restore information. + /// + /// Name of an existing Virtual Network. + /// + /// + /// Properties of the Virtual Network connection. See example. /// /// /// Headers that will be added to request. @@ -78252,6 +77630,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -78261,7 +77642,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreFromDeletedAppWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateVnetConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, VnetInfo connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78286,9 +77667,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (restoreRequest == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -78307,15 +77692,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("restoreRequest", restoreRequest); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromDeletedApp", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78329,7 +77716,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -78360,9 +77747,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(restoreRequest != null) + if(connectionEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -78386,7 +77773,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -78416,13 +77803,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -78431,20 +77836,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a web app from a snapshot. + /// Gets an app's Virtual Network gateway. /// /// - /// Description for Restores a web app from a snapshot. + /// Description for Gets an app's Virtual Network gateway. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Snapshot restore settings. Snapshot information can be obtained by calling - /// GetDeletedSites or GetSiteSnapshots API. + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". /// /// /// Headers that will be added to request. @@ -78455,6 +77862,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -78464,7 +77874,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78489,13 +77899,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (restoreRequest == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); } - if (restoreRequest != null) + if (gatewayName == null) { - restoreRequest.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } if (Client.SubscriptionId == null) { @@ -78514,15 +77924,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("restoreRequest", restoreRequest); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSnapshot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVnetConnectionGateway", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78536,7 +77949,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -78567,12 +77980,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(restoreRequest != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -78593,7 +78000,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -78623,13 +78030,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -78638,19 +78063,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Install site extension on a web site, or a deployment slot. + /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). /// /// - /// Description for Install site extension on a web site, or a deployment slot. + /// Description for Adds a gateway to a connected Virtual Network (PUT) or + /// updates it (PATCH). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the app. /// - /// - /// Site extension name. + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// The properties to update this gateway with. /// /// /// Headers that will be added to request. @@ -78673,7 +78105,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginInstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78698,9 +78130,21 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) + if (vnetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (connectionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); + } + if (connectionEnvelope != null) + { + connectionEnvelope.Validate(); } if (Client.SubscriptionId == null) { @@ -78719,16 +78163,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginInstallSiteExtension", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVnetConnectionGateway", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78773,6 +78220,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(connectionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -78793,7 +78246,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 429) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -78823,7 +78276,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -78836,25 +78289,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -78874,11 +78309,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Copies a deployment slot to another deployment slot of an app. + /// Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). /// /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. + /// Description for Adds a gateway to a connected Virtual Network (PUT) or + /// updates it (PATCH). /// /// /// Name of the resource group to which the resource belongs. @@ -78886,9 +78321,14 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. + /// + /// Name of the Virtual Network. + /// + /// + /// Name of the gateway. Currently, the only supported string is "primary". + /// + /// + /// The properties to update this gateway with. /// /// /// Headers that will be added to request. @@ -78899,6 +78339,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -78908,7 +78351,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginCopyProductionSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateVnetConnectionGatewayWithHttpMessagesAsync(string resourceGroupName, string name, string vnetName, string gatewayName, VnetGateway connectionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -78933,13 +78376,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (copySlotEntity == null) + if (vnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vnetName"); + } + if (gatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "copySlotEntity"); + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - if (copySlotEntity != null) + if (connectionEnvelope == null) { - copySlotEntity.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "connectionEnvelope"); } if (Client.SubscriptionId == null) { @@ -78958,15 +78405,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("copySlotEntity", copySlotEntity); + tracingParameters.Add("vnetName", vnetName); + tracingParameters.Add("gatewayName", gatewayName); + tracingParameters.Add("connectionEnvelope", connectionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCopyProductionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateVnetConnectionGateway", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -78980,7 +78431,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -79011,9 +78462,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(copySlotEntity != null) + if(connectionEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(copySlotEntity, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectionEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -79037,7 +78488,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -79067,13 +78518,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -79082,26 +78551,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Creates a new web, mobile, or API app in an existing resource group, or - /// updates an existing app. + /// List webjobs for an app, or a deployment slot. /// /// - /// Description for Creates a new web, mobile, or API app in an existing - /// resource group, or updates an existing app. + /// Description for List webjobs for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Unique name of the app to create or update. To create or update a - /// deployment slot, use the {slot} parameter. - /// - /// - /// A JSON representation of the app properties. See example. - /// - /// - /// Name of the deployment slot to create or update. By default, this API - /// attempts to create or modify the production slot. + /// Site name. /// /// /// Headers that will be added to request. @@ -79124,7 +78583,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWebJobsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79149,18 +78608,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); - } - if (siteEnvelope != null) - { - siteEnvelope.Validate(); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -79178,17 +78625,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteEnvelope", siteEnvelope); - tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListWebJobs", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -79202,7 +78646,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -79233,12 +78677,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -79259,7 +78697,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -79289,7 +78727,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -79302,25 +78740,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -79340,28 +78760,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a specific backup to another app (or deployment slot, if - /// specified). + /// Get webjob information for an app, or a deployment slot. /// /// - /// Description for Restores a specific backup to another app (or deployment - /// slot, if specified). + /// Description for Get webjob information for an app, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// ID of the backup. - /// - /// - /// Information on restore request . + /// Site name. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restore a backup of the production slot. + /// + /// Name of the web job. /// /// /// Headers that will be added to request. @@ -79372,6 +78783,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -79381,7 +78795,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWebJobWithHttpMessagesAsync(string resourceGroupName, string name, string webJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79406,21 +78820,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (backupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); - } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) - { - request.Validate(); - } - if (slot == null) + if (webJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "webJobName"); } if (Client.SubscriptionId == null) { @@ -79439,19 +78841,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("backupId", backupId); - tracingParameters.Add("request", request); - tracingParameters.Add("slot", slot); + tracingParameters.Add("webJobName", webJobName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetWebJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{webJobName}", System.Uri.EscapeDataString(webJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -79465,7 +78864,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -79496,12 +78895,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -79522,7 +78915,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -79552,13 +78945,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -79567,20 +78978,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets the Git/FTP publishing credentials of an app. + /// Creates a new web, mobile, or API app in an existing resource group, or + /// updates an existing app. /// /// - /// Description for Gets the Git/FTP publishing credentials of an app. + /// Description for Creates a new web, mobile, or API app in an existing + /// resource group, or updates an existing app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Unique name of the app to create or update. To create or update a + /// deployment slot, use the {slot} parameter. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the publishing credentials for the production slot. + /// + /// A JSON representation of the app properties. See example. /// /// /// Headers that will be added to request. @@ -79603,7 +79016,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListPublishingCredentialsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79628,9 +79041,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (siteEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); + } + if (siteEnvelope != null) + { + siteEnvelope.Validate(); } if (Client.SubscriptionId == null) { @@ -79649,16 +79066,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); + tracingParameters.Add("siteEnvelope", siteEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListPublishingCredentialsSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -79672,7 +79088,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -79703,6 +79119,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(siteEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -79723,7 +79145,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -79753,7 +79175,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -79766,7 +79188,25 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -79786,23 +79226,24 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Invoke the MSDeploy web app extension. + /// Restores a specific backup to another app (or deployment slot, if + /// specified). /// /// - /// Description for Invoke the MSDeploy web app extension. + /// Description for Restores a specific backup to another app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the app. /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// + /// ID of the backup. /// - /// - /// Details of MSDeploy operation + /// + /// Information on restore request . /// /// /// Headers that will be added to request. @@ -79813,9 +79254,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -79825,7 +79263,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -79850,13 +79288,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (backupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); } - if (mSDeploy == null) + if (request == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); } if (Client.SubscriptionId == null) { @@ -79875,17 +79317,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("mSDeploy", mSDeploy); + tracingParameters.Add("backupId", backupId); + tracingParameters.Add("request", request); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateMSDeployOperationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestore", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -79899,7 +79341,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -79930,9 +79372,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(mSDeploy != null) + if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -79956,7 +79398,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 409) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -79986,31 +79428,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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 == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -80019,25 +79443,16 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Create function for web site, or a deployment slot. + /// Gets the Git/FTP publishing credentials of an app. /// /// - /// Description for Create function for web site, or a deployment slot. + /// Description for Gets the Git/FTP publishing credentials of an app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Function name. - /// - /// - /// Name of the deployment slot. - /// - /// - /// Function details. + /// Name of the app. /// /// /// Headers that will be added to request. @@ -80060,7 +79475,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginListPublishingCredentialsWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -80085,18 +79500,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (functionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (functionEnvelope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "functionEnvelope"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -80114,19 +79517,14 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("functionName", functionName); - tracingParameters.Add("slot", slot); - tracingParameters.Add("functionEnvelope", functionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceFunctionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginListPublishingCredentials", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -80140,7 +79538,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -80171,12 +79569,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(functionEnvelope != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(functionEnvelope, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -80197,7 +79589,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -80227,7 +79619,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -80235,12 +79627,12 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -80271,13 +79663,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of web app. /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. - /// - /// - /// ID of web app instance. - /// /// /// Details of MSDeploy operation /// @@ -80302,7 +79687,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -80327,14 +79712,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } - if (instanceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); - } if (mSDeploy == null) { throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); @@ -80356,19 +79733,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slot", slot); - tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("mSDeploy", mSDeploy); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceMSDeployOperationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateMSDeployOperation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -80502,28 +79875,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Create function for web site, or a deployment slot. /// /// - /// Description for Start capturing network packets for the site. + /// Description for Create function for web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. + /// Site name. /// - /// - /// The maximum frame length in bytes (Optional). + /// + /// Function name. /// - /// - /// The Blob URL to store capture file. + /// + /// Function details. /// /// /// Headers that will be added to request. @@ -80546,7 +79913,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginStartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateFunctionWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -80571,9 +79938,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (functionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (functionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionEnvelope"); } if (Client.SubscriptionId == null) { @@ -80592,33 +79963,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("slot", slot); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("functionEnvelope", functionEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartWebSiteNetworkTraceOperationSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateFunction", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -80630,7 +79987,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -80661,6 +80018,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(functionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(functionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -80681,7 +80044,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 201) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -80711,7 +80074,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -80719,30 +80082,12 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -80762,20 +80107,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Approves or rejects a private endpoint connection + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Approves or rejects a private endpoint connection + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// Name of web app. /// - /// + /// + /// ID of web app instance. /// - /// + /// + /// Details of MSDeploy operation /// /// /// Headers that will be added to request. @@ -80798,7 +80145,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateInstanceMSDeployOperationWithHttpMessagesAsync(string resourceGroupName, string name, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -80823,13 +80170,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) + if (instanceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); } - if (privateEndpointWrapper == null) + if (mSDeploy == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); + throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); } if (Client.SubscriptionId == null) { @@ -80848,17 +80195,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); - tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); + tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("mSDeploy", mSDeploy); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceMSDeployOperation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -80903,9 +80250,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(privateEndpointWrapper != null) + if(mSDeploy != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -80929,7 +80276,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 201 && (int)_statusCode != 409) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -80959,7 +80306,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -80967,30 +80314,12 @@ internal WebAppsOperations(WebSiteManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -81010,18 +80339,22 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Deletes a private endpoint connection + /// Restores a web app. /// /// - /// Description for Deletes a private endpoint connection + /// Description for Restores a web app. /// + /// + /// Azure subscription. + /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the site. + /// Name of web app. /// - /// + /// + /// Migration migrationOptions. /// /// /// Headers that will be added to request. @@ -81044,8 +80377,12 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginMigrateStorageWithHttpMessagesAsync(string subscriptionName, string resourceGroupName, string name, StorageMigrationOptions migrationOptions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (subscriptionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionName"); + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -81069,9 +80406,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (privateEndpointConnectionName == null) + if (migrationOptions == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "migrationOptions"); + } + if (migrationOptions != null) + { + migrationOptions.Validate(); } if (Client.SubscriptionId == null) { @@ -81088,20 +80429,24 @@ internal WebAppsOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("subscriptionName", subscriptionName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("migrationOptions", migrationOptions); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateStorage", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (subscriptionName != null) + { + _queryParameters.Add(string.Format("subscriptionName={0}", System.Uri.EscapeDataString(subscriptionName))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -81113,7 +80458,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -81144,6 +80489,12 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; + if(migrationOptions != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(migrationOptions, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -81164,7 +80515,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -81194,7 +80545,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -81207,43 +80558,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 204) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -81263,23 +80578,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores an app from a backup blob in Azure Storage. + /// Migrates a local (in-app) MySql database to a remote MySql database. /// /// - /// Description for Restores an app from a backup blob in Azure Storage. + /// Description for Migrates a local (in-app) MySql database to a remote MySql + /// database. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// Information on restore request . + /// Name of web app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// restore a backup of the production slot. + /// + /// MySql migration options. /// /// /// Headers that will be added to request. @@ -81290,6 +80602,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -81299,7 +80614,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreFromBackupBlobSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginMigrateMySqlWithHttpMessagesAsync(string resourceGroupName, string name, MigrateMySqlRequest migrationRequestEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81324,17 +80639,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "request"); - } - if (request != null) + if (migrationRequestEnvelope == null) { - request.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "migrationRequestEnvelope"); } - if (slot == null) + if (migrationRequestEnvelope != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + migrationRequestEnvelope.Validate(); } if (Client.SubscriptionId == null) { @@ -81353,17 +80664,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("request", request); - tracingParameters.Add("slot", slot); + tracingParameters.Add("migrationRequestEnvelope", migrationRequestEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromBackupBlobSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMySql", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -81408,9 +80717,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(request != null) + if(migrationRequestEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(migrationRequestEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -81434,7 +80743,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -81464,13 +80773,31 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -81479,23 +80806,25 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a deleted web app to this web app. + /// Start capturing network packets for the site. /// /// - /// Description for Restores a deleted web app to this web app. + /// Description for Start capturing network packets for the site. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// The name of the web app. /// - /// - /// Deleted web app restore information. + /// + /// The duration to keep capturing in seconds. /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. /// /// /// Headers that will be added to request. @@ -81506,6 +80835,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -81515,7 +80847,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreFromDeletedAppSlotWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> BeginStartWebSiteNetworkTraceOperationWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81540,14 +80872,6 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (restoreRequest == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); - } - if (slot == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -81565,19 +80889,31 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("restoreRequest", restoreRequest); - tracingParameters.Add("slot", slot); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromDeletedAppSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginStartWebSiteNetworkTraceOperation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -81620,12 +80956,6 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(restoreRequest != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -81676,13 +81006,49 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -81691,24 +81057,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Restores a web app from a snapshot. + /// Approves or rejects a private endpoint connection /// /// - /// Description for Restores a web app from a snapshot. + /// Description for Approves or rejects a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of web app. + /// Name of the site. /// - /// - /// Snapshot restore settings. Snapshot information can be obtained by calling - /// GetDeletedSites or GetSiteSnapshots API. + /// /// - /// - /// Name of web app slot. If not specified then will default to production - /// slot. + /// /// /// /// Headers that will be added to request. @@ -81719,6 +81081,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -81728,7 +81093,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81753,17 +81118,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (restoreRequest == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); - } - if (restoreRequest != null) + if (privateEndpointConnectionName == null) { - restoreRequest.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - if (slot == null) + if (privateEndpointWrapper == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); } if (Client.SubscriptionId == null) { @@ -81782,17 +81143,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("restoreRequest", restoreRequest); - tracingParameters.Add("slot", slot); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSnapshotSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -81806,7 +81167,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -81837,9 +81198,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(restoreRequest != null) + if(privateEndpointWrapper != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -81893,13 +81254,49 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -81908,23 +81305,18 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Install site extension on a web site, or a deployment slot. + /// Deletes a private endpoint connection /// /// - /// Description for Install site extension on a web site, or a deployment slot. + /// Description for Deletes a private endpoint connection /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Site name. - /// - /// - /// Site extension name. + /// Name of the site. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API uses the - /// production slot. + /// /// /// /// Headers that will be added to request. @@ -81947,7 +81339,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginInstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -81972,13 +81364,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteExtensionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); - } - if (slot == null) + if (privateEndpointConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } if (Client.SubscriptionId == null) { @@ -81997,18 +81385,16 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteExtensionId", siteExtensionId); - tracingParameters.Add("slot", slot); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginInstallSiteExtensionSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -82022,7 +81408,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -82073,7 +81459,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 429) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -82103,7 +81489,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -82116,7 +81502,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -82129,12 +81515,30 @@ internal WebAppsOperations(WebSiteManagementClient client) } } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 202) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 204) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -82154,11 +81558,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Copies a deployment slot to another deployment slot of an app. + /// Restores an app from a backup blob in Azure Storage. /// /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. + /// Description for Restores an app from a backup blob in Azure Storage. /// /// /// Name of the resource group to which the resource belongs. @@ -82166,13 +81569,8 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. + /// + /// Information on restore request . /// /// /// Headers that will be added to request. @@ -82192,7 +81590,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginCopySlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreFromBackupBlobWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -82217,17 +81615,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (copySlotEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "copySlotEntity"); - } - if (copySlotEntity != null) + if (request == null) { - copySlotEntity.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - if (slot == null) + if (request != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + request.Validate(); } if (Client.SubscriptionId == null) { @@ -82246,17 +81640,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("copySlotEntity", copySlotEntity); - tracingParameters.Add("slot", slot); + tracingParameters.Add("request", request); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCopySlotSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromBackupBlob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotcopy").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -82301,9 +81693,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(copySlotEntity != null) + if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(copySlotEntity, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -82372,23 +81764,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Swaps two deployment slots of an app. + /// Restores a deleted web app to this web app. /// /// - /// Description for Swaps two deployment slots of an app. + /// Description for Restores a deleted web app to this web app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name. See example. + /// Name of web app. /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. + /// + /// Deleted web app restore information. /// /// /// Headers that will be added to request. @@ -82408,7 +81796,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginSwapSlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreFromDeletedAppWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -82433,17 +81821,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); - } - if (slotSwapEntity != null) - { - slotSwapEntity.Validate(); - } - if (slot == null) + if (restoreRequest == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); } if (Client.SubscriptionId == null) { @@ -82462,17 +81842,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); - tracingParameters.Add("slot", slot); + tracingParameters.Add("restoreRequest", restoreRequest); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSwapSlotSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromDeletedApp", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -82517,9 +81895,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) + if(restoreRequest != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -82588,23 +81966,20 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Restores a web app from a snapshot. /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Restores a web app from a snapshot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. - /// - /// - /// JSON representation of a SiteSourceControl object. See example. + /// Name of web app. /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the source control configuration for the production slot. + /// + /// Snapshot restore settings. Snapshot information can be obtained by calling + /// GetDeletedSites or GetSiteSnapshots API. /// /// /// Headers that will be added to request. @@ -82615,9 +81990,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -82627,7 +81999,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreSnapshotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -82652,13 +82024,13 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteSourceControl == null) + if (restoreRequest == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); } - if (slot == null) + if (restoreRequest != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + restoreRequest.Validate(); } if (Client.SubscriptionId == null) { @@ -82677,17 +82049,15 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteSourceControl", siteSourceControl); - tracingParameters.Add("slot", slot); + tracingParameters.Add("restoreRequest", restoreRequest); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSourceControlSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSnapshot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -82701,7 +82071,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -82732,9 +82102,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteSourceControl != null) + if(restoreRequest != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -82758,7 +82128,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -82788,67 +82158,13 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -82857,28 +82173,19 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Install site extension on a web site, or a deployment slot. /// /// - /// Description for Start capturing network packets for the site. + /// Description for Install site extension on a web site, or a deployment slot. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The name of the slot for this web app. - /// - /// - /// The duration to keep capturing in seconds. - /// - /// - /// The maximum frame length in bytes (Optional). + /// Site name. /// - /// - /// The Blob URL to store capture file. + /// + /// Site extension name. /// /// /// Headers that will be added to request. @@ -82901,7 +82208,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginStartNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginInstallSiteExtensionWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -82926,9 +82233,9 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slot == null) + if (siteExtensionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); } if (Client.SubscriptionId == null) { @@ -82947,33 +82254,18 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("slot", slot); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("siteExtensionId", siteExtensionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartNetworkTraceSlot", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginInstallSiteExtension", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -82985,7 +82277,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -83036,7 +82328,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 429) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -83066,7 +82358,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -83079,7 +82371,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -83092,12 +82384,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } } // Deserialize Response - if ((int)_statusCode == 202) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -83117,19 +82409,26 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Swaps two deployment slots of an app. + /// Creates a new web, mobile, or API app in an existing resource group, or + /// updates an existing app. /// /// - /// Description for Swaps two deployment slots of an app. + /// Description for Creates a new web, mobile, or API app in an existing + /// resource group, or updates an existing app. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// Name of the app. + /// Unique name of the app to create or update. To create or update a + /// deployment slot, use the {slot} parameter. /// - /// - /// JSON object that contains the target slot name. See example. + /// + /// A JSON representation of the app properties. See example. + /// + /// + /// Name of the deployment slot to create or update. By default, this API + /// attempts to create or modify the production slot. /// /// /// Headers that will be added to request. @@ -83140,6 +82439,9 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -83149,7 +82451,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginSwapSlotWithProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateSlotWithHttpMessagesAsync(string resourceGroupName, string name, Site siteEnvelope, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -83174,13 +82476,17 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (slotSwapEntity == null) + if (siteEnvelope == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + throw new ValidationException(ValidationRules.CannotBeNull, "siteEnvelope"); } - if (slotSwapEntity != null) + if (siteEnvelope != null) { - slotSwapEntity.Validate(); + siteEnvelope.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -83199,15 +82505,17 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("siteEnvelope", siteEnvelope); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSwapSlotWithProduction", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -83221,7 +82529,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -83252,9 +82560,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(slotSwapEntity != null) + if(siteEnvelope != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -83308,13 +82616,49 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -83323,10 +82667,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Updates the source control configuration of an app. + /// Restores a specific backup to another app (or deployment slot, if + /// specified). /// /// - /// Description for Updates the source control configuration of an app. + /// Description for Restores a specific backup to another app (or deployment + /// slot, if specified). /// /// /// Name of the resource group to which the resource belongs. @@ -83334,8 +82680,15 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Name of the app. /// - /// - /// JSON representation of a SiteSourceControl object. See example. + /// + /// ID of the backup. + /// + /// + /// Information on restore request . + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// restore a backup of the production slot. /// /// /// Headers that will be added to request. @@ -83346,9 +82699,6 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -83358,7 +82708,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestoreSlotWithHttpMessagesAsync(string resourceGroupName, string name, string backupId, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -83383,9 +82733,21 @@ internal WebAppsOperations(WebSiteManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (siteSourceControl == null) + if (backupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + throw new ValidationException(ValidationRules.CannotBeNull, "backupId"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); } if (Client.SubscriptionId == null) { @@ -83404,15 +82766,19 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); - tracingParameters.Add("siteSourceControl", siteSourceControl); + tracingParameters.Add("backupId", backupId); + tracingParameters.Add("request", request); + tracingParameters.Add("slot", slot); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSourceControl", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSlot", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{backupId}", System.Uri.EscapeDataString(backupId)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -83426,7 +82792,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -83457,9 +82823,9 @@ internal WebAppsOperations(WebSiteManagementClient client) // Serialize Request string _requestContent = null; - if(siteSourceControl != null) + if(request != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -83483,7 +82849,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -83513,56 +82879,221 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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) + if (_shouldTrace) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the Git/FTP publishing credentials of an app. + /// + /// + /// Description for Gets the Git/FTP publishing credentials of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the publishing credentials for the production slot. + /// + /// + /// 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> BeginListPublishingCredentialsSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); } - catch (JsonException ex) + if (resourceGroupName.Length < 1) { - _httpRequest.Dispose(); - if (_httpResponse != null) + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginListPublishingCredentialsSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) { - _httpResponse.Dispose(); + _httpRequest.Headers.Remove(_header.Key); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Deserialize Response - if ((int)_statusCode == 201) + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) { - _httpResponse.Dispose(); + ex.Body = _errorBody; } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } + 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 == 202) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -83582,25 +83113,4543 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Start capturing network packets for the site. + /// Invoke the MSDeploy web app extension. /// /// - /// Description for Start capturing network packets for the site. + /// Description for Invoke the MSDeploy web app extension. /// /// /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. + /// Name of web app. /// - /// - /// The duration to keep capturing in seconds. + /// + /// Name of web app slot. If not specified then will default to production + /// slot. /// - /// - /// The maximum frame length in bytes (Optional). + /// + /// Details of MSDeploy operation /// - /// - /// The Blob URL to store capture file. + /// + /// 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> BeginCreateMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (mSDeploy == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); + tracingParameters.Add("mSDeploy", mSDeploy); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateMSDeployOperationSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(mSDeploy != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 201 && (int)_statusCode != 409) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create function for web site, or a deployment slot. + /// + /// + /// Description for Create function for web site, or a deployment slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Function name. + /// + /// + /// Name of the deployment slot. + /// + /// + /// Function details. + /// + /// + /// 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> BeginCreateInstanceFunctionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string functionName, string slot, FunctionEnvelope functionEnvelope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (functionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (functionEnvelope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "functionEnvelope"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("functionName", functionName); + tracingParameters.Add("slot", slot); + tracingParameters.Add("functionEnvelope", functionEnvelope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceFunctionSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(functionEnvelope != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(functionEnvelope, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 201) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Invoke the MSDeploy web app extension. + /// + /// + /// Description for Invoke the MSDeploy web app extension. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// ID of web app instance. + /// + /// + /// Details of MSDeploy 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> BeginCreateInstanceMSDeployOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, string instanceId, MSDeploy mSDeploy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (instanceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instanceId"); + } + if (mSDeploy == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "mSDeploy"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slot", slot); + tracingParameters.Add("instanceId", instanceId); + tracingParameters.Add("mSDeploy", mSDeploy); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateInstanceMSDeployOperationSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(mSDeploy != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(mSDeploy, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 201 && (int)_statusCode != 409) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Start capturing network packets for the site. + /// + /// + /// Description for Start capturing network packets for the site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. + /// + /// + /// The name of the slot for this web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// 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>> BeginStartWebSiteNetworkTraceOperationSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("slot", slot); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginStartWebSiteNetworkTraceOperationSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// + /// + /// 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> BeginApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (privateEndpointWrapper == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointWrapper"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("privateEndpointWrapper", privateEndpointWrapper); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginApproveOrRejectPrivateEndpointConnectionSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(privateEndpointWrapper != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointWrapper, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// 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> BeginDeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string privateEndpointConnectionName, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePrivateEndpointConnectionSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 204) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Restores an app from a backup blob in Azure Storage. + /// + /// + /// Description for Restores an app from a backup blob in Azure Storage. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Information on restore request . + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// restore a backup of the production slot. + /// + /// + /// 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 BeginRestoreFromBackupBlobSlotWithHttpMessagesAsync(string resourceGroupName, string name, RestoreRequest request, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("request", request); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromBackupBlobSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Restores a deleted web app to this web app. + /// + /// + /// Description for Restores a deleted web app to this web app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Deleted web app restore information. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// 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 BeginRestoreFromDeletedAppSlotWithHttpMessagesAsync(string resourceGroupName, string name, DeletedAppRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (restoreRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("restoreRequest", restoreRequest); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFromDeletedAppSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(restoreRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Restores a web app from a snapshot. + /// + /// + /// Description for Restores a web app from a snapshot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of web app. + /// + /// + /// Snapshot restore settings. Snapshot information can be obtained by calling + /// GetDeletedSites or GetSiteSnapshots API. + /// + /// + /// Name of web app slot. If not specified then will default to production + /// slot. + /// + /// + /// 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 BeginRestoreSnapshotSlotWithHttpMessagesAsync(string resourceGroupName, string name, SnapshotRestoreRequest restoreRequest, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (restoreRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "restoreRequest"); + } + if (restoreRequest != null) + { + restoreRequest.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("restoreRequest", restoreRequest); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreSnapshotSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(restoreRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(restoreRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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; + } + + /// + /// Install site extension on a web site, or a deployment slot. + /// + /// + /// Description for Install site extension on a web site, or a deployment slot. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// Site extension name. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API uses the + /// production slot. + /// + /// + /// 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> BeginInstallSiteExtensionSlotWithHttpMessagesAsync(string resourceGroupName, string name, string siteExtensionId, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (siteExtensionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteExtensionId"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("siteExtensionId", siteExtensionId); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginInstallSiteExtensionSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{siteExtensionId}", System.Uri.EscapeDataString(siteExtensionId)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 429) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Swaps two deployment slots of an app. + /// + /// + /// Description for Swaps two deployment slots of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name. See example. + /// + /// + /// Name of the source slot. If a slot is not specified, the production slot is + /// used as the source slot. + /// + /// + /// 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 BeginSwapSlotSlotWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slotSwapEntity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginSwapSlotSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 source control configuration of an app. + /// + /// + /// Description for Updates the source control configuration of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON representation of a SiteSourceControl object. See example. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the source control configuration for the production slot. + /// + /// + /// 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> BeginCreateOrUpdateSourceControlSlotWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, string slot, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (siteSourceControl == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("siteSourceControl", siteSourceControl); + tracingParameters.Add("slot", slot); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSourceControlSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(siteSourceControl != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Start capturing network packets for the site. + /// + /// + /// Description for Start capturing network packets for the site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. + /// + /// + /// The name of the slot for this web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// 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>> BeginStartNetworkTraceSlotWithHttpMessagesAsync(string resourceGroupName, string name, string slot, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slot == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slot"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("slot", slot); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginStartNetworkTraceSlot", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{slot}", System.Uri.EscapeDataString(slot)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Swaps two deployment slots of an app. + /// + /// + /// Description for Swaps two deployment slots of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON object that contains the target slot name. See example. + /// + /// + /// 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 BeginSwapSlotWithProductionWithHttpMessagesAsync(string resourceGroupName, string name, CsmSlotEntity slotSwapEntity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (slotSwapEntity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "slotSwapEntity"); + } + if (slotSwapEntity != null) + { + slotSwapEntity.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("slotSwapEntity", slotSwapEntity); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginSwapSlotWithProduction", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(slotSwapEntity != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(slotSwapEntity, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 source control configuration of an app. + /// + /// + /// Description for Updates the source control configuration of an app. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// JSON representation of a SiteSourceControl object. See example. + /// + /// + /// 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> BeginCreateOrUpdateSourceControlWithHttpMessagesAsync(string resourceGroupName, string name, SiteSourceControl siteSourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (siteSourceControl == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "siteSourceControl"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("siteSourceControl", siteSourceControl); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSourceControl", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(siteSourceControl != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(siteSourceControl, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Start capturing network packets for the site. + /// + /// + /// Description for Start capturing network packets for the site. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. + /// + /// + /// The duration to keep capturing in seconds. + /// + /// + /// The maximum frame length in bytes (Optional). + /// + /// + /// The Blob URL to store capture file. + /// + /// + /// 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>> BeginStartNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); + } + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("name", name); + tracingParameters.Add("durationInSeconds", durationInSeconds); + tracingParameters.Add("maxFrameLength", maxFrameLength); + tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginStartNetworkTrace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (durationInSeconds != null) + { + _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); + } + if (maxFrameLength != null) + { + _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); + } + if (sasUrl != null) + { + _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all apps for a subscription. + /// + /// + /// Description for Get all apps for a 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all web, mobile, and API apps in the specified resource group. + /// + /// + /// Description for Gets all web, mobile, and API apps in the specified + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets existing backups of an app. + /// + /// + /// Description for Gets existing backups of an app. + /// + /// + /// 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>> ListBackupsNextWithHttpMessagesAsync(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, "ListBackupsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List the configurations of an app + /// + /// + /// Description for List the configurations of an app + /// + /// + /// 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("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -83623,38 +87672,11 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginStartNetworkTraceWithHttpMessagesAsync(string resourceGroupName, string name, int? durationInSeconds = default(int?), int? maxFrameLength = default(int?), string sasUrl = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetAppSettingsKeyVaultReferencesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.ApiVersion == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -83663,37 +87685,14 @@ internal WebAppsOperations(WebSiteManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("name", name); - tracingParameters.Add("durationInSeconds", durationInSeconds); - tracingParameters.Add("maxFrameLength", maxFrameLength); - tracingParameters.Add("sasUrl", sasUrl); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStartNetworkTrace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingsKeyVaultReferencesNext", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); List _queryParameters = new List(); - if (durationInSeconds != null) - { - _queryParameters.Add(string.Format("durationInSeconds={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(durationInSeconds, Client.SerializationSettings).Trim('"')))); - } - if (maxFrameLength != null) - { - _queryParameters.Add(string.Format("maxFrameLength={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxFrameLength, Client.SerializationSettings).Trim('"')))); - } - if (sasUrl != null) - { - _queryParameters.Add(string.Format("sasUrl={0}", System.Uri.EscapeDataString(sasUrl))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -83701,7 +87700,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -83752,7 +87751,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -83782,7 +87781,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -83795,7 +87794,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -83807,13 +87806,166 @@ internal WebAppsOperations(WebSiteManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// 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>> GetSiteConnectionStringKeyVaultReferencesNextWithHttpMessagesAsync(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, "GetSiteConnectionStringKeyVaultReferencesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 == 202) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -83833,10 +87985,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get all apps for a subscription. + /// Gets a list of web app configuration snapshots identifiers. Each element of + /// the list contains a timestamp and the ID of the snapshot. /// /// - /// Description for Get all apps for a subscription. + /// Description for Gets a list of web app configuration snapshots identifiers. + /// Each element of the list contains a timestamp and the ID of the snapshot. /// /// /// The NextLink from the previous successful call to List operation. @@ -83862,7 +88016,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationSnapshotInfoNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -83877,7 +88031,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -83971,7 +88125,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -83984,7 +88138,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -84004,11 +88158,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all web, mobile, and API apps in the specified resource group. + /// List continuous web jobs for an app, or a deployment slot. /// /// - /// Description for Gets all web, mobile, and API apps in the specified - /// resource group. + /// Description for List continuous web jobs for an app, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -84034,7 +88187,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListContinuousWebJobsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -84049,7 +88202,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -84143,7 +88296,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -84156,7 +88309,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -84176,10 +88329,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// List deployments for an app, or a deployment slot. /// /// - /// Description for Gets existing backups of an app. + /// Description for List deployments for an app, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -84205,7 +88358,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBackupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDeploymentsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -84220,7 +88373,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBackupsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -84314,7 +88467,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -84327,7 +88480,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -84347,10 +88500,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the configurations of an app + /// Lists ownership identifiers for domain associated with web app. /// /// - /// Description for List the configurations of an app + /// Description for Lists ownership identifiers for domain associated with web + /// app. /// /// /// The NextLink from the previous successful call to List operation. @@ -84376,7 +88530,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDomainOwnershipIdentifiersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -84391,7 +88545,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -84485,7 +88639,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -84498,7 +88652,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -84518,12 +88672,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a list of web app configuration snapshots identifiers. Each element of - /// the list contains a timestamp and the ID of the snapshot. + /// List the functions for a web site, or a deployment slot. /// /// - /// Description for Gets a list of web app configuration snapshots identifiers. - /// Each element of the list contains a timestamp and the ID of the snapshot. + /// Description for List the functions for a web site, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -84549,7 +88701,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationSnapshotInfoNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -84564,7 +88716,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListFunctionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -84628,7 +88780,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -84658,7 +88810,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -84671,7 +88823,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -84691,10 +88843,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List continuous web jobs for an app, or a deployment slot. + /// Get hostname bindings for an app or a deployment slot. /// /// - /// Description for List continuous web jobs for an app, or a deployment slot. + /// Description for Get hostname bindings for an app or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -84720,7 +88872,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListContinuousWebJobsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListHostNameBindingsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -84735,7 +88887,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -84829,7 +88981,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -84842,7 +88994,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -84862,10 +89014,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployments for an app, or a deployment slot. + /// Gets all scale-out instances of an app. /// /// - /// Description for List deployments for an app, or a deployment slot. + /// Description for Gets all scale-out instances of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -84891,7 +89043,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDeploymentsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceIdentifiersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -84906,7 +89058,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -85000,7 +89152,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -85013,7 +89165,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -85033,11 +89185,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Lists ownership identifiers for domain associated with web app. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Lists ownership identifiers for domain associated with web - /// app. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -85063,7 +89216,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDomainOwnershipIdentifiersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -85078,7 +89231,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -85142,7 +89295,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -85172,7 +89325,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -85185,7 +89338,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -85205,10 +89358,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the functions for a web site, or a deployment slot. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for List the functions for a web site, or a deployment slot. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -85234,7 +89389,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessModulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -85249,7 +89404,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListFunctionsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -85343,7 +89498,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -85356,7 +89511,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -85376,10 +89531,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get hostname bindings for an app or a deployment slot. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Get hostname bindings for an app or a deployment slot. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -85405,7 +89562,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListHostNameBindingsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessThreadsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -85420,7 +89577,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -85484,7 +89641,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -85514,7 +89671,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -85527,7 +89684,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -85547,10 +89704,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// Gets existing backups of an app. /// /// - /// Description for Gets all scale-out instances of an app. + /// Description for Gets existing backups of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -85576,7 +89733,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceIdentifiersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteBackupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -85591,7 +89748,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -85604,7 +89761,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -85685,7 +89842,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -85698,7 +89855,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -85718,12 +89875,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Gets perfmon counters for web app. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Gets perfmon counters for web app. /// /// /// The NextLink from the previous successful call to List operation. @@ -85749,7 +89904,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPerfMonCountersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -85764,7 +89919,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -85828,7 +89983,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -85858,7 +90013,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -85871,7 +90026,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -85891,12 +90046,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// The NextLink from the previous successful call to List operation. @@ -85922,7 +90076,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessModulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -85937,7 +90091,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -86001,7 +90155,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -86031,7 +90185,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -86044,7 +90198,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -86064,12 +90218,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -86095,7 +90249,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessThreadsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -86110,7 +90264,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -86204,7 +90358,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -86217,7 +90371,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -86237,10 +90391,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Gets existing backups of an app. + /// Description for List module information for a process by its ID for a + /// specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -86266,7 +90422,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteBackupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessModulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -86281,7 +90437,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessModulesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -86294,7 +90450,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -86345,7 +90501,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -86375,7 +90531,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -86388,7 +90544,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -86408,10 +90564,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets perfmon counters for web app. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for Gets perfmon counters for web app. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -86437,7 +90595,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPerfMonCountersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListProcessThreadsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -86452,7 +90610,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreadsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -86516,7 +90674,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -86546,7 +90704,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -86559,7 +90717,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -86579,12 +90737,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Get public certificates for an app or a deployment slot. /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Get public certificates for an app or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -86610,7 +90766,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPublicCertificatesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -86625,7 +90781,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificatesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -86689,7 +90845,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -86719,7 +90875,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -86732,7 +90888,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -86752,12 +90908,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// Get list of siteextensions for a web site, or a deployment slot. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for Get list of siteextensions for a web site, or a deployment + /// slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -86783,7 +90938,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessModulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteExtensionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -86798,7 +90953,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessModulesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensionsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -86892,7 +91047,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -86905,7 +91060,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -86925,12 +91080,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets an app's deployment slots. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets an app's deployment slots. /// /// /// The NextLink from the previous successful call to List operation. @@ -86956,7 +91109,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListProcessThreadsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSlotsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -86971,7 +91124,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcessThreadsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSlotsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87035,7 +91188,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -87065,7 +91218,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87078,7 +91231,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87098,10 +91251,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get public certificates for an app or a deployment slot. + /// Gets existing backups of an app. /// /// - /// Description for Get public certificates for an app or a deployment slot. + /// Description for Gets existing backups of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -87127,7 +91280,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublicCertificatesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBackupsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -87142,7 +91295,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublicCertificatesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBackupsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87236,7 +91389,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87249,7 +91402,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87269,11 +91422,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get list of siteextensions for a web site, or a deployment slot. + /// List the configurations of an app /// /// - /// Description for Get list of siteextensions for a web site, or a deployment - /// slot. + /// Description for List the configurations of an app /// /// /// The NextLink from the previous successful call to List operation. @@ -87299,7 +91451,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteExtensionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -87314,7 +91466,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteExtensionsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87378,7 +91530,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -87408,7 +91560,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87421,7 +91573,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87441,10 +91593,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets an app's deployment slots. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Gets an app's deployment slots. + /// Description for Gets the config reference app settings and status of an app /// /// /// The NextLink from the previous successful call to List operation. @@ -87470,7 +91622,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSlotsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetAppSettingsKeyVaultReferencesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -87485,7 +91637,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSlotsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAppSettingsKeyVaultReferencesSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87579,7 +91731,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87592,7 +91744,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87612,10 +91764,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Gets existing backups of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// The NextLink from the previous successful call to List operation. @@ -87641,7 +91793,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBackupsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetSiteConnectionStringKeyVaultReferencesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -87656,7 +91808,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBackupsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSiteConnectionStringKeyVaultReferencesSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87750,7 +91902,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87763,7 +91915,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87783,10 +91935,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the configurations of an app + /// Gets a list of web app configuration snapshots identifiers. Each element of + /// the list contains a timestamp and the ID of the snapshot. /// /// - /// Description for List the configurations of an app + /// Description for Gets a list of web app configuration snapshots identifiers. + /// Each element of the list contains a timestamp and the ID of the snapshot. /// /// /// The NextLink from the previous successful call to List operation. @@ -87812,7 +91966,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListConfigurationSnapshotInfoSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -87827,7 +91981,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -87921,7 +92075,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -87934,7 +92088,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -87954,12 +92108,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets a list of web app configuration snapshots identifiers. Each element of - /// the list contains a timestamp and the ID of the snapshot. + /// List continuous web jobs for an app, or a deployment slot. /// /// - /// Description for Gets a list of web app configuration snapshots identifiers. - /// Each element of the list contains a timestamp and the ID of the snapshot. + /// Description for List continuous web jobs for an app, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -87985,7 +92137,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListConfigurationSnapshotInfoSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListContinuousWebJobsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88000,7 +92152,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListConfigurationSnapshotInfoSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88094,7 +92246,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88107,7 +92259,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88127,10 +92279,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List continuous web jobs for an app, or a deployment slot. + /// List deployments for an app, or a deployment slot. /// /// - /// Description for List continuous web jobs for an app, or a deployment slot. + /// Description for List deployments for an app, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -88156,7 +92308,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListContinuousWebJobsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDeploymentsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88171,7 +92323,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListContinuousWebJobsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88265,7 +92417,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88278,7 +92430,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88298,10 +92450,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List deployments for an app, or a deployment slot. + /// Lists ownership identifiers for domain associated with web app. /// /// - /// Description for List deployments for an app, or a deployment slot. + /// Description for Lists ownership identifiers for domain associated with web + /// app. /// /// /// The NextLink from the previous successful call to List operation. @@ -88327,7 +92480,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDeploymentsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDomainOwnershipIdentifiersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88342,7 +92495,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDeploymentsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88436,7 +92589,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88449,7 +92602,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88469,11 +92622,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Lists ownership identifiers for domain associated with web app. + /// List the functions for a web site, or a deployment slot. /// /// - /// Description for Lists ownership identifiers for domain associated with web - /// app. + /// Description for List the functions for a web site, or a deployment slot. /// /// /// The NextLink from the previous successful call to List operation. @@ -88499,7 +92651,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDomainOwnershipIdentifiersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceFunctionsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88514,7 +92666,178 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDomainOwnershipIdentifiersSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceFunctionsSlotNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 404) + { + var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get hostname bindings for an app or a deployment slot. + /// + /// + /// Description for Get hostname bindings for an app or a deployment slot. + /// + /// + /// 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>> ListHostNameBindingsSlotNextWithHttpMessagesAsync(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, "ListHostNameBindingsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88608,7 +92931,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88621,7 +92944,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88641,10 +92964,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the functions for a web site, or a deployment slot. + /// Gets all scale-out instances of an app. /// /// - /// Description for List the functions for a web site, or a deployment slot. + /// Description for Gets all scale-out instances of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -88670,7 +92993,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceFunctionsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceIdentifiersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88685,7 +93008,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceFunctionsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceIdentifiersSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88749,7 +93072,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -88779,7 +93102,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88792,7 +93115,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88812,10 +93135,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Get hostname bindings for an app or a deployment slot. + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. /// /// - /// Description for Get hostname bindings for an app or a deployment slot. + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -88841,7 +93166,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListHostNameBindingsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -88856,7 +93181,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListHostNameBindingsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -88920,7 +93245,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -88950,7 +93275,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -88963,7 +93288,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -88983,183 +93308,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets all scale-out instances of an app. + /// List module information for a process by its ID for a specific scaled-out + /// instance in a web site. /// /// - /// Description for Gets all scale-out instances of an app. - /// - /// - /// 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>> ListInstanceIdentifiersSlotNextWithHttpMessagesAsync(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, "ListInstanceIdentifiersSlotNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.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 = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get list of processes for a web site, or a deployment slot, or for a + /// Description for List module information for a process by its ID for a /// specific scaled-out instance in a web site. - /// - /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -89185,7 +93339,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessModulesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89200,7 +93354,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessesSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89294,7 +93448,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89307,7 +93461,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89327,12 +93481,12 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List module information for a process by its ID for a specific scaled-out - /// instance in a web site. + /// List the threads in a process by its ID for a specific scaled-out instance + /// in a web site. /// /// - /// Description for List module information for a process by its ID for a - /// specific scaled-out instance in a web site. + /// Description for List the threads in a process by its ID for a specific + /// scaled-out instance in a web site. /// /// /// The NextLink from the previous successful call to List operation. @@ -89358,7 +93512,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessModulesSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInstanceProcessThreadsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89373,7 +93527,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessModulesSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89467,7 +93621,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89480,7 +93634,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89500,12 +93654,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// List the threads in a process by its ID for a specific scaled-out instance - /// in a web site. + /// Gets existing backups of an app. /// /// - /// Description for List the threads in a process by its ID for a specific - /// scaled-out instance in a web site. + /// Description for Gets existing backups of an app. /// /// /// The NextLink from the previous successful call to List operation. @@ -89531,7 +93683,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInstanceProcessThreadsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSiteBackupsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89546,7 +93698,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInstanceProcessThreadsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89559,7 +93711,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -89610,7 +93762,7 @@ internal WebAppsOperations(WebSiteManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -89640,7 +93792,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89653,7 +93805,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89673,10 +93825,10 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets existing backups of an app. + /// Gets perfmon counters for web app. /// /// - /// Description for Gets existing backups of an app. + /// Description for Gets perfmon counters for web app. /// /// /// The NextLink from the previous successful call to List operation. @@ -89702,7 +93854,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSiteBackupsSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPerfMonCountersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89717,7 +93869,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSiteBackupsSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89730,7 +93882,7 @@ internal WebAppsOperations(WebSiteManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -89811,7 +93963,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89824,7 +93976,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -89844,10 +93996,11 @@ internal WebAppsOperations(WebSiteManagementClient client) } /// - /// Gets perfmon counters for web app. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Gets perfmon counters for web app. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// The NextLink from the previous successful call to List operation. @@ -89873,7 +94026,7 @@ internal WebAppsOperations(WebSiteManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPerfMonCountersSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetPrivateEndpointConnectionListSlotNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -89888,7 +94041,7 @@ internal WebAppsOperations(WebSiteManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPerfMonCountersSlotNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnectionListSlotNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -89982,7 +94135,7 @@ internal WebAppsOperations(WebSiteManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -89995,7 +94148,7 @@ internal WebAppsOperations(WebSiteManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperationsExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperationsExtensions.cs index b268e898aef2..b40763b12bb1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperationsExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebAppsOperationsExtensions.cs @@ -1603,6 +1603,200 @@ public static BackupRequest GetBackupConfiguration(this IWebAppsOperations opera } } + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + public static IPage GetAppSettingsKeyVaultReferences(this IWebAppsOperations operations, string resourceGroupName, string name) + { + return operations.GetAppSettingsKeyVaultReferencesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// The cancellation token. + /// + public static async Task> GetAppSettingsKeyVaultReferencesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAppSettingsKeyVaultReferencesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// App Setting key name. + /// + public static ApiKVReference GetAppSettingKeyVaultReference(this IWebAppsOperations operations, string resourceGroupName, string name, string appSettingKey) + { + return operations.GetAppSettingKeyVaultReferenceAsync(resourceGroupName, name, appSettingKey).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// App Setting key name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAppSettingKeyVaultReferenceAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string appSettingKey, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAppSettingKeyVaultReferenceWithHttpMessagesAsync(resourceGroupName, name, appSettingKey, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + public static IPage GetSiteConnectionStringKeyVaultReferences(this IWebAppsOperations operations, string resourceGroupName, string name) + { + return operations.GetSiteConnectionStringKeyVaultReferencesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// The cancellation token. + /// + public static async Task> GetSiteConnectionStringKeyVaultReferencesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSiteConnectionStringKeyVaultReferencesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + public static ApiKVReference GetSiteConnectionStringKeyVaultReference(this IWebAppsOperations operations, string resourceGroupName, string name, string connectionStringKey) + { + return operations.GetSiteConnectionStringKeyVaultReferenceAsync(resourceGroupName, name, connectionStringKey).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference and status of an app + /// + /// + /// Description for Gets the config reference and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetSiteConnectionStringKeyVaultReferenceAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string connectionStringKey, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSiteConnectionStringKeyVaultReferenceWithHttpMessagesAsync(resourceGroupName, name, connectionStringKey, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Replaces the connection strings of an app. /// @@ -6130,9 +6324,9 @@ public static SwiftVirtualNetwork GetSwiftVirtualNetworkConnection(this IWebApps /// /// Properties of the Virtual Network connection. See example. /// - public static SwiftVirtualNetwork CreateOrUpdateSwiftVirtualNetworkConnection(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope) + public static SwiftVirtualNetwork CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope) { - return operations.CreateOrUpdateSwiftVirtualNetworkConnectionAsync(resourceGroupName, name, connectionEnvelope).GetAwaiter().GetResult(); + return operations.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckAsync(resourceGroupName, name, connectionEnvelope).GetAwaiter().GetResult(); } /// @@ -6163,9 +6357,9 @@ public static SwiftVirtualNetwork CreateOrUpdateSwiftVirtualNetworkConnection(th /// /// The cancellation token. /// - public static async Task CreateOrUpdateSwiftVirtualNetworkConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -6218,72 +6412,6 @@ public static void DeleteSwiftVirtualNetwork(this IWebAppsOperations operations, (await operations.DeleteSwiftVirtualNetworkWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - public static SwiftVirtualNetwork UpdateSwiftVirtualNetworkConnection(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope) - { - return operations.UpdateSwiftVirtualNetworkConnectionAsync(resourceGroupName, name, connectionEnvelope).GetAwaiter().GetResult(); - } - - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateSwiftVirtualNetworkConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateSwiftVirtualNetworkConnectionWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all network features used by the app (or deployment slot, if /// specified). @@ -6302,7 +6430,7 @@ public static SwiftVirtualNetwork UpdateSwiftVirtualNetworkConnection(this IWebA /// Name of the app. /// /// - /// The type of view. This can either be "summary" or "detailed". + /// The type of view. Only "summary" is supported at this time. /// public static NetworkFeatures ListNetworkFeatures(this IWebAppsOperations operations, string resourceGroupName, string name, string view) { @@ -6327,7 +6455,7 @@ public static NetworkFeatures ListNetworkFeatures(this IWebAppsOperations operat /// Name of the app. /// /// - /// The type of view. This can either be "summary" or "detailed". + /// The type of view. Only "summary" is supported at this time. /// /// /// The cancellation token. @@ -7258,12 +7386,11 @@ public static PrivateAccess PutPrivateAccessVnet(this IWebAppsOperations operati } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// The operations group for this extension method. @@ -7272,20 +7399,19 @@ public static PrivateAccess PutPrivateAccessVnet(this IWebAppsOperations operati /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. /// - public static IPage ListProcesses(this IWebAppsOperations operations, string resourceGroupName, string name) + public static IPage GetPrivateEndpointConnectionList(this IWebAppsOperations operations, string resourceGroupName, string name) { - return operations.ListProcessesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.GetPrivateEndpointConnectionListAsync(resourceGroupName, name).GetAwaiter().GetResult(); } /// - /// Get list of processes for a web site, or a deployment slot, or for a - /// specific scaled-out instance in a web site. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Get list of processes for a web site, or a deployment slot, - /// or for a specific scaled-out instance in a web site. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// The operations group for this extension method. @@ -7294,26 +7420,24 @@ public static IPage ListProcesses(this IWebAppsOperations operation /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. /// /// /// The cancellation token. /// - public static async Task> ListProcessesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetPrivateEndpointConnectionListAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListProcessesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPrivateEndpointConnectionListWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Gets a private endpoint connection /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Gets a private endpoint connection /// /// /// The operations group for this extension method. @@ -7322,23 +7446,21 @@ public static IPage ListProcesses(this IWebAppsOperations operation /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. /// - /// - /// PID. + /// + /// Name of the private endpoint connection. /// - public static ProcessInfo GetProcess(this IWebAppsOperations operations, string resourceGroupName, string name, string processId) + public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) { - return operations.GetProcessAsync(resourceGroupName, name, processId).GetAwaiter().GetResult(); + return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); } /// - /// Get process information by its ID for a specific scaled-out instance in a - /// web site. + /// Gets a private endpoint connection /// /// - /// Description for Get process information by its ID for a specific scaled-out - /// instance in a web site. + /// Description for Gets a private endpoint connection /// /// /// The operations group for this extension method. @@ -7347,7 +7469,263 @@ public static ProcessInfo GetProcess(this IWebAppsOperations operations, string /// Name of the resource group to which the resource belongs. /// /// - /// Site name. + /// Name of the site. + /// + /// + /// Name of the private endpoint connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + return operations.ApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ApproveOrRejectPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + public static object DeletePrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task DeletePrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IWebAppsOperations operations, string resourceGroupName, string name) + { + return operations.GetPrivateLinkResourcesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link resources + /// + /// + /// Description for Gets the private link resources + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateLinkResourcesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. + /// + /// + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + public static IPage ListProcesses(this IWebAppsOperations operations, string resourceGroupName, string name) + { + return operations.ListProcessesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + } + + /// + /// Get list of processes for a web site, or a deployment slot, or for a + /// specific scaled-out instance in a web site. + /// + /// + /// Description for Get list of processes for a web site, or a deployment slot, + /// or for a specific scaled-out instance in a web site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListProcessesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListProcessesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. + /// + /// + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. + /// + /// + /// PID. + /// + public static ProcessInfo GetProcess(this IWebAppsOperations operations, string resourceGroupName, string name, string processId) + { + return operations.GetProcessAsync(resourceGroupName, name, processId).GetAwaiter().GetResult(); + } + + /// + /// Get process information by its ID for a specific scaled-out instance in a + /// web site. + /// + /// + /// Description for Get process information by its ID for a specific scaled-out + /// instance in a web site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Site name. /// /// /// PID. @@ -8374,63 +8752,10 @@ public static void DeleteSiteExtension(this IWebAppsOperations operations, strin } /// - /// Copies a deployment slot to another deployment slot of an app. + /// Gets an app's deployment slots. /// /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - public static void CopyProductionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity) - { - operations.CopyProductionSlotAsync(resourceGroupName, name, copySlotEntity).GetAwaiter().GetResult(); - } - - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// The cancellation token. - /// - public static async Task CopyProductionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CopyProductionSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets an app's deployment slots. - /// - /// - /// Description for Gets an app's deployment slots. + /// Description for Gets an app's deployment slots. /// /// /// The operations group for this extension method. @@ -8616,9 +8941,8 @@ public static Site CreateOrUpdateSlot(this IWebAppsOperations operations, string /// If true, web app metrics are also deleted. /// /// - /// Specify true if the App Service plan will be empty after app deletion and - /// you want to delete the empty App Service plan. By default, the empty App - /// Service plan is not deleted. + /// Specify false if you want to keep empty App Service plan. By default, empty + /// App Service plan is deleted. /// public static void DeleteSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, bool? deleteMetrics = default(bool?), bool? deleteEmptyServerFarm = default(bool?)) { @@ -8649,9 +8973,8 @@ public static Site CreateOrUpdateSlot(this IWebAppsOperations operations, string /// If true, web app metrics are also deleted. /// /// - /// Specify true if the App Service plan will be empty after app deletion and - /// you want to delete the empty App Service plan. By default, the empty App - /// Service plan is not deleted. + /// Specify false if you want to keep empty App Service plan. By default, empty + /// App Service plan is deleted. /// /// /// The cancellation token. @@ -9226,6 +9549,272 @@ public static void RestoreSlot(this IWebAppsOperations operations, string resour (await operations.RestoreSlotWithHttpMessagesAsync(resourceGroupName, name, backupId, request, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + /// given site. + /// + /// + /// Description for Returns whether Scm basic auth is allowed and whether Ftp + /// is allowed for a given site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + public static CsmPublishingCredentialsPoliciesCollection GetBasicPublishingCredentialsPoliciesSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + { + return operations.GetBasicPublishingCredentialsPoliciesSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + /// given site. + /// + /// + /// Description for Returns whether Scm basic auth is allowed and whether Ftp + /// is allowed for a given site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetBasicPublishingCredentialsPoliciesSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetBasicPublishingCredentialsPoliciesSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns whether FTP is allowed on the site or not. + /// + /// + /// Description for Returns whether FTP is allowed on the site or not. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + public static CsmPublishingCredentialsPoliciesEntity GetFtpAllowedSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + { + return operations.GetFtpAllowedSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Returns whether FTP is allowed on the site or not. + /// + /// + /// Description for Returns whether FTP is allowed on the site or not. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetFtpAllowedSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetFtpAllowedSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates whether FTP is allowed on the site or not. + /// + /// + /// Description for Updates whether FTP is allowed on the site or not. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// + public static CsmPublishingCredentialsPoliciesEntity UpdateFtpAllowedSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot) + { + return operations.UpdateFtpAllowedSlotAsync(resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot).GetAwaiter().GetResult(); + } + + /// + /// Updates whether FTP is allowed on the site or not. + /// + /// + /// Description for Updates whether FTP is allowed on the site or not. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task UpdateFtpAllowedSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateFtpAllowedSlotWithHttpMessagesAsync(resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns whether Scm basic auth is allowed on the site or not. + /// + /// + /// Description for Returns whether Scm basic auth is allowed on the site or + /// not. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + public static CsmPublishingCredentialsPoliciesEntity GetScmAllowedSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + { + return operations.GetScmAllowedSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Returns whether Scm basic auth is allowed on the site or not. + /// + /// + /// Description for Returns whether Scm basic auth is allowed on the site or + /// not. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetScmAllowedSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetScmAllowedSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates whether user publishing credentials are allowed on the site or not. + /// + /// + /// Description for Updates whether user publishing credentials are allowed on + /// the site or not. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// + public static CsmPublishingCredentialsPoliciesEntity UpdateScmAllowedSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot) + { + return operations.UpdateScmAllowedSlotAsync(resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot).GetAwaiter().GetResult(); + } + + /// + /// Updates whether user publishing credentials are allowed on the site or not. + /// + /// + /// Description for Updates whether user publishing credentials are allowed on + /// the site or not. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task UpdateScmAllowedSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmPublishingCredentialsPoliciesEntity csmPublishingAccessPoliciesEntity, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateScmAllowedSlotWithHttpMessagesAsync(resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// List the configurations of an app /// @@ -9695,10 +10284,229 @@ public static AzureStoragePropertyDictionaryResource UpdateAzureStorageAccountsS } /// - /// Gets the Azure storage account configurations of an app. + /// Gets the Azure storage account configurations of an app. + /// + /// + /// Description for Gets the Azure storage account configurations of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. + /// + public static AzureStoragePropertyDictionaryResource ListAzureStorageAccountsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + { + return operations.ListAzureStorageAccountsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Gets the Azure storage account configurations of an app. + /// + /// + /// Description for Gets the Azure storage account configurations of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the Azure storage account configurations for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task ListAzureStorageAccountsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAzureStorageAccountsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates the backup configuration of an app. + /// + /// + /// Description for Updates the backup configuration of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Edited backup configuration. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the backup configuration for the production slot. + /// + public static BackupRequest UpdateBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, BackupRequest request, string slot) + { + return operations.UpdateBackupConfigurationSlotAsync(resourceGroupName, name, request, slot).GetAwaiter().GetResult(); + } + + /// + /// Updates the backup configuration of an app. + /// + /// + /// Description for Updates the backup configuration of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Edited backup configuration. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// update the backup configuration for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, BackupRequest request, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, request, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the backup configuration of an app. + /// + /// + /// Description for Deletes the backup configuration of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the backup configuration for the production slot. + /// + public static void DeleteBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + { + operations.DeleteBackupConfigurationSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Deletes the backup configuration of an app. + /// + /// + /// Description for Deletes the backup configuration of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will + /// delete the backup configuration for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the backup configuration of an app. + /// + /// + /// Description for Gets the backup configuration of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the backup configuration for the production slot. + /// + public static BackupRequest GetBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + { + return operations.GetBackupConfigurationSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + } + + /// + /// Gets the backup configuration of an app. + /// + /// + /// Description for Gets the backup configuration of an app. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the app. + /// + /// + /// Name of the deployment slot. If a slot is not specified, the API will get + /// the backup configuration for the production slot. + /// + /// + /// The cancellation token. + /// + public static async Task GetBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the config reference app settings and status of an app /// /// - /// Description for Gets the Azure storage account configurations of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// The operations group for this extension method. @@ -9710,19 +10518,17 @@ public static AzureStoragePropertyDictionaryResource UpdateAzureStorageAccountsS /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. /// - public static AzureStoragePropertyDictionaryResource ListAzureStorageAccountsSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static IPage GetAppSettingsKeyVaultReferencesSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.ListAzureStorageAccountsSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.GetAppSettingsKeyVaultReferencesSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Gets the Azure storage account configurations of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Gets the Azure storage account configurations of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// The operations group for this extension method. @@ -9734,25 +10540,23 @@ public static AzureStoragePropertyDictionaryResource ListAzureStorageAccountsSlo /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the Azure storage account configurations for the production slot. /// /// /// The cancellation token. /// - public static async Task ListAzureStorageAccountsSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetAppSettingsKeyVaultReferencesSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAzureStorageAccountsSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetAppSettingsKeyVaultReferencesSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Updates the backup configuration of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Updates the backup configuration of an app. + /// Description for Gets the config reference and status of an app /// /// /// The operations group for this extension method. @@ -9763,23 +10567,21 @@ public static AzureStoragePropertyDictionaryResource ListAzureStorageAccountsSlo /// /// Name of the app. /// - /// - /// Edited backup configuration. + /// + /// App Setting key name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the backup configuration for the production slot. /// - public static BackupRequest UpdateBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, BackupRequest request, string slot) + public static ApiKVReference GetAppSettingKeyVaultReferenceSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string appSettingKey, string slot) { - return operations.UpdateBackupConfigurationSlotAsync(resourceGroupName, name, request, slot).GetAwaiter().GetResult(); + return operations.GetAppSettingKeyVaultReferenceSlotAsync(resourceGroupName, name, appSettingKey, slot).GetAwaiter().GetResult(); } /// - /// Updates the backup configuration of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Updates the backup configuration of an app. + /// Description for Gets the config reference and status of an app /// /// /// The operations group for this extension method. @@ -9790,29 +10592,27 @@ public static BackupRequest UpdateBackupConfigurationSlot(this IWebAppsOperation /// /// Name of the app. /// - /// - /// Edited backup configuration. + /// + /// App Setting key name. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// update the backup configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task UpdateBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, BackupRequest request, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAppSettingKeyVaultReferenceSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string appSettingKey, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, request, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetAppSettingKeyVaultReferenceSlotWithHttpMessagesAsync(resourceGroupName, name, appSettingKey, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes the backup configuration of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Deletes the backup configuration of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// The operations group for this extension method. @@ -9824,19 +10624,17 @@ public static BackupRequest UpdateBackupConfigurationSlot(this IWebAppsOperation /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the backup configuration for the production slot. /// - public static void DeleteBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static IPage GetSiteConnectionStringKeyVaultReferencesSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - operations.DeleteBackupConfigurationSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.GetSiteConnectionStringKeyVaultReferencesSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Deletes the backup configuration of an app. + /// Gets the config reference app settings and status of an app /// /// - /// Description for Deletes the backup configuration of an app. + /// Description for Gets the config reference app settings and status of an app /// /// /// The operations group for this extension method. @@ -9848,22 +10646,23 @@ public static void DeleteBackupConfigurationSlot(this IWebAppsOperations operati /// Name of the app. /// /// - /// Name of the deployment slot. If a slot is not specified, the API will - /// delete the backup configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task DeleteBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetSiteConnectionStringKeyVaultReferencesSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.GetSiteConnectionStringKeyVaultReferencesSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets the backup configuration of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Gets the backup configuration of an app. + /// Description for Gets the config reference and status of an app /// /// /// The operations group for this extension method. @@ -9874,20 +10673,20 @@ public static void DeleteBackupConfigurationSlot(this IWebAppsOperations operati /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the backup configuration for the production slot. /// - public static BackupRequest GetBackupConfigurationSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + public static ApiKVReference GetSiteConnectionStringKeyVaultReferenceSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string connectionStringKey, string slot) { - return operations.GetBackupConfigurationSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + return operations.GetSiteConnectionStringKeyVaultReferenceSlotAsync(resourceGroupName, name, connectionStringKey, slot).GetAwaiter().GetResult(); } /// - /// Gets the backup configuration of an app. + /// Gets the config reference and status of an app /// /// - /// Description for Gets the backup configuration of an app. + /// Description for Gets the config reference and status of an app /// /// /// The operations group for this extension method. @@ -9898,16 +10697,16 @@ public static BackupRequest GetBackupConfigurationSlot(this IWebAppsOperations o /// /// Name of the app. /// + /// + /// /// - /// Name of the deployment slot. If a slot is not specified, the API will get - /// the backup configuration for the production slot. /// /// /// The cancellation token. /// - public static async Task GetBackupConfigurationSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetSiteConnectionStringKeyVaultReferenceSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string connectionStringKey, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetBackupConfigurationSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetSiteConnectionStringKeyVaultReferenceSlotWithHttpMessagesAsync(resourceGroupName, name, connectionStringKey, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -14805,80 +15604,6 @@ public static SwiftVirtualNetwork GetSwiftVirtualNetworkConnectionSlot(this IWeb } } - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. - /// - public static SwiftVirtualNetwork CreateOrUpdateSwiftVirtualNetworkConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot) - { - return operations.CreateOrUpdateSwiftVirtualNetworkConnectionSlotAsync(resourceGroupName, name, connectionEnvelope, slot).GetAwaiter().GetResult(); - } - - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateSwiftVirtualNetworkConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Deletes a Swift Virtual Network connection from an app (or deployment /// slot). @@ -14934,80 +15659,6 @@ public static void DeleteSwiftVirtualNetworkSlot(this IWebAppsOperations operati (await operations.DeleteSwiftVirtualNetworkSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. - /// - public static SwiftVirtualNetwork UpdateSwiftVirtualNetworkConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot) - { - return operations.UpdateSwiftVirtualNetworkConnectionSlotAsync(resourceGroupName, name, connectionEnvelope, slot).GetAwaiter().GetResult(); - } - - /// - /// Integrates this Web App with a Virtual Network. This requires that 1) - /// "swiftSupported" is true when doing a GET against this resource, and 2) - /// that the target Subnet has already been delegated, and is not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// Description for Integrates this Web App with a Virtual Network. This - /// requires that 1) "swiftSupported" is true when doing a GET against this - /// resource, and 2) that the target Subnet has already been delegated, and is - /// not - /// in use by another App Service Plan other than the one this App is in. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// Properties of the Virtual Network connection. See example. - /// - /// - /// Name of the deployment slot. If a slot is not specified, the API will add - /// or update connections for the production slot. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateSwiftVirtualNetworkConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, SwiftVirtualNetwork connectionEnvelope, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateSwiftVirtualNetworkConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, connectionEnvelope, slot, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all network features used by the app (or deployment slot, if /// specified). @@ -15026,7 +15677,7 @@ public static SwiftVirtualNetwork UpdateSwiftVirtualNetworkConnectionSlot(this I /// Name of the app. /// /// - /// The type of view. This can either be "summary" or "detailed". + /// The type of view. Only "summary" is supported at this time. /// /// /// Name of the deployment slot. If a slot is not specified, the API will get @@ -15055,7 +15706,7 @@ public static NetworkFeatures ListNetworkFeaturesSlot(this IWebAppsOperations op /// Name of the app. /// /// - /// The type of view. This can either be "summary" or "detailed". + /// The type of view. Only "summary" is supported at this time. /// /// /// Name of the deployment slot. If a slot is not specified, the API will get @@ -16027,7 +16678,66 @@ public static PrivateAccess GetPrivateAccessSlot(this IWebAppsOperations operati /// Networks that can access the site. /// /// - /// Description for Gets data around private site access enablement and + /// Description for Gets data around private site access enablement and + /// authorized Virtual Networks that can access the site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. + /// + /// + /// The name of the slot for the web app. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateAccessSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateAccessSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Sets data around private site access enablement and authorized Virtual + /// Networks that can access the site. + /// + /// + /// Description for Sets data around private site access enablement and + /// authorized Virtual Networks that can access the site. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// The name of the web app. + /// + /// + /// The information for the private access + /// + /// + /// The name of the slot for the web app. + /// + public static PrivateAccess PutPrivateAccessVnetSlot(this IWebAppsOperations operations, string resourceGroupName, string name, PrivateAccess access, string slot) + { + return operations.PutPrivateAccessVnetSlotAsync(resourceGroupName, name, access, slot).GetAwaiter().GetResult(); + } + + /// + /// Sets data around private site access enablement and authorized Virtual + /// Networks that can access the site. + /// + /// + /// Description for Sets data around private site access enablement and /// authorized Virtual Networks that can access the site. /// /// @@ -16039,27 +16749,29 @@ public static PrivateAccess GetPrivateAccessSlot(this IWebAppsOperations operati /// /// The name of the web app. /// + /// + /// The information for the private access + /// /// /// The name of the slot for the web app. /// /// /// The cancellation token. /// - public static async Task GetPrivateAccessSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task PutPrivateAccessVnetSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, PrivateAccess access, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPrivateAccessSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.PutPrivateAccessVnetSlotWithHttpMessagesAsync(resourceGroupName, name, access, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Sets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Sets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// The operations group for this extension method. @@ -16068,26 +16780,22 @@ public static PrivateAccess GetPrivateAccessSlot(this IWebAppsOperations operati /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The information for the private access + /// Name of the site. /// /// - /// The name of the slot for the web app. + /// Name of the site deployment slot. /// - public static PrivateAccess PutPrivateAccessVnetSlot(this IWebAppsOperations operations, string resourceGroupName, string name, PrivateAccess access, string slot) + public static IPage GetPrivateEndpointConnectionListSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.PutPrivateAccessVnetSlotAsync(resourceGroupName, name, access, slot).GetAwaiter().GetResult(); + return operations.GetPrivateEndpointConnectionListSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// - /// Sets data around private site access enablement and authorized Virtual - /// Networks that can access the site. + /// Gets the list of private endpoint connections associated with a site /// /// - /// Description for Sets data around private site access enablement and - /// authorized Virtual Networks that can access the site. + /// Description for Gets the list of private endpoint connections associated + /// with a site /// /// /// The operations group for this extension method. @@ -16096,20 +16804,17 @@ public static PrivateAccess PutPrivateAccessVnetSlot(this IWebAppsOperations ope /// Name of the resource group to which the resource belongs. /// /// - /// The name of the web app. - /// - /// - /// The information for the private access + /// Name of the site. /// /// - /// The name of the slot for the web app. + /// Name of the site deployment slot. /// /// /// The cancellation token. /// - public static async Task PutPrivateAccessVnetSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, PrivateAccess access, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetPrivateEndpointConnectionListSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.PutPrivateAccessVnetSlotWithHttpMessagesAsync(resourceGroupName, name, access, slot, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPrivateEndpointConnectionListSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -16131,10 +16836,14 @@ public static PrivateAccess PutPrivateAccessVnetSlot(this IWebAppsOperations ope /// Name of the site. /// /// + /// Name of the private endpoint connection. + /// + /// + /// Name of the site deployment slot. /// - public static PrivateEndpointConnectionResource GetPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + public static RemotePrivateEndpointConnectionARMResource GetPrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot) { - return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + return operations.GetPrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, slot).GetAwaiter().GetResult(); } /// @@ -16153,13 +16862,17 @@ public static PrivateEndpointConnectionResource GetPrivateEndpointConnection(thi /// Name of the site. /// /// + /// Name of the private endpoint connection. + /// + /// + /// Name of the site deployment slot. /// /// /// The cancellation token. /// - public static async Task GetPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetPrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -16184,9 +16897,11 @@ public static PrivateEndpointConnectionResource GetPrivateEndpointConnection(thi /// /// /// - public static PrivateEndpointConnectionResource ApproveOrRejectPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + /// + /// + public static RemotePrivateEndpointConnectionARMResource ApproveOrRejectPrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot) { - return operations.ApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + return operations.ApproveOrRejectPrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot).GetAwaiter().GetResult(); } /// @@ -16208,12 +16923,14 @@ public static PrivateEndpointConnectionResource ApproveOrRejectPrivateEndpointCo /// /// /// + /// + /// /// /// The cancellation token. /// - public static async Task ApproveOrRejectPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ApproveOrRejectPrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -16236,9 +16953,11 @@ public static PrivateEndpointConnectionResource ApproveOrRejectPrivateEndpointCo /// /// /// - public static object DeletePrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + /// + /// + public static object DeletePrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot) { - return operations.DeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + return operations.DeletePrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, slot).GetAwaiter().GetResult(); } /// @@ -16258,12 +16977,14 @@ public static object DeletePrivateEndpointConnection(this IWebAppsOperations ope /// /// /// + /// + /// /// /// The cancellation token. /// - public static async Task DeletePrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeletePrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -16284,9 +17005,11 @@ public static object DeletePrivateEndpointConnection(this IWebAppsOperations ope /// /// Name of the site. /// - public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IWebAppsOperations operations, string resourceGroupName, string name) + /// + /// + public static PrivateLinkResourcesWrapper GetPrivateLinkResourcesSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) { - return operations.GetPrivateLinkResourcesAsync(resourceGroupName, name).GetAwaiter().GetResult(); + return operations.GetPrivateLinkResourcesSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); } /// @@ -16304,12 +17027,14 @@ public static PrivateLinkResourcesWrapper GetPrivateLinkResources(this IWebAppsO /// /// Name of the site. /// + /// + /// /// /// The cancellation token. /// - public static async Task GetPrivateLinkResourcesAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetPrivateLinkResourcesSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPrivateLinkResourcesSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -17599,67 +18324,6 @@ public static void DeleteSiteExtensionSlot(this IWebAppsOperations operations, s (await operations.DeleteSiteExtensionSlotWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - public static void CopySlotSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot) - { - operations.CopySlotSlotAsync(resourceGroupName, name, copySlotEntity, slot).GetAwaiter().GetResult(); - } - - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - /// - /// The cancellation token. - /// - public static async Task CopySlotSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CopySlotSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// Get the difference in configuration settings between two web app slots. /// @@ -18018,9 +18682,11 @@ public static SiteSourceControl CreateOrUpdateSourceControlSlot(this IWebAppsOpe /// Name of the deployment slot. If a slot is not specified, the API will /// delete the source control configuration for the production slot. /// - public static void DeleteSourceControlSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot) + /// + /// + public static void DeleteSourceControlSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, string additionalFlags = default(string)) { - operations.DeleteSourceControlSlotAsync(resourceGroupName, name, slot).GetAwaiter().GetResult(); + operations.DeleteSourceControlSlotAsync(resourceGroupName, name, slot, additionalFlags).GetAwaiter().GetResult(); } /// @@ -18042,12 +18708,14 @@ public static void DeleteSourceControlSlot(this IWebAppsOperations operations, s /// Name of the deployment slot. If a slot is not specified, the API will /// delete the source control configuration for the production slot. /// + /// + /// /// /// The cancellation token. /// - public static async Task DeleteSourceControlSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteSourceControlSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string slot, string additionalFlags = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteSourceControlSlotWithHttpMessagesAsync(resourceGroupName, name, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteSourceControlSlotWithHttpMessagesAsync(resourceGroupName, name, slot, additionalFlags, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -19824,9 +20492,11 @@ public static SiteSourceControl CreateOrUpdateSourceControl(this IWebAppsOperati /// /// Name of the app. /// - public static void DeleteSourceControl(this IWebAppsOperations operations, string resourceGroupName, string name) + /// + /// + public static void DeleteSourceControl(this IWebAppsOperations operations, string resourceGroupName, string name, string additionalFlags = default(string)) { - operations.DeleteSourceControlAsync(resourceGroupName, name).GetAwaiter().GetResult(); + operations.DeleteSourceControlAsync(resourceGroupName, name, additionalFlags).GetAwaiter().GetResult(); } /// @@ -19844,12 +20514,14 @@ public static void DeleteSourceControl(this IWebAppsOperations operations, strin /// /// Name of the app. /// + /// + /// /// /// The cancellation token. /// - public static async Task DeleteSourceControlAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteSourceControlAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string additionalFlags = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteSourceControlWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteSourceControlWithHttpMessagesAsync(resourceGroupName, name, additionalFlags, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -21637,6 +22309,110 @@ public static Operation BeginMigrateMySql(this IWebAppsOperations operations, st } } + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + { + return operations.BeginApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + } + + /// + /// Approves or rejects a private endpoint connection + /// + /// + /// Description for Approves or rejects a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginApproveOrRejectPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + public static object BeginDeletePrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + { + return operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a private endpoint connection + /// + /// + /// Description for Deletes a private endpoint connection + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group to which the resource belongs. + /// + /// + /// Name of the site. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeletePrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Restores an app from a backup blob in Azure Storage. /// @@ -21833,62 +22609,9 @@ public static SiteExtensionInfo BeginInstallSiteExtension(this IWebAppsOperation public static async Task BeginInstallSiteExtensionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string siteExtensionId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginInstallSiteExtensionWithHttpMessagesAsync(resourceGroupName, name, siteExtensionId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - public static void BeginCopyProductionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity) - { - operations.BeginCopyProductionSlotAsync(resourceGroupName, name, copySlotEntity).GetAwaiter().GetResult(); - } - - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCopyProductionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginCopyProductionSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, null, cancellationToken).ConfigureAwait(false)).Dispose(); + { + return _result.Body; + } } /// @@ -22357,9 +23080,11 @@ public static MSDeployStatus BeginCreateInstanceMSDeployOperationSlot(this IWebA /// /// /// - public static PrivateEndpointConnectionResource BeginApproveOrRejectPrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) + /// + /// + public static RemotePrivateEndpointConnectionARMResource BeginApproveOrRejectPrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot) { - return operations.BeginApproveOrRejectPrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper).GetAwaiter().GetResult(); + return operations.BeginApproveOrRejectPrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot).GetAwaiter().GetResult(); } /// @@ -22381,12 +23106,14 @@ public static PrivateEndpointConnectionResource BeginApproveOrRejectPrivateEndpo /// /// /// + /// + /// /// /// The cancellation token. /// - public static async Task BeginApproveOrRejectPrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginApproveOrRejectPrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginApproveOrRejectPrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -22409,9 +23136,11 @@ public static PrivateEndpointConnectionResource BeginApproveOrRejectPrivateEndpo /// /// /// - public static object BeginDeletePrivateEndpointConnection(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName) + /// + /// + public static object BeginDeletePrivateEndpointConnectionSlot(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot) { - return operations.BeginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName).GetAwaiter().GetResult(); + return operations.BeginDeletePrivateEndpointConnectionSlotAsync(resourceGroupName, name, privateEndpointConnectionName, slot).GetAwaiter().GetResult(); } /// @@ -22431,12 +23160,14 @@ public static object BeginDeletePrivateEndpointConnection(this IWebAppsOperation /// /// /// + /// + /// /// /// The cancellation token. /// - public static async Task BeginDeletePrivateEndpointConnectionAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeletePrivateEndpointConnectionSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, string privateEndpointConnectionName, string slot, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeletePrivateEndpointConnectionSlotWithHttpMessagesAsync(resourceGroupName, name, privateEndpointConnectionName, slot, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -22675,67 +23406,6 @@ public static SiteExtensionInfo BeginInstallSiteExtensionSlot(this IWebAppsOpera } } - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - public static void BeginCopySlotSlot(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot) - { - operations.BeginCopySlotSlotAsync(resourceGroupName, name, copySlotEntity, slot).GetAwaiter().GetResult(); - } - - /// - /// Copies a deployment slot to another deployment slot of an app. - /// - /// - /// Description for Copies a deployment slot to another deployment slot of an - /// app. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the resource group to which the resource belongs. - /// - /// - /// Name of the app. - /// - /// - /// JSON object that contains the target slot name and site config properties - /// to override the source slot config. See example. - /// - /// - /// Name of the source slot. If a slot is not specified, the production slot is - /// used as the source slot. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCopySlotSlotAsync(this IWebAppsOperations operations, string resourceGroupName, string name, CsmCopySlotEntity copySlotEntity, string slot, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginCopySlotSlotWithHttpMessagesAsync(resourceGroupName, name, copySlotEntity, slot, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// Swaps two deployment slots of an app. /// @@ -23250,6 +23920,86 @@ public static IPage ListConfigurationsNext(this IWebAppsOper } } + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetAppSettingsKeyVaultReferencesNext(this IWebAppsOperations operations, string nextPageLink) + { + return operations.GetAppSettingsKeyVaultReferencesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetAppSettingsKeyVaultReferencesNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAppSettingsKeyVaultReferencesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetSiteConnectionStringKeyVaultReferencesNext(this IWebAppsOperations operations, string nextPageLink) + { + return operations.GetSiteConnectionStringKeyVaultReferencesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetSiteConnectionStringKeyVaultReferencesNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSiteConnectionStringKeyVaultReferencesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a list of web app configuration snapshots identifiers. Each element of /// the list contains a timestamp and the ID of the snapshot. @@ -23748,6 +24498,48 @@ public static IPage ListPerfMonCountersNext(this IWebAppsOperat } } + /// + /// Gets the list of private endpoint connections associated with a site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetPrivateEndpointConnectionListNext(this IWebAppsOperations operations, string nextPageLink) + { + return operations.GetPrivateEndpointConnectionListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of private endpoint connections associated with a site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get list of processes for a web site, or a deployment slot, or for a /// specific scaled-out instance in a web site. @@ -24082,6 +24874,86 @@ public static IPage ListConfigurationsSlotNext(this IWebApps } } + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetAppSettingsKeyVaultReferencesSlotNext(this IWebAppsOperations operations, string nextPageLink) + { + return operations.GetAppSettingsKeyVaultReferencesSlotNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetAppSettingsKeyVaultReferencesSlotNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAppSettingsKeyVaultReferencesSlotNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetSiteConnectionStringKeyVaultReferencesSlotNext(this IWebAppsOperations operations, string nextPageLink) + { + return operations.GetSiteConnectionStringKeyVaultReferencesSlotNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the config reference app settings and status of an app + /// + /// + /// Description for Gets the config reference app settings and status of an app + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetSiteConnectionStringKeyVaultReferencesSlotNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSiteConnectionStringKeyVaultReferencesSlotNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a list of web app configuration snapshots identifiers. Each element of /// the list contains a timestamp and the ID of the snapshot. @@ -24580,6 +25452,48 @@ public static IPage ListPerfMonCountersSlotNext(this IWebAppsOp } } + /// + /// Gets the list of private endpoint connections associated with a site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage GetPrivateEndpointConnectionListSlotNext(this IWebAppsOperations operations, string nextPageLink) + { + return operations.GetPrivateEndpointConnectionListSlotNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of private endpoint connections associated with a site + /// + /// + /// Description for Gets the list of private endpoint connections associated + /// with a site + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> GetPrivateEndpointConnectionListSlotNextAsync(this IWebAppsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionListSlotNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get list of processes for a web site, or a deployment slot, or for a /// specific scaled-out instance in a web site. diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs index e13c1b883b34..0ccd5a99dd44 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClient.cs @@ -82,6 +82,11 @@ public partial class WebSiteManagementClient : ServiceClient public virtual IAppServiceCertificateOrdersOperations AppServiceCertificateOrders { get; private set; } + /// + /// Gets the ICertificateOrdersDiagnosticsOperations. + /// + public virtual ICertificateOrdersDiagnosticsOperations CertificateOrdersDiagnostics { get; private set; } + /// /// Gets the ICertificateRegistrationProviderOperations. /// @@ -117,6 +122,11 @@ public partial class WebSiteManagementClient : ServiceClient public virtual IDiagnosticsOperations Diagnostics { get; private set; } + /// + /// Gets the IGlobalModelOperations. + /// + public virtual IGlobalModelOperations GlobalModel { get; private set; } + /// /// Gets the IProviderOperations. /// @@ -394,6 +404,7 @@ public WebSiteManagementClient(System.Uri baseUri, ServiceClientCredentials cred private void Initialize() { AppServiceCertificateOrders = new AppServiceCertificateOrdersOperations(this); + CertificateOrdersDiagnostics = new CertificateOrdersDiagnosticsOperations(this); CertificateRegistrationProvider = new CertificateRegistrationProviderOperations(this); Domains = new DomainsOperations(this); TopLevelDomains = new TopLevelDomainsOperations(this); @@ -401,6 +412,7 @@ private void Initialize() Certificates = new CertificatesOperations(this); DeletedWebApps = new DeletedWebAppsOperations(this); Diagnostics = new DiagnosticsOperations(this); + GlobalModel = new GlobalModelOperations(this); Provider = new ProviderOperations(this); Recommendations = new RecommendationsOperations(this); WebApps = new WebAppsOperations(this); @@ -409,7 +421,7 @@ private void Initialize() AppServicePlans = new AppServicePlansOperations(this); ResourceHealthMetadata = new ResourceHealthMetadataOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-06-01"; + ApiVersion = "2020-12-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -443,6 +455,204 @@ private void Initialize() DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } + /// + /// Exchange code for GitHub access token for AppService CLI + /// + /// + /// Description for Exchange code for GitHub access token for AppService CLI + /// + /// + /// Code string to exchange for Github Access token + /// + /// + /// State string used for verification. + /// + /// + /// 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> GenerateGithubAccessTokenForAppserviceCLIAsyncWithHttpMessagesAsync(string code, string state, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (code == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "code"); + } + if (state == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "state"); + } + AppserviceGithubTokenRequest request = new AppserviceGithubTokenRequest(); + if (code != null || state != null) + { + request.Code = code; + request.State = state; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GenerateGithubAccessTokenForAppserviceCLIAsync", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Web/generateGithubAccessTokenForAppserviceCLI").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("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(request != null) + { + _requestContent = SafeJsonConvert.SerializeObject(request, 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 DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + DefaultErrorResponse _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 publishing user /// @@ -1935,7 +2145,8 @@ private void Initialize() /// /// Name of SKU used to filter the regions. Possible values include: 'Free', /// 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', - /// 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' + /// 'IsolatedV2', 'PremiumV2', 'PremiumV3', 'PremiumContainer', + /// 'ElasticPremium', 'ElasticIsolated' /// /// /// Specify <code>true</code> if you want to filter to only regions diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClientExtensions.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClientExtensions.cs index ef734c7a7f7b..653d2cddfeee 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClientExtensions.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/WebSiteManagementClientExtensions.cs @@ -21,6 +21,52 @@ namespace Microsoft.Azure.Management.WebSites /// public static partial class WebSiteManagementClientExtensions { + /// + /// Exchange code for GitHub access token for AppService CLI + /// + /// + /// Description for Exchange code for GitHub access token for AppService CLI + /// + /// + /// The operations group for this extension method. + /// + /// + /// Code string to exchange for Github Access token + /// + /// + /// State string used for verification. + /// + public static AppserviceGithubToken GenerateGithubAccessTokenForAppserviceCLIAsync(this IWebSiteManagementClient operations, string code, string state) + { + return operations.GenerateGithubAccessTokenForAppserviceCLIAsyncAsync(code, state).GetAwaiter().GetResult(); + } + + /// + /// Exchange code for GitHub access token for AppService CLI + /// + /// + /// Description for Exchange code for GitHub access token for AppService CLI + /// + /// + /// The operations group for this extension method. + /// + /// + /// Code string to exchange for Github Access token + /// + /// + /// State string used for verification. + /// + /// + /// The cancellation token. + /// + public static async Task GenerateGithubAccessTokenForAppserviceCLIAsyncAsync(this IWebSiteManagementClient operations, string code, string state, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GenerateGithubAccessTokenForAppserviceCLIAsyncWithHttpMessagesAsync(code, state, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets publishing user /// @@ -365,7 +411,8 @@ public static DeploymentLocations GetSubscriptionDeploymentLocations(this IWebSi /// /// Name of SKU used to filter the regions. Possible values include: 'Free', /// 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', - /// 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' + /// 'IsolatedV2', 'PremiumV2', 'PremiumV3', 'PremiumContainer', + /// 'ElasticPremium', 'ElasticIsolated' /// /// /// Specify <code>true</code> if you want to filter to only regions @@ -396,7 +443,8 @@ public static DeploymentLocations GetSubscriptionDeploymentLocations(this IWebSi /// /// Name of SKU used to filter the regions. Possible values include: 'Free', /// 'Shared', 'Basic', 'Standard', 'Premium', 'Dynamic', 'Isolated', - /// 'PremiumV2', 'ElasticPremium', 'ElasticIsolated' + /// 'IsolatedV2', 'PremiumV2', 'PremiumV3', 'PremiumContainer', + /// 'ElasticPremium', 'ElasticIsolated' /// /// /// Specify <code>true</code> if you want to filter to only regions diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj index 6746aec79a70..74a26a599397 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Microsoft.Azure.Management.Websites.csproj @@ -7,9 +7,9 @@ Microsoft.Azure.Management.Websites Provides website management capabilities for Microsoft Azure. Microsoft.Azure.Management.Websites - 3.1.0 + 3.1.1 Microsoft Azure website management;website management; - + $(SdkTargetFx) diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Properties/AssemblyInfo.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Properties/AssemblyInfo.cs index e9afa0cf38a9..b846d2da1a76 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Properties/AssemblyInfo.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Properties/AssemblyInfo.cs @@ -8,8 +8,8 @@ [assembly: AssemblyTitle("Microsoft Azure Web Sites Management Library")] [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Web Sites.")] -[assembly: AssemblyVersion("3.1.0")] -[assembly: AssemblyFileVersion("3.1.0")] +[assembly: AssemblyVersion("3.1.1")] +[assembly: AssemblyFileVersion("3.1.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Azure .NET SDK")] From 08e9baff9bd2e9d6eb856194211f2d39685c7702 Mon Sep 17 00:00:00 2001 From: Kota Sudhakar Reddy <60102891+Kotasudhakarreddy@users.noreply.github.com> Date: Tue, 18 May 2021 08:51:03 +0530 Subject: [PATCH 7/7] Latest changes for apiversion:2020-12 --- .../mgmtmetadata/web_resource-manager.txt | 6 +++--- .../src/Generated/Models/SiteConfig.cs | 21 ++++++++++++++++++- .../Generated/Models/SiteConfigResource.cs | 21 ++++++++++++++++++- .../SdkInfo_WebSiteManagementClient.cs | 4 ++-- 4 files changed, 45 insertions(+), 7 deletions(-) diff --git a/eng/mgmt/mgmtmetadata/web_resource-manager.txt b/eng/mgmt/mgmtmetadata/web_resource-manager.txt index 073cfde26c42..53bc81aeae39 100644 --- a/eng/mgmt/mgmtmetadata/web_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/web_resource-manager.txt @@ -3,13 +3,13 @@ AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=K:\DotNet-SDK\Apr-2021\azure-sdk-for-net\sdk +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-12 --csharp-sdks-folder=K:\DotNet-SDK\Apr-2021\azure-sdk-for-net\sdk Autorest CSharp Version: 2.3.84 -2021-05-10 18:10:58 UTC +2021-05-18 03:16:34 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: f1b7ba2a910b4195e1e2109b7c69852d4af4aa40 +Commit: 03a759c3b3c86cecc1c6030cc5e4d6940437706a AutoRest information Requested version: v2 Bootstrapper version: autorest@2.0.4413 diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs index a32ecd8ec971..58c40d7011d1 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfig.cs @@ -56,6 +56,10 @@ public SiteConfig() /// <code>true</code> if /// HTTP logging is enabled; otherwise, /// <code>false</code>. + /// Flag to use Managed + /// Identity Creds for ACR pull + /// If using user managed + /// identity, the user managed identity ClientId /// HTTP logs directory size /// limit. /// /// Property to allow or block all /// public traffic. - public SiteConfig(int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), bool? vnetRouteAllEnabled = default(bool?), int? vnetPrivatePortsCount = default(int?), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), string keyVaultReferenceIdentity = default(string), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string scmMinTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), int? functionAppScaleLimit = default(int?), string healthCheckPath = default(string), bool? functionsRuntimeScaleMonitoringEnabled = default(bool?), string websiteTimeZone = default(string), int? minimumElasticInstanceCount = default(int?), IDictionary azureStorageAccounts = default(IDictionary), string publicNetworkAccess = default(string)) + public SiteConfig(int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), bool? acrUseManagedIdentityCreds = default(bool?), string acrUserManagedIdentityID = default(string), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), bool? vnetRouteAllEnabled = default(bool?), int? vnetPrivatePortsCount = default(int?), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), string keyVaultReferenceIdentity = default(string), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string scmMinTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), int? functionAppScaleLimit = default(int?), string healthCheckPath = default(string), bool? functionsRuntimeScaleMonitoringEnabled = default(bool?), string websiteTimeZone = default(string), int? minimumElasticInstanceCount = default(int?), IDictionary azureStorageAccounts = default(IDictionary), string publicNetworkAccess = default(string)) { NumberOfWorkers = numberOfWorkers; DefaultDocuments = defaultDocuments; @@ -184,6 +188,8 @@ public SiteConfig() RemoteDebuggingEnabled = remoteDebuggingEnabled; RemoteDebuggingVersion = remoteDebuggingVersion; HttpLoggingEnabled = httpLoggingEnabled; + AcrUseManagedIdentityCreds = acrUseManagedIdentityCreds; + AcrUserManagedIdentityID = acrUserManagedIdentityID; LogsDirectorySizeLimit = logsDirectorySizeLimit; DetailedErrorLoggingEnabled = detailedErrorLoggingEnabled; PublishingUsername = publishingUsername; @@ -333,6 +339,19 @@ public SiteConfig() [JsonProperty(PropertyName = "httpLoggingEnabled")] public bool? HttpLoggingEnabled { get; set; } + /// + /// Gets or sets flag to use Managed Identity Creds for ACR pull + /// + [JsonProperty(PropertyName = "acrUseManagedIdentityCreds")] + public bool? AcrUseManagedIdentityCreds { get; set; } + + /// + /// Gets or sets if using user managed identity, the user managed + /// identity ClientId + /// + [JsonProperty(PropertyName = "acrUserManagedIdentityID")] + public string AcrUserManagedIdentityID { get; set; } + /// /// Gets or sets HTTP logs directory size limit. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs index 5142f2099da2..64431460f147 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/Models/SiteConfigResource.cs @@ -62,6 +62,10 @@ public SiteConfigResource() /// <code>true</code> if /// HTTP logging is enabled; otherwise, /// <code>false</code>. + /// Flag to use Managed + /// Identity Creds for ACR pull + /// If using user managed + /// identity, the user managed identity ClientId /// HTTP logs directory size /// limit. /// /// Property to allow or block all /// public traffic. - public SiteConfigResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), bool? vnetRouteAllEnabled = default(bool?), int? vnetPrivatePortsCount = default(int?), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), string keyVaultReferenceIdentity = default(string), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string scmMinTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), int? functionAppScaleLimit = default(int?), string healthCheckPath = default(string), bool? functionsRuntimeScaleMonitoringEnabled = default(bool?), string websiteTimeZone = default(string), int? minimumElasticInstanceCount = default(int?), IDictionary azureStorageAccounts = default(IDictionary), string publicNetworkAccess = default(string)) + public SiteConfigResource(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), int? numberOfWorkers = default(int?), IList defaultDocuments = default(IList), string netFrameworkVersion = default(string), string phpVersion = default(string), string pythonVersion = default(string), string nodeVersion = default(string), string powerShellVersion = default(string), string linuxFxVersion = default(string), string windowsFxVersion = default(string), bool? requestTracingEnabled = default(bool?), System.DateTime? requestTracingExpirationTime = default(System.DateTime?), bool? remoteDebuggingEnabled = default(bool?), string remoteDebuggingVersion = default(string), bool? httpLoggingEnabled = default(bool?), bool? acrUseManagedIdentityCreds = default(bool?), string acrUserManagedIdentityID = default(string), int? logsDirectorySizeLimit = default(int?), bool? detailedErrorLoggingEnabled = default(bool?), string publishingUsername = default(string), IList appSettings = default(IList), IList connectionStrings = default(IList), SiteMachineKey machineKey = default(SiteMachineKey), IList handlerMappings = default(IList), string documentRoot = default(string), string scmType = default(string), bool? use32BitWorkerProcess = default(bool?), bool? webSocketsEnabled = default(bool?), bool? alwaysOn = default(bool?), string javaVersion = default(string), string javaContainer = default(string), string javaContainerVersion = default(string), string appCommandLine = default(string), ManagedPipelineMode? managedPipelineMode = default(ManagedPipelineMode?), IList virtualApplications = default(IList), SiteLoadBalancing? loadBalancing = default(SiteLoadBalancing?), Experiments experiments = default(Experiments), SiteLimits limits = default(SiteLimits), bool? autoHealEnabled = default(bool?), AutoHealRules autoHealRules = default(AutoHealRules), string tracingOptions = default(string), string vnetName = default(string), bool? vnetRouteAllEnabled = default(bool?), int? vnetPrivatePortsCount = default(int?), CorsSettings cors = default(CorsSettings), PushSettings push = default(PushSettings), ApiDefinitionInfo apiDefinition = default(ApiDefinitionInfo), ApiManagementConfig apiManagementConfig = default(ApiManagementConfig), string autoSwapSlotName = default(string), bool? localMySqlEnabled = default(bool?), int? managedServiceIdentityId = default(int?), int? xManagedServiceIdentityId = default(int?), string keyVaultReferenceIdentity = default(string), IList ipSecurityRestrictions = default(IList), IList scmIpSecurityRestrictions = default(IList), bool? scmIpSecurityRestrictionsUseMain = default(bool?), bool? http20Enabled = default(bool?), string minTlsVersion = default(string), string scmMinTlsVersion = default(string), string ftpsState = default(string), int? preWarmedInstanceCount = default(int?), int? functionAppScaleLimit = default(int?), string healthCheckPath = default(string), bool? functionsRuntimeScaleMonitoringEnabled = default(bool?), string websiteTimeZone = default(string), int? minimumElasticInstanceCount = default(int?), IDictionary azureStorageAccounts = default(IDictionary), string publicNetworkAccess = default(string)) : base(id, name, kind, type) { NumberOfWorkers = numberOfWorkers; @@ -191,6 +195,8 @@ public SiteConfigResource() RemoteDebuggingEnabled = remoteDebuggingEnabled; RemoteDebuggingVersion = remoteDebuggingVersion; HttpLoggingEnabled = httpLoggingEnabled; + AcrUseManagedIdentityCreds = acrUseManagedIdentityCreds; + AcrUserManagedIdentityID = acrUserManagedIdentityID; LogsDirectorySizeLimit = logsDirectorySizeLimit; DetailedErrorLoggingEnabled = detailedErrorLoggingEnabled; PublishingUsername = publishingUsername; @@ -340,6 +346,19 @@ public SiteConfigResource() [JsonProperty(PropertyName = "properties.httpLoggingEnabled")] public bool? HttpLoggingEnabled { get; set; } + /// + /// Gets or sets flag to use Managed Identity Creds for ACR pull + /// + [JsonProperty(PropertyName = "properties.acrUseManagedIdentityCreds")] + public bool? AcrUseManagedIdentityCreds { get; set; } + + /// + /// Gets or sets if using user managed identity, the user managed + /// identity ClientId + /// + [JsonProperty(PropertyName = "properties.acrUserManagedIdentityID")] + public string AcrUserManagedIdentityID { get; set; } + /// /// Gets or sets HTTP logs directory size limit. /// diff --git a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs index 5d3969b7dfbf..e081f8220e4f 100644 --- a/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs +++ b/sdk/websites/Microsoft.Azure.Management.WebSites/src/Generated/SdkInfo_WebSiteManagementClient.cs @@ -59,10 +59,10 @@ public static IEnumerable> ApiInfo_WebSiteManageme // BEGIN: Code Generation Metadata Section public static readonly String AutoRestVersion = "v2"; public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=K:\\DotNet-SDK\\Apr-2021\\azure-sdk-for-net\\sdk"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-12 --csharp-sdks-folder=K:\\DotNet-SDK\\Apr-2021\\azure-sdk-for-net\\sdk"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "f1b7ba2a910b4195e1e2109b7c69852d4af4aa40"; + public static readonly String GithubCommidId = "03a759c3b3c86cecc1c6030cc5e4d6940437706a"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section